From 3596358ea07a128091456bc53d3b969371161ec3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 6 Dec 2022 11:37:45 +0100 Subject: [PATCH 0001/1418] Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap; under COVARIANCE_MEMORY_OPT --- lib_com/options.h | 4 +- lib_enc/ivas_spar_encoder.c | 136 +++++++++++++++++++++++++++++++++++- lib_enc/ivas_spar_md_enc.c | 9 ++- lib_enc/ivas_stat_enc.h | 2 + 4 files changed, 146 insertions(+), 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0ec45254f9..a3cc817f54 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,7 +175,9 @@ #define FIX_GET_DELAY_RETURN /* Issue 223: change return data type in function get_delay() */ #define NTT_REDUC_COMP_POC /* Contribution : Complexity reduction of phase spectrum in stereo downmix*/ -#define FIX_ISM_INACTIVE_BITS /* fix bitbudget distribution in inactive frames in ISM format */ +//#define FIX_ISM_INACTIVE_BITS /* fix bitbudget distribution in inactive frames in ISM format */ + +#define COVARIANCE_MEMORY_OPT /* Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index b08eeb5e4b..0dd5346e84 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -325,6 +325,120 @@ ivas_error ivas_spar_enc( } +#ifdef COVARIANCE_MEMORY_OPT +/*-------------------------------------------------------------------* + * ivas_spar_cov_md_process() + * + * Process call for SPAR covariance and MD encoder + *-------------------------------------------------------------------*/ + +static void ivas_spar_cov_md_process( + Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ + BSTR_ENC_HANDLE hMetaData, + const int16_t nchan_inp, + const int16_t sba_order, + float *ppIn_FR_real[IVAS_SPAR_MAX_CH], + float *ppIn_FR_imag[IVAS_SPAR_MAX_CH], + const int16_t transient_det, + const int16_t dtx_vad ) +{ + int16_t i, j, i_ts, b, table_idx; + float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; + float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; + float cov_real_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; + float cov_dtx_real_buf[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; + ENCODER_CONFIG_HANDLE hEncoderConfig = st_ivas->hEncoderConfig; + SPAR_ENC_HANDLE hSpar = st_ivas->hSpar; + IVAS_QMETADATA_HANDLE hQMetaData = st_ivas->hQMetaData; + + /*-----------------------------------------------------------------------------------------* + * Covariance process + *-----------------------------------------------------------------------------------------*/ + + for ( i = 0; i < nchan_inp; i++ ) + { + for ( j = 0; j < nchan_inp; j++ ) + { + cov_real[i][j] = cov_real_buf[i][j]; + cov_dtx_real[i][j] = cov_dtx_real_buf[i][j]; + } + } + + ivas_enc_cov_handler_process( hSpar->hCovEnc, ppIn_FR_real, ppIn_FR_imag, cov_real, cov_dtx_real, hSpar->hFbMixer->pFb, 0, hSpar->hFbMixer->pFb->filterbank_num_bands, nchan_inp, dtx_vad, transient_det ); + + /*-----------------------------------------------------------------------------------------* + * Set SPAR bitrates + *-----------------------------------------------------------------------------------------*/ + + table_idx = ivas_get_spar_table_idx( hEncoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + + if ( hSpar->hMdEnc->table_idx != table_idx ) + { + hSpar->hMdEnc->table_idx = table_idx; + ivas_spar_set_bitrate_config( &hSpar->hMdEnc->spar_md_cfg, table_idx, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND ); + } + + /*-----------------------------------------------------------------------------------------* + * MetaData encoder + *-----------------------------------------------------------------------------------------*/ + + if ( hSpar->hMdEnc->spar_hoa_md_flag == 0 ) + { + ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order ); + } + + { + float azi_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; + float ele_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; + float diffuseness[IVAS_MAX_NUM_BANDS]; + float Wscale_d[IVAS_MAX_NUM_BANDS]; + int16_t d_start_band, d_end_band; + int16_t dirac_band_idx; + + d_start_band = hSpar->enc_param_start_band; + d_end_band = IVAS_MAX_NUM_BANDS; + + for ( b = d_start_band; b < d_end_band; b++ ) + { + dirac_band_idx = hSpar->dirac_to_spar_md_bands[b] - d_start_band; + for ( i_ts = 0; i_ts < hQMetaData->q_direction->cfg.nblocks; i_ts++ ) + { + azi_dirac[b][i_ts] = hQMetaData->q_direction->band_data[dirac_band_idx].azimuth[i_ts]; + ele_dirac[b][i_ts] = hQMetaData->q_direction->band_data[dirac_band_idx].elevation[i_ts]; + } + diffuseness[b] = 1.0f - hQMetaData->q_direction->band_data[dirac_band_idx].energy_ratio[0]; + } + + if ( d_start_band >= 6 && dtx_vad == 1 ) + { + mvr2r( hSpar->hMdEnc->spar_md.band_coeffs[d_start_band - 1].P_quant_re, hSpar->hMdEnc->spar_md.band_coeffs[d_start_band - 1].P_re, IVAS_SPAR_MAX_CH - 1 ); + } + + for ( b = d_start_band; b < d_end_band; b++ ) + { + Wscale_d[b] = 1.0f; + for ( i = 1; i < nchan_inp; i++ ) + { + Wscale_d[b] += cov_real[i][i][b] / max( EPSILON, cov_real[0][0][b] ); + } + Wscale_d[b] = Wscale_d[b] / ( 1.0f + (float) sba_order ); /*DirAC normalized signal variance sums to 1 + order*/ + Wscale_d[b] = sqrtf( Wscale_d[b] ); + Wscale_d[b] = min( 2.0f, max( Wscale_d[b], 1.0f ) ); + } + + ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, hSpar->hMdEnc->mixer_mat, &hSpar->hMdEnc->spar_md, &hSpar->hMdEnc->spar_md_cfg, d_start_band, d_end_band, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, dtx_vad, Wscale_d ); + } + + if ( hSpar->hMdEnc->spar_hoa_md_flag ) + { + ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order ); + } + + return; +} +#endif + + /*-----------------------------------------------------------------------------------------* * Function ivas_spar_enc_process() * @@ -343,10 +457,13 @@ static ivas_error ivas_spar_enc_process( float *p_pcm_tmp[IVAS_SPAR_MAX_CH]; int16_t i, j, b, i_ts, input_frame, transient_det, dtx_vad; int32_t ivas_total_brate, input_Fs; +#ifdef COVARIANCE_MEMORY_OPT + int16_t nchan_inp, sba_order; +#else float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; - int16_t nchan_inp, nchan_transport, sba_order; int16_t table_idx; +#endif int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; ivas_error error; const int16_t *order; @@ -523,6 +640,9 @@ static ivas_error ivas_spar_enc_process( } } +#ifdef COVARIANCE_MEMORY_OPT + ivas_spar_cov_md_process( st_ivas, hMetaData, nchan_inp, sba_order, ppIn_FR_real, ppIn_FR_imag, transient_det, dtx_vad ); +#else /*-----------------------------------------------------------------------------------------* * Covariance process *-----------------------------------------------------------------------------------------*/ @@ -531,8 +651,13 @@ static ivas_error ivas_spar_enc_process( { for ( j = 0; j < nchan_inp; j++ ) { +#ifdef COVARIANCE_MEMORY_OPT + cov_real[i][j] = cov_real_buf[i][j]; + cov_dtx_real[i][j] = cov_dtx_real_buf[i][j]; +#else cov_real[i][j] = hSpar->hMdEnc->cov_real[i][j]; cov_dtx_real[i][j] = hSpar->hMdEnc->cov_dtx_real[i][j]; +#endif } } @@ -607,12 +732,17 @@ static ivas_error ivas_spar_enc_process( { ivas_spar_md_enc_process( hSpar->hMdEnc, hEncoderConfig, cov_real, cov_dtx_real, hMetaData, dtx_vad, nchan_inp, sba_order ); } +#endif /*-----------------------------------------------------------------------------------------* * FB mixer *-----------------------------------------------------------------------------------------*/ +#ifdef COVARIANCE_MEMORY_OPT + ivas_fb_mixer_get_in_out_mapping( hSpar->hFbMixer->fb_cfg, st_ivas->nchan_transport, ENC, remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order], in_out_mixer_map ); +#else ivas_fb_mixer_get_in_out_mapping( hSpar->hFbMixer->fb_cfg, nchan_transport, ENC, remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order], in_out_mixer_map ); +#endif #ifdef DEBUG_SBA_MD_DUMP { @@ -765,7 +895,11 @@ static ivas_error ivas_spar_enc_process( order = remix_order_set[hSpar->hMdEnc->spar_md_cfg.remix_unmix_order]; +#ifdef COVARIANCE_MEMORY_OPT + for ( j = 0; j < st_ivas->nchan_transport; j++ ) +#else for ( j = 0; j < nchan_transport; j++ ) +#endif { mvr2r( p_pcm_tmp[j], data_f[order[j]], input_frame ); } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 09c766b581..24d42b2369 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -147,6 +147,7 @@ ivas_error ivas_spar_md_enc_open( } } +#ifndef COVARIANCE_MEMORY_OPT if ( ( hMdEnc->cov_real = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov real matrix" ); @@ -184,7 +185,7 @@ ivas_error ivas_spar_md_enc_open( } } } - +#endif if ( ( hMdEnc->mixer_mat_local = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); @@ -249,6 +250,7 @@ void ivas_spar_md_enc_close( count_free( hMdEnc->mixer_mat ); } +#ifndef COVARIANCE_MEMORY_OPT if ( hMdEnc->cov_real != NULL ) { for ( i = 0; i < num_channels; i++ ) @@ -276,7 +278,7 @@ void ivas_spar_md_enc_close( } count_free( hMdEnc->cov_dtx_real ); } - +#endif if ( hMdEnc->mixer_mat_local != NULL ) { for ( i = 0; i < num_channels; i++ ) @@ -363,6 +365,7 @@ static ivas_error ivas_spar_md_enc_init( } } +#ifndef COVARIANCE_MEMORY_OPT for ( i = 0; i < num_channels; i++ ) { for ( j = 0; j < num_channels; j++ ) @@ -374,7 +377,7 @@ static ivas_error ivas_spar_md_enc_init( } } } - +#endif ivas_clear_band_coeffs( hMdEnc->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdEnc->spar_md.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); ivas_clear_band_coeff_idx( hMdEnc->spar_md_prior.band_coeffs_idx, IVAS_MAX_NUM_BANDS ); diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 0644fcd918..50a4bdbb65 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -638,8 +638,10 @@ typedef struct ivas_spar_md_enc_state_t int16_t num_decorr; float ***mixer_mat; +#ifndef COVARIANCE_MEMORY_OPT float ***cov_real; float ***cov_dtx_real; +#endif float ***mixer_mat_local; ivas_spar_md_com_cfg spar_md_cfg; ivas_arith_coeffs_t arith_coeffs; -- GitLab From 857ec60588aefc5c54adf9ba151ee204544a2a93 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 6 Dec 2022 11:38:53 +0100 Subject: [PATCH 0002/1418] merge from main --- lib_com/options.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a0f3493559..b75ba0e983 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,14 +175,13 @@ #define FIX_GET_DELAY_RETURN /* Issue 223: change return data type in function get_delay() */ #define NTT_REDUC_COMP_POC /* NTT Contribution 10: Complexity reduction of phase spectrum in stereo downmix*/ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ +#define FIX_ITD_CNG /* Eri: Fix for CNG ITD */ //#define FIX_ISM_INACTIVE_BITS /* fix bitbudget distribution in inactive frames in ISM format */ #define COVARIANCE_MEMORY_OPT /* Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */ -#define FIX_ITD_CNG /* Eri: Fix for CNG ITD */ - /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif -- GitLab From dcc555206b57ca344a782e0d6869656e53e52425 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 8 Dec 2022 16:25:41 +1100 Subject: [PATCH 0003/1418] split binaural rendering with fast conv renderer --- Workspace_msvc/lib_debug.vcxproj | 6 +- Workspace_msvc/lib_rend.vcxproj | 5 + apps/decoder.c | 186 +++- apps/renderer.c | 290 +++++- lib_com/common_api_types.h | 19 + lib_com/ivas_cnst.h | 20 + lib_com/ivas_prot.h | 155 +++- lib_com/options.h | 8 +- lib_debug/debug.c | 133 ++- lib_debug/debug.h | 14 +- lib_debug/mem_count.c | 2 +- lib_dec/ivas_dec.c | 31 + lib_dec/ivas_dirac_dec.c | 41 + lib_dec/ivas_init_dec.c | 33 + lib_dec/ivas_mc_param_dec.c | 16 +- lib_dec/ivas_rom_dec.c | 43 + lib_dec/ivas_rom_dec.h | 12 + lib_dec/ivas_sba_dec.c | 12 + lib_dec/ivas_spar_md_dec.c | 4 +- lib_dec/ivas_stat_dec.h | 129 ++- lib_dec/lib_dec.c | 39 +- lib_dec/lib_dec.h | 12 + lib_rend/ivas_binauralRenderer.c | 479 +++++++++- lib_rend/ivas_lib_rend_internal.h | 52 ++ lib_rend/ivas_output_init.c | 12 + lib_rend/ivas_splitRend_lcld_dec.c | 92 ++ lib_rend/ivas_splitRend_lcld_enc.c | 92 ++ lib_rend/ivas_splitRendererPost.c | 1004 ++++++++++++++++++++ lib_rend/ivas_splitRendererPre.c | 1324 +++++++++++++++++++++++++++ lib_rend/ivas_splitRenderer_utils.c | 300 ++++++ lib_rend/lib_rend.c | 267 +++++- lib_rend/lib_rend.h | 25 + 32 files changed, 4774 insertions(+), 83 deletions(-) create mode 100644 lib_rend/ivas_splitRend_lcld_dec.c create mode 100644 lib_rend/ivas_splitRend_lcld_enc.c create mode 100644 lib_rend/ivas_splitRendererPost.c create mode 100644 lib_rend/ivas_splitRendererPre.c create mode 100644 lib_rend/ivas_splitRenderer_utils.c diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index 5dc36d4633..ec954e62ff 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -73,7 +73,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_util;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) false @@ -97,7 +97,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_util;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) false @@ -124,7 +124,7 @@ AnySuitable false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_util;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index c3a1268694..af88421f8b 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -200,6 +200,11 @@ + + + + + diff --git a/apps/decoder.c b/apps/decoder.c index 6396e3ab94..29d0e17119 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -76,6 +76,10 @@ static #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( 3750 ) /*temp buffer size for 1.5 mbps*/ +#endif + #define IVAS_PUBLIC_ORIENT_TRK_REF 0 #define IVAS_PUBLIC_ORIENT_TRK_AVG 1 @@ -114,7 +118,10 @@ typedef struct #ifdef DEBUG_FOA_AGC FILE *agcBitstream; /* temporary */ #endif - +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_MODE splitRendMode; + char *postRendheadrotTrajFileName; #endif } DecArguments; @@ -126,7 +133,13 @@ typedef struct static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); -static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); +static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, +#ifdef SPLIT_REND_WITH_HEAD_ROT + HeadRotFileReader *postRendheadRotReader, + uint8_t *splitRendBitsBuf, +#endif + IVAS_DEC_HANDLE hIvasDec, + int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); #ifdef DEBUGGING static int16_t app_own_random( int16_t *seed ); @@ -186,8 +199,14 @@ int main( LsCustomFileReader *hLsCustomReader = NULL; hrtfFileReader *hrtfReader = NULL; HeadRotFileReader *headRotReader = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + HeadRotFileReader *postRendheadRotReader = NULL; +#endif ivas_error error = IVAS_ERR_UNKNOWN; int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + uint8_t splitRendBitsBuf[MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES]; +#endif RenderConfigReader *renderConfigReader = NULL; #ifdef DEBUGGING int32_t noClipping; @@ -284,6 +303,16 @@ int main( goto cleanup; } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( arg.splitRendMode == SPLIT_REND_COMB ) + { + if ( ( error = HeadRotationFileReader_open( arg.postRendheadrotTrajFileName, &postRendheadRotReader ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: Can't open post renderer head-rotation file %s \n\n", arg.postRendheadrotTrajFileName ); + goto cleanup; + } + } +#endif /*------------------------------------------------------------------------------------------* * Open custom loudspeaker layout file @@ -316,9 +345,18 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef DEBUGGING - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, +#ifdef SPLIT_REND_WITH_HEAD_ROT + arg.splitRendMode, +#endif + arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + arg.enableSplitRendWithHeadRot +#endif + ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -507,7 +545,11 @@ int main( } else { - error = decodeG192( arg, hBsReader, headRotReader, hIvasDec, pcmBuf ); + error = decodeG192( arg, hBsReader, headRotReader, +#ifdef SPLIT_REND_WITH_HEAD_ROT + postRendheadRotReader, splitRendBitsBuf, +#endif + hIvasDec, pcmBuf ); } if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE ) @@ -554,7 +596,9 @@ cleanup: CustomLsReader_close( &hLsCustomReader ); hrtfFileReader_close( &hrtfReader ); HeadRotationFileReader_close( &headRotReader ); - +#ifdef SPLIT_REND_WITH_HEAD_ROT + HeadRotationFileReader_close( &postRendheadRotReader ); +#endif RenderConfigReader_close( &renderConfigReader ); if ( BS_Reader_Close( &hBsReader ) != IVAS_ERR_OK ) @@ -666,6 +710,43 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static int8_t parseSplitRendMode( + char *value, + IVAS_SPLIT_REND_MODE *SplitRendMode ) +{ + int16_t temp; + int8_t success; + success = 1; + to_upper( value ); + + temp = (int16_t) atoi( value ); + if ( temp == 0 ) + { + *SplitRendMode = SPLIT_REND_DISABLED; + } +#if 0 + else if ( temp == 1 ) + { + *SplitRendMode = SPLIT_REND_PRE; + } + else if ( temp == 2 ) + { + *SplitRendMode = SPLIT_REND_POST; + } +#endif + else if ( temp == 3 ) + { + *SplitRendMode = SPLIT_REND_COMB; + } + else + { + fprintf( stderr, "Error: Incorrect or unsupported value for split rendering mode specified!\n\n" ); + success = 0; + } + return success ? 0 : -1; +} +#endif /*---------------------------------------------------------------------* * parseCmdlIVAS_dec() * @@ -698,6 +779,10 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + arg->postRendheadrotTrajFileName = NULL; +#endif + arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF; #ifdef SUPPORT_JBM_TRACEFILE @@ -720,6 +805,10 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; +#ifdef SPLIT_REND_WITH_HEAD_ROT + arg->splitRendMode = SPLIT_REND_DISABLED; +#endif + /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -871,6 +960,41 @@ static bool parseCmdlIVAS_dec( arg->headrotTrajFileName = argv[i]; i++; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( strcmp( argv_to_upper, "-SBRM" ) == 0 ) + { + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Head rotation file name not specified!\n\n" ); + usage_dec(); + return false; + } + if ( parseSplitRendMode( argv[i], &arg->splitRendMode ) != 0 ) + { + fprintf( stderr, "Error: Invalid split rendering mode %s \n\n", argv[i] ); + usage_dec(); + return false; + } + i++; + } + else if ( strcmp( argv_to_upper, "-PRTF" ) == 0 ) + { + arg->enableHeadRotation = true; + i++; + + if ( argc - i <= 4 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Head rotation file name not specified!\n\n" ); + usage_dec(); + return false; + } + + arg->postRendheadrotTrajFileName = argv[i]; + i++; + } +#endif else if ( strcmp( argv_to_upper, "-OTR" ) == 0 ) { if ( strlen( argv[i + 1] ) > 3 ) @@ -1079,6 +1203,10 @@ static void usage_dec( void ) fprintf( stdout, " which of the two supported formats is in use.\n" ); fprintf( stdout, " default bitstream file format is G.192\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + fprintf( stdout, "-sbrm mode : split rendering mode (0 - disabled, 1 - PRE RENDERER, 2 - POST RENDERER, 3 - COMBINED PRE-POST RENDERING), by default disabled\n" ); + fprintf( stdout, "-prtf File : Head rotation for post renderer specified by external trajectory File (to be used with split rendering)\n" ); +#endif fprintf( stdout, "-hrtf File : HRTF filter File used in ISm format and BINAURAL output configuration\n" ); #ifdef DEBUGGING fprintf( stdout, "-force_subframe_bin : Forces parametric binauralizer code to use 5 ms time resolution even when\n" ); @@ -1126,6 +1254,10 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, +#ifdef SPLIT_REND_WITH_HEAD_ROT + HeadRotFileReader *postRendheadRotReader, + uint8_t *splitRendBitsBuf, +#endif IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) @@ -1151,6 +1283,10 @@ static ivas_error decodeG192( uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_BITS splitRendBits; +#endif + IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -1172,6 +1308,13 @@ static ivas_error decodeG192( reset_wmops(); #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + splitRendBits.bits_buf = splitRendBitsBuf; + splitRendBits.bits_read = 0; + splitRendBits.bits_written = 0; + splitRendBits.buf_len = MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES; +#endif + /*------------------------------------------------------------------------------------------* * Loop for every packet (frame) of bitstream data * - Read the bitstream packet @@ -1226,15 +1369,42 @@ static ivas_error decodeG192( goto cleanup; } - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + SPLIT_REND_PRE +#endif + ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( arg.splitRendMode == SPLIT_REND_COMB ) + { + if ( ( error = HeadRotationFileReading( postRendheadRotReader, Quaternions, frame ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading post rendering head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, SPLIT_REND_POST ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } +#endif } /* Run decoder for one frame (get rendered output) */ - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, pcmBuf, &nOutSamples ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetSamples( hIvasDec, pcmBuf, &nOutSamples +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + &splitRendBits +#endif + ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: could not get samples from decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 8682232fa0..1fc6a5bad5 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -183,6 +183,10 @@ typedef struct char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_MODE splitRendMode; + char postRendheadRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; +#endif char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientationTracking; @@ -211,6 +215,10 @@ typedef enum CmdLnOptionId_inputMetadata, CmdLnOptionId_listFormats, CmdLnOptionId_inputGain, +#ifdef SPLIT_REND_WITH_HEAD_ROT + CmdLnOptionId_SplitRendMode, + CmdLnOptionId_PostRendtrajFile, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -256,6 +264,20 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "tf", .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", }, +#ifdef SPLIT_REND_WITH_HEAD_ROT + { + .id = CmdLnOptionId_SplitRendMode, + .match = "split_bin_rend_mode", + .matchShort = "sbrm", + .description = "Split rendering mode option (only for BINAURAL and BINAURAL_ROOM outputs)", + }, + { + .id = CmdLnOptionId_PostRendtrajFile, + .match = "post_rend_trajectory_file", + .matchShort = "prtf", + .description = "Split rendering option with head tracking data for post renderer (only for BINAURAL and BINAURAL_ROOM outputs)", + }, +#endif { .id = CmdLnOptionId_customHrtfFile, .match = "custom_hrtf", @@ -405,7 +427,13 @@ static void printSupportedAudioConfigs( void ); static IVAS_REND_AudioConfig parseAudioConfig( const char *configString ); -static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, float *floatBuffer ); +static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, float *floatBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t cldfb_in, + HANDLE_CLDFB_FILTER_BANK *cldfbAna +#endif +); static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); @@ -558,6 +586,50 @@ static float dBToLin( return powf( 10.0f, gain_dB / 20.0f ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static int16_t rend_openCldfb( + HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], + const int16_t num_in_chs, + const int32_t output_Fs ) +{ + int16_t n; + + for ( n = 0; n < num_in_chs; n++ ) + { + if ( openCldfb( &( cldfbAna[n] ), CLDFB_ANALYSIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK ) + { + return -1; + } + } + return 0; +} + +static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS] ) +{ + int16_t n; + for ( n = 0; n < MAX_INPUT_CHANNELS; n++ ) + { + if ( cldfbAna[n] != NULL ) + { + deleteCldfb( &( cldfbAna[n] ) ); + cldfbAna[n] = NULL; + } + } + return; +} + +static int16_t get_cldfb_in_flag( CmdlnArgs *args ) +{ + int16_t cldfb_in; + cldfb_in = 0; + if ( ( args->splitRendMode == SPLIT_REND_PRE ) || ( args->splitRendMode == SPLIT_REND_COMB ) ) + { + cldfb_in = 1; + } + + return cldfb_in; +} +#endif /* ============================================================================ */ @@ -567,6 +639,11 @@ int main( { IVAS_REND_HANDLE hIvasRend; HeadRotFileReader *headRotReader = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + HeadRotFileReader *postRendHeadRotReader = NULL; + HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS]; + int16_t cldfb_in; +#endif hrtfFileReader *hrtfFileReader = NULL; IsmPositionProvider *positionProvider; RenderConfigReader *renderConfigReader = NULL; @@ -622,6 +699,13 @@ int main( HeadRotationFileReader_open( args.headRotationFilePath, &headRotReader ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( args.splitRendMode == SPLIT_REND_COMB ) && !isEmptyString( args.postRendheadRotationFilePath ) ) + { + HeadRotationFileReader_open( args.postRendheadRotationFilePath, &postRendHeadRotReader ); + } +#endif + if ( !isEmptyString( args.customHrtfFilePath ) ) { hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ); @@ -666,12 +750,22 @@ int main( } const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + const int16_t CLDFBframeSize_smpls = (int16_t) frameSize_smpls * 2; + cldfb_in = get_cldfb_in_flag( &args ); +#endif + IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + args.splitRendMode +#endif + ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -794,6 +888,12 @@ int main( } const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in ) + { + rend_openCldfb( cldfbAna, totalNumInChannels, args.sampleRate ); + } +#endif if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) @@ -829,11 +929,26 @@ int main( inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; inpInt16Buffer = count_malloc( inBufferSize * sizeof( int16_t ) ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in == 0 ) + { + inFloatBuffer = count_malloc( inBufferSize * sizeof( float ) ); + inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; + } + else + { + inFloatBuffer = count_malloc( CLDFBframeSize_smpls * totalNumInChannels * sizeof( float ) ); + inBuffer.config.numSamplesPerChannel = (int16_t) CLDFBframeSize_smpls; + } +#else inFloatBuffer = count_malloc( inBufferSize * sizeof( float ) ); +#endif outInt16Buffer = count_malloc( outBufferSize * sizeof( int16_t ) ); outFloatBuffer = count_malloc( outBufferSize * sizeof( float ) ); - inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; +#ifdef SPLIT_REND_WITH_HEAD_ROT + inBuffer.config.is_cldfb = cldfb_in; +#endif inBuffer.config.numChannels = (int16_t) totalNumInChannels; inBuffer.data = inFloatBuffer; @@ -874,7 +989,12 @@ int main( } /* Convert from int to float and from interleaved to packed */ - convertInputBuffer( inpInt16Buffer, numSamplesRead, frameSize_smpls, num_in_channels, inFloatBuffer ); + convertInputBuffer( inpInt16Buffer, numSamplesRead, inBuffer.config.numSamplesPerChannel, num_in_channels, inFloatBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + inBuffer.config.is_cldfb, cldfbAna +#endif + ); #ifdef DEC_TO_REND_FLOAT_DUMP /* Overwrite from dump file */ float tmp[960 * 16]; @@ -899,13 +1019,33 @@ int main( { IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; HeadRotationFileReading( headRotReader, quatBuffer, frame ); - IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer ); + IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + SPLIT_REND_PRE +#endif + ); } else { - IVAS_REND_SetHeadRotation( hIvasRend, NULL ); + IVAS_REND_SetHeadRotation( hIvasRend, NULL +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + SPLIT_REND_PRE +#endif + ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + /* Read from post renderer head rotation trajectory file if specified */ + if ( postRendHeadRotReader != NULL ) + { + IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; + HeadRotationFileReading( postRendHeadRotReader, quatBuffer, frame ); + IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, SPLIT_REND_POST ); + } +#endif + for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, mcIds[i], &numChannels ) ) != IVAS_ERR_OK ) @@ -1071,6 +1211,13 @@ int main( { MasaFileReader_close( &masaReaders[i] ); } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in ) + { + rend_closeCldfb( cldfbAna ); + } +#endif AudioFileReader_close( &audioReader ); AudioFileWriter_close( &audioWriter ); HeadRotationFileReader_close( &headRotReader ); @@ -1090,6 +1237,10 @@ int main( print_mem_renderer( SRAM_size ); #endif +#ifdef DEBUGGING + dbgclose(); +#endif + return 0; } @@ -1276,6 +1427,44 @@ static int8_t parseDiegeticPan( return success ? 0 : -1; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static int8_t parseSplitRendMode( + char *value, + IVAS_SPLIT_REND_MODE *SplitRendMode ) +{ + int16_t temp; + int8_t success; + success = 1; + to_upper( value ); + + temp = (int16_t) atoi( value ); + if ( temp == 0 ) + { + *SplitRendMode = SPLIT_REND_DISABLED; + } +#if 0 + else if ( temp == 1 ) + { + *SplitRendMode = SPLIT_REND_PRE; + } + else if ( temp == 2 ) + { + *SplitRendMode = SPLIT_REND_POST; + } +#endif + else if ( temp == 3 ) + { + *SplitRendMode = SPLIT_REND_COMB; + } + else + { + fprintf( stderr, "Error: Incorrect or unsupported value for split rendering mode specified!\n\n" ); + success = 0; + } + return success ? 0 : -1; +} +#endif + static int8_t parseOrientationTracking( char *value, int8_t *tracking_type ) @@ -1305,8 +1494,13 @@ static int8_t parseOrientationTracking( static IVAS_REND_AudioConfig parseAudioConfig( const char *configString ) { +#ifndef SPLIT_REND_WITH_HEAD_ROT char charBuf[14]; charBuf[13] = '\0'; +#else + char charBuf[25]; + charBuf[24] = '\0'; +#endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); to_upper( charBuf ); @@ -1377,7 +1571,6 @@ static IVAS_REND_AudioConfig parseAudioConfig( { return IVAS_REND_AUDIO_CONFIG_BINAURAL; } - return IVAS_REND_AUDIO_CONFIG_UNKNOWN; } @@ -1467,6 +1660,11 @@ static CmdlnArgs defaultArgs( args.numInMetadataFiles = 0; clearString( args.headRotationFilePath ); + +#ifdef SPLIT_REND_WITH_HEAD_ROT + args.splitRendMode = SPLIT_REND_DISABLED; + clearString( args.postRendheadRotationFilePath ); +#endif clearString( args.customHrtfFilePath ); clearString( args.renderConfigFilePath ); @@ -1538,6 +1736,20 @@ static void parseOption( assert( numOptionValues == 1 ); strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case CmdLnOptionId_PostRendtrajFile: + assert( numOptionValues == 1 ); + strncpy( args->postRendheadRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); + break; + case CmdLnOptionId_SplitRendMode: + assert( numOptionValues == 1 ); + if ( parseSplitRendMode( optionValues[0], &args->splitRendMode ) != 0 ) + { + fprintf( stderr, "Unknown option for split rendering mode: %s\n", optionValues[0] ); + exit( -1 ); + } + break; +#endif case CmdLnOptionId_customHrtfFile: assert( numOptionValues == 1 ); strncpy( args->customHrtfFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); @@ -2392,26 +2604,72 @@ static void convertInputBuffer( const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, - float *floatBuffer ) + float *floatBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t cldfb_in, + HANDLE_CLDFB_FILTER_BANK *cldfbAna +#endif +) { int16_t chnl, smpl, i; i = 0; +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in ) + { + int16_t slotIdx, numCldfbBands, numFloatPcmSamples; + float fIn[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + numFloatPcmSamples = numFloatSamplesPerChannel >> 1; + numCldfbBands = numFloatPcmSamples / CLDFB_NO_COL_MAX; + /* CLDFB Analysis*/ + assert( numIntSamplesPerChannel <= MAX_OUTPUT_CHANNELS * L_FRAME48k ); + for ( smpl = 0; smpl < numFloatPcmSamples; ++smpl ) + { + for ( chnl = 0; chnl < numChannels; ++chnl ) + { + if ( i < numIntSamplesPerChannel ) + { + fIn[chnl][smpl] = (float) intBuffer[i]; + } + else + { + fIn[chnl][smpl] = 0.f; + } - for ( smpl = 0; smpl < numFloatSamplesPerChannel; ++smpl ) - { + ++i; + } + } for ( chnl = 0; chnl < numChannels; ++chnl ) { - if ( i < numIntSamplesPerChannel ) + for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ ) { - floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = (float) intBuffer[i]; + cldfbAnalysis_ts( &fIn[chnl][numCldfbBands * slotIdx], + &floatBuffer[( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )], + &floatBuffer[numCldfbBands + ( chnl * numFloatSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands )], + numCldfbBands, + cldfbAna[chnl] ); } - else + } + } + else +#endif + { + for ( smpl = 0; smpl < numFloatSamplesPerChannel; ++smpl ) + { + for ( chnl = 0; chnl < numChannels; ++chnl ) { - floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = 0.f; - } + if ( i < numIntSamplesPerChannel ) + { + floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = (float) intBuffer[i]; + } + else + { + floatBuffer[chnl * numFloatSamplesPerChannel + smpl] = 0.f; + } - ++i; + ++i; + } } } diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index fa14ecff23..39cbc82a1a 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -83,6 +83,16 @@ typedef struct } IVAS_QUATERNION; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct ivas_split_rend_bits_t +{ + uint8_t *bits_buf; + int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ + int32_t bits_written; + int32_t bits_read; +} ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS, *IVAS_SPLIT_REND_BITS_HANDLE; +#endif + typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_qmetadata_frame_struct *IVAS_MASA_QMETADATA_HANDLE; @@ -146,5 +156,14 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef enum _IVAS_SPLIT_REND_MODE +{ + SPLIT_REND_DISABLED = -1, + SPLIT_REND_PRE, + SPLIT_REND_POST, + SPLIT_REND_COMB +} IVAS_SPLIT_REND_MODE; +#endif #endif /* COMMON_API_TYPES_H */ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 4a9ce1e080..0c33ade4d7 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1360,6 +1360,26 @@ typedef enum #define BINAURAL_CONVBANDS 50 /* Bands upto which convolution is performed */ #define BINAURAL_NTAPS_MAX 96 +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define SPLIT_REND_DECOR_ALPHA (0.25f) +#define MAX_YAW_ANGLES (3) +#define MAX_PITCH_ANGLES (1) +#define MAX_ROLL_ANGLES (1) +#define MAX_HEAD_ROT_POSES (MAX_YAW_ANGLES*MAX_PITCH_ANGLES*MAX_ROLL_ANGLES) +#define MAX_SPLIT_REND_MD_BANDS (20) +#define COMPLEX_MD_BAND_THRESH (MAX_SPLIT_REND_MD_BANDS) + +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define IVAS_SPLIT_REND_PRED_QUANT_PNTS ( 31 ) +#define IVAS_SPLIT_REND_D_QUANT_PNTS ( 15 ) +#define IVAS_SPLIT_REND_PRED_MIN_VAL ( -1.0f ) +#define IVAS_SPLIT_REND_PRED_MAX_VAL ( 1.0f ) +#define IVAS_SPLIT_REND_D_MIN_VAL ( 0.0f ) +#define IVAS_SPLIT_REND_D_MAX_VAL ( 1.0f ) +#define IVAS_SPLIT_REND_MAX_NUM_BYTES (4000) +#endif +#endif + #define HRTF_SH_ORDER 3 #define HRTF_SH_CHANNELS 16 #define HRTF_NUM_BINS 60 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c09adab6c8..fea2bef693 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -298,6 +298,10 @@ void stereo_dmx_evs_close_encoder( ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits +#endif ); ivas_error ivas_dec_setup( @@ -4339,6 +4343,14 @@ void ivas_quantise_real_values( const int16_t dim ); +ivas_error ivas_deindex_real_index( + const int16_t *index, + const int16_t q_levels, + const float min_value, + const float max_value, + float *quant, + const int16_t num_ch_dim2 ); + void ivas_spar_get_uniform_quant_strat( ivas_spar_md_com_cfg *pSpar_md_com_cfg, @@ -4551,12 +4563,20 @@ void ivas_binaural_cldfb( ); void ivas_binRenderer( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ - float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ +#else + float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ + float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ +#endif + float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ ); void ivas_binaural_add_LFE( @@ -4638,6 +4658,129 @@ void rotateFrame_sd_cldfb( const int16_t nb_band /* i : number of CLDFB bands to process */ ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + +/*----------------------------------------------------------------------------------* + * Split renderer prototypes + *----------------------------------------------------------------------------------*/ + +void ivas_set_split_rend_setup( + IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ); + +void ivas_init_split_rend_handles( + SPLIT_REND_WRAPPER *hSplitRendWrapper ); + +ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitBinRend, + const int32_t output_Fs, + const IVAS_SPLIT_REND_MODE splitRendMode, + const int16_t is_cldfb_in ); + +void ivas_split_renderer_close( + SPLIT_REND_WRAPPER *hSplitBinRend); + +ivas_error ivas_splitBinLCLDEncOpen( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ); + +void ivas_splitBinLCLDEncClose( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ); + +void ivas_splitBinLCLDEncProcess( + BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + ivas_split_rend_bits_t *pBits ); + +ivas_error ivas_splitBinLCLDDecOpen( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ); + +void ivas_splitBinLCLDDecClose( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ); + +void ivas_splitBinLCLDDecProcess( + BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec, + ivas_split_rend_bits_t *pBits, + float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ); + +ivas_error ivas_splitBinPreRendOpen( + BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + , + const int32_t output_Fs +#endif +); + +ivas_error ivas_splitBinPostRendOpen( + BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, + const int32_t output_Fs ); + +ivas_error ivas_renderMultiBinToSplitBinaural( + SPLIT_REND_WRAPPER *hSplitBin, + ivas_split_rend_bits_t *pBits, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], + const int16_t max_bands, + float out[][L_FRAME48k]); + +void ivas_rend_CldfbSplitPreRendProcess( + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t max_bands, + ivas_split_rend_bits_t *pBits ); + +void ivas_rend_CldfbSplitPostRendProcess( + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], + float Cldfb_RealBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float output[][L_FRAME48k] ); + +void ivas_splitBinPreRendClose( + BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ); + +void ivas_splitBinPostRendClose( + BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend ); + +void ivas_splitBinPostRendMdDec( + ivas_split_rend_bits_t *pBits, + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, +#endif + const int16_t num_md_bands); + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +void ivas_log_cldfb2wav_data( + float Cldfb_In_Real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + HANDLE_CLDFB_FILTER_BANK *cldfbSyn, + const int16_t num_chs, + const int16_t num_freq_bands, + const int32_t output_Fs, + const char *filename ); +#endif + +void ivas_SplitRenderer_GetRotMd( + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + ivas_split_rend_bits_t *pBits, + int16_t sf_idx ); + +void ivas_SplitRenderer_PostRenderer( + BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ + float Cldfb_RealBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + int16_t sf_idx, + const IVAS_QUATERNION *Quaternions_ref, + const IVAS_QUATERNION *Quaternions_act ); + +#endif /*----------------------------------------------------------------------------------* * renderer prototypes diff --git a/lib_com/options.h b/lib_com/options.h index 9dc8ab44c8..1f12475cfb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,8 +154,12 @@ #define FIX_VBR_COMPLEXITY /* Issue 234: fix extremely high complexity numbers for IVAS EVS mode */ #define FIX_ISM_INACTIVE_BITS /* Issue 230: fix bitbudget distribution in inactive frames in ISM format */ - - +#define SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_WITH_HEAD_ROT +//#define SPLIT_REND_WITH_HEAD_ROT_DEBUG // only for debugging purposes +#define SPLIT_REND_BASE2_CODING +//#define SPLIT_REND_SKIP_POST_REND +#endif /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif diff --git a/lib_debug/debug.c b/lib_debug/debug.c index 5ee8f10e31..dc3d0cb4d9 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "options.h" #include "prot.h" #ifdef DEBUGGING @@ -54,6 +55,9 @@ #else #endif #include "wmops.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#include "tinywaveout_c.h" +#endif /*-------------------------------------------------------------------* @@ -89,12 +93,19 @@ int16_t debug_level = 0; static FILE *in_fileptr[N_FILEPTR]; static FILE *out_fileptr[N_FILEPTR]; - +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +static WAVEFILEOUT *out_wavfileptr[N_FILEPTR]; +#endif static char *in_filename[N_FILEPTR]; static char *out_filename[N_FILEPTR]; - +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +static char *out_wavfilename[N_FILEPTR]; +#endif static int16_t in_count = 0; static int16_t out_count = 0; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +static int16_t out_wav_count = 0; +#endif static int16_t flag_count = 0; static char *flag_name[N_DBGFLAG]; @@ -390,7 +401,13 @@ void dbgclose() fclose( out_fileptr[i] ); free( out_filename[i] ); } - +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( i = 0; i < out_wav_count; i++ ) + { + CloseWav( out_wavfileptr[i] ); + free( out_wavfilename[i] ); + } +#endif for ( i = 0; i < snr_count; i++ ) { free( snr_name[i] ); @@ -846,4 +863,114 @@ int16_t make_dirs( const char *const pathname ) return 0; } +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +int16_t dbgwrite_wav( + const float *buffer[], /* i : Write buffer */ + const int16_t count_per_ch, /* i : Number of elements */ + const char *const filename, + int32_t fs, + int16_t num_chs ) +{ + int16_t index, i; + int16_t *tmp_buf; + + index = lookup( filename, (const char *const *) out_wavfilename, out_wav_count ); + + if ( index == -1 ) + { + if ( make_dirs( filename ) != 0 ) + { + fprintf( stderr, "dbgwrite: Could not create directory structure for %s. Exiting..\n", filename ); + exit( -1 ); + } + + index = out_wav_count; + out_wavfileptr[index] = CreateWav( (const char *) filename, fs, num_chs, 16 /* const uint32_t writeWaveExt */ ); + out_wavfilename[index] = malloc( sizeof( char ) * ( strlen( filename ) + 1 ) ); + strcpy( out_wavfilename[index], filename ); + out_wav_count++; + } + + if ( out_wavfileptr[index] != NULL ) + { + int16_t j, k; + float tmp; + tmp_buf = (int16_t *) calloc( count_per_ch * num_chs, sizeof( int16_t ) ); + k = 0; + for ( j = 0; j < count_per_ch; j++ ) + { + for ( i = 0; i < num_chs; i++, k++ ) + { + tmp = roundf( buffer[i][j] ); + tmp_buf[k] = ( tmp > MAX16B_FLT ) ? MAX16B : ( tmp < MIN16B_FLT ) ? MIN16B + : (short) tmp; + } + } + WriteWavShort( out_wavfileptr[index], tmp_buf, count_per_ch * num_chs ); + free( tmp_buf ); + } + else + { + fprintf( stderr, "dbgwrite_wav: Could not write to file: %s. Exiting..\n", filename ); + exit( -1 ); + } + + return 0; +} + + +int16_t dbgwrite_txt( + const float *buffer, /* i : Write buffer */ + const int16_t count, /* i : Number of elements */ + const char *const filename, + const char *const msg_opt ) +{ + int16_t index, i; + + index = lookup( filename, (const char *const *) out_filename, out_count ); + + if ( index == -1 ) + { + if ( make_dirs( filename ) != 0 ) + { + fprintf( stderr, "dbgwrite: Could not create directory structure for %s. Exiting..\n", filename ); + exit( -1 ); + } + + index = out_count; + out_fileptr[index] = fopen( filename, "w" ); + out_filename[index] = malloc( sizeof( char ) * ( strlen( filename ) + 1 ) ); + strcpy( out_filename[index], filename ); + out_count++; + } + + if ( out_fileptr[index] != NULL ) + { + if ( buffer != NULL ) + { + if ( msg_opt == NULL ) + { + for ( i = 0; i < count; i++ ) + { + fprintf( out_fileptr[index], "%f\n", buffer[i] ); + } + } + else + { + for ( i = 0; i < count; i++ ) + { + fprintf( out_fileptr[index], "%s %f\n", msg_opt, buffer[i] ); + } + } + } + } + else + { + fprintf( stderr, "dbgwrite_txt: Could not write to file: %s. Exiting..\n", filename ); + exit( -1 ); + } + + return 0; +} +#endif #endif /* DEBUGGING */ diff --git a/lib_debug/debug.h b/lib_debug/debug.h index abf246674a..e228f11cf4 100644 --- a/lib_debug/debug.h +++ b/lib_debug/debug.h @@ -95,7 +95,19 @@ int16_t dbgwrite( const char *const filename #endif ); - +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +int16_t dbgwrite_wav( + const float *buffer[], /* i : Write buffer */ + const int16_t count_per_ch, /* i : Number of elements */ + const char *const filename, + int32_t fs, + int16_t num_chs ); +int16_t dbgwrite_txt( + const float *buffer, /* i : Write buffer */ + const int16_t count, /* i : Number of elements */ + const char *const filename, + const char *const msg_opt ); +#endif void dbgwrite_mat_repeat( float *buffer, /* i : write buffer */ int16_t nRow, /* i : matrix size (rows) */ diff --git a/lib_debug/mem_count.c b/lib_debug/mem_count.c index 278126d35e..598b023df3 100644 --- a/lib_debug/mem_count.c +++ b/lib_debug/mem_count.c @@ -98,7 +98,7 @@ typedef INT64 int64_t; /* This is the maximum number of allocations for which to keep information. It can be increased if required. */ #ifdef SBA_BR_SWITCHING -#define MAX_INFO_RECORDS 8000 +#define MAX_INFO_RECORDS 9000 #else #define MAX_INFO_RECORDS 3000 #endif diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 5d3a5a10f9..cf887ab725 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -53,6 +53,10 @@ ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits +#endif ) { int16_t n, output_frame, nchan_out; @@ -85,6 +89,12 @@ ivas_error ivas_dec( } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hDecoderConfig->Opt_splitRendMode != SPLIT_REND_DISABLED ) + { + ivas_set_split_rend_setup( &st_ivas->splitBinRend, hSplitRendBits ); + } +#endif /*----------------------------------------------------------------* * Initialization of local vars after struct has been set *----------------------------------------------------------------*/ @@ -543,6 +553,27 @@ ivas_error ivas_dec( } +#ifdef SPLIT_REND_WITH_HEAD_ROT + /*split rendering process calls*/ + if ( st_ivas->hDecoderConfig->Opt_splitRendMode != SPLIT_REND_DISABLED ) + { + if ( ( st_ivas->splitBinRend.splitrend.hBinHrSplitPreRend != NULL ) && ( st_ivas->splitBinRend.splitrend.hBinHrSplitPostRend != NULL ) ) + { + IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; + int16_t max_band; + hSplitBinRend = &st_ivas->splitBinRend; + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); + ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, + hSplitBinRend->hSplitRendBits, + hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, + hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, + st_ivas->hHeadTrackData->Quaternions, + st_ivas->hPostRendheadTrackData->Quaternions, max_band, output ); + + dynamic_free( st_ivas->splitBinRend.hMultiBinCldfbData ); + } + } +#endif /*----------------------------------------------------------------* * Write IVAS output channels * - compensation for saturation diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f2273de26d..8b07d7bb1d 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1815,8 +1815,19 @@ void ivas_dirac_dec( /*CLDFB: last output channels reserved to LFT for CICPx*/ float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif +#else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif + int16_t index, num_freq_bands; DIRAC_DEC_STACK_MEM DirAC_mem; @@ -2338,12 +2349,37 @@ void ivas_dirac_dec( /* Perform binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + st_ivas->hPostRendheadTrackData, +#endif Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hBinRenderer->splitRendMode == SPLIT_REND_PRE || st_ivas->hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + { + int16_t pos_idx; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES + 1; pos_idx++ ) +#else + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#endif + { + for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots; slot_idx++ ) + { + for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) + { + mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); + mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); + } + } + } + } +#endif + /* Inverse CLDFB*/ for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { @@ -2353,8 +2389,13 @@ void ivas_dirac_dec( for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; +#else RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; +#endif } cldfbSynthesis( RealBuffer, diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e51b46779c..5d8d158739 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -564,6 +564,20 @@ ivas_error ivas_init_decoder_front( } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hDecoderConfig->Opt_splitRendMode == SPLIT_REND_COMB ) + { + if ( ( error = ivas_headTrack_open( &( st_ivas->hPostRendheadTrackData ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + st_ivas->hPostRendheadTrackData = NULL; + } +#endif + /*-------------------------------------------------------------------* * Allocate HRTF binary handle *--------------------------------------------------------------------*/ @@ -1157,6 +1171,9 @@ ivas_error ivas_init_decoder( { return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, hDecoderConfig->output_Fs, hDecoderConfig->Opt_splitRendMode, 1 ); +#endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -1482,6 +1499,11 @@ void ivas_initialize_handles_dec( /* rendering handles */ st_ivas->hBinRenderer = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + st_ivas->splitBinRend.hMultiBinCldfbData = NULL; + st_ivas->splitBinRend.hSplitRendBits = NULL; + ivas_init_split_rend_handles( &st_ivas->splitBinRend.splitrend ); +#endif st_ivas->hDiracDecBin = NULL; st_ivas->hLsSetUpConversion = NULL; st_ivas->hEFAPdata = NULL; @@ -1640,6 +1662,10 @@ void ivas_destroy_dec( /* Fastconv binaural renderer handle */ ivas_binRenderer_close( &st_ivas->hBinRenderer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + /* Split binaural renderer handle */ + ivas_split_renderer_close( &st_ivas->splitBinRend.splitrend ); +#endif /* Parametric binaural renderer handle */ ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); @@ -1677,6 +1703,13 @@ void ivas_destroy_dec( count_free( st_ivas->hHeadTrackData ); st_ivas->hHeadTrackData = NULL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hPostRendheadTrackData != NULL ) + { + count_free( st_ivas->hPostRendheadTrackData ); + st_ivas->hPostRendheadTrackData = NULL; + } +#endif /* Time Domain binaural renderer handle */ if ( st_ivas->hBinRendererTd != NULL ) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 7557fed214..7b8901fdec 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -799,8 +799,13 @@ void ivas_param_mc_dec( float Cldfb_ImagBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_NSLOTS][CLDFB_NO_CHANNELS_MAX]; float Cldfb_RealBuffer[MAX_INTERN_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_INTERN_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][PARAM_MC_MAX_NSLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#endif float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float mixing_matrix[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -1052,7 +1057,11 @@ void ivas_param_mc_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + NULL, +#endif + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, + Cldfb_RealBuffer, Cldfb_ImagBuffer ); } else if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_CLDFB ) { @@ -1073,8 +1082,13 @@ void ivas_param_mc_dec( { if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; +#else RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; +#endif } else { diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index c79bc38019..d481ffa904 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -552,4 +552,47 @@ const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENCE_BINS] 0.048207f, 0.10796f, 0.11845f, 0.047886f, 0.035917f, 0.045196f, 0.018863f, 0.015547f, 0.014157f }; +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*----------------------------------------------------------------------* + * split rendering ROM tables + *-----------------------------------------------------------------------*/ +const float split_rend_relative_yaw_angles[MAX_YAW_ANGLES] = {0.0f, -15.0f, 30.0f}; /*actual rotations would be Ref, Ref - 15, Ref - 15 + 30 */ +const float split_rend_relative_pitch_angles[MAX_PITCH_ANGLES] = {0.0f}; +const float split_rend_relative_roll_angles[MAX_ROLL_ANGLES] = {0.0f}; +const int16_t SplitRend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1] = +{ + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 34, 36, 38, 40, 50, 60 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 20, 25, 30, 35, 40, 50, 60 + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 21, 23, 25, 27, 30, 35, 40, 50, 60 + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 25, 40, 60 +}; + +const int32_t ivas_split_rend_huff_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3] = { + { 0, 1, 0 },{ 1, 2, 2 },{ 2, 3, 6 },{ 3, 4, 14 }, + { 4, 5, 30 },{ 5, 6, 62 },{ 6, 7, 126 },{ 7, 8, 254 }, + { 8, 9, 510 },{ 9, 10, 1022 },{ 10, 11, 2046 },{ 11, 12, 4094 }, + { 12, 13, 8190 },{ 13, 14, 16382 },{ 14, 14, 16383 } +}; +const int32_t ivas_split_rend_huff_pred_consts[IVAS_SPLIT_REND_PRED_QUANT_PNTS][3] = { + /* + { -15, 16, 65532 },{ -14, 16, 65533 },{ -13, 15, 32764 },{ -12, 14, 16380 }, + { -11, 13, 8188 },{ -10, 12, 4092 },{ -9, 11, 2044 },{ -8, 10, 1020 },{ -7, 9, 508 }, + { -6, 8, 252 },{ -5, 7, 124 },{ -4, 6, 60 },{ -3, 5, 28 }, + { -2, 4, 12 },{ -1, 3, 4 },{ 0, 1, 0 },{ 1, 3, 5 }, + { 2, 4, 13 },{ 3, 5, 29 },{ 4, 6, 61 },{ 5, 7, 125 }, + { 6, 8, 253 },{ 7, 9, 509 },{ 8, 10, 1021 },{ 9, 11, 2045 }, + { 10, 12, 4093 },{ 11, 13, 8189 },{ 12, 14, 16381 },{ 13, 15, 32765 }, + { 14, 16, 65534 },{ 15, 16, 65535 }*/ + +{-15,10,1020},{-14,10,1021},{-13,9,506},{-12,9,507}, +{-11,8,250},{-10,8,251},{-9,7,120},{-8,7,121}, +{-7,6,56},{-6,6,57},{-5,5,24},{-4,5,25},{-3,4,8}, +{-2,4,9},{-1,3,2},{0,2,0},{1,3,3}, +{2,4,10},{3,4,11},{4,5,26},{5,5,27}, +{6,6,58},{7,6,59},{8,7,122},{9,7,123}, +{10,7,124},{11,8,252},{12,9,508},{13,9,509}, +{14,10,1022},{15,10,1023}, +}; +#endif + /* clang-format on */ diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index febc60e2e5..aa5f48cbe9 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -156,4 +156,16 @@ extern const float diffuseFieldCoherenceDifferenceX[BINAURAL_COHERENCE_DIFFERENC extern const float diffuseFieldCoherenceDifferenceY[BINAURAL_COHERENCE_DIFFERENCE_BINS]; extern const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENCE_BINS]; +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*----------------------------------------------------------------------* + * split rendering ROM tables + *-----------------------------------------------------------------------*/ +extern const float split_rend_relative_yaw_angles[MAX_YAW_ANGLES]; +extern const float split_rend_relative_pitch_angles[MAX_PITCH_ANGLES]; +extern const float split_rend_relative_roll_angles[MAX_ROLL_ANGLES]; +extern const int16_t SplitRend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1]; +extern const int32_t ivas_split_rend_huff_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_pred_consts[IVAS_SPLIT_REND_PRED_QUANT_PNTS][3]; +#endif + #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 975fb60480..3c02a05d9b 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -159,6 +159,9 @@ ivas_error ivas_sba_dec_reinit( /* Fastconv binaural renderer handle */ ivas_binRenderer_close( &st_ivas->hBinRenderer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_split_renderer_close( &st_ivas->splitBinRend.splitrend ); +#endif /* Parametric binaural renderer handle */ ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); @@ -460,6 +463,9 @@ ivas_error ivas_sba_dec_reinit( { return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, hDecoderConfig->output_Fs, hDecoderConfig->Opt_splitRendMode, 1 ); +#endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -794,10 +800,16 @@ ivas_error ivas_sba_dec_reconfigure( { return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, st_ivas->hDecoderConfig->output_Fs, st_ivas->hDecoderConfig->Opt_splitRendMode, 1 ); +#endif } else if ( st_ivas->hBinRenderer != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) ) { ivas_binRenderer_close( &st_ivas->hBinRenderer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_split_renderer_close( &st_ivas->splitBinRend.splitrend ); +#endif } if ( st_ivas->hDiracDecBin == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index f316c746cf..4eed6b8ced 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -83,8 +83,6 @@ static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, co static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decoder_State *st, const int16_t bw, const int16_t num_bands, int16_t *num_dmx_per_band, int16_t *num_dec_per_band ); -static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 ); - static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode ); @@ -2482,7 +2480,7 @@ static void ivas_parse_parameter_bitstream_dtx( * Deindex real index *-----------------------------------------------------------------------------------------*/ -static ivas_error ivas_deindex_real_index( +ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index a18f826921..0b346d0036 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1264,15 +1264,107 @@ typedef struct ivas_binaural_rendering_conv_module_struct float ***filterTapsLeftImag; float ***filterTapsRightReal; float ***filterTapsRightImag; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + float ****filterStatesLeftReal; + float ****filterStatesLeftImag; +#else float ***filterStatesLeftReal; float ***filterStatesLeftImag; +#endif int16_t numTapsArray[BINAURAL_CONVBANDS]; int16_t numTaps; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t numPoses; +#endif } BINRENDERER_CONV_MODULE, *BINRENDERER_CONV_MODULE_HANDLE; +#ifdef SPLIT_REND_WITH_HEAD_ROT +/* binaural split rendering head rotation data structure */ +typedef struct ivas_binaural_head_rot_split_rendering_md_struct +{ + float pred_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float pred_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd; + int16_t pred_mat_re_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t pred_mat_im_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t gd_idx; +} BIN_HR_SPLIT_REND_MD, *BIN_HR_SPLIT_REND_MD_HANDLE; + +typedef struct ivas_split_rend_huffman_cfg_t +{ + const int32_t *codebook; + int16_t min_len; + int16_t max_len; + int16_t sym_len; +} ivas_split_rend_huffman_cfg_t; + +typedef struct ivas_binaural_head_rot_split_rendering_huff_struct +{ + ivas_split_rend_huffman_cfg_t pred; + int16_t pred_idx_trav[IVAS_SPLIT_REND_PRED_QUANT_PNTS]; + int16_t pred_base2_code_len; + ivas_split_rend_huffman_cfg_t gd; + int16_t gd_base2_code_len; + int16_t gd_idx_trav[IVAS_SPLIT_REND_D_QUANT_PNTS]; +} BIN_HR_SPLIT_REND_HUFF, *BIN_HR_SPLIT_REND_HUFF_HANDLE; + +typedef struct ivas_binaural_head_rot_split_pre_rendering_struct +{ + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; + float fix_pos_rot_mat[MAX_YAW_ANGLES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + BIN_HR_SPLIT_REND_HUFF huff_cfg; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; +#endif +} BIN_HR_SPLIT_PRE_REND, *BIN_HR_SPLIT_PRE_REND_HANDLE; + +typedef struct ivas_binaural_head_rot_split_post_rendering_struct +{ + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; + float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + BIN_HR_SPLIT_REND_HUFF huff_cfg; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float mixer_mat_re[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mixer_mat_im[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd_mem[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS]; +#else + float mixer_mat_re[1][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mixer_mat_im[1][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd_mem[1][MAX_SPLIT_REND_MD_BANDS]; +#endif + int16_t cf_flag; + HANDLE_CLDFB_FILTER_BANK cldfbSyn[BINAURAL_CHANNELS]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HANDLE_CLDFB_FILTER_BANK cldfbSynReconsBinDec[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS]; +#endif +} BIN_HR_SPLIT_POST_REND, *BIN_HR_SPLIT_POST_REND_HANDLE; + +typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct +{ + void *pLcld_enc; +} BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; + +typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct +{ + void *pLcld_dec; +} BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; + +typedef struct +{ + HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; +} CLDFB_HANDLES_WRAPPER, *CLDFB_HANDLES_WRAPPER_HANDLE; +typedef struct +{ + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend; + BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc; + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; + BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec; + CLDFB_HANDLES_WRAPPER_HANDLE hCldfbHandles; +} SPLIT_REND_WRAPPER; +#endif + /* Fastconv binaural data structure */ typedef struct ivas_binaural_rendering_struct { @@ -1287,14 +1379,15 @@ typedef struct ivas_binaural_rendering_struct int16_t nInChannels; /* number input channels */ int8_t render_lfe; /* Flag to render LFE in binaural rendering*/ IVAS_FORMAT ivas_format; /* format; corresponds to st_ivas->ivas_format, unless the signal gets transormed to a different domain for rendering */ - +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_MODE splitRendMode; /*Split rendering mode, pre, post (OR combined in debug mode)*/ +#endif /* Convolution module structure */ BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; /* Variables related to reverb module */ float earlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; REVERB_STRUCT_HANDLE hReverb; - } BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE; @@ -1688,7 +1781,6 @@ typedef struct ivas_render_config_t ivas_renderTypeOverride renderer_type_override; #endif ivas_roomAcoustics_t roomAcoustics; - } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; @@ -1877,7 +1969,10 @@ 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 */ - int16_t orientation_tracking; /* indicates orientation tracking type */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_MODE Opt_splitRendMode; /* Split rendering mode */ +#endif + int16_t orientation_tracking; /* indicates orientation tracking type */ float no_diegetic_pan; int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ @@ -1889,7 +1984,24 @@ typedef struct decoder_config_structure } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; - +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct +{ +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#endif +} IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA, *IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE; +typedef struct +{ + IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE hMultiBinCldfbData; /*scratch buffer for frame by frame processing*/ + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ + SPLIT_REND_WRAPPER splitrend; +} IVAS_DEC_SPLIT_REND_WRAPPER; +#endif /*----------------------------------------------------------------------------------* * * Main IVAS decoder structure @@ -1975,6 +2087,11 @@ typedef struct Decoder_Struct int32_t noClipping; /* number of clipped samples */ #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_DEC_SPLIT_REND_WRAPPER splitBinRend; + HEAD_TRACK_DATA_HANDLE hPostRendheadTrackData; +#endif + } Decoder_Struct; /* clang-format on */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d45527b740..676076fc1f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -95,7 +95,6 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int16_t orientation_tracking, const float no_diegetic_pan ); - /*---------------------------------------------------------------------* * IVAS_DEC_Open() * @@ -388,6 +387,10 @@ ivas_error IVAS_DEC_Configure( 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 SPLIT_REND_WITH_HEAD_ROT + , + const IVAS_SPLIT_REND_MODE splitRendMode /* i : split rend mode */ +#endif #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ @@ -444,6 +447,10 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_Headrotation = enableHeadRotation; hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hDecoderConfig->Opt_splitRendMode = splitRendMode; +#endif + /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) { @@ -620,6 +627,10 @@ ivas_error IVAS_DEC_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ int16_t *nOutSamples /* o : number of samples written to output buffer */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits +#endif ) { Decoder_Struct *st_ivas; @@ -646,7 +657,12 @@ ivas_error IVAS_DEC_GetSamples( else if ( hIvasDec->mode == IVAS_DEC_MODE_IVAS ) { /* run the main IVAS decoding routine */ - if ( ( error = ivas_dec( st_ivas, pcmBuf ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_dec( st_ivas, pcmBuf +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + hSplitRendBits +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -832,6 +848,10 @@ 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 */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_MODE splitRendMode /* i : flag to determine split rendering mode*/ +#endif ) { HEAD_TRACK_DATA_HANDLE hHeadTrackData; @@ -843,6 +863,12 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } hHeadTrackData = hIvasDec->st_ivas->hHeadTrackData; +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( splitRendMode == SPLIT_REND_POST ) + { + hHeadTrackData = hIvasDec->st_ivas->hPostRendheadTrackData; + } +#endif if ( hHeadTrackData == NULL ) { @@ -858,7 +884,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( hHeadTrackData->Quaternions[i].z = orientation[i].z; } - hIvasDec->st_ivas->hHeadTrackData->num_quaternions = 0; + hHeadTrackData->num_quaternions = 0; return IVAS_ERR_OK; } @@ -1345,7 +1371,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = st->total_brate; } - if ( ( error = IVAS_DEC_GetSamples( hIvasDec, pcmBuf, &nOutSamplesElse ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_GetSamples( hIvasDec, pcmBuf, &nOutSamplesElse +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + NULL +#endif + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f43034c885..4a052ba32b 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -127,6 +127,10 @@ ivas_error IVAS_DEC_Configure( 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 SPLIT_REND_WITH_HEAD_ROT + , + const IVAS_SPLIT_REND_MODE splitRendMode /* i : split rendering mode */ +#endif #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ @@ -153,6 +157,10 @@ ivas_error IVAS_DEC_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ int16_t *nOutSamples /* o : number of samples written to output buffer */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits /* o : bitstream output for split rendering mode*/ +#endif ); /*! r: error code */ @@ -173,6 +181,10 @@ 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 */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_MODE splitRendMode /* i : flag to determine split rendering mode*/ +#endif ); /*! r: error code */ diff --git a/lib_rend/ivas_binauralRenderer.c b/lib_rend/ivas_binauralRenderer.c index 09713a6f5c..ff85e0c73b 100644 --- a/lib_rend/ivas_binauralRenderer.c +++ b/lib_rend/ivas_binauralRenderer.c @@ -40,6 +40,11 @@ #include "ivas_rom_rend.h" #include "ivas_rom_com.h" #include "ivas_rom_binauralRenderer.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "ivas_rom_dec.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -58,6 +63,10 @@ static void ivas_binRenderer_filterModule( float CLDFB_real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : real part of LS signals */ float CLDFB_imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : imag part of LS signals */ BINAURAL_RENDERER_HANDLE hBinRenderer /* i/o: fastconv binaural renderer handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + int16_t pos_idx +#endif ) { int16_t bandIdx, k, chIdx, tapIdx; @@ -68,8 +77,13 @@ static void ivas_binRenderer_filterModule( { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + filterStatesLeftRealPtr = (float *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal[pos_idx][bandIdx][chIdx][0] ); + filterStatesLeftImagPtr = (float *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag[pos_idx][bandIdx][chIdx][0] ); +#else filterStatesLeftRealPtr = (float *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx][0] ); filterStatesLeftImagPtr = (float *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx][0] ); +#endif filterTapsLeftRealPtr = hBinRenderer->hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx]; filterTapsLeftImagPtr = hBinRenderer->hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx]; @@ -112,7 +126,6 @@ static void ivas_binRenderer_filterModule( return; } - /*------------------------------------------------------------------------- * ivas_binRenderer_convModuleOpen() * @@ -128,6 +141,9 @@ static ivas_error ivas_binRenderer_convModuleOpen( { int16_t bandIdx, chIdx; BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx; +#endif /*-----------------------------------------------------------------* * prepare library opening @@ -229,7 +245,69 @@ static ivas_error ivas_binRenderer_convModuleOpen( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + hBinRenConvModule->numPoses = MAX_HEAD_ROT_POSES + 1; +#else + hBinRenConvModule->numPoses = MAX_HEAD_ROT_POSES; +#endif + } + else + { + hBinRenConvModule->numPoses = 1; + } + + if ( ( hBinRenConvModule->filterStatesLeftReal = (float ****) count_malloc( hBinRenConvModule->numPoses * sizeof( float *** ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + if ( ( hBinRenConvModule->filterStatesLeftImag = (float ****) count_malloc( hBinRenConvModule->numPoses * sizeof( float *** ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + for ( pos_idx = 0; pos_idx < hBinRenConvModule->numPoses; pos_idx++ ) + { + if ( ( hBinRenConvModule->filterStatesLeftReal[pos_idx] = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + if ( ( hBinRenConvModule->filterStatesLeftImag[pos_idx] = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) + { + if ( ( hBinRenConvModule->filterStatesLeftReal[pos_idx][bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + if ( ( hBinRenConvModule->filterStatesLeftImag[pos_idx][bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) + { + if ( ( hBinRenConvModule->filterStatesLeftReal[pos_idx][bandIdx][chIdx] = (float *) count_malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + + if ( ( hBinRenConvModule->filterStatesLeftImag[pos_idx][bandIdx][chIdx] = (float *) count_malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); + } + } + } + } +#else if ( ( hBinRenConvModule->filterStatesLeftReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); @@ -265,8 +343,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } } +#endif /* set memories */ + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) @@ -305,10 +385,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && hRenderConfig->roomAcoustics.use_brir ) { - /* set the memories to zero */ - set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); - set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); - if ( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = leftBRIRReal[bandIdx][tmp]; @@ -326,10 +402,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { - /* set the memories to zero */ - set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTaps ); - set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTaps ); - if ( isLoudspeaker ) { hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = leftHRIRReal[bandIdx][tmp]; @@ -349,6 +421,31 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < hBinRenConvModule->numPoses; pos_idx++ ) + { + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) + { + for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) + { + /* set the memories to zero */ + set_zero( hBinRenConvModule->filterStatesLeftReal[pos_idx][bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); + set_zero( hBinRenConvModule->filterStatesLeftImag[pos_idx][bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); + } + } + } +#else + for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) + { + for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) + { + /* set the memories to zero */ + set_zero( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); + set_zero( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] ); + } + } +#endif + hBinRenderer->hBinRenConvModule = hBinRenConvModule; return IVAS_ERR_OK; @@ -474,6 +571,77 @@ static void ivas_binaural_obtain_DMX( return; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*------------------------------------------------------------------------- + * ivas_rend_openCldfbRend() + * + * Allocate and initialize CLDFB fast conv renderer handle + *------------------------------------------------------------------------*/ + +ivas_error ivas_rend_openCldfbRend( + CLDFB_REND_WRAPPER *pCldfbRend, + const IVAS_REND_AudioConfig inConfig, + const IVAS_SPLIT_REND_MODE splitRendMode, + RENDER_CONFIG_DATA *hRendCfg, + const int32_t output_Fs ) +{ + BINAURAL_RENDERER_HANDLE hBinRenderer; + int16_t convBand; + ivas_error error; + AUDIO_CONFIG in_config; + + error = IVAS_ERR_OK; + + /*-----------------------------------------------------------------* + * prepare library opening + *-----------------------------------------------------------------*/ + + if ( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) count_malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Renderer\n" ) ); + } + + if ( ( hBinRenderer->hInputSetup = (IVAS_OUTPUT_SETUP_HANDLE) count_malloc( sizeof( IVAS_OUTPUT_SETUP ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for output setup Binaural Renderer\n" ) ); + } + + hBinRenderer->rotInCldfb = 1; + hBinRenderer->splitRendMode = splitRendMode; + + hBinRenderer->ivas_format = SBA_FORMAT; + + hBinRenderer->max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); + convBand = hBinRenderer->max_band; + + hBinRenderer->timeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; /* Corresponds to 5 msec sound to motion latency */ + in_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); + + if ( convBand > BINAURAL_CONVBANDS ) + { + hBinRenderer->conv_band = BINAURAL_CONVBANDS; + } + else + { + hBinRenderer->conv_band = convBand; + } + hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; + getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); + + /* Allocate memories and buffers needed for convolutional module */ + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config, hRendCfg ) ) != IVAS_ERR_OK ) + { + return error; + } + pCldfbRend->binaural_latency_ns = (int32_t) ( FASTCONV_HOA3_latency_s * 1000000000.f ); + hBinRenderer->hReverb = NULL; + hBinRenderer->hEFAPdata = NULL; + + pCldfbRend->hCldfbRend = hBinRenderer; + + return error; +} +#endif /*------------------------------------------------------------------------- * ivas_binRenderer_open() @@ -509,6 +677,10 @@ ivas_error ivas_binRenderer_open( hBinRenderer->rotInCldfb = 1; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + hBinRenderer->splitRendMode = st_ivas->hDecoderConfig->Opt_splitRendMode; +#endif + /* Declare some common variables needed for renderer */ /* Which format used for binaural rendering (needed for late reverb) ? MC or SBA */ if ( st_ivas->hIntSetup.is_loudspeaker_setup ) @@ -647,6 +819,9 @@ static void ivas_binRenderer_convModuleClose( ) { int16_t bandIdx, chIdx; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t posIdx; +#endif BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; hBinRenConvModule = ( *hBinRenderer )->hBinRenConvModule; @@ -683,7 +858,39 @@ static void ivas_binRenderer_convModuleClose( count_free( hBinRenConvModule->filterTapsRightImag ); hBinRenConvModule->filterTapsRightImag = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( posIdx = 0; posIdx < hBinRenConvModule->numPoses; posIdx++ ) + { + for ( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) + { + for ( chIdx = 0; chIdx < ( *hBinRenderer )->nInChannels; chIdx++ ) + { + count_free( hBinRenConvModule->filterStatesLeftReal[posIdx][bandIdx][chIdx] ); + hBinRenConvModule->filterStatesLeftReal[posIdx][bandIdx][chIdx] = NULL; + + count_free( hBinRenConvModule->filterStatesLeftImag[posIdx][bandIdx][chIdx] ); + hBinRenConvModule->filterStatesLeftImag[posIdx][bandIdx][chIdx] = NULL; + } + + count_free( hBinRenConvModule->filterStatesLeftReal[posIdx][bandIdx] ); + hBinRenConvModule->filterStatesLeftReal[posIdx][bandIdx] = NULL; + count_free( hBinRenConvModule->filterStatesLeftImag[posIdx][bandIdx] ); + hBinRenConvModule->filterStatesLeftImag[posIdx][bandIdx] = NULL; + } + + count_free( hBinRenConvModule->filterStatesLeftReal[posIdx] ); + hBinRenConvModule->filterStatesLeftReal[posIdx] = NULL; + + count_free( hBinRenConvModule->filterStatesLeftImag[posIdx] ); + hBinRenConvModule->filterStatesLeftImag[posIdx] = NULL; + } + count_free( hBinRenConvModule->filterStatesLeftReal ); + hBinRenConvModule->filterStatesLeftReal = NULL; + + count_free( hBinRenConvModule->filterStatesLeftImag ); + hBinRenConvModule->filterStatesLeftImag = NULL; +#else for ( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) { for ( chIdx = 0; chIdx < ( *hBinRenderer )->nInChannels; chIdx++ ) @@ -707,7 +914,7 @@ static void ivas_binRenderer_convModuleClose( count_free( hBinRenConvModule->filterStatesLeftImag ); hBinRenConvModule->filterStatesLeftImag = NULL; - +#endif count_free( ( *hBinRenderer )->hBinRenConvModule ); ( *hBinRenderer )->hBinRenConvModule = NULL; @@ -715,6 +922,23 @@ static void ivas_binRenderer_convModuleClose( return; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*------------------------------------------------------------------------- + * ivas_rend_openCldfbRend() + * + * Close CLDFB based fastconv binaural renderer memories + *------------------------------------------------------------------------*/ +void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ) +{ + if ( pCldfbRend->hCldfbRend->hInputSetup != NULL ) + { + count_free( pCldfbRend->hCldfbRend->hInputSetup ); + pCldfbRend->hCldfbRend->hInputSetup = NULL; + } + ivas_binRenderer_close( &pCldfbRend->hCldfbRend ); + return; +} +#endif /*------------------------------------------------------------------------- * ivas_binRenderer_close() @@ -801,8 +1025,13 @@ void ivas_binaural_cldfb( { float Cldfb_RealBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif int16_t slot_idx, subframeIdx, index_slot, idx_in, idx_lfe, maxBand, ch; /* Implement a 5 msec loops */ @@ -839,7 +1068,13 @@ void ivas_binaural_cldfb( } /* Implement binaural rendering */ - ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + NULL, +#endif + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, + Cldfb_RealBuffer, + Cldfb_ImagBuffer ); /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -851,8 +1086,13 @@ void ivas_binaural_cldfb( for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx]; +#else RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch][slot_idx]; ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch][slot_idx]; +#endif } cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][index_slot * maxBand] ), maxBand * MAX_PARAM_SPATIAL_SUBFRAMES, st_ivas->cldfbSynDec[ch] ); @@ -862,7 +1102,6 @@ void ivas_binaural_cldfb( return; } - /*------------------------------------------------------------------------- * ivas_binRenderer() * @@ -870,21 +1109,59 @@ void ivas_binaural_cldfb( *-------------------------------------------------------------------------*/ void ivas_binRenderer( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ +#else float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ +#endif + float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ ) { int16_t chIdx, k; int16_t numTimeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx, num_poses; +#endif wmops_sub_start( "fastconv_binaural_rendering" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + num_poses = MAX_HEAD_ROT_POSES + 1; +#else + num_poses = MAX_HEAD_ROT_POSES; +#endif + } + else + { + num_poses = 1; + } +#endif + /* Compute Convolution */ /* memory reset for the binaural output */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { + set_zero( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); + set_zero( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); + } + } + } +#else for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) { for ( k = 0; k < numTimeSlots; k++ ) @@ -893,6 +1170,7 @@ void ivas_binRenderer( set_zero( Cldfb_ImagBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); } } +#endif /* Head rotation in HOA3 or CICPx */ if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) @@ -924,7 +1202,94 @@ void ivas_binRenderer( ivas_sba2mc_cldfb( *( hBinRenderer->hInputSetup ), RealBuffer, ImagBuffer, hBinRenderer->nInChannels, hBinRenderer->conv_band, hBinRenderer->hoa_dec_mtx ); } - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, hBinRenderer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], RealBuffer, ImagBuffer, hBinRenderer, 0 ); +#else + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); +#endif + +#ifdef SPLIT_REND_WITH_HEAD_ROT + /*TODO : move this to a separate function*/ + if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + { + int16_t yaw_idx, pitch_idx, roll_idx; + IVAS_QUATERNION Quaternions_rel, Quaternions_abs, *Quaternions_ref; + float Rmat_local[3][3]; + if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) + { + Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; + Quaternions_rel.w = -3.0f; /*euler*/ + Quaternions_abs.w = -3.0f; /*euler*/ + Quat2Euler( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + // Quaternions_abs.x = Quaternions_ref->x; + // Quaternions_abs.y = Quaternions_ref->y; + // Quaternions_abs.z = Quaternions_ref->z; + for ( yaw_idx = 0; yaw_idx < MAX_YAW_ANGLES; yaw_idx++ ) + { + for ( pitch_idx = 0; pitch_idx < MAX_PITCH_ANGLES; pitch_idx++ ) + { + for ( roll_idx = 0; roll_idx < MAX_ROLL_ANGLES; roll_idx++ ) + { + pos_idx = yaw_idx * MAX_PITCH_ANGLES * MAX_ROLL_ANGLES + pitch_idx * MAX_ROLL_ANGLES + roll_idx; + if ( pos_idx == 0 ) + { + continue; + } + + Quaternions_rel.x = split_rend_relative_yaw_angles[yaw_idx]; + Quaternions_rel.y = split_rend_relative_pitch_angles[pitch_idx]; + Quaternions_rel.z = split_rend_relative_roll_angles[roll_idx]; + Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; + Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; + Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; + + + QuatToRotMat( Quaternions_rel, Rmat_local ); + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + pos_idx +#endif + ); + } + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + if ( hPostRendHeadTrackData != NULL ) + { + IVAS_QUATERNION *Quaternions_new1; + IVAS_QUATERNION Quaternions_new; + Quaternions_new1 = &hPostRendHeadTrackData->Quaternions[hPostRendHeadTrackData->num_quaternions++]; + Quaternions_new.w = -3.0f; /*euler*/ + Quat2Euler( *Quaternions_new1, &Quaternions_new.z, &Quaternions_new.y, &Quaternions_new.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quaternions_rel.x = Quaternions_new.x - Quaternions_abs.x; + Quaternions_rel.y = Quaternions_new.y - Quaternions_abs.y; + Quaternions_rel.z = Quaternions_new.z - Quaternions_abs.z; + Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; + Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; + Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; + + QuatToRotMat( Quaternions_rel, Rmat_local ); + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES], Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES], RealBuffer, ImagBuffer, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + MAX_HEAD_ROT_POSES +#endif + ); + } +#endif + } + } +#endif + /* Obtain the binaural dmx and compute the reverb */ if ( hBinRenderer->hReverb != NULL ) @@ -952,9 +1317,18 @@ void ivas_binRenderer( { for ( k = 0; k < numTimeSlots; k++ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + /* Combine first and second parts to generate binaural output signal with room effect */ + v_add( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); + v_add( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); + } +#else /* Combine first and second parts to generate binaural output signal with room effect */ v_add( Cldfb_RealBuffer_Binaural[chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); v_add( Cldfb_ImagBuffer_Binaural[chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); +#endif } } } @@ -963,3 +1337,72 @@ void ivas_binRenderer( return; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT +void ivas_rend_CldfbMultiBinRendProcess( + const BINAURAL_RENDERER_HANDLE hCldfbRend, + const IVAS_REND_HeadRotData *pHeadRotData, + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Real[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ + float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) +{ + int16_t sf_idx, slot_idx, ch_idx, idx, pose_idx; + HEAD_TRACK_DATA head_track; + float Cldfb_RealBuffer_sfIn[MAX_INPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_sfIn[MAX_INPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HEAD_TRACK_DATA head_track_post; + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif + + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; + for ( ch_idx = 0; ch_idx < hCldfbRend->nInChannels; ch_idx++ ) + { + mvr2r( &Cldfb_In_Real[ch_idx][idx][0], &Cldfb_RealBuffer_sfIn[ch_idx][slot_idx][0], hCldfbRend->max_band ); + mvr2r( &Cldfb_In_Imag[ch_idx][idx][0], &Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx][0], hCldfbRend->max_band ); + } + } + head_track.num_quaternions = 0; + head_track.shd_rot_max_order = -1; + head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + head_track_post.num_quaternions = 0; + head_track_post.shd_rot_max_order = -1; + head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); +#endif + + ivas_binRenderer( hCldfbRend, &head_track, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + &head_track_post, +#endif + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pose_idx = 0; pose_idx < MAX_HEAD_ROT_POSES + 1; pose_idx++ ) +#else + for ( pose_idx = 0; pose_idx < MAX_HEAD_ROT_POSES; pose_idx++ ) +#endif + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + mvr2r( &Cldfb_RealBuffer_Binaural[pose_idx][ch_idx][slot_idx][0], &Cldfb_Out_Real[pose_idx][ch_idx][idx][0], hCldfbRend->max_band ); + mvr2r( &Cldfb_ImagBuffer_Binaural[pose_idx][ch_idx][slot_idx][0], &Cldfb_Out_Imag[pose_idx][ch_idx][idx][0], hCldfbRend->max_band ); + } + } + } + + return; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_lib_rend_internal.h b/lib_rend/ivas_lib_rend_internal.h index f758bc780a..f985b662a0 100644 --- a/lib_rend/ivas_lib_rend_internal.h +++ b/lib_rend/ivas_lib_rend_internal.h @@ -41,6 +41,9 @@ typedef struct { int8_t headRotEnabled; IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_QUATERNION headPositionsPostRend[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; } IVAS_REND_HeadRotData; @@ -58,6 +61,14 @@ typedef struct HRTFS_HANDLE hHrtfCrend; } CREND_WRAPPER; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct +{ + int32_t binaural_latency_ns; + BINAURAL_RENDERER_HANDLE hCldfbRend; +} CLDFB_REND_WRAPPER; +#endif + IVAS_REND_AudioConfigType getAudioConfigType( const IVAS_REND_AudioConfig config ); @@ -75,6 +86,47 @@ ivas_error ivas_rend_openCrend( RENDER_CONFIG_DATA *hRendCfg, const int32_t output_Fs ); +#ifdef SPLIT_REND_WITH_HEAD_ROT +void ivas_rend_CldfbMultiBinRendProcess( + const BINAURAL_RENDERER_HANDLE hCldfbRend, + const IVAS_REND_HeadRotData *pHeadRotData, + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Real[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ + float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ); + +ivas_error ivas_rend_openCldfb( + HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], + const IVAS_REND_AudioConfig inConfig, + const int32_t output_Fs ); +ivas_error ivas_rend_openCldfbRend( + CLDFB_REND_WRAPPER *pCldfbRend, + const IVAS_REND_AudioConfig inConfig, + const IVAS_SPLIT_REND_MODE splitRendMode, + RENDER_CONFIG_DATA *hRendCfg, + const int32_t output_Fs ); + +void ivas_split_rend_bitstream_init( ivas_split_rend_bits_t *pBits, const int32_t buf_len_bytes, uint8_t *pbuf ); +void ivas_split_rend_huffman_dec_init_min_max_len( ivas_split_rend_huffman_cfg_t *p_huff_cfg ); +void ivas_split_rend_init_huff_cfg( BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ); +void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); +int16_t wrap_a( int16_t val, int16_t min_val, int16_t max_val ); +void ivas_SplitRenderer_getdiagdiff( + int16_t in_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + int16_t out_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + const int16_t sign, + const int16_t min_val, + const int16_t max_val ); +void ivas_split_rend_bitstream_write_int32( ivas_split_rend_bits_t *pBits, int32_t val, int32_t bits ); +int32_t ivas_split_rend_bitstream_read_int32( ivas_split_rend_bits_t *pBits, int32_t bits ); +IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( + const IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME], + int16_t subframe_idx ); + +void ivas_rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS] ); +void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); +#endif + ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, const IVAS_REND_AudioConfig inConfig, diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index e5407abff4..fae2144afe 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -627,3 +627,15 @@ void ivas_renderer_select( return; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT +void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ) +{ + hSplitRendBits->bits_written = 0; + hSplitRendBits->bits_read = 0; + hSplitBinRend->hSplitRendBits = hSplitRendBits; + + hSplitBinRend->hMultiBinCldfbData = (IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) dynamic_malloc( sizeof( IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ); + return; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c new file mode 100644 index 0000000000..249acceea7 --- /dev/null +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -0,0 +1,92 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include "options.h" +#include +#include "ivas_prot.h" +#include "prot.h" +#include "cnst.h" +#include "ivas_cnst.h" +#include "ivas_rom_rend.h" +#include "ivas_rom_com.h" +#include "ivas_rom_dec.h" +#include "ivas_rom_binauralRenderer.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + +#ifdef SPLIT_REND_WITH_HEAD_ROT +ivas_error ivas_splitBinLCLDDecOpen( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ) +{ + ivas_error error; + BIN_HR_SPLIT_LCLD_DEC_HANDLE splitBinLCLDDec; + error = IVAS_ERR_OK; + if ( ( splitBinLCLDDec = (BIN_HR_SPLIT_LCLD_DEC_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_LCLD_DEC ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); + } + + splitBinLCLDDec->pLcld_dec = NULL; // place holder for CLDFB decoder handle + + *hSplitBinLCLDDec = splitBinLCLDDec; + return error; +} + +void ivas_splitBinLCLDDecClose( + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ) +{ + if ( ( *hSplitBinLCLDDec ) != NULL ) + { + count_free( *hSplitBinLCLDDec ); + *hSplitBinLCLDDec = NULL; + } + return; +} + +void ivas_splitBinLCLDDecProcess( + BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec, + ivas_split_rend_bits_t *pBits, + float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) +{ + assert( hSplitBinLCLDDec != NULL ); + assert( Cldfb_Out_Real != NULL ); + assert( Cldfb_Out_Imag != NULL ); + assert( pBits != NULL ); + return; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c new file mode 100644 index 0000000000..355712e327 --- /dev/null +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -0,0 +1,92 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include "options.h" +#include +#include "ivas_prot.h" +#include "prot.h" +#include "cnst.h" +#include "ivas_cnst.h" +#include "ivas_rom_rend.h" +#include "ivas_rom_com.h" +#include "ivas_rom_dec.h" +#include "ivas_rom_binauralRenderer.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + +#ifdef SPLIT_REND_WITH_HEAD_ROT +ivas_error ivas_splitBinLCLDEncOpen( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ) +{ + ivas_error error; + BIN_HR_SPLIT_LCLD_ENC_HANDLE splitBinLCLDEnc; + error = IVAS_ERR_OK; + if ( ( splitBinLCLDEnc = (BIN_HR_SPLIT_LCLD_ENC_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_LCLD_ENC ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); + } + + splitBinLCLDEnc->pLcld_enc = NULL; // place holder for CLDFB encoder handle + + *hSplitBinLCLDEnc = splitBinLCLDEnc; + return error; +} + +void ivas_splitBinLCLDEncClose( + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ) +{ + if ( ( *hSplitBinLCLDEnc ) != NULL ) + { + count_free( *hSplitBinLCLDEnc ); + *hSplitBinLCLDEnc = NULL; + } + return; +} + +void ivas_splitBinLCLDEncProcess( + BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + ivas_split_rend_bits_t *pBits ) +{ + assert( hSplitBinLCLDEnc != NULL ); + assert( Cldfb_In_Real != NULL ); + assert( Cldfb_In_Imag != NULL ); + assert( pBits != NULL ); + return; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c new file mode 100644 index 0000000000..56782f4989 --- /dev/null +++ b/lib_rend/ivas_splitRendererPost.c @@ -0,0 +1,1004 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include "options.h" +#include +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#include +#endif +#include "ivas_prot.h" +#include "prot.h" +#include "cnst.h" +#include "ivas_cnst.h" +#include "ivas_rom_rend.h" +#include "ivas_rom_com.h" +#include "ivas_rom_dec.h" +#include "ivas_rom_binauralRenderer.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + +#ifdef SPLIT_REND_WITH_HEAD_ROT +ivas_error ivas_splitBinPostRendOpen( + BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, + const int32_t output_Fs ) +{ + BIN_HR_SPLIT_POST_REND_HANDLE hBinRend; + ivas_error error; + int16_t ch; + + error = IVAS_ERR_OK; + if ( ( hBinRend = (BIN_HR_SPLIT_POST_REND_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_POST_REND ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for bin split post renderer Module \n" ) ); + } + + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + hBinRend->cldfbSyn[ch] = NULL; + } +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + hBinRend->cldfbSynReconsBinDec[i][ch] = NULL; + } + } +#endif + + + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( error = openCldfb( &( hBinRend->cldfbSyn[ch] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( error = openCldfb( &( hBinRend->cldfbSynReconsBinDec[i][ch] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } +#endif + hBinRend->cf_flag = 0; + set_fix_rotation_mat( hBinRend->fix_pos_rot_mat ); + ivas_split_rend_init_huff_cfg( &hBinRend->huff_cfg ); + *hBinHrSplitPostRend = hBinRend; + + return error; +} + +void ivas_splitBinPostRendClose( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend ) +{ + int16_t ch; + if ( ( *hBinHrSplitPostRend ) != NULL ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( *hBinHrSplitPostRend )->cldfbSyn[ch] != NULL ) + { + deleteCldfb( &( ( *hBinHrSplitPostRend )->cldfbSyn[ch] ) ); + ( *hBinHrSplitPostRend )->cldfbSyn[ch] = NULL; + } + } +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( *hBinHrSplitPostRend )->cldfbSynReconsBinDec[i][ch] != NULL ) + { + deleteCldfb( &( ( *hBinHrSplitPostRend )->cldfbSynReconsBinDec[i][ch] ) ); + ( *hBinHrSplitPostRend )->cldfbSynReconsBinDec[i][ch] = NULL; + } + } + } +#endif + + count_free( ( *hBinHrSplitPostRend ) ); + ( *hBinHrSplitPostRend ) = NULL; + } + return; +} + +/*-----------------------------------------------------------------------------------------* + * Function ivas_huffman_code_bits_present() + * + * Huffman code bits present + *-----------------------------------------------------------------------------------------*/ + +static int32_t ivas_split_rend_huffman_code_bits_present( + const int32_t *codebook, + const int32_t code, + const int32_t bits, + const int32_t len ) +{ + int32_t index = len + 1; + int32_t i = 0; + int32_t code_t, ind_t, bits_t; + + while ( i < len ) + { + ind_t = codebook[0]; + bits_t = codebook[1]; + code_t = codebook[2]; + if ( ( code == code_t ) && ( bits == bits_t ) ) + { + return ind_t; + } + codebook = codebook + 3; + i++; + } + + return index; +} + +static int16_t ivas_split_rend_huffman_decode_opt( + ivas_split_rend_huffman_cfg_t *huff_cfg, + ivas_split_rend_bits_t *pBits, + const int16_t *idx_trav_list ) +{ + int32_t i, ind, code, num_bits, code_b, num_bits_read; + const int32_t *codebook; + codebook = huff_cfg->codebook; + num_bits_read = 0; + ind = huff_cfg->codebook[0] - 1; + code = 0; + for ( i = 0; i < huff_cfg->sym_len; i++ ) + { + codebook = codebook + idx_trav_list[i] * 3; + num_bits = codebook[1]; + code_b = codebook[2]; + num_bits_read = num_bits - num_bits_read; + code = code << num_bits_read; + if ( num_bits_read > 0 ) + { + code |= ivas_split_rend_bitstream_read_int32( pBits, num_bits_read ); + } + + if ( code == code_b ) + { + ind = codebook[0]; + break; + } + + num_bits_read = num_bits; + codebook = huff_cfg->codebook; + } +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + assert( ind >= huff_cfg->codebook[0] ); +#endif + return (int16_t) ind; +} + +static int16_t ivas_split_rend_huffman_decode( + ivas_split_rend_huffman_cfg_t *huff_cfg, + ivas_split_rend_bits_t *pBits ) +{ + int32_t code, bit, num_bits_read, ind; + + code = ivas_split_rend_bitstream_read_int32( pBits, huff_cfg->min_len ); + num_bits_read = huff_cfg->min_len; + + ind = ivas_split_rend_huffman_code_bits_present( huff_cfg->codebook, code, num_bits_read, huff_cfg->sym_len ); + + while ( ind > huff_cfg->sym_len ) + { + bit = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + num_bits_read += 1; + code = code << 1 | bit; + ind = ivas_split_rend_huffman_code_bits_present( huff_cfg->codebook, code, num_bits_read, huff_cfg->sym_len ); + if ( num_bits_read > huff_cfg->max_len ) + { + assert( 0 ); + } + } + + return (int16_t) ind; +} + +static void ivas_split_rend_unquant_md( + BIN_HR_SPLIT_REND_MD_HANDLE hMd, + int16_t real_only, + float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) +{ + int16_t ch1, ch2; + + ivas_deindex_real_index( + &hMd->pred_mat_re_idx[0][0], + IVAS_SPLIT_REND_PRED_QUANT_PNTS, + IVAS_SPLIT_REND_PRED_MIN_VAL, + IVAS_SPLIT_REND_PRED_MAX_VAL, + &hMd->pred_mat_re[0][0], + BINAURAL_CHANNELS * BINAURAL_CHANNELS ); + ivas_deindex_real_index( + &hMd->pred_mat_im_idx[0][0], + IVAS_SPLIT_REND_PRED_QUANT_PNTS, + IVAS_SPLIT_REND_PRED_MIN_VAL, + IVAS_SPLIT_REND_PRED_MAX_VAL, + &hMd->pred_mat_im[0][0], + BINAURAL_CHANNELS * BINAURAL_CHANNELS ); + ivas_deindex_real_index( + &hMd->gd_idx, + IVAS_SPLIT_REND_D_QUANT_PNTS, + IVAS_SPLIT_REND_D_MIN_VAL, + IVAS_SPLIT_REND_D_MAX_VAL, + &hMd->gd, + 1 ); + + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_re[ch1][ch2] = hMd->pred_mat_re[ch1][ch2] + fix_pos_rot_mat[ch1][ch2]; + // hMd->pred_mat_re[ch1][ch2] = hQMd->pred_mat_re[ch1][ch2]; + } + } + if ( real_only ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_im[ch1][ch2] = 0.0f; + } + } + } + return; +} + +static void ivas_splitBinPostRendMdBase2Dec( + ivas_split_rend_bits_t *pBits, + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + const int16_t num_md_bands ) +{ + int16_t sf_idx, real_only, pos_idx, b, ch1, ch2; + int16_t min_pred_idx, min_gd_idx, pred_code_len, gd_code_len; + int16_t code; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; + + pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; + min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; + min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; + pred_code_len = pHuff_cfg->pred_base2_code_len; + gd_code_len = pHuff_cfg->gd_base2_code_len; + + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); + hMd->pred_mat_re_idx[ch1][ch2] = code + min_pred_idx; + } + } + + if ( real_only == 0 ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); + hMd->pred_mat_im_idx[ch1][ch2] = code + min_pred_idx; + } + } + } + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, gd_code_len ); + hMd->gd_idx = code + min_gd_idx; + } + } + } + + return; +} + +static void ivas_splitBinPostRendMdHuffDec( + ivas_split_rend_bits_t *pBits, + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + const int16_t num_md_bands ) +{ + int16_t pos_idx, b, sf_idx; + int16_t real_only, ch1, ch2; + int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t min_pred_idx, max_pred_idx; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; + + pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; + min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; + max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; + real_only = 0; + + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); + // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + } + } + ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_idx, max_pred_idx ); + + if ( real_only == 0 ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); + // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + } + } + ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_im_idx, -1, min_pred_idx, max_pred_idx ); + } + hMd->gd_idx = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->gd, pBits, pHuff_cfg->gd_idx_trav ); + // hMd->gd_idx = ivas_split_rend_huffman_decode( &pHuff_cfg->gd, pBits ); + } + } + } + + return; +} + +void ivas_splitBinPostRendMdDec( + ivas_split_rend_bits_t *pBits, + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, +#endif + const int16_t num_md_bands ) +{ + int16_t pos_idx, b, sf_idx; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + int16_t ch1, ch2; +#endif + int16_t real_only, yaw_idx; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + real_only = 0; + +#ifdef SPLIT_REND_BASE2_CODING + ivas_splitBinPostRendMdBase2Dec( pBits, hBinHrSplitPostRend, num_md_bands ); +#else + ivas_splitBinPostRendMdHuffDec( pBits, hBinHrSplitPostRend, num_md_bands ); +#endif + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + yaw_idx = ( pos_idx / ( MAX_PITCH_ANGLES * MAX_ROLL_ANGLES ) ); + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + /*verify that MD is decodd correctly*/ + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + int16_t val; + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + if ( abs( hMd->pred_mat_re_idx[ch1][ch2] - val ) > 0 ) + { + assert( 0 ); + } + + if ( real_only == 0 ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + if ( abs( hMd->pred_mat_im_idx[ch1][ch2] - val ) > 0 ) + { + assert( 0 ); + } + } + + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; + if ( abs( hMd->gd_idx - val ) > 0 ) + { + assert( 0 ); + } + } + } +#endif + + ivas_split_rend_unquant_md( hMd, + real_only, hBinHrSplitPostRend->fix_pos_rot_mat[yaw_idx] ); + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + /*verify that MD is decodd correctly*/ + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + float val; + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch1][ch2] + + hBinHrSplitPostRend->fix_pos_rot_mat[yaw_idx][ch1][ch2]; + if ( fabs( hMd->pred_mat_re[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch1][ch2]; + if ( fabs( hMd->pred_mat_im[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd; + if ( fabs( hMd->gd - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } +#endif + } + } + } + return; +} + +#define REAL_IMAG_INTERPOLATION +static void wrap_around_angle( float *a ) +{ + if ( ( *a ) > 180.0f ) + { + ( *a ) = ( *a ) - 360; + } + else if ( ( *a ) < -180.0f ) + { + ( *a ) = ( *a ) + 360; + } + return; +} +static void wrap_around_ypr( IVAS_QUATERNION *Quaternions ) +{ + /*only if quat is actually yaw, pitch , roll angles*/ + if ( Quaternions->w == -3.0f ) + { + wrap_around_angle( &Quaternions->x ); + wrap_around_angle( &Quaternions->y ); + wrap_around_angle( &Quaternions->z ); + } + return; +} +static void get_interpolation_vars( + const IVAS_QUATERNION *Quaternions_ref, + const IVAS_QUATERNION *Quaternions_act, + int16_t interp_pose_idx[2], + float *interp_fact ) +{ + IVAS_QUATERNION quaternions_diff, quaternions_diffx[MAX_HEAD_ROT_POSES], quaternions_ref_euler, quaternions_act_euler; + int16_t yaw_idx, pitch_idx, roll_idx, pos_idx; + float min_diff, d1, n1; + int16_t idx1, idx2; + + idx1 = 0; + idx2 = 0; + quaternions_diff.x = 0.0f; + quaternions_diff.y = 0.0f; + quaternions_diff.z = 0.0f; + + for ( yaw_idx = 0; yaw_idx < MAX_YAW_ANGLES; yaw_idx++ ) + { + for ( pitch_idx = 0; pitch_idx < MAX_PITCH_ANGLES; pitch_idx++ ) + { + for ( roll_idx = 0; roll_idx < MAX_ROLL_ANGLES; roll_idx++ ) + { + pos_idx = yaw_idx * MAX_PITCH_ANGLES * MAX_ROLL_ANGLES + pitch_idx * MAX_ROLL_ANGLES + roll_idx; + + quaternions_diff.x += split_rend_relative_yaw_angles[yaw_idx]; + quaternions_diff.y += split_rend_relative_pitch_angles[pitch_idx]; + quaternions_diff.z += split_rend_relative_roll_angles[roll_idx]; + quaternions_diffx[pos_idx].x = quaternions_diff.x; + quaternions_diffx[pos_idx].y = quaternions_diff.y; + quaternions_diffx[pos_idx].z = quaternions_diff.z; + } + } + } + + /*interpolation if actual pose is not same as one of assumed poses*/ + /*get the deviation*/ + Quat2Euler( *Quaternions_ref, &quaternions_ref_euler.z, &quaternions_ref_euler.y, &quaternions_ref_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quat2Euler( *Quaternions_act, &quaternions_act_euler.z, &quaternions_act_euler.y, &quaternions_act_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + quaternions_diff.w = -3.0f; /*euler*/ + quaternions_diff.x = quaternions_act_euler.x - quaternions_ref_euler.x; + quaternions_diff.y = quaternions_act_euler.y - quaternions_ref_euler.y; + quaternions_diff.z = quaternions_act_euler.z - quaternions_ref_euler.z; + wrap_around_ypr( &quaternions_diff ); + if ( fabs( quaternions_diff.x ) > EPSILON ) + { + min_diff = 360.0f; + /*find the closest pose from assumed poses*/ + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + if ( fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ) < min_diff ) + { + idx1 = pos_idx; + min_diff = (float) fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ); + } + } + + min_diff = 360.0; + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + if ( ( fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ) < min_diff ) && + ( pos_idx != idx1 ) ) + { + idx2 = pos_idx; + min_diff = (float) fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ); + } + } + } + interp_pose_idx[0] = idx1; + interp_pose_idx[1] = idx2; + + if ( idx1 != idx2 ) + { + n1 = quaternions_diffx[idx1].x - quaternions_diffx[idx2].x; + d1 = quaternions_diffx[idx1].x - quaternions_diff.x; + *interp_fact = d1 / n1; + } + else + { + *interp_fact = 0.0f; + } + + return; +} + +static void interpolate_rend_md( + BIN_HR_SPLIT_REND_MD rot_md[][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], + float mix_mat_re[][BINAURAL_CHANNELS], + float mix_mat_im[][BINAURAL_CHANNELS], + float *gd_int, + int16_t sf_idx, + int16_t band_idx, + int16_t interp_pose_idx[2], + float interp_fact ) +{ + int16_t ch_idx1, ch_idx2, idx1, idx2; + float mix_mat_abs1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_ph1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_abs2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_ph2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_abs[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_ph[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float gd1, gd2, diff; + BIN_HR_SPLIT_REND_MD *pRot_md; + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + set_zero( mix_mat_abs1[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_ph1[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_abs1[ch_idx1][ch_idx1] = 1.0f; + + set_zero( mix_mat_abs2[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_ph2[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_abs2[ch_idx1][ch_idx1] = 1.0f; + } + gd1 = 0.0f; + gd2 = 0.0f; + + idx1 = interp_pose_idx[0]; + idx2 = interp_pose_idx[1]; + if ( ( idx1 != 0 ) || ( idx2 != 0 ) ) + { + if ( idx1 != 0 ) + { + pRot_md = &rot_md[idx1 - 1][sf_idx][band_idx]; + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + mix_mat_abs1[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; + mix_mat_ph1[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; + } + } + gd1 = rot_md[idx1 - 1][sf_idx][band_idx].gd; + } + + if ( idx2 != 0 ) + { + pRot_md = &rot_md[idx2 - 1][sf_idx][band_idx]; + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + mix_mat_abs2[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; + mix_mat_ph2[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; + } + } + gd2 = rot_md[idx2 - 1][sf_idx][band_idx].gd; + } + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + diff = mix_mat_abs1[ch_idx1][ch_idx2] - mix_mat_abs2[ch_idx1][ch_idx2]; + mix_mat_abs[ch_idx1][ch_idx2] = mix_mat_abs1[ch_idx1][ch_idx2] - ( diff * interp_fact ); + + diff = mix_mat_ph1[ch_idx1][ch_idx2] - mix_mat_ph2[ch_idx1][ch_idx2]; + mix_mat_ph[ch_idx1][ch_idx2] = mix_mat_ph1[ch_idx1][ch_idx2] - ( diff * interp_fact ); + + mix_mat_re[ch_idx1][ch_idx2] = mix_mat_abs[ch_idx1][ch_idx2]; + mix_mat_im[ch_idx1][ch_idx2] = mix_mat_ph[ch_idx1][ch_idx2]; + } + } + diff = gd1 - gd2; + *gd_int = gd1 - ( diff * interp_fact ); + } + else + { + /*P = P'*/ + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + set_zero( mix_mat_re[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_im[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_re[ch_idx1][ch_idx1] = 1.0f; + } + *gd_int = 0.0f; + } + + return; +} + +void ivas_SplitRenderer_PostRenderer( + BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ + float Cldfb_RealBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + int16_t sf_idx, + const IVAS_QUATERNION *Quaternions_ref, + const IVAS_QUATERNION *Quaternions_act ) +{ + int16_t pos_idx, b, brange[2], ch_idx1; + int16_t num_md_bands, slot_idx, b2; + float pred_out_re[BINAURAL_CHANNELS], pred_out_im[BINAURAL_CHANNELS], tmp_re, tmp_im, gd_int, gd_cf, gd_cf_abs; + int16_t interp_pose_idx[2]; + float interp_fact; + float mix_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif + float fade; + float *pMix_mat_re_prev[BINAURAL_CHANNELS]; + float *pMix_mat_im_prev[BINAURAL_CHANNELS]; + const int16_t *pBand_grouping = SplitRend_band_grouping; + num_md_bands = MAX_SPLIT_REND_MD_BANDS; + + wmops_sub_start( "ivas_SplitRenderer_PostRenderer" ); + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + pos_idx = MAX_HEAD_ROT_POSES - 1; +#else + pos_idx = 0; +#endif + + get_interpolation_vars( Quaternions_ref, Quaternions_act, interp_pose_idx, &interp_fact ); + for ( b = 0; b < num_md_bands; b++ ) + { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + set_zero( mix_mat_re[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_im[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_re[ch_idx1][ch_idx1] = 1.0f; + } + gd_int = 0.0f; + + interpolate_rend_md( hBinPostRenderer->rot_md, mix_mat_re, mix_mat_im, &gd_int, sf_idx, b, interp_pose_idx, interp_fact ); + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + /*update the prediction matrix with interpolated matrix*/ + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] = mix_mat_re[ch_idx1][0]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] = mix_mat_re[ch_idx1][1]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] = mix_mat_im[ch_idx1][0]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] = mix_mat_im[ch_idx1][1]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd = gd_int; + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#else + pos_idx = 0; +#endif + { + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + fade = ( (float) slot_idx + 1.0f ) / MAX_PARAM_SPATIAL_SUBFRAMES; + for ( b = 0; b < num_md_bands; b++ ) + { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + if ( hBinPostRenderer->cf_flag ) + { + pMix_mat_re_prev[ch_idx1] = hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1]; + pMix_mat_im_prev[ch_idx1] = hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1]; + mix_mat_re[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] ) + + ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][0]; + mix_mat_re[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] ) + + ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][1]; + + mix_mat_im[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] ) + + ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][0]; + mix_mat_im[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] ) + + ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][1]; + } + else + { + mix_mat_re[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; + mix_mat_re[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; + mix_mat_im[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; + mix_mat_im[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + } + } + + if ( hBinPostRenderer->cf_flag ) + { + gd_cf = fade * hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd + + ( 1 - fade ) * hBinPostRenderer->gd_mem[pos_idx][b]; + } + else + { + gd_cf = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; + } + gd_cf_abs = (float) fabs( gd_cf ); + + brange[0] = pBand_grouping[b]; + brange[1] = pBand_grouping[b + 1]; + for ( b2 = brange[0]; b2 < brange[1]; b2++ ) + { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + // Apply prediction matrix + IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[0][slot_idx][b2], + Cldfb_ImagBuffer_Ref_Binaural[0][slot_idx][b2], + mix_mat_re[0][ch_idx1], + mix_mat_im[0][ch_idx1], + tmp_re, + tmp_im ); + pred_out_re[ch_idx1] = tmp_re; + pred_out_im[ch_idx1] = tmp_im; + + IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[1][slot_idx][b2], + Cldfb_ImagBuffer_Ref_Binaural[1][slot_idx][b2], + mix_mat_re[1][ch_idx1], + mix_mat_im[1][ch_idx1], + tmp_re, + tmp_im ); + pred_out_re[ch_idx1] += tmp_re; + pred_out_im[ch_idx1] += tmp_im; + } + + // Apply decorrelation + if ( 1 ) + { + tmp_re = Cldfb_RealBuffer_Ref_Binaural[0][slot_idx][b2] + Cldfb_RealBuffer_Ref_Binaural[1][slot_idx][b2]; + tmp_im = Cldfb_ImagBuffer_Ref_Binaural[0][slot_idx][b2] + Cldfb_ImagBuffer_Ref_Binaural[1][slot_idx][b2]; + + pred_out_re[0] += ( gd_cf_abs * tmp_re ); + pred_out_im[0] += ( gd_cf_abs * tmp_im ); + pred_out_re[1] += ( gd_cf * tmp_re ); + pred_out_im[1] += ( gd_cf * tmp_im ); + } + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + Cldfb_RealBuffer_Recons_Binaural[pos_idx][ch_idx1][slot_idx][b2] = pred_out_re[ch_idx1]; + Cldfb_ImagBuffer_Recons_Binaural[pos_idx][ch_idx1][slot_idx][b2] = pred_out_im[ch_idx1]; +#else + Cldfb_RealBuffer_Ref_Binaural[ch_idx1][slot_idx][b2] = pred_out_re[ch_idx1]; + Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][slot_idx][b2] = pred_out_im[ch_idx1]; +#endif + } + } + } + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#else + pos_idx = 0; +#endif + { + for ( b = 0; b < num_md_bands; b++ ) + { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; + hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; + hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; + hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + } + hBinPostRenderer->gd_mem[pos_idx][b] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; + } + } + hBinPostRenderer->cf_flag = 1; + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + { + int16_t num_cldfb_bands; + num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + mvr2r( Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][slot_idx], Cldfb_RealBuffer_Ref_Binaural[ch_idx1][slot_idx], num_cldfb_bands ); + mvr2r( Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][slot_idx], Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][slot_idx], num_cldfb_bands ); + } + } + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + char fname[200] = "recons_out_pos"; + char tag[2]; + tag[0] = (char) ( '0' + pos_idx ); + tag[1] = '\0'; + strcat( fname, tag ); + strcat( fname, ".wav" ); + ivas_log_cldfb2wav_data( + Cldfb_RealBuffer_Recons_Binaural[pos_idx], + Cldfb_ImagBuffer_Recons_Binaural[pos_idx], + hBinPostRenderer->cldfbSynReconsBinDec[pos_idx], + BINAURAL_CHANNELS, + num_cldfb_bands, + 48000, + fname ); + } + } +#endif + + wmops_sub_end(); + return; +} + +void ivas_rend_CldfbSplitPostRendProcess( + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], + float Cldfb_RealBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float output[][L_FRAME48k] ) +{ + int16_t sf_idx, ch_idx, index_slot, slot_idx, num_cldfb_bands; + float Cldfb_RealBuffer_sfIn[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_sfIn[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + + num_cldfb_bands = hBinHrSplitPostRend->cldfbSyn[0]->no_channels; + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + index_slot = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + mvr2r( &Cldfb_RealBuffer_Binaural[ch_idx][index_slot][0], &Cldfb_RealBuffer_sfIn[ch_idx][slot_idx][0], num_cldfb_bands ); + mvr2r( &Cldfb_ImagBuffer_Binaural[ch_idx][index_slot][0], &Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx][0], num_cldfb_bands ); + } + } + +#ifndef SPLIT_REND_SKIP_POST_REND + ivas_SplitRenderer_PostRenderer( + hBinHrSplitPostRend, + Cldfb_RealBuffer_sfIn, + Cldfb_ImagBuffer_sfIn, + sf_idx, + &QuaternionsPre[sf_idx], + &QuaternionsPost[sf_idx] ); +#endif + + /* Implement CLDFB synthesis */ + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + + index_slot = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES; + + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + RealBuffer[slot_idx] = Cldfb_RealBuffer_sfIn[ch_idx][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx]; + } + + cldfbSynthesis( RealBuffer, ImagBuffer, &( output[ch_idx][index_slot * num_cldfb_bands] ), num_cldfb_bands * MAX_PARAM_SPATIAL_SUBFRAMES, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); + } + } + + return; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c new file mode 100644 index 0000000000..8c37efcef3 --- /dev/null +++ b/lib_rend/ivas_splitRendererPre.c @@ -0,0 +1,1324 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include "options.h" +#include +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#include +#endif +#include "ivas_prot.h" +#include "prot.h" +#include "cnst.h" +#include "ivas_cnst.h" +#include "ivas_rom_rend.h" +#include "ivas_rom_com.h" +#include "ivas_rom_dec.h" +#include "ivas_rom_binauralRenderer.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + + +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define MAX_BAND_SMOOTH ( 1 ) +#define SMOOTH_NORM_FACTOR ( 5.0f ) + +static void ivas_mat_mult_2by2_complex( float in_re1[2][2], + float in_im1[2][2], + float in_re2[2][2], + float in_im2[2][2], + float out_re2[2][2], + float out_im2[2][2] ) +{ + int16_t i, j; + float tmp_re, tmp_im; + + for ( i = 0; i < 2; i++ ) + { + for ( j = 0; j < 2; j++ ) + { + + IVAS_CMULT_FLOAT( in_re1[i][0], in_im1[i][0], + in_re2[0][j], in_im2[0][j], tmp_re, tmp_im ); + out_re2[i][j] = tmp_re; + out_im2[i][j] = tmp_im; + IVAS_CMULT_FLOAT( in_re1[i][1], in_im1[i][1], + in_re2[1][j], in_im2[1][j], tmp_re, tmp_im ); + out_re2[i][j] += tmp_re; + out_im2[i][j] += tmp_im; + } + } + return; +} +static void ivas_calc_mat_det_2by2_complex( float in_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float in_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float *det_re, + float *det_im ) +{ + float re1, im1, re2, im2; + IVAS_CMULT_FLOAT( in_re[0][0], in_im[0][0], in_re[1][1], in_im[1][1], re1, im1 ); + IVAS_CMULT_FLOAT( in_re[0][1], in_im[0][1], in_re[1][0], in_im[1][0], re2, im2 ); + *det_re = re1 - re2; + *det_im = im1 - im2; + return; +} + +static int16_t ivas_is_mat_inv_2by2_complex( float in_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float in_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ) +{ + int16_t is_det_zero = 1; + float det, det_re, det_im; + ivas_calc_mat_det_2by2_complex( in_re, in_im, &det_re, &det_im ); + det = ( ( det_re * det_re ) + ( det_im * det_im ) ); + if ( det < EPSILON ) + { + is_det_zero = 0; + } + return is_det_zero; +} + +static void ivas_calc_mat_inv_2by2_complex( + float in_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float in_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float out_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float out_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ) +{ + float det_re, det_im; + float re, im, det; + ivas_calc_mat_det_2by2_complex( in_re, in_im, &det_re, &det_im ); + det = ( det_re * det_re ) + ( det_im * det_im ); + // assert to catch cases when input is singular matrix + assert( det > 0 ); + det = 1 / det; + + IVAS_CMULT_FLOAT( det_re, -det_im, in_re[1][1], in_im[1][1], re, im ); + out_re[0][0] = re * det; + out_im[0][0] = im * det; + + IVAS_CMULT_FLOAT( det_re, -det_im, in_re[0][1], in_im[0][1], re, im ); + out_re[0][1] = -re * det; + out_im[0][1] = -im * det; + IVAS_CMULT_FLOAT( det_re, -det_im, in_re[1][0], in_im[1][0], re, im ); + out_re[1][0] = -re * det; + out_im[1][0] = -im * det; + IVAS_CMULT_FLOAT( det_re, -det_im, in_re[0][0], in_im[0][0], re, im ); + out_re[1][1] = re * det; + out_im[1][1] = im * det; + return; +} + +static void ComputePredMat( + float cov_ii_re[][BINAURAL_CHANNELS], + float cov_ii_im[][BINAURAL_CHANNELS], + float cov_io_re[][BINAURAL_CHANNELS], + float cov_io_im[][BINAURAL_CHANNELS], + float pred_mat_re[][BINAURAL_CHANNELS], + float pred_mat_im[][BINAURAL_CHANNELS], + int16_t num_chs, + int16_t real_only ) +{ + float cov_ii_local_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + // float cov_ii_local_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_ii_inv_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_ii_inv_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float trace_cov; + int16_t i, j; + + trace_cov = 0.0f; + for ( i = 0; i < num_chs; i++ ) + { + trace_cov += cov_ii_re[i][i]; + } + trace_cov = max( 0.0f, trace_cov ); + if ( trace_cov < EPSILON ) + { + for ( i = 0; i < num_chs; i++ ) + { + /* protection from cases when variance of ref channels is very small */ + set_zero( pred_mat_re[i], BINAURAL_CHANNELS ); + set_zero( pred_mat_im[i], BINAURAL_CHANNELS ); + } + return; + } + + for ( i = 0; i < num_chs; i++ ) + { + mvr2r( cov_ii_re[i], cov_ii_local_re[i], num_chs ); + // mvr2r( cov_ii_im[i], cov_ii_local_im[i], num_chs ); + } + for ( i = 0; i < num_chs; i++ ) + { + cov_ii_local_re[i][i] = cov_ii_re[i][i] + ( trace_cov * 0.0001f ); + // cov_ii_local_im[i][i] = cov_ii_im[i][i] + ( trace_cov * 0.0005f ); + } + + // float det_re, det_im, det; + // ivas_calc_mat_det_2by2_complex( cov_ii_local_re, cov_ii_im, &det_re, &det_im ); + // det = ( ( det_re * det_re ) + ( det_im * det_im ) ); + // det = sqrtf( det ); + // if ( ivas_is_mat_inv_2by2_complex( cov_ii_local_re, cov_ii_im ) ) + // if ( det > 0.0001f ) + if ( ivas_is_mat_inv_2by2_complex( cov_ii_local_re, cov_ii_im ) ) + { + ivas_calc_mat_inv_2by2_complex( cov_ii_local_re, cov_ii_im, cov_ii_inv_re, cov_ii_inv_im ); + ivas_mat_mult_2by2_complex( cov_ii_inv_re, cov_ii_inv_im, cov_io_re, cov_io_im, + pred_mat_re, pred_mat_im ); + } + else + { + // float max_var; + int16_t max_var_idx; + for ( i = 0; i < num_chs; i++ ) + { + set_zero( pred_mat_re[i], BINAURAL_CHANNELS ); + set_zero( pred_mat_im[i], BINAURAL_CHANNELS ); + } + + max_var_idx = 0; + // max_var = cov_ii_local_re[0][0]; + if ( cov_ii_local_re[1][1] > cov_ii_local_re[0][0] ) + { + max_var_idx = 1; + // max_var = cov_ii_local_re[1][1]; + } + + if ( cov_ii_local_re[max_var_idx][max_var_idx] > EPSILON ) + { + for ( j = 0; j < num_chs; j++ ) + { + pred_mat_re[max_var_idx][j] = cov_io_re[max_var_idx][j] / cov_ii_local_re[max_var_idx][max_var_idx]; + pred_mat_im[max_var_idx][j] = cov_io_im[max_var_idx][j] / cov_ii_local_re[max_var_idx][max_var_idx]; + } + } + } + + if ( real_only ) + { + for ( i = 0; i < num_chs; i++ ) + { + set_zero( pred_mat_im[i], BINAURAL_CHANNELS ); + } + } + + return; +} + +static void ComputePostPredCov( + float cov_ii_re[][BINAURAL_CHANNELS], + float cov_ii_im[][BINAURAL_CHANNELS], + float pred_mat_re[][BINAURAL_CHANNELS], + float pred_mat_im[][BINAURAL_CHANNELS], + float postpred_cov_re[][BINAURAL_CHANNELS], + float postpred_cov_im[][BINAURAL_CHANNELS], + int16_t num_chs ) +{ + int16_t i, j; + float dmx_mat_conj_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float dmx_mat_conj_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float temp_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float temp_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + + assert( num_chs == BINAURAL_CHANNELS ); + for ( i = 0; i < num_chs; i++ ) + { + for ( j = 0; j < num_chs; j++ ) + { + dmx_mat_conj_re[i][j] = pred_mat_re[j][i]; + dmx_mat_conj_im[i][j] = -pred_mat_im[j][i]; + + temp_mat_re[i][j] = pred_mat_re[i][j]; + temp_mat_im[i][j] = pred_mat_im[i][j]; + } + set_zero( postpred_cov_re[i], BINAURAL_CHANNELS ); + set_zero( postpred_cov_im[i], BINAURAL_CHANNELS ); + } + + /* 2x2 mult */ + ivas_mat_mult_2by2_complex( dmx_mat_conj_re, dmx_mat_conj_im, cov_ii_re, cov_ii_im, + temp_mat_re, temp_mat_im ); + ivas_mat_mult_2by2_complex( temp_mat_re, temp_mat_im, pred_mat_re, pred_mat_im, + postpred_cov_re, postpred_cov_im ); + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + for ( j = 0; j < i; j++ ) + { + postpred_cov_re[i][j] = postpred_cov_re[j][i]; + postpred_cov_im[i][j] = -postpred_cov_im[j][i]; + } + postpred_cov_im[i][i] = 0; + } + + return; +} + +static void ComputeBandedCrossCov( + float Cldfb_RealBuffer1[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer1[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_RealBuffer2[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer2[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float out_cov_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float out_cov_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + int16_t num_chs, + const int16_t *pBand_grouping, + int16_t num_subframes, + int16_t md_band_idx, + int16_t real_only ) +{ + int16_t sf, cldfb_band_idx, ch_idx1, ch_idx2; + int16_t brange[2]; + + for ( ch_idx1 = 0; ch_idx1 < num_chs; ch_idx1++ ) + { + set_f( out_cov_re[ch_idx1], 0.0f, num_chs ); + set_f( out_cov_im[ch_idx1], 0.0f, num_chs ); + } + brange[0] = pBand_grouping[md_band_idx]; + brange[1] = pBand_grouping[md_band_idx + 1]; + for ( ch_idx1 = 0; ch_idx1 < num_chs; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < num_chs; ch_idx2++ ) + { + if ( real_only == 0 ) + { + for ( sf = 0; sf < num_subframes; sf++ ) + { + for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) + { + out_cov_re[ch_idx1][ch_idx2] += + Cldfb_RealBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer2[ch_idx2][sf][cldfb_band_idx] + + Cldfb_ImagBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer2[ch_idx2][sf][cldfb_band_idx]; + + out_cov_im[ch_idx1][ch_idx2] += + Cldfb_RealBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer2[ch_idx2][sf][cldfb_band_idx] - + Cldfb_ImagBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer2[ch_idx2][sf][cldfb_band_idx]; + } + } + } + else + { + for ( sf = 0; sf < num_subframes; sf++ ) + { + for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) + { + out_cov_re[ch_idx1][ch_idx2] += + Cldfb_RealBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer2[ch_idx2][sf][cldfb_band_idx] + + Cldfb_ImagBuffer1[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer2[ch_idx2][sf][cldfb_band_idx]; + + out_cov_im[ch_idx1][ch_idx2] = 0.0f; + } + } + } + } + } + + + return; +} + +static void ComputeBandedCov( + float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float out_cov_re[][BINAURAL_CHANNELS], + float out_cov_im[][BINAURAL_CHANNELS], + int16_t num_chs, + const int16_t *pBand_grouping, + int16_t num_subframes, + int16_t md_band_idx, + int16_t real_only ) +{ + int16_t sf, cldfb_band_idx, ch_idx1, ch_idx2; + int16_t brange[2]; + + for ( ch_idx1 = 0; ch_idx1 < num_chs; ch_idx1++ ) + { + set_f( out_cov_re[ch_idx1], 0.0f, num_chs ); + set_f( out_cov_im[ch_idx1], 0.0f, num_chs ); + } + brange[0] = pBand_grouping[md_band_idx]; + brange[1] = pBand_grouping[md_band_idx + 1]; + for ( ch_idx1 = 0; ch_idx1 < num_chs; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 <= ch_idx1; ch_idx2++ ) + { + if ( ( ch_idx2 != ch_idx1 ) && ( real_only == 0 ) ) + { + for ( sf = 0; sf < num_subframes; sf++ ) + { + for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) + { + out_cov_re[ch_idx1][ch_idx2] += + Cldfb_RealBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer[ch_idx2][sf][cldfb_band_idx] + + Cldfb_ImagBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer[ch_idx2][sf][cldfb_band_idx]; + + out_cov_im[ch_idx1][ch_idx2] += + Cldfb_RealBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer[ch_idx2][sf][cldfb_band_idx] - + Cldfb_ImagBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer[ch_idx2][sf][cldfb_band_idx]; + } + } + } + else + { + for ( sf = 0; sf < num_subframes; sf++ ) + { + for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) + { + out_cov_re[ch_idx1][ch_idx2] += + Cldfb_RealBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_RealBuffer[ch_idx2][sf][cldfb_band_idx] + + Cldfb_ImagBuffer[ch_idx1][sf][cldfb_band_idx] * Cldfb_ImagBuffer[ch_idx2][sf][cldfb_band_idx]; + + out_cov_im[ch_idx1][ch_idx2] = 0.0f; + } + } + } + } + } + + for ( ch_idx1 = 0; ch_idx1 < num_chs; ch_idx1++ ) + { + for ( ch_idx2 = ch_idx1 + 1; ch_idx2 < num_chs; ch_idx2++ ) + { + out_cov_re[ch_idx1][ch_idx2] = out_cov_re[ch_idx2][ch_idx1]; + out_cov_im[ch_idx1][ch_idx2] = -out_cov_im[ch_idx2][ch_idx1]; + } + } + + + return; +} + +static float GetNormFact( + float cov_ii_re[][BINAURAL_CHANNELS], + float cov_ii_im[][BINAURAL_CHANNELS], + float cov_io_re[][BINAURAL_CHANNELS], + float cov_io_im[][BINAURAL_CHANNELS], + float cov_oo_re[][BINAURAL_CHANNELS] ) +{ + int16_t i, j; + float norm_fact, abs_val; + + norm_fact = 0.0f; + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + IVAS_CALCULATE_ABS( cov_ii_re[i][j], cov_ii_im[i][j], abs_val ); + norm_fact = max( norm_fact, abs_val ); + + IVAS_CALCULATE_ABS( cov_io_re[i][j], cov_io_im[i][j], abs_val ); + norm_fact = max( norm_fact, abs_val ); + + IVAS_CALCULATE_RABS( cov_oo_re[i][j], abs_val ); + norm_fact = max( norm_fact, abs_val ); + } + } + + norm_fact = ( norm_fact > EPSILON ) ? norm_fact : 1.0f; + + norm_fact = PCM16_TO_FLT_FAC / norm_fact; + + return norm_fact; +} + +static void ivas_split_rend_huffman_encode( + ivas_split_rend_huffman_cfg_t *huff_cfg, + int16_t in, + int32_t *hcode, + int32_t *hlen ) +{ + int32_t min_sym_val; + const int32_t *codebook; + + min_sym_val = huff_cfg->codebook[0]; + + codebook = &huff_cfg->codebook[3 * ( in - min_sym_val )]; + *hlen = codebook[1]; + *hcode = codebook[2]; + + return; +} + +static void ivas_split_rend_quant_md( + BIN_HR_SPLIT_REND_MD_HANDLE hMd, + int16_t real_only, + float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) +{ + int16_t ch1, ch2; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_re[ch1][ch2] -= fix_pos_rot_mat[ch1][ch2]; + hMd->pred_mat_re[ch1][ch2] = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( hMd->pred_mat_re[ch1][ch2], IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + } + } + if ( real_only == 0 ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_im[ch1][ch2] = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( hMd->pred_mat_im[ch1][ch2], IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + } + } + } + hMd->gd = min( IVAS_SPLIT_REND_D_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_D_MIN_VAL ) ); + + ivas_quantise_real_values( &hMd->pred_mat_re[0][0], + IVAS_SPLIT_REND_PRED_QUANT_PNTS, + IVAS_SPLIT_REND_PRED_MIN_VAL, + IVAS_SPLIT_REND_PRED_MAX_VAL, + &hMd->pred_mat_re_idx[0][0], + &hMd->pred_mat_re[0][0], + BINAURAL_CHANNELS * BINAURAL_CHANNELS ); + + ivas_quantise_real_values( &hMd->pred_mat_im[0][0], + IVAS_SPLIT_REND_PRED_QUANT_PNTS, + IVAS_SPLIT_REND_PRED_MIN_VAL, + IVAS_SPLIT_REND_PRED_MAX_VAL, + &hMd->pred_mat_im_idx[0][0], + &hMd->pred_mat_im[0][0], + BINAURAL_CHANNELS * BINAURAL_CHANNELS ); + + ivas_quantise_real_values( &hMd->gd, + IVAS_SPLIT_REND_D_QUANT_PNTS, + IVAS_SPLIT_REND_D_MIN_VAL, + IVAS_SPLIT_REND_D_MAX_VAL, + &hMd->gd_idx, + &hMd->gd, + 1 ); + + return; +} + + +static void ComputeCoeffs( + float cov_ii_re[][BINAURAL_CHANNELS], + float cov_ii_im[][BINAURAL_CHANNELS], + float cov_io_re[][BINAURAL_CHANNELS], + float cov_io_im[][BINAURAL_CHANNELS], + float cov_oo_re[][BINAURAL_CHANNELS], + BIN_HR_SPLIT_REND_MD_HANDLE hMd, + float fix_pos_rot_mat[][BINAURAL_CHANNELS], + int16_t real_only ) +{ + float postpred_cov_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float postpred_cov_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_ii_norm_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_ii_norm_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_io_norm_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_io_norm_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_oo_norm_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float sigma_d, rho_hat, rho, gd, gd2, gl2, gr2, cov_norm_fact; + float aa, bb, cc, dd, sign; + int16_t i, j; + + +#if 1 + + cov_norm_fact = GetNormFact( + cov_ii_re, + cov_ii_im, + cov_io_re, + cov_io_im, + cov_oo_re ); + + // normalize the covariance + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + cov_ii_norm_re[i][j] = cov_ii_re[i][j] * cov_norm_fact; + cov_ii_norm_im[i][j] = cov_ii_im[i][j] * cov_norm_fact; + cov_io_norm_re[i][j] = cov_io_re[i][j] * cov_norm_fact; + cov_io_norm_im[i][j] = cov_io_im[i][j] * cov_norm_fact; + cov_oo_norm_re[i][j] = cov_oo_re[i][j] * cov_norm_fact; + } + } + + ComputePredMat( cov_ii_norm_re, + cov_ii_norm_im, + cov_io_norm_re, + cov_io_norm_im, + hMd->pred_mat_re, + hMd->pred_mat_im, + BINAURAL_CHANNELS, + real_only ); +#else + +#endif + + /*TODO : change this function to real only as thats what is needed*/ + ComputePostPredCov( cov_ii_norm_re, + cov_ii_norm_im, + hMd->pred_mat_re, + hMd->pred_mat_im, + postpred_cov_re, + postpred_cov_im, + BINAURAL_CHANNELS ); + + // normalize everything to +-1 range + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + postpred_cov_re[i][j] *= 1.0f / ( PCM16_TO_FLT_FAC ); + cov_ii_norm_re[i][j] = cov_ii_norm_re[i][j] * 1.0f / ( PCM16_TO_FLT_FAC ); + cov_oo_norm_re[i][j] = cov_oo_norm_re[i][j] * 1.0f / ( PCM16_TO_FLT_FAC ); + } + } + + sigma_d = cov_ii_norm_re[0][0] + cov_ii_norm_re[1][1] + cov_ii_norm_re[0][1] + cov_ii_norm_re[1][0] + EPSILON; + + rho_hat = max( EPSILON, sqrtf( postpred_cov_re[0][0] * postpred_cov_re[1][1] ) ); + rho_hat = postpred_cov_re[0][1] / rho_hat; + rho = max( EPSILON, sqrtf( cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1] ) ); + rho = cov_oo_norm_re[0][1] / rho; + rho_hat = min( max( rho_hat, -0.9999f ), 0.9999f ); + rho = min( max( rho, -0.9999f ), 0.9999f ); + + // Compute decorrelator gain : gd2 = 0; + gd = 0; + gd2 = 0; + + aa = ( sigma_d * sigma_d ) * ( ( rho_hat * rho_hat ) - 1 ) + EPSILON; + bb = -( rho_hat * rho_hat ) * sigma_d * ( cov_oo_norm_re[0][0] + cov_oo_norm_re[1][1] ); + cc = ( rho_hat * rho_hat ) * cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1]; + cc -= cov_oo_norm_re[0][1] * cov_oo_norm_re[0][1]; + + sign = +1.0f; + if ( rho < ( rho_hat - 0.0001 ) ) + { + bb -= 2 * sigma_d * cov_oo_norm_re[0][1]; + sign = -1.0f; + } + else if ( rho > ( rho_hat + 0.0001 ) ) + { + bb += 2 * sigma_d * cov_oo_norm_re[0][1]; + } + dd = bb * bb - ( 4 * aa * cc ); + if ( dd >= 0 ) + { + float gd2_1, gd2_2; + gd2_1 = ( -bb + sqrtf( dd ) ) / ( 2 * aa ); + gd2_2 = ( -bb - sqrtf( dd ) ) / ( 2 * aa ); + if ( ( gd2_1 >= 0 ) && ( gd2_2 >= 0 ) ) + { + gd2 = min( gd2_1, gd2_2 ); + } + else + { + gd2 = max( 0, max( gd2_1, gd2_2 ) ); + } + gd = sign * sqrtf( gd2 ); + } + + gd = min( 1.0f, max( gd, 0.0f ) ); + hMd->gd = SPLIT_REND_DECOR_ALPHA * gd + ( 1 - SPLIT_REND_DECOR_ALPHA ) * hMd->gd; + gd2 = min( gd2, cov_oo_norm_re[0][0] / sigma_d ); + gd2 = min( gd2, cov_oo_norm_re[1][1] / sigma_d ); + + + if ( postpred_cov_re[0][0] > EPSILON ) + { + gl2 = ( cov_oo_norm_re[0][0] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[0][0] ); + gl2 = max( gl2, 1.0f ); + gl2 = sqrtf( gl2 ); + } + else + { + gl2 = 1.0f; + } + if ( postpred_cov_re[1][1] > EPSILON ) + { + gr2 = ( cov_oo_norm_re[1][1] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[1][1] ); + gr2 = max( gr2, 1.0f ); + gr2 = sqrtf( gr2 ); + } + else + { + gr2 = 1.0f; + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hMd->pred_mat_re[i][0] *= gl2; + hMd->pred_mat_re[i][0] = min( 2.0f, max( hMd->pred_mat_re[i][0], -2.0f ) ); + + hMd->pred_mat_re[i][1] *= gr2; + hMd->pred_mat_re[i][1] = min( 2.0f, max( hMd->pred_mat_re[i][1], -2.0f ) ); + } + if ( real_only == 0 ) + { + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hMd->pred_mat_im[i][0] *= gl2; + hMd->pred_mat_im[i][0] = min( 2.0f, max( hMd->pred_mat_im[i][0], -2.0f ) ); + + hMd->pred_mat_im[i][1] *= gr2; + hMd->pred_mat_im[i][1] = min( 2.0f, max( hMd->pred_mat_im[i][1], -2.0f ) ); + } + } + + ivas_split_rend_quant_md( hMd, real_only, fix_pos_rot_mat ); + return; +} + +static void ivas_SplitRenderer_code_md_base2( + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg, + ivas_split_rend_bits_t *pBits, + int16_t sf_idx, + int16_t num_md_bands ) +{ + int16_t real_only, pos_idx, b, ch1, ch2; + int16_t min_pred_idx, min_gd_idx, pred_code_len, gd_code_len; + int32_t code; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; + min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; + pred_code_len = pHuff_cfg->pred_base2_code_len; + gd_code_len = pHuff_cfg->gd_base2_code_len; + + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + hMd = &rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_re_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } + } + if ( real_only == 0 ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_im_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } + } + } + code = hMd->gd_idx - min_gd_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, gd_code_len ); + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + { + static int num_bits = 0; + static int cntr = 0, sh_cnt = 0; + float fnum_bits; + + cntr++; + sh_cnt++; + + if ( sh_cnt == MAX_PARAM_SPATIAL_SUBFRAMES ) + { + num_bits += pBits->bits_written; + // collect bits for every second + if ( cntr == 200 ) + { + cntr = 0; + fnum_bits = (float) num_bits / 1000.0f; + dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); + num_bits = 0; + } + sh_cnt = 0; + } + } +#endif + return; +} + +static void ivas_SplitRenderer_code_md( + BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg, + ivas_split_rend_bits_t *pBits, + int16_t sf_idx, + int16_t num_md_bands ) +{ + int16_t real_only, pos_idx, b, ch1, ch2; + int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t min_pred_idx, max_pred_idx; + int32_t code, len; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + + min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; + max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; + real_only = 0; + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + hMd = &rot_md[pos_idx][sf_idx][b]; + + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + if ( real_only == 0 ) + { + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + } + ivas_split_rend_huffman_encode( &pHuff_cfg->gd, hMd->gd_idx, &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + { + static int num_bits = 0; + static int cntr = 0, sh_cnt = 0; + float fnum_bits; + + cntr++; + sh_cnt++; + + if ( sh_cnt == MAX_PARAM_SPATIAL_SUBFRAMES ) + { + num_bits += pBits->bits_written; + // collect bits for every second + if ( cntr == 200 ) + { + cntr = 0; + fnum_bits = (float) num_bits / 1000.0f; + dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); + num_bits = 0; + } + sh_cnt = 0; + } + } +#endif + return; +} + +void ivas_SplitRenderer_GetRotMd( + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + ivas_split_rend_bits_t *pBits, + int16_t sf_idx ) +{ + float cov_ii_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_oo_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_io_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_ii_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_oo_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float cov_io_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t real_only = 0; + + int16_t pos_idx, b; + int16_t yaw_idx; + int16_t num_md_bands; + const int16_t *pBand_grouping = SplitRend_band_grouping; + num_md_bands = MAX_SPLIT_REND_MD_BANDS; + + wmops_sub_start( "ivas_SplitRenderer_GetRotMd" ); + + /*compute reference signal covariance*/ + for ( b = 0; b < num_md_bands; b++ ) + { + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + cov_ii_re, cov_ii_im, + BINAURAL_CHANNELS, + pBand_grouping, + MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); + + /*compute rotated signal covariance*/ + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + ComputeBandedCrossCov( Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + cov_io_re, cov_io_im, + BINAURAL_CHANNELS, + pBand_grouping, + MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); + + ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + cov_oo_re, cov_oo_im, + BINAURAL_CHANNELS, + pBand_grouping, + MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); + + yaw_idx = ( pos_idx / ( MAX_PITCH_ANGLES * MAX_ROLL_ANGLES ) ); + ComputeCoeffs( cov_ii_re, + cov_ii_im, + cov_io_re, + cov_io_im, + cov_oo_re, + &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b], + hBinHrSplitPreRend->fix_pos_rot_mat[yaw_idx], + real_only ); + } + } + +#ifdef SPLIT_REND_BASE2_CODING + ivas_SplitRenderer_code_md_base2( + hBinHrSplitPreRend->rot_md, + &hBinHrSplitPreRend->huff_cfg, + pBits, + sf_idx, + num_md_bands ); +#else + ivas_SplitRenderer_code_md( + hBinHrSplitPreRend->rot_md, + &hBinHrSplitPreRend->huff_cfg, + pBits, + sf_idx, + num_md_bands ); +#endif + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + { + int16_t num_cldfb_bands; + num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + char fname[200] = "rotated_ref_pos"; + char tag[2]; + tag[0] = (char) ( '0' + pos_idx ); + tag[1] = '\0'; + strcat( fname, tag ); + strcat( fname, ".wav" ); + ivas_log_cldfb2wav_data( + Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + hBinHrSplitPreRend->cldfbSynRotBinDec[pos_idx], + BINAURAL_CHANNELS, + num_cldfb_bands, + 48000, + fname ); + } + ivas_log_cldfb2wav_data( + Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + hBinHrSplitPreRend->cldfbSynRotBinDec[MAX_HEAD_ROT_POSES], + BINAURAL_CHANNELS, + num_cldfb_bands, + 48000, + "rotated_ref_RefPos.wav" ); + } +#endif + + wmops_sub_end(); + + return; +} + +void ivas_rend_CldfbSplitPreRendProcess( + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t max_bands, + ivas_split_rend_bits_t *pBits ) +{ + int16_t sf_idx, slot_idx, ch_idx, idx, pos_idx, num_poses; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + num_poses = MAX_HEAD_ROT_POSES + 1; +#else + num_poses = MAX_HEAD_ROT_POSES; +#endif + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + mvr2r( &Cldfb_In_BinReal[pos_idx][ch_idx][idx][0], &Cldfb_RealBuffer_Binaural[pos_idx][ch_idx][slot_idx][0], max_bands ); + mvr2r( &Cldfb_In_BinImag[pos_idx][ch_idx][idx][0], &Cldfb_ImagBuffer_Binaural[pos_idx][ch_idx][slot_idx][0], max_bands ); + } + } + } + + ivas_SplitRenderer_GetRotMd( + hBinHrSplitPreRend, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + pBits, + sf_idx ); + } + + return; +} + +ivas_error ivas_splitBinPreRendOpen( + BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + , + const int32_t output_Fs +#endif +) +{ + BIN_HR_SPLIT_PRE_REND_HANDLE hBinRend; + ivas_error error; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + int16_t ch; +#endif + int16_t pos_idx, sf_idx, bandIdx; + + error = IVAS_ERR_OK; + if ( ( hBinRend = (BIN_HR_SPLIT_PRE_REND_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_PRE_REND ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for bin split pre renderer Module \n" ) ); + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES + 1; i++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + hBinRend->cldfbSynRotBinDec[i][ch] = NULL; + } + } + + for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES + 1; i++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + if ( ( error = openCldfb( &( hBinRend->cldfbSynRotBinDec[i][ch] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } +#endif + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + { + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + for ( bandIdx = 0; bandIdx < MAX_SPLIT_REND_MD_BANDS; bandIdx++ ) + { + hBinRend->rot_md[pos_idx][sf_idx][bandIdx].gd = 0.0f; + } + } + } + set_fix_rotation_mat( hBinRend->fix_pos_rot_mat ); + ivas_split_rend_init_huff_cfg( &hBinRend->huff_cfg ); + *hBinHrSplitPreRend = hBinRend; + return error; +} + +void ivas_splitBinPreRendClose( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ) +{ + if ( ( *hBinHrSplitPreRend ) != NULL ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + { + int16_t i, n; + for ( i = 0; i < MAX_HEAD_ROT_POSES + 1; i++ ) + { + for ( n = 0; n < BINAURAL_CHANNELS; n++ ) + { + if ( ( *hBinHrSplitPreRend )->cldfbSynRotBinDec[i][n] != NULL ) + { + deleteCldfb( &( ( *hBinHrSplitPreRend )->cldfbSynRotBinDec[i][n] ) ); + ( *hBinHrSplitPreRend )->cldfbSynRotBinDec[i][n] = NULL; + } + } + } + } +#endif + count_free( ( *hBinHrSplitPreRend ) ); + ( *hBinHrSplitPreRend ) = NULL; + } + return; +} + +void ivas_init_split_rend_handles( SPLIT_REND_WRAPPER *hSplitRendWrapper ) +{ + hSplitRendWrapper->hBinHrSplitPostRend = NULL; + hSplitRendWrapper->hBinHrSplitPreRend = NULL; + hSplitRendWrapper->hCldfbHandles = NULL; + hSplitRendWrapper->hSplitBinLCLDDec = NULL; + hSplitRendWrapper->hSplitBinLCLDEnc = NULL; + return; +} + +ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, const int32_t OutSampleRate, const IVAS_SPLIT_REND_MODE splitRendMode, const int16_t is_cldfb_in ) +{ + ivas_error error, ch, num_ch; + error = IVAS_ERR_OK; + + if ( is_cldfb_in == 0 ) + { + if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) count_malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) ); + } + num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; + for ( ch = 0; ch < num_ch; ch++ ) + { + hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; + } + + for ( ch = 0; ch < num_ch; ch++ ) + { + if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, OutSampleRate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + + switch ( splitRendMode ) + { + case SPLIT_REND_PRE: + + error = ivas_splitBinPreRendOpen( &hSplitRendWrapper->hBinHrSplitPreRend +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + , + OutSampleRate +#endif + ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc ); + break; + case SPLIT_REND_POST: + error = ivas_splitBinPostRendOpen( &hSplitRendWrapper->hBinHrSplitPostRend, OutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + break; + case SPLIT_REND_COMB: + error = ivas_splitBinPreRendOpen( &hSplitRendWrapper->hBinHrSplitPreRend +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + , + OutSampleRate +#endif + ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + error = ivas_splitBinPostRendOpen( &hSplitRendWrapper->hBinHrSplitPostRend, OutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec ); + break; + default: + return IVAS_ERR_INVALID_OUTPUT_FORMAT; + } + + return error; +} + +void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ) +{ + if ( hSplitBinRend->hBinHrSplitPreRend != NULL ) + { + ivas_splitBinPreRendClose( &hSplitBinRend->hBinHrSplitPreRend ); + } + if ( hSplitBinRend->hSplitBinLCLDEnc != NULL ) + { + ivas_splitBinLCLDEncClose( &hSplitBinRend->hSplitBinLCLDEnc ); + } + if ( hSplitBinRend->hBinHrSplitPostRend != NULL ) + { + ivas_splitBinPostRendClose( &hSplitBinRend->hBinHrSplitPostRend ); + } + if ( hSplitBinRend->hSplitBinLCLDDec != NULL ) + { + ivas_splitBinLCLDDecClose( &hSplitBinRend->hSplitBinLCLDDec ); + } + + if ( hSplitBinRend->hCldfbHandles != NULL ) + { + hSplitBinRend->hCldfbHandles = NULL; + } + return; +} + +ivas_error ivas_renderMultiBinToSplitBinaural( + SPLIT_REND_WRAPPER *hSplitBin, + ivas_split_rend_bits_t *pBits, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], + const int16_t max_bands, + float out[][L_FRAME48k] ) +{ + ivas_error error; + error = IVAS_ERR_OK; + if ( hSplitBin->hCldfbHandles != NULL ) + { + /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ + int16_t num_cldfb_bands, ch, slot_idx, pos_idx; + + assert( hSplitBin->hCldfbHandles != NULL ); + num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; + /* CLDFB Analysis*/ +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES + 1; pos_idx++ ) +#else + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#endif + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + { + cldfbAnalysis_ts( &( out[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), + Cldfb_In_BinReal[pos_idx][ch][slot_idx], + Cldfb_In_BinImag[pos_idx][ch][slot_idx], + max_bands, + hSplitBin->hCldfbHandles->cldfbAna[ch] ); + } + } + } + } + + ivas_rend_CldfbSplitPreRendProcess( + hSplitBin->hBinHrSplitPreRend, + Cldfb_In_BinReal, + Cldfb_In_BinImag, + max_bands, + pBits ); + + ivas_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0], + pBits ); + + + /*CLFDB decoding and SPLIT post rendering MD based adjustments*/ + { + + ivas_splitBinLCLDDecProcess( + hSplitBin->hSplitBinLCLDDec, + pBits, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0] ); + + ivas_splitBinPostRendMdDec( + pBits, + hSplitBin->hBinHrSplitPostRend, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + hSplitBin->hBinHrSplitPreRend, +#endif + MAX_SPLIT_REND_MD_BANDS ); + + ivas_rend_CldfbSplitPostRendProcess( + hSplitBin->hBinHrSplitPostRend, + QuaternionsPre, + QuaternionsPost, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0], + out ); + } + + return error; +} +#endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c new file mode 100644 index 0000000000..9d68e424fd --- /dev/null +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -0,0 +1,300 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include "options.h" +#include +#include "ivas_prot.h" +#include "prot.h" +#include "cnst.h" +#include "ivas_cnst.h" +#include "ivas_rom_rend.h" +#include "ivas_rom_com.h" +#include "ivas_rom_dec.h" +#include "ivas_rom_binauralRenderer.h" +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + +#ifdef SPLIT_REND_WITH_HEAD_ROT +void ivas_split_rend_bitstream_init( ivas_split_rend_bits_t *pBits, const int32_t buf_len_bytes, uint8_t *pbuf ) +{ + pBits->bits_buf = pbuf; + pBits->buf_len = buf_len_bytes; + pBits->bits_read = 0; + pBits->bits_written = 0; + return; +} + +void ivas_split_rend_huffman_dec_init_min_max_len( + ivas_split_rend_huffman_cfg_t *p_huff_cfg ) +{ + int16_t i, code_len; + const int32_t *codebook; + + codebook = p_huff_cfg->codebook; + + p_huff_cfg->min_len = p_huff_cfg->sym_len; + p_huff_cfg->max_len = 0; + + for ( i = 0; i < p_huff_cfg->sym_len; i++ ) + { + code_len = (int16_t) codebook[1]; + if ( p_huff_cfg->min_len > code_len ) + { + p_huff_cfg->min_len = code_len; + } + if ( p_huff_cfg->max_len < code_len ) + { + p_huff_cfg->max_len = code_len; + } + codebook = codebook + 3; + } + + return; +} + +static int16_t is_idx_present( int16_t *idx_list, const int16_t idx, const int16_t len ) +{ + int16_t i; + for ( i = 0; i < len; i++ ) + { + if ( idx_list[i] == idx ) + { + return 1; + } + } + return 0; +} +static void ivas_split_huff_get_idx_trav_list( int16_t *idx_list, ivas_split_rend_huffman_cfg_t *p_huff_cfg ) +{ + int16_t i, j, min_idx; + int32_t min_bits; + const int32_t *codebook; + + for ( i = 0; i < p_huff_cfg->sym_len; i++ ) + { + idx_list[i] = -1; + } + + for ( i = 0; i < p_huff_cfg->sym_len; i++ ) + { + codebook = p_huff_cfg->codebook; + min_bits = p_huff_cfg->max_len; + min_idx = -1; + for ( j = 0; j < p_huff_cfg->sym_len; j++ ) + { + if ( ( min_bits >= codebook[1] ) && ( is_idx_present( idx_list, j, i + 1 ) == 0 ) ) + { + min_bits = codebook[1]; + min_idx = j; + } + codebook += 3; + } + idx_list[i] = min_idx; + } + + return; +} + +void ivas_split_rend_init_huff_cfg( BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ) +{ + pHuff_cfg->pred.codebook = &ivas_split_rend_huff_pred_consts[0][0]; + pHuff_cfg->pred.sym_len = IVAS_SPLIT_REND_PRED_QUANT_PNTS; + ivas_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->pred ); + ivas_split_huff_get_idx_trav_list( pHuff_cfg->pred_idx_trav, &pHuff_cfg->pred ); + pHuff_cfg->pred_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->pred.sym_len ) ); + + pHuff_cfg->gd.codebook = &ivas_split_rend_huff_d_consts[0][0]; + pHuff_cfg->gd.sym_len = IVAS_SPLIT_REND_D_QUANT_PNTS; + ivas_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->gd ); + ivas_split_huff_get_idx_trav_list( pHuff_cfg->gd_idx_trav, &pHuff_cfg->gd ); + pHuff_cfg->gd_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->gd.sym_len ) ); + + return; +} + +void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS] ) +{ + float yaw_a, cos_yaw, sin_yaw; + int16_t pos_idx; + yaw_a = 0.0f; + for ( pos_idx = 0; pos_idx < MAX_YAW_ANGLES - 1; pos_idx++ ) + { + yaw_a += split_rend_relative_yaw_angles[pos_idx + 1]; + cos_yaw = cosf( EVS_PI * yaw_a / 180.0f ); + sin_yaw = sinf( EVS_PI * yaw_a / 180.0f ); + sin_yaw = 0.0f; + fix_pos_rot_mat[pos_idx][0][0] = cos_yaw; + fix_pos_rot_mat[pos_idx][1][1] = cos_yaw; + fix_pos_rot_mat[pos_idx][0][1] = sin_yaw; + fix_pos_rot_mat[pos_idx][1][0] = -1.0f * sin_yaw; + } + return; +} + +int16_t wrap_a( int16_t val, int16_t min_val, int16_t max_val ) +{ + if ( val < min_val ) + { + val = max_val - min_val + val + 1; + } + if ( val > max_val ) + { + val = min_val + val - max_val - 1; + } + return val; +} + +void ivas_SplitRenderer_getdiagdiff( + int16_t in_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + int16_t out_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + const int16_t sign, + const int16_t min_val, + const int16_t max_val ) +{ + out_idx[0][0] = in_idx[0][0]; + out_idx[0][1] = in_idx[0][1]; + out_idx[1][1] = in_idx[1][1] + sign * out_idx[0][0]; + out_idx[1][1] = wrap_a( out_idx[1][1], min_val, max_val ); + out_idx[1][0] = in_idx[1][0] + sign * out_idx[0][1]; + out_idx[1][0] = wrap_a( out_idx[1][0], min_val, max_val ); + + return; +} + + +int32_t ivas_split_rend_bitstream_read_int32( ivas_split_rend_bits_t *pBits, int32_t bits ) +{ + int32_t val, k; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + assert( ( pBits->bits_written - pBits->bits_read ) >= bits ); + assert( bits <= 32 ); +#endif + + /* write bit by bit */ + val = 0; + for ( k = bits - 1; k >= 0; k-- ) + { + if ( pBits->bits_buf[pBits->bits_read >> 3] & ( 1 << ( pBits->bits_read & 7 ) ) ) + { + val |= 1 << k; + } + pBits->bits_read++; + } + return val; +} +void ivas_split_rend_bitstream_write_int32( ivas_split_rend_bits_t *pBits, int32_t val, int32_t bits ) +{ + int32_t mask, k; + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + /*protection check*/ + if ( ( pBits->buf_len << 3 ) < ( pBits->bits_written + bits ) ) + { + assert( 0 ); + } +#endif + + mask = 1 << ( bits - 1 ); + /* write bit by bit */ + for ( k = 0; k < bits; k++ ) + { + if ( val & mask ) + { + pBits->bits_buf[pBits->bits_written >> 3] |= ( 1 << ( pBits->bits_written & 7 ) ); + } + else + { + pBits->bits_buf[pBits->bits_written >> 3] &= ~( 1 << ( pBits->bits_written & 7 ) ); + } + pBits->bits_written++; + mask >>= 1; + } + return; +} + + +IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( + const IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME], + int16_t subframe_idx ) +{ + int16_t idx; + + idx = ( subframe_idx * RENDERER_HEAD_POSITIONS_PER_FRAME ) / MAX_PARAM_SPATIAL_SUBFRAMES; + return headPositions[idx]; +} + + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +void ivas_log_cldfb2wav_data( + float Cldfb_In_Real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + HANDLE_CLDFB_FILTER_BANK *cldfbSyn, + const int16_t num_chs, + const int16_t num_freq_bands, + const int32_t output_Fs, + const char *filename ) +{ + float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + float pcm_out[BINAURAL_CHANNELS][L_FRAME48k]; + float *pPcm[BINAURAL_CHANNELS]; + float Cldfb_local_Real[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_local_Imag[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + int16_t sf, ch; + + assert( num_chs <= BINAURAL_CHANNELS ); + for ( ch = 0; ch < num_chs; ch++ ) + { + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + mvr2r( Cldfb_In_Real[ch][sf], Cldfb_local_Real[ch][sf], num_freq_bands ); + mvr2r( Cldfb_In_Imag[ch][sf], Cldfb_local_Imag[ch][sf], num_freq_bands ); + RealBuffer[sf] = Cldfb_local_Real[ch][sf]; + ImagBuffer[sf] = Cldfb_local_Imag[ch][sf]; + } + cldfbSynthesis( RealBuffer, + ImagBuffer, + &( pcm_out[ch][0] ), + num_freq_bands * MAX_PARAM_SPATIAL_SUBFRAMES, + cldfbSyn[ch] ); + pPcm[ch] = pcm_out[ch]; + } + dbgwrite_wav( pPcm, num_freq_bands * MAX_PARAM_SPATIAL_SUBFRAMES, + filename, output_Fs, num_chs ); +} +#endif +#endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2764aa6a10..f604c309e9 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -50,10 +50,15 @@ /* 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 ) +#define MAX_BUFFER_LENGTH_PER_CHANNEL ( L_FRAME48k ) +#define MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL ( MAX_BUFFER_LENGTH_PER_CHANNEL * 2 ) /* Maximum buffer length (total) in samples. */ +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define MAX_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#else #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#endif /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 20 @@ -86,6 +91,9 @@ typedef struct const LSSETUP_CUSTOM_STRUCT *pCustomLsOut; const EFAP_WRAPPER *pEfapOutWrapper; const IVAS_REND_HeadRotData *pHeadRotData; +#ifdef SPLIT_REND_WITH_HEAD_ROT + const IVAS_SPLIT_REND_MODE *pSplitRendMode; +#endif /* TODO @Philips : would this be a better place to store the render config data? * bearing in mind we could have multiple inputs to the renderer, we might neeed to accomodate * multiple rendering configurations unless one global one can be used. If this is not relevant, @@ -136,6 +144,10 @@ typedef struct input_base base; pan_matrix hoaDecMtx; CREND_WRAPPER crendWrapper; +#ifdef SPLIT_REND_WITH_HEAD_ROT + CLDFB_REND_WRAPPER cldfbRendWrapper; + SPLIT_REND_WRAPPER splitRendWrapper; +#endif rotation_gains rot_gains_prev; } input_sba; @@ -172,6 +184,9 @@ struct IVAS_REND IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; IVAS_REND_HeadRotData headRotData; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_MODE splitRendMode; +#endif int8_t rendererConfigEnabled; RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ @@ -194,6 +209,40 @@ static float *getSmplPtr( return buffer.data + chnlIdx * buffer.config.numSamplesPerChannel + smplIdx; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static void copyBufferToCLDFBarray( + const IVAS_REND_AudioBuffer buffer, + float re[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float im[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) +{ + uint32_t smplIdx, slotIdx; + uint32_t numCldfbSamples, num_bands; + uint32_t chnlIdx; + const float *readPtr; + + assert( ( buffer.config.is_cldfb == 1 ) && "for time domain input call copyBufferTo2dArray()" ); + readPtr = buffer.data; + numCldfbSamples = ( (uint32_t) buffer.config.numSamplesPerChannel ) >> 1; + num_bands = numCldfbSamples / CLDFB_NO_COL_MAX; + for ( chnlIdx = 0; chnlIdx < (uint32_t) buffer.config.numChannels; ++chnlIdx ) + { + for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx ) + { + for ( smplIdx = 0; smplIdx < num_bands; ++smplIdx ) + { + re[chnlIdx][slotIdx][smplIdx] = *readPtr++; + } + for ( smplIdx = 0; smplIdx < num_bands; ++smplIdx ) + { + im[chnlIdx][slotIdx][smplIdx] = *readPtr++; + } + } + } + + return; +} +#endif + static void copyBufferTo2dArray( const IVAS_REND_AudioBuffer buffer, float array[MAX_OUTPUT_CHANNELS][L_FRAME48k] ) @@ -202,6 +251,9 @@ static void copyBufferTo2dArray( uint32_t chnlIdx; const float *readPtr; +#ifdef SPLIT_REND_WITH_HEAD_ROT + assert( ( buffer.config.is_cldfb == 0 ) && "for CLDFB input call copyBufferToCLDFBarray()" ); +#endif readPtr = buffer.data; for ( chnlIdx = 0; chnlIdx < (uint32_t) buffer.config.numChannels; ++chnlIdx ) @@ -836,6 +888,12 @@ static void initHeadRotation( { hIvasRend->headRotData.headPositions[i] = quaternionInit(); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) + { + hIvasRend->headRotData.headPositionsPostRend[i] = quaternionInit(); + } +#endif return; } @@ -915,6 +973,9 @@ static rendering_context getRendCtx( ctx.pCustomLsOut = &hIvasRend->customLsOut; ctx.pEfapOutWrapper = &hIvasRend->efapOutWrapper; ctx.pHeadRotData = &hIvasRend->headRotData; +#ifdef SPLIT_REND_WITH_HEAD_ROT + ctx.pSplitRendMode = &hIvasRend->splitRendMode; +#endif return ctx; } @@ -942,7 +1003,6 @@ static CREND_WRAPPER defaultCrendWrapper( return w; } - static ivas_error setRendInputActiveIsm( void *input, const IVAS_REND_AudioConfig inConfig, @@ -1796,7 +1856,24 @@ static ivas_error updateSbaPanGains( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: - error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, *rendCtx.pOutSampleRate ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( *rendCtx.pSplitRendMode ) != SPLIT_REND_DISABLED ) + { + if ( ( *rendCtx.pSplitRendMode ) != SPLIT_REND_POST ) + { + error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, SPLIT_REND_PRE, hRendCfg, *rendCtx.pOutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + error = ivas_split_renderer_open( &inputSba->splitRendWrapper, *rendCtx.pOutSampleRate, *rendCtx.pSplitRendMode, 1 ); + } + else +#endif + { + error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, *rendCtx.pOutSampleRate ); + } break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_REND_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) @@ -1863,6 +1940,13 @@ static void clearInputSba( { ivas_rend_closeCrend( &inputSba->crendWrapper ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) + { + ivas_rend_closeCldfbRend( &inputSba->cldfbRendWrapper ); + } + ivas_split_renderer_close( &inputSba->splitRendWrapper ); +#endif return; } @@ -2125,6 +2209,11 @@ static DecoderDummy *initDecoderDummy( int32_t sampleRate, int16_t numTransChann decDummy->hDecoderConfig->Opt_Headrotation = 0; decDummy->hBinRenderer = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + decDummy->splitBinRend.hSplitRendBits = NULL; + decDummy->splitBinRend.hMultiBinCldfbData = NULL; + ivas_init_split_rend_handles( &decDummy->splitBinRend.splitrend ); +#endif decDummy->hEFAPdata = NULL; decDummy->hHrtf = NULL; decDummy->hHrtfTD = NULL; @@ -2287,7 +2376,12 @@ static void clearInputMasa( input_masa *inputMasa ) ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, - const IVAS_REND_AudioConfig outConfig ) + const IVAS_REND_AudioConfig outConfig +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_MODE splitRendMode +#endif +) { int16_t i; IVAS_REND_HANDLE hIvasRend; @@ -2327,6 +2421,9 @@ ivas_error IVAS_REND_Open( #ifdef DEBUGGING hIvasRend->numClipping = 0; #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + hIvasRend->splitRendMode = splitRendMode; +#endif /* Initialize limiter */ if ( ( error = IVAS_REND_NumOutChannels( hIvasRend, &numOutChannels ) ) != IVAS_ERR_OK ) @@ -2359,6 +2456,10 @@ ivas_error IVAS_REND_Open( { initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); hIvasRend->inputsSba[i].crendWrapper.hCrend = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; + ivas_init_split_rend_handles( &hIvasRend->inputsSba[i].splitRendWrapper ); +#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { @@ -3047,8 +3148,19 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { - latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; - *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hIvasRend->inputsSba[i].splitRendWrapper.hBinHrSplitPostRend != NULL ) + { + latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; + latency_ns += IVAS_FB_DEC_DELAY_NS; + *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); + } + else +#endif + { + latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; + *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); + } } } @@ -3072,7 +3184,9 @@ ivas_error IVAS_REND_FeedInputAudio( ivas_error error; input_base *inputBase; int16_t numInputChannels; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t cldfb2tdSampleFact; +#endif /*-----------------------------------------------------------------* * Validate function arguments *-----------------------------------------------------------------*/ @@ -3081,7 +3195,16 @@ ivas_error IVAS_REND_FeedInputAudio( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + cldfb2tdSampleFact = ( inputAudio.config.is_cldfb ) ? 2 : 1; +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( inputAudio.config.numSamplesPerChannel <= 0 || ( MAX_BUFFER_LENGTH_PER_CHANNEL < inputAudio.config.numSamplesPerChannel && inputAudio.config.is_cldfb == 0 ) || + ( ( MAX_BUFFER_LENGTH_PER_CHANNEL * cldfb2tdSampleFact ) < inputAudio.config.numSamplesPerChannel && inputAudio.config.is_cldfb == 1 ) ) +#else if ( inputAudio.config.numSamplesPerChannel <= 0 || MAX_BUFFER_LENGTH_PER_CHANNEL < inputAudio.config.numSamplesPerChannel ) +#endif { return IVAS_ERR_INVALID_BUFFER_SIZE; } @@ -3089,8 +3212,13 @@ ivas_error IVAS_REND_FeedInputAudio( { return IVAS_ERR_WRONG_NUM_CHANNELS; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && + ( inputAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut ) +#else if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && inputAudio.config.numSamplesPerChannel * 1000 != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut ) +#endif { /* Binaural rendering requires specific frame size */ return IVAS_ERR_INVALID_BUFFER_SIZE; @@ -3295,7 +3423,12 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, - const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] ) + const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const IVAS_SPLIT_REND_MODE splitRendMode +#endif +) { int16_t i; @@ -3320,9 +3453,21 @@ ivas_error IVAS_REND_SetHeadRotation( else { hIvasRend->headRotData.headRotEnabled = 1; - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( splitRendMode == SPLIT_REND_POST ) + { + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) + { + hIvasRend->headRotData.headPositionsPostRend[i] = headRot[i]; + } + } + else +#endif { - hIvasRend->headRotData.headPositions[i] = headRot[i]; + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) + { + hIvasRend->headRotData.headPositions[i] = headRot[i]; + } } } @@ -4330,6 +4475,88 @@ static ivas_error renderSbaToSba( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error renderMultiBinToSplitBinaural( + SPLIT_REND_WRAPPER *hSplitBin, + ivas_split_rend_bits_t *pBits, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const IVAS_REND_HeadRotData *pHeadRotData, + const int16_t max_bands, + float out[][L_FRAME48k] ) +{ + ivas_error error; + IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES]; + int16_t sf_idx; + + error = IVAS_ERR_OK; + + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + { + QuaternionsPre[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); + QuaternionsPost[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); + } + + ivas_renderMultiBinToSplitBinaural( hSplitBin, pBits, Cldfb_In_BinReal, Cldfb_In_BinImag, QuaternionsPre, QuaternionsPost, max_bands, out ); + + return error; +} + +static ivas_error renderSbaToSplitBinaural( + input_sba *sbaInput, + IVAS_REND_AudioBuffer outAudio ) +{ + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + ivas_error error; + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#endif + ivas_split_rend_bits_t bits; + + wmops_sub_start( "renderSbaToSplitBinaural" ); + error = IVAS_ERR_OK; + + copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + + ivas_rend_CldfbMultiBinRendProcess( + sbaInput->cldfbRendWrapper.hCldfbRend, + sbaInput->base.ctx.pHeadRotData, + Cldfb_RealBuffer, + Cldfb_ImagBuffer, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural ); + + + /*SPLIT pre rendering MD and CLDFB coding*/ + ivas_split_rend_bitstream_init( &bits, + outAudio.config.numChannels * outAudio.config.numSamplesPerChannel * sizeof( float ), + (uint8_t *) outAudio.data ); + + renderMultiBinToSplitBinaural( &sbaInput->splitRendWrapper, + &bits, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + sbaInput->base.ctx.pHeadRotData, + sbaInput->cldfbRendWrapper.hCldfbRend->max_band, + tmpCrendBuffer ); + + // TEMP zero out + set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + + wmops_sub_end(); + + return error; +} +#endif + static ivas_error renderSbaToBinaural( input_sba *sbaInput, const IVAS_REND_AudioConfig outConfig, @@ -4451,10 +4678,18 @@ static ivas_error renderInputSba( { ivas_error error; IVAS_REND_AudioBuffer inAudio; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t cldfb2tdSampleFact; +#endif inAudio = sbaInput->base.inputBuffer; +#ifdef SPLIT_REND_WITH_HEAD_ROT + cldfb2tdSampleFact = ( inAudio.config.is_cldfb ) ? 2 : 1; + if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel * cldfb2tdSampleFact ) +#else if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) +#endif { /* Mismatch between the number of input samples vs number of requested output samples - currently not allowed */ return IVAS_ERR_INVALID_BUFFER_SIZE; @@ -4479,7 +4714,17 @@ static ivas_error renderInputSba( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: - error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( *sbaInput->base.ctx.pSplitRendMode ) != SPLIT_REND_DISABLED ) + { + /*TODO : combine this with renderSbaToBinaural*/ + error = renderSbaToSplitBinaural( sbaInput, outAudio ); + } + else +#endif + { + error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); + } break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index ea4b84d897..498545a9c2 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -53,6 +53,9 @@ typedef struct { int16_t numSamplesPerChannel; int16_t numChannels; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t is_cldfb; +#endif } IVAS_REND_AudioBufferConfig; typedef struct @@ -61,6 +64,20 @@ typedef struct float *data; } IVAS_REND_AudioBuffer; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct +{ + int32_t bufLenInBytes; + int32_t bitsWritten; + int32_t bitsRead; +} IVAS_REND_BitstreamBufferConfig; +typedef struct +{ + IVAS_REND_BitstreamBufferConfig config; + uint8_t *bits; +} IVAS_REND_BitstreamBuffer; +#endif + typedef struct { IVAS_REND_AudioBufferConfig config; @@ -150,6 +167,10 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ const IVAS_REND_AudioConfig outConfig /* i : output audio config */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_SPLIT_REND_MODE splitRendMode /* i : split rendering mode */ +#endif ); /* Note: this will reset custom LFE routings set for any MC input */ @@ -252,6 +273,10 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const IVAS_SPLIT_REND_MODE splitRendMode +#endif ); ivas_error IVAS_REND_GetSamples( -- GitLab From 45cc1b96d208b1dacdca70ddd012a04bfb0fe16d Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Dec 2022 22:56:46 +0200 Subject: [PATCH 0004/1418] Implementation of contribution 26 - combined objects + MASA (OMASA) input format --- apps/decoder.c | 59 ++ apps/encoder.c | 127 +++ lib_com/ivas_cnst.h | 23 +- lib_com/ivas_ism_config.c | 102 ++- lib_com/ivas_masa_com.c | 249 +++++- lib_com/ivas_prot.h | 166 ++++ lib_com/ivas_rom_com.c | 42 + lib_com/ivas_rom_com.h | 8 + lib_com/ivas_stat_com.h | 4 +- lib_com/options.h | 10 +- lib_dec/ivas_cpe_dec.c | 53 +- lib_dec/ivas_dec.c | 135 ++- lib_dec/ivas_dirac_dec.c | 95 +- lib_dec/ivas_dirac_dec_binaural_functions.c | 388 +++++++- lib_dec/ivas_dirac_output_synthesis_dec.c | 123 ++- lib_dec/ivas_init_dec.c | 175 +++- lib_dec/ivas_ism_metadata_dec.c | 55 +- lib_dec/ivas_ism_param_dec.c | 4 + lib_dec/ivas_ism_renderer.c | 165 ++++ lib_dec/ivas_masa_dec.c | 653 +++++++++++++- lib_dec/ivas_mono_dmx_renderer.c | 17 + lib_dec/ivas_qmetadata_dec.c | 173 +++- lib_dec/ivas_sce_dec.c | 31 +- lib_dec/ivas_stat_dec.h | 55 ++ lib_dec/lib_dec.c | 36 + lib_dec/lib_dec.h | 9 + lib_enc/ivas_cpe_enc.c | 40 +- lib_enc/ivas_enc.c | 96 +- lib_enc/ivas_init_enc.c | 137 ++- lib_enc/ivas_ism_enc.c | 45 +- lib_enc/ivas_ism_metadata_enc.c | 215 ++++- lib_enc/ivas_ism_param_enc.c | 5 + lib_enc/ivas_masa_enc.c | 828 ++++++++++++++++- lib_enc/ivas_omasa_enc.c | 936 ++++++++++++++++++++ lib_enc/ivas_qmetadata_enc.c | 308 ++++++- lib_enc/ivas_sce_enc.c | 10 + lib_enc/ivas_stat_enc.h | 59 ++ lib_enc/lib_enc.c | 97 +- lib_enc/lib_enc.h | 24 + lib_rend/ivas_output_init.c | 20 + 40 files changed, 5663 insertions(+), 114 deletions(-) create mode 100644 lib_enc/ivas_omasa_enc.c diff --git a/apps/decoder.c b/apps/decoder.c index 7f94e19808..79cfb67d4f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -123,6 +123,12 @@ typedef struct #endif #endif +#ifdef MASAISM_EDIT_OBJECTS + bool editing_ism_enabled; + int16_t index_of_edited_ism; + int16_t azimuth_edited_ism; + int16_t elevation_edited_ism; +#endif } DecArguments; @@ -496,6 +502,17 @@ int main( } } +#ifdef MASAISM_EDIT_OBJECTS + /*------------------------------------------------------------------------------------------* + * Set edited object positions + *------------------------------------------------------------------------------------------*/ + + if ( arg.editing_ism_enabled ) + { + IVAS_DEC_SetEditedIsmPositions( hIvasDec, arg.index_of_edited_ism, arg.azimuth_edited_ism, arg.elevation_edited_ism ); + } +#endif + /*-----------------------------------------------------------------* * Decoding *-----------------------------------------------------------------*/ @@ -690,6 +707,9 @@ static bool parseCmdlIVAS_dec( { int16_t i; char argv_to_upper[FILENAME_MAX]; +#ifdef MASAISM_EDIT_OBJECTS + int32_t tmp; +#endif #ifdef DEBUGGING float ftmp; char stmp[FILENAME_MAX]; @@ -731,6 +751,13 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; +#ifdef MASAISM_EDIT_OBJECTS + arg->editing_ism_enabled = false; + arg->index_of_edited_ism = 0; + arg->azimuth_edited_ism = 0; + arg->elevation_edited_ism = 0; +#endif + /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -958,6 +985,38 @@ static bool parseCmdlIVAS_dec( } i++; } +#ifdef MASAISM_EDIT_OBJECTS + else if ( strcmp( argv_to_upper, "-EDIT_ISM" ) == 0 ) /* Edit ISM position: objectID, azimuth (deg), elevation (deg) */ + { + arg->editing_ism_enabled = true; + i++; + + if ( argc - i <= 6 || argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Edited ISM position parameters not defined! \n\n" ); + usage_dec(); + return false; + } + + if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + { + arg->index_of_edited_ism = tmp; + i++; + } + + if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + { + arg->azimuth_edited_ism = tmp; + i++; + } + + if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + { + arg->elevation_edited_ism = tmp; + i++; + } + } +#endif /*-----------------------------------------------------------------* * Option not recognized diff --git a/apps/encoder.c b/apps/encoder.c index 0bad34878b..af70f8f0a4 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -98,6 +98,14 @@ typedef union _EncInputFormatConfig /* MC details */ IVAS_ENC_MC_LAYOUT mcLayout; +#ifdef MASA_AND_OBJECTS + struct EncMasaIsmConfig + { + int16_t numObjects; + const char *metadataFiles[IVAS_MAX_NUM_OBJECTS]; + IVAS_ENC_MASA_VARIANT masaVariant; + } masa_ism; +#endif } EncInputFormatConfig; /* Struct for storing cmdln arguments */ @@ -488,6 +496,15 @@ int main( goto cleanup; } break; +#ifdef MASA_AND_OBJECTS + case IVAS_ENC_INPUT_MASA_ISM: + if ( ( error = IVAS_ENC_ConfigureForMASAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masa_ism.numObjects, arg.inputFormatConfig.masa_ism.masaVariant ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_ENC_ConfigureForMASAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); + exit( -1 ); + } + break; +#endif default: fprintf( stderr, "\nInvalid input type\n\n" ); goto cleanup; @@ -513,7 +530,12 @@ int main( } } + +#ifdef MASA_AND_OBJECTS + const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM ) ? arg.inputFormatConfig.ism.numObjects : 0; +#else const int16_t numIsmInputs = arg.inputFormat == IVAS_ENC_INPUT_ISM ? arg.inputFormatConfig.ism.numObjects : 0; +#endif for ( i = 0; i < numIsmInputs; ++i ) { @@ -1446,6 +1468,100 @@ static bool parseCmdlIVAS_enc( return false; } } +#ifdef MASA_AND_OBJECTS + else if ( strcmp( to_upper( argv[i] ), "-ISM_MASA" ) == 0 ) + { + arg->inputFormat = IVAS_ENC_INPUT_MASA_ISM; + i++; + + if ( i < argc - 5 ) + { + if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + { + i++; + } + + if ( tmp <= 0 ) + { + fprintf( stderr, "Error: Too low number of ISM channels specified!\n\n" ); + usage_enc(); + } + else + { + if ( tmp <= IVAS_MAX_NUM_OBJECTS ) /* number of ISM channels */ + { + arg->inputFormatConfig.masa_ism.numObjects = (int16_t) tmp; + } + else + { + fprintf( stderr, "Error: Too high number of ISM channels!\n\n" ); + usage_enc(); + } + } + } + else + { + fprintf( stderr, "Error: Number of ISM channels not specified!\n\n" ); + usage_enc(); + } + if ( i < argc - 4 ) + { + if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + { + i++; + } + + switch ( tmp ) + { + case 1: + arg->inputFormatConfig.masa_ism.masaVariant = IVAS_ENC_MASA_1CH; + break; + case 2: + arg->inputFormatConfig.masa_ism.masaVariant = IVAS_ENC_MASA_2CH; + break; + default: + fprintf( stderr, "Error: MASA channels must for the moment be 1 or 2.\n\n" ); + usage_enc(); + break; + } + } + + /* read input metadata files */ + for ( j = 0; j < arg->inputFormatConfig.masa_ism.numObjects; j++ ) + { + if ( i < argc - 4 ) + { + if ( strcmp( argv[i], "NULL" ) == 0 || strcmp( argv[i], "null" ) == 0 ) + { + /* no metadata input file -> encode only audio streams */ + arg->inputFormatConfig.masa_ism.metadataFiles[j] = NULL; + } + else + { + arg->inputFormatConfig.masa_ism.metadataFiles[j] = argv[i]; + } + + i++; + } + else + { + fprintf( stderr, "Error: not enough arguments\n\n" ); + usage_enc(); + } + } + + if ( i < argc - 4 ) + { + arg->masaMetadataFile = argv[i]; + i++; + } + else + { + fprintf( stderr, "Error: not enough MASA arguments\n\n" ); + usage_enc(); + } + } +#endif else if ( strcmp( argv_to_upper, "-STEREO_DMX_EVS" ) == 0 ) { arg->inputFormat = IVAS_ENC_INPUT_MONO; @@ -1621,6 +1737,10 @@ static void usage_enc( void ) fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); 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" ); +#ifdef MASA_AND_OBJECTS + fprintf( stdout, " for IVAS MASA and objects R = (13200, 16400, 24400, 32000, 48000, 64000, 96000, 128000, \n" ); + fprintf( stdout, " 160000, 192000, 256000, 384000, 512000)\n" ); +#endif fprintf( stdout, " Alternatively, R can be a bitrate switching file which consists of R values\n" ); fprintf( stdout, " indicating the bitrate for each frame in bps. These values are stored in\n" ); fprintf( stdout, " binary format using 4 bytes per value\n" ); @@ -1644,6 +1764,13 @@ static void usage_enc( void ) fprintf( stdout, "-masa Ch File : MASA format \n" ); fprintf( stdout, " where Ch specifies the number of input/transport channels (1 or 2): \n" ); fprintf( stdout, " and File specifies input file containing parametric metadata \n" ); +#ifdef MASA_AND_OBJECTS + fprintf( stdout, "-ism_masa IsmChannels MasaChannels IsmFiles MasaFile : MASA and objects format \n" ); + fprintf( stdout, " where IsmChannels specifies the number of ISms (1-4)\n" ); + fprintf( stdout, " and MasaChannels specifies the number of MASA input/transport channels (1 or 2) \n" ); + fprintf( stdout, " and IsmFiles specify input files containing metadata, one file per object \n" ); + fprintf( stdout, " and MasaFile specifies MASA input file containing parametric metadata \n" ); +#endif fprintf( stdout, "-mc InputConf : Multi-channel format\n" ); fprintf( stdout, " where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4\n" ); fprintf( stdout, " Loudspeaker positions are assumed to have azimuth and elevation as per \n" ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 7306216378..0e1aa45572 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -70,7 +70,9 @@ typedef enum SBA_FORMAT, /* IVAS SBA (ambisonics) format */ MASA_FORMAT, /* IVAS MASA format */ MC_FORMAT, /* IVAS multi-channel format */ - +#ifdef MASA_AND_OBJECTS + MASA_ISM_FORMAT, /* IVAS combined MASA + objects format*/ +#endif } IVAS_FORMAT; @@ -179,7 +181,11 @@ 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 */ +#ifdef MASA_AND_OBJECTS +#define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS + 2 ) /* number of max. metadata (now only 2 for DirAC) */ +#else #define MAX_NUM_METADATA max( 2, MAX_NUM_OBJECTS ) /* number of max. metadata (now only 2 for DirAC) */ +#endif #define IVAS_ENC_DELAY_NS ACELP_LOOK_NS @@ -345,6 +351,12 @@ typedef enum ISM_MODE_NONE, ISM_MODE_DISC, /* discrete ISM */ ISM_MODE_PARAM /* parametric ISM */ +#ifdef MASA_AND_OBJECTS + , + ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ + ISM_MASA_MODE_ONE_OBJ, /* MASA ISM mode when one object is encoded separarately */ + ISM_MASA_MODE_DISC +#endif } ISM_MODE; @@ -1088,6 +1100,12 @@ enum #define MASA_DELTA_AZI_DCT 10 #define MASA_TRANSP_BITS 1 +#ifdef MASA_AND_OBJECTS +#define MASA_ISM_FORMAT_BITS 1 +#define NO_BITS_MASA_ISM_NO_OBJ 2 +#define MASA2TOTAL_THR 0.98f +#define BITS_MASA2TOTTAL_DCT0 6 +#endif #define MASA_HEADER_BITS 2 #define MASA_SUBFRAME_BITS 1 #define MASA_LOWBITRATE_MODE_BITS 1 @@ -1143,6 +1161,9 @@ enum #define MASA_ANGLE_AT_EQUATOR_DEG 0.738796268264740f #define MASA_INV_ANGLE_AT_EQUATOR_DEG 1.353553128183453f #define MASA_STEREO_MIN_BITRATE IVAS_24k4 +#ifdef MASA_AND_OBJECTS +#define MAXIMUM_OMASA_FREQ_BANDS 8 /* Corresponds to maximum number of coding bands at 32 kbps */ +#endif #define MASA_BIT_REDUCT_PARAM 10 #define MASA_MAXIMUM_TWO_DIR_BANDS 18 diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index fc4be3127e..4869de36ce 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -96,6 +96,10 @@ ivas_error ivas_ism_config( 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 */ +#ifdef MASA_AND_OBJECTS + , + int16_t masa_ism_flag /* i : flag indicating ISM MASA format */ +#endif ) { int16_t ch; @@ -107,9 +111,20 @@ ivas_error ivas_ism_config( int16_t n_ISms; ivas_error error; - error = IVAS_ERR_OK; - n_ISms = nchan_transport; + error = IVAS_ERR_OK; +#ifdef MASA_AND_OBJECTS + if ( masa_ism_flag == 1 ) + { + n_ISms = num_obj; + } + else + { +#endif + n_ISms = nchan_transport; +#ifdef MASA_AND_OBJECTS + } +#endif /* initialization */ ism_metadata_flag_global = 0; @@ -131,7 +146,16 @@ ivas_error ivas_ism_config( /* count ISm common signaling bits */ if ( hIsmMeta != NULL ) { +#ifdef MASA_AND_OBJECTS + nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS; + if ( masa_ism_flag == 0 ) + { + /* the bits for writing the number of objects are counted here for pure ISM modes */ + nb_bits_metadata[0] += num_obj; + } +#else nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj; +#endif for ( ch = 0; ch < n_ISms; ch++ ) { @@ -490,3 +514,77 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } +#ifdef MASA_AND_OBJECTS +/*--------------------------------------------------------------- + * ivas_omasa_ism_mode_select() + * + * selects the ISM mode base on bit-rate and number of objects in the combined ISM MASA format mode + * ---------------------------------------------------------------*/ + +/*! r : ISM format mode */ +ISM_MODE ivas_omasa_ism_mode_select( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t no_obj /* i : number of objects */ +) +{ + ISM_MODE ism_mode = ISM_MODE_NONE; + + switch ( no_obj ) + { + case 1: + if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_48k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 2: + if ( ivas_total_brate >= IVAS_80k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + else if ( ivas_total_brate >= IVAS_48k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 3: + + case 4: + if ( ivas_total_brate >= IVAS_160k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_80k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + else if ( ivas_total_brate >= IVAS_48k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } + else + { + ism_mode = ISM_MODE_NONE; + } + break; + } + + return ism_mode; +} +#endif diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index f98dcd8414..bf08a0b229 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -66,6 +66,12 @@ void ivas_masa_set_elements( int16_t *element_mode, /* o : element mode */ int16_t *nSCE, /* o : number of SCEs */ int16_t *nCPE /* o : number of CPEs */ +#ifdef MASA_AND_OBJECTS + , + int16_t ivas_format, + const ISM_MODE ism_mode, + int32_t sce_brate +#endif ) { if ( nchan_transport == 2 ) @@ -78,16 +84,43 @@ void ivas_masa_set_elements( *element_mode = IVAS_SCE; /* This is needed for the initialization phase to initialize codec mode to SCE, since it is written first to the file*/ } else +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) + { + + *nCPE = 1; + + if ( *element_mode == -1 ) + { + *element_mode = IVAS_CPE_DFT; /* To have it initialized in case it was not already. */ + } + if ( ivas_total_brate > MIN_BRATE_MDCT_STEREO ) + { + *element_mode = IVAS_CPE_MDCT; + if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_ONE_OBJ ) && ( ivas_total_brate - sce_brate < MIN_BRATE_MDCT_STEREO ) ) + { + *element_mode = IVAS_CPE_DFT; + } + } + } + else +#endif { *nCPE = 1; *nSCE = 0; - if ( ivas_total_brate > IVAS_48k ) + if ( ivas_total_brate > MIN_BRATE_MDCT_STEREO ) { *element_mode = IVAS_CPE_MDCT; } } hQMetaData->bits_frame_nominal = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ); +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) + { + hQMetaData->bits_frame_nominal -= (int16_t) ( sce_brate / FRAMES_PER_SEC ); + } +#endif } else if ( nchan_transport == 1 ) { @@ -388,3 +421,217 @@ void masa_sample_rate_band_correction( return; } + +#ifdef MASA_AND_OBJECTS +/*--------------------------------------------------------------- + * valid() + * + * Checking validity of the index of an ISM ratio index vector, + * within the indexing function. + *---------------------------------------------------------------*/ +int16_t valid( /* o: valid or not 1/0 */ + int16_t index, /* i: index to be checked */ + int16_t K, /* i: L1 norm to check against */ + int16_t len /* i: vector length */ +) +{ + int16_t out; + int16_t i, sum, elem; + int16_t base[4]; + + sum = 0; + set_s( base, 1, len ); + + + for ( i = 1; i < len; i++ ) + { + base[i] = base[i - 1] * 10; + } + sum = 0; + for ( i = len - 1; i >= 0; i-- ) + { + elem = index / base[i]; + sum += elem; + index -= elem * base[i]; + } + if ( sum <= K ) + { + out = 1; + } + else + { + out = 0; + } + return out; +} + +/*--------------------------------------------------------------- + * reconstruct_ism_ratios() + * + * Obtains ISM ratio values from the quantized indexes + *---------------------------------------------------------------*/ +void reconstruct_ism_ratios( + int16_t *ratio_ism_idx, /* i: index vector */ + int16_t n_ism, /* i: number of components/objects */ + float step, /* i: quantization step */ + float *q_energy_ratio_ism /* o: reconstructed ISM values */ +) +{ + int16_t i; + float sum; + sum = 0; + for ( i = 0; i < n_ism - 1; i++ ) + { + q_energy_ratio_ism[i] = ratio_ism_idx[i] * step; + sum += q_energy_ratio_ism[i]; + } + q_energy_ratio_ism[n_ism - 1] = 1.0f - sum; + return; +} + +/*--------------------------------------------------------------- + * modify_masa_energy_ratios() + * + * Updates energy ratios by taking into account the MASA content contribution + * to the total audio scene + *---------------------------------------------------------------*/ +void modify_masa_energy_ratios( + IVAS_QMETADATA_HANDLE hQMetaData /* i/o: Metadata handle */ +) +{ + int16_t i, m, d, b; + for ( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ ) + { + if ( hQMetaData->q_direction[0].cfg.nblocks == 1 ) + { + i = 0; + } + else + { + i = m; + } + + for ( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ ) + { + for ( d = 0; d < hQMetaData->no_directions; d++ ) + { + hQMetaData->q_direction[d].band_data[b].energy_ratio[m] = hQMetaData->q_direction[d].band_data[b].energy_ratio[m] * hQMetaData->masa_to_total_energy_ratio[i][b]; + } + } + } +} + +/*--------------------------------------------------------------- + * ivas_get_stereo_panning_gains() + * + * + *---------------------------------------------------------------*/ +void ivas_get_stereo_panning_gains( + float aziDeg, + float eleDeg, + float panningGains[2] ) +{ + float aziRad, eleRad; + float y, mappedX, aziRadMapped, A, A2, A3; + const float LsAngleRad = 30.0f * PI_OVER_180; + /* Convert azi and ele to an azi value of the cone of confusion */ + aziRad = aziDeg * PI_OVER_180; + eleRad = eleDeg * PI_OVER_180; + y = ( sinf( aziRad ) * cosf( eleRad ) ); + mappedX = sqrtf( max( 0.0f, 1.0f - ( y * y ) ) ); + aziRadMapped = atan2f( y, mappedX ); + + if ( aziRadMapped >= LsAngleRad ) + { /* Left side */ + panningGains[0] = 1.0f; + panningGains[1] = 0.0f; + } + else if ( aziRadMapped <= -LsAngleRad ) + { /* Right side */ + panningGains[0] = 0.0f; + panningGains[1] = 1.0f; + } + else /* Tangent panning law */ + { + A = tanf( aziRadMapped ) / tanf( LsAngleRad ); + A2 = ( A - 1.0f ) / max( 0.001f, A + 1.0f ); + A3 = 1.0f / ( A2 * A2 + 1.0f ); + panningGains[0] = sqrtf( A3 ); + panningGains[1] = sqrtf( 1.0f - A3 ); + } +} + +/*--------------------------------------------------------------- + * distribute_evenly_ism() + * + * Obtain ISM ratio indexes for even content distribution bbetween objects + *---------------------------------------------------------------*/ +void distribute_evenly_ism( + int16_t *idx, /* o: index values */ + int16_t K, /* i: sum of indexes */ + int16_t no_ism /* i: number of objects */ +) +{ + int16_t i; + int16_t sum; + sum = 0; + for ( i = 0; i < no_ism; i++ ) + { + idx[i] = (int16_t) ( K / no_ism ); + sum += idx[i]; + } + assert( sum <= K ); + i = 0; + while ( sum < K ) + { + if ( i == no_ism ) + { + i = 0; + } + idx[i]++; + sum++; + i++; + } +} + +/*--------------------------------------------------------------- + * calculate_cpe_brate_MASA_ISM() + * + * Calculates bitrate for MASA_ISM mode that is not used for separated objects, + * * but for the CPE part (metadata included) + *---------------------------------------------------------------*/ +int32_t /* o: cpe bitrate value */ +calculate_cpe_brate_MASA_ISM( + ISM_MODE ism_mode, /* i: ism mode */ + int32_t ivas_total_brate, /* i: total bit rate for IVAS */ + int16_t n_ism ) /* i: number of objects */ +{ + int32_t cpe_brate; + int16_t k, sce_id; + + k = 0; + + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) + { + k++; + } + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + cpe_brate = ivas_total_brate - sep_object_brate[k - 2][0]; /* take data from the first column */ + } + else if ( ism_mode == ISM_MASA_MODE_DISC ) + { + cpe_brate = ivas_total_brate; + + for ( sce_id = 0; sce_id < n_ism; sce_id++ ) + { + cpe_brate -= sep_object_brate[k - 2][n_ism - 1]; + } + } + else + { + cpe_brate = ivas_total_brate; + } + return cpe_brate; +} +#endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 7b2ad0a798..8bd1d65bfb 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -741,6 +741,9 @@ ivas_error ivas_ism_config( 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 */ +#ifdef MASA_AND_OBJECTS + , int16_t masa_ism_flag /* i : flag indicating ISM MASA format */ +#endif ); void ivas_ism_reset_metadata( @@ -801,6 +804,10 @@ ivas_error ivas_ism_metadata_enc( const int16_t localVAD[], /* i : VAD flag */ const int16_t ism_mode, /* i : ISM mode */ const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ +#ifdef MASA_AND_OBJECTS + , + int16_t n_ism /* i : number of ism-s */ +#endif ); ivas_error ivas_ism_metadata_dec( @@ -3267,6 +3274,10 @@ void ivas_dirac_dec_binaural( const int16_t nchan_transport /* i : number of transport channels */ ); +#ifdef MASA_AND_OBJECTS +void ivas_get_stereo_panning_gains( float aziDeg, float eleDeg, float panningGains[2] ); +#endif + ivas_error ivas_binaural_reverb_open( REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */ const int16_t numBins, /* i : number of CLDFB bins */ @@ -3455,6 +3466,9 @@ void ivas_dirac_dec_compute_directional_responses( DIRAC_DEC_HANDLE hDirAC, /* i/o: DirAC handle */ const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ +#ifdef MASA_AND_OBJECTS + MASA_ISM_DATA_HANDLE hMasaIsm, /* i : MASA_ISM data structure */ +#endif const int16_t direction_idx, /* i : index for direction (azi and ele) */ const int16_t subframe_idx, /* i : subframe index */ const float *surCohRatio, @@ -4406,6 +4420,13 @@ void ivas_masa_encode( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t Opt_DTX_ON, /* i : DTX on flag */ const int16_t element_mode /* i : element mode */ +#ifdef MASA_AND_OBJECTS + , + ISM_MODE ism_mode, /* i : ISM format mode */ + int16_t nchan_ism, /* i : number of ism channels */ + ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ + int16_t idx_separated_object /* i : index of the separated object */ +#endif ); void ivas_masa_estimate_energy( @@ -4427,8 +4448,59 @@ void ivas_masa_set_elements( int16_t *element_mode, /* o : element mode */ int16_t *nSCE, /* o : number of SCEs */ int16_t *nCPE /* o : number of CPEs */ +#ifdef MASA_AND_OBJECTS + , + int16_t ivas_format, /* i : IVAS format */ + const ISM_MODE ism_mode, /* i : ISM mode */ + int32_t sce_brate /* i : bitrate of SCE */ +#endif +); + +#ifdef MASA_AND_OBJECTS +int16_t valid( + int16_t index, + int16_t K, + int16_t len +); + +void reconstruct_ism_ratios( + int16_t *ratio_ism_idx, + int16_t n_ism, + float step, + float *q_energy_ratio_ism ); +void distribute_evenly_ism( + int16_t *idx, + int16_t K, + int16_t no_ism +); + +int16_t ivas_qmetadata_DecodeExtendedGR( + uint16_t* bitstream, + int16_t* index, + const int16_t alph_size, + const int16_t gr_param +); + +int16_t ivas_qmetadata_encode_extended_gr_length( + const uint16_t value, + const uint16_t alphabet_size, + const int16_t gr_param); + +void ivas_qmetadata_encode_extended_gr( + BSTR_ENC_HANDLE hMetaData, /* i/o: q_metadata handle */ + const uint16_t value, /* i : value to be encoded */ + const uint16_t alphabet_size, /* i : alphabet size */ + const int16_t gr_param); /* i : GR order */ + +int32_t /* o: cpe bitrate value */ +calculate_cpe_brate_MASA_ISM( + ISM_MODE ism_mode, /* i: ism mode */ + int32_t ivas_total_brate, /* i: total bit rate for IVAS */ + int16_t n_ism ); /* i: number of objects */ +#endif + void ivas_masa_set_coding_config( MASA_CODEC_CONFIG* config, /* i/o: MASA coding config structure */ int16_t* band_mapping, /* o : Band mapping used */ @@ -4961,6 +5033,100 @@ void ivas_filter_process( const int16_t length /* i : filter order */ ); +#ifdef MASA_AND_OBJECTS +/* ----------------------------------------------------------------------------------* +* OMASA prototypes +* ----------------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_enc_open( + Encoder_Struct* st_ivas /* i/o: IVAS encoder handle */ +); + +void ivas_omasa_enc_close( + OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ + const int16_t nchan_ism /* i : number of objects */ +); + +void ivas_omasa_set_config( + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ + const int32_t input_Fs /* i : Input sample rate */ +); + +void ivas_omasa_enc( + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ + float data_in_f[][L_FRAME48k], /* i : Input audio signals for parameter analysis */ + float data_out_f[][L_FRAME48k], /* o : Transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t nchan_transport, /* i : Number of transport channels */ + const int16_t nchan_inp, /* i : Number of objects for parameter analysis */ + const ISM_MODE ism_mode, /* i : ISM mode */ + float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ + int16_t* idx_separated_object /* o : Index of the separated object */ +); + +ISM_MODE ivas_omasa_ism_mode_select( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t no_obj /* i : number of input ISM's */ +); + +void ivas_merge_masa_transports( + float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ + float data_in_f2[][L_FRAME48k], /* i : Transport audio signals 2 */ + float data_out_f[][L_FRAME48k], /* o : Merged transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t num_transport_channels /* i : Number of transport audio signals */ +); + +void ivas_masa_ism_data_open( + Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ +); + + +void preProcessStereoTransportsForMovedObjects( + Decoder_Struct* st_ivas, + float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + uint8_t nBins, + uint8_t firstSubframe, + uint8_t nSubframes +); + +ivas_error ivas_masa_ism_separate_object_renderer_open( + Decoder_Struct* st_ivas /* i/o: IVAS decoder structure */ +); + +void ivas_masa_ism_separate_object_render( + Decoder_Struct* st_ivas, /* i/o: IVAS decoder structure */ + float input_f[][L_FRAME48k], /* i : separated object signal */ + float output_f[][L_FRAME48k], /* i/o: output signals */ + const int16_t output_frame /* i : output frame length per channel */ +); + +void ivas_masa_ism_set_edited_objects( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +); + +void encode_masa_to_total( + IVAS_QMETADATA_HANDLE hQMetaData, + BSTR_ENC_HANDLE hMetaData +); + +void decode_masa_to_total( + uint16_t* bit_stream, + int16_t* index, + float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + int16_t nbands +); + +void modify_masa_energy_ratios( + IVAS_QMETADATA_HANDLE hQMetaData +); + +#endif /*----------------------------------------------------------------------------------* * TD Binaural Object renderer diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index c824c94a40..7c28e6b4f6 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2779,6 +2779,48 @@ const float McMASA_LFEGain_vectors[64] = -2.14f, 0.26f, 0.84f, 1.02f }; +#ifdef MASA_AND_OBJECTS + +int32_t sep_object_brate[][MAX_NUM_OBJECTS] ={ + {0, 0, 0, 0}, /* 13k2 */ + {0, 0, 0, 0}, /* 16k4 */ + {0, 0, 0, 0}, /* 24k4 */ + {0, 0, 0, 0}, /* 32k */ + {0, 0, 0, 0}, /* 48k */ + {16000, 0, 0, 0}, /* 64k */ + {20000, 16000, 0, 0}, /* 80k */ + {IVAS_32k, 20000, 0, 0}, /* 96k */ + {IVAS_32k, IVAS_24k4, 0, 0}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ + {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ + {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ + {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ + {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ +}; +/* column wise DCT matrices for 4 5, and 8 dim */ + float dct4[] = { + 0.5000f, 0.6533f, 0.5000f, 0.2706f, + 0.5000f, 0.2706f, -0.5000f, -0.6533f, + 0.5000f, -0.2706f, -0.5000f, 0.6533f, + 0.5000f, -0.6533f, 0.5000f, -0.2706f + }; + + float dct5[] = { + 0.4472f, 0.6015f, 0.5117f, 0.3717f, 0.1954f, + 0.4472f, 0.3717f, -0.1954f, -0.6015f, -0.5117f, + 0.4472f, 0.0000f, -0.6325f, -0.0000f, 0.6325f, + 0.4472f, -0.3717f, -0.1954f, 0.6015f, -0.5117f, + 0.4472f, -0.6015f, 0.5117f, -0.3717f, 0.1954f + }; + float dct8[] = { + 0.3536f, 0.4904f, 0.4619f, 0.4157f, 0.3536f, 0.2778f, 0.1913f, 0.0975f, 0.3536f, 0.4157f, + 0.1913f, -0.0975f, -0.3536f, -0.4904f, -0.4619f, -0.2778f, 0.3536f, 0.2778f, -0.1913f, -0.4904f, + -0.3536f, 0.0975f, 0.4619f, 0.4157f, 0.3536f, 0.0975f, -0.4619f, -0.2778f, 0.3536f, 0.4157f, + -0.1913f, -0.4904f, 0.3536f, -0.0975f, -0.4619f, 0.2778f, 0.3536f, -0.4157f, -0.1913f, 0.4904f, + 0.3536f, -0.2778f, -0.1913f, 0.4904f, -0.3536f, -0.0975f, 0.4619f, -0.4157f, 0.3536f, -0.4157f, + 0.1913f, 0.0975f, -0.3536f, 0.4904f, -0.4619f, 0.2778f, 0.3536f, -0.4904f, 0.4619f, -0.4157f, + 0.3536f, -0.2778f, 0.1913f, -0.0975f }; +#endif /*----------------------------------------------------------------------------------* * ISM ROM tables diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 2b3755087c..acf2a80924 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -312,6 +312,14 @@ extern const float cb_azi_chan[]; extern const float McMASA_LFEGain_vectors[64]; +#ifdef MASA_AND_OBJECTS +/* MASA and ISM combined format */ +extern int32_t sep_object_brate[][MAX_NUM_OBJECTS]; +extern float dct4[]; +extern float dct5[]; +extern float dct8[]; +#endif + /*----------------------------------------------------------------------------------* * ISM ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 2ec890b57d..ff2606ee62 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -526,7 +526,9 @@ typedef struct ivas_masa_qmetadata_frame_struct int16_t ec_flag; float dir_comp_ratio; uint8_t is_masa_ivas_format; - +#ifdef MASA_AND_OBJECTS + float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; /* TODO Nokia: This should be moved to some other place and reserved only when needed. */ +#endif } IVAS_QMETADATA, *IVAS_QMETADATA_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index 8a35f4f6f4..528e348ff4 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -61,11 +61,11 @@ /*#define MEM_COUNT_DETAILS*/ /* RAM counting tool: print per sub-structure details */ -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +/*#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_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/" */ @@ -174,6 +174,12 @@ #define FIX_GET_DELAY_RETURN /* Issue 223: change return data type in function get_delay() */ +#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ +#ifdef MASA_AND_OBJECTS +#define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ +#endif + + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 12b8fcb899..34d3584f7a 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -77,7 +77,9 @@ ivas_error ivas_cpe_dec( Decoder_State **sts; int32_t ivas_total_brate; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t cpe_brate; +#endif error = IVAS_ERR_OK; wmops_sub_start( "ivas_cpe_dec" ); @@ -218,15 +220,33 @@ ivas_error ivas_cpe_dec( /* read DFT Stereo side info */ nb_bits = (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal ); - sts[1]->bit_stream = sts[0]->bit_stream + ivas_total_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; - +#ifdef MASA_AND_OBJECTS + cpe_brate = ivas_total_brate; + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + sts[1]->bit_stream = sts[0]->bit_stream + cpe_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; + } + else + { +#endif + sts[1]->bit_stream = sts[0]->bit_stream + ivas_total_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; +#ifdef MASA_AND_OBJECTS + } +#endif if ( ivas_total_brate == IVAS_SID_5k2 ) { nb_bits -= SID_FORMAT_NBITS; sts[1]->bit_stream -= SID_FORMAT_NBITS; } +#ifdef MASA_AND_OBJECTS + if ( ( ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || + ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) ) ) && + ivas_total_brate > IVAS_SID_5k2 ) +#else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ivas_total_brate > IVAS_SID_5k2 ) +#endif { sts[0]->total_brate = hCPE->element_brate; /* Only mono downmix was transmitted in this case */ } @@ -543,7 +563,9 @@ ivas_error create_cpe_dec( Decoder_State *st; int32_t output_Fs; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t cpe_brate; +#endif error = IVAS_ERR_OK; /*-----------------------------------------------------------------* @@ -581,7 +603,11 @@ ivas_error create_cpe_dec( hCPE->lt_es_em = 0.0f; /* Note: nchan_out is considered to be related to the structure. This is nchan_out for CPE and for MASA_format is always 2. */ +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) +#else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) +#endif { hCPE->nchan_out = CPE_CHANNELS; } @@ -589,8 +615,21 @@ ivas_error create_cpe_dec( { hCPE->nchan_out = min( CPE_CHANNELS, st_ivas->hDecoderConfig->nchan_out ); } - +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + cpe_brate = element_brate; + } + else + { + cpe_brate = st_ivas->hDecoderConfig->ivas_total_brate; + } + if ( ( ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || + ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && + st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) +#else if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) +#endif { hCPE->nchan_out = 1; } @@ -607,7 +646,11 @@ ivas_error create_cpe_dec( for ( i = 0; i < CPE_CHANNELS; i++ ) { +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || +#else if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || +#endif ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) { if ( ( hCPE->input_mem[i] = (float *) count_malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 5d3a5a10f9..9ceaa52f68 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -60,11 +60,17 @@ ivas_error ivas_dec( float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ /* IVAS_fmToDo: buffer can be allocated dynamically based on the actual number of output channels */ int16_t nchan_remapped; float output_lfe_ch[L_FRAME48k]; +#ifdef MASA_AND_OBJECTS + int16_t nb_bits_metadata[MAX_SCE + 1]; +#else int16_t nb_bits_metadata[MAX_SCE]; +#endif int32_t output_Fs, ivas_total_brate; AUDIO_CONFIG output_config; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t ism_brate; +#endif error = IVAS_ERR_OK; wmops_sub_start( "ivas_dec" ); @@ -541,7 +547,134 @@ ivas_error ivas_dec( } } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + ism_brate = 0; + st = st_ivas->hCPE[0]->hCoreCoder[0]; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + st->bit_stream = &( st_ivas->bit_stream[( st_ivas->hSCE[0]->element_brate / FRAMES_PER_SEC )] ); + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + ism_brate += st_ivas->hSCE[n]->element_brate; + } + st->bit_stream = &( st_ivas->bit_stream[( ism_brate / FRAMES_PER_SEC )] ); + } + + nb_bits_metadata[0] = 0; + set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); + + /* Set the number of objects for the parametric rendering */ + if ( st_ivas->hDirAC != NULL ) + { + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; + } + else + { + st_ivas->hDirAC->numIsmDirections = 0; + } + } + + /* MASA decoding */ + if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Audio signal decoding */ + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + if ( st_ivas->nSCE == 1 ) + { + ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ); + } + else + { +#ifdef DEBUGGING + assert( ( st_ivas->nSCE <= 1 ) && "nSCE should be 1 if not in ISM_MASA_MODE_DISC." ); +#endif + } + } + else + { + /* decode ISM format */ + ivas_ism_metadata_dec( ism_brate, &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL ); + + for ( n = 0; n < st_ivas->nSCE - 1; n++ ) + { + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } + } + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + } + } + if ( st_ivas->nCPE == 1 ) + { + ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ); + } + + /* HP filtering */ + for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) + { + hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + + /* Set edited object positions, if editing enabled */ + ivas_masa_ism_set_edited_objects( st_ivas ); + + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { + ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); + } + else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) + { + ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); + } + else if ( st_ivas->hDirAC ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + mvr2r( output[2], data_separated_objects[0], output_frame ); + } + else + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + } + } + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); + } + else + { + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + } + } + } +#endif /*----------------------------------------------------------------* * Write IVAS output channels diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 5f9e908481..b689109ae7 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -300,12 +300,20 @@ ivas_error ivas_dirac_dec_config( hDirAC->panningConf = DIRAC_PANNING_HOA3; nchan_out_woLFE = 1; } +#ifdef MASA_AND_OBJECTS + else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirAC->hOutSetup.is_loudspeaker_setup ) +#else else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirAC->hOutSetup.is_loudspeaker_setup ) +#endif { hDirAC->synthesisConf = DIRAC_SYNTHESIS_PSD_LS; hDirAC->panningConf = DIRAC_PANNING_VBAP; } +#ifdef MASA_AND_OBJECTS + else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && !hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->nchan_transport > 1 ) +#else else if ( st_ivas->ivas_format == MASA_FORMAT && !hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->nchan_transport > 1 ) +#endif { hDirAC->synthesisConf = DIRAC_SYNTHESIS_PSD_SHD; hDirAC->panningConf = DIRAC_PANNING_HOA3; @@ -342,6 +350,10 @@ ivas_error ivas_dirac_dec_config( hDirAC->masa_stereo_type_detect = NULL; } +#ifdef MASA_AND_OBJECTS + hDirAC->numIsmDirections = 0; /* By default, no ism directions, set correct number runtime when needed */ +#endif + /*-----------------------------------------------------------------* * (re)configure sub-modules *-----------------------------------------------------------------*/ @@ -789,12 +801,18 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_OPEN ) { + hDirAC->dirac_md_buffer_length = 0; hDirAC->dirac_bs_md_write_idx = 0; hDirAC->dirac_read_idx = 0; hDirAC->spar_to_dirac_write_idx = 0; + +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) +#else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) +#endif { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; } @@ -836,6 +854,7 @@ ivas_error ivas_dirac_dec_config( hDirAC->diffuseness_vector[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->diffuseness_vector[i], 1.0f, hDirAC->num_freq_bands ); + hDirAC->energy_ratio1[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); hDirAC->spreadCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); @@ -843,8 +862,11 @@ ivas_error ivas_dirac_dec_config( hDirAC->surroundingCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); } - +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) +#else if ( st_ivas->ivas_format == MASA_FORMAT ) +#endif { hDirAC->azimuth2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); hDirAC->elevation2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); @@ -1563,7 +1585,12 @@ void ivas_qmetadata_to_dirac( int16_t qBand_idx; q_direction = &( hQMetaData->q_direction[0] ); +#ifdef MASA_AND_OBJECTS + hDirAC->numParametricDirections = hQMetaData->no_directions; + hDirAC->numSimultaneousDirections = hDirAC->numParametricDirections + hDirAC->numIsmDirections; +#else hDirAC->numSimultaneousDirections = hQMetaData->no_directions; +#endif if ( hMasa != NULL && ivas_total_brate > IVAS_SID_5k2 ) { @@ -1873,6 +1900,10 @@ void ivas_dirac_dec( float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef MASA_AND_OBJECTS + float Cldfb_RealBuffer_Temp[2][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ + float Cldfb_ImagBuffer_Temp[2][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ +#endif int16_t index, num_freq_bands; DIRAC_DEC_STACK_MEM DirAC_mem; @@ -2016,6 +2047,9 @@ void ivas_dirac_dec( ivas_dirac_dec_compute_directional_responses( hDirAC, st_ivas->hVBAPdata, st_ivas->hMasa, +#ifdef MASA_AND_OBJECTS + st_ivas->hMasaIsmData, +#endif subframe_idx, subframe_idx, surCohRatio, @@ -2027,6 +2061,9 @@ void ivas_dirac_dec( ivas_dirac_dec_compute_directional_responses( hDirAC, st_ivas->hVBAPdata, st_ivas->hMasa, +#ifdef MASA_AND_OBJECTS + st_ivas->hMasaIsmData, +#endif subframe_idx, subframe_idx, surCohRatio, @@ -2035,6 +2072,36 @@ void ivas_dirac_dec( } } +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) + { + for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots; slot_idx++ ) + { + index_slot = subframe_idx * hDirAC->subframe_nbslots + slot_idx; + + /* CLDFB Analysis*/ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + cldfbAnalysis_ts( &( output_f[sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), + Cldfb_RealBuffer_Temp[ch][index_slot], + Cldfb_ImagBuffer_Temp[ch][index_slot], + hDirAC->num_freq_bands, + st_ivas->cldfbAnaDec[ch] ); + } + } + + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + preProcessStereoTransportsForMovedObjects( st_ivas, + Cldfb_RealBuffer_Temp, + Cldfb_ImagBuffer_Temp, + hDirAC->num_freq_bands, + subframe_idx, + 1 ); + } + } +#endif + for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots; slot_idx++ ) { index_slot = subframe_idx * hDirAC->subframe_nbslots + slot_idx; @@ -2047,6 +2114,16 @@ void ivas_dirac_dec( mvr2r( pppQMfFrame_ts_im[ch][slot_idx], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands ); } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 ) + { + for ( ch = 0; ch < nchan_transport; ch++ ) + { + mvr2r( Cldfb_RealBuffer_Temp[ch][index_slot], Cldfb_RealBuffer[ch][0], hDirAC->num_freq_bands ); + mvr2r( Cldfb_ImagBuffer_Temp[ch][index_slot], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands ); + } + } +#endif else { /* CLDFB Analysis*/ @@ -2649,19 +2726,35 @@ static void initDiffuseResponses( set_zero( &diffuse_response_function[num_horizontal_speakers], NUM_ELEVATED_SPEAKERS ); *num_ele_spk_no_diffuse_rendering = NUM_ELEVATED_SPEAKERS; } +#ifdef MASA_AND_OBJECTS + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) +#else else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) +#endif { mvr2r( diffuse_response_CICP6, diffuse_response_function, num_channels ); } +#ifdef MASA_AND_OBJECTS + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_2 ) && ( num_channels == 7 ) ) +#else else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) +#endif { mvr2r( diffuse_response_CICP14, diffuse_response_function, num_channels ); } +#ifdef MASA_AND_OBJECTS + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) +#else else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) +#endif { mvr2r( diffuse_response_CICP16, diffuse_response_function, num_channels ); } +#ifdef MASA_AND_OBJECTS + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) +#else else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) +#endif { if ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) { diff --git a/lib_dec/ivas_dirac_dec_binaural_functions.c b/lib_dec/ivas_dirac_dec_binaural_functions.c index ee02a1bfe1..fc60732864 100644 --- a/lib_dec/ivas_dirac_dec_binaural_functions.c +++ b/lib_dec/ivas_dirac_dec_binaural_functions.c @@ -52,6 +52,9 @@ #define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) +#ifdef MASA_AND_OBJECTS +#define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f ) +#endif /*------------------------------------------------------------------------- * Local function prototypes @@ -121,7 +124,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { +#ifdef MASA_AND_OBJECTS + for ( k = 0; k < BINAURAL_CHANNELS + MAX_NUM_OBJECTS; k++ ) +#else for ( k = 0; k < BINAURAL_CHANNELS + 1; k++ ) +#endif { set_zero( hBinaural->processMtxRe[j][k], nBins ); set_zero( hBinaural->processMtxIm[j][k], nBins ); @@ -366,8 +373,13 @@ static void ivas_dirac_dec_binaural_internal( { DIRAC_DEC_HANDLE hDirAC; uint8_t slot, ch, nBins, numInChannels; +#ifdef MASA_AND_OBJECTS + float Cldfb_RealBuffer_in[6][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_in[6][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer_in[4][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_in[4][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#endif float Rmat[3][3]; uint8_t firstSlot, slotEnd; int16_t max_band_decorr; @@ -381,10 +393,24 @@ static void ivas_dirac_dec_binaural_internal( /* The input channel number at this processing function (not nchan_transport) */ numInChannels = BINAURAL_CHANNELS; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) + { + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + numInChannels += (uint8_t) st_ivas->nchan_ism; + } + else + { + numInChannels++; + } + } +#else if ( st_ivas->hOutSetup.separateChannelEnabled ) { numInChannels++; } +#endif Rmat[0][0] = 1.0f; Rmat[0][1] = 0.0f; @@ -502,6 +528,18 @@ static void ivas_dirac_dec_binaural_internal( ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, firstSubframe, nSubframes ); } +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + preProcessStereoTransportsForMovedObjects( st_ivas, + Cldfb_RealBuffer_in, + Cldfb_ImagBuffer_in, + nBins, + firstSubframe, + nSubframes ); + } +#endif + if ( st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) { QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[firstSubframe], Rmat ); @@ -717,7 +755,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Determine target covariance matrix containing target binaural properties */ for ( bin = 0; bin < nBins; bin++ ) { - float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ + float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ +#ifdef MASA_AND_OBJECTS + float diffusenessValForDecorrelationReduction = 1.0f; + float diffEneValForDecorrelationReduction; +#endif float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ float diffEne, dirEne, meanEnePerCh; uint16_t dirIndex; @@ -736,7 +778,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float lRealp, lImagp, rRealp, rImagp; float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; - +#ifdef MASA_AND_OBJECTS + uint8_t isIsmDirection = 0; +#endif if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ { aziDeg = hDirAC->azimuth[dirac_read_idx][bin]; @@ -744,15 +788,55 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format != MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_ISM_FORMAT && dirIndex < hDirAC->numParametricDirections ) ) /* For second of the two simultaneous directions */ +#else else /* For second of the two simultaneous directions */ +#endif { aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; ratio = hDirAC->energy_ratio2[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; } +#ifdef MASA_AND_OBJECTS + else /* For object directions of MASA_ISM_FORMAT */ + { + isIsmDirection = 1; + uint16_t ismDirIndex; + ismDirIndex = dirIndex - hDirAC->numParametricDirections; + if ( st_ivas->hMasaIsmData->ism_is_edited[ismDirIndex] ) + { + aziDeg = st_ivas->hMasaIsmData->azimuth_ism_edited[ismDirIndex]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism_edited[ismDirIndex]; + } + else + { + aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex]; + } + ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; + spreadCoh = 0.0f; + } +#endif diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ +#ifdef MASA_AND_OBJECTS + if ( diffuseness < 0.0f ) + { + diffuseness = 0.0f; + } + if ( isIsmDirection ) + { + /* Objects cause lesser decorrelation reduction, to avoid removing all decorrelation when only objects are present */ + diffusenessValForDecorrelationReduction -= ratio * 0.5f; + } + else + { + diffusenessValForDecorrelationReduction -= ratio; + } +#endif + if ( separateCenterChannelRendering ) { /* In masa + mono rendering mode, the center directions originate from phantom sources, so the @@ -886,13 +970,31 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Add diffuse / ambient part covariance matrix */ diffuseness = max( 0.0f, diffuseness ); diffEne = diffuseness * meanEnePerCh; + surCoh = hDirAC->surroundingCoherence[dirac_read_idx][bin]; + +#ifdef MASA_AND_OBJECTS + diffusenessValForDecorrelationReduction = max( 0.0f, diffusenessValForDecorrelationReduction ); + diffEneValForDecorrelationReduction = diffusenessValForDecorrelationReduction * meanEnePerCh; +#endif + if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { if ( !h->renderStereoOutputInsteadOfBinaural ) { /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ +#ifdef MASA_AND_OBJECTS + float spectrumModVal; + /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ + spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 )]; + diffEne *= spectrumModVal; +#else diffEne *= ( 1.0f - surCoh ) + surCoh * surCohEne[min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 )]; +#endif +#ifdef MASA_AND_OBJECTS + /* Modify also the value for decorrelation reduction */ + diffEneValForDecorrelationReduction *= spectrumModVal; +#endif } } h->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ @@ -918,7 +1020,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } /* Store parameters for formulating average diffuseness over frame */ +#ifdef MASA_AND_OBJECTS + h->frameMeanDiffuseness[bin] += diffEneValForDecorrelationReduction; +#else h->frameMeanDiffuseness[bin] += diffEne; +#endif frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } @@ -1004,10 +1110,27 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { uint8_t chA, chB, bin; uint8_t separateCenterChannelRendering; +#ifdef MASA_AND_OBJECTS + uint8_t nchanSeparateChannels; +#endif int16_t nBins; DIRAC_DEC_BIN_HANDLE h; h = st_ivas->hDiracDecBin; +#ifdef MASA_AND_OBJECTS + separateCenterChannelRendering = 0; + nchanSeparateChannels = 0; + if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) + { + separateCenterChannelRendering = 1; + nchanSeparateChannels = 1; + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; + } + } +#else separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; +#endif nBins = st_ivas->hDirAC->num_freq_bands; /* Actually bins */ for ( bin = 0; bin < nBins; bin++ ) @@ -1144,6 +1267,50 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( float gainFactor; int16_t aziDeg = 0; int16_t eleDeg = 0; +#ifdef MASA_AND_OBJECTS + uint8_t instantChange = 0; + + gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); + for ( chB = 0; chB < nchanSeparateChannels; chB++ ) + { + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism[chB]; + } + else + { + aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism; + eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; + instantChange = 1; + } + } + + for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) + { + h->processMtxRePrev[chA][chB + 2][bin] = h->processMtxRe[chA][chB + 2][bin]; + h->processMtxImPrev[chA][chB + 2][bin] = h->processMtxIm[chA][chB + 2][bin]; + } + + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat ); + + h->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; + h->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; + h->processMtxRe[1][chB + 2][bin] = rRealp * gainFactor; + h->processMtxIm[1][chB + 2][bin] = rImagp * gainFactor; + + if ( instantChange ) + { + for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) + { + h->processMtxRePrev[chA][chB + 2][bin] = h->processMtxRe[chA][chB + 2][bin]; + h->processMtxImPrev[chA][chB + 2][bin] = h->processMtxIm[chA][chB + 2][bin]; + } + } + } +#else gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) @@ -1158,6 +1325,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( h->processMtxIm[0][2][bin] = lImagp * gainFactor; h->processMtxRe[1][2][bin] = rRealp * gainFactor; h->processMtxIm[1][2][bin] = rImagp * gainFactor; +#endif } } @@ -1814,3 +1982,219 @@ static void hrtfShGetHrtf( return; } + +#ifdef MASA_AND_OBJECTS +void preProcessStereoTransportsForMovedObjects( + Decoder_Struct *st_ivas, + float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + uint8_t nBins, + uint8_t firstSubframe, + uint8_t nSubframes ) +{ + int16_t subframe, bin, ch, inCh, outCh, ismDirIndex, slot; + DIRAC_DEC_HANDLE hDirAC; + MASA_ISM_DATA_HANDLE hMasaIsmData; + uint8_t enableCentering; + + hDirAC = st_ivas->hDirAC; + hMasaIsmData = st_ivas->hMasaIsmData; + + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) + { + enableCentering = 0; + } + else + { + enableCentering = 1; + } + + /* Bypass processing until first object is moved */ + if ( hMasaIsmData->objectsMoved == 0 ) + { + for ( ismDirIndex = 0; ismDirIndex < hDirAC->numIsmDirections; ismDirIndex++ ) + { + if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) + { + hMasaIsmData->objectsMoved = 1; + } + } + if ( hMasaIsmData->objectsMoved == 0 ) + { + /* No objects have moved so far */ + return; + } + } + + /* Perform object-movement based processing */ + for ( subframe = firstSubframe; subframe < ( firstSubframe + nSubframes ); subframe++ ) + { + for ( bin = 0; bin < nBins; bin++ ) + { + float ismPreprocMtxNew[2][2]; + float ismPreprocMtxIncrement[2][2]; + float eneMove[2]; + float enePreserve[2]; + float ismRatioAcc; + float subframeEne; + float normEnes[2]; + float remainderNormEne; + + set_zero( ismPreprocMtxNew[0], 2 ); + set_zero( ismPreprocMtxNew[1], 2 ); + set_zero( ismPreprocMtxIncrement[0], 2 ); + set_zero( ismPreprocMtxIncrement[1], 2 ); + set_zero( eneMove, 2 ); + set_zero( enePreserve, 2 ); + ismRatioAcc = 0.0f; + subframeEne = 0.0f; + set_zero( normEnes, 2 ); + + /* Determine transport normalized energies and subframe energy */ + for ( slot = subframe * hDirAC->subframe_nbslots; slot < (int16_t) ( ( subframe + 1 ) * hDirAC->subframe_nbslots ); slot++ ) + { + for ( ch = 0; ch < 2; ch++ ) + { + normEnes[ch] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; + normEnes[ch] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; + } + } + subframeEne = normEnes[0] + normEnes[1]; + normEnes[0] /= fmaxf( 1e-12f, subframeEne ); + normEnes[1] /= fmaxf( 1e-12f, subframeEne ); + + /* For each ismDir, formulate a mix-matrix that moves object audio signals between + * left and right channels when needed. Make a combined matrix by a ratio-weighted sum */ + for ( ismDirIndex = 0; ismDirIndex < hDirAC->numIsmDirections; ismDirIndex++ ) + { + float panGainsOut[2]; + float panGainsIn[2]; + float ratio; + float panEnesOut[2]; + float panEnesIn[2]; + float centeringFactor; + + ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; + ismRatioAcc += ratio; + + /* Get input and output panning gains */ + ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex], + hMasaIsmData->elevation_ism[ismDirIndex], + panGainsIn ); + if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) + { + ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism_edited[ismDirIndex], + hMasaIsmData->elevation_ism_edited[ismDirIndex], + panGainsOut ); + } + else + { + /* When not edited, input and output pan gains are the same */ + for ( ch = 0; ch < 2; ch++ ) + { + panGainsOut[ch] = panGainsIn[ch]; + } + } + + /* Determine pan enes */ + for ( ch = 0; ch < 2; ch++ ) + { + panEnesOut[ch] = panGainsOut[ch] * panGainsOut[ch]; + panEnesIn[ch] = panGainsIn[ch] * panGainsIn[ch]; + } + + if ( enableCentering ) + { + centeringFactor = fmaxf( 0.0f, 2.0f * fabsf( panEnesIn[0] - panEnesOut[0] ) - 1.0f ); + for ( ch = 0; ch < 2; ch++ ) + { + panEnesOut[ch] *= ( 1.0f - centeringFactor ); + panEnesOut[ch] += 0.5f * centeringFactor; + } + } + + for ( ch = 0; ch < 2; ch++ ) + { + float eneMoveThis; + float enePreserveThis; + eneMoveThis = fmaxf( 0.0f, panEnesIn[ch] - panEnesOut[ch] ); + enePreserveThis = panEnesIn[ch] - eneMoveThis; + + eneMove[ch] += ratio * eneMoveThis; + enePreserve[ch] += ratio * enePreserveThis; + + /* Subtract object parts from normEnes */ + normEnes[ch] -= panEnesIn[ch] * ratio; + } + } + /* Any remaining (non-object) energy is set to be preserved at both channels */ + remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); + for ( ch = 0; ch < 2; ch++ ) + { + enePreserve[ch] += fmaxf( 0.0f, normEnes[ch] + remainderNormEne / 2.0f ); + } + + /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix */ + for ( ch = 0; ch < 2; ch++ ) + { + float normVal; + hMasaIsmData->eneMoveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->eneMoveIIR[ch][bin] += eneMove[ch] * subframeEne; + hMasaIsmData->enePreserveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->enePreserveIIR[ch][bin] += enePreserve[ch] * subframeEne; + normVal = fmaxf( EPSILON, hMasaIsmData->eneMoveIIR[ch][bin] + hMasaIsmData->enePreserveIIR[ch][bin] ); + ismPreprocMtxNew[ch][ch] = sqrtf( hMasaIsmData->enePreserveIIR[ch][bin] / normVal ); + ismPreprocMtxNew[1 - ch][ch] = sqrtf( hMasaIsmData->eneMoveIIR[ch][bin] / normVal ); + } + + + /* Get increment value for temporal interpolation */ + for ( inCh = 0; inCh < 2; inCh++ ) + { + for ( outCh = 0; outCh < 2; outCh++ ) + { + ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] ) / (float) hDirAC->subframe_nbslots; + } + } + + /* Mix signals */ + for ( slot = subframe * hDirAC->subframe_nbslots; slot < (int16_t) ( ( subframe + 1 ) * hDirAC->subframe_nbslots ); slot++ ) + { + float eqVal; + float outSlotRe[2]; + float outSlotIm[2]; + + set_zero( outSlotRe, 2 ); + set_zero( outSlotIm, 2 ); + + for ( outCh = 0; outCh < 2; outCh++ ) + { + for ( inCh = 0; inCh < 2; inCh++ ) + { + hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] += ismPreprocMtxIncrement[outCh][inCh]; + outSlotRe[outCh] += inRe[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; + outSlotIm[outCh] += inIm[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; + } + } + + /* IIR average the energy measures and determine and apply energy-preserving equalizer */ + hMasaIsmData->preprocEneTarget[bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->preprocEneRealized[bin] *= STEREO_PREPROCESS_IIR_FACTOR; + for ( ch = 0; ch < 2; ch++ ) + { + hMasaIsmData->preprocEneTarget[bin] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; + hMasaIsmData->preprocEneTarget[bin] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; + hMasaIsmData->preprocEneRealized[bin] += outSlotRe[ch] * outSlotRe[ch]; + hMasaIsmData->preprocEneRealized[bin] += outSlotIm[ch] * outSlotIm[ch]; + } + eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[bin] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[bin] ) ) ); + for ( ch = 0; ch < 2; ch++ ) + { + inRe[ch][slot][bin] = outSlotRe[ch] * eqVal; + inIm[ch][slot][bin] = outSlotIm[ch] * eqVal; + } + } + } + } +} +#endif diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 79c04f824b..91d6435c78 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -499,6 +499,9 @@ void ivas_dirac_dec_output_synthesis_process_slot( ivas_dirac_dec_compute_directional_responses( hDirAC, hVBAPdata, NULL, +#ifdef MASA_AND_OBJECTS + NULL, +#endif index_slot, index_slot / MAX_PARAM_SPATIAL_SUBFRAMES, NULL, 2, @@ -1427,8 +1430,11 @@ void ivas_dirac_dec_compute_directional_responses( DIRAC_DEC_HANDLE hDirAC, /* i/o: DirAC handle */ const VBAP_HANDLE hVBAPdata, /* i : VBAP structure */ const MASA_DECODER_HANDLE hMasa, /* i : MASA decoder structure */ - const int16_t direction_idx, /* i : index for direction (azi and ele), can slot index (>2TCs) or subrame index (<=2TCs) */ - const int16_t subframe_idx, /* i : subframe index */ +#ifdef MASA_AND_OBJECTS + MASA_ISM_DATA_HANDLE hMasaIsm, /* i : MASA_ISM data structure */ +#endif + const int16_t direction_idx, /* i : index for direction (azi and ele), can slot index (>2TCs) or subrame index (<=2TCs) */ + const int16_t subframe_idx, /* i : subframe index */ const float *surCohRatio, const int16_t shd_rot_max_order, /* i : split-order rotation method */ const float *p_Rmat /* i : rotation matrix */ @@ -1463,7 +1469,11 @@ void ivas_dirac_dec_compute_directional_responses( num_channels_dir = hDirAC->num_outputs_dir; azimuth = hDirAC->azimuth[hDirAC->dirac_read_idx]; elevation = hDirAC->elevation[hDirAC->dirac_read_idx]; +#ifdef MASA_AND_OBJECTS + if ( hDirAC->numParametricDirections == 2 ) +#else if ( hDirAC->numSimultaneousDirections == 2 ) +#endif { azimuth2 = hDirAC->azimuth2[direction_idx]; elevation2 = hDirAC->elevation2[direction_idx]; @@ -1521,7 +1531,11 @@ void ivas_dirac_dec_compute_directional_responses( spreadCoherencePanningHoa( azimuth[k], elevation[k], hDirAC->spreadCoherence[subframe_idx][k], direct_response_hoa, num_channels_dir, hDirAC->hOutSetup.ambisonics_order ); /* Synthesize the second direction and combine the gains */ +#ifdef MASA_AND_OBJECTS + if ( hDirAC->numParametricDirections == 2 ) +#else if ( hDirAC->numSimultaneousDirections == 2 ) +#endif { spreadCoherencePanningHoa( azimuth2[k], elevation2[k], hDirAC->spreadCoherence2[subframe_idx][k], direct_response_dir2, num_channels_dir, hDirAC->hOutSetup.ambisonics_order ); @@ -1536,6 +1550,56 @@ void ivas_dirac_dec_compute_directional_responses( } } +#ifdef MASA_AND_OBJECTS + if ( hDirAC->numIsmDirections > 0 ) + { + int16_t dir; + float direct_response_temp[MAX_OUTPUT_CHANNELS]; + float direct_response_ism[MAX_OUTPUT_CHANNELS]; + float masaDirect; + float ismDirect; + + set_zero( direct_response_ism, num_channels_dir ); + + for ( dir = 0; dir < hDirAC->numIsmDirections; dir++ ) + { + if ( hMasaIsm->ism_is_edited[dir] ) + { + ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); + } + else + { + ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); + } + + for ( l = 0; l < num_channels_dir; l++ ) + { + direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; + } + } + + masaDirect = hDirAC->energy_ratio1[subframe_idx][k] + EPSILON; + if ( hDirAC->numParametricDirections == 2 ) + { + masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; + } + ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; + for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) + { + ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; + } + + totalDirect = masaDirect + ismDirect; + directRatio[0] = masaDirect / totalDirect; + directRatio[1] = ismDirect / totalDirect; + for ( l = 0; l < num_channels_dir; l++ ) + { + direct_response_hoa[l] *= directRatio[0]; + direct_response_hoa[l] += directRatio[1] * direct_response_ism[l]; + } + } +#endif + /* Synthesize surrounding coherence */ if ( surCohRatio != NULL && surCohRatio[k] > 0.f ) { @@ -1580,7 +1644,12 @@ void ivas_dirac_dec_compute_directional_responses( normalizePanningGains( direct_response_ls, num_channels_dir ); /* Synthesize the second direction and combine the gains */ +#ifdef MASA_AND_OBJECTS + if ( hDirAC->numParametricDirections == 2 ) +#else if ( hDirAC->numSimultaneousDirections == 2 ) +#endif + { spreadCoherencePanningVbap( azimuth2[k], elevation2[k], hDirAC->spreadCoherence2[subframe_idx][k], direct_response_dir2, num_channels_dir, hVBAPdata ); @@ -1597,7 +1666,57 @@ void ivas_dirac_dec_compute_directional_responses( } normalizePanningGains( direct_response_ls, num_channels_dir ); } +#ifdef MASA_AND_OBJECTS + if ( hDirAC->numIsmDirections > 0 ) + { + int16_t dir; + float direct_response_temp[MAX_OUTPUT_CHANNELS]; + float direct_response_ism[MAX_OUTPUT_CHANNELS]; + float masaDirect; + float ismDirect; + set_zero( direct_response_ism, num_channels_dir ); + + for ( dir = 0; dir < hDirAC->numIsmDirections; dir++ ) + { + if ( hMasaIsm->ism_is_edited[dir] ) + { + vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir] ); + } + else + { + vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir] ); + } + + for ( l = 0; l < num_channels_dir; l++ ) + { + direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; + } + } + normalizePanningGains( direct_response_ism, num_channels_dir ); + + masaDirect = hDirAC->energy_ratio1[subframe_idx][k] + EPSILON; + if ( hDirAC->numParametricDirections == 2 ) + { + masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; + } + ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; + for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) + { + ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; + } + + totalDirect = masaDirect + ismDirect; + directRatio[0] = masaDirect / totalDirect; + directRatio[1] = ismDirect / totalDirect; + for ( l = 0; l < num_channels_dir; l++ ) + { + direct_response_ls[l] *= directRatio[0]; + direct_response_ls[l] += directRatio[1] * direct_response_ism[l]; + } + normalizePanningGains( direct_response_ls, num_channels_dir ); + } +#endif /* Synthesize surrounding coherence */ if ( surCohRatio != NULL && surCohRatio[k] > 0.f ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e51b46779c..7da5528fb0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -69,6 +69,9 @@ ivas_error ivas_dec_setup( Decoder_State *st; int32_t ivas_total_brate; ivas_error error; +#ifdef MASA_AND_OBJECTS + int32_t cpe_brate; +#endif error = IVAS_ERR_OK; num_bits_read = 0; @@ -183,6 +186,33 @@ ivas_error ivas_dec_setup( } } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + st_ivas->nchan_transport = 2; + /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata*/ + st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 3] + 1; + + st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); + + if ( st_ivas->ini_frame > 0 ) + { + /* reconfigure in case a change of operation mode is detected */ + if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) + { + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) && st_ivas->nCPE == 1 ) + { + st_ivas->hCPE[0]->nchan_out = 1; + } + else if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + } +#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { /* read MC configuration */ @@ -350,15 +380,24 @@ static ivas_error ivas_read_format( case 3: if ( st_ivas->bit_stream[*num_bits_read] ) { + ( *num_bits_read )++; st_ivas->ivas_format = MASA_FORMAT; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->bit_stream[*num_bits_read] ) + { + st_ivas->ivas_format = MASA_ISM_FORMAT; + } + ( *num_bits_read )++; +#endif } else { + ( *num_bits_read )++; st_ivas->ivas_format = SBA_FORMAT; st_ivas->sba_mode = ivas_sba_mode_select( ivas_total_brate ); } - ( *num_bits_read )++; + break; } } @@ -615,7 +654,9 @@ ivas_error ivas_init_decoder( AUDIO_CONFIG output_config; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t sce_brate; +#endif error = IVAS_ERR_OK; output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -931,6 +972,77 @@ ivas_error ivas_init_decoder( } } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); + + k = 0; + sce_brate = 0; + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) + { + k++; + } + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + /* one separated object */ + st_ivas->nSCE = 1; + + sce_brate = sep_object_brate[k - 2][0]; + create_sce_dec( st_ivas, 0, sce_brate ); + + reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + int32_t temp_brate[MAX_SCE]; + st_ivas->nSCE = st_ivas->nchan_ism; /* number of objects */ + + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + + temp_brate[sce_id] = sep_object_brate[k - 2][st_ivas->nSCE - 1]; + sce_brate += temp_brate[sce_id]; + + if ( ( error = create_sce_dec( st_ivas, sce_id, temp_brate[sce_id] ) ) != IVAS_ERR_OK ) + { + return error; + } + reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); + } + + + if ( ( error = create_ism_metadata_dec( st_ivas, st_ivas->nSCE, temp_brate ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + ivas_masa_dec_open( st_ivas ); + ivas_masa_ism_data_open( st_ivas ); + + if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + { + ivas_dirac_dec_open( st_ivas ); + } + + st_ivas->nCPE = 1; + create_cpe_dec( st_ivas, 0, ( ( ivas_total_brate - sce_brate ) / st_ivas->nchan_transport ) * CPE_CHANNELS ); + + for ( n = 0; n < CPE_CHANNELS; n++ ) + { + reset_indices_dec( st_ivas->hCPE[0]->hCoreCoder[n] ); + } + + if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } +#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { if ( st_ivas->mc_mode == MC_MODE_MCT ) @@ -1492,6 +1604,9 @@ void ivas_initialize_handles_dec( st_ivas->hCrend = NULL; st_ivas->hHrtf = NULL; st_ivas->hoa_dec_mtx = NULL; +#ifdef MASA_AND_OBJECTS + st_ivas->hMasaIsmData = NULL; +#endif st_ivas->hHeadTrackData = NULL; st_ivas->hHrtfTD = NULL; @@ -1670,7 +1785,23 @@ void ivas_destroy_dec( count_free( st_ivas->hMonoDmxRenderer ); st_ivas->hMonoDmxRenderer = NULL; } - +#ifdef MASA_AND_OBJECTS + /* MASA ISM structure */ + if ( st_ivas->hMasaIsmData != NULL ) + { + if ( st_ivas->hMasaIsmData->delayBuffer != NULL ) + { + for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) + { + count_free( st_ivas->hMasaIsmData->delayBuffer[i] ); + } + count_free( st_ivas->hMasaIsmData->delayBuffer ); + st_ivas->hMasaIsmData->delayBuffer = NULL; + } + count_free( st_ivas->hMasaIsmData ); + st_ivas->hMasaIsmData = NULL; + } +#endif /* Head track data handle */ if ( st_ivas->hHeadTrackData != NULL ) { @@ -1736,6 +1867,43 @@ void ivas_init_dec_get_num_cldfb_instances( case RENDERER_BINAURAL_PARAMETRIC: case RENDERER_BINAURAL_PARAMETRIC_ROOM: case RENDERER_STEREO_PARAMETRIC: +#ifdef MASA_AND_OBJECTS + if ( st_ivas->nchan_transport == 1 ) + { + *numCldfbAnalyses = st_ivas->nchan_transport + 1; + } + + if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hOutSetup.separateChannelEnabled ) + { + *numCldfbAnalyses = st_ivas->nchan_transport + 1; + } + + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + *numCldfbAnalyses += st_ivas->nchan_ism; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + *numCldfbAnalyses = st_ivas->nchan_transport + 1; + } + } + + if ( st_ivas->hDiracDecBin->useTdDecorr ) + { + *numCldfbAnalyses += 2; + } + break; + case RENDERER_MONO_DOWNMIX: + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + /* CLDFB not used in rendering */ + *numCldfbAnalyses = 0; + *numCldfbSyntheses = 0; + } + break; +#else if ( st_ivas->nchan_transport == 1 ) { *numCldfbAnalyses = st_ivas->nchan_transport + 1; @@ -1759,6 +1927,7 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = 0; } break; +#endif case RENDERER_DIRAC: if ( st_ivas->sba_mode == SBA_MODE_SPAR ) { diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 6b9f8ec8ba..f2c67c7301 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -126,13 +126,25 @@ ivas_error ivas_ism_metadata_dec( *----------------------------------------------------------------*/ /* read number of objects */ - num_obj = 1; - while ( get_next_indice( st0, 1 ) == 1 && num_obj < MAX_NUM_OBJECTS ) +#ifdef MASA_AND_OBJECTS + if ( ism_mode != ISM_MASA_MODE_DISC ) { - ( num_obj )++; +#endif + num_obj = 1; + while ( get_next_indice( st0, 1 ) == 1 && num_obj < MAX_NUM_OBJECTS ) + { + ( num_obj )++; + } + ism_mode = ivas_ism_mode_select( num_obj, ism_total_brate ); +#ifdef MASA_AND_OBJECTS } + else + { + num_obj = *nchan_transport; + } + +#endif - ism_mode = ivas_ism_mode_select( num_obj, ism_total_brate ); if ( ism_mode == ISM_MODE_PARAM ) { @@ -202,7 +214,11 @@ ivas_error ivas_ism_metadata_dec( for ( ch = 0; ch < num_obj; ch++ ) { hIsmMetaData = hIsmMeta[ch]; +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { nb_bits_start = st0->next_bit_pos; } @@ -362,7 +378,11 @@ ivas_error ivas_ism_metadata_dec( } /* save number of metadata bits read */ +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { nb_bits_metadata[ch] = st0->next_bit_pos - nb_bits_start; } @@ -455,13 +475,29 @@ ivas_error ivas_ism_metadata_dec( if ( !bfi ) { - ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ); +#ifdef MASA_AND_OBJECTS + int16_t masa_ism_flag = 0; + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) + { + masa_ism_flag = 1; + } +#endif + + ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata +#ifdef MASA_AND_OBJECTS + , + masa_ism_flag +#endif + ); for ( ch = 0; ch < *nchan_transport; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; - +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) @@ -534,7 +570,12 @@ ivas_error create_ism_metadata_dec( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } - ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); + ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL +#ifdef MASA_AND_OBJECTS + , + 0 +#endif + ); return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 8ebf27afb5..61d8f9ebf0 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1022,7 +1022,11 @@ static ivas_error ivas_ism_bitrate_switching( error = IVAS_ERR_OK; +#ifdef MASA_AND_OBJECTS + ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, num_obj, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ); +#else ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, num_obj, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); +#endif st_ivas->nSCE = st_ivas->nchan_transport; ivas_corecoder_dec_reconfig( st_ivas, nchan_transport_old, 0, nchan_transport_old, 0 ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index f27d49b111..b7ec828d2f 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -222,3 +222,168 @@ void ivas_ism_render( } return; } + +#ifdef MASA_AND_OBJECTS +/*-------------------------------------------------------------------------* + * ivas_masa_ism_separate_object_renderer_open() + * + * Open structures, reserve memory, and init values. + *-------------------------------------------------------------------------*/ + +ivas_error ivas_masa_ism_separate_object_renderer_open( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t interpolator_length; + int16_t i; + + if ( ( st_ivas->hIsmRendererData = (ISM_RENDERER_HANDLE) count_malloc( sizeof( ISM_RENDERER_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer \n" ) ); + } + + + for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) + { + set_f( st_ivas->hIsmRendererData->prev_gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); + } + + interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / 50 ); + for ( i = 0; i < interpolator_length; i++ ) + { + st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length ); + } + + st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + st_ivas->hMasaIsmData->delayBuffer_nchan = 1; + } + else + { + st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; + } + + if ( ( st_ivas->hMasaIsmData->delayBuffer = (float **) count_malloc( st_ivas->hMasaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); + } + for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) + { + if ( ( st_ivas->hMasaIsmData->delayBuffer[i] = (float *) count_malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); + } + set_zero( st_ivas->hMasaIsmData->delayBuffer[i], st_ivas->hMasaIsmData->delayBuffer_size ); + } + + return IVAS_ERR_OK; +} + + +/*-------------------------------------------------------------------------* + * ivas_masa_ism_separate_object_render() + * + * Rendering separated objects and mixing them to the parametrically rendered signals + *-------------------------------------------------------------------------*/ + +void ivas_masa_ism_separate_object_render( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float input_f[][L_FRAME48k], /* i : separated object signal */ + float output_f[][L_FRAME48k], /* i/o: output signals */ + const int16_t output_frame /* i : output frame length per channel */ +) +{ + VBAP_HANDLE hVBAPdata; + AUDIO_CONFIG output_config; + int16_t nchan_out_woLFE; + ISM_RENDERER_HANDLE hRendererData; + int16_t j, k, j2; + int16_t obj; + float gains[MAX_OUTPUT_CHANNELS]; + float g1, g2; + int16_t lfe_index; + int16_t azimuth, elevation; + int16_t num_objects; + uint8_t single_separated; + + hVBAPdata = st_ivas->hVBAPdata; + output_config = st_ivas->hDecoderConfig->output_config; + nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; + hRendererData = st_ivas->hIsmRendererData; + lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + single_separated = 1; + num_objects = 1; + } + else + { + single_separated = 0; + num_objects = st_ivas->nchan_ism; + } + + for ( obj = 0; obj < num_objects; obj++ ) + { + delay_signal( input_f[obj], output_frame, st_ivas->hMasaIsmData->delayBuffer[obj], st_ivas->hMasaIsmData->delayBuffer_size ); /* Delay the signal to match CLDFB delay */ + + if ( single_separated ) + { + azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; + elevation = st_ivas->hMasaIsmData->elevation_separated_ism; + } + else + { + azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; + elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; + } + + if ( output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_5_1_4 ) + { + /* If no elevation support in output format, then rendering should be done with zero elevation */ + elevation = 0; + } + else if ( output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_4 ) + { + /* For no negative elevations, it's better to map them to zero */ + elevation = elevation < 0 ? 0 : elevation; + } + + if ( hVBAPdata != NULL ) + { + vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); + } + else + { + ivas_dirac_dec_get_response( azimuth, elevation, gains, st_ivas->hDirAC->hOutSetup.ambisonics_order ); + } + + for ( j = 0; j < nchan_out_woLFE; j++ ) + { + if ( st_ivas->hDirAC->hOutSetup.num_lfe > 0 ) + { + j2 = j + ( j >= lfe_index ); + } + else + { + j2 = j; + } + + if ( fabsf( gains[j] ) > 0.0f || fabsf( hRendererData->prev_gains[obj][j] ) > 0.0f ) + { + for ( k = 0; k < output_frame; k++ ) + { + g1 = hRendererData->interpolator[k]; + g2 = 1.0f - g1; + output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; + } + } + hRendererData->prev_gains[obj][j] = gains[j]; + } + } + + return; +} +#endif diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 3df3784405..dcb70abf57 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -70,6 +70,10 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); +#ifdef MASA_AND_OBJECTS +static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos ); +static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, int16_t no_ism, int16_t K ); +#endif /*-----------------------------------------------------------------------* * ivas_masa_decode() @@ -91,13 +95,20 @@ ivas_error ivas_masa_decode( IVAS_FORMAT ivas_format; int16_t low_bitrate_mode, tmp_elem_mode; ivas_error error; +#ifdef MASA_AND_OBJECTS + int16_t obj; +#endif error = IVAS_ERR_OK; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; low_bitrate_mode = -1; /* This means that LBR mode is not used. */ +#ifdef MASA_AND_OBJECTS + if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->hOutSetup.separateChannelEnabled ) +#endif { masa_brate = st_ivas->hCPE[0]->element_brate; } @@ -131,6 +142,24 @@ ivas_error ivas_masa_decode( /* the number of MASA transport channels was read in ivas_dec_setup() */ st->next_bit_pos -= MASA_TRANSP_BITS; *nb_bits_read += MASA_TRANSP_BITS; +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) + { + /* the number of objects was read */ + st->next_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; + *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + /* read index of separated object */ + /* no_ism should be > 1*/ + byteBuffer = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read )++; + st_ivas->hMasaIsmData->idx_separated_ism = 2 * byteBuffer + st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read )++; + } + } +#endif /* Placeholder for descriptive metadata content */ byteBuffer = st->bit_stream[( st->next_bit_pos )--]; byteBuffer += st->bit_stream[( st->next_bit_pos )--]; @@ -191,8 +220,39 @@ ivas_error ivas_masa_decode( /* Remove already read bits from the bit budget */ hQMetaData->metadata_max_bits -= *nb_bits_read; + +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos ); + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) + { + if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) + { + st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->hMasaIsmData->azimuth_ism[obj]; + st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->hMasaIsmData->elevation_ism[obj]; + } + } + } + } +#endif + + *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos ); +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Modify spatial metadata based on the MASA-to-total energy ratios */ + modify_masa_energy_ratios( hQMetaData ); + } +#endif /* Get direction decoding quality. EC 1 and 2 are handled by the default value. */ if ( hQMetaData->ec_flag == 2 ) { @@ -227,7 +287,12 @@ ivas_error ivas_masa_decode( } ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, - hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); + hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE +#ifdef MASA_AND_OBJECTS + , + st_ivas->ivas_format, st_ivas->ism_mode, 0 +#endif + ); hQMetaData->metadata_max_bits = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; @@ -279,17 +344,74 @@ ivas_error ivas_masa_decode( ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, SBA_MODE_NONE, 0 ); } - st->next_bit_pos = next_bit_pos_orig; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( hQMetaData->q_direction == NULL ) + { + if ( ( error = ivas_masa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + if ( st_ivas->hDirAC != NULL ) + { + int16_t i; + int16_t b; + int16_t block; - if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) + for ( i = 0; i < st_ivas->hDirAC->numIsmDirections; i++ ) /* Todo Nokia: Probably there is a better place for this eventually */ + { + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + st_ivas->hDirAC->diffuseness_vector[block][b] -= st_ivas->hMasaIsmData->energy_ratio_ism[i][block][b]; + } + } + } + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + st_ivas->hDirAC->diffuseness_vector[block][b] = max( 0.0f, st_ivas->hDirAC->diffuseness_vector[block][b] ); + } + } + } + } +#endif + st->next_bit_pos = next_bit_pos_orig; +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT ) { - st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; + int32_t cpe_brate; + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); - if ( ivas_total_brate <= IVAS_SID_5k2 ) + if ( st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) { - st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = 0; + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = cpe_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; + + if ( ivas_total_brate <= IVAS_SID_5k2 ) + { + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = 0; + } } } + else + { +#endif + if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) + { + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; + + if ( ivas_total_brate <= IVAS_SID_5k2 ) + { + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = 0; + } + } +#ifdef MASA_AND_OBJECTS + } +#endif if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 ) { @@ -321,13 +443,30 @@ ivas_error ivas_masa_dec_open( ) { MASA_DECODER_HANDLE hMasa; - +#ifdef MASA_AND_OBJECTS + int16_t i; + int32_t sce_brate; +#endif if ( ( hMasa = (MASA_DECODER_HANDLE) count_malloc( sizeof( MASA_DECODER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) ); } - - ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); +#ifdef MASA_AND_OBJECTS + sce_brate = 0; + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + sce_brate += st_ivas->hSCE[i]->element_brate; + } + } +#endif + ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE +#ifdef MASA_AND_OBJECTS + , + st_ivas->ivas_format, st_ivas->ism_mode, sce_brate +#endif + ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); @@ -359,7 +498,46 @@ ivas_error ivas_masa_dec_open( return IVAS_ERR_OK; } +#ifdef MASA_AND_OBJECTS +/*-------------------------------------------------------------------* + * ivas_masa_ism_data_open() + * + * + *-------------------------------------------------------------------*/ + +void ivas_masa_ism_data_open( + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ +) +{ + MASA_ISM_DATA_HANDLE hMasaIsmData; + int16_t bin; + int16_t ch; + if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) count_malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) + { + fprintf( stderr, "Can not allocate memory for MASA_ISM data\n" ); + exit( -1 ); + } + + for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) + { + for ( ch = 0; ch < 2; ch++ ) + { + hMasaIsmData->ismPreprocMatrix[ch][ch][bin] = 1.0f; + hMasaIsmData->ismPreprocMatrix[1 - ch][ch][bin] = 0.0f; + hMasaIsmData->eneMoveIIR[ch][bin] = 0.0f; + hMasaIsmData->enePreserveIIR[ch][bin] = 0.0f; + } + hMasaIsmData->preprocEneTarget[bin] = 0.0f; + hMasaIsmData->preprocEneRealized[bin] = 0.0f; + } + hMasaIsmData->objectsMoved = 0; + hMasaIsmData->delayBuffer = NULL; + st_ivas->hMasaIsmData = hMasaIsmData; + + return; +} +#endif /*-----------------------------------------------------------------------* * ivas_masa_dec_close() * @@ -423,14 +601,40 @@ static ivas_error ivas_masa_dec_config( int16_t i; MASA_DECODER_HANDLE hMasa; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t ivas_total_brate; + int32_t sce_brate; +#endif error = IVAS_ERR_OK; hMasa = st_ivas->hMasa; - ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); +#ifdef MASA_AND_OBJECTS + ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; + + sce_brate = 0; + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + sce_brate += st_ivas->hSCE[i]->element_brate; + } + } + + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, sce_brate ); + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); + } + else + { + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); + } +#else + ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); +#endif st_ivas->hQMetaData->metadata_max_bits = hMasa->config.max_metadata_bits; st_ivas->hQMetaData->bandMap = hMasa->data.band_mapping; st_ivas->hQMetaData->nchan_transport = st_ivas->nchan_transport; @@ -1024,6 +1228,9 @@ ivas_error ivas_masa_dec_reconfigure( Decoder_State **sts; int32_t ivas_total_brate, last_ivas_total_brate; ivas_error error; +#ifdef MASA_AND_OBJECTS + int32_t sce_brate; +#endif error = IVAS_ERR_OK; @@ -1059,7 +1266,7 @@ ivas_error ivas_masa_dec_reconfigure( sts = st_ivas->hCPE[cpe_id]->hCoreCoder; sts[0]->bit_stream = bit_stream + num_bits; num_bits += (int16_t) ( st_ivas->hCPE[cpe_id]->element_brate / FRAMES_PER_SEC ); - + /* Todo: Nokia make for MASA_ISM*/ if ( ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate >= MASA_STEREO_MIN_BITRATE ) || ( ivas_total_brate < MASA_STEREO_MIN_BITRATE && last_ivas_total_brate == FRAME_NO_DATA ) ) { @@ -1086,8 +1293,22 @@ ivas_error ivas_masa_dec_reconfigure( } } } - - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); +#ifdef MASA_AND_OBJECTS + sce_brate = 0; + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( n = 0; n < st_ivas->nSCE; n++ ) + { + sce_brate += st_ivas->hSCE[n]->element_brate; + } + } +#endif + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp +#ifdef MASA_AND_OBJECTS + , + st_ivas->ivas_format, st_ivas->ism_mode, sce_brate +#endif + ); return error; } @@ -1357,3 +1578,407 @@ static void compute_foa_cov_matrix( return; } + +#ifdef MASA_AND_OBJECTS + +static void decode_index_slice( + int16_t index, + int16_t *ratio_idx_ism, + int16_t no_ism, + int16_t K ) +{ + int16_t i, j, sum, elem; + int16_t base[MAX_NUM_OBJECTS]; + + switch ( no_ism ) + { + case 2: + ratio_idx_ism[0] = index; + ratio_idx_ism[1] = K - ratio_idx_ism[0]; + break; + case 3: + case 4: + { + j = 0; + while ( index >= 0 ) + { + if ( valid( j, K, no_ism - 1 ) ) + { + index--; + } + j++; + } + j--; + base[0] = 1; + for ( i = 1; i < no_ism - 1; i++ ) + { + base[i] = base[i - 1] * 10; + } + sum = 0; + for ( i = no_ism - 2; i >= 0; i-- ) + { + elem = j / base[i]; + ratio_idx_ism[no_ism - i - 2] = elem; + sum += elem; + j -= elem * base[i]; + } + ratio_idx_ism[no_ism - 1] = K - sum; + } + + default: + break; + } +} + +static void read_ism_ratio_index( + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t no_ism, + int16_t numCodingBands, + int16_t sf, + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + uint16_t *bit_stream, + int16_t *next_bit_pos, + float *masa_to_total_energy_ratio ) +{ + int16_t b, i; + int16_t index; + int16_t GR_order, differential_subframe; + int16_t buf; + int16_t no_levels_ratio_ism; + no_levels_ratio_ism = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); + if ( sf == 0 ) + { + switch ( no_ism ) + { + case 2: + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = 0; + for ( i = 0; i < 3; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + + decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + break; + case 3: + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + /* read first 5 bits */ + index = 0; + for ( i = 0; i < 5; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + if ( index == 31 ) + { + index = 0; + for ( i = 0; i < 3; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + index += 31; + } + + decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + break; + case 4: + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + /* read 7 bits */ + index = 0; + for ( i = 0; i < 7; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + + decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + break; + default: + assert( ( no_ism >= 2 && no_ism <= 4 ) && "Wrong number of objects for MASA_ISM." ); + break; + } + } + else + { + /* read prediciton type */ + differential_subframe = bit_stream[( *next_bit_pos )--]; + /* read GR order */ + GR_order = bit_stream[( *next_bit_pos )--]; + for ( b = 0; b < numCodingBands; b++ ) + { + for ( i = 0; i < no_ism - 1; i++ ) + { + buf = ivas_qmetadata_DecodeExtendedGR( bit_stream, next_bit_pos, 100, GR_order ); + if ( ( buf % 2 ) == 0 ) + { + ratio_ism_idx[b][i] = -( buf >> 1 ); + } + else + { + ratio_ism_idx[b][i] = ( ( buf + 1 ) >> 1 ); + } + } + } + if ( differential_subframe ) + { + /* differential to previous subframe */ + for ( b = 0; b < numCodingBands; b++ ) + { + ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx_prev_sf[b][i]; + ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; + } + } + } + else + { + /* difference to previous subband */ + ratio_ism_idx[0][no_ism - 1] = no_levels_ratio_ism; + /* first subband - differential to previous subframe */ + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[0][i] = ratio_ism_idx[0][i] + ratio_ism_idx_prev_sf[0][i]; + ratio_ism_idx[0][no_ism - 1] -= ratio_ism_idx[0][i]; + } + /* rest of subbands differential to previous subband */ + for ( b = 1; b < numCodingBands; b++ ) + { + ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx[b - 1][i]; + ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; + } + } + } + } +} + +static void decode_ism_ratios( + uint16_t *bit_stream, + int16_t *next_bit_pos, + IVAS_QMETADATA_HANDLE hQMetaData, + float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t n_ism ) +{ + int16_t sf, band; + int16_t nbands, numSf; + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + + nbands = hQMetaData->q_direction->cfg.nbands; + numSf = hQMetaData->q_direction->cfg.nblocks; + for ( sf = 0; sf < numSf; sf++ ) + { + /* read ism ratio indexes */ + read_ism_ratio_index( ratio_ism_idx, n_ism, nbands, sf, ratio_ism_idx_prev_sf, bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio[sf] ); + + /* save previous subframe index values */ + if ( sf < numSf - 1 ) + { + /* Todo Nokia: can be moved to the read_ism_ratio ... function */ + for ( band = 0; band < nbands; band++ ) + { + mvs2s( ratio_ism_idx[band], ratio_ism_idx_prev_sf[band], n_ism ); + } + } + + /* reconstructed values */ + for ( band = 0; band < nbands; band++ ) + { + reconstruct_ism_ratios( ratio_ism_idx[band], n_ism, 1.0f / (float) ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ), ratio_ism[sf][band] ); + } + } +} + +static int16_t ivas_decode_masaism_metadata( + IVAS_QMETADATA_HANDLE hQMetaData, + MASA_DECODER_HANDLE hMasa, + MASA_ISM_DATA_HANDLE hMasaIsmData, + const int16_t nchan_ism, + uint16_t *bit_stream, + int16_t *next_bit_pos ) +{ + int16_t sf, band, dir, nbands, nblocks, obj, i; + + float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + int16_t *band_mapping; + int16_t b; + float priority[MAX_NUM_OBJECTS]; + int16_t bits_ism[MAX_NUM_OBJECTS], index; + uint16_t idx_el, idx_az; + float azimuth, elevation; + int16_t nb_bits_read; + + nb_bits_read = *next_bit_pos; + nbands = hQMetaData->q_direction->cfg.nbands; + nblocks = hQMetaData->q_direction->cfg.nblocks; + + + /* Read MASA-to-total energy ratios */ + decode_masa_to_total( bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio, nbands ); + if ( nchan_ism > 1 ) + { + /* read ISM ratios */ + decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism ); + + /* calculate priority */ + set_f( priority, 0.0f, nchan_ism ); + for ( sf = 0; sf < nblocks; sf++ ) + { + for ( band = 0; band < nbands; band++ ) + { + for ( obj = 0; obj < nchan_ism; obj++ ) + { + priority[obj] = max( priority[obj], ( energy_ratio_ism[sf][band][obj] * hQMetaData->masa_to_total_energy_ratio[sf][band] ) ); + } + } + } + } + else + { + for ( sf = 0; sf < nblocks; sf++ ) + { + for ( band = 0; band < nbands; band++ ) + { + energy_ratio_ism[sf][band][0] = 1.0f; + } + } + priority[0] = 1; + } + + /* read ISM metadata */ + for ( obj = 0; obj < nchan_ism; obj++ ) + { + bits_ism[obj] = 11 - (int16_t) ( ( 1 - priority[obj] ) * 7 ); + } + + for ( obj = 0; obj < nchan_ism; obj++ ) + { + index = 0; + for ( i = 0; i < bits_ism[obj]; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); + hMasaIsmData->azimuth_ism[obj] = (int16_t) rint( azimuth ); + hMasaIsmData->elevation_ism[obj] = (int16_t) rint( elevation ); + } + + /* Modify ISM metadata based on the MASA-to-total energy ratios */ + for ( sf = 0; sf < nblocks; sf++ ) + { + for ( band = 0; band < nbands; band++ ) + { + for ( dir = 0; dir < nchan_ism; dir++ ) + { + energy_ratio_ism[sf][band][dir] *= ( 1.0f - hQMetaData->masa_to_total_energy_ratio[sf][band] ); + } + } + } + + /* Set data to struct in bins */ + band_mapping = hMasa->data.band_mapping; + for ( band = 0; band < hMasa->config.numCodingBands; ++band ) + { + for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + { + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; ++sf ) + { + if ( nblocks == 1 ) + { + i = 0; + } + else + { + i = sf; + } + + for ( dir = 0; dir < nchan_ism; dir++ ) + { + hMasaIsmData->energy_ratio_ism[dir][sf][b] = energy_ratio_ism[i][band][dir]; + } + } + } + } + + return ( nb_bits_read - *next_bit_pos ); +} + +void ivas_masa_ism_set_edited_objects( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t dir; + MASA_ISM_DATA_HANDLE hMasaIsmData; + + hMasaIsmData = st_ivas->hMasaIsmData; + + /* Set positions of the edited objects */ + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + if ( st_ivas->editing_ism_enabled ) + { + hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism] = st_ivas->azimuth_edited; + hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism] = st_ivas->elevation_edited; + } + } + else + { + for ( dir = 0; dir < MAX_NUM_OBJECTS; dir++ ) + { + if ( dir == st_ivas->index_of_edited_ism && st_ivas->editing_ism_enabled ) + { + hMasaIsmData->ism_is_edited[dir] = 1; + hMasaIsmData->azimuth_ism_edited[dir] = st_ivas->azimuth_edited; + hMasaIsmData->elevation_ism_edited[dir] = st_ivas->elevation_edited; + } + else + { + hMasaIsmData->ism_is_edited[dir] = 0; + } + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st_ivas->editing_ism_enabled ) + { + if ( st_ivas->hMasaIsmData->idx_separated_ism == st_ivas->index_of_edited_ism ) + { + st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->azimuth_edited; + st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->elevation_edited; + } + } + } +} + + +#endif diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 20b677075e..6edad11925 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -94,6 +94,23 @@ void ivas_mono_downmix_render_passive( MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) + { + numInputChannels = st_ivas->nchan_transport; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + numInputChannels = st_ivas->nchan_transport + 1; + } + else + { + numInputChannels = st_ivas->nchan_transport + st_ivas->nchan_ism; + } + } +#endif hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 059ba752e7..b5b145a30f 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -55,7 +55,9 @@ static int16_t ivas_qmetadata_raw_decode_dir( IVAS_QDIRECTION *q_direction, uint static uint16_t ivas_qmetadata_DecodeQuasiUniform( const uint16_t *bitstream, int16_t *index, const uint16_t alphabet_size ); +#ifndef MASA_AND_OBJECTS static int16_t ivas_qmetadata_DecodeExtendedGR( uint16_t *bitstream, int16_t *index, const int16_t alph_size, const int16_t gr_param ); +#endif static int16_t ivas_qmetadata_ReorderElevationDecoded( const int16_t elev_dist, const int16_t elev_avg, const int16_t elev_alph ); @@ -91,6 +93,10 @@ static int16_t read_GR_min_removed_data( uint16_t *bitstream, int16_t *p_bit_pos static int16_t decode_fixed_rate_composed_index_coherence( uint16_t *bitstream, int16_t *p_bit_pos, const int16_t no_bands, int16_t *no_cv_vec, uint16_t *decoded_index, const int16_t no_symb ); +#ifdef MASA_AND_OBJECTS +static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, int16_t len_stream, uint16_t *bit_stream, int16_t *index, int16_t first_line ); +#endif + /*-----------------------------------------------------------------------* * Global function definitions *-----------------------------------------------------------------------*/ @@ -557,6 +563,7 @@ int16_t ivas_qmetadata_dec_decode( bits_dir_target += bits_dir_raw; bits_dir_used += bits_dir; + #ifdef DEBUG_MODE_QMETADATA fprintf( pF, "frame %d: diff %d coh %d surcoh %d ", frame, bits_diff, bits_coherence, bits_sur_coherence ); fprintf( pF, "dir %d %d,%d,%d\n", ec_flag, start_index_0 - *index, total_bits_1dir, bits_dir_raw ); @@ -1573,12 +1580,16 @@ static uint16_t ivas_qmetadata_DecodeQuasiUniform( *------------------------------------------------------------------------*/ /* !r: Value decoded from the bitstream */ -static int16_t ivas_qmetadata_DecodeExtendedGR( - uint16_t *bitstream, /* i : pointer to the bitstream to read */ - int16_t *index, /* i/o: position in the bitstream to start reading (gets updated with reading) */ - const int16_t alph_size, /* i : size of the alphabet, used to calculate the number of bits needed */ - const int16_t gr_param /* i : GR parameter that indicates the limit for the most significant bits (msb) */ -) +#ifndef MASA_AND_OBJECTS +static +#endif + int16_t + ivas_qmetadata_DecodeExtendedGR( + uint16_t *bitstream, /* i : pointer to the bitstream to read */ + int16_t *index, /* i/o: position in the bitstream to start reading (gets updated with reading) */ + const int16_t alph_size, /* i : size of the alphabet, used to calculate the number of bits needed */ + const int16_t gr_param /* i : GR parameter that indicates the limit for the most significant bits (msb) */ + ) { int16_t i, msb_size; uint16_t value; @@ -3289,3 +3300,153 @@ static void decode_combined_index( return; } + +#ifdef MASA_AND_OBJECTS +static void read_stream_dct_coeffs_omasa( + int16_t *q_idx, + float *q_dct_data, + int16_t len_stream, + uint16_t *bit_stream, + int16_t *index, + int16_t first_line ) +{ + int16_t sign, nbits; + int16_t i, j, i_min; + int16_t last_non_null; + float step = 0.1f; + + nbits = 0; + sign = 1; + if ( first_line == 0 ) + { + /* read sign */ + sign = bit_stream[( *index )--]; + if ( sign == 0 ) + { + sign = -1; + } + nbits++; + } + + set_s( q_idx, 0, len_stream ); + /* read DCT 0 component */ + for ( i = 0; i < BITS_MASA2TOTTAL_DCT0; i++ ) + { + q_idx[0] = ( q_idx[0] << 1 ) + bit_stream[( *index )--]; + } + q_idx[0] *= sign; + + if ( q_idx[0] != 0 ) + { + /* read last non null position */ + last_non_null = 0; + j = (int16_t) ceilf( log2f( (float) ( len_stream ) ) ); + for ( i = 0; i < j; i++ ) + { + last_non_null = ( last_non_null << 1 ) + bit_stream[( *index )--]; + } + + nbits += j; + if ( last_non_null > 0 ) + { + /* read index of last index encoded with GR2 */ + i_min = 0; + j = (int16_t) ceilf( log2f( (float) ( last_non_null + 1 ) ) ); + for ( i = 0; i < j; i++ ) + { + i_min = ( i_min << 1 ) + bit_stream[( *index )--]; + } + + nbits += j; + + /* read GR data */ + for ( i = 1; i <= i_min; i++ ) + { + q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, 2 ); + } + for ( i = i_min + 1; i <= last_non_null; i++ ) + { + q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, 0 ); + } + } + } + /* deindex */ + q_dct_data[0] = q_idx[0] * step; + for ( i = 1; i < len_stream; i++ ) + { + if ( ( q_idx[i] % 2 ) == 0 ) + { + q_dct_data[i] = -( q_idx[i] >> 1 ) * step; + } + else + { + q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; + } + } + return; +} + +void decode_masa_to_total( + uint16_t *bit_stream, + int16_t *index, + float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + int16_t nbands ) +{ + int16_t i, j, k; + + int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + + float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], + dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + + + int16_t n_streams, len_stream; + /* Setup coding parameters */ + if ( nbands == 5 ) + { + n_streams = 1; + len_stream = nbands * 4; + } + else if ( nbands == 8 ) + { + n_streams = 4; + len_stream = 8; + } + else + { + n_streams = 4; + len_stream = nbands; + printf( "Unrecognized number of bands!" ); /* To do: finalize this */ + exit( -1 ); + } + set_s( q_idx, 0, nbands * MAX_PARAM_SPATIAL_SUBFRAMES ); + for ( i = 0; i < n_streams; i++ ) + { + read_stream_dct_coeffs_omasa( &q_idx[i * len_stream], &q_dct_data[i * len_stream], len_stream, bit_stream, index, i == 0 ); + } + + + /* inverse DCT2 transform */ + if ( nbands == 5 ) + { + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); /* reuse of variable*/ + } + else + { + assert( nbands == 8 ); + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); + } + k = 0; + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + for ( j = 0; j < nbands; j++ ) + { + masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); + masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] ); + k++; + } + } +} +#endif diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 97ee2e8336..45fc95f4c2 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -142,7 +142,15 @@ ivas_error ivas_sce_dec( if ( ( st_ivas->hQMetaData != NULL ) && ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) { +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL ); + } + else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#else if ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) +#endif { st->bits_frame_nominal = (int16_t) ( hSCE->element_brate / FRAMES_PER_SEC ); } @@ -160,6 +168,7 @@ ivas_error ivas_sce_dec( st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL ); } + /* set "total_brate" */ if ( !st_ivas->bfi && ( ivas_total_brate == IVAS_SID_5k2 ) ) { @@ -169,17 +178,31 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + /* one separated object */ + st->total_brate = hSCE->element_brate; + } + } +#endif else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } - /*----------------------------------------------------------------* - * Core codec configuration - *----------------------------------------------------------------*/ +/*----------------------------------------------------------------* + * Core codec configuration + *----------------------------------------------------------------*/ - /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ +/* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ +#ifdef MASA_AND_OBJECTS + if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) +#else if ( st_ivas->ivas_format == ISM_FORMAT && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) +#endif { st->flag_ACELP16k = 0; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 2393a41f2f..c85e9ef9fb 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -657,7 +657,13 @@ typedef struct ivas_dirac_dec_data_structure int16_t spar_to_dirac_write_idx; int16_t dirac_md_buffer_length; +#ifdef MASA_AND_OBJECTS + int16_t numSimultaneousDirections; /* From 1 to 2 + MAX_NUM_OBJECTS */ + int16_t numParametricDirections; /* 1 or 2 */ + int16_t numIsmDirections; /* From 0 to MAX_NUM_OBJECTS */ +#else int16_t numSimultaneousDirections; /* 1 or 2 */ +#endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; /*Parameter estimation*/ @@ -1172,6 +1178,35 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; +#ifdef MASA_AND_OBJECTS +/* Data structure for MASA_ISM rendering */ +typedef struct ivas_masa_ism_data_structure +{ + int16_t azimuth_ism[MAX_NUM_OBJECTS]; + int16_t elevation_ism[MAX_NUM_OBJECTS]; + float energy_ratio_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + + int16_t azimuth_ism_edited[MAX_NUM_OBJECTS]; + int16_t elevation_ism_edited[MAX_NUM_OBJECTS]; + uint8_t ism_is_edited[MAX_NUM_OBJECTS]; + + int16_t idx_separated_ism; + int16_t azimuth_separated_ism; + int16_t elevation_separated_ism; + + float ismPreprocMatrix[2][2][CLDFB_NO_CHANNELS_MAX]; + uint8_t objectsMoved; + float eneMoveIIR[2][CLDFB_NO_CHANNELS_MAX]; + float enePreserveIIR[2][CLDFB_NO_CHANNELS_MAX]; + float preprocEneTarget[CLDFB_NO_CHANNELS_MAX]; + float preprocEneRealized[CLDFB_NO_CHANNELS_MAX]; + + float **delayBuffer; + int16_t delayBuffer_size; + int16_t delayBuffer_nchan; + +} MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; +#endif /*----------------------------------------------------------------------------------* * Binaural Rendering structure @@ -1230,8 +1265,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure float ChEneOut[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float ChCrossReOut[CLDFB_NO_CHANNELS_MAX]; float ChCrossImOut[CLDFB_NO_CHANNELS_MAX]; +#ifdef MASA_AND_OBJECTS + float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; +#else float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; /* +1 refers to SeparateChannel */ float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; +#endif float processMtxDecRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float diffuseFieldCoherence[CLDFB_NO_CHANNELS_MAX]; @@ -1242,8 +1282,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure REVERB_STRUCT_HANDLE hReverb; uint8_t renderStereoOutputInsteadOfBinaural; float frameMeanDiffuseness[CLDFB_NO_CHANNELS_MAX]; +#ifdef MASA_AND_OBJECTS + float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; +#else float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; +#endif float processMtxDecRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; uint16_t useSubframeMode; /* 0 = process in 20 ms frames, 1 = process in 5 ms subframes */ @@ -1961,6 +2006,16 @@ typedef struct Decoder_Struct HEAD_TRACK_DATA_HANDLE hHeadTrackData; /* Head tracking data structure */ RENDER_CONFIG_DATA *hRenderConfig; /* Renderer config pointer */ int32_t binaural_latency_ns; /* HRTF binauralization latency in ns */ +#ifdef MASA_AND_OBJECTS + int16_t nchan_ism; /* number of ism channels in combined input format mode */ + MASA_ISM_DATA_HANDLE hMasaIsmData; /* MASA_ISM rendering structure */ + + uint8_t editing_ism_enabled; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t index_of_edited_ism; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t azimuth_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t elevation_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ +#endif + #ifdef DEBUGGING int32_t noClipping; /* number of clipped samples */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 70e0384839..8016e4f75f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -197,6 +197,13 @@ ivas_error IVAS_DEC_Open( st_ivas->sba_planar = 0; st_ivas->sba_analysis_order = 0; +#ifdef MASA_AND_OBJECTS + hIvasDec->st_ivas->editing_ism_enabled = 0; + hIvasDec->st_ivas->index_of_edited_ism = 0; + hIvasDec->st_ivas->azimuth_edited = 0; + hIvasDec->st_ivas->elevation_edited = 0; +#endif + return IVAS_ERR_OK; } @@ -940,6 +947,35 @@ ivas_error IVAS_DEC_GetHrtfHandle( } +#ifdef MASAISM_EDIT_OBJECTS +/*---------------------------------------------------------------------* + * IVAS_DEC_SetEditedIsmPositions( ) + * + * + *---------------------------------------------------------------------*/ + +ivas_error IVAS_DEC_SetEditedIsmPositions( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + int16_t index_of_edited_ism, /* i : Index of edited ISM */ + int16_t azimuth_edited_ism, /* i : Azimuth */ + int16_t elevation_edited_ism /* i : Elevation */ +) +{ + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + hIvasDec->st_ivas->editing_ism_enabled = 1; + hIvasDec->st_ivas->index_of_edited_ism = index_of_edited_ism; + hIvasDec->st_ivas->azimuth_edited = azimuth_edited_ism; + hIvasDec->st_ivas->elevation_edited = elevation_edited_ism; + + return IVAS_ERR_OK; +} +#endif + + /*---------------------------------------------------------------------* * IVAS_DEC_GetRenderConfig( ) * diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f43034c885..7231ccf3da 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -278,6 +278,15 @@ ivas_error IVAS_DEC_GetHrtfHandle( IVAS_DEC_HRTF_HANDLE *hHrtfTD /* o : HRTF handle */ ); +#ifdef MASAISM_EDIT_OBJECTS +ivas_error IVAS_DEC_SetEditedIsmPositions( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + int16_t index_of_edited_ism, /* i : Index of edited ISM */ + int16_t azimuth_edited_ism, /* i : Azimuth */ + int16_t elevation_edited_ism /* i : Elevation */ +); +#endif + /*! r: error code*/ ivas_error IVAS_DEC_GetRenderConfig( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5c4011fe0c..e5c83ffb20 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -101,6 +101,9 @@ ivas_error ivas_cpe_enc( ENCODER_CONFIG_HANDLE hEncoderConfig; int32_t ivas_total_brate; ivas_error error; +#ifdef MASA_AND_OBJECTS + int32_t cpe_brate; +#endif error = IVAS_ERR_OK; @@ -547,7 +550,9 @@ ivas_error ivas_cpe_enc( * DFT Stereo residual coding * DFT Stereo parameters writing into the bitstream *----------------------------------------------------------------*/ - +#ifdef MASA_AND_OBJECTS + cpe_brate = 0; +#endif if ( hCPE->element_mode == IVAS_CPE_DFT ) { if ( hEncoderConfig->Opt_DTX_ON ) @@ -578,6 +583,33 @@ ivas_error ivas_cpe_enc( } /* Write stereo bitstream */ +#ifdef MASA_AND_OBJECTS + cpe_brate = ivas_total_brate; + + if ( ivas_format == MASA_ISM_FORMAT ) + { + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + } + + if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && cpe_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) + { + nb_bits = 0; /* Only mono downmix is transmitted in this case */ + } + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) + { + nb_bits = hCPE->hMetaData->nb_bits_tot; + } + else + { + stereo_dft_enc_write_BS( hCPE, &nb_bits ); + } + + if ( !( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) ) + { + /* Residual coding in MDCT domain */ + stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal - ( ( ivas_format == MASA_FORMAT ) ? nb_bits_metadata : 0 ) ) ); + } +#else if ( ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) { nb_bits = 0; /* Only mono downmix is transmitted in this case */ @@ -596,7 +628,7 @@ ivas_error ivas_cpe_enc( /* Residual coding in MDCT domain */ stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal - ( ( ivas_format == MASA_FORMAT ) ? nb_bits_metadata : 0 ) ) ); } - +#endif if ( sts[0]->core_brate == FRAME_NO_DATA || sts[0]->core_brate == SID_2k40 ) { assert( ( nb_bits <= ( ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS ) ) && "Stereo DFT CNG: bit budget is violated" ); @@ -762,7 +794,11 @@ ivas_error create_cpe_enc( for ( n = 0; n < CPE_CHANNELS; n++ ) { +#ifdef MASA_AND_OBJECTS + if ( ivas_format == STEREO_FORMAT || ivas_format == MASA_FORMAT || ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == STEREO_FORMAT || ivas_format == MASA_FORMAT || ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) +#endif { if ( ( hCPE->input_mem[n] = (float *) count_malloc( sizeof( float ) * NS2SA( input_Fs, STEREO_DFT_OVL_NS ) ) ) == NULL ) { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 7be1f11c49..bc2b6d33a0 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -61,7 +61,11 @@ ivas_error ivas_enc( ENCODER_CONFIG_HANDLE hEncoderConfig; BSTR_ENC_HANDLE hMetaData; Encoder_State *st; /* used for bitstream handling */ +#ifdef MASA_AND_OBJECTS + int16_t nb_bits_metadata[MAX_SCE + 1]; +#else int16_t nb_bits_metadata[MAX_SCE]; +#endif float data_f[MAX_INPUT_CHANNELS][L_FRAME48k]; /* IVAS_fmToDo: buffer can be allocated dynamically based on the number of analysed channels */ int32_t ivas_total_brate; ivas_error error; @@ -250,7 +254,12 @@ ivas_error ivas_enc( ivas_masa_estimate_energy( st_ivas->hMasa, data_f, input_frame, st_ivas->nchan_transport ); ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, - ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 ); + ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 +#ifdef MASA_AND_OBJECTS + , + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0 +#endif + ); } } else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) @@ -289,6 +298,83 @@ ivas_error ivas_enc( } } } +#ifdef MASA_AND_OBJECTS + else if ( ivas_format == MASA_ISM_FORMAT ) + { + float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; + float data_separated_object[L_FRAME48k]; + int16_t idx_separated_object; + + ivas_masa_enc_reconfigure( st_ivas ); + + hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; + + /* Stereo transport is used also with monoMASA, duplicate mono if monoMASA */ + if ( ( st_ivas->hEncoderConfig->nchan_inp - st_ivas->nchan_ism ) == 1 ) + { + v_multc( data_f[st_ivas->nchan_ism], 1.0f / SQRT2, data_f[st_ivas->nchan_ism], input_frame ); + mvr2r( data_f[st_ivas->nchan_ism], data_f[st_ivas->nchan_ism + 1], input_frame ); + } + + /* nb_bits_metadata[0] = 0; */ + set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); + if ( st_ivas->hQMetaData != NULL ) + { + /* Configure MASA encoder based on frame parameters */ + ivas_masa_enc_config( st_ivas ); + idx_separated_object = 0; + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Configure oMASA analysis based on MASA config */ + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs ); + } + else + { + st_ivas->nSCE = st_ivas->nchan_ism; + } + /* Estimate TF-tile energy for the input MASA stream */ + ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[st_ivas->nchan_ism] ), input_frame, st_ivas->nchan_transport ); + + /* put audio object data in SCE's */ + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Estimate MASA parameters for the objects */ + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, data_transport_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, + data_separated_object, &idx_separated_object ); + } + + /* Encode MASA parameters and write MASA metadata bitstream */ + ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object ); + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Merge transport signals */ + ivas_merge_masa_transports( data_transport_f, &( data_f[st_ivas->nchan_ism] ), data_f, input_frame, st_ivas->nchan_transport ); + } + } + + /* Encode transport signals */ + n = 0; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ); /* there are no metadata bits in SCE in this mode */ + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + /* Analysis, decision about bitrates per channel & core coding */ + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + { + return error; + } + n = st_ivas->nchan_ism; + } + + if ( st_ivas->nCPE == 1 ) /* Stereo DMX */ + { + ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); + } + } +#endif else if ( ivas_format == MC_FORMAT ) { /* select MC format mode; write MC LS setup; reconfigure the MC format encoder */ @@ -339,7 +425,13 @@ ivas_error ivas_enc( ivas_mcmasa_enc( st_ivas->hMcMasa, st_ivas->hQMetaData, st_ivas->hMasa, data_f, input_frame, st_ivas->nchan_transport, nchan_inp ); - ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 ); + ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 +#ifdef MASA_AND_OBJECTS + , + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0 +#endif + ); + if ( st_ivas->hMcMasa->separateChannelEnabled ) { diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 18280a60e2..b5ed592a34 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -37,6 +37,9 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_stat_enc.h" +#ifdef MASA_AND_OBJECTS +#include "ivas_rom_com.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -74,10 +77,31 @@ void ivas_write_format( ind = 6; nBits += extra_bits; break; +#ifdef MASA_AND_OBJECTS + case MASA_FORMAT: + ind = 14; + nBits += extra_bits + MASA_ISM_FORMAT_BITS; + break; +#else case MASA_FORMAT: ind = 7; nBits += extra_bits; break; +#endif +#ifdef MASA_AND_OBJECTS + case MASA_ISM_FORMAT: + if ( st_ivas->ism_mode == ISM_MODE_NONE ) + { + ind = 14; /* send MASA format */ + nBits += extra_bits + MASA_ISM_FORMAT_BITS; + } + else + { + ind = 15; + nBits += extra_bits + MASA_ISM_FORMAT_BITS; + } + break; +#endif default: assert( !"Invalid format. Aborting." ); break; @@ -156,7 +180,11 @@ void ivas_write_format_sid( ind = SID_MASA_2TC; } break; - +#ifdef MASA_AND_OBJECTS + case MASA_ISM_FORMAT: /* TODO Nokia: Finalize for SID case */ + ind = 8; + break; +#endif default: assert( !"Reserved SID format symbol written." ); break; @@ -194,7 +222,12 @@ int16_t getNumChanAnalysis( { n = st_ivas->hEncoderConfig->nchan_inp; } - +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + n = st_ivas->hEncoderConfig->nchan_inp; + } +#endif return n; } @@ -299,6 +332,11 @@ void ivas_initialize_handles_enc( /* LFE handle */ st_ivas->hLFE = NULL; +#ifdef MASA_AND_OBJECTS + /* Object MASA handle */ + st_ivas->hOMasa = NULL; +#endif + return; } @@ -519,6 +557,93 @@ ivas_error ivas_init_encoder( } } } +#ifdef MASA_AND_OBJECTS + else if ( ivas_format == MASA_ISM_FORMAT ) + { + int32_t element_brate_tmp[MAX_NUM_OBJECTS]; + int32_t sce_brate; + int16_t k; + + st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); + st_ivas->nchan_transport = 2; + create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ); + /* the values of element_brate_tmp will be re-written in MASA_ISM_FORMAT because they are taken from sep_object_brate[][]*/ + + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + st_ivas->nSCE = st_ivas->nchan_ism; + } + + k = 0; + sce_brate = 0; + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) + { + k++; + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + /* use the bitrate for one object */ + sce_brate = sep_object_brate[k - 2][0]; + create_sce_enc( st_ivas, 0, sce_brate ); + + /* prepare bitstream buffers */ + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list = ind_list[0]; + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); + + st_ivas->hSCE[0]->hMetaData->ind_list = ind_list_metadata[0]; + reset_indices_enc( st_ivas->hSCE[0]->hMetaData, MAX_BITS_METADATA ); + } + else + { + sce_brate = 0; + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + sce_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); + + /* 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 ); + + 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 ); + } + } + ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); + ivas_masa_enc_open( st_ivas ); + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + ivas_omasa_enc_open( st_ivas ); + } + if ( ivas_total_brate - sce_brate >= MIN_BRATE_MDCT_STEREO ) + { + st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; + } + else + { + st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; + } + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + { + create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - sce_brate ); + + /* prepare bitstream buffers */ + for ( n = 0; n < CPE_CHANNELS; n++ ) + { + st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[st_ivas->nSCE + cpe_id * CPE_CHANNELS + n]; + reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); + } + + /* 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 else if ( ivas_format == MC_FORMAT ) { st_ivas->mc_mode = ivas_mc_mode_select( hEncoderConfig->mc_input_setup, ivas_total_brate ); @@ -978,6 +1103,14 @@ void ivas_destroy_enc( st_ivas->hMcMasa = NULL; } +#ifdef MASA_AND_OBJECTS + if ( st_ivas->hOMasa != NULL ) + { + ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->nchan_ism ); + st_ivas->hOMasa = NULL; + } +#endif + /* Stereo downmix for EVS encoder handle */ if ( st_ivas->hStereoDmxEVS != NULL ) { diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 8e6c059c7b..4c8709ad0a 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -88,7 +88,9 @@ ivas_error ivas_ism_enc( int16_t localVAD_HE_SAD[1]; /* local HE VAD */ int16_t i, nBits; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int16_t n; +#endif error = IVAS_ERR_OK; wmops_sub_start( "ivas_ism_enc" ); @@ -98,7 +100,11 @@ ivas_error ivas_ism_enc( *-----------------------------------------------------------------*/ /* in ISM format: st_ivas->nchan_transport = st_ivas->nSCE */ +#ifdef MASA_AND_OBJECTS + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) +#else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) +#endif { hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; @@ -205,11 +211,34 @@ ivas_error ivas_ism_enc( st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; } - 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 ); + 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 +#ifdef MASA_AND_OBJECTS + , + st_ivas->nSCE +#endif + ); } else /* ISM_MODE_DISC */ { +#ifdef MASA_AND_OBJECTS + int32_t ism_total_brate; + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + ism_total_brate = 0; + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + ism_total_brate += st_ivas->hSCE[i]->element_brate; + } + } + else + { + ism_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; + } + + ivas_ism_metadata_enc( ism_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, st_ivas->nSCE ); +#else 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 ); +#endif } /*----------------------------------------------------------------* @@ -235,8 +264,20 @@ ivas_error ivas_ism_enc( /*------------------------------------------------------------------* * CoreCoders encoding *-----------------------------------------------------------------*/ +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + n = st_ivas->nSCE; + } + else + { + n = st_ivas->nchan_transport; + } + for ( sce_id = 0; sce_id < n; sce_id++ ) +#else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) +#endif { hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 60550bca0b..139b7806a9 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -142,6 +142,10 @@ ivas_error ivas_ism_metadata_enc( 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 */ +#ifdef MASA_AND_OBJECTS + , + int16_t n_ism /* i : number of ism-s */ +#endif ) { int16_t i, ch, nb_bits_start = 0, diff; @@ -154,7 +158,9 @@ ivas_error ivas_ism_metadata_enc( int16_t ism_imp[MAX_NUM_OBJECTS]; int16_t num_obj, nbands, nblocks; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int16_t n_ch; +#endif error = IVAS_ERR_OK; wmops_sub_start( "ism_meta_enc" ); @@ -167,12 +173,21 @@ ivas_error ivas_ism_metadata_enc( { num_obj = nchan_transport; } +#ifdef MASA_AND_OBJECTS + else if ( ism_mode == ISM_MASA_MODE_DISC ) + { + num_obj = n_ism; + } +#endif else { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: incorrect ISM mode" ); } - +#ifdef MASA_AND_OBJECTS + 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 || ism_mode == ISM_MASA_MODE_DISC ) ) +#else 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 ) ) +#endif { /* no metadata encoding in CNG */ wmops_sub_end(); @@ -196,7 +211,11 @@ ivas_error ivas_ism_metadata_enc( { hIsmMeta[ch]->ism_metadata_flag = 1; } +#ifdef MASA_AND_OBJECTS + else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else else if ( ism_mode == ISM_MODE_DISC ) +#endif { hIsmMeta[ch]->ism_metadata_flag = localVAD[ch]; @@ -223,11 +242,28 @@ ivas_error ivas_ism_metadata_enc( /*----------------------------------------------------------------* * Rate importance of particular ISm streams *----------------------------------------------------------------*/ +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + n_ch = num_obj; + } + else + { + n_ch = nchan_transport; + } + rate_ism_importance( n_ch, hIsmMeta, hSCE, ism_imp ); + +#else rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); +#endif /* relax the importance decision in "stereo" coding for noisy audio */ +#ifdef MASA_AND_OBJECTS + if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && num_obj == 2 ) +#else if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) +#endif { float diff_F; @@ -250,28 +286,47 @@ ivas_error ivas_ism_metadata_enc( * Write ISm common signaling *----------------------------------------------------------------*/ - /* write number of objects - unary coding */ - for ( ch = 1; ch < num_obj; ch++ ) + /*Todo: Nokia check where we transmit the number of objects */ +#ifdef MASA_AND_OBJECTS + if ( ism_mode != ISM_MASA_MODE_DISC ) { - push_indice( hBstr, IND_ISM_NUM_OBJECTS, 1, 1 ); +#endif + /* write number of objects - unary coding */ + 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 MASA_AND_OBJECTS } - push_indice( hBstr, IND_ISM_NUM_OBJECTS, 0, 1 ); - +#endif /* write ISm metadata flag (one per object) */ +#ifdef MASA_AND_OBJECTS + for ( ch = 0; ch < n_ch; ch++ ) +#else for ( ch = 0; ch < nchan_transport; ch++ ) +#endif { push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); } + for ( ch = 0; ch < num_obj; ch++ ) { ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; } - +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { /* write VAD flag */ +#ifdef MASA_AND_OBJECTS + for ( ch = 0; ch < n_ch; ch++ ) +#else for ( ch = 0; ch < nchan_transport; ch++ ) +#endif { if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { @@ -298,7 +353,11 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < num_obj; ch++ ) { hIsmMetaData = hIsmMeta[ch]; +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { nb_bits_start = hBstr->nb_bits_tot; } @@ -310,7 +369,11 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ /* Azimuth quantization (quantize azimuth to the AZIMUTH_NBITS-bit index */ +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { idx_azimuth_abs = ism_quant_meta( hIsmMetaData->azimuth, &valQ, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); } @@ -416,7 +479,11 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ /* Elevation quantization (quantize azimuth to the ELEVATION_NBITS-bit index */ +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { idx_elevation_abs = ism_quant_meta( hIsmMetaData->elevation, &valQ, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); } @@ -545,7 +612,11 @@ ivas_error ivas_ism_metadata_enc( hIsmMetaData->last_elevation_idx = idx_elevation_abs; /* save number of metadata bits written */ +#ifdef MASA_AND_OBJECTS + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#else if ( ism_mode == ISM_MODE_DISC ) +#endif { nb_bits_metadata[ch] = hBstr->nb_bits_tot - nb_bits_start; } @@ -676,14 +747,39 @@ ivas_error ivas_ism_metadata_enc( /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ - +#ifdef MASA_AND_OBJECTS + ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, + ( ism_mode == ISM_MASA_MODE_DISC ) ); +#else ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ); +#endif for ( ch = 0; ch < num_obj; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } +#ifdef MASA_AND_OBJECTS + for ( ch = 0; ch < n_ch; ch++ ) + { + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) + { + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; + if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) + { + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; + } + } + + hSCE[ch]->element_brate = element_brate[ch]; + hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; + /* write metadata only in active frames */ + if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) + { + reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); + } + } +#else for ( ch = 0; ch < nchan_transport; ch++ ) { if ( ism_mode == ISM_MODE_DISC ) @@ -704,6 +800,7 @@ ivas_error ivas_ism_metadata_enc( reset_indices_enc( hSCE[ch]->hMetaData, MAX_BITS_METADATA ); } } +#endif wmops_sub_end(); @@ -723,20 +820,77 @@ ivas_error create_ism_metadata_enc( ) { int16_t ch, nchan_transport; - - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) +#ifdef MASA_AND_OBJECTS + nchan_transport = st_ivas->nchan_transport; + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { - nchan_transport = 2; + switch ( st_ivas->ism_mode ) + { + case ISM_MASA_MODE_PARAM: + st_ivas->nCPE = 1; + st_ivas->nSCE = 0; + break; + case ISM_MASA_MODE_ONE_OBJ: + st_ivas->nCPE = 1; + st_ivas->nSCE = 1; + break; + case ISM_MODE_DISC: + st_ivas->nCPE = 1; + st_ivas->nSCE = n_ISms; + break; + case ISM_MASA_MODE_DISC: + st_ivas->nCPE = 1; + st_ivas->nSCE = n_ISms; + break; + case ISM_MODE_NONE: + if ( nchan_transport == 1 ) + { + st_ivas->nSCE = 1; + st_ivas->nCPE = 0; + } + else + { + st_ivas->nSCE = 0; + st_ivas->nCPE = 1; + } + break; + default: + break; + } } else { - nchan_transport = n_ISms; - } +#endif + if ( st_ivas->ism_mode == ISM_MODE_NONE ) + { + nchan_transport = st_ivas->nchan_transport; - st_ivas->nchan_transport = nchan_transport; - st_ivas->nSCE = nchan_transport; - st_ivas->nCPE = 0; + if ( nchan_transport == 1 ) + { + st_ivas->nSCE = 1; + st_ivas->nCPE = 0; + } + else + { + st_ivas->nSCE = 0; + st_ivas->nCPE = 1; + } + } + else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + { + nchan_transport = 2; + } + else + { + nchan_transport = n_ISms; + } + st_ivas->nchan_transport = nchan_transport; + st_ivas->nSCE = nchan_transport; + st_ivas->nCPE = 0; +#ifdef MASA_AND_OBJECTS + } +#endif /* allocate ISm metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) { @@ -753,8 +907,29 @@ ivas_error create_ism_metadata_enc( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } - - ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); - +#ifdef MASA_AND_OBJECTS + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, 1, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ); + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ); + } + } + else + { +#endif + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL +#ifdef MASA_AND_OBJECTS + , + 0 +#endif + ); +#ifdef MASA_AND_OBJECTS + } +#endif return IVAS_ERR_OK; } diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index 8dcdef30b5..7cb259b7f7 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -274,6 +274,7 @@ ivas_error ivas_param_ism_enc_open( /* Assign the number of objects */ hDirAC->hParamIsm->num_obj = st_ivas->hEncoderConfig->nchan_inp; + /* 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 ) { @@ -442,7 +443,11 @@ ivas_error ivas_ism_enc_config( st_ivas->nSCE = st_ivas->nchan_transport; st_ivas->nCPE = 0; +#ifdef MASA_AND_OBJECTS + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hEncoderConfig->nchan_inp, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ); +#else ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hEncoderConfig->nchan_inp, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); +#endif ivas_corecoder_enc_reconfig( st_ivas, nchan_transport_old, 0, nchan_transport_old ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index c2649adc56..05f5892005 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -58,7 +58,26 @@ static void compensate_energy_ratios( MASA_ENCODER_HANDLE hMasa ); static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate ); +#ifdef MASA_AND_OBJECTS +static void ivas_merge_masa_metadatas( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); + +static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[] /* i/o: ISM metadata handles */ +); + +static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); + + +static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t no_ism, float masa_to_total_energy_ratio ); + +static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); + +static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio ); +#else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); +#endif /*-----------------------------------------------------------------------* @@ -85,7 +104,9 @@ ivas_error ivas_masa_enc_open( MASA_ENCODER_HANDLE hMasa; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t sce_brate; +#endif error = IVAS_ERR_OK; if ( ( hMasa = (MASA_ENCODER_HANDLE) count_malloc( sizeof( MASA_ENCODER ) ) ) == NULL ) @@ -94,9 +115,14 @@ ivas_error ivas_masa_enc_open( } hEncoderConfig = st_ivas->hEncoderConfig; + generate_gridEq( &( hMasa->data.Sph_Grid16 ) ); +#ifdef MASA_AND_OBJECTS + if ( hEncoderConfig->ivas_format == MASA_FORMAT || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) +#else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) +#endif { hMasa->data.num_Cldfb_instances = st_ivas->nchan_transport; } @@ -112,14 +138,31 @@ ivas_error ivas_masa_enc_open( return error; } } - +#ifdef MASA_AND_OBJECTS + sce_brate = 0; + if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + sce_brate += st_ivas->hSCE[i]->element_brate; + } + } +#endif ivas_masa_set_elements( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, - st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); + st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE +#ifdef MASA_AND_OBJECTS + , + hEncoderConfig->ivas_format, st_ivas->ism_mode, sce_brate +#endif + ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); - +#ifdef MASA_AND_OBJECTS + if ( hEncoderConfig->ivas_format == MASA_FORMAT || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) +#else if ( hEncoderConfig->ivas_format == MASA_FORMAT ) +#endif { for ( i = 0; i < st_ivas->nchan_transport; i++ ) { @@ -158,8 +201,11 @@ void ivas_masa_enc_close( { deleteCldfb( &( hMasa->data.cldfbAnaEnc[i] ) ); } - +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { for ( i = 0; i < nchan_transport; i++ ) { @@ -190,16 +236,27 @@ void ivas_masa_encode( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t Opt_DTX_ON, /* i : DTX on flag */ const int16_t element_mode /* i : element mode */ +#ifdef MASA_AND_OBJECTS + , + ISM_MODE ism_mode, /* i : ISM format mode */ + int16_t nchan_ism, /* i : number of ism channels */ + ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ + int16_t idx_separated_object /* i : index of the separated object */ +#endif ) { MASA_DIRECTIONAL_SPATIAL_META *h_orig_metadata; int16_t i, j; int16_t masa_sid_descriptor; + masa_sid_descriptor = -1; h_orig_metadata = NULL; - +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { /* Create the MASA SID descriptor for the metadata and CPE mode, in order to have the SID frame self-contained. */ if ( Opt_DTX_ON && hQMetaData != NULL ) @@ -234,8 +291,11 @@ void ivas_masa_encode( /* Combine frequency bands and sub-frames */ combine_freqbands_and_subframes( hMasa ); } - +#ifdef MASA_AND_OBJECTS + if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) ) +#else if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ivas_format == MASA_FORMAT ) +#endif { /* Combine directions */ combine_directions( hMasa ); @@ -251,12 +311,30 @@ void ivas_masa_encode( /* Reset qmetadata bit budget */ hQMetaData->metadata_max_bits = hMasa->config.max_metadata_bits; - +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) + { + /* always write the number of objects in ISM_MASA format*/ + push_next_indice( hMetaData, nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ ); + hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; + + /* write index of separated object if needed */ + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ && hMasa->data.nchan_ism > 1 ) + { + push_next_indice( hMetaData, idx_separated_object, NO_BITS_MASA_ISM_NO_OBJ ); + hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; + } + } +#endif /* write placeholder data for descriptive metadata */ push_next_indice( hMetaData, 0, MASA_HEADER_BITS ); @@ -279,23 +357,55 @@ void ivas_masa_encode( } /* Move data from encoder to qmetadata */ +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { move_metadata_to_qmetadata( hMasa, hQMetaData ); } +#ifdef MASA_AND_OBJECTS + else if ( ivas_format == MASA_ISM_FORMAT ) + { + ivas_merge_masa_metadatas( hMasa, hQMetaData ); + } +#endif if ( hMasa->config.max_metadata_bits < MINIMUM_BIT_BUDGET_NORMAL_META && !hMasa->config.joinedSubframes ) { +#ifdef MASA_AND_OBJECTS + reduce_metadata_further( hMasa, hQMetaData, ivas_format, ism_mode ); +#else reduce_metadata_further( hMasa, hQMetaData, ivas_format ); - +#endif /* Write low bitrate mode. 1 signals that we have merged through time, 0 signals merge through frequency. */ push_next_indice( hMetaData, hQMetaData->q_direction[0].cfg.nblocks == 1 ? 1 : 0, MASA_LOWBITRATE_MODE_BITS ); hQMetaData->metadata_max_bits -= MASA_LOWBITRATE_MODE_BITS; } +#ifdef MASA_AND_OBJECTS + /* Encode MASA+ISM metadata */ + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + /* encode MASA/ISM energy ratios */ + ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData ); + } + else + { + hQMetaData->masa_to_total_energy_ratio[0][0] = -1; /* signals NOT to adjust the energy ratios */ + } +#endif /* Encode metadata */ ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + /* Modify spatial metadata based on the MASA-to-total energy ratios */ + modify_masa_energy_ratios( hQMetaData ); + } +#endif *nb_bits_metadata = hMetaData->nb_bits_tot; if ( ivas_format == MASA_FORMAT && Opt_DTX_ON ) @@ -466,19 +576,40 @@ ivas_error ivas_masa_enc_config( uint8_t isActualTwoDir; /* Flag to tell that when there are two directions present in metadata, they both contain meaningful information. */ int32_t ivas_total_brate; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t sce_brate; +#endif error = IVAS_ERR_OK; hMasa = st_ivas->hMasa; hQMetaData = st_ivas->hQMetaData; ivas_format = st_ivas->hEncoderConfig->ivas_format; ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; - +#ifdef MASA_AND_OBJECTS + sce_brate = 0; + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + sce_brate += st_ivas->hSCE[i]->element_brate; + } + } +#endif ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, - hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); + hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE +#ifdef MASA_AND_OBJECTS + , + ivas_format, st_ivas->ism_mode, sce_brate +#endif + ); hQMetaData->is_masa_ivas_format = 1; + +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { /* Inspect metadata for parameter changes that affect coding. */ detect_metadata_composition( hMasa, &joinedSubframes, &coherencePresent, &isActualTwoDir ); @@ -493,8 +624,18 @@ ivas_error ivas_masa_enc_config( hMasa->config.numberOfDirections = 1; } - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, ivas_total_brate, st_ivas->nchan_transport, ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); - +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT ) + { + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); + } + else + { +#endif + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, ivas_total_brate, st_ivas->nchan_transport, ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); +#ifdef MASA_AND_OBJECTS + } +#endif /* Setup importance weights for two-direction band selection. */ if ( hMasa->config.numberOfDirections == 2 ) { @@ -572,9 +713,17 @@ ivas_error ivas_masa_enc_config( masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, hQMetaData, st_ivas->hEncoderConfig->input_Fs ); /* Transmit stereo signals using a mono downmix at lowest bitrates */ +#ifdef MASA_AND_OBJECTS + if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) +#else if ( ivas_format == MASA_FORMAT && st_ivas->nCPE == 1 && st_ivas->hCPE[0]->hStereoDft != NULL && st_ivas->hCPE[0]->hStereoDft->hConfig != NULL ) +#endif { +#ifdef MASA_AND_OBJECTS + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ( ivas_total_brate - sce_brate < MASA_STEREO_MIN_BITRATE ) ? 1 : 0; +#else st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; +#endif } return error; @@ -1276,7 +1425,12 @@ static void compensate_energy_ratios( static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, - const IVAS_FORMAT ivas_format ) + const IVAS_FORMAT ivas_format +#ifdef MASA_AND_OBJECTS + , + const ISM_MODE ism_mode +#endif +) { int16_t sf; int16_t band; @@ -1299,7 +1453,11 @@ static void reduce_metadata_further( /* Get energy for the input data in 4-subframe, 5-band format */ totalEnergySum = 0.0f; +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) /* Energy data is in 4-subframe, 24-band format */ +#else if ( ivas_format == MASA_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ +#endif { for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { @@ -1678,8 +1836,21 @@ void ivas_masa_enc_reconfigure( int16_t n, tmp; int16_t sce_id, cpe_id; int32_t ivas_total_brate; - ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; +#ifdef MASA_AND_OBJECTS + int32_t sce_brate; +#endif + ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; +#ifdef MASA_AND_OBJECTS + sce_brate = 0; + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) + { + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + sce_brate += st_ivas->hSCE[sce_id]->element_brate; + } + } +#endif if ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) { for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) @@ -1699,7 +1870,16 @@ 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 MASA_AND_OBJECTS + if ( ivas_total_brate - sce_brate < MASA_STEREO_MIN_BITRATE || ivas_total_brate - sce_brate < MIN_BRATE_MDCT_STEREO ) + { + st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; + } + else + { + st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_MDCT; + } +#else if ( ivas_total_brate < MASA_STEREO_MIN_BITRATE ) { st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; @@ -1712,10 +1892,622 @@ void ivas_masa_enc_reconfigure( { st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_MDCT; } +#endif } - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp +#ifdef MASA_AND_OBJECTS + , + st_ivas->hEncoderConfig->ivas_format, st_ivas->ism_mode, sce_brate +#endif + ); } return; } + +#ifdef MASA_AND_OBJECTS +static void ivas_merge_masa_metadatas( + MASA_ENCODER_HANDLE hMasa, + IVAS_QMETADATA_HANDLE hQMeta ) +{ + int16_t sf, band; + uint8_t numCodingBands; + uint8_t numDirections; + uint8_t numSf; + MASA_METADATA_HANDLE hMeta; + float energyTimesRatio1, energyTimesRatio2; + int16_t brange[2]; + float eneBand; + float energyMerged[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; + int16_t bin; + + numCodingBands = hMasa->config.numCodingBands; + numDirections = hMasa->config.numberOfDirections; + numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; + hMeta = &( hMasa->masaMetadata ); + + assert( numDirections == 1 && "MASA metadata merging currently implemented only for 1-direction metadata" ); /* Currently only 1-direction metadata is fed to merging */ + + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + brange[0] = hMasa->data.band_mapping[band]; + brange[1] = hMasa->data.band_mapping[band + 1]; + + /* Compute energies */ + /* MASA energy is in the full 24 band resolution, whereas the ISM energy is already in the coding band resolution */ + eneBand = 0.0f; + for ( bin = brange[0]; bin < brange[1]; bin++ ) + { + eneBand += hMasa->data.energy[sf][bin]; + } + energyMerged[sf][band] = eneBand + hMasa->data.energy_ism[sf][band]; + + /* Compute weights */ + energyTimesRatio1 = hMasa->data.energy_ism[sf][band] * hQMeta->q_direction[0].band_data[band].energy_ratio[sf]; + energyTimesRatio2 = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; + + /* Determine combined metadata based on the weights */ + if ( energyTimesRatio2 > energyTimesRatio1 ) + { + hQMeta->q_direction[0].band_data[band].azimuth[sf] = hMeta->directional_meta[0].azimuth[sf][band]; + hQMeta->q_direction[0].band_data[band].elevation[sf] = hMeta->directional_meta[0].elevation[sf][band]; + hQMeta->q_direction[0].band_data[band].energy_ratio[sf] = hMeta->directional_meta[0].energy_ratio[sf][band]; + if ( hQMeta->q_direction[0].coherence_band_data != NULL ) + { + hQMeta->q_direction[0].coherence_band_data[band].spread_coherence[sf] = (uint8_t) roundf( hMeta->directional_meta[0].spread_coherence[sf][band] * UINT8_MAX ); + } + if ( hQMeta->surcoh_band_data != NULL ) + { + hQMeta->surcoh_band_data[band].surround_coherence[sf] = (uint8_t) roundf( hMeta->common_meta.surround_coherence[sf][band] * UINT8_MAX ); + } + } + } + } + + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + hMasa->data.energy[sf][band] = energyMerged[sf][band]; + } + } +} + + +static void quantize_ratio_ism_vector( + float *ratio_ism, + int16_t *idx, + int16_t no_ism, + float masa_to_total_energy_ratio ) +{ + int16_t i, j, best_i, best_i2; + + float dist, div, tmp, dist2, best_dist; + int16_t part_idx_sum, max_sum_idx; + max_sum_idx = ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1; + if ( no_ism > 1 ) + { + + if ( masa_to_total_energy_ratio >= MASA2TOTAL_THR ) + { + distribute_evenly_ism( idx, max_sum_idx, no_ism ); + } + else + { + dist = 0.0f; + div = 1.0f / (float) ( max_sum_idx ); + + part_idx_sum = 0; + + for ( i = 0; i < no_ism; i++ ) + { + idx[i] = (int16_t) ( ( ratio_ism[i] ) * ( max_sum_idx ) ); + part_idx_sum += idx[i]; + + tmp = ( ratio_ism[i] - ( idx[i] * div ) ); + dist += ( tmp * tmp ); + } + best_dist = dist; + best_i2 = -1; + while ( part_idx_sum < max_sum_idx ) + { + best_i = -1; + /* check which index to increase by 1 for a possible improvement */ + + for ( i = 0; i < no_ism; i++ ) + { + idx[i]++; + dist2 = 0.0f; + + + for ( j = 0; j < no_ism; j++ ) + { + tmp = ( ratio_ism[i] - ( idx[i] * div ) ); + dist2 += ( tmp * tmp ); + } + + if ( dist2 < best_dist ) + { + best_i2 = best_i; + best_i = i; + best_dist = dist2; + } + idx[i]--; + } + if ( best_i > -1 ) + { + idx[best_i]++; + part_idx_sum++; + } + else + { + if ( best_i2 > -1 ) + { + idx[best_i2]++; + part_idx_sum++; + } + else + { + idx[no_ism - 1] += max_sum_idx - part_idx_sum; + part_idx_sum = max_sum_idx; + } + } + } + assert( sum_s( idx, no_ism ) == max_sum_idx ); + } + } + else + { + idx[0] = (int16_t) ( ( ratio_ism[0] ) * ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ) + 0.5f ); + } + + + return; +} + + +static int16_t index_slice_enum( + const int16_t *ratio_ism_idx, + int16_t no_ism ) +{ + int16_t i; + int16_t x, index; + int16_t base; + + if ( no_ism == 2 ) + { + index = ratio_ism_idx[0]; + } + else + { + x = ratio_ism_idx[no_ism - 2]; + base = 10; + for ( i = no_ism - 3; i >= 0; i-- ) + { + x += ratio_ism_idx[i] * base; + base *= 10; + } + + index = 0; + i = 0; + while ( i <= x ) + { + if ( valid( i, 7, no_ism - 1 ) ) + { + index++; + } + i++; + } + index--; + } + + return index; +} + +static int16_t encode_ratio_ism_subframe( + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t no_ism, + int16_t numCodingBands, + int16_t sf, + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + BSTR_ENC_HANDLE hMetaData, + const float *masa_to_total_energy_ratio ) +{ + int16_t b, i; + int16_t diff_idx[MAX_NUM_OBJECTS], index; + int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb, bits_pos0; + int16_t differential_subframe; + + nbits = 0; + nbits0 = 0; + nbits1 = 0; + + bits_pos0 = hMetaData->nb_bits_tot; + differential_subframe = 1; /* the differences are taken with respect to previous subframe */ + if ( sf == 0 ) /* first subframe */ + { + if ( no_ism == 2 ) + { + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = index_slice_enum( ratio_ism_idx[b], no_ism ); + + push_next_indice( hMetaData, index, 3 ); + nbits += 3; + } + } + } + else if ( no_ism == 3 ) + { + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = index_slice_enum( ratio_ism_idx[b], no_ism ); + /* there are 36 indices and part of them use 5 bits; 31 is special code to + signal that there are indices larger than 31, represented on extra 3 bits */ + if ( index < 31 ) + { + push_next_indice( hMetaData, index, 5 ); + nbits += 5; + } + else + { + push_next_indice( hMetaData, 31, 5 ); + nbits += 5; + + push_next_indice( hMetaData, index - 31, 3 ); + nbits += 3; + } + } + } + } + else + { + if ( no_ism == 4 ) + { + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = index_slice_enum( ratio_ism_idx[b], no_ism ); + push_next_indice( hMetaData, index, 7 ); + nbits += 7; + } + } + } + } +#ifdef DEBUGGING + assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); +#endif + } + else + { + nbits0 = 0; + nbits1 = 0; + for ( b = 0; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); + } + } + if ( nbits0 < nbits1 ) + { + GR_order = 0; + nbits = nbits0; + } + else + { + GR_order = 1; + nbits = nbits1; + } + + /* try the difference from subband to subband; first subband is compared to previous subframe first subband*/ + /* take difference with respect to previous subframe only for first subband */ + nbits0 = 0; + nbits1 = 0; + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); + } + for ( b = 1; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); + } + } + + if ( nbits0 < nbits1 ) + { + GR_order_sb = 0; + } + else + { + GR_order_sb = 1; + nbits0 = nbits1; + } + + if ( nbits0 < nbits ) + { + differential_subframe = 0; + nbits = nbits0; + GR_order = GR_order_sb; + } + nbits++; /* for GR_order */ + nbits++; /* for the prediction type */ + + /* write prediction type */ + push_next_indice( hMetaData, differential_subframe, 1 ); + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + /* write data */ + if ( differential_subframe ) + { + for ( b = 0; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + } + } + } + else + { + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + } + for ( b = 1; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + /* transform difference index into positive */ + for ( i = 0; i < no_ism - 1; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + diff_idx[i] = -2 * diff_idx[i]; + } + else + { + diff_idx[i] = 2 * diff_idx[i] - 1; + } + } + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + } + } + } +#ifdef DEBUGGING + assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); +#endif + } + return nbits; +} + + +static void ivas_encode_masaism_metadata( + MASA_ENCODER_HANDLE hMasa, + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[] /* i/o: ISM metadata handles */ +) +{ + int16_t sf, band; + uint8_t numCodingBands; + uint8_t numSf; + int16_t brange[2]; + float eneBand; + int16_t bin; + int16_t obj; + float priority[MAX_NUM_OBJECTS]; + int16_t bits_ism[MAX_NUM_OBJECTS]; + uint16_t idx_sph; + float theta_q, phi_q; + uint16_t index_theta, index_phi; + float ratio_ism[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + float step; + int16_t inv_step; + + numCodingBands = hMasa->config.numCodingBands; + numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; + + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + if ( hMasa->data.energy_ism[sf][band] == 0.0f ) + { + hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f; + } + else + { + brange[0] = hMasa->data.band_mapping[band]; + brange[1] = hMasa->data.band_mapping[band + 1]; + + eneBand = 0.0f; + for ( bin = brange[0]; bin < brange[1]; bin++ ) + { + eneBand += hMasa->data.energy[sf][bin]; + } + hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hMasa->data.energy_ism[sf][band] + EPSILON ); + } + } + } + + + encode_masa_to_total( hQMetaData, hMetaData ); + /* quantize ism_ratios */ + if ( hMasa->data.nchan_ism > 1 ) + { + + inv_step = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); + step = 1.0f / inv_step; + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + assert( ( hMasa->data.energy_ratio_ism[sf][band][obj] >= 0 ) && ( hMasa->data.energy_ratio_ism[sf][band][obj] <= 1 ) ); + ratio_ism[band][obj] = hMasa->data.energy_ratio_ism[sf][band][obj]; + } + /* Quantize power ratios */ + quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band] ); + /* reconstructed values */ + reconstruct_ism_ratios( ratio_ism_idx[band], hMasa->data.nchan_ism, step, hMasa->data.q_energy_ratio_ism[sf][band] ); + /* encode vector */ + } + + /* encode data for current subframe */ + encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf] ); + + /* calculate quantized ISM ratios */ + /* save previous subframe indexes */ + for ( band = 0; band < numCodingBands; band++ ) + { + mvs2s( ratio_ism_idx[band], ratio_ism_idx_prev_sf[band], hMasa->data.nchan_ism ); + } + } + + set_f( priority, 0.0f, hMasa->data.nchan_ism ); + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + priority[obj] = max( priority[obj], ( hMasa->data.q_energy_ratio_ism[sf][band][obj] * hQMetaData->masa_to_total_energy_ratio[sf][band] ) ); + } + } + } + } + else + { + priority[0] = 1; + } + + /* decide parameters for ISM metadata quantization */ + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); + } + /* this is only the first version */ + /* quantize directions */ + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); + push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); + } +} + + +void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], + float data_in_f2[][L_FRAME48k], + float data_out_f[][L_FRAME48k], + const int16_t input_frame, + const int16_t num_transport_channels ) +{ + int16_t i, j; + + for ( i = 0; i < num_transport_channels; i++ ) + { + for ( j = 0; j < input_frame; j++ ) + { + data_out_f[i][j] = data_in_f1[i][j] + data_in_f2[i][j]; + } + } +} +#endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c new file mode 100644 index 0000000000..cd1f574346 --- /dev/null +++ b/lib_enc/ivas_omasa_enc.c @@ -0,0 +1,936 @@ +/****************************************************************************************************** + + (C) 2022 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 +#include +#include +#include +#include "string.h" + +#include "ivas_cnst.h" +#include "ivas_prot.h" +#include "options.h" +#include "prot.h" +#include "ivas_rom_com.h" +#include "ivas_rom_enc.h" +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmops.h" + +#ifdef MASA_AND_OBJECTS + +/*------------------------------------------------------------------------- + * Local function prototypes + *------------------------------------------------------------------------*/ + +static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); + +static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); + +static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t num_transport_channels, const int16_t num_input_channels, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); + +static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); + +static void computeReferencePower_omasa( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float *reference_power, const int16_t enc_param_start_band, const int16_t num_freq_bands ); + + +/*--------------------------------------------------------------------------* + * ivas_omasa_enc_open() + * + * + *--------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_enc_open( + Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ +) +{ + int16_t i, j; + float tmp_f; + OMASA_ENC_HANDLE hOMasa; + int16_t numAnalysisChannels; + int16_t input_frame; + ivas_error error; + + error = IVAS_ERR_OK; + + assert( st_ivas->hMasa != NULL && "MASA encoder handle is not present" ); + + if ( ( hOMasa = (OMASA_ENC_HANDLE) count_malloc( sizeof( OMASA_ENC_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for OMASA encoder\n" ) ); + } + + numAnalysisChannels = st_ivas->nchan_ism; + + /* initialize delay compensation */ + hOMasa->num_samples_delay_comp = NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS ); + tmp_f = ( (float) hOMasa->num_samples_delay_comp ) / (float) ( NS2SA( st_ivas->hEncoderConfig->input_Fs, DIRAC_SLOT_NS ) ); + hOMasa->num_slots_delay_comp = (int16_t) ( tmp_f ); + + if ( tmp_f > hOMasa->num_slots_delay_comp ) + { + hOMasa->num_slots_delay_comp++; + hOMasa->offset_comp = -hOMasa->num_samples_delay_comp; + hOMasa->num_samples_delay_comp = hOMasa->num_slots_delay_comp * NS2SA( st_ivas->hEncoderConfig->input_Fs, DIRAC_SLOT_NS ); + hOMasa->offset_comp += hOMasa->num_samples_delay_comp; + } + else + { + hOMasa->offset_comp = 0; + } + + for ( i = 0; i < numAnalysisChannels; i++ ) + { + hOMasa->delay_buffer[i] = (float *) count_malloc( NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) * sizeof( float ) ); /* Todo Nokia: Return errors if alloc fails */ + set_zero( hOMasa->delay_buffer[i], NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) ); + } + + /* open/initialize CLDFB */ + hOMasa->num_Cldfb_instances = numAnalysisChannels; + for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) + { + openCldfb( &( hOMasa->cldfbAnaEnc[i] ), CLDFB_ANALYSIS, st_ivas->hEncoderConfig->input_Fs, CLDFB_PROTOTYPE_5_00MS ); + } + + /* intensity 3-dim */ + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + hOMasa->direction_vector_m[i] = (float **) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ); + + for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) + { + hOMasa->direction_vector_m[i][j] = (float *) count_malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); + set_zero( hOMasa->direction_vector_m[i][j], MAXIMUM_OMASA_FREQ_BANDS ); + } + } + + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) + { + hOMasa->buffer_intensity_real[i][j] = (float *) count_malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); + set_zero( hOMasa->buffer_intensity_real[i][j], MAXIMUM_OMASA_FREQ_BANDS ); + } + } + + set_zero( hOMasa->buffer_energy, DIRAC_NO_COL_AVG_DIFF * MASA_FREQUENCY_BANDS ); + + for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) + { + set_f( hOMasa->prev_object_dm_gains[i], (float) sqrt( 0.5 ), MASA_MAX_TRANSPORT_CHANNELS ); + } + set_zero( hOMasa->broadband_energy_sm, MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS ); + set_zero( hOMasa->broadband_energy_prev, MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS ); + hOMasa->prev_selected_object = 0; + hOMasa->changing_object = 0; + + input_frame = (int16_t) ( st_ivas->hEncoderConfig->input_Fs / FRAMES_PER_SEC ); + for ( i = 0; i < input_frame; i++ ) + { + hOMasa->interpolator[i] = ( (float) i ) / ( (float) input_frame ); + hOMasa->fade_out_gain[i] = ( 1.0f + cosf( ( (float) i ) / ( (float) input_frame ) * EVS_PI ) ) / 2.0f; + hOMasa->fade_in_gain[i] = 1.0f - hOMasa->fade_out_gain[i]; + } + + hOMasa->index_buffer_intensity = 0; + + st_ivas->hOMasa = hOMasa; + + return error; +} + + +/*--------------------------------------------------------------------------* + * ivas_omasa_enc_close() + * + O + *--------------------------------------------------------------------------*/ + +void ivas_omasa_enc_close( + OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ + const int16_t nchan_ism /* i : number of objects */ +) +{ + int16_t i, j; + + + for ( i = 0; i < nchan_ism; i++ ) + { + count_free( hOMasa->delay_buffer[i] ); + hOMasa->delay_buffer[i] = NULL; + } + + for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) + { + deleteCldfb( &( hOMasa->cldfbAnaEnc[i] ) ); + } + + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) + { + count_free( hOMasa->direction_vector_m[i][j] ); + hOMasa->direction_vector_m[i][j] = NULL; + } + + for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) + { + count_free( hOMasa->buffer_intensity_real[i][j] ); + hOMasa->buffer_intensity_real[i][j] = NULL; + } + + count_free( hOMasa->direction_vector_m[i] ); + hOMasa->direction_vector_m[i] = NULL; + } + + count_free( hOMasa ); + + return; +} + + +/*--------------------------------------------------------------------------* + * ivas_omasa_set_config() + * + * Frame-by-frame config for oMASA + *--------------------------------------------------------------------------*/ + +void ivas_omasa_set_config( + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ + const int32_t input_Fs /* i : Input sample rate */ +) +{ + int16_t i, maxBin; + + /* Determine the number of bands */ + hOMasa->nbands = hMasa->config.numCodingBands; + hOMasa->nCodingBands = hMasa->config.numCodingBands; + + /* Determine the number of subframes */ + hOMasa->nSubframes = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; + + /* Determine band grouping */ + if ( hOMasa->nbands == 24 ) + { + mvs2s( MASA_band_grouping_24, hOMasa->band_grouping, 24 + 1 ); + } + else + { + for ( i = 0; i < hOMasa->nbands + 1; i++ ) + { + hOMasa->band_grouping[i] = MASA_band_grouping_24[hMasa->data.band_mapping[i]]; + } + } + + maxBin = (int16_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + + for ( i = 1; i < hOMasa->nbands + 1; i++ ) + { + if ( hOMasa->band_grouping[i] >= maxBin ) + { + hOMasa->band_grouping[i] = maxBin; + hOMasa->nbands = i; + break; + } + } + + mvs2s( DirAC_block_grouping, hOMasa->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); + if ( hOMasa->nSubframes == 1 ) + { + hOMasa->block_grouping[1] = hOMasa->block_grouping[MAX_PARAM_SPATIAL_SUBFRAMES]; + } +} + + +/*--------------------------------------------------------------------------* + * ivas_omasa_enc() + * + * + *--------------------------------------------------------------------------*/ + +void ivas_omasa_enc( + OMASA_ENC_HANDLE hOMasa, + IVAS_QMETADATA_HANDLE hQMeta, + MASA_ENCODER_HANDLE hMasa, + ISM_METADATA_HANDLE hIsmMeta[], + float data_in_f[][L_FRAME48k], + float data_out_f[][L_FRAME48k], + const int16_t input_frame, + const int16_t nchan_transport, + const int16_t nchan_ism, + const ISM_MODE ism_mode, + float data_separated_object[L_FRAME48k], + int16_t *idx_separated_object ) +{ + int16_t i, j; + + /* Analysis */ + if ( ism_mode == ISM_MODE_NONE ) + { + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; + float energyRatio[MASA_FREQUENCY_BANDS]; + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; + float surroundingCoherence[MASA_FREQUENCY_BANDS]; + int16_t nBands, nBlocks; + uint8_t fixedDistance = 0; + + nBands = hOMasa->nbands; + nBlocks = hOMasa->nSubframes; + + /* Estimate MASA parameters from the objects */ + ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); + + /* Set analyzed values to the QMeta struct */ + for ( i = 0; i < nBands; i++ ) + { + for ( j = 0; j < nBlocks; j++ ) + { + hQMeta->q_direction[0].band_data[i].azimuth[j] = azimuth_m_values[j][i]; + hQMeta->q_direction[0].band_data[i].elevation[j] = elevation_m_values[j][i]; + hQMeta->q_direction[0].band_data[i].energy_ratio[j] = energyRatio[i]; /* Only one value is transmitted for all subframes */ + hQMeta->q_direction[0].band_data[i].distance[j] = fixedDistance; + + if ( hQMeta->surcoh_band_data != NULL ) + { + hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = (uint8_t) roundf( spreadCoherence[j][i] * UINT8_MAX ); + hQMeta->surcoh_band_data[i].surround_coherence[j] = (uint8_t) roundf( surroundingCoherence[i] * UINT8_MAX ); + } + } + } + + /* At lower sampling rates, set zeros for higher bands that were not analyzed */ + if ( nBands < hOMasa->nCodingBands ) + { + for ( i = nBands; i < hOMasa->nCodingBands; i++ ) + { + for ( j = 0; j < nBlocks; j++ ) + { + hQMeta->q_direction[0].band_data[i].azimuth[j] = 0.0f; + hQMeta->q_direction[0].band_data[i].elevation[j] = 0.0f; + hQMeta->q_direction[0].band_data[i].energy_ratio[j] = 0.0f; + hQMeta->q_direction[0].band_data[i].distance[j] = 0; + + if ( hQMeta->surcoh_band_data != NULL ) + { + hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = 0; + hQMeta->surcoh_band_data[i].surround_coherence[j] = 0; + } + } + } + } + } + else if ( ism_mode == ISM_MASA_MODE_PARAM ) + { + /* Estimate energies and ratios */ + ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); + } + else + { + float broadband_energy[MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS]; + int16_t loudest_object; + int16_t selected_object; + int16_t nchan_all_inp; + float alpha; + uint8_t fade_out_separate_object; + uint8_t fade_in_separate_object; + + /* Estimate broadband energies */ + nchan_all_inp = nchan_ism + nchan_transport; + set_zero( broadband_energy, nchan_all_inp ); + for ( i = 0; i < nchan_all_inp; i++ ) + { + for ( j = 0; j < input_frame; j++ ) + { + broadband_energy[i] += data_in_f[i][j] * data_in_f[i][j]; + } + } + + /* Temporal averaging */ + alpha = 0.8f; + for ( i = 0; i < nchan_all_inp; i++ ) + { + hOMasa->broadband_energy_sm[i] = ( 1.0f - alpha ) * broadband_energy[i] + alpha * hOMasa->broadband_energy_sm[i]; + } + + /* Determine loudest object */ + loudest_object = 0; + for ( i = 1; i < nchan_ism; i++ ) + { + if ( hOMasa->broadband_energy_sm[i] > hOMasa->broadband_energy_sm[loudest_object] ) + { + loudest_object = i; + } + } + + /* Determine object to separate */ + selected_object = hOMasa->prev_selected_object; + fade_out_separate_object = 0; + fade_in_separate_object = 0; + if ( hOMasa->changing_object ) + { + hOMasa->changing_object = 0; + selected_object = loudest_object; + fade_in_separate_object = 1; + } + else + { + if ( loudest_object != hOMasa->prev_selected_object ) + { + float selected_ene; + float total_ene; + float selected_ratio; + float adaptive_threshold_dB; + float ratio_objects_dB; + float hardswitch_threshold = 0.25f; + + /* Compute the energy of the current and the previous selected object in the current and the previous frame */ + selected_ene = broadband_energy[loudest_object] + broadband_energy[hOMasa->prev_selected_object] + hOMasa->broadband_energy_prev[loudest_object] + hOMasa->broadband_energy_prev[hOMasa->prev_selected_object]; + + /* Compute the energy of all objects and MASA channels in the current and the previous frame */ + total_ene = 0.0f; + for ( i = 0; i < nchan_all_inp; i++ ) + { + total_ene += broadband_energy[i] + hOMasa->broadband_energy_prev[i]; + } + + /* Compute the ratio */ + selected_ratio = selected_ene / ( total_ene + EPSILON ); + + adaptive_threshold_dB = selected_ratio * 9.0f + 1.0f; /* selected ratio = 0 -> 1 dB, selected ratio = 1 -> 10 dB */ + ratio_objects_dB = 10.0f * log10f( hOMasa->broadband_energy_sm[loudest_object] / ( hOMasa->broadband_energy_sm[hOMasa->prev_selected_object] + EPSILON ) ); + + /* Adaptively determine whether to change the separated object. If they are quiet compared to the total energy, change easier, as other signals mask the change. */ + if ( ratio_objects_dB > adaptive_threshold_dB ) + { + if ( selected_ratio < hardswitch_threshold ) /* If low level compared to all audio channels, perform hardswitch */ + { + selected_object = loudest_object; + } + else /* If high level compared to all audio channels, perform switch via fade out fade in */ + { + hOMasa->changing_object = 1; + fade_out_separate_object = 1; + } + } + } + } + + /* Set values for next frame */ + for ( i = 0; i < nchan_all_inp; i++ ) + { + hOMasa->broadband_energy_prev[i] = broadband_energy[i]; + } + hOMasa->prev_selected_object = selected_object; + + /* Separate the selected object */ + *idx_separated_object = selected_object; + mvr2r( data_in_f[selected_object], data_separated_object, input_frame ); + if ( fade_out_separate_object ) + { + v_mult( data_separated_object, hOMasa->fade_out_gain, data_separated_object, input_frame ); + v_mult( data_in_f[selected_object], hOMasa->fade_in_gain, data_in_f[selected_object], input_frame ); + } + else if ( fade_in_separate_object ) + { + v_mult( data_separated_object, hOMasa->fade_in_gain, data_separated_object, input_frame ); + v_mult( data_in_f[selected_object], hOMasa->fade_out_gain, data_in_f[selected_object], input_frame ); + } + else + { + set_zero( data_in_f[selected_object], input_frame ); + } + + /* Estimate energies and ratios */ + ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); + } + + + /* Downmix */ + ivas_omasa_dmx( data_in_f, data_out_f, input_frame, nchan_transport, nchan_ism, hIsmMeta, hOMasa->prev_object_dm_gains, hOMasa->interpolator ); + + return; +} + + +/*--------------------------------------------------------------------------* + * Local functions + *--------------------------------------------------------------------------*/ + +/* Estimate MASA parameters from the objects */ +static void ivas_omasa_param_est_enc( + OMASA_ENC_HANDLE hOMasa, + MASA_ENCODER_HANDLE hMasa, + ISM_METADATA_HANDLE hIsmMeta[], + float data_f[][L_FRAME48k], + float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + float energyRatio[MASA_FREQUENCY_BANDS], + float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + float surroundingCoherence[MASA_FREQUENCY_BANDS], + const int16_t input_frame, + const int16_t nchan_inp ) +{ + float reference_power[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + int16_t ts, i, j, d, k; + int16_t num_freq_bins, num_freq_bands, index; + float dir_v[DIRAC_NUM_DIMS]; + int16_t l_ts; + float Chnl_RealBuffer[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; + float Chnl_ImagBuffer[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; + float Foa_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; + float Foa_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; + float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; + float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; + float diffuseness_vector[MASA_FREQUENCY_BANDS]; + float diffuseness_m[MASA_FREQUENCY_BANDS]; + int16_t band_m_idx, block_m_idx; + float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; + float norm_tmp; + int16_t mrange[2], brange[2]; + + num_freq_bins = hOMasa->cldfbAnaEnc[0]->no_channels; + num_freq_bands = hOMasa->nbands; + l_ts = input_frame / CLDFB_NO_COL_MAX; + + + /* Need to initialize renormalization_factors, and variables to be normalized */ + set_zero( renormalization_factor_diff, hOMasa->nbands ); + set_zero( diffuseness_m, hOMasa->nbands ); + + /* Copy current frame to memory for delay compensation */ + for ( i = 0; i < nchan_inp; i++ ) + { + mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); + } + + /* Compute ISM to FOA matrices */ + for ( i = 0; i < nchan_inp; i++ ) + { + hOMasa->chnlToFoaMtx[0][i] = 1.0f; + hOMasa->chnlToFoaMtx[1][i] = sinf( ( hIsmMeta[i]->azimuth / 180.0f * EVS_PI ) ) * cosf( ( hIsmMeta[i]->elevation / 180.0f * EVS_PI ) ); + hOMasa->chnlToFoaMtx[2][i] = sinf( ( hIsmMeta[i]->elevation / 180.0f * EVS_PI ) ); + hOMasa->chnlToFoaMtx[3][i] = cosf( ( hIsmMeta[i]->azimuth / 180.0f * EVS_PI ) ) * cosf( ( hIsmMeta[i]->elevation / 180.0f * EVS_PI ) ); + } + + /* do processing over all CLDFB time slots */ + for ( block_m_idx = 0; block_m_idx < hOMasa->nSubframes; block_m_idx++ ) + { + mrange[0] = hOMasa->block_grouping[block_m_idx]; + mrange[1] = hOMasa->block_grouping[block_m_idx + 1]; + + for ( band_m_idx = 0; band_m_idx < hOMasa->nbands; band_m_idx++ ) + { + hOMasa->direction_vector_m[0][block_m_idx][band_m_idx] = 0.0f; + hOMasa->direction_vector_m[1][block_m_idx][band_m_idx] = 0.0f; + hOMasa->direction_vector_m[2][block_m_idx][band_m_idx] = 0.0f; + } + + set_zero( hMasa->data.energy_ism[block_m_idx], num_freq_bands ); + + for ( ts = mrange[0]; ts < mrange[1]; ts++ ) + { + for ( i = 0; i < nchan_inp; i++ ) + { + if ( ts < hOMasa->num_slots_delay_comp ) + { + cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); + } + else + { + cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); + } + } + + /* Compute energy */ + for ( i = 0; i < num_freq_bands; i++ ) + { + brange[0] = hOMasa->band_grouping[i]; + brange[1] = hOMasa->band_grouping[i + 1]; + for ( j = brange[0]; j < brange[1]; j++ ) + { + for ( k = 0; k < nchan_inp; k++ ) + { + hMasa->data.energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; + } + } + } + + /* Compute FOA */ + /* W */ + mvr2r( Chnl_RealBuffer[0], Foa_RealBuffer[0], num_freq_bins ); + mvr2r( Chnl_ImagBuffer[0], Foa_ImagBuffer[0], num_freq_bins ); + for ( i = 1; i < nchan_inp; i++ ) + { + v_add( Chnl_RealBuffer[i], Foa_RealBuffer[0], Foa_RealBuffer[0], num_freq_bins ); + v_add( Chnl_ImagBuffer[i], Foa_ImagBuffer[0], Foa_ImagBuffer[0], num_freq_bins ); + } + + /* Y */ + v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[1][0], Foa_RealBuffer[1], num_freq_bins ); + v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[1][0], Foa_ImagBuffer[1], num_freq_bins ); + for ( i = 1; i < nchan_inp; i++ ) + { + v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[1][i], Foa_RealBuffer[1], num_freq_bins ); + v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[1][i], Foa_ImagBuffer[1], num_freq_bins ); + } + + /* Z */ + v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[2][0], Foa_RealBuffer[2], num_freq_bins ); + v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[2][0], Foa_ImagBuffer[2], num_freq_bins ); + for ( i = 1; i < nchan_inp; i++ ) + { + v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[2][i], Foa_RealBuffer[2], num_freq_bins ); + v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[2][i], Foa_ImagBuffer[2], num_freq_bins ); + } + + /* X */ + v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[3][0], Foa_RealBuffer[3], num_freq_bins ); + v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[3][0], Foa_ImagBuffer[3], num_freq_bins ); + for ( i = 1; i < nchan_inp; i++ ) + { + v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[3][i], Foa_RealBuffer[3], num_freq_bins ); + v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[3][i], Foa_ImagBuffer[3], num_freq_bins ); + } + + /* Direction estimation */ + computeIntensityVector_enc( hOMasa->band_grouping, Foa_RealBuffer, Foa_ImagBuffer, num_freq_bands, intensity_real ); + computeDirectionVectors( intensity_real[0], intensity_real[1], intensity_real[2], 0, num_freq_bands, direction_vector[0], direction_vector[1], direction_vector[2] ); + + /* Power estimation for diffuseness */ + computeReferencePower_omasa( hOMasa->band_grouping, Foa_RealBuffer, Foa_ImagBuffer, reference_power[ts], 0, num_freq_bands ); + + /* Fill buffers of length "averaging_length" time slots for intensity and energy */ + hOMasa->index_buffer_intensity = ( hOMasa->index_buffer_intensity % DIRAC_NO_COL_AVG_DIFF ) + 1; /* averaging_length = 32 */ + index = hOMasa->index_buffer_intensity; + for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) + { + /* only real part needed */ + mvr2r( intensity_real[i], &( hOMasa->buffer_intensity_real[i][index - 1][0] ), num_freq_bands ); + } + mvr2r( reference_power[ts], &( hOMasa->buffer_energy[( index - 1 ) * num_freq_bands] ), num_freq_bands ); + + computeDiffuseness( hOMasa->buffer_intensity_real, hOMasa->buffer_energy, num_freq_bands, diffuseness_vector ); + + for ( band_m_idx = 0; band_m_idx < hOMasa->nbands; band_m_idx++ ) + { + norm_tmp = reference_power[ts][band_m_idx] * ( 1 - diffuseness_vector[band_m_idx] ); + + hOMasa->direction_vector_m[0][block_m_idx][band_m_idx] += norm_tmp * direction_vector[0][band_m_idx]; + hOMasa->direction_vector_m[1][block_m_idx][band_m_idx] += norm_tmp * direction_vector[1][band_m_idx]; + hOMasa->direction_vector_m[2][block_m_idx][band_m_idx] += norm_tmp * direction_vector[2][band_m_idx]; + + diffuseness_m[band_m_idx] += reference_power[ts][band_m_idx] * diffuseness_vector[band_m_idx]; + renormalization_factor_diff[band_m_idx] += reference_power[ts][band_m_idx]; + } + } + + for ( band_m_idx = 0; band_m_idx < hOMasa->nbands; band_m_idx++ ) + { + for ( d = 0; d < DIRAC_NUM_DIMS; d++ ) + { + dir_v[d] = hOMasa->direction_vector_m[d][block_m_idx][band_m_idx]; + } + ivas_qmetadata_direction_vector_to_azimuth_elevation( dir_v, &azimuth_m_values[block_m_idx][band_m_idx], &elevation_m_values[block_m_idx][band_m_idx] ); + } + + /* Set coherences to zero, as this mode is used at lowest bit rates where the coherences are not transmitted */ + for ( band_m_idx = 0; band_m_idx < hOMasa->nbands; band_m_idx++ ) + { + spreadCoherence[block_m_idx][band_m_idx] = 0.0f; + surroundingCoherence[band_m_idx] = 0.0f; + } + } + + /* Determine energy ratios */ + for ( band_m_idx = 0; band_m_idx < hOMasa->nbands; band_m_idx++ ) + { + if ( renormalization_factor_diff[band_m_idx] > EPSILON ) + { + diffuseness_m[band_m_idx] /= renormalization_factor_diff[band_m_idx]; + } + else + { + diffuseness_m[band_m_idx] = 0.0f; + } + + energyRatio[band_m_idx] = 1.0f - diffuseness_m[band_m_idx]; + } + + /* Update memory */ + for ( i = 0; i < nchan_inp; i++ ) + { + mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); + } + + return; +} + + +/* Estimate energies and ratios */ +static void ivas_omasa_energy_and_ratio_est( + OMASA_ENC_HANDLE hOMasa, + MASA_ENCODER_HANDLE hMasa, + float data_f[][L_FRAME48k], + const int16_t input_frame, + const int16_t nchan_inp ) +{ + int16_t ts, i, j, k; + int16_t num_freq_bands; + int16_t l_ts; + float Chnl_RealBuffer[MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + float Chnl_ImagBuffer[MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + int16_t block_m_idx; + int16_t mrange[2], brange[2]; + float tftile_energy; + float ism_ratio_sum; + + num_freq_bands = hOMasa->nbands; + l_ts = input_frame / CLDFB_NO_COL_MAX; + + + /* Copy current frame to memory for delay compensation */ + for ( i = 0; i < nchan_inp; i++ ) + { + mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); + } + + /* do processing over all CLDFB time slots */ + for ( block_m_idx = 0; block_m_idx < hOMasa->nSubframes; block_m_idx++ ) + { + mrange[0] = hOMasa->block_grouping[block_m_idx]; + mrange[1] = hOMasa->block_grouping[block_m_idx + 1]; + + /* Reset variable */ + for ( i = 0; i < hOMasa->nbands; i++ ) + { + set_zero( hMasa->data.energy_ratio_ism[block_m_idx][i], nchan_inp ); + } + set_zero( hMasa->data.energy_ism[block_m_idx], num_freq_bands ); + + /* Compute CLDFB */ + for ( ts = mrange[0]; ts < mrange[1]; ts++ ) + { + for ( i = 0; i < nchan_inp; i++ ) + { + if ( ts < hOMasa->num_slots_delay_comp ) + { + cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); + } + else + { + cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); + } + } + + /* Compute energy */ + for ( i = 0; i < num_freq_bands; i++ ) + { + brange[0] = hOMasa->band_grouping[i]; + brange[1] = hOMasa->band_grouping[i + 1]; + for ( j = brange[0]; j < brange[1]; j++ ) + { + for ( k = 0; k < nchan_inp; k++ ) + { + tftile_energy = Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; + hMasa->data.energy_ism[block_m_idx][i] += tftile_energy; + hMasa->data.energy_ratio_ism[block_m_idx][i][k] += tftile_energy; + } + } + } + } + + /* Compute ISM energy ratios */ + for ( i = 0; i < num_freq_bands; i++ ) + { + ism_ratio_sum = 0.0f; + for ( j = 0; j < nchan_inp; j++ ) + { + hMasa->data.energy_ratio_ism[block_m_idx][i][j] /= ( hMasa->data.energy_ism[block_m_idx][i] + EPSILON ); + ism_ratio_sum += hMasa->data.energy_ratio_ism[block_m_idx][i][j]; + } + + if ( ism_ratio_sum == 0.0f ) + { + float temp_ism_ratio = 1.0f / ( (float) nchan_inp ); + for ( j = 0; j < nchan_inp; j++ ) + { + hMasa->data.energy_ratio_ism[block_m_idx][i][j] = temp_ism_ratio; + } + } + } + hMasa->data.nchan_ism = nchan_inp; + } + + /* Update memory */ + for ( i = 0; i < nchan_inp; i++ ) + { + mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); + } + + return; +} + + +/* Compute downmix */ +static void ivas_omasa_dmx( + float data_in_f[][L_FRAME48k], + float data_out_f[][L_FRAME48k], + const int16_t input_frame, + const int16_t num_transport_channels, + const int16_t num_input_channels, + ISM_METADATA_HANDLE hIsmMeta[], + float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], + const float interpolator[L_FRAME48k] ) +{ + int16_t i, j, k; + float azimuth, elevation; + float gains[MASA_MAX_TRANSPORT_CHANNELS]; + float g1, g2; + + if ( num_transport_channels == 2 ) + { + for ( i = 0; i < num_transport_channels; i++ ) + { + set_zero( data_out_f[i], input_frame ); + } + + for ( i = 0; i < num_input_channels; i++ ) + { + azimuth = hIsmMeta[i]->azimuth; + elevation = hIsmMeta[i]->elevation; + + ivas_get_stereo_panning_gains( azimuth, elevation, gains ); + + /* Downmix using the panning gains */ + for ( j = 0; j < num_transport_channels; j++ ) + { + if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0 ) + { + for ( k = 0; k < input_frame; k++ ) + { + g1 = interpolator[k]; + g2 = 1.0f - g1; + data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k]; + } + } + prev_gains[i][j] = gains[j]; + } + } + } + else if ( num_transport_channels == 1 ) + { + for ( i = 0; i < input_frame; i++ ) + { + data_out_f[0][i] = 0.0f; + for ( j = 0; j < num_input_channels; j++ ) + { + data_out_f[0][i] += data_in_f[j][i]; + } + } + } +} + + +static void computeIntensityVector_enc( + const int16_t *band_grouping, + float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], + const int16_t num_frequency_bands, + float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ) +{ + /* Reminder + * X = a + ib; Y = c + id + * X*Y = ac - bd + i(ad +bc) + */ + int16_t i, j; + float real, img; + int16_t brange[2]; + + for ( i = 0; i < num_frequency_bands; i++ ) + { + brange[0] = band_grouping[i]; + brange[1] = band_grouping[i + 1]; + + intensity_real[0][i] = 0; + intensity_real[1][i] = 0; + intensity_real[2][i] = 0; + + for ( j = brange[0]; j < brange[1]; j++ ) + { + real = Cldfb_RealBuffer[0][j]; + img = Cldfb_ImagBuffer[0][j]; + intensity_real[0][i] += Cldfb_RealBuffer[3][j] * real + Cldfb_ImagBuffer[3][j] * img; /* Intensity is XYZ order, audio is WYZX order. */ + intensity_real[1][i] += Cldfb_RealBuffer[1][j] * real + Cldfb_ImagBuffer[1][j] * img; + intensity_real[2][i] += Cldfb_RealBuffer[2][j] * real + Cldfb_ImagBuffer[2][j] * img; + } + } + + return; +} + +static void computeReferencePower_omasa( + const int16_t *band_grouping, /* i : Band grouping for estimation */ + float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ + float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ + float *reference_power, /* o : Estimated power */ + const int16_t enc_param_start_band, /* i : first band to process */ + const int16_t num_freq_bands /* i : Number of frequency bands */ +) +{ + int16_t brange[2]; + int16_t ch_idx, i, j; + + for ( i = 0; i < num_freq_bands; i++ ) + { + brange[0] = band_grouping[i + enc_param_start_band]; + brange[1] = band_grouping[i + enc_param_start_band + 1]; + reference_power[i] = 0; + + for ( ch_idx = 0; ch_idx < DIRAC_MAX_ANA_CHANS; ch_idx++ ) + { + /* abs()^2 */ + for ( j = brange[0]; j < brange[1]; j++ ) + { + reference_power[i] += ( Cldfb_RealBuffer[ch_idx][j] * Cldfb_RealBuffer[ch_idx][j] ) + ( Cldfb_ImagBuffer[ch_idx][j] * Cldfb_ImagBuffer[ch_idx][j] ); + } + } + } + + v_multc( reference_power, 0.5f, reference_power, num_freq_bands ); + + return; +} + +#endif /* MASA_AND_OBJECTS */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index c9f0bd70ff..1c9eef86e8 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -64,9 +64,15 @@ static int16_t ivas_qmetadata_entropy_encode_dir( BSTR_ENC_HANDLE hMetaData, IVA static int16_t ivas_qmetadata_raw_encode_dir( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const int16_t nbands, const int16_t start_band ); -static int16_t ivas_qmetadata_encode_extended_gr_length( const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); +#ifndef MASA_AND_OBJECTS +static +#endif + int16_t + ivas_qmetadata_encode_extended_gr_length( const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); +#ifndef MASA_AND_OBJECTS static void ivas_qmetadata_encode_extended_gr( BSTR_ENC_HANDLE hMetaData, const uint16_t value, const uint16_t alphabet_size, const int16_t gr_param ); +#endif static int16_t ivas_qmetadata_get_optimal_gr_param( uint16_t *unsigned_data, const int16_t count, const int16_t gr_param_count, int16_t *opt_gr_size ); @@ -118,6 +124,10 @@ static void transform_azimuth_dir2( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *d static int16_t calc_var_azi( const IVAS_QDIRECTION *q_direction, const int16_t diffuseness_index_max_ec_frame, const float avg_azimuth, float *avg_azimuth_out ); +#ifdef MASA_AND_OBJECTS +static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line ); +#endif + /*-----------------------------------------------------------------------* * ivas_qmetadata_enc_encode() * @@ -2408,11 +2418,14 @@ static int16_t ivas_qmetadata_get_optimal_gr_param( * * *------------------------------------------------------------------------*/ - -static int16_t ivas_qmetadata_encode_extended_gr_length( - const uint16_t value, - const uint16_t alphabet_size, - const int16_t gr_param ) +#ifndef MASA_AND_OBJECTS +static +#endif + int16_t + ivas_qmetadata_encode_extended_gr_length( + const uint16_t value, + const uint16_t alphabet_size, + const int16_t gr_param ) { uint16_t msb_alphabet_size; int16_t bits; @@ -2551,12 +2564,15 @@ static int16_t ivas_qmetadata_reorder_azimuth_index( * * *------------------------------------------------------------------------*/ - -static void ivas_qmetadata_encode_extended_gr( - BSTR_ENC_HANDLE hMetaData, - const uint16_t value, - const uint16_t alphabet_size, - const int16_t gr_param ) +#ifndef MASA_AND_OBJECTS +static +#endif + void + ivas_qmetadata_encode_extended_gr( + BSTR_ENC_HANDLE hMetaData, + const uint16_t value, + const uint16_t alphabet_size, + const int16_t gr_param ) { uint16_t msb_alphabet_size; uint16_t msb, lsb, cnt; @@ -4905,3 +4921,271 @@ static float direction_distance( return d / (float) ( dim1 * dim2 ); } #endif +#ifdef MASA_AND_OBJECTS +static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line ) +{ + int16_t nb_bits = 0, bits_pos; + int16_t last_non_null; + uint16_t nb_GR_min, i_min, nb_GR; + int16_t i, j; + + bits_pos = hMetaData->nb_bits_tot; + /* write DCT 0 component */ + /* write sign only if not the very first DCT coeff */ + if ( first_line == 0 ) + { + if ( q_idx[0] > 0 ) + { + push_next_indice( hMetaData, 1, 1 ); + push_next_indice( hMetaData, q_idx[0], BITS_MASA2TOTTAL_DCT0 ); /* Todo : define constant */ + } + else + { + push_next_indice( hMetaData, 0, 1 ); + push_next_indice( hMetaData, -q_idx[0], BITS_MASA2TOTTAL_DCT0 ); + } + nb_bits += BITS_MASA2TOTTAL_DCT0 + 1; + } + else + { + push_next_indice( hMetaData, q_idx[0], BITS_MASA2TOTTAL_DCT0 ); + nb_bits += BITS_MASA2TOTTAL_DCT0; + } + + + /* find last non-null position */ + last_non_null = -1; + if ( q_idx[0] != 0 ) + { + last_non_null = len_stream - 1; + while ( ( q_idx[last_non_null] == 0 ) && ( last_non_null >= 0 ) ) + { + last_non_null--; + } + } + if ( last_non_null == -1 ) + { + /* all values are zero; no need to send anything else */ + assert( q_idx[0] == 0 ); + } + else + { + assert( q_idx[0] != 0 ); + /*last_non_null = max(4, last_non_null); */ + + /* write index of last non null index on log2(len_stream) bits */ + j = (int16_t) ceilf( log2f( (float) ( len_stream ) ) ); + push_next_indice( hMetaData, last_non_null, j ); + nb_bits += j; + if ( last_non_null > 0 ) + { + /* find optimum length of the part encoded with GR2 */ + nb_GR_min = 1000; + i_min = 0; + for ( i = 1; i <= last_non_null; i++ ) + { + nb_GR = 0; + for ( j = 1; j <= i; j++ ) + { + nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 2 ); + } + for ( j = i + 1; j <= last_non_null; j++ ) + { + nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 0 ); + } + if ( nb_GR < nb_GR_min ) + { + nb_GR_min = nb_GR; + i_min = i; + } + } + + assert( nb_GR_min < 1000 ); + + + /* write number of indexes encoded with GR2 */ + j = (int16_t) ceilf( log2f( (float) ( last_non_null + 1 ) ) ); + assert( i_min < ( 1 << j ) ); + push_next_indice( hMetaData, i_min, j ); + nb_bits += j; + + /* write GR data */ + for ( i = 1; i <= i_min; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, 2 ); + } + for ( i = i_min + 1; i <= last_non_null; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, 0 ); + } + nb_bits += nb_GR_min; + } + assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); + } + return nb_bits; +} + +void encode_masa_to_total( + IVAS_QMETADATA_HANDLE hQMetaData, + BSTR_ENC_HANDLE hMetaData ) +{ + int16_t i, j, k; + float data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + + + float step = 0.1f; + int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + float dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + float dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; + int16_t nbands; + + int16_t bits_pos, nb_bits; + int16_t n_streams, len_stream; + + nbands = hQMetaData->numCodingBands; +#ifdef DEBUG_MODE_QMETADATA + static FILE *pF = NULL; + static FILE *pF_ratio = NULL; + + if ( pF == NULL ) + pF = fopen( "./res/qmetadata_ism_qidx__enc.txt", "w" ); + if ( pF_ratio == NULL ) + pF_ratio = fopen( "./res/qmetadata_masa2tot_enc.txt", "w" ); + +#endif + +#ifdef DEBUGGING + assert( ( nbands == 5 || nbands == 8 ) && "Number of subbands in parametric MASA_ISM should be 5 or 8 " ); +#endif + bits_pos = hMetaData->nb_bits_tot; + k = 0; + for ( i = 0; i < nbands; i++ ) + { + for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) + { + data[k] = hQMetaData->masa_to_total_energy_ratio[j][i]; + k++; + } + } + + + /* DCT2 transform */ + if ( nbands == 5 ) + { + matrix_product( dct5, nbands, nbands, 0, data, MAX_PARAM_SPATIAL_SUBFRAMES, nbands, 1, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 1, dct_data ); + } + else + { + matrix_product( dct8, nbands, nbands, 0, data, MAX_PARAM_SPATIAL_SUBFRAMES, nbands, 1, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 1, dct_data ); + } + + /* Setup coding parameters */ + if ( nbands == 5 ) + { + n_streams = 1; + len_stream = nbands * MAX_PARAM_SPATIAL_SUBFRAMES; + } + else + { + n_streams = MAX_PARAM_SPATIAL_SUBFRAMES; + len_stream = 8; + } + + for ( k = 0; k < n_streams; k++ ) + { + j = k * len_stream; + /* quantize with fixed common step */ + q_idx[j] = (int16_t) rintf( dct_data[j] / step ); + + if ( q_idx[j] > ( ( 1 << BITS_MASA2TOTTAL_DCT0 ) - 1 ) ) /* limit DCT0 to BITS_MASA2TOTTAL_DCT0 bit representation */ + { + q_idx[j] = ( ( 1 << BITS_MASA2TOTTAL_DCT0 ) - 1 ); + } + q_dct_data[j] = step * q_idx[j]; + if ( q_idx[j] == 0 ) + { + set_s( &q_idx[j], 0, len_stream ); + set_zero( &q_dct_data[j], len_stream ); + } + else + { + for ( i = 1; i < len_stream; i++ ) + { + q_idx[j + i] = (int16_t) rintf( dct_data[j + i] / step ); + q_dct_data[j + i] = step * q_idx[j + i]; + if ( q_idx[j + i] <= 0 ) + { + q_idx[j + i] = -2 * q_idx[j + i]; + } + else + { + q_idx[j + i] = 2 * q_idx[j + i] - 1; + } + } + } + } + + + /* reconstruct masa2total */ + /* inverse DCT2 transform */ + if ( nbands == 5 ) + { + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); /* reuse of variable*/ + } + else + { + assert( nbands == 8 ); + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); + } + k = 0; + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + for ( j = 0; j < nbands; j++ ) + { + hQMetaData->masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); + hQMetaData->masa_to_total_energy_ratio[i][j] = min( 1.0f, hQMetaData->masa_to_total_energy_ratio[i][j] ); + k++; + } + } + + /* write data */ + nb_bits = 0; + for ( i = 0; i < n_streams; i++ ) + { + nb_bits += write_stream_dct_coeffs_omasa( &q_idx[i * len_stream], len_stream, hMetaData, ( i == 0 ) ); + } + + assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); + +#ifdef DEBUG_MODE_QMETADATA + { + + fprintf( pF, "frame %d: ", frame ); + fprintf( pF_ratio, "frame %d: ", frame ); + + + /* direction_distance( elevation_orig, azimuth_orig, q_direction, nbands, nblocks, mat_dist );*/ + for ( i = 0; i < nbands; i++ ) + { + for ( j = 0; j < 4; j++ ) + { + fprintf( pF_ratio, " %5.2f ", hQMetaData->masa_to_total_energy_ratio[j][i] ); + } + } + for ( i = 0; i < 20; i++ ) + { + fprintf( pF, " %4d ", q_idx[i] ); + } + fprintf( pF, "\n" ); + fprintf( pF_ratio, "\n" ); + } +#endif + + return; +} +#endif diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index ba0c27ddd1..e33bdbb078 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -144,7 +144,11 @@ ivas_error ivas_sce_enc( /* set "bits_frame_nominal" */ if ( st_ivas->hQMetaData != NULL && st_ivas->hSpar == NULL ) { +#ifdef MASA_AND_OBJECTS + if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_ONE_OBJ ) ) +#else if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) +#endif { st->bits_frame_nominal = (int16_t) ( hSCE->element_brate / FRAMES_PER_SEC ); } @@ -330,6 +334,12 @@ ivas_error create_sce_enc( } copy_encoder_config( st_ivas, st, 1 ); +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ism_mode >= ISM_MASA_MODE_PARAM ) + { + st->element_mode = IVAS_SCE; /* To do: Nokia check as this is not optimal and verify if it influences other SCE modes */ + } +#endif 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; diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 0644fcd918..a76ddf692a 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -713,6 +713,13 @@ typedef struct ivas_param_mc_enc_data_structure typedef struct ivas_masa_encoder_data_struct { float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; +#ifdef MASA_AND_OBJECTS + float energy_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; /* TODO Nokia: Make an own MASAISM struct for these, and reserve it only for OMASA */ + float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; + int16_t nchan_ism; + +#endif int16_t num_Cldfb_instances; HANDLE_CLDFB_FILTER_BANK cldfbAnaEnc[MAX_NUM_ENC_CLDFB_INSTANCES]; float *delay_buffer[MASA_MAX_TRANSPORT_CHANNELS]; @@ -796,6 +803,52 @@ typedef struct ivas_mcmasa_enc_data_structure } MCMASA_ENC_DATA, *MCMASA_ENC_HANDLE; +#ifdef MASA_AND_OBJECTS +/*----------------------------------------------------------------------------------* + * Object MASA (OMASA) encoder structure + *----------------------------------------------------------------------------------*/ + +typedef struct ivas_omasa_enc_data_structure +{ + int16_t nbands; + int16_t nCodingBands; + int16_t nSubframes; + + /* delay compensation */ + float *delay_buffer[MAX_NUM_OBJECTS]; /* Delay buffer for parameter estimation */ + int16_t num_samples_delay_comp; + int16_t num_slots_delay_comp; + int16_t offset_comp; + + /* CLDFB analysis */ + int16_t num_Cldfb_instances; + HANDLE_CLDFB_FILTER_BANK cldfbAnaEnc[MAX_NUM_OBJECTS]; + + /* DirAC parameter estimation */ + float **direction_vector_m[DIRAC_NUM_DIMS]; /* Average direction vector */ + int16_t band_grouping[MASA_FREQUENCY_BANDS + 1]; + int16_t block_grouping[5]; + + /* diffuseness */ + int16_t index_buffer_intensity; + float *buffer_intensity_real[DIRAC_NUM_DIMS][DIRAC_NO_COL_AVG_DIFF]; + float buffer_energy[DIRAC_NO_COL_AVG_DIFF * MASA_FREQUENCY_BANDS]; + + float chnlToFoaMtx[DIRAC_MAX_ANA_CHANS][MCMASA_MAX_ANA_CHANS]; + + float interpolator[L_FRAME48k]; + + float prev_object_dm_gains[MAX_NUM_OBJECTS][MASA_MAX_TRANSPORT_CHANNELS]; + float broadband_energy_sm[MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS]; + float broadband_energy_prev[MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS]; + int16_t prev_selected_object; + uint8_t changing_object; + float fade_out_gain[L_FRAME48k]; + float fade_in_gain[L_FRAME48k]; + +} OMASA_ENC_DATA, *OMASA_ENC_HANDLE; +#endif + /*----------------------------------------------------------------------------------* * Stereo CNG handle @@ -1027,6 +1080,9 @@ typedef struct /* high-level encoder parameters */ int16_t nchan_transport; /* number of transport channels */ +#ifdef MASA_AND_OBJECTS + int16_t nchan_ism; +#endif int16_t sba_analysis_order; /* Ambisonic (SBA) order used for analysis and coding */ int16_t codec_mode; /* Mode1 or Mode2 of core codec */ int16_t last_codec_mode; /* previous frame Mode 1 or 2 */ @@ -1048,6 +1104,9 @@ typedef struct MCT_ENC_HANDLE hMCT; /* MCT handle */ PARAM_MC_ENC_HANDLE hParamMC; /* Parametric MC handle */ MCMASA_ENC_HANDLE hMcMasa; /* Multi-channel MASA data handle */ +#ifdef MASA_AND_OBJECTS + OMASA_ENC_HANDLE hOMasa; /* Object MASA data handle */ +#endif LFE_ENC_HANDLE hLFE; /* LFE data handle */ ISM_MODE ism_mode; /* ISM format mode */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index b3f8dc478d..c3b526f1b2 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -351,6 +351,64 @@ ivas_error IVAS_ENC_ConfigureForStereo( return error; } +#ifdef MASA_AND_OBJECTS +/*---------------------------------------------------------------------* + * IVAS_ENC_ConfigureForMASAObjects() + * + * Configure and initialize the combined MASA and ISM encoder. + *---------------------------------------------------------------------*/ + +ivas_error IVAS_ENC_ConfigureForMASAObjects( + IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ + const int32_t inputFs, /* i : input sampling frequency */ + const int32_t bitrate, /* i : requested bitrate of the ouput bitstream */ + 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 */ + const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ +) +{ + Encoder_Struct *st_ivas; + ivas_error error; + + if ( ( error = doCommonConfigureChecks( hIvasEnc ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( numObjects > MAX_NUM_OBJECTS ) + { + return IVAS_ERR_TOO_MANY_INPUTS; + } + st_ivas = hIvasEnc->st_ivas; + switch ( masaVariant ) + { + case IVAS_ENC_MASA_1CH: + st_ivas->hEncoderConfig->nchan_inp = 1 + numObjects; + st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ + break; + case IVAS_ENC_MASA_2CH: + st_ivas->hEncoderConfig->nchan_inp = 2 + numObjects; + st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ + break; + default: + return IVAS_ERR_INVALID_MASA_CONFIG; + break; + } + + st_ivas = hIvasEnc->st_ivas; + + /* Currently this is true but it is already shown in descriptive metadata that there can be inequality for this. */ + st_ivas->nchan_transport = st_ivas->hEncoderConfig->nchan_inp - numObjects; + + + st_ivas->hEncoderConfig->ivas_format = MASA_ISM_FORMAT; + + st_ivas->nchan_ism = numObjects; + + return configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); +} +#endif /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForObjects() @@ -418,8 +476,11 @@ ivas_error IVAS_ENC_FeedObjectMetadata( { return IVAS_ERR_NOT_CONFIGURED; } - +#ifdef MASA_AND_OBJECTS + if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) +#else if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT ) +#endif { return IVAS_ERR_METADATA_NOT_EXPECTED; } @@ -574,8 +635,11 @@ ivas_error IVAS_ENC_FeedMasaMetadata( { return IVAS_ERR_NOT_CONFIGURED; } - +#ifdef MASA_AND_OBJECTS + if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) +#else if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_FORMAT ) +#endif { return IVAS_ERR_METADATA_NOT_EXPECTED; } @@ -662,7 +726,9 @@ static ivas_error configureEncoder( Encoder_Struct *st_ivas; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; - +#ifdef MASA_AND_OBJECTS + int32_t cpe_brate; +#endif error = IVAS_ERR_OK; st_ivas = hIvasEnc->st_ivas; @@ -803,6 +869,24 @@ static ivas_error configureEncoder( } } } + +#ifdef MASA_AND_OBJECTS + else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + st_ivas->ism_mode = ivas_omasa_ism_mode_select( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_ism ); + + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_ism ); + + /*adapt element_mode according to the bit-rate*/ + if ( hEncoderConfig->element_mode_init != IVAS_SCE ) + { + if ( cpe_brate >= IVAS_48k ) + { + hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; + } + } + } +#endif } else /* EVS mono */ { @@ -1576,7 +1660,12 @@ static ivas_error printConfigInfo_enc( fprintf( stdout, "IVAS mode: Multi-Channel 7.1+4\n" ); } } - +#ifdef MASA_AND_OBJECTS + else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + fprintf( stdout, "IVAS format: MASA and objects format\n" ); + } +#endif /*-----------------------------------------------------------------* * Print CNG update interval, if DTX is activated *-----------------------------------------------------------------*/ diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index dbcb21c989..d66e58e1dd 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -52,6 +52,9 @@ typedef enum _IVAS_ENC_INPUT_FORMAT IVAS_ENC_INPUT_SBA, IVAS_ENC_INPUT_MASA, IVAS_ENC_INPUT_MC, +#ifdef MASA_AND_OBJECTS + IVAS_ENC_INPUT_MASA_ISM, +#endif IVAS_DEC_INPUT_UNKNOWN = 0xffff } IVAS_ENC_INPUT_FORMAT; @@ -96,6 +99,14 @@ typedef enum _IVAS_ENC_MASA_VARIANT IVAS_ENC_MASA_UNDEFINED = 0xffff } IVAS_ENC_MASA_VARIANT; +#ifdef MASA_AND_OBJECTS +typedef enum _IVAS_ENC_COMBINED_FORMAT +{ + IVAS_ENC_MASA_ISM = 1, + IVAS_ENC_COMBINED_UNDEFINED = 0xffff +} IVAS_ENC_COMBINED_FORMAT; +#endif + #ifdef DEBUGGING typedef enum _IVAS_ENC_STEREO_MODE { @@ -185,6 +196,19 @@ ivas_error IVAS_ENC_ConfigureForObjects( const uint16_t numObjects /* i : number of objects to be encoded */ ); +#ifdef MASA_AND_OBJECTS +/*! r: encoder error code */ +ivas_error IVAS_ENC_ConfigureForMASAObjects( + IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ + const int32_t inputFs, /* i : input sampling frequency */ + const int32_t bitrate, /* i : requested bitrate of the ouput bitstream */ + 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 */ + const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ +); +#endif + /*! r: error code */ ivas_error IVAS_ENC_ConfigureForAmbisonics( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index e5407abff4..a69b72f9ce 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -330,8 +330,13 @@ void ivas_renderer_select( } } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) +#else else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) +#endif { + *internal_config = output_config; if ( output_config == AUDIO_CONFIG_BINAURAL ) { @@ -565,6 +570,21 @@ void ivas_renderer_select( } } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + *renderer_type = RENDERER_DIRAC; + + if ( output_config == AUDIO_CONFIG_MONO ) + { + *renderer_type = RENDERER_MONO_DOWNMIX; + } + else if ( output_config == AUDIO_CONFIG_STEREO ) + { + *renderer_type = RENDERER_STEREO_PARAMETRIC; + } + } +#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { *internal_config = transport_config; -- GitLab From 54394aba7ffb008a6ab7e79db57bed56cb42573f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhold=20B=C3=B6hm?= Date: Thu, 22 Dec 2022 11:52:34 +0100 Subject: [PATCH 0005/1418] added CLDFB codec implementation --- Workspace_msvc/lib_rend.vcxproj | 15 +- Workspace_msvc/renderer.vcxproj | 6 +- lib_com/ivas_prot.h | 9 +- lib_dec/ivas_stat_dec.h | 20 + lib_rend/ivas_cldfb_trans_codec/Bitstream.c | 226 +++ lib_rend/ivas_cldfb_trans_codec/Bitstream.h | 62 + lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c | 912 +++++++++++ lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h | 32 + lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c | 1226 ++++++++++++++ lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h | 33 + lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c | 1457 +++++++++++++++++ lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h | 305 ++++ lib_rend/ivas_cldfb_trans_codec/NoiseGen.c | 47 + lib_rend/ivas_cldfb_trans_codec/NoiseGen.h | 35 + .../ivas_cldfb_trans_codec/PerceptualModel.c | 160 ++ .../ivas_cldfb_trans_codec/PerceptualModel.h | 18 + .../ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c | 31 + .../ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h | 25 + .../ivas_cldfb_trans_codec/RMSEnvGrouping.c | 378 +++++ .../ivas_cldfb_trans_codec/RMSEnvGrouping.h | 31 + lib_rend/ivas_cldfb_trans_codec/Tables.c | 116 ++ lib_rend/ivas_cldfb_trans_codec/Tables.h | 65 + lib_rend/ivas_splitRend_lcld_dec.c | 111 +- lib_rend/ivas_splitRend_lcld_enc.c | 127 +- lib_rend/ivas_splitRendererPre.c | 20 +- lib_rend/lib_rend.c | 10 +- 26 files changed, 5453 insertions(+), 24 deletions(-) create mode 100644 lib_rend/ivas_cldfb_trans_codec/Bitstream.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/Bitstream.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/NoiseGen.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/NoiseGen.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h create mode 100644 lib_rend/ivas_cldfb_trans_codec/Tables.c create mode 100644 lib_rend/ivas_cldfb_trans_codec/Tables.h diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index af88421f8b..0cef2758b9 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -89,7 +89,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -126,7 +126,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) @@ -169,7 +169,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true @@ -197,6 +197,15 @@ + + + + + + + + + diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj index 6ca03f67dd..250d5c6025 100644 --- a/Workspace_msvc/renderer.vcxproj +++ b/Workspace_msvc/renderer.vcxproj @@ -86,7 +86,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;..\lib_rend\ivas_cldfb_trans_codec;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) EnableFastChecks @@ -130,7 +130,7 @@ Disabled - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;..\lib_rend\ivas_cldfb_trans_codec;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;WIN32;$(Macros);%(PreprocessorDefinitions) @@ -180,7 +180,7 @@ Neither false false - ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;..\lib_rend\ivas_cldfb_trans_codec;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);%(PreprocessorDefinitions) true diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index fea2bef693..62050015c6 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4680,7 +4680,10 @@ void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend); ivas_error ivas_splitBinLCLDEncOpen( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ); + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, + int32_t iSampleRate, + int32_t iChannels, + int32_t iDataRate ); void ivas_splitBinLCLDEncClose( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ); @@ -4692,7 +4695,9 @@ void ivas_splitBinLCLDEncProcess( ivas_split_rend_bits_t *pBits ); ivas_error ivas_splitBinLCLDDecOpen( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ); + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, + int32_t iSampleRate, + int32_t iChannels ); void ivas_splitBinLCLDDecClose( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 0b346d0036..65d2af32f9 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -42,6 +42,10 @@ #include "ivas_stat_rend.h" #include "common_api_types.h" // VE2AT: don't we want to avoid this include in the library? I admit that the rules hefre are not 100% clear to me but introducing it just for IVAS_QUATERNION is not necessry I think +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "ivas_cldfb_trans_codec/CQMFEncoder.h" +#include "ivas_cldfb_trans_codec/CQMFDecoder.h" +#endif /*----------------------------------------------------------------------------------* * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) @@ -1344,11 +1348,27 @@ typedef struct ivas_binaural_head_rot_split_post_rendering_struct typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct { void *pLcld_enc; + int32_t iChannels; + CQMFEncoder *psCQMFEncoder; + float ***pppfCQMFReal; + float ***pppfCQMFImag; +#ifdef CLDFB_DEBUG + FILE *cldfbIn; + int numFrame; +#endif } BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct { void *pLcld_dec; + int32_t iChannels; + CQMFDecoder *psCQMFDecoder; + float ***pppfDecCQMFReal; + float ***pppfDecCQMFImag; +#ifdef CLDFB_DEBUG + FILE *cldfbOut; + int numFrame; +#endif } BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; typedef struct diff --git a/lib_rend/ivas_cldfb_trans_codec/Bitstream.c b/lib_rend/ivas_cldfb_trans_codec/Bitstream.c new file mode 100644 index 0000000000..e542fcb15e --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/Bitstream.c @@ -0,0 +1,226 @@ +#include "Bitstream.h" + +#include +#include +#include "wmops.h" + +#define MAX_BUFFER 1024 + +static const unsigned int MASKS[] = +{ + 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, + 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, + 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, + 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, +}; + +Bitstream* CreateBitstream(const int iDirection, + const int iMaxBuffer) + +{ + + int n; + Bitstream *psBitstream; + + psBitstream = (Bitstream*)malloc(sizeof(Bitstream)); + + psBitstream->iDirection =iDirection; + psBitstream->iMaxBuffer = iMaxBuffer; + psBitstream->iIndex = 0; + psBitstream->iBufferEnd = 0; + psBitstream->iBufferStart = 0; + psBitstream->iError = BS_ERROR_NONE; + + if(psBitstream->iMaxBuffer == -1){ + psBitstream->iMaxBuffer = MAX_BUFFER; + } + + psBitstream->puchBuffer = (unsigned char*)malloc(sizeof(unsigned char) * psBitstream->iMaxBuffer); + + for(n = 0; n < psBitstream->iMaxBuffer; n ++){ + psBitstream->puchBuffer[n] = 0; + } + + return psBitstream; +} + +void DeleteBitstream(Bitstream *psBitstream) +{ + free(psBitstream->puchBuffer); + free(psBitstream); +} + +void BSFlushBuffer(Bitstream *psBitstream) +{ + memset(psBitstream->puchBuffer,0,psBitstream->iMaxBuffer); + psBitstream->iIndex = 0; + psBitstream->iBufferEnd = 0; + psBitstream->iBufferStart = 0; + psBitstream->iError = BS_ERROR_NONE; +} + +int BSPutBytes(Bitstream *psBitstream, + const unsigned char *puchBytes, + const int iByteCount) +{ + int n; + for(n = 0; n < iByteCount; n ++){ + psBitstream->puchBuffer[psBitstream->iBufferEnd] = puchBytes[n]; + psBitstream->iBufferEnd ++; + } + if(psBitstream->iDirection != BS_READ){ + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int BSGetBytes(Bitstream *psBitstream, + unsigned char *puchBytes, + int iByteCount) +{ + int n; + for(n = 0; n < iByteCount; n++){ + puchBytes[n] = psBitstream->puchBuffer[psBitstream->iBufferStart]; + psBitstream->puchBuffer[psBitstream->iBufferStart] = 0; + psBitstream->iBufferStart ++; + } + if(psBitstream->iDirection != BS_WRITE){ + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int BSByteAlign(Bitstream *psBitstream) +{ + if(psBitstream->iDirection == BS_WRITE){ + if(psBitstream->iIndex & 0x7){ + int iByte; + int iRem; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - (psBitstream->iIndex - (iByte<<3)); + psBitstream->puchBuffer[iByte] &= (0xff ^ MASKS[iRem]); + psBitstream->iIndex += iRem; + } + } + else{ + if(psBitstream->iIndex & 0x7){ + int iByte; + int iRem; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - (psBitstream->iIndex - (iByte<<3)); + psBitstream->iIndex += iRem; + } + } + + return psBitstream->iError; +} + +int BSPutBits(Bitstream *psBitstream, + int iValue, + int iBitCount) +{ + iValue &= MASKS[iBitCount]; + while(iBitCount){ + int iByte; + int iRem; + int iShift; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - (psBitstream->iIndex - (iByte<<3)); //8 - psBitstream->iIndex & 0x7; + + iShift = iBitCount-iRem; + if(iShift <= 0){ + iShift *= -1; + psBitstream->puchBuffer[iByte] += (unsigned char) (iValue<iIndex += iBitCount; + iBitCount = 0; + } + else{ + psBitstream->puchBuffer[iByte] += (unsigned char) (iValue>>iShift); + iValue &= MASKS[iShift]; + psBitstream->iIndex += iRem; + iBitCount -= iRem; + } + } + + if(psBitstream->iDirection != BS_WRITE){ + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int BSGetBits(Bitstream *psBitstream, + int iBitCount) +{ + int iValue = 0; + + while(iBitCount){ + unsigned char uchByte; + int iByte; + int iRem; + int iShift; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - (psBitstream->iIndex - (iByte << 3)); //8 - psBitstream->iIndex & 0x7; + uchByte = psBitstream->puchBuffer[iByte]; + iShift = iBitCount - iRem; + + if(iShift <= 0){ + iShift *= -1; + iValue += (int)((uchByte >> iShift) & MASKS[iBitCount]); + psBitstream->iIndex += iBitCount; + iBitCount = 0; + } + else{ + uchByte &= MASKS[iRem]; + iValue += (((int)uchByte)<iIndex += iRem; + iBitCount -= iRem; + } + } + + if(psBitstream->iDirection != BS_READ){ + psBitstream->iError = BS_ERROR_FAIL; + } + + return iValue; +} + +int BSForceBack(Bitstream *psBitstream, + int iValue, + int iBitCount) +{ + psBitstream->iIndex -= iBitCount; + return (iValue>>iBitCount); +} + +int BSGetByteCount(Bitstream *psBitstream) +{ + int iBytes; + iBytes = psBitstream->iIndex>>3; + if((iBytes << 3) != psBitstream->iIndex){ + iBytes ++; + } + + return iBytes; +} + +unsigned char* BSGetBuffer(Bitstream *psBitstream) +{ + return psBitstream->puchBuffer; +} + +int BSGetAvailableBytes(Bitstream *psBitstream) +{ + return psBitstream->iBufferEnd; +} + +int BSGetError(Bitstream *psBitstream) +{ + return psBitstream->iError; +} diff --git a/lib_rend/ivas_cldfb_trans_codec/Bitstream.h b/lib_rend/ivas_cldfb_trans_codec/Bitstream.h new file mode 100644 index 0000000000..a3e936e59b --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/Bitstream.h @@ -0,0 +1,62 @@ +#ifndef _BITSTREAM_H_ +#define _BITSTREAM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum{BS_READ,BS_WRITE}; +enum{BS_ERROR_NONE,BS_ERROR_FAIL}; + +typedef struct BITSTREAM{ + int iMaxBuffer; + int iDirection; + int iBufferEnd; + int iBufferStart; + int iIndex; + int iError; + unsigned char *puchBuffer; +}Bitstream; + + +Bitstream* CreateBitstream(const int iDirection, + const int iMaxBuffer); + +void DeleteBitstream(Bitstream *psBitstream); + +void BSFlushBuffer(Bitstream *psBitstream); + +int BSPutBytes(Bitstream *psBitstream, + const unsigned char *puchBytes, + const int iByteCount); + +int BSGetBytes(Bitstream *psBitstream, + unsigned char *puchBytes, + int iByteCount); + +int BSByteAlign(Bitstream *psBitstream); + +int BSPutBits(Bitstream *psBitstream, + int iValue, + int iBitCount); + +int BSGetBits(Bitstream *psBitstream, + int iBitCount); + +int BSForceBack(Bitstream *psBitstream, + int iValue, + int iBitCount); + +unsigned char* BSGetBuffer(Bitstream *psBitstream); + +int BSGetByteCount(Bitstream *psBitstream); + +int BSGetAvailableBytes(Bitstream *psBitstream); + +int BSGetError(Bitstream *psBitstream); + +#ifdef __cplusplus +} +#endif + +#endif /* _BITSTREAM_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c new file mode 100644 index 0000000000..40d627e612 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c @@ -0,0 +1,912 @@ +#include "CQMFDecoder.h" + +#include +#include +#include +#include +#include "Tables.h" +#include "wmops.h" +#include "PerceptualModel.h" +#include "RMSEnvDeltaHuff.h" +#include "CQMFHuff.h" +#include "NoiseGen.h" +#include "Bitstream.h" + +typedef struct CQMF_DECODER{ + int iSampleRate; + int iChannels; + int iNumBlocks; + + int iNumBands; + const int *piBandwidths; + + int iMSMode; + int *piMSFlags; + + int iCommonGrouping; + int *piNumGroups; + int **ppiGroupLengths; + + int ***pppiRMSEnvelope; + int ***pppiSMR; + int ***pppiExcitation; + int ***pppiAlloc; + + int iAllocOffset; + + int ***pppiCQMFSignReal; + int ***pppiCQMFSignImag; + int ***pppiQCQMFReal; + int ***pppiQCQMFImag; + + Bitstream *psBSRead; + + NoiseGen *psNoiseGen; + + int iLastError; +}CQMFDecoder; + +CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, + const int iChannels) +{ + int n; + CQMFDecoder *psCQMFDecoder = NULL; + + assert(iSampleRate == 48000); //Fix + + psCQMFDecoder = (CQMFDecoder*)malloc(sizeof(CQMFDecoder)); + psCQMFDecoder->iSampleRate = iSampleRate; + psCQMFDecoder->iChannels = iChannels; + psCQMFDecoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; + psCQMFDecoder->iAllocOffset = 0; + + psCQMFDecoder->iNumBands = MAX_BANDS_48; //Fix + psCQMFDecoder->piBandwidths = c_aiBandwidths48; //Fix + + psCQMFDecoder->iMSMode = 0; + psCQMFDecoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); + + psCQMFDecoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo + psCQMFDecoder->piNumGroups = (int*)malloc(psCQMFDecoder->iChannels * sizeof(int)); + psCQMFDecoder->ppiGroupLengths = (int**)malloc(psCQMFDecoder->iChannels * sizeof(int*)); + psCQMFDecoder->pppiRMSEnvelope = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiSMR = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiExcitation = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiAlloc = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + + psCQMFDecoder->pppiCQMFSignReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiCQMFSignImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiQCQMFReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiQCQMFImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + for(n = 0; n < iChannels ; n ++){ + int k; + psCQMFDecoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); + psCQMFDecoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + + psCQMFDecoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + psCQMFDecoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + + psCQMFDecoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + } + } + + psCQMFDecoder->psBSRead = CreateBitstream(BS_READ,4096); + + psCQMFDecoder->psNoiseGen = NULL;//CreateNoiseGen(); // No noise fill for now + + psCQMFDecoder->iLastError = DECODER_ERROR_NONE; + + return psCQMFDecoder; +} + +void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) +{ + if(psCQMFDecoder != NULL){ + + if(psCQMFDecoder->piMSFlags != NULL){ + free(psCQMFDecoder->piMSFlags); + } + + if(psCQMFDecoder->piNumGroups != NULL){ + free(psCQMFDecoder->piNumGroups); + } + + if(psCQMFDecoder->ppiGroupLengths != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + free(psCQMFDecoder->ppiGroupLengths[n]); + } + free(psCQMFDecoder->ppiGroupLengths); + } + + if(psCQMFDecoder->pppiRMSEnvelope != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiRMSEnvelope[n][k]); + } + free(psCQMFDecoder->pppiRMSEnvelope[n]); + } + free(psCQMFDecoder->pppiRMSEnvelope); + } + + if(psCQMFDecoder->pppiSMR != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiSMR[n][k]); + } + free(psCQMFDecoder->pppiSMR[n]); + } + free(psCQMFDecoder->pppiSMR); + } + + if(psCQMFDecoder->pppiExcitation != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiExcitation[n][k]); + } + free(psCQMFDecoder->pppiExcitation[n]); + } + free(psCQMFDecoder->pppiExcitation); + } + + if(psCQMFDecoder->pppiAlloc != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiAlloc[n][k]); + } + free(psCQMFDecoder->pppiAlloc[n]); + } + free(psCQMFDecoder->pppiAlloc); + } + + if(psCQMFDecoder->pppiCQMFSignReal != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiCQMFSignReal[n][k]); + } + free(psCQMFDecoder->pppiCQMFSignReal[n]); + } + free(psCQMFDecoder->pppiCQMFSignReal); + } + + if(psCQMFDecoder->pppiCQMFSignImag != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiCQMFSignImag[n][k]); + } + free(psCQMFDecoder->pppiCQMFSignImag[n]); + } + free(psCQMFDecoder->pppiCQMFSignImag); + } + + if(psCQMFDecoder->pppiQCQMFReal != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiQCQMFReal[n][k]); + } + free(psCQMFDecoder->pppiQCQMFReal[n]); + } + free(psCQMFDecoder->pppiQCQMFReal); + } + + if(psCQMFDecoder->pppiQCQMFImag != NULL){ + int n; + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFDecoder->pppiQCQMFImag[n][k]); + } + free(psCQMFDecoder->pppiQCQMFImag[n]); + } + free(psCQMFDecoder->pppiQCQMFImag); + } + + if(psCQMFDecoder->psBSRead != NULL){ + DeleteBitstream(psCQMFDecoder->psBSRead); + } + + if(psCQMFDecoder->psNoiseGen != NULL){ + DeleteNoiseGen(psCQMFDecoder->psNoiseGen); + } + + free(psCQMFDecoder); + } +} + +int CQMFDecoderGetError(CQMFDecoder *psCQMFDecoder) +{ + return psCQMFDecoder->iLastError; +} + +static void ApplyRMSEnvelope(const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag); + +static void ReplaceSign(const int iNumBlocks, + const int iNumCQMFBands, + const int **ppiSignReal, + const int **ppiSignImag, + float **ppfReal, + float **ppfImag); + +static void InvQuantizeSpectrum(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag, + float **ppfReal, + float **ppfImag, + NoiseGen *psNoiseGen); //Nullable + +static void InvMSCoding(const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + const int iMSMode, + const int *piMSFlags, + float ***pppfReal, + float ***pppfImag); + +/* Currently only the number of bands in frame */ +static int ReadHeaderInformation(int *piNumBands, + Bitstream *psBSRead); + +static int ReadMSInformation(const int iNumBands, + int *piMSMode, + int *piMSFlags, + Bitstream *psBSRead); + +static int ReadGroupInformation(const int iChannels, + int *piCommonGrouping, + int *piNumGroups, + int **ppiGroupLengths, + Bitstream *psBSRead); + +static int ReadHuff(const unsigned int (*pauiHuffDecTable)[HUFF_DEC_TABLE_SIZE], + int *piSymbol, + Bitstream *psBSRead); + +static int ReadRMSEnvelope(const int iChannels, + const int *piNumGroups, + const int iNumBands, + int ***pppiRMSEnvelope, + Bitstream *psBSRead); + +static int ReadAllocInformation(int *piAllocOffset, + Bitstream *psBSRead); + +static int ReadCQMFData( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + int **ppiSignReal, + int **ppiSignImag, + int **ppiQReal, + int **ppiQImag, + Bitstream *psBSRead); + +static void ComputeAllocation(const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc); + +int DecodeFrame(CQMFDecoder *psCQMFDecoder, + const int iNumBytes, + const unsigned char *puchData, + float ***pppfCQMFReal, + float ***pppfCQMFImag) +{ + int n; + int iBitsRead; + + iBitsRead = 0; + + BSFlushBuffer(psCQMFDecoder->psBSRead); + BSPutBytes(psCQMFDecoder->psBSRead,puchData,iNumBytes); + + iBitsRead += ReadHeaderInformation(&psCQMFDecoder->iNumBands, + psCQMFDecoder->psBSRead); + + if(psCQMFDecoder->iChannels == 2){ + iBitsRead += ReadMSInformation(psCQMFDecoder->iNumBands, + &psCQMFDecoder->iMSMode, + psCQMFDecoder->piMSFlags, + psCQMFDecoder->psBSRead); + } + + iBitsRead += ReadGroupInformation(psCQMFDecoder->iChannels, + &psCQMFDecoder->iCommonGrouping, + psCQMFDecoder->piNumGroups, + psCQMFDecoder->ppiGroupLengths, + psCQMFDecoder->psBSRead); + + iBitsRead += ReadRMSEnvelope(psCQMFDecoder->iChannels, + (const int*)psCQMFDecoder->piNumGroups, + psCQMFDecoder->iNumBands, + psCQMFDecoder->pppiRMSEnvelope, + psCQMFDecoder->psBSRead); + + iBitsRead += ReadAllocInformation(&psCQMFDecoder->iAllocOffset, + psCQMFDecoder->psBSRead); + + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ // This will be updated to support multiple sample rates + int k; + for(k = 0; k < psCQMFDecoder->piNumGroups[n]; k ++){ + PerceptualModel(psCQMFDecoder->iNumBands, + psCQMFDecoder->pppiRMSEnvelope[n][k], + psCQMFDecoder->pppiExcitation[n][k], + psCQMFDecoder->pppiSMR[n][k]); + + } + } + + ComputeAllocation(psCQMFDecoder->iChannels, + (const int*)psCQMFDecoder->piNumGroups, + psCQMFDecoder->iNumBands, + (const int***)psCQMFDecoder->pppiSMR, + psCQMFDecoder->iAllocOffset, + psCQMFDecoder->pppiAlloc); + + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + iBitsRead += ReadCQMFData(psCQMFDecoder->piNumGroups[n], + (const int*)psCQMFDecoder->ppiGroupLengths[n], + psCQMFDecoder->iNumBands, + psCQMFDecoder->piBandwidths, + (const int**)psCQMFDecoder->pppiAlloc[n], + psCQMFDecoder->pppiCQMFSignReal[n], + psCQMFDecoder->pppiCQMFSignImag[n], + psCQMFDecoder->pppiQCQMFReal[n], + psCQMFDecoder->pppiQCQMFImag[n], + psCQMFDecoder->psBSRead); + } + + for(n = 0; n < psCQMFDecoder->iChannels; n ++){ + InvQuantizeSpectrum(psCQMFDecoder->piNumGroups[n], + (const int*)psCQMFDecoder->ppiGroupLengths[n], + psCQMFDecoder->iNumBands, + psCQMFDecoder->piBandwidths, + (const int**)psCQMFDecoder->pppiAlloc[n], + (const int**)psCQMFDecoder->pppiQCQMFReal[n], + (const int**)psCQMFDecoder->pppiQCQMFImag[n], + pppfCQMFReal[n], + pppfCQMFImag[n], + psCQMFDecoder->psNoiseGen); + + ReplaceSign(psCQMFDecoder->iNumBlocks, + CQMF_BANDS, + (const int**)psCQMFDecoder->pppiCQMFSignReal[n], + (const int**)psCQMFDecoder->pppiCQMFSignImag[n], + pppfCQMFReal[n], + pppfCQMFImag[n]); + + + ApplyRMSEnvelope(psCQMFDecoder->iNumBands, + psCQMFDecoder->piBandwidths, + psCQMFDecoder->piNumGroups[n], + (const int*)psCQMFDecoder->ppiGroupLengths[n], + (const int **)psCQMFDecoder->pppiRMSEnvelope[n], + pppfCQMFReal[n], + pppfCQMFImag[n]); + } + + if(psCQMFDecoder->iChannels == 2 && psCQMFDecoder->iMSMode > 0){ + InvMSCoding(psCQMFDecoder->iNumBlocks, + psCQMFDecoder->iNumBands, + psCQMFDecoder->piBandwidths, + psCQMFDecoder->iMSMode, + (const int*)psCQMFDecoder->piMSFlags, + pppfCQMFReal, + pppfCQMFImag); + } + + //printf("Bits Read %d\n",iBitsRead); + + return psCQMFDecoder->iLastError; +} + +static void ApplyRMSEnvelope(const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag) +{ + int n; + int iBlockOffset; + + iBlockOffset = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iRMSEnv; + float fGain; + + iRMSEnv = ppiRMSEnvelope[n][b]; + fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER + iRMSEnv]; + for(m = 0; m < piBandwidths[b]; m ++){ + ppfReal[iBlockOffset][iFBOffset] *= fGain; + ppfImag[iBlockOffset][iFBOffset] *= fGain; + iFBOffset ++; + } + } + iBlockOffset ++; + } + } +} + +static void ReplaceSign(const int iNumBlocks, + const int iNumCQMFBands, + const int **ppiSignReal, + const int **ppiSignImag, + float **ppfReal, + float **ppfImag) +{ + int n; + for(n = 0; n < iNumBlocks; n ++){ + int b; + for(b = 0; b < iNumCQMFBands; b ++){ + if(ppiSignReal[n][b] == 1){ + ppfReal[n][b] = -ppfReal[n][b]; + } + if(ppiSignImag[n][b] == 1){ + ppfImag[n][b] = -ppfImag[n][b]; + } + } + } +} + +static void InvQuantizeSpectrum(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag, + float **ppfReal, + float **ppfImag, + NoiseGen *psNoiseGen) // Pass in NULL to swicth off noise gen +{ + int n; + int iBlockOffest; + + iBlockOffest = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iAlloc; + float fInvSCFGain; + + iAlloc = ppiAlloc[n][b]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + + if(iAlloc > 0){ + for(m = 0; m < piBandwidths[b]; m ++){ + int iQuantValue; + + iQuantValue = ppiQReal[iBlockOffest][iFBOffset]; + ppfReal[iBlockOffest][iFBOffset] = (float)iQuantValue * fInvSCFGain; + + iQuantValue = ppiQImag[iBlockOffest][iFBOffset]; + ppfImag[iBlockOffest][iFBOffset] = (float)iQuantValue * fInvSCFGain; + + iFBOffset ++; + } + } + else if(psNoiseGen != NULL){ + for(m = 0; m < piBandwidths[b]; m ++){ + ppfReal[iBlockOffest][iFBOffset] = 0.7f * GetNoise(psNoiseGen); + ppfImag[iBlockOffest][iFBOffset] = 0.7f * GetNoise(psNoiseGen); + + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + + } + + iBlockOffest ++; + } + } +} + +static void InvMSCoding(const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + const int iMSMode, + const int *piMSFlags, + float ***pppfReal, + float ***pppfImag) +{ + if(iMSMode > 0){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + if(piMSFlags[b] == 1){ + int n; + for(n = 0; n < piBandwidths[b]; n ++){ + int k; + for(k = 0; k < iNumBlocks; k ++){ + float fLeftReal; + float fLeftImag; + float fRightReal; + float fRightImag; + + fLeftReal = (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); + fLeftImag = (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); + fRightReal = (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); + fRightImag = (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); + + pppfReal[0][k][iFBOffset] = fLeftReal; + pppfReal[1][k][iFBOffset] = fRightReal; + pppfImag[0][k][iFBOffset] = fLeftImag; + pppfImag[1][k][iFBOffset] = fRightImag; + } + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + } + } +} + +/* Currently only the number of bands in frame */ +static int ReadHeaderInformation(int *piNumBands, + Bitstream *psBSRead) +{ + int iBitsRead; + + iBitsRead = 0; + *piNumBands = BSGetBits(psBSRead, 5); + iBitsRead += 5; + + return iBitsRead; +} + +static int ReadMSInformation(const int iNumBands, + int *piMSMode, + int *piMSFlags, + Bitstream *psBSRead) +{ + int iBitsRead; + + iBitsRead = 0; + *piMSMode = BSGetBits(psBSRead,2); + iBitsRead += 2; + + if(*piMSMode == 0){ + int n; + for(n = 0; n > 16); + } + + if(iVal){ + BSForceBack(psBSRead,iIndex,iVal); + iBitsRead -= iVal; + } + + *piSymbol = iSymbol; + + return iBitsRead; +} + +static int ReadRMSEnvelope(const int iChannels, + const int *piNumGroups, + const int iNumBands, + int ***pppiRMSEnvelope, + Bitstream *psBSRead) +{ + int n; + int iBitsRead; + + iBitsRead = 0; + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < piNumGroups[n]; k ++){ + int b; + int iLastRMSVal; + + iLastRMSVal = BSGetBits(psBSRead,ENV0_BITS); + iBitsRead += ENV0_BITS; + + iLastRMSVal += ENV_MIN; + pppiRMSEnvelope[n][k][0] = iLastRMSVal; + for(b = 1; b < iNumBands; b ++){ + int iDelta; + + iBitsRead += ReadHuff(c_aaiRMSEnvHuffDec,&iDelta,psBSRead); + + iDelta += ENV_DELTA_MIN; + iLastRMSVal += iDelta; + pppiRMSEnvelope[n][k][b] = iLastRMSVal; + } + } + } + + return iBitsRead; +} + +static int ReadAllocInformation(int *piAllocOffset, + Bitstream *psBSRead) +{ + int iBitsRead; + + iBitsRead = 0; + + *piAllocOffset = BSGetBits(psBSRead,ALLOC_OFFSET_BITS); + *piAllocOffset += MIN_ALLOC_OFFSET; + iBitsRead += ALLOC_OFFSET_BITS; + + return iBitsRead; +} + +static int ReadCQMFData(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + int **ppiSignReal, + int **ppiSignImag, + int **ppiQReal, + int **ppiQImag, + Bitstream *psBSRead) +{ + int n; + int iBitsRead; + int iBlockOffest; + + iBitsRead = 0; + iBlockOffest = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iAlloc; + int iHuffDim; + int iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + + if(iAlloc > 0){ + const unsigned int (*pauiHuffmanTable)[HUFF_DEC_TABLE_SIZE] = NULL; //const? + + pauiHuffmanTable = GetHuffDecTable(iAlloc); + for(m = 0; m < piBandwidths[b]; m ++){ + int iQuantValue1 = 0; + int iQuantValue2 = 0; + + if(iHuffDim == 2){ + int iSymbol; + + iBitsRead += ReadHuff(pauiHuffmanTable,&iSymbol,psBSRead); + iQuantValue1 = iSymbol / iHuffMod; + iQuantValue2 = iSymbol % iHuffMod; + } + else{ + iBitsRead += ReadHuff(pauiHuffmanTable,&iQuantValue1,psBSRead); + iBitsRead += ReadHuff(pauiHuffmanTable,&iQuantValue2,psBSRead); + } + + ppiQReal[iBlockOffest][iFBOffset] = iQuantValue1; + ppiQImag[iBlockOffest][iFBOffset] = iQuantValue2; + + if(iQuantValue1 > 0){ + ppiSignReal[iBlockOffest][iFBOffset] = BSGetBits(psBSRead,1); + iBitsRead += 1; + } + if(iQuantValue2 > 0){ + ppiSignImag[iBlockOffest][iFBOffset] = BSGetBits(psBSRead,1); + iBitsRead += 1; + } + + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + + } + + iBlockOffest ++; + } + } + + return iBitsRead; +} + +static void ComputeAllocation(const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc) +{ + int n; + + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < piNumGroups[n]; k ++){ + int b; + for(b = 0; b < iNumBands; b ++){ + int iAlloc; + iAlloc = ((pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE) >> 5); + iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; + iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; + pppiAlloc[n][k][b] = iAlloc; + } + } + } +} diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h new file mode 100644 index 0000000000..e865343cd9 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h @@ -0,0 +1,32 @@ +#ifndef _CQMF_DECODER_H_ +#define _CQMF_DECODER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define DECODER_ERROR_NONE (0) +#define DECODER_ERROR_FS_NOT_SUPPORTED (-1) +#define DECODER_ERROR_CHAN_NOT_SUPPORTED (-2) +#define DECODER_ERROR_UNKNOWN (-100) + +typedef struct CQMF_DECODER CQMFDecoder; + +CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, + const int iChannels); + +void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder); + +int CQMFDecoderGetError(CQMFDecoder *psCQMFDecoder); + +int DecodeFrame(CQMFDecoder *psCQMFDecoder, + const int iNumBytes, + const unsigned char *puchData, + float ***pppfCQMFReal, + float ***pppfCQMFImag); + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_DECODER_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c new file mode 100644 index 0000000000..a7db7969e9 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c @@ -0,0 +1,1226 @@ +#include "CQMFEncoder.h" + +#include +#include +#include +#include +#include "Tables.h" +#include "wmops.h" +#include "RMSEnvGrouping.h" +#include "PerceptualModel.h" +#include "RMSEnvDeltaHuff.h" +#include "CQMFHuff.h" +#include "Bitstream.h" + +typedef struct CQMF_ENCODER{ + int iSampleRate; + int iChannels; + int iNumBlocks; + + int iTargetBitRate; + int iTargetBitsPerFrame; + + int iNumBands; + const int *piBandwidths; + + int iMSMode; + int *piMSFlags; + + RMSEnvelopeGrouping *psRMSEnvelopeGrouping; + + int iCommonGrouping; + int *piNumGroups; + int **ppiGroupLengths; + + int ***pppiRMSEnvelope; + int ***pppiSMR; + int ***pppiExcitation; + int ***pppiAlloc; + + int iAllocOffset; + + int ***pppiCQMFSignReal; + int ***pppiCQMFSignImag; + int ***pppiQCQMFReal; + int ***pppiQCQMFImag; + + Bitstream *psBSWrite; + + int iLastError; +}CQMFEncoder; + +CQMFEncoder* CreateCQMFEncoder(const int iSampleRate, + const int iChannels, + const int iTargetBitRate) +{ + int n; + CQMFEncoder *psCQMFEncoder = NULL; + + assert(iSampleRate == 48000); //Fix + + psCQMFEncoder = (CQMFEncoder*)malloc(sizeof(CQMFEncoder)); + psCQMFEncoder->iSampleRate = iSampleRate; + psCQMFEncoder->iChannels = iChannels; + psCQMFEncoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; + psCQMFEncoder->iAllocOffset = 0; + + psCQMFEncoder->iTargetBitRate = iTargetBitRate; + psCQMFEncoder->iTargetBitsPerFrame = iTargetBitRate * CQMF_BLOCKS_PER_FRAME * CQMF_BANDS / iSampleRate; + + psCQMFEncoder->iNumBands = MAX_BANDS_48 - 1; //Fix + psCQMFEncoder->piBandwidths = c_aiBandwidths48; //Fix + + psCQMFEncoder->iMSMode = 0; + psCQMFEncoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); + + psCQMFEncoder->psRMSEnvelopeGrouping = CreateRMSEnvelopeGrouping(psCQMFEncoder->iNumBlocks); + + psCQMFEncoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo + psCQMFEncoder->piNumGroups = (int*)malloc(psCQMFEncoder->iChannels * sizeof(int)); + psCQMFEncoder->ppiGroupLengths = (int**)malloc(psCQMFEncoder->iChannels * sizeof(int*)); + psCQMFEncoder->pppiRMSEnvelope = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiSMR = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiExcitation = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiAlloc = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + + psCQMFEncoder->pppiCQMFSignReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiCQMFSignImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiQCQMFReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + psCQMFEncoder->pppiQCQMFImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); + for(n = 0; n < iChannels ; n ++){ + int k; + psCQMFEncoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); + psCQMFEncoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + + psCQMFEncoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFEncoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + psCQMFEncoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFEncoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFEncoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFEncoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + + psCQMFEncoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFEncoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFEncoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFEncoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + } + } + + psCQMFEncoder->psBSWrite = CreateBitstream(BS_WRITE,4096); + + psCQMFEncoder->iLastError = ENCODER_ERROR_NONE; + + return psCQMFEncoder; +} + +void DeleteCQMFEncoder(CQMFEncoder *psCQMFEncoder) +{ + if(psCQMFEncoder != NULL){ + + if(psCQMFEncoder->piMSFlags != NULL){ + free(psCQMFEncoder->piMSFlags); + } + + if(psCQMFEncoder->piNumGroups != NULL){ + free(psCQMFEncoder->piNumGroups); + } + + if(psCQMFEncoder->psRMSEnvelopeGrouping != NULL){ + DeleteRMSEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping); + } + + if(psCQMFEncoder->ppiGroupLengths != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + free(psCQMFEncoder->ppiGroupLengths[n]); + } + free(psCQMFEncoder->ppiGroupLengths); + } + + if(psCQMFEncoder->pppiRMSEnvelope != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiRMSEnvelope[n][k]); + } + free(psCQMFEncoder->pppiRMSEnvelope[n]); + } + free(psCQMFEncoder->pppiRMSEnvelope); + } + + if(psCQMFEncoder->pppiSMR != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiSMR[n][k]); + } + free(psCQMFEncoder->pppiSMR[n]); + } + free(psCQMFEncoder->pppiSMR); + } + + if(psCQMFEncoder->pppiExcitation != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiExcitation[n][k]); + } + free(psCQMFEncoder->pppiExcitation[n]); + } + free(psCQMFEncoder->pppiExcitation); + } + + if(psCQMFEncoder->pppiAlloc != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiAlloc[n][k]); + } + free(psCQMFEncoder->pppiAlloc[n]); + } + free(psCQMFEncoder->pppiAlloc); + } + + if(psCQMFEncoder->pppiCQMFSignReal != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiCQMFSignReal[n][k]); + } + free(psCQMFEncoder->pppiCQMFSignReal[n]); + } + free(psCQMFEncoder->pppiCQMFSignReal); + } + + if(psCQMFEncoder->pppiCQMFSignImag != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiCQMFSignImag[n][k]); + } + free(psCQMFEncoder->pppiCQMFSignImag[n]); + } + free(psCQMFEncoder->pppiCQMFSignImag); + } + + if(psCQMFEncoder->pppiQCQMFReal != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiQCQMFReal[n][k]); + } + free(psCQMFEncoder->pppiQCQMFReal[n]); + } + free(psCQMFEncoder->pppiQCQMFReal); + } + + if(psCQMFEncoder->pppiQCQMFImag != NULL){ + int n; + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + int k; + for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ + free(psCQMFEncoder->pppiQCQMFImag[n][k]); + } + free(psCQMFEncoder->pppiQCQMFImag[n]); + } + free(psCQMFEncoder->pppiQCQMFImag); + } + + DeleteBitstream(psCQMFEncoder->psBSWrite); + + free(psCQMFEncoder); + } +} + +int CQMFEncoderGetError(CQMFEncoder *psCQMFEncoder) +{ + return psCQMFEncoder->iLastError; +} + +static void MSModeCalculation(const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int *piMSMode, + int *piMSFlags); + +static void RemoveRMSEnvelope(const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag); + +static void RemoveSign(const int iNumBlocks, + const int iNumCQMFBands, + float **ppfReal, + float **ppfImag, + int **ppiSignReal, + int **ppiSignImag); + +static int CountCQMFBits(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag); + +/* Currently only the number of bands in frame */ +static int WriteHeaderInformation(const int iNumBands, + Bitstream *psBSWrite); + +static int WriteMSInformation(const int iNumBands, + const int iMSMode, + const int *piMSFlags, + Bitstream *psBSWrite); + +static int WriteGroupInformation(const int iChannels, + const int iCommonGrouping, + const int *piNumGroups, + const int **ppiGroupLengths, + Bitstream *psBSWrite); + +static int WriteRMSEnvelope(const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiRMSEnvelope, + Bitstream *psBSWrite); + +static int WriteAllocInformation(const int iAllocOffset, + Bitstream *psBSWrite); + +static int WriteCQMFData(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiSignReal, + const int **ppiSignImag, + const int **ppiQReal, + const int **ppiQImag, + Bitstream *psBSWrite); + +static int ComputeAllocation(const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAvailableBits, + int *piAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag); + +static int ComputeAllocationByPass(const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag); + + + +int EncodeFrame(CQMFEncoder *psCQMFEncoder, + float ***pppfCQMFReal, + float ***pppfCQMFImag, + int *piNumiBytes, + unsigned char *puchData) +{ + int n; + int iAvailableBits; + int iBitsWritten; + int iCQMFBits; + + iAvailableBits = psCQMFEncoder->iTargetBitsPerFrame; // HCBR for now + iBitsWritten = 0; + + + /* Do MS calc here */ + if(psCQMFEncoder->iChannels == 2){ + MSModeCalculation(psCQMFEncoder->iNumBlocks, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + pppfCQMFReal, + pppfCQMFImag, + &psCQMFEncoder->iMSMode, + psCQMFEncoder->piMSFlags); + + if(psCQMFEncoder->iMSMode > 0){ + psCQMFEncoder->iCommonGrouping = 1; // Make sure common grouping is enabled when MS is in use + } + } + + + /* Compute Grouping and RMS Envelopes */ + if(psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1){ + ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float***)pppfCQMFReal, + (const float***)pppfCQMFImag, + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading + &psCQMFEncoder->piNumGroups[0], + psCQMFEncoder->ppiGroupLengths[0], + psCQMFEncoder->pppiRMSEnvelope); + + psCQMFEncoder->piNumGroups[1] = psCQMFEncoder->piNumGroups[0]; + for(n = 0; n < psCQMFEncoder->piNumGroups[0]; n ++){ + psCQMFEncoder->ppiGroupLengths[1][n] = psCQMFEncoder->ppiGroupLengths[0][n]; + } + } + else{ + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float***)&pppfCQMFReal[n], + (const float***)&pppfCQMFImag[n], + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading + &psCQMFEncoder->piNumGroups[n], + psCQMFEncoder->ppiGroupLengths[n], + &psCQMFEncoder->pppiRMSEnvelope[n]); + } + } + + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + RemoveSign(psCQMFEncoder->iNumBlocks, + CQMF_BANDS, + pppfCQMFReal[n], + pppfCQMFImag[n], + psCQMFEncoder->pppiCQMFSignReal[n], + psCQMFEncoder->pppiCQMFSignImag[n]); + + RemoveRMSEnvelope(psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + psCQMFEncoder->piNumGroups[n], + (const int*)psCQMFEncoder->ppiGroupLengths[n], + (const int **)psCQMFEncoder->pppiRMSEnvelope[n], + pppfCQMFReal[n], + pppfCQMFImag[n]); + } + + BSFlushBuffer(psCQMFEncoder->psBSWrite); + iBitsWritten += WriteHeaderInformation(psCQMFEncoder->iNumBands, + psCQMFEncoder->psBSWrite); + + if(psCQMFEncoder->iChannels == 2){ + iBitsWritten += WriteMSInformation(psCQMFEncoder->iNumBands, + psCQMFEncoder->iMSMode, + (const int*)psCQMFEncoder->piMSFlags, + psCQMFEncoder->psBSWrite); + } + + iBitsWritten += WriteGroupInformation(psCQMFEncoder->iChannels, + psCQMFEncoder->iCommonGrouping, + (const int*)psCQMFEncoder->piNumGroups, + (const int**)psCQMFEncoder->ppiGroupLengths, + psCQMFEncoder->psBSWrite); + + iBitsWritten += WriteRMSEnvelope(psCQMFEncoder->iChannels, + (const int*)psCQMFEncoder->piNumGroups, + psCQMFEncoder->iNumBands, + (const int***)psCQMFEncoder->pppiRMSEnvelope, + psCQMFEncoder->psBSWrite); + + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ // This will be updated to support multiple sample rates + int k; + for(k = 0; k < psCQMFEncoder->piNumGroups[n]; k ++){ + PerceptualModel(psCQMFEncoder->iNumBands, + psCQMFEncoder->pppiRMSEnvelope[n][k], + psCQMFEncoder->pppiExcitation[n][k], + psCQMFEncoder->pppiSMR[n][k]); + + } + } + + iAvailableBits -= iBitsWritten; + iCQMFBits = ComputeAllocation(psCQMFEncoder->iChannels, + (const int*)psCQMFEncoder->piNumGroups, + (const int**)psCQMFEncoder->ppiGroupLengths, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float***)pppfCQMFReal, + (const float***)pppfCQMFImag, + (const int***)psCQMFEncoder->pppiSMR, + iAvailableBits, + &psCQMFEncoder->iAllocOffset, + psCQMFEncoder->pppiAlloc, + psCQMFEncoder->pppiQCQMFReal, + psCQMFEncoder->pppiQCQMFImag); + + iBitsWritten += WriteAllocInformation(psCQMFEncoder->iAllocOffset,psCQMFEncoder->psBSWrite); + + for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + iBitsWritten += WriteCQMFData(psCQMFEncoder->piNumGroups[n], + (const int*)psCQMFEncoder->ppiGroupLengths[n], + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const int**)psCQMFEncoder->pppiAlloc[n], + (const int**)psCQMFEncoder->pppiCQMFSignReal[n], + (const int**)psCQMFEncoder->pppiCQMFSignImag[n], + (const int**)psCQMFEncoder->pppiQCQMFReal[n], + (const int**)psCQMFEncoder->pppiQCQMFImag[n], + psCQMFEncoder->psBSWrite); + } + + BSByteAlign(psCQMFEncoder->psBSWrite); + *piNumiBytes = BSGetByteCount(psCQMFEncoder->psBSWrite); + BSGetBytes(psCQMFEncoder->psBSWrite,puchData,*piNumiBytes); + + //printf("Bits Written %d\n",iBitsWritten); + + return psCQMFEncoder->iLastError; +} + +static void MSModeCalculation(const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int *piMSMode, + int *piMSFlags) +{ + int b; + int iFBOffset; + int iNumMSBands; + + *piMSMode = 0; + iFBOffset = 0; + iNumMSBands = 0; + for(b = 0; b < iNumBands; b ++){ + int n; + float fLeftEnergy; + float fRightEnergy; + float fMidEnergy; + float fSideEnergy; + float fLRRatio; + float fMSRatio; + + fLeftEnergy = 0.0; + fRightEnergy = 0.0; + fMidEnergy = 0.0; + fSideEnergy = 0.0; + + for(n = 0; n < piBandwidths[b]; n ++){ + int k; + for(k = 0; k < iNumBlocks; k ++){ + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; + + fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); + fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); + fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); + fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); + + fLeftEnergy += (pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset]); + fRightEnergy += (pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset]); + fMidEnergy += (fMidReal * fMidReal + fMidImag * fMidImag); + fSideEnergy += (fSideReal * fSideReal + fSideImag * fSideImag); + } + + iFBOffset ++; + } + + fLeftEnergy = log10f(fLeftEnergy + 1e-12f); + fRightEnergy = log10f(fRightEnergy + 1e-12f); + fMidEnergy = log10f(fMidEnergy + 1e-12f); + fSideEnergy = log10f(fSideEnergy + 1e-12f); + + if(fLeftEnergy > fRightEnergy){ + fLRRatio = fLeftEnergy - fRightEnergy; + } + else{ + fLRRatio = fRightEnergy - fLeftEnergy; + } + + if(fMidEnergy > fSideEnergy){ + fMSRatio = fMidEnergy - fSideEnergy; + } + else{ + fMSRatio = fSideEnergy - fMidEnergy; + } + + if(fMSRatio > fLRRatio){ + iNumMSBands ++; + piMSFlags[b] = 1; + } + else{ + piMSFlags[b] = 0; + } + } + + if(iNumMSBands == iNumBands){ + *piMSMode = 1; + } + else if(iNumMSBands > 0){ + *piMSMode = 2; + } + else{ + *piMSMode = 0; + } + + if(*piMSMode > 0){ + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + if(piMSFlags[b] == 1){ + int n; + for(n = 0; n < piBandwidths[b]; n ++){ + int k; + for(k = 0; k < iNumBlocks; k ++){ + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; + + fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); + fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); + fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); + fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); + + pppfReal[0][k][iFBOffset] = fMidReal; + pppfReal[1][k][iFBOffset] = fSideReal; + pppfImag[0][k][iFBOffset] = fMidImag; + pppfImag[1][k][iFBOffset] = fSideImag; + } + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + } + } +} + +static void RemoveRMSEnvelope(const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag) +{ + int n; + int iBlockOffset; + + iBlockOffset = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iRMSEnv; + float fGain; + + iRMSEnv = ppiRMSEnvelope[n][b]; + fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER - iRMSEnv]; + for(m = 0; m < piBandwidths[b]; m ++){ + ppfReal[iBlockOffset][iFBOffset] *= fGain; + ppfImag[iBlockOffset][iFBOffset] *= fGain; + iFBOffset ++; + } + } + iBlockOffset ++; + } + } +} + +static void RemoveSign(const int iNumBlocks, + const int iNumCQMFBands, + float **ppfReal, + float **ppfImag, + int **ppiSignReal, + int **ppiSignImag) +{ + int n; + for(n = 0; n < iNumBlocks; n ++){ + int b; + for(b = 0; b < iNumCQMFBands; b ++){ + if(ppfReal[n][b] > 0.0){ + ppiSignReal[n][b] = 0; + } + else{ + ppfReal[n][b] = -ppfReal[n][b]; + ppiSignReal[n][b] = 1; + } + if(ppfImag[n][b] > 0.0){ + ppiSignImag[n][b] = 0; + } + else{ + ppfImag[n][b] = -ppfImag[n][b]; + ppiSignImag[n][b] = 1; + } + } + } +} + +/* Rename */ +static void QuantizeSpectrum(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const float **ppfReal, + const float **ppfImag, + int **ppiQReal, + int **ppiQImag) +{ + int n; + int iBlockOffest; + + iBlockOffest = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iAlloc; + int iMaxQuantVal; + float fSCFGain; + + iAlloc = ppiAlloc[n][b]; + fSCFGain = c_afScaleFactor[iAlloc]; + iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; + for(m = 0; m < piBandwidths[b]; m ++){ + int iQuantValue; + + iQuantValue = (int)(fSCFGain * ppfReal[iBlockOffest][iFBOffset] + 0.5); +#ifdef _DEBUG_VERBOSE + if(iQuantValue > iMaxQuantVal){ + printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); + iQuantValue = iMaxQuantVal; + } +#else + iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; +#endif + ppiQReal[iBlockOffest][iFBOffset] = iQuantValue; + + iQuantValue = (int)(fSCFGain * ppfImag[iBlockOffest][iFBOffset] + 0.5); +#ifdef _DEBUG_VERBOSE + if(iQuantValue > iMaxQuantVal){ + printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); + iQuantValue = iMaxQuantVal; + } +#else + iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; +#endif + ppiQImag[iBlockOffest][iFBOffset] = iQuantValue; + + iFBOffset ++; + } + + } + + iBlockOffest ++; + } + } +} + +static int CountCQMFBits(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag) +{ + int n; + int iBits; + int iBlockOffest; + + iBits = 0; + iBlockOffest = 0; + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iAlloc; + int iHuffDim; + int iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + + if(iAlloc > 0){ + const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? + + pauiHuffmanTable = GetHuffEncTable(iAlloc); + for(m = 0; m < piBandwidths[b]; m ++){ + int iQuantValue1; + int iQuantValue2; + + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; + iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; + + iBits += (iQuantValue1 > 0) ? 1 : 0; //Sign bit for vals > 0 + iBits += (iQuantValue2 > 0) ? 1 : 0; //Sign bit for vals > 0 + if(iHuffDim == 2){ + iQuantValue1 *= iHuffMod; + iQuantValue1 += iQuantValue2; + iBits += pauiHuffmanTable[iQuantValue1][0]; + } + else{ + iBits += pauiHuffmanTable[iQuantValue1][0]; + iBits += pauiHuffmanTable[iQuantValue2][0]; + } + + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + + } + + iBlockOffest ++; + } + } + + return iBits; +} + +/* Currently only the number of bands in frame */ +static int WriteHeaderInformation(const int iNumBands, + Bitstream *psBSWrite) +{ + int iBitsWritten; + + iBitsWritten = 0; + BSPutBits(psBSWrite,iNumBands,5); + iBitsWritten += 5; + + return iBitsWritten; +} + +static int WriteMSInformation(const int iNumBands, + const int iMSMode, + const int *piMSFlags, + Bitstream *psBSWrite) +{ + int iBitsWritten; + + iBitsWritten = 0; + + BSPutBits(psBSWrite,iMSMode,2); + iBitsWritten += 2; + if(iMSMode == 2){ + int n; + for(n = 0; n < iNumBands; n ++){ + BSPutBits(psBSWrite,piMSFlags[n],1); + iBitsWritten += 1; + } + } + + return iBitsWritten; +} + +static int WriteGroupInformation(const int iChannels, + const int iCommonGrouping, + const int *piNumGroups, + const int **ppiGroupLengths, + Bitstream *psBSWrite) +{ + int iBitsWritten; + + iBitsWritten = 0; + if(iChannels == 2 && iCommonGrouping == 1){ + int k; + + BSPutBits(psBSWrite,iCommonGrouping,1); + iBitsWritten += 1; + + BSPutBits(psBSWrite,(piNumGroups[0] - 1),4); + iBitsWritten += 4; + + for(k = 0; k < piNumGroups[0]; k ++){ + BSPutBits(psBSWrite,(ppiGroupLengths[0][k] - 1),4); + iBitsWritten += 4; + } + } + else if(iChannels == 2){ + int n; + + BSPutBits(psBSWrite,iCommonGrouping,1); + iBitsWritten += 1; + + for(n = 0; n < iChannels; n ++){ + int k; + + BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); + iBitsWritten += 4; + + for(k = 0; k < piNumGroups[n]; k ++){ + BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); + iBitsWritten += 4; + } + } + } + else{ + int n; + + for(n = 0; n < iChannels; n ++){ + int k; + + BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); + iBitsWritten += 4; + + for(k = 0; k < piNumGroups[n]; k ++){ + BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); + iBitsWritten += 4; + } + } + } + + return iBitsWritten; +} + +static int WriteRMSEnvelope(const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiRMSEnvelope, + Bitstream *psBSWrite) +{ + int n; + int iBitsWritten; + + iBitsWritten = 0; + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < piNumGroups[n]; k ++){ + int b; + int iLastRMSVal; + + iLastRMSVal = pppiRMSEnvelope[n][k][0]; + iLastRMSVal = (iLastRMSVal > ENV_MIN) ? iLastRMSVal : ENV_MIN; + iLastRMSVal = (iLastRMSVal < ENV_MAX) ? iLastRMSVal : ENV_MAX; + BSPutBits(psBSWrite,(iLastRMSVal - ENV_MIN),ENV0_BITS); + iBitsWritten += ENV0_BITS; + + for(b = 1; b < iNumBands; b ++){ + int iDelta; + + iDelta = pppiRMSEnvelope[n][k][b] - iLastRMSVal; + iDelta = (iDelta > ENV_DELTA_MIN) ? iDelta : ENV_DELTA_MIN; + iDelta = (iDelta < ENV_DELTA_MAX) ? iDelta : ENV_DELTA_MAX; + iDelta -= ENV_DELTA_MIN; + + BSPutBits(psBSWrite,c_aaiRMSEnvHuffEnc[iDelta][1],c_aaiRMSEnvHuffEnc[iDelta][0]); + iBitsWritten += c_aaiRMSEnvHuffEnc[iDelta][0]; + + iLastRMSVal = pppiRMSEnvelope[n][k][b]; + } + } + } + + return iBitsWritten; +} + +static int WriteAllocInformation(const int iAllocOffset, + Bitstream *psBSWrite) +{ + int iBitsWritten; + + iBitsWritten = 0; + + if(iAllocOffset < MIN_ALLOC_OFFSET || iAllocOffset > MAX_ALLOC_OFFSET){ + printf("Serious error\n"); + } + + BSPutBits(psBSWrite,(iAllocOffset - MIN_ALLOC_OFFSET),ALLOC_OFFSET_BITS); + iBitsWritten += ALLOC_OFFSET_BITS; + + return iBitsWritten; +} + +static int WriteCQMFData(const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiSignReal, + const int **ppiSignImag, + const int **ppiQReal, + const int **ppiQImag, + Bitstream *psBSWrite) +{ + int n; + int iBitsWritten; + int iBlockOffest; + + iBitsWritten = 0; + iBlockOffest = 0; + + + for(n = 0; n < iNumGroups; n ++){ + int k; + for(k = 0; k < piGroupLengths[n]; k ++){ + int b; + int iFBOffset; + + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + int iAlloc; + int iHuffDim; + int iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + + if(iAlloc > 0){ + const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? + + pauiHuffmanTable = GetHuffEncTable(iAlloc); + for(m = 0; m < piBandwidths[b]; m ++){ + int iQuantValue1; + int iQuantValue2; + + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; + iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; + + + if(iHuffDim == 2){ + int iSymbol; + iSymbol = iQuantValue1; + iSymbol *= iHuffMod; + iSymbol += iQuantValue2; + BSPutBits(psBSWrite, pauiHuffmanTable[iSymbol][1], pauiHuffmanTable[iSymbol][0]); + iBitsWritten += pauiHuffmanTable[iSymbol][0]; + } + else{ + BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue1][1], pauiHuffmanTable[iQuantValue1][0]); + iBitsWritten += pauiHuffmanTable[iQuantValue1][0]; + BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue2][1], pauiHuffmanTable[iQuantValue2][0]); + iBitsWritten += pauiHuffmanTable[iQuantValue2][0]; + } + + if(iQuantValue1 > 0){ + BSPutBits(psBSWrite,ppiSignReal[iBlockOffest][iFBOffset],1); + iBitsWritten += 1; + } + if(iQuantValue2 > 0){ + BSPutBits(psBSWrite,ppiSignImag[iBlockOffest][iFBOffset],1); + iBitsWritten += 1; + } + + iFBOffset ++; + } + } + else{ + iFBOffset += piBandwidths[b]; + } + + } + + iBlockOffest ++; + } + } + + return iBitsWritten; +} + +static int ComputeAllocation(const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAvailableBits, + int *piAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag) +{ + int iBitsUsed; + int iDone; + int iDelta; + + iBitsUsed = ALLOC_OFFSET_BITS; // Bits used for Alloc Offset + + iDone = 0; + iDelta = -MIN_ALLOC_OFFSET; + *piAllocOffset = 0; + while(iDone == 0){ + int n; + int iLimitAllocOffset; + iBitsUsed = ALLOC_OFFSET_BITS; + + iLimitAllocOffset = *piAllocOffset; + iLimitAllocOffset = (iLimitAllocOffset > MIN_ALLOC_OFFSET) ? iLimitAllocOffset : MIN_ALLOC_OFFSET; + iLimitAllocOffset = (iLimitAllocOffset < MAX_ALLOC_OFFSET) ? iLimitAllocOffset : MAX_ALLOC_OFFSET; + + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < piNumGroups[n]; k ++){ + int b; + for(b = 0; b < iNumBands; b ++){ + int iAlloc; + iAlloc = ((pppiSMR[n][k][b] + iLimitAllocOffset * ALLOC_OFFSET_SCALE) >> 5); + iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; + iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; + pppiAlloc[n][k][b] = iAlloc; + } + } + + QuantizeSpectrum(piNumGroups[n], + (const int*)ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int**)pppiAlloc[n], + (const float**)pppfReal[n], + (const float**)pppfImag[n], + pppiQReal[n], + pppiQImag[n]); + + iBitsUsed += CountCQMFBits(piNumGroups[n], + (const int*)ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int**)pppiAlloc[n], + (const int**)pppiQReal[n], + (const int**)pppiQImag[n]); + } + + if(*piAllocOffset <= MIN_ALLOC_OFFSET && iBitsUsed > iAvailableBits){ +#ifdef DEBUG_VERBOSE + printf("Frame can not be coded with the number of bits available\n"); +#endif + //iLastError = ENC_ERROR_STREAM_FAILURE; + return -1; + } + else if(*piAllocOffset >= MAX_ALLOC_OFFSET && iBitsUsed < iAvailableBits){ + *piAllocOffset = MAX_ALLOC_OFFSET; + iDone ++; + } + else{ + if(iDelta == 0 && iBitsUsed > iAvailableBits){ + iDelta = 1; + } + else if(iDelta == 0 && iBitsUsed < iAvailableBits){ + iDone ++; + } + else if(iBitsUsed == iAvailableBits){ + iDone ++; + } + + if(iBitsUsed > iAvailableBits){ + *piAllocOffset -= iDelta; + iDelta >>= 1; + } + else if(iBitsUsed < iAvailableBits){ + *piAllocOffset += iDelta; + iDelta >>= 1; + } + } + + } + + //printf("%d\t%d\t%d\t%d\n",*piAllocOffset,iAvailableBits,iBitsUsed,iAvailableBits - iBitsUsed); + + return iBitsUsed; +} + +static int ComputeAllocationByPass(const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag) +{ + int n; + int iBitsUsed; + + iBitsUsed = ALLOC_OFFSET_BITS; + + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < piNumGroups[n]; k ++){ + int b; + for(b = 0; b < iNumBands; b ++){ + int iAlloc; + iAlloc = ((pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE) >> 5); + iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; + iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; + pppiAlloc[n][k][b] = iAlloc; + } + } + + QuantizeSpectrum(piNumGroups[n], + (const int*)ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int**)pppiAlloc[n], + (const float**)pppfReal[n], + (const float**)pppfImag[n], + pppiQReal[n], + pppiQImag[n]); + + iBitsUsed += CountCQMFBits(piNumGroups[n], + (const int*)ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int**)pppiAlloc[n], + (const int**)pppiQReal[n], + (const int**)pppiQImag[n]); + } + + return iBitsUsed; +} diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h new file mode 100644 index 0000000000..d509827beb --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h @@ -0,0 +1,33 @@ +#ifndef _CQMF_ENCODER_H_ +#define _CQMF_ENCODER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define ENCODER_ERROR_NONE (0) +#define ENCODER_ERROR_FS_NOT_SUPPORTED (-1) +#define ENCODER_ERROR_CHAN_NOT_SUPPORTED (-2) +#define ENCODER_ERROR_UNKNOWN (-100) + +typedef struct CQMF_ENCODER CQMFEncoder; + +CQMFEncoder* CreateCQMFEncoder(const int iSampleRate, + const int iChannels, + const int iTargetBitRate); + +void DeleteCQMFEncoder(CQMFEncoder *psCQMFEncoder); + +int CQMFEncoderGetError(CQMFEncoder *psCQMFEncoder); + +int EncodeFrame(CQMFEncoder *psCQMFEncoder, + float ***pppfCQMFReal, + float ***pppfCQMFImag, + int *piNumiBytes, + unsigned char *puchData); + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_ENCODER_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c new file mode 100644 index 0000000000..ad7e387c72 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c @@ -0,0 +1,1457 @@ +#include "CQMFHuff.h" +#include "wmops.h" + +const unsigned int c_aaiCQMFHuffEnc1[16][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0001}, + {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0009, 0x0003}, {0x000a, 0x0001}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, +}; + +const unsigned int c_aaiCQMFHuffDec1[4][16] = +{ + {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, +}; + +const unsigned int c_aaiCQMFHuffEnc2[25][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, + {0x000c, 0x0002}, {0x000c, 0x0003}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, + {0x000b, 0x0004}, {0x000c, 0x0007}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, + {0x000b, 0x000b}, + +}; + +const unsigned int c_aaiCQMFHuffDec2[4][16] = +{ + {0x0001ffff, 0x00000006, 0x00010005, 0x00010005, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, + {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x00000003, 0x00000004, 0x00000008, 0x00000009, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000011, 0x00010010, 0x00010010, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, }, +}; + +const unsigned int c_aaiCQMFHuffEnc3[36][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0006}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, + {0x0007, 0x0001}, {0x000b, 0x0007}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0008}, + {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x000a}, {0x000b, 0x0009}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, + {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000d, 0x0010}, + {0x000d, 0x0011}, {0x000d, 0x0012}, {0x000d, 0x0013}, {0x000c, 0x000b}, + +}; + +const unsigned int c_aaiCQMFHuffDec3[14][16] = +{ + {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x0001000f, 0x0001000f, 0x00010014, 0x00010014, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x00000013, 0x00000023, 0x00010003, 0x00010003, 0x00010009, 0x00010009, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, +}; + +const unsigned int c_aaiCQMFHuffEnc4[49][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0004}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x0003, 0x0001}, + {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0005}, {0x000f, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, + {0x0008, 0x0001}, {0x000d, 0x000a}, {0x000f, 0x0006}, {0x000f, 0x0007}, {0x000f, 0x0008}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0006}, + {0x000c, 0x0007}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000e, 0x000c}, {0x000d, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, + {0x000f, 0x000e}, {0x000f, 0x000f}, {0x000f, 0x0010}, {0x000f, 0x0011}, {0x000f, 0x0012}, {0x000f, 0x0013}, {0x000f, 0x0014}, {0x000f, 0x0015}, + {0x000f, 0x0016}, {0x000f, 0x0017}, {0x000e, 0x000d}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000e, 0x0010}, {0x000e, 0x0011}, {0x000e, 0x0012}, + {0x000e, 0x0013}, + +}; + +const unsigned int c_aaiCQMFHuffDec4[9][16] = +{ + {0x0001ffff, 0x00000008, 0x00010007, 0x00010007, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000010, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0007ffff, 0x0006ffff, 0x0008ffff, 0x0004ffff, 0x0005ffff, 0x0003ffff, 0x00000017, 0x00000018, 0x00010003, 0x00010003, 0x0001000a, 0x0001000a, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x00010014, 0x00010014, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, + {0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, + {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, +}; + +const unsigned int c_aaiCQMFHuffEnc5[64][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x000c}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, + {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, {0x000a, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, + {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x000c, 0x0003}, {0x000f, 0x000d}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, + {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0004}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, + {0x000e, 0x0007}, {0x000d, 0x0005}, {0x0010, 0x0015}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, + {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, + {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, + {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0010, 0x0016}, {0x0010, 0x0017}, +}; + +const unsigned int c_aaiCQMFHuffDec5[27][16] = +{ + {0x0001ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, + {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x00000013, 0x00010003, 0x00010003, 0x00010018, 0x00010018, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, + {0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000022, 0x0000003e, 0x0000003f, 0x00010004, 0x00010004, 0x00010014, 0x00010014, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x0008ffff, 0x0007ffff, 0x0009ffff, 0x000dffff, 0x0006ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, +}; + +const unsigned int c_aaiCQMFHuffEnc6[81][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, + {0x0012, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x000e, 0x0006}, {0x0012, 0x0004}, {0x0012, 0x0005}, + {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000c, 0x0003}, {0x000f, 0x0008}, {0x0012, 0x0008}, + {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0005}, {0x000e, 0x0007}, {0x0011, 0x001c}, + {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0009}, {0x0010, 0x000f}, + {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0011, 0x001d}, {0x0012, 0x0016}, + {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, + {0x0012, 0x001f}, {0x0012, 0x0020}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, + {0x0012, 0x0027}, {0x0012, 0x0028}, {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, + {0x0012, 0x002f}, {0x0012, 0x0030}, {0x0012, 0x0031}, {0x0012, 0x0032}, {0x0012, 0x0033}, {0x0012, 0x0034}, {0x0012, 0x0035}, {0x0012, 0x0036}, + {0x0012, 0x0037}, + +}; + +const unsigned int c_aaiCQMFHuffDec6[21][16] = +{ + {0x0001ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000014, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x00000015, 0x00010003, 0x00010003, 0x0001001b, 0x0001001b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x00010016, 0x00010016, 0x00010026, 0x00010026, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x0008ffff, 0x0009ffff, 0x0007ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0006ffff, 0x00000027, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, + {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, }, + {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, + {0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, + {0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020044, 0x00020044, 0x00020044, 0x00020044, }, + {0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, + {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, }, + {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020050, 0x00020050, 0x00020050, 0x00020050, }, +}; + +const unsigned int c_aaiCQMFHuffEnc7[81][2] = +{ + {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x000a, 0x0002}, {0x000d, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, + {0x0012, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0006}, {0x000f, 0x0009}, {0x0012, 0x0004}, + {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0006}, {0x0011, 0x0018}, + {0x0011, 0x0019}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x000a, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000e, 0x0007}, {0x000f, 0x000a}, + {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x000d, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x000b}, + {0x0011, 0x001a}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0010, 0x000e}, {0x0012, 0x0011}, {0x0010, 0x000f}, + {0x0010, 0x0010}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0010, 0x0011}, {0x0012, 0x0017}, + {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, + {0x0012, 0x0020}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, + {0x0012, 0x0028}, {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, {0x0012, 0x002f}, + {0x0011, 0x001b}, + +}; + +const unsigned int c_aaiCQMFHuffDec7[23][16] = +{ + {0x0001ffff, 0x0002ffff, 0x0001000a, 0x0001000a, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, + {0x0004ffff, 0x0003ffff, 0x00010014, 0x00010014, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0008ffff, 0x0007ffff, 0x0006ffff, 0x0005ffff, 0x00010015, 0x00010015, 0x0001001d, 0x0001001d, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00000030, 0x00000036, 0x0001000e, 0x0001000e, 0x0001001f, 0x0001001f, 0x00010027, 0x00010027, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x000effff, 0x000dffff, 0x000bffff, 0x000cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0009ffff, 0x000affff, 0x0000002d, 0x0000002f, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, + {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, + {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, }, + {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, + {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020037, 0x00020037, 0x00020037, 0x00020037, }, + {0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, }, + {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, + {0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, }, + {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020047, 0x00020047, 0x00020047, 0x00020047, }, + {0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, + {0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, +}; + +const unsigned int c_aaiCQMFHuffEnc8[121][2] = +{ + {0x0002, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000d, 0x0003}, {0x0010, 0x0008}, {0x0014, 0x0000}, {0x0014, 0x0001}, + {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0004}, + {0x0010, 0x0009}, {0x0012, 0x0016}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0005, 0x0002}, {0x0005, 0x0003}, + {0x0007, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0004}, {0x0010, 0x000a}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, + {0x0014, 0x000d}, {0x000a, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0005}, {0x0010, 0x000b}, {0x0012, 0x0017}, {0x0014, 0x000e}, + {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0005}, {0x000f, 0x0006}, + {0x0011, 0x000d}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0011, 0x000e}, + {0x000f, 0x0007}, {0x0011, 0x000f}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, + {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0013, 0x002a}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0013, 0x002b}, {0x0014, 0x0021}, {0x0014, 0x0022}, + {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, + {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, + {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, + {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, + {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, + {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, + {0x0014, 0x0053}, + +}; + +const unsigned int c_aaiCQMFHuffDec8[17][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, + {0x0004ffff, 0x0003ffff, 0x00010018, 0x00010018, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x0008ffff, 0x0006ffff, 0x0005ffff, 0x0007ffff, 0x00010019, 0x00010019, 0x00010023, 0x00010023, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x000bffff, 0x0009ffff, 0x000affff, 0x00000005, 0x00000010, 0x0000001b, 0x00000025, 0x0001002f, 0x0001002f, 0x00010038, 0x00010038, }, + {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00010042, 0x00010042, 0x00010045, 0x00010045, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, + {0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000027, 0x00000028, }, + {0x00000029, 0x0000002a, 0x0000002b, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000043, }, + {0x00000044, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, }, + {0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, }, + {0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000006c, 0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, }, +}; + +const unsigned int c_aaiCQMFHuffEnc9[196][2] = +{ + {0x0003, 0x0002}, {0x0002, 0x0002}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x000b, 0x0003}, {0x000f, 0x000e}, {0x0010, 0x0016}, {0x0013, 0x0000}, + {0x0012, 0x004a}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0003, 0x0003}, {0x0002, 0x0003}, + {0x0004, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0004}, {0x000e, 0x0009}, {0x0011, 0x0028}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, + {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0005, 0x0001}, {0x0004, 0x0003}, {0x0007, 0x0003}, {0x0009, 0x0002}, + {0x000c, 0x0004}, {0x000e, 0x000a}, {0x0010, 0x0017}, {0x0012, 0x004b}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, + {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0005}, {0x000e, 0x000b}, {0x000f, 0x000f}, + {0x0011, 0x0029}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, + {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0005}, {0x000e, 0x000c}, {0x000f, 0x0010}, {0x0011, 0x002a}, {0x0012, 0x004c}, {0x0013, 0x001a}, + {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x000e, 0x000d}, {0x000d, 0x0007}, + {0x000f, 0x0011}, {0x0010, 0x0018}, {0x0012, 0x004d}, {0x0013, 0x0021}, {0x0012, 0x004e}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, + {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0010, 0x0019}, {0x0010, 0x001a}, {0x0010, 0x001b}, {0x0012, 0x004f}, + {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, + {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0011, 0x002b}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, + {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, + {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, + {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, + {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, + {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, + {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, + {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, + {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, + {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, + {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, + {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, + {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, + +}; + +const unsigned int c_aaiCQMFHuffDec9[30][16] = +{ + {0x0001ffff, 0x00000002, 0x00000010, 0x0000001d, 0x00010000, 0x00010000, 0x0001000e, 0x0001000e, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0003ffff, 0x0002ffff, 0x00000003, 0x00000011, 0x0000002a, 0x0000002b, 0x0001001e, 0x0001001e, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x000bffff, 0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000020, 0x0000003a, 0x00010004, 0x00010004, 0x00010012, 0x00010012, 0x0001002d, 0x0001002d, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, + {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x0001003c, 0x0001003c, 0x00010048, 0x00010048, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, + {0x001cffff, 0x001dffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000006, 0x00000022, 0x00000049, 0x00000054, 0x00000055, 0x00000056, 0x00010005, 0x00010005, 0x0001002f, 0x0001002f, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, }, + {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020057, 0x00020057, 0x00020057, 0x00020057, }, + {0x000fffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, }, + {0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, + {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, + {0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, + {0x00010007, 0x00010007, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, + {0x00010045, 0x00010045, 0x0001004b, 0x0001004b, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, + {0x00010053, 0x00010053, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, }, + {0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, }, + {0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, }, + {0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, }, + {0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, }, + {0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, }, + {0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, }, + {0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, }, + {0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, }, + {0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, }, + {0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, }, + {0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, }, + {0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, +}; + +const unsigned int c_aaiCQMFHuffEnc10[196][2] = +{ + {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0004, 0x0002}, {0x0006, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x000f, 0x000e}, {0x000f, 0x000f}, + {0x0012, 0x003f}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0003, 0x0005}, {0x0002, 0x0003}, + {0x0004, 0x0003}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000c, 0x0006}, {0x000e, 0x000b}, {0x000f, 0x0010}, {0x0013, 0x0005}, {0x0013, 0x0006}, + {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0007, 0x0002}, + {0x000a, 0x0004}, {0x000c, 0x0007}, {0x000e, 0x000c}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0003}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0008}, + {0x000f, 0x0011}, {0x0011, 0x0028}, {0x0013, 0x0010}, {0x0012, 0x0040}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, + {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0009}, {0x000f, 0x0012}, {0x0010, 0x0016}, {0x0013, 0x0015}, + {0x0011, 0x0029}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x000c, 0x0008}, {0x000b, 0x0007}, + {0x000c, 0x0009}, {0x000e, 0x000d}, {0x000f, 0x0013}, {0x0010, 0x0017}, {0x0011, 0x002a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0012, 0x0041}, + {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x000f, 0x0014}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000f, 0x0015}, + {0x0012, 0x0042}, {0x0010, 0x0018}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, + {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0010, 0x0019}, {0x0010, 0x001a}, {0x0011, 0x002b}, {0x0010, 0x001b}, {0x0012, 0x0043}, + {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, + {0x0012, 0x0044}, {0x0012, 0x0045}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0012, 0x0046}, {0x0013, 0x0035}, {0x0013, 0x0036}, + {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, + {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, + {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, + {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, + {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, + {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, + {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, + {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, + {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0012, 0x0047}, + {0x0012, 0x0048}, {0x0012, 0x0049}, {0x0012, 0x004a}, {0x0012, 0x004b}, + +}; + +const unsigned int c_aaiCQMFHuffDec10[34][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000002, 0x00000010, 0x0000001c, 0x0000001d, 0x00010000, 0x00010000, 0x00010001, 0x00010001, 0x0001000e, 0x0001000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0006ffff, 0x0004ffff, 0x0003ffff, 0x0005ffff, 0x0001001f, 0x0001001f, 0x0001002c, 0x0001002c, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x000fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x0007ffff, 0x00000005, 0x00000013, 0x00000021, 0x00000046, 0x00000048, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, + {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x00010015, 0x00010015, 0x00010030, 0x00010030, 0x0001003d, 0x0001003d, 0x0001004a, 0x0001004a, 0x00010054, 0x00010054, 0x00010057, 0x00010057, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, + {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x000effff, 0x0011ffff, 0x0012ffff, 0x000dffff, 0x000bffff, 0x000cffff, 0x0000003e, 0x0000004b, 0x00000059, 0x00000063, 0x00000064, 0x00000066, 0x00010006, 0x00010006, 0x00010007, 0x00010007, }, + {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020067, 0x00020067, 0x00020067, 0x00020067, }, + {0x0014ffff, 0x0013ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0010ffff, }, + {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, }, + {0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, }, + {0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, + {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, }, + {0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, + {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, + {0x00010053, 0x00010053, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, }, + {0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, }, + {0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, }, + {0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, }, + {0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, }, + {0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, }, + {0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, + {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, + {0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, }, + {0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, }, + {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, +}; + +const unsigned int c_aaiCQMFHuffEnc11[256][2] = +{ + {0x0004, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0004}, {0x0006, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0004}, {0x000e, 0x000c}, {0x0010, 0x001e}, + {0x0013, 0x0000}, {0x0012, 0x005b}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, + {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0003}, {0x0008, 0x0004}, {0x000a, 0x0004}, {0x000d, 0x0009}, {0x000f, 0x0011}, + {0x0013, 0x0007}, {0x0012, 0x005c}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0004, 0x0005}, {0x0003, 0x0007}, {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0005}, {0x000e, 0x000d}, {0x000f, 0x0012}, + {0x0012, 0x005d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, + {0x0006, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0005}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000d, 0x000a}, {0x000f, 0x0013}, {0x0011, 0x0035}, + {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, + {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0005}, {0x000a, 0x0006}, {0x000c, 0x0006}, {0x000e, 0x000e}, {0x000f, 0x0014}, {0x0011, 0x0036}, + {0x0012, 0x005e}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, + {0x000b, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000e, 0x000f}, {0x000f, 0x0015}, {0x0011, 0x0037}, {0x0012, 0x005f}, + {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, + {0x000e, 0x0010}, {0x000d, 0x000b}, {0x000e, 0x0011}, {0x000f, 0x0016}, {0x0010, 0x001f}, {0x0012, 0x0060}, {0x0011, 0x0038}, {0x0012, 0x0061}, + {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, + {0x0010, 0x0020}, {0x000f, 0x0017}, {0x0010, 0x0021}, {0x0011, 0x0039}, {0x0011, 0x003a}, {0x0012, 0x0062}, {0x0013, 0x0034}, {0x0013, 0x0035}, + {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, + {0x0012, 0x0063}, {0x0011, 0x003b}, {0x0012, 0x0064}, {0x0012, 0x0065}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, + {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, + {0x0013, 0x004a}, {0x0012, 0x0066}, {0x0013, 0x004b}, {0x0012, 0x0067}, {0x0012, 0x0068}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, + {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, + {0x0013, 0x0057}, {0x0012, 0x0069}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, + {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, + {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, + {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, + {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, + {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, + {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, + {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, + {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, + {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, + {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, + {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, +}; + +const unsigned int c_aaiCQMFHuffDec11[43][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000000, 0x00000002, 0x00000020, 0x00010001, 0x00010001, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010021, 0x00010021, }, + {0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000004, 0x00000014, 0x00000033, 0x00000040, 0x00000041, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, + {0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020051, 0x00020051, 0x00020051, 0x00020051, }, + {0x0014ffff, 0x000bffff, 0x000affff, 0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000044, 0x00000053, 0x00010005, 0x00010005, 0x00010025, 0x00010025, 0x00010050, 0x00010050, 0x00010052, 0x00010052, }, + {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, + {0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, + {0x00000070, 0x00000072, 0x00010017, 0x00010017, 0x00010027, 0x00010027, 0x00010036, 0x00010036, 0x00010046, 0x00010046, 0x00010055, 0x00010055, 0x00010063, 0x00010063, 0x00010071, 0x00010071, }, + {0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0011ffff, 0x0010ffff, 0x0012ffff, 0x0013ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000007, 0x00000064, }, + {0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, + {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, + {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, + {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020057, 0x00020057, 0x00020057, 0x00020057, }, + {0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, + {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, + {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020093, 0x00020093, 0x00020093, 0x00020093, }, + {0x0018ffff, 0x0017ffff, 0x0019ffff, 0x0015ffff, 0x0016ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, + {0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, }, + {0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, }, + {0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, }, + {0x00010008, 0x00010008, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010018, 0x00010018, }, + {0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, + {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, + {0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, }, + {0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010084, 0x00010084, 0x00010085, 0x00010085, }, + {0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, }, + {0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010092, 0x00010092, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, + {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, + {0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, }, + {0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, }, + {0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, }, + {0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, }, + {0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, }, + {0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, }, + {0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, }, + {0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, }, + {0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, }, + {0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, }, + {0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, }, +}; + +const unsigned int c_aaiCQMFHuffEnc12[400][2] = +{ + {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0005, 0x0002}, {0x0007, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0009}, {0x000f, 0x0011}, + {0x0012, 0x0053}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, + {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0004, 0x0007}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0003}, + {0x0007, 0x0004}, {0x0009, 0x0004}, {0x000c, 0x0008}, {0x000e, 0x000c}, {0x0010, 0x001b}, {0x0011, 0x002e}, {0x0013, 0x009d}, {0x0014, 0x0009}, + {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, + {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0004}, {0x0008, 0x0004}, {0x000a, 0x0005}, {0x000d, 0x000a}, {0x000f, 0x0012}, + {0x0011, 0x002f}, {0x0013, 0x009e}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, + {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0007, 0x0005}, + {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000e, 0x000d}, {0x000f, 0x0013}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0014, 0x001c}, {0x0014, 0x001d}, + {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, + {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0006}, {0x000d, 0x000b}, {0x000e, 0x000e}, {0x0010, 0x001c}, + {0x0012, 0x0054}, {0x0013, 0x009f}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, + {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x000a, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0007}, {0x000b, 0x0007}, + {0x000d, 0x000c}, {0x000e, 0x000f}, {0x000f, 0x0014}, {0x0011, 0x0032}, {0x0013, 0x00a0}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, + {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, + {0x000d, 0x000d}, {0x000c, 0x0009}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000e, 0x0010}, {0x0010, 0x001d}, {0x0010, 0x001e}, {0x0013, 0x00a1}, + {0x0013, 0x00a2}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, + {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x000f, 0x0015}, {0x000e, 0x0011}, {0x000f, 0x0016}, {0x000f, 0x0017}, + {0x0010, 0x001f}, {0x0011, 0x0033}, {0x0012, 0x0055}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, + {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, + {0x0011, 0x0034}, {0x0010, 0x0020}, {0x0010, 0x0021}, {0x0011, 0x0035}, {0x0012, 0x0056}, {0x0013, 0x00a3}, {0x0014, 0x0053}, {0x0014, 0x0054}, + {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, + {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0012, 0x0057}, {0x0012, 0x0058}, {0x0014, 0x0061}, {0x0014, 0x0062}, + {0x0012, 0x0059}, {0x0014, 0x0063}, {0x0012, 0x005a}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, + {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, + {0x0014, 0x0071}, {0x0012, 0x005b}, {0x0014, 0x0072}, {0x0013, 0x00a4}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, + {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, + {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, + {0x0014, 0x0087}, {0x0013, 0x00a5}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, + {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, + {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, + {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, + {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, + {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, + {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, + {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, + {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, + {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, + {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, + {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, + {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, + {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, + {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, + {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, + {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, + {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, + {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, + {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, + {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, + {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, +}; + +const unsigned int c_aaiCQMFHuffDec12[44][16] = +{ + {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000001, 0x00000002, 0x00000014, 0x00000028, 0x0000002a, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010029, 0x00010029, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0000002c, 0x00000052, 0x00010004, 0x00010004, 0x00010018, 0x00010018, 0x0001003f, 0x0001003f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, + {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, + {0x0018ffff, 0x000fffff, 0x000effff, 0x000dffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000001a, 0x00000079, 0x00010041, 0x00010041, 0x00010054, 0x00010054, 0x00010067, 0x00010067, }, + {0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, + {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, + {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, + {0x000000a1, 0x000000a2, 0x00010007, 0x00010007, 0x0001002f, 0x0001002f, 0x00010043, 0x00010043, 0x0001006a, 0x0001006a, 0x0001008c, 0x0001008c, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, }, + {0x0029ffff, 0x002affff, 0x002bffff, 0x0017ffff, 0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000001c, 0x00000057, 0x0000007d, 0x0000007e, 0x00000090, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, + {0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, + {0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, + {0x0001006c, 0x0001006c, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x000100a5, 0x000100a5, 0x000100cb, 0x000100cb, 0x000100e1, 0x000100e1, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, }, + {0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001001e, 0x0001001e, 0x00010031, 0x00010031, 0x00010059, 0x00010059, }, + {0x001affff, 0x001bffff, 0x0019ffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, }, + {0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, }, + {0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, }, + {0x00000026, 0x00000027, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003a, 0x0000003b, 0x00000046, 0x00000047, 0x00000048, 0x00000049, }, + {0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, }, + {0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, }, + {0x0000009d, 0x0000009e, 0x0000009f, 0x000000a6, 0x000000a7, 0x000000a8, 0x000000a9, 0x000000aa, 0x000000ab, 0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, }, + {0x000000b3, 0x000000b6, 0x000000b7, 0x000000b9, 0x000000bb, 0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, 0x000000c6, }, + {0x000000c7, 0x000000c8, 0x000000ca, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, }, + {0x000000d9, 0x000000da, 0x000000db, 0x000000dc, 0x000000dd, 0x000000de, 0x000000df, 0x000000e0, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, }, + {0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, }, + {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, + {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, + {0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, }, + {0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, 0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, }, + {0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, }, + {0x0000014a, 0x0000014b, 0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, }, + {0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, 0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, }, + {0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, }, + {0x0000017a, 0x0000017b, 0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, }, +}; + +const unsigned int c_aaiCQMFHuffEnc13[625][2] = +{ + {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0005}, {0x0008, 0x0006}, {0x000a, 0x0008}, {0x000c, 0x000c}, + {0x000e, 0x0019}, {0x0010, 0x0049}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, + {0x000b, 0x0009}, {0x000d, 0x0011}, {0x000f, 0x002a}, {0x0010, 0x004a}, {0x0011, 0x0084}, {0x0012, 0x0100}, {0x0013, 0x000f}, {0x0013, 0x0010}, + {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, + {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0005, 0x0008}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x0009}, {0x0006, 0x0007}, {0x0008, 0x0007}, + {0x0009, 0x0008}, {0x000b, 0x000a}, {0x000d, 0x0012}, {0x000f, 0x002b}, {0x0012, 0x0101}, {0x0012, 0x0102}, {0x0013, 0x001b}, {0x0013, 0x001c}, + {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, + {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0005, 0x000a}, {0x0004, 0x000d}, {0x0005, 0x000b}, {0x0006, 0x0008}, {0x0007, 0x0007}, + {0x0009, 0x0009}, {0x000a, 0x0009}, {0x000c, 0x000d}, {0x000d, 0x0013}, {0x0010, 0x004b}, {0x0010, 0x004c}, {0x0013, 0x0028}, {0x0013, 0x0029}, + {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, + {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0008}, + {0x0008, 0x0008}, {0x000a, 0x000a}, {0x000b, 0x000b}, {0x000d, 0x0014}, {0x000e, 0x001a}, {0x0011, 0x0085}, {0x0010, 0x004d}, {0x0013, 0x0036}, + {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, + {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0008, 0x0009}, {0x0007, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000c}, {0x000c, 0x000e}, {0x000e, 0x001b}, {0x000f, 0x002c}, {0x0011, 0x0086}, {0x0013, 0x0044}, + {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, + {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x000a, 0x000c}, {0x0009, 0x000a}, + {0x0009, 0x000b}, {0x000a, 0x000d}, {0x000b, 0x000d}, {0x000c, 0x000f}, {0x000e, 0x001c}, {0x000e, 0x001d}, {0x0011, 0x0087}, {0x0011, 0x0088}, + {0x0012, 0x0103}, {0x0012, 0x0104}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, + {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x000c, 0x0010}, + {0x000b, 0x000e}, {0x000b, 0x000f}, {0x000c, 0x0011}, {0x000d, 0x0015}, {0x000e, 0x001e}, {0x000f, 0x002d}, {0x0011, 0x0089}, {0x0011, 0x008a}, + {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, + {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, + {0x000e, 0x001f}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000e, 0x0020}, {0x000e, 0x0021}, {0x000f, 0x002e}, {0x0010, 0x004e}, {0x0013, 0x0070}, + {0x0012, 0x0105}, {0x0012, 0x0106}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, + {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, + {0x0013, 0x007f}, {0x0010, 0x004f}, {0x000f, 0x002f}, {0x000f, 0x0030}, {0x000f, 0x0031}, {0x0010, 0x0050}, {0x0011, 0x008b}, {0x0011, 0x008c}, + {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, + {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, + {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0012, 0x0107}, {0x0010, 0x0051}, {0x0010, 0x0052}, {0x0010, 0x0053}, {0x0011, 0x008d}, {0x0011, 0x008e}, + {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, + {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, + {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0011, 0x008f}, {0x0011, 0x0090}, {0x0013, 0x00a5}, {0x0011, 0x0091}, {0x0013, 0x00a6}, + {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, + {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, + {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, + {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, + {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, + {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, + {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, + {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, + {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, + {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, + {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, + {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, + {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, + {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, + {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, + {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, + {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, + {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, + {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, + {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, + {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, + {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, + {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, + {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, + {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, + {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, + {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, + {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, + {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, + {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, + {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, + {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, + {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, + {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, + {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, + {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, + {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, + {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, + {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, + {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, + {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, + {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, {0x0013, 0x01f3}, {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, + {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, {0x0013, 0x01fb}, {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, + {0x0013, 0x01ff}, + +}; + +const unsigned int c_aaiCQMFHuffDec13[98][16] = +{ + {0x0006ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000001, 0x00000019, 0x0000001b, 0x0000001c, 0x00000033, 0x00000034, 0x0000004c, 0x0001001a, 0x0001001a, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, + {0x00010067, 0x00010067, 0x0001007e, 0x0001007e, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, + {0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, + {0x000cffff, 0x000bffff, 0x000affff, 0x0008ffff, 0x0007ffff, 0x0009ffff, 0x00000005, 0x00000037, 0x00000068, 0x0000007d, 0x0000007f, 0x00000080, 0x0001001e, 0x0001001e, 0x0001004f, 0x0001004f, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, + {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020099, 0x00020099, 0x00020099, 0x00020099, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, + {0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, + {0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, + {0x000000af, 0x000000b2, 0x00010020, 0x00010020, 0x00010039, 0x00010039, 0x0001006a, 0x0001006a, 0x00010082, 0x00010082, 0x0001009a, 0x0001009a, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, }, + {0x001effff, 0x002fffff, 0x0040ffff, 0x0051ffff, 0x0014ffff, 0x0013ffff, 0x0011ffff, 0x0012ffff, 0x000effff, 0x000dffff, 0x000fffff, 0x0010ffff, 0x00000007, 0x00000052, 0x00000083, 0x0000009b, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, + {0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, + {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, }, + {0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, }, + {0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, + {0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, }, + {0x000000e5, 0x000000fb, 0x000000fc, 0x000000fd, 0x00010022, 0x00010022, 0x0001003b, 0x0001003b, 0x00010085, 0x00010085, 0x000100b5, 0x000100b5, 0x000100cd, 0x000100cd, 0x000100e2, 0x000100e2, }, + {0x001cffff, 0x001dffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x00000009, 0x00000023, 0x00000054, 0x00000055, 0x0000006e, 0x000000ce, 0x000000e1, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, + {0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, }, + {0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, }, + {0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, }, + {0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, }, + {0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, }, + {0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, }, + {0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200fa, 0x000200fa, 0x000200fa, 0x000200fa, }, + {0x0021ffff, 0x0023ffff, 0x0022ffff, 0x0025ffff, 0x0024ffff, 0x0026ffff, 0x0029ffff, 0x001fffff, 0x0020ffff, 0x0027ffff, 0x0028ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, }, + {0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, }, + {0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, + {0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, }, + {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, + {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010026, 0x00010026, }, + {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, + {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, + {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, + {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, + {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, }, + {0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, }, + {0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, }, + {0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, + {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, }, + {0x000100cf, 0x000100cf, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, }, + {0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, }, + {0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, }, + {0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, + {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, }, + {0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, }, + {0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, }, + {0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010115, 0x00010115, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, + {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, + {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, + {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, }, + {0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, + {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, + {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, }, + {0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, }, + {0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, }, + {0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, }, + {0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, }, + {0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, }, + {0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, }, + {0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, }, + {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, + {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, + {0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, }, + {0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, }, + {0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, }, + {0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, }, + {0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, }, + {0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, }, + {0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, }, + {0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, }, + {0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, }, + {0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, }, + {0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, }, + {0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, }, + {0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, }, + {0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, }, + {0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, }, + {0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, }, + {0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, }, + {0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, }, + {0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, }, + {0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, }, + {0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, }, + {0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, }, + {0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, }, + {0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, }, + {0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, 0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, }, + {0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, }, + {0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, 0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, }, + {0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, }, + {0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, 0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, }, + {0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, }, +}; + +const unsigned int c_aaiCQMFHuffEnc14[625][2] = +{ + {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0006, 0x0007}, {0x0007, 0x0007}, {0x0009, 0x0009}, {0x000a, 0x000a}, + {0x000c, 0x000e}, {0x000e, 0x0019}, {0x000f, 0x0029}, {0x0010, 0x0046}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, + {0x0013, 0x000c}, {0x0005, 0x000b}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x000c}, {0x0006, 0x0008}, {0x0008, 0x0008}, + {0x0009, 0x000a}, {0x000b, 0x000c}, {0x000c, 0x000f}, {0x000e, 0x001a}, {0x0010, 0x0047}, {0x0010, 0x0048}, {0x0012, 0x00f1}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, + {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0005, 0x000d}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x000e}, {0x0006, 0x0009}, {0x0007, 0x0008}, + {0x0008, 0x0009}, {0x000a, 0x000b}, {0x000b, 0x000d}, {0x000d, 0x0013}, {0x000e, 0x001b}, {0x0010, 0x0049}, {0x0013, 0x0018}, {0x0013, 0x0019}, + {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, + {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0005, 0x000f}, {0x0004, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x000a}, + {0x0007, 0x0009}, {0x0009, 0x000b}, {0x000a, 0x000c}, {0x000c, 0x0010}, {0x000d, 0x0014}, {0x000f, 0x002a}, {0x0012, 0x00f2}, {0x0013, 0x0025}, + {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, + {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0006, 0x000b}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0006, 0x000c}, + {0x0007, 0x000a}, {0x0008, 0x000a}, {0x000a, 0x000d}, {0x000b, 0x000e}, {0x000c, 0x0011}, {0x000e, 0x001c}, {0x000f, 0x002b}, {0x0011, 0x0081}, + {0x0013, 0x0032}, {0x0012, 0x00f3}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, + {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0007, 0x000b}, {0x0006, 0x000d}, {0x0007, 0x000c}, + {0x0007, 0x000d}, {0x0008, 0x000b}, {0x0009, 0x000c}, {0x000b, 0x000f}, {0x000c, 0x0012}, {0x000d, 0x0015}, {0x000e, 0x001d}, {0x0010, 0x004a}, + {0x0011, 0x0082}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, + {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0009, 0x000d}, {0x0008, 0x000c}, + {0x0008, 0x000d}, {0x0009, 0x000e}, {0x000a, 0x000e}, {0x000b, 0x0010}, {0x000c, 0x0013}, {0x000d, 0x0016}, {0x000e, 0x001e}, {0x000f, 0x002c}, + {0x0010, 0x004b}, {0x0012, 0x00f4}, {0x0012, 0x00f5}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, + {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x000a, 0x000f}, + {0x0009, 0x000f}, {0x000a, 0x0010}, {0x000a, 0x0011}, {0x000b, 0x0011}, {0x000c, 0x0014}, {0x000d, 0x0017}, {0x000e, 0x001f}, {0x000f, 0x002d}, + {0x0010, 0x004c}, {0x0011, 0x0083}, {0x0011, 0x0084}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, + {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, + {0x000c, 0x0015}, {0x000b, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0016}, {0x000c, 0x0017}, {0x000d, 0x0018}, {0x000e, 0x0020}, {0x000f, 0x002e}, + {0x0011, 0x0085}, {0x0010, 0x004d}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, + {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, + {0x0013, 0x0072}, {0x000e, 0x0021}, {0x000d, 0x0019}, {0x000d, 0x001a}, {0x000d, 0x001b}, {0x000e, 0x0022}, {0x000f, 0x002f}, {0x0010, 0x004e}, + {0x0011, 0x0086}, {0x0011, 0x0087}, {0x0013, 0x0073}, {0x0012, 0x00f6}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, + {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, + {0x0013, 0x0080}, {0x0013, 0x0081}, {0x000f, 0x0030}, {0x000e, 0x0023}, {0x000e, 0x0024}, {0x000e, 0x0025}, {0x0010, 0x004f}, {0x0012, 0x00f7}, + {0x0011, 0x0088}, {0x0012, 0x00f8}, {0x0012, 0x00f9}, {0x0012, 0x00fa}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, + {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, + {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0012, 0x00fb}, {0x0010, 0x0050}, {0x0010, 0x0051}, {0x000f, 0x0031}, {0x0012, 0x00fc}, + {0x0012, 0x00fd}, {0x0012, 0x00fe}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, + {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, + {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0011, 0x0089}, {0x0011, 0x008a}, + {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0011, 0x008b}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, + {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, + {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0012, 0x00ff}, {0x0013, 0x00ba}, + {0x0012, 0x0100}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, + {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, + {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, + {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, + {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, + {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, + {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, + {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, + {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, + {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, + {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, + {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, + {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, + {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, + {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, + {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, + {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, + {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, + {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, + {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, + {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, + {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, + {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, + {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, + {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, + {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, + {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, + {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, + {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, + {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, + {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, + {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, + {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, + {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, + {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, + {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, + {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, + {0x0012, 0x0101}, + +}; + +const unsigned int c_aaiCQMFHuffDec14[103][16] = +{ + {0x000affff, 0x0009ffff, 0x0008ffff, 0x0002ffff, 0x0003ffff, 0x0001ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x00000033, 0x00000034, 0x0000004c, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, + {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, }, + {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, + {0x00010037, 0x00010037, 0x00010050, 0x00010050, 0x00010068, 0x00010068, 0x0001007d, 0x0001007d, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00020004, 0x00020004, 0x00020004, 0x00020004, }, + {0x0012ffff, 0x0011ffff, 0x000fffff, 0x0010ffff, 0x000cffff, 0x000bffff, 0x000dffff, 0x000effff, 0x0000001f, 0x00000038, 0x00000069, 0x00000081, 0x00000097, 0x00000098, 0x00010005, 0x00010005, }, + {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, + {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, + {0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, }, + {0x0001009b, 0x0001009b, 0x000100b3, 0x000100b3, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x000200af, 0x000200af, 0x000200af, 0x000200af, }, + {0x00000053, 0x0000006c, 0x00000084, 0x0000009c, 0x000000b4, 0x000000c8, 0x000000cb, 0x000000cc, 0x00010021, 0x00010021, 0x0001003a, 0x0001003a, 0x0001006b, 0x0001006b, 0x00010083, 0x00010083, }, + {0x0028ffff, 0x0039ffff, 0x004affff, 0x0023ffff, 0x001cffff, 0x001bffff, 0x0019ffff, 0x0018ffff, 0x001affff, 0x0015ffff, 0x0013ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x00000008, 0x00000022, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, }, + {0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, }, + {0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, }, + {0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, }, + {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, }, + {0x000100fa, 0x000100fa, 0x00010116, 0x00010116, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, + {0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200fb, 0x000200fb, 0x000200fb, 0x000200fb, }, + {0x00000114, 0x00000115, 0x0001000a, 0x0001000a, 0x00010055, 0x00010055, 0x0001006e, 0x0001006e, 0x0001009f, 0x0001009f, 0x000100b7, 0x000100b7, 0x000100cf, 0x000100cf, 0x000100e6, 0x000100e6, }, + {0x001fffff, 0x001dffff, 0x001effff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000000b, 0x00000024, 0x00000025, 0x0000003d, 0x00000087, 0x000000a0, 0x000000b8, 0x000000d1, 0x000000e7, 0x000000fe, }, + {0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, }, + {0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, }, + {0x00020148, 0x00020148, 0x00020148, 0x00020148, 0x00020270, 0x00020270, 0x00020270, 0x00020270, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, }, + {0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, }, + {0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, }, + {0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, }, + {0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, }, + {0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, + {0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200ff, 0x000200ff, 0x000200ff, 0x000200ff, }, + {0x00020101, 0x00020101, 0x00020101, 0x00020101, 0x00020102, 0x00020102, 0x00020102, 0x00020102, 0x00020103, 0x00020103, 0x00020103, 0x00020103, 0x00020113, 0x00020113, 0x00020113, 0x00020113, }, + {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x00020146, 0x00020146, 0x00020146, 0x00020146, }, + {0x0031ffff, 0x002dffff, 0x002bffff, 0x002cffff, 0x002effff, 0x002fffff, 0x0032ffff, 0x0037ffff, 0x0029ffff, 0x002affff, 0x0030ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0038ffff, }, + {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, + {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, }, + {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, + {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, + {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, + {0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, }, + {0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100bb, 0x000100bb, }, + {0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, + {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010070, 0x00010070, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, }, + {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, + {0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, + {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, }, + {0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100ea, 0x000100ea, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, + {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, + {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, }, + {0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, }, + {0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, }, + {0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, }, + {0x00010112, 0x00010112, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, + {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, + {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010133, 0x00010133, }, + {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, + {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, + {0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010147, 0x00010147, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, }, + {0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, }, + {0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, }, + {0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, }, + {0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, }, + {0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, }, + {0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, }, + {0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, }, + {0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, }, + {0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, }, + {0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, }, + {0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, }, + {0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, }, + {0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, }, + {0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, }, + {0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, }, + {0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, }, + {0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, }, + {0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, }, + {0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, }, + {0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, }, + {0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, }, + {0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, }, + {0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, }, + {0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, }, + {0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, }, + {0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, }, + {0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, }, + {0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, }, + {0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, }, + {0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, }, + {0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, }, + {0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, 0x00010245, 0x00010245, }, + {0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, }, + {0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, 0x00010255, 0x00010255, }, + {0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, }, + {0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, 0x00010265, 0x00010265, }, + {0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, }, +}; + +const unsigned int c_aaiCQMFHuffEnc15[28][2] = +{ + {0x0003, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, + {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000f, 0x0003}, + {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, + {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, + +}; + +const unsigned int c_aaiCQMFHuffDec15[10][16] = +{ + {0x0001ffff, 0x00000005, 0x00010000, 0x00010000, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, + {0x0002ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0003ffff, 0x0000000d, 0x0001000c, 0x0001000c, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0001000f, 0x0001000f, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, +}; + +const unsigned int c_aaiCQMFHuffEnc16[32][2] = +{ + {0x0003, 0x0001}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0001}, {0x0005, 0x0001}, + {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, + {0x0010, 0x0007}, {0x0011, 0x0001}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, + {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, +}; + +const unsigned int c_aaiCQMFHuffDec16[11][16] = +{ + {0x0001ffff, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0002ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, +}; + +const unsigned int c_aaiCQMFHuffEnc17[41][2] = +{ + {0x0004, 0x0001}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0002}, + {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, + {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x0010, 0x0003}, {0x0011, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, + {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, + {0x0013, 0x0013}, + +}; + +const unsigned int c_aaiCQMFHuffDec17[7][16] = +{ + {0x0001ffff, 0x00000000, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, }, + {0x0002ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003ffff, 0x00000010, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x00000013, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, }, + {0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, }, +}; + +const unsigned int c_aaiCQMFHuffEnc18[40][2] = +{ + {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, + {0x0004, 0x0005}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, + {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0011, 0x0003}, {0x0012, 0x0004}, + {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0012, 0x0005}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, + {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0013, 0x0007}, +}; + +const unsigned int c_aaiCQMFHuffDec18[7][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00000000, 0x00000006, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, }, + {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0004ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x0006ffff, 0x0005ffff, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x00000018, 0x00000019, 0x0000001a, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00010027, 0x00010027, }, +}; + +const unsigned int c_aaiCQMFHuffEnc19[47][2] = +{ + {0x0004, 0x0002}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, + {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0007, 0x0002}, + {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000e, 0x0002}, {0x000e, 0x0003}, + {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0011, 0x0009}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0001}, {0x0012, 0x0002}, + {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, + {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, + +}; + +const unsigned int c_aaiCQMFHuffDec19[10][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003ffff, 0x00000011, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x0004ffff, 0x00000015, 0x00010014, 0x00010014, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0005ffff, 0x00000018, 0x00000019, 0x0000001a, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, + {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, +}; + +const unsigned int c_aaiCQMFHuffEnc20[58][2] = +{ + {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, + {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0002}, + {0x0007, 0x0003}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, + {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0003}, {0x000f, 0x0005}, {0x0011, 0x0007}, + {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0011, 0x0008}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, + {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0011, 0x0009}, + {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, + {0x0011, 0x0012}, {0x0011, 0x0013}, + +}; + +const unsigned int c_aaiCQMFHuffDec20[17][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000002, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00010001, 0x00010001, 0x00010003, 0x00010003, 0x00010004, 0x00010004, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0004ffff, 0x0003ffff, 0x00000011, 0x00000012, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x0006ffff, 0x0005ffff, 0x00000019, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x000fffff, 0x0010ffff, 0x000effff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x0001001e, 0x0001001e, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, +}; + +const unsigned int c_aaiCQMFHuffEnc21[70][2] = +{ + {0x0005, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, + {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, + {0x0005, 0x0007}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, + {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, + {0x000c, 0x0003}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0004}, {0x000f, 0x0007}, {0x000e, 0x0005}, {0x0011, 0x0004}, + {0x0010, 0x000d}, {0x0011, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, + {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, + {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, + {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, + +}; + +const unsigned int c_aaiCQMFHuffDec21[23][16] = +{ + {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x0006ffff, 0x0005ffff, 0x00000018, 0x00000019, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000020, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, + {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, + {0x0016ffff, 0x0015ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x00000028, 0x00010025, 0x00010025, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, + {0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, }, + {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, }, +}; + +const unsigned int c_aaiCQMFHuffEnc22[81][2] = +{ + {0x0005, 0x0004}, {0x0004, 0x0006}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0004, 0x0007}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0007}, + {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0003}, + {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, + {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, + {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0005}, {0x000e, 0x0005}, + {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x0010, 0x0011}, {0x0010, 0x0012}, {0x0011, 0x0000}, {0x0011, 0x0001}, + {0x0011, 0x0002}, {0x0010, 0x0013}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, + {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, + {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, + {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, + {0x0011, 0x0021}, + +}; + +const unsigned int c_aaiCQMFHuffDec22[30][16] = +{ + {0x0005ffff, 0x0006ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x0004ffff, 0x00000001, 0x00000004, 0x0000000a, 0x0000000c, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x0001000b, 0x0001000b, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000017, 0x00000018, 0x00000019, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x000cffff, 0x000bffff, 0x000affff, 0x00000023, 0x00000024, 0x00000025, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x001dffff, 0x0000002c, 0x0000002d, 0x00000031, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, }, + {0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, + {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, + {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, + {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, + {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, + {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, + {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, +}; + +const unsigned int c_aaiCQMFHuffEnc23[93][2] = +{ + {0x0005, 0x0004}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, + {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, + {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, + {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, + {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000b, 0x0003}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0004}, + {0x000c, 0x0005}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x0010, 0x0014}, {0x000f, 0x000b}, + {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x000f, 0x000f}, {0x0011, 0x0002}, {0x0011, 0x0003}, + {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, + {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, + {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, + {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, + {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0010, 0x0015}, + +}; + +const unsigned int c_aaiCQMFHuffDec23[35][16] = +{ + {0x0006ffff, 0x0007ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x000affff, 0x0008ffff, 0x0009ffff, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x000effff, 0x000dffff, 0x000bffff, 0x000cffff, 0x00000027, 0x00000028, 0x00010023, 0x00010023, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000002e, 0x0000005c, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010035, 0x00010035, }, + {0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, }, + {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, + {0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, + {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, + {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, + {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, + {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, + {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, + {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, }, + {0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, +}; + +const unsigned int c_aaiCQMFHuffEnc24[121][2] = +{ + {0x0006, 0x0005}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, + {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, + {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, + {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0004}, {0x0007, 0x0005}, + {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, + {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, + {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000d, 0x0004}, + {0x000c, 0x0007}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, + {0x0010, 0x000f}, {0x000f, 0x000c}, {0x0011, 0x0016}, {0x0010, 0x0010}, {0x000f, 0x000d}, {0x0010, 0x0011}, {0x0012, 0x0000}, {0x0011, 0x0017}, + {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, + {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, + {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, + {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, + {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, + {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, + {0x0011, 0x001d}, + +}; + +const unsigned int c_aaiCQMFHuffDec24[37][16] = +{ + {0x000dffff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000001, 0x00000002, 0x00000003, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x0011ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, }, + {0x0015ffff, 0x0014ffff, 0x0012ffff, 0x0013ffff, 0x00000034, 0x00000035, 0x00000036, 0x00000038, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x00000043, 0x00000045, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010044, 0x00010044, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, + {0x0024ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x00000040, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, }, + {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, }, + {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, + {0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, }, + {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, + {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, + {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, + {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, + {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, + {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, }, + {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, + {0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, }, + {0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, +}; + +const unsigned int c_aaiCQMFHuffEnc25[136][2] = +{ + {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, + {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, + {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0007}, {0x0006, 0x0008}, + {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, + {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, + {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, + {0x0008, 0x0009}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0004}, {0x000a, 0x0005}, + {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0005}, + {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, + {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000f, 0x0010}, {0x000e, 0x000b}, {0x000f, 0x0011}, {0x0010, 0x001b}, {0x0010, 0x001c}, {0x0010, 0x001d}, + {0x0010, 0x001e}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, + {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0010, 0x001f}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, + {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, + {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, + {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, {0x0011, 0x0024}, {0x0011, 0x0025}, + {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0011, 0x002a}, {0x0011, 0x002b}, {0x0011, 0x002c}, {0x0011, 0x002d}, + {0x0011, 0x002e}, {0x0011, 0x002f}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0011, 0x0034}, {0x0011, 0x0035}, +}; + +const unsigned int c_aaiCQMFHuffDec25[54][16] = +{ + {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, + {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, + {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, }, + {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x001affff, 0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x0001004a, 0x0001004a, 0x0001004c, 0x0001004c, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, + {0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x0000005a, }, + {0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, }, + {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, + {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, + {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, + {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, + {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, + {0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, + {0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, }, + {0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, + {0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, + {0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, + {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, + {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, + {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, + {0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, + {0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, }, + {0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, }, + {0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, + {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, }, + {0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, }, + {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, }, + {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, + {0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, }, + {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, }, + {0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, + {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, }, + {0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, }, + {0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, }, +}; + +const unsigned int c_aaiCQMFHuffEnc26[164][2] = +{ + {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, + {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, + {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0005, 0x001f}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, + {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, + {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, + {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, + {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0005}, {0x000a, 0x0006}, + {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, + {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, + {0x000d, 0x0008}, {0x000e, 0x0006}, {0x000d, 0x0009}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0008}, {0x000f, 0x0009}, + {0x000f, 0x000a}, {0x0011, 0x0014}, {0x0010, 0x000b}, {0x000f, 0x000b}, {0x0010, 0x000c}, {0x0012, 0x001b}, {0x0010, 0x000d}, {0x0010, 0x000e}, + {0x0011, 0x0015}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0010, 0x000f}, {0x0012, 0x001e}, {0x0013, 0x0000}, {0x0012, 0x001f}, {0x0013, 0x0001}, + {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0012, 0x0020}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, + {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, + {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, + {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, + {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, + {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, + {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, + {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, + +}; + +const unsigned int c_aaiCQMFHuffDec26[38][16] = +{ + {0x000fffff, 0x0010ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, }, + {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, + {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, + {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, + {0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, + {0x001affff, 0x0019ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, + {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, + {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, + {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x0001005b, 0x0001005b, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, + {0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x001dffff, 0x001cffff, 0x001effff, 0x001fffff, 0x001bffff, 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005f, 0x00000063, }, + {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, + {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, + {0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, }, + {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, }, + {0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, }, + {0x00010065, 0x00010065, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, }, + {0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, }, + {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, }, + {0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, }, + {0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, }, + {0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, }, +}; + +extern const unsigned int (*GetHuffEncTable(const int iAlloc))[2]; + +extern const unsigned int (*GetHuffDecTable(const int iAlloc))[16]; + diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h new file mode 100644 index 0000000000..b8103689fe --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h @@ -0,0 +1,305 @@ +#ifndef _CQMF_HUFF_H_ +#define _CQMF_HUFF_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef HUFF_READ_SIZE +#define HUFF_READ_SIZE (4) +#endif + +#ifndef HUFF_DEC_TABLE_SIZE +#define HUFF_DEC_TABLE_SIZE (16) +#endif + +#include // For NULL + +extern const unsigned int c_aaiCQMFHuffEnc1[16][2]; + +extern const unsigned int c_aaiCQMFHuffDec1[4][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc2[25][2]; + +extern const unsigned int c_aaiCQMFHuffDec2[4][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc3[36][2]; + +extern const unsigned int c_aaiCQMFHuffDec3[14][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc4[49][2]; + +extern const unsigned int c_aaiCQMFHuffDec4[9][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc5[64][2]; + +extern const unsigned int c_aaiCQMFHuffDec5[27][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc6[81][2]; + +extern const unsigned int c_aaiCQMFHuffDec6[21][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc7[81][2]; + +extern const unsigned int c_aaiCQMFHuffDec7[23][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc8[121][2]; + +extern const unsigned int c_aaiCQMFHuffDec8[17][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc9[196][2]; + +extern const unsigned int c_aaiCQMFHuffDec9[30][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc10[196][2]; + +extern const unsigned int c_aaiCQMFHuffDec10[34][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc11[256][2]; + +extern const unsigned int c_aaiCQMFHuffDec11[43][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc12[400][2]; + +extern const unsigned int c_aaiCQMFHuffDec12[44][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc13[625][2]; + +extern const unsigned int c_aaiCQMFHuffDec13[98][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc14[625][2]; + +extern const unsigned int c_aaiCQMFHuffDec14[103][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc15[28][2]; + +extern const unsigned int c_aaiCQMFHuffDec15[10][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc16[32][2]; + +extern const unsigned int c_aaiCQMFHuffDec16[11][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc17[41][2]; + +extern const unsigned int c_aaiCQMFHuffDec17[7][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc18[40][2]; + +extern const unsigned int c_aaiCQMFHuffDec18[7][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc19[47][2]; + +extern const unsigned int c_aaiCQMFHuffDec19[10][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc20[58][2]; + +extern const unsigned int c_aaiCQMFHuffDec20[17][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc21[70][2]; + +extern const unsigned int c_aaiCQMFHuffDec21[23][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc22[81][2]; + +extern const unsigned int c_aaiCQMFHuffDec22[30][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc23[93][2]; + +extern const unsigned int c_aaiCQMFHuffDec23[35][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc24[121][2]; + +extern const unsigned int c_aaiCQMFHuffDec24[37][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc25[136][2]; + +extern const unsigned int c_aaiCQMFHuffDec25[54][HUFF_DEC_TABLE_SIZE]; + +extern const unsigned int c_aaiCQMFHuffEnc26[164][2]; + +extern const unsigned int c_aaiCQMFHuffDec26[38][HUFF_DEC_TABLE_SIZE]; + +inline const unsigned int (*GetHuffEncTable(const int iAlloc))[2] +{ + const unsigned int (*pauiHuffmanTable)[2] = NULL; + + switch(iAlloc){ + case 1: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc1; + break; + case 2: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc2; + break; + case 3: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc3; + break; + case 4: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc4; + break; + case 5: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc5; + break; + case 6: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc6; + break; + case 7: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc7; + break; + case 8: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc8; + break; + case 9: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc9; + break; + case 10: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc10; + break; + case 11: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc11; + break; + case 12: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc12; + break; + case 13: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc13; + break; + case 14: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc14; + break; + case 15: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc15; + break; + case 16: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc16; + break; + case 17: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc17; + break; + case 18: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc18; + break; + case 19: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc19; + break; + case 20: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc20; + break; + case 21: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc21; + break; + case 22: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc22; + break; + case 23: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc23; + break; + case 24: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc24; + break; + case 25: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc25; + break; + case 26: + pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc26; + break; + + } + + return pauiHuffmanTable; +} + +inline const unsigned int (*GetHuffDecTable(const int iAlloc))[16] +{ + const unsigned int (*pauiHuffmanTable)[16] = NULL; + + switch(iAlloc){ + case 1: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec1; + break; + case 2: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec2; + break; + case 3: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec3; + break; + case 4: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec4; + break; + case 5: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec5; + break; + case 6: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec6; + break; + case 7: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec7; + break; + case 8: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec8; + break; + case 9: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec9; + break; + case 10: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec10; + break; + case 11: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec11; + break; + case 12: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec12; + break; + case 13: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec13; + break; + case 14: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec14; + break; + case 15: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec15; + break; + case 16: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec16; + break; + case 17: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec17; + break; + case 18: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec18; + break; + case 19: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec19; + break; + case 20: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec20; + break; + case 21: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec21; + break; + case 22: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec22; + break; + case 23: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec23; + break; + case 24: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec24; + break; + case 25: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec25; + break; + case 26: + pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec26; + break; + + } + + return pauiHuffmanTable; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_HUFF_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c new file mode 100644 index 0000000000..e2f7ea62b1 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c @@ -0,0 +1,47 @@ +#include "NoiseGen.h" +#include +#include +#include +#include "wmops.h" + +NoiseGen* CreateNoiseGen() +{ + int n; + + NoiseGen *psNoiseGen = NULL; + + psNoiseGen = (NoiseGen*)malloc(sizeof(NoiseGen)); + psNoiseGen->iNoiseBufferLength = 2048; + psNoiseGen->iNoiseBufferMask = 2047; + psNoiseGen->iNoiseBufferIndex = 0; + + psNoiseGen->pfNoiseBuffer = (float*)malloc(psNoiseGen->iNoiseBufferLength * sizeof(float)); + + /* Generate Laplacian distributed noise */ + for(n = 0; n < psNoiseGen->iNoiseBufferLength; n ++){ + float fNoise = 0.0; + float fScale = 0.707f; + fNoise = (float)((rand() & (RAND_MAX - 1)) - (RAND_MAX >> 1)) / (float)RAND_MAX; + + if(fNoise < 0.0){ + fNoise = fScale * logf(1.0f + 1.9999999f * fNoise); + } + else{ + fNoise = -fScale * logf(1.0f - 1.9999999f * fNoise); + } + + psNoiseGen->pfNoiseBuffer[n] = fNoise; + } + + return psNoiseGen; +} + +void DeleteNoiseGen(NoiseGen *psNoiseGen) +{ + free(psNoiseGen->pfNoiseBuffer); + free(psNoiseGen); +} + +extern float GetNoise(NoiseGen *psNoiseGen); + + diff --git a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h new file mode 100644 index 0000000000..1a4ccb924c --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h @@ -0,0 +1,35 @@ +#ifndef _NOISE_GEN_H_ +#define _NOISE_GEN_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct NOISE_GEN{ + int iNoiseBufferLength; + int iNoiseBufferMask; + int iNoiseBufferIndex; + float *pfNoiseBuffer; +}NoiseGen; + +NoiseGen* CreateNoiseGen(); + +void DeleteNoiseGen(NoiseGen *psNoiseGen); + +inline float GetNoise(NoiseGen *psNoiseGen) +{ + float fNoiseSample; + + fNoiseSample = psNoiseGen->pfNoiseBuffer[psNoiseGen->iNoiseBufferIndex]; + psNoiseGen->iNoiseBufferIndex ++; + psNoiseGen->iNoiseBufferIndex &= psNoiseGen->iNoiseBufferMask; + + return fNoiseSample; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _NOISE_GEN_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c b/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c new file mode 100644 index 0000000000..2e7e8568e7 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c @@ -0,0 +1,160 @@ +#include "PerceptualModel.h" +#include "Tables.h" +#include "wmops.h" + +#define LOG_ADD_TABLE_LENGTH (512) + +const int c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { + 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D, 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39, + 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, + 0x31, 0x31, 0x31, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2B, + 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x29, 0x29, 0x29, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26, 0x26, + 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23, 0x23, 0x23, 0x23, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21, + 0x20, 0x20, 0x20, 0x20, 0x1F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1D, 0x1D, 0x1D, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1B, 0x1B, 0x1B, 0x1B, 0x1A, 0x1A, 0x1A, 0x1A, 0x19, 0x19, 0x19, 0x19, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x17, 0x16, 0x16, 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x15, + 0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, + 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0F, 0x0F, 0x0F, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x09, 0x09, + 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + + +static inline int LogAdd(int iVal1,int iVal2) +{ + int iRetVal; + + if(iVal1 > iVal2){ + iRetVal = iVal1 - iVal2; + iRetVal = (iRetVal < (LOG_ADD_TABLE_LENGTH - 1)) ? iRetVal : (LOG_ADD_TABLE_LENGTH - 1); + iRetVal = iVal1 + c_aiLogAddTable[iRetVal]; + } + else{ + iRetVal = iVal2 - iVal1; + iRetVal = (iRetVal < (LOG_ADD_TABLE_LENGTH - 1)) ? iRetVal : (LOG_ADD_TABLE_LENGTH - 1); + iRetVal = iVal2 + c_aiLogAddTable[iRetVal]; + } + + return iRetVal; +} + +const int c_aiBandwidthAdjust48[MAX_BANDS_48] = { + 0,0,0,0,0,0,0,0,0,0,0,64,64,64,64,64, + 101,101,128,165,165,180,213,}; + +const int c_aiAbsoluteThresh48[MAX_BANDS_48] = { + -1787,-1787,-1787,-1787,-1787,-1787,-1787,-1787,-1782,-1761,-1737,-1679,-1638,-1613,-1590,-1568, + -1516,-1459,-1395,-1289,-671,-409,-401,}; + +const int c_aiDefaultTheta48[MAX_BANDS_48] = { + 7,7,6,5,5,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4, +}; + +const int c_aaiSpreadFunction48[MAX_BANDS_48][MAX_BANDS_48] = { + 0,-1561,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-289,-4,-1234,-2295,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-569,-229, + -8,-905,-1705,-2324,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-789,-445,-173,-16,-656,-1271,-1765,-2172,-2520,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-961,-616,-340,-136, + -28,-488,-976,-1382,-1729,-2032,-2305,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-1088,-743,-465,-257,-148,-31,-371,-769,-1114,-1417,-1689,-2054,-2483, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1198,-852,-574,-364,-209,-148, + -42,-300,-635,-936,-1207,-1572,-2000,-2376,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-1293,-948,-669,-458,-301,-183,-145,-56,-258,-547,-816,-1179,-1606,-1982,-2311, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1375,-1029,-750,-539,-381,-260,-180,-142, + -68,-231,-487,-846,-1272,-1647,-1976,-2261,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1444, + -1099,-820,-608,-449,-328,-233,-194,-138,-77,-213,-555,-978,-1352,-1681,-1966,-2268, + -2552,-2552,-2552,-2552,-2552,-2552,-1501,-1155,-876,-665,-505,-383,-287,-210,-193,-130, + -79,-298,-711,-1083,-1411,-1696,-1997,-2288,-2550,-2552,-2552,-2552,-2552,-1567,-1221,-942, + -730,-570,-448,-351,-272,-206,-189,-151,-72,-349,-713,-1039,-1324,-1625,-1915,-2177, + -2448,-2552,-2552,-2552,-1650,-1304,-1025,-813,-653,-530,-432,-352,-285,-227,-177,-163, + -69,-297,-613,-895,-1195,-1485,-1746,-2017,-2238,-2401,-2545,-1727,-1381,-1102,-890,-730, + -607,-509,-428,-360,-301,-249,-180,-153,-72,-257,-527,-824,-1112,-1373,-1643,-1865, + -2028,-2171,-1798,-1452,-1173,-960,-800,-677,-579,-498,-430,-370,-317,-246,-192,-145, + -76,-224,-505,-790,-1050,-1320,-1540,-1703,-1847,-1860,-1514,-1234,-1022,-862,-738,-640, + -559,-490,-430,-377,-306,-224,-197,-136,-81,-242,-515,-771,-1040,-1260,-1422,-1566, + -1923,-1577,-1297,-1085,-925,-801,-703,-621,-553,-492,-439,-367,-284,-213,-198,-144, + -83,-235,-479,-744,-963,-1125,-1268,-1986,-1640,-1360,-1148,-988,-864,-766,-684,-615, + -555,-501,-429,-345,-273,-211,-204,-146,-89,-216,-465,-680,-841,-984,-2043,-1697, + -1417,-1205,-1044,-921,-822,-741,-672,-611,-557,-485,-401,-328,-264,-211,-205,-140, + -93,-227,-430,-588,-729,-2104,-1758,-1479,-1266,-1106,-982,-884,-802,-733,-673,-619, + -546,-461,-388,-324,-269,-212,-211,-151,-100,-195,-336,-472,-2163,-1817,-1537,-1324, + -1164,-1040,-942,-860,-791,-731,-676,-604,-519,-445,-380,-325,-268,-226,-219,-147, + -114,-167,-280,-2203,-1857,-1577,-1365,-1205,-1081,-982,-901,-831,-771,-717,-644,-559, + -485,-420,-364,-306,-252,-239,-206,-132,-122,-163,-2224,-1878,-1598,-1386,-1225,-1102, + -1003,-921,-852,-792,-737,-665,-580,-505,-441,-385,-326,-271,-222,-224,-176,-121,-114, +}; + +#define PERCEPTUAL_MODEL_SCALE (64) + +#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) + +#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) + +#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) + +#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) + +#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (4) + +void PerceptualModel(const int iMaxQuantBands, + const int *piRMSEnvelope, + int *piExcitation, + int *piSMR) +{ + int n; + + for(n = 0; n < iMaxQuantBands; n ++){ + int iSLOffset; + + piExcitation[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n]; + // Calculate sensation level offset + iSLOffset = c_aiDefaultTheta48[n] * (piExcitation[n] - c_aiAbsoluteThresh48[n]) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; + //iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; + // Offset envelope by sensation level offset + piExcitation[n] -= iSLOffset; + // Convert to loudness domain (x^0.3) + piExcitation[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + } + + // Spread excitation function + for(n = 0; n < iMaxQuantBands; n ++){ + int k; + const int *piSpread; + + piSpread = c_aaiSpreadFunction48[n]; + piSMR[n] = piExcitation[n] + piSpread[n]; + for(k = 0; k < iMaxQuantBands; k ++){ + if(k != n){ + piSMR[n] = LogAdd(piSMR[n],piExcitation[k] + piSpread[k]); + } + } + } + + for(n = 0; n < iMaxQuantBands; n ++){ + piSMR[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + piSMR[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n] - piSMR[n]; + } +} diff --git a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h b/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h new file mode 100644 index 0000000000..e9d62c8106 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h @@ -0,0 +1,18 @@ +#ifndef _PERCEPTUAL_MODEL_H_ +#define _PERCEPTUAL_MODEL_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +void PerceptualModel(const int iMaxQuantBands, + const int *piRMSEnvelope, + int *piExcitation, + int *piSMR); + +#ifdef __cplusplus +} +#endif + +#endif /* _PERCEPTUAL_MODEL_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c b/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c new file mode 100644 index 0000000000..9e314fcd08 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c @@ -0,0 +1,31 @@ +#include "RMSEnvDeltaHuff.h" +#include "wmops.h" + +const unsigned int c_aaiRMSEnvHuffEnc[64][2] = +{ + {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0003}, {0x0013, 0x0004}, + {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0012, 0x000b}, {0x000d, 0x0002}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000d, 0x0003}, + {0x000b, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0008, 0x0005}, + {0x0008, 0x0006}, {0x0007, 0x0004}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0005, 0x0003}, {0x0004, 0x0002}, {0x0003, 0x0002}, {0x0002, 0x0002}, + {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x0009, 0x0008}, + {0x0009, 0x0009}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, + {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, +}; + +const unsigned int c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = +{ + {0x0002ffff, 0x0001ffff, 0x0000001d, 0x00000022, 0x0001001e, 0x0001001e, 0x00010021, 0x00010021, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000017, 0x00000018, 0x00000025, 0x00010019, 0x00010019, 0x00010024, 0x00010024, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x0009ffff, 0x0008ffff, 0x0000002c, 0x0000002d, 0x00010010, 0x00010010, 0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x000bffff, 0x000cffff, 0x000affff, 0x00000031, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, + {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, +}; diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h b/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h new file mode 100644 index 0000000000..e7e1059384 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h @@ -0,0 +1,25 @@ +#ifndef _RMS_ENV_DELTA_HUFF_H_ +#define _RMS_ENV_DELTA_HUFF_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef HUFF_READ_SIZE +#define HUFF_READ_SIZE (4) +#endif + +#ifndef HUFF_DEC_TABLE_SIZE +#define HUFF_DEC_TABLE_SIZE (16) +#endif + +extern const unsigned int c_aaiRMSEnvHuffEnc[64][2]; + +extern const unsigned int c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RMS_ENV_DELTA_HUFF_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c new file mode 100644 index 0000000000..f51051d52d --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c @@ -0,0 +1,378 @@ +#include "RMSEnvGrouping.h" + +/* Double check cost function calculation */ + +#include +#include +#include +#include +#include "wmops.h" +#include "Tables.h" + +typedef struct GMNODE{ + int iGroupStart; + int iGroupLength; + float *pfMergedEnergydB; + struct GMNODE *psNext; +}GMNode; + +typedef struct RMS_ENVELOPE_GROUPING +{ + int iNumBlocks; + int iMaxGroups; + float **ppfBandEnergy; + float **ppfBandEnergydB; + float **ppfWeight; + GMNode *psGMNodes; +}RMSEnvelopeGrouping; + +RMSEnvelopeGrouping* CreateRMSEnvelopeGrouping(int iNumBlocks) +{ + int n; + assert((iNumBlocks & 0x1) == 0); // remove this + + RMSEnvelopeGrouping *psRMSEnvelopeGrouping; + + psRMSEnvelopeGrouping = (RMSEnvelopeGrouping*)malloc(sizeof(RMSEnvelopeGrouping)); + psRMSEnvelopeGrouping->iNumBlocks = iNumBlocks; + psRMSEnvelopeGrouping->iMaxGroups = iNumBlocks >> 1; // Change this + + psRMSEnvelopeGrouping->ppfBandEnergy = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + psRMSEnvelopeGrouping->ppfBandEnergydB = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + psRMSEnvelopeGrouping->ppfWeight = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ + psRMSEnvelopeGrouping->ppfBandEnergy[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); /* 2 for stereo joint group calc */ + psRMSEnvelopeGrouping->ppfBandEnergydB[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); + psRMSEnvelopeGrouping->ppfWeight[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); + } + + psRMSEnvelopeGrouping->psGMNodes = (GMNode*)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(GMNode)); + for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ + psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); + } + + return psRMSEnvelopeGrouping; +} + +void DeleteRMSEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping) +{ + int n; + + for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ + free(psRMSEnvelopeGrouping->ppfBandEnergy[n]); + free(psRMSEnvelopeGrouping->ppfBandEnergydB[n]); + free(psRMSEnvelopeGrouping->ppfWeight[n]); + } + free(psRMSEnvelopeGrouping->ppfBandEnergy); + free(psRMSEnvelopeGrouping->ppfBandEnergydB); + free(psRMSEnvelopeGrouping->ppfWeight); + + for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ + free(psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB); + } + free(psRMSEnvelopeGrouping->psGMNodes); + + free(psRMSEnvelopeGrouping); +} + + +void ComputeBandEnergy(const int iChannels, + const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + float **ppfBandEnergy, + float **ppfBandEnergydB, + float **ppfWeight) +{ + int n; + + for(n = 0; n < iChannels; n ++){ + int k; + int iChanOffset; + + iChanOffset = n * iNumBands; + for(k = 0; k < iNumBlocks; k ++){ + int b; + int iFBOffset; + iFBOffset = 0; + for(b = 0; b < iNumBands; b ++){ + int m; + float fEnergy = 1e-12f; + //float fWeight; + + for(m = 0; m < piBandwidths[b]; m ++){ + fEnergy += (pppfReal[n][k][iFBOffset] * pppfReal[n][k][iFBOffset] + pppfImag[n][k][iFBOffset] * pppfImag[n][k][iFBOffset]); + iFBOffset ++; + } + fEnergy /= (float)(2 * piBandwidths[b]); + ppfBandEnergy[k][iChanOffset + b] = fEnergy; + ppfBandEnergydB[k][iChanOffset + b] = 10.0f * log10f(fEnergy); + + ppfWeight[k][iChanOffset + b] = 1.0; + } + } + } +} + +/* THis is temporary cost function */ +float TryMerge(const int iNumBands, + const int iStartBlock, + const int iGroupLength, + const float fMaxAllowedDiffdB, + const float **ppfBandEnergy, + const float **ppfBandEnergydB, + float *pfMegredEnergydB) +{ + int b; + int n; + float fMeanCost; + float fMaxCost; + float fInvGroupSize = 1.0f / (float)iGroupLength; + float fInvNumBands = 1.0f / (float)iNumBands; + + for(b = 0; b < iNumBands; b ++){ + float fGroupEnergy; + + + fGroupEnergy = 0.0; + for(n = iStartBlock; n < (iStartBlock + iGroupLength); n ++){ + fGroupEnergy += ppfBandEnergy[n][b]; + } + fGroupEnergy *= fInvGroupSize; + fGroupEnergy = 10.0f * log10f(fGroupEnergy); //Note epsolon was added when computing BandEnergy; + + pfMegredEnergydB[b] = fGroupEnergy; + } + + fMeanCost = 0.0; + fMaxCost = 0.0; + for(n = iStartBlock; n < (iStartBlock + iGroupLength); n ++){ + float fMeanAbsDiff; + float fMaxAbsDiff; + + fMeanAbsDiff = 0.0; + fMaxAbsDiff = 0.0; + for(b = 0; b < iNumBands; b ++){ + float fAbsDiff; + + fAbsDiff = fabsf(ppfBandEnergydB[n][b] - pfMegredEnergydB[b]); + fMeanAbsDiff += fAbsDiff; + fMaxAbsDiff = (fMaxAbsDiff > fAbsDiff) ? fMaxAbsDiff : fAbsDiff; + } + fMeanAbsDiff *= fInvNumBands; + + fMeanCost = (fMeanCost > fMeanAbsDiff) ? fMeanCost : fMeanAbsDiff; + fMaxCost = (fMaxCost > fMaxAbsDiff) ? fMaxCost : fMaxAbsDiff; + } + + //printf("%f\t%f\n",fMeanCost,fMaxCost); + + if(fMaxCost > fMaxAllowedDiffdB){ + fMeanCost = 1e12f; //Some large value + } + + return fMeanCost; +} + +void ComputeGreedyGroups(RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int iChannels, + const int iNumBands, + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB) +{ + float fBestMeanCost; + + fBestMeanCost = 0.0; + while(fBestMeanCost < fMeanAllowedDiffdB){ + GMNode *psGMNode; + GMNode *psBestGMNode; + + fBestMeanCost = fMeanAllowedDiffdB; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while(psGMNode->psNext != NULL){ + float fMeanCost; + int iGroupLength; + + iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; + + fMeanCost = TryMerge(iNumBands * iChannels, + psGMNode->iGroupStart, + psGMNode->iGroupLength, + fMaxAllowedDiffdB, + (const float**)psRMSEnvelopeGrouping->ppfBandEnergy, + (const float**)psRMSEnvelopeGrouping->ppfBandEnergydB, + psGMNode->pfMergedEnergydB); + + + if(fMeanCost < fBestMeanCost){ + fBestMeanCost = fMeanCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + + if(fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL){ + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + } + } +} + + +void ComputeRMSEnvelope(const int iChannels, + const int iNumBands, + const int iNumGroups, + const int *piGroupLengths, + const float **ppfBandEnergy, + int ***pppiRMSEnvelope) +{ + int n; + + for(n = 0; n < iChannels; n ++){ + int b; + int iChanOffset; + + iChanOffset = n * iNumBands; + for(b = 0; b < iNumBands; b ++){ + int k; + int iBlockOffset; + + iBlockOffset = 0; + for(k = 0; k < iNumGroups; k ++){ + int m; + float fGroupEnergy; + fGroupEnergy = 0.0; + for(m = 0; m < piGroupLengths[k]; m ++){ + fGroupEnergy += ppfBandEnergy[iBlockOffset][b + iChanOffset]; + iBlockOffset ++; + } + fGroupEnergy /= (float)piGroupLengths[k]; + + pppiRMSEnvelope[n][k][b] = (int)(log2f(fGroupEnergy) + 0.5); + pppiRMSEnvelope[n][k][b] = (pppiRMSEnvelope[n][k][b] > ENV_MIN) ? pppiRMSEnvelope[n][k][b] : ENV_MIN; + pppiRMSEnvelope[n][k][b] = (pppiRMSEnvelope[n][k][b] < ENV_MAX) ? pppiRMSEnvelope[n][k][b] : ENV_MAX; + } + } + } +} + +void LimitRMSEnvelope(const int iBandCount, + const int iRMSDeltaMax, + const int iRMSDeltaMin, + int *piRMSEnvelope) +{ + int iBand; + int iLastSCF; + + /* Increase low envelope values to ensure that the scale factors traces the large values correctly (checking for max deltas) */ + iLastSCF = piRMSEnvelope[iBandCount - 1]; + for(iBand = iBandCount - 2; iBand > -1; iBand --) + { + int iDelta; + + iDelta = iLastSCF - piRMSEnvelope[iBand]; + + if(iDelta > iRMSDeltaMax){ +#ifdef DEBUG_VERBOSE + printf("WARNING ScaleFactor Delta limited\n"); +#endif + piRMSEnvelope[iBand] += (iDelta - iRMSDeltaMax); + } + + iLastSCF = piRMSEnvelope[iBand]; + } + + /* Increase low envelope values to ensure that the envelope traces the large values correctly (checking for min deltas)*/ + iLastSCF = piRMSEnvelope[0]; + for(iBand = 1; iBand < iBandCount; iBand ++){ + int iDelta; + + iDelta = piRMSEnvelope[iBand] - iLastSCF; + + if(iDelta < iRMSDeltaMin){ +#ifdef DEBUG_VERBOSE + printf("WARNING ScaleFactor Delta limited\n"); +#endif + piRMSEnvelope[iBand] += (iRMSDeltaMin - iDelta); + } + + iLastSCF = piRMSEnvelope[iBand]; + } +} + +void ComputeEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int iChannels, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB, + int *piNumGroups, + int *piGroupLengths, + int ***pppiRMSEnvelope) +{ + int n; + GMNode *psGMNode; + + /* Compute Band Energies */ + ComputeBandEnergy(iChannels, + psRMSEnvelopeGrouping->iNumBlocks, + iNumBands, + piBandwidths, + pppfReal, + pppfImag, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, + psRMSEnvelopeGrouping->ppfWeight); + + /* Init GMNodes */ + psRMSEnvelopeGrouping->psGMNodes[0].iGroupStart = 0; + psRMSEnvelopeGrouping->psGMNodes[0].iGroupLength = 2; + psRMSEnvelopeGrouping->psGMNodes[0].psNext = NULL; + for(n = 1; n < psRMSEnvelopeGrouping->iMaxGroups; n ++){ + psRMSEnvelopeGrouping->psGMNodes[n - 1].psNext = &psRMSEnvelopeGrouping->psGMNodes[n]; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupStart = n * 2; // change this + psRMSEnvelopeGrouping->psGMNodes[n].iGroupLength = 2; // change this + psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; + } + + /* Perform grouping via Greedy Merge */ + ComputeGreedyGroups(psRMSEnvelopeGrouping, + iChannels, + iNumBands, + fMeanAllowedDiffdB, + fMaxAllowedDiffdB); + + /* Calc Groups from Merge Results */ + *piNumGroups = 0; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + while(psGMNode != NULL){ + piGroupLengths[*piNumGroups] = psGMNode->iGroupLength; + *piNumGroups += 1; + psGMNode = psGMNode->psNext; + } + + /* Compute RMS Envelope given group lengths */ + ComputeRMSEnvelope(iChannels, + iNumBands, + *piNumGroups, + piGroupLengths, + (const float**)psRMSEnvelopeGrouping->ppfBandEnergy, + pppiRMSEnvelope); + + /* Envelope Tenting */ + for(n = 0; n < iChannels; n ++){ + int k; + for(k = 0; k < *piNumGroups; k ++){ + LimitRMSEnvelope(iNumBands, + ENV_DELTA_MAX, + ENV_DELTA_MIN, + pppiRMSEnvelope[n][k]); + } + } +} diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h new file mode 100644 index 0000000000..fa7506935f --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h @@ -0,0 +1,31 @@ +#ifndef _RMS_ENV_GROUPING_H_ +#define _RMS_ENV_GROUPING_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct RMS_ENVELOPE_GROUPING RMSEnvelopeGrouping; + +RMSEnvelopeGrouping* CreateRMSEnvelopeGrouping(int iNumBlocks); + +void DeleteRMSEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping); + +void ComputeEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int iChannels, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB, + int *piNumGroups, + int *piGroupLengths, + int ***pppiRMSEnvelope); + +#ifdef __cplusplus +} +#endif + +#endif /* _RMS_ENV_GROUPING_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/Tables.c b/lib_rend/ivas_cldfb_trans_codec/Tables.c new file mode 100644 index 0000000000..735c8d21f2 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/Tables.c @@ -0,0 +1,116 @@ +#include "Tables.h" +#include "wmops.h" + +/* Move this to perceptual model ? */ +const int c_aiBandwidths48[MAX_BANDS_48] = { + 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, +}; + + +const float c_afScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 0.353553390593f, + 0.420448207627f, + 0.500000000000f, + 0.594603557501f, + 0.707106781187f, + 0.840896415254f, + 1.000000000000f, + 1.189207115003f, + 1.414213562373f, + 1.681792830507f, + 2.000000000000f, + 2.378414230005f, + 2.828427124746f, + 3.363585661015f, + 4.0f, + 4.756828460011f, + 5.656854249492f, + 6.727171322030f, + 8.0f, + 9.513656920022f, + 11.31370849898f, + 13.45434264406f, + 16.00000000000f, + 19.02731384004f, + 22.62741699797f, + 26.90868528812f, //~40dB SNR +}; + +const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 2.367513562373095f, + 2.046407115002721f, + 1.775900000000000f, + 1.536446415253715f, + 1.323056781186548f, + 1.132903557501360f, + 0.965800000000000f, + 0.821348207626857f, + 0.695103390593274f, + 0.587801778750680f, + 0.495800000000000f, + 0.418124103813429f, + 0.352176695296637f, + 0.296200889375340f, + 0.249400000000000f, + 0.209812051906714f, + 0.176538347648318f, + 0.148525444687670f, + 0.124900000000000f, + 0.105056025953357f, + 0.088388347648318f, + 0.074325444687670f, + 0.062500000000000f, + 0.052556025953357f, + 0.044194173824159f, + 0.037162722343835f, +}; + +const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { + 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, + 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, + 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, + 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, + 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, + 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, + 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, + 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, + 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, + 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, + 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, + 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, + 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, + 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, + 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, + 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, + 4.29496730e+09f, +}; + +const int c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { + 0, 3, 4, 5, 6, 7, 8, 8, + 10, 13, 13, 15, 19, 24, 24, 27, + 31, 40, 39, 46, 57, 69, 80, 92, + 120, 135, 163, +}; + +const int c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, +}; + +const int c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { + 0, 4, 5, 6, 7, 8, 9, 9, + 11, 14, 14, 16, 20, 25, 25, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, +}; + +const int c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { + 1, 16, 25, 36, 49, 64, 81, 81, + 121, 196, 196, 256, 400, 625, 625, 28, + 32, 41, 40, 47, 58, 70, 81, 93, + 121, 136, 164, +}; diff --git a/lib_rend/ivas_cldfb_trans_codec/Tables.h b/lib_rend/ivas_cldfb_trans_codec/Tables.h new file mode 100644 index 0000000000..960ee0d231 --- /dev/null +++ b/lib_rend/ivas_cldfb_trans_codec/Tables.h @@ -0,0 +1,65 @@ +#ifndef _TABLES_H_ +#define _TABLES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define DEBUG_VERBOSE + +#define CQMF_BLOCKS_PER_FRAME (16) +#define CQMF_MAX_BLOCKS_PER_FRAME (16) +#define CQMF_BANDS (60) + +#define MAX_BANDS (23) +#define MAX_BANDS_48 (23) + +extern const int c_aiBandwidths48[MAX_BANDS_48]; // move this + + +#define ENV_MIN (-64) +#define ENV_MAX (64) + +#define ENV0_BITS (7) + +#define ENV_DELTA_MIN (-32) +#define ENV_DELTA_MAX (31) + +#define ENV_RECONSTRUCT_TABLE_SIZE (129) + +#define ENV_RECONSTRUCT_TABLE_CENTER (64) + +#define MIN_ALLOC (0) +#define MAX_ALLOC (26) + +#define ALLOC_OFFSET_SCALE (8) + +#define ALLOC_OFFSET_BITS (8) + +#define MIN_ALLOC_OFFSET (-128) +#define MAX_ALLOC_OFFSET (127) + + + +#define ALLOC_TABLE_SIZE (27) + +extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; + +extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; + +extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; + +extern const int c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; + +extern const int c_aiHuffmanDim[ALLOC_TABLE_SIZE]; + +extern const int c_aiHuffmanMod[ALLOC_TABLE_SIZE]; + +extern const int c_aiHuffmanSize[ALLOC_TABLE_SIZE]; + +#ifdef __cplusplus +} +#endif + +#endif /* _TABLES_H_ */ diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index 249acceea7..f89564fffc 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -50,7 +50,9 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error ivas_splitBinLCLDDecOpen( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ) + BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, + int32_t iSampleRate, + int32_t iChannels ) { ivas_error error; BIN_HR_SPLIT_LCLD_DEC_HANDLE splitBinLCLDDec; @@ -62,6 +64,30 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->pLcld_dec = NULL; // place holder for CLDFB decoder handle + splitBinLCLDDec->iChannels = iChannels; + splitBinLCLDDec->psCQMFDecoder = CreateCQMFDecoder( iSampleRate, iChannels ); + + splitBinLCLDDec->pppfDecCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDDec->pppfDecCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + for ( int32_t n = 0; n < splitBinLCLDDec->iChannels; n++ ) + { + splitBinLCLDDec->pppfDecCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDDec->pppfDecCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + } + +#ifdef CLDFB_DEBUG + splitBinLCLDDec->numFrame = 0; + char cldfbFilename[50] = "cldfb_out.bin"; + if ( ( splitBinLCLDDec->cldfbOut = fopen( cldfbFilename, "wb" ) ) == NULL ) + { + fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", cldfbFilename ); + exit( -1 ); + } + int num_bands = CLDFB_NO_CHANNELS_MAX; + fwrite( &iChannels, sizeof( int ), 1, splitBinLCLDDec->cldfbOut ); + fwrite( &num_bands, sizeof( int ), 1, splitBinLCLDDec->cldfbOut ); +#endif + *hSplitBinLCLDDec = splitBinLCLDDec; return error; } @@ -71,6 +97,26 @@ void ivas_splitBinLCLDDecClose( { if ( ( *hSplitBinLCLDDec ) != NULL ) { + if ( ( *hSplitBinLCLDDec )->psCQMFDecoder != NULL ) + { + DeleteCQMFDecoder( ( *hSplitBinLCLDDec )->psCQMFDecoder ); + } + + for ( int32_t n = 0; n < ( *hSplitBinLCLDDec )->iChannels; n++ ) + { + free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal[n] ); + free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag[n] ); + } + free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal ); + free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag ); + +#ifdef CLDFB_DEBUG + if ( ( *hSplitBinLCLDDec )->cldfbOut != NULL ) + { + fclose( ( *hSplitBinLCLDDec )->cldfbOut ); + } +#endif + count_free( *hSplitBinLCLDDec ); *hSplitBinLCLDDec = NULL; } @@ -87,6 +133,67 @@ void ivas_splitBinLCLDDecProcess( assert( Cldfb_Out_Real != NULL ); assert( Cldfb_Out_Imag != NULL ); assert( pBits != NULL ); + + int32_t iBytesWritten; + unsigned char auchData[4096]; + unsigned char *bval; + + iBytesWritten = ivas_split_rend_bitstream_read_int32( pBits, 8 * sizeof( uint16_t ) ); +#ifdef CLDFB_DEBUG + printf( "Bytes read = %d\n", iBytesWritten ); +#endif + bval = auchData; + for ( int32_t bytesCount = 0; bytesCount < iBytesWritten; bytesCount++ ) + { + *bval = (uint8_t) ivas_split_rend_bitstream_read_int32( pBits, 8 ); + bval++; + } + + // A conversion is needed for the 3d pointer interface here ........ :( + for ( int32_t n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + { + for ( int32_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + hSplitBinLCLDDec->pppfDecCQMFReal[n][k] = Cldfb_Out_Real[n][k]; + hSplitBinLCLDDec->pppfDecCQMFImag[n][k] = Cldfb_Out_Imag[n][k]; + } + } + + // Initialized with zeros....... :( + for ( int k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + for ( int b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + for ( int n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + { + hSplitBinLCLDDec->pppfDecCQMFReal[n][k][b] = 0.0; + hSplitBinLCLDDec->pppfDecCQMFImag[n][k][b] = 0.0; + } + } + } + + DecodeFrame( hSplitBinLCLDDec->psCQMFDecoder, iBytesWritten, auchData, hSplitBinLCLDDec->pppfDecCQMFReal, hSplitBinLCLDDec->pppfDecCQMFImag ); + +#ifdef CLDFB_DEBUG + printf( "Frame Decoded = %d\n", ++hSplitBinLCLDDec->numFrame ); + int writeByte = 0; + for ( int k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + for ( int b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + for ( int n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) + { + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + if ( writeByte != 1 ) + exit( -1 ); + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFImag[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + if ( writeByte != 1 ) + exit( -1 ); + } + } + } +#endif + return; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index 355712e327..97da222528 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -50,7 +50,10 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error ivas_splitBinLCLDEncOpen( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ) + BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, + int32_t iSampleRate, + int32_t iChannels, + int32_t iDataRate ) { ivas_error error; BIN_HR_SPLIT_LCLD_ENC_HANDLE splitBinLCLDEnc; @@ -62,6 +65,30 @@ ivas_error ivas_splitBinLCLDEncOpen( splitBinLCLDEnc->pLcld_enc = NULL; // place holder for CLDFB encoder handle + splitBinLCLDEnc->iChannels = iChannels; + splitBinLCLDEnc->psCQMFEncoder = CreateCQMFEncoder( iSampleRate, iChannels, iDataRate ); + + splitBinLCLDEnc->pppfCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDEnc->pppfCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + for ( int32_t n = 0; n < splitBinLCLDEnc->iChannels; n++ ) + { + splitBinLCLDEnc->pppfCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDEnc->pppfCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + } + +#ifdef CLDFB_DEBUG + splitBinLCLDEnc->numFrame = 0; + char cldfbFilename[50] = "cldfb_in_ref.qmf"; + if ( ( splitBinLCLDEnc->cldfbIn = fopen( cldfbFilename, "rb" ) ) == NULL ) + { + fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", cldfbFilename ); + exit( -1 ); + } + int chan, band; + fread( &chan, sizeof( int ), 1, splitBinLCLDEnc->cldfbIn ); + fread( &band, sizeof( int ), 1, splitBinLCLDEnc->cldfbIn ); +#endif + *hSplitBinLCLDEnc = splitBinLCLDEnc; return error; } @@ -71,6 +98,23 @@ void ivas_splitBinLCLDEncClose( { if ( ( *hSplitBinLCLDEnc ) != NULL ) { + DeleteCQMFEncoder( ( *hSplitBinLCLDEnc )->psCQMFEncoder ); + + for ( int32_t n = 0; n < ( *hSplitBinLCLDEnc )->iChannels; n++ ) + { + free( ( *hSplitBinLCLDEnc )->pppfCQMFReal[n] ); + free( ( *hSplitBinLCLDEnc )->pppfCQMFImag[n] ); + } + free( ( *hSplitBinLCLDEnc )->pppfCQMFReal ); + free( ( *hSplitBinLCLDEnc )->pppfCQMFImag ); + +#ifdef CLDFB_DEBUG + if ( ( *hSplitBinLCLDEnc )->cldfbIn != NULL ) + { + fclose( ( *hSplitBinLCLDEnc )->cldfbIn ); + } +#endif + count_free( *hSplitBinLCLDEnc ); *hSplitBinLCLDEnc = NULL; } @@ -87,6 +131,85 @@ void ivas_splitBinLCLDEncProcess( assert( Cldfb_In_Real != NULL ); assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); + + int32_t iBytesWritten; + uint16_t ushBytes; + unsigned char auchData[4096]; + unsigned char *bval; + int32_t code; + + iBytesWritten = 4096; + + // A conversion is needed for the 3d pointer interface here ........ :( + for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { + for ( int32_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + hSplitBinLCLDEnc->pppfCQMFReal[n][k] = Cldfb_In_Real[n][k]; + hSplitBinLCLDEnc->pppfCQMFImag[n][k] = Cldfb_In_Imag[n][k]; + } + } + +#ifdef CLDFB_DEBUG + int readByte = 0; + for ( int k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + for ( int b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + for ( int n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { +#if 0 + readByte = fread(&hSplitBinLCLDEnc->pppfCQMFReal[n][k][b], sizeof(float), 1, hSplitBinLCLDEnc->cldfbIn); + if ( readByte != 1 ) + break; + readByte = fread(&hSplitBinLCLDEnc->pppfCQMFImag[n][k][b], sizeof(float), 1, hSplitBinLCLDEnc->cldfbIn); +#else + readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + if ( readByte != 1 ) + break; + readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); +#endif + } + } + } + + if ( readByte == 1 ) + { + printf( "Frame Read = %d\n", ++hSplitBinLCLDEnc->numFrame ); + } + else + { + printf( "Writing zeroes...\n" ); + for ( int k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + for ( int b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) + { + for ( int n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) + { + hSplitBinLCLDEnc->pppfCQMFReal[n][k][b] = 0.f; + hSplitBinLCLDEnc->pppfCQMFImag[n][k][b] = 0.f; + } + } + } + } +#endif + + EncodeFrame( hSplitBinLCLDEnc->psCQMFEncoder, hSplitBinLCLDEnc->pppfCQMFReal, hSplitBinLCLDEnc->pppfCQMFImag, &iBytesWritten, auchData ); + + bval = auchData; + ushBytes = (uint16_t) iBytesWritten; + ivas_split_rend_bitstream_write_int32( pBits, (int32_t) ushBytes, 8 * sizeof( uint16_t ) ); + for ( int32_t bytesCount = 0; bytesCount < iBytesWritten; bytesCount++ ) + { + code = (int32_t) *bval; + ivas_split_rend_bitstream_write_int32( pBits, code, 8 ); + bval++; + } + +#ifdef CLDFB_DEBUG + printf( "Bytes written = %d\n", iBytesWritten ); +#endif + return; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 8c37efcef3..f5f34302f9 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1169,7 +1169,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, cons { return error; } - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc ); + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, 384000 ); break; case SPLIT_REND_POST: error = ivas_splitBinPostRendOpen( &hSplitRendWrapper->hBinHrSplitPostRend, OutSampleRate ); @@ -1177,7 +1177,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, cons { return error; } - error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec ); + error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec, OutSampleRate, 2 ); if ( error != IVAS_ERR_OK ) { return error; @@ -1194,7 +1194,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, cons { return error; } - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc ); + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, 384000 ); if ( error != IVAS_ERR_OK ) { return error; @@ -1204,7 +1204,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, cons { return error; } - error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec ); + error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec, OutSampleRate, 2 ); break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -1296,12 +1296,6 @@ ivas_error ivas_renderMultiBinToSplitBinaural( /*CLFDB decoding and SPLIT post rendering MD based adjustments*/ { - ivas_splitBinLCLDDecProcess( - hSplitBin->hSplitBinLCLDDec, - pBits, - Cldfb_In_BinReal[0], - Cldfb_In_BinImag[0] ); - ivas_splitBinPostRendMdDec( pBits, hSplitBin->hBinHrSplitPostRend, @@ -1310,6 +1304,12 @@ ivas_error ivas_renderMultiBinToSplitBinaural( #endif MAX_SPLIT_REND_MD_BANDS ); + ivas_splitBinLCLDDecProcess( + hSplitBin->hSplitBinLCLDDec, + pBits, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0] ); + ivas_rend_CldfbSplitPostRendProcess( hSplitBin->hBinHrSplitPostRend, QuaternionsPre, diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f604c309e9..098ecf562b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1003,6 +1003,7 @@ static CREND_WRAPPER defaultCrendWrapper( return w; } + static ivas_error setRendInputActiveIsm( void *input, const IVAS_REND_AudioConfig inConfig, @@ -1829,7 +1830,8 @@ static ivas_error initSbaPanGainsForSbaOut( return error; } -static ivas_error updateSbaPanGains( +static ivas_error +updateSbaPanGains( input_sba *inputSba, const IVAS_REND_AudioConfig outConfig, RENDER_CONFIG_DATA *hRendCfg ) @@ -3155,7 +3157,11 @@ ivas_error IVAS_REND_GetDelay( latency_ns += IVAS_FB_DEC_DELAY_NS; *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); } - else + else if ( hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend != NULL ) + { + latency_ns = 0; + *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); + } #endif { latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; -- GitLab From bf339f0d98f5bda084b23be4bb5155882625ee98 Mon Sep 17 00:00:00 2001 From: advasila Date: Mon, 16 Jan 2023 09:36:44 +0200 Subject: [PATCH 0006/1418] update project files --- Workspace_msvc/lib_enc.vcxproj | 1 + Workspace_msvc/lib_enc.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index a2d1e13ae7..21973c8968 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -213,6 +213,7 @@ + diff --git a/Workspace_msvc/lib_enc.vcxproj.filters b/Workspace_msvc/lib_enc.vcxproj.filters index 8fe608e0a6..a0fb055f48 100644 --- a/Workspace_msvc/lib_enc.vcxproj.filters +++ b/Workspace_msvc/lib_enc.vcxproj.filters @@ -584,6 +584,9 @@ enc_ivas_c + + enc_ivas_c + -- GitLab From 7e1872b6c3b4c0c15182120ad1b9260a98a25b24 Mon Sep 17 00:00:00 2001 From: Shanush Prema Thasarathan Date: Wed, 18 Jan 2023 11:08:25 +1100 Subject: [PATCH 0007/1418] Rename ivas_cldfb_trans_codec/Bitstream.* to ivas_cldfb_trans_codec/cldfb_codec_bitstream.* to avoid name clash --- .../{Bitstream.c => cldfb_codec_bitstream.c} | 0 .../{Bitstream.h => cldfb_codec_bitstream.h} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lib_rend/ivas_cldfb_trans_codec/{Bitstream.c => cldfb_codec_bitstream.c} (100%) rename lib_rend/ivas_cldfb_trans_codec/{Bitstream.h => cldfb_codec_bitstream.h} (100%) diff --git a/lib_rend/ivas_cldfb_trans_codec/Bitstream.c b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c similarity index 100% rename from lib_rend/ivas_cldfb_trans_codec/Bitstream.c rename to lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c diff --git a/lib_rend/ivas_cldfb_trans_codec/Bitstream.h b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h similarity index 100% rename from lib_rend/ivas_cldfb_trans_codec/Bitstream.h rename to lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h -- GitLab From 84c7598ae14642ed85f08f17f8aecc6e92e541a2 Mon Sep 17 00:00:00 2001 From: Shanush Prema Thasarathan Date: Wed, 18 Jan 2023 11:18:37 +1100 Subject: [PATCH 0008/1418] Fix makefile such that code will compile on Mac (and therefore Linux?) --- Makefile | 2 +- lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c | 2 +- lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c | 2 +- lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 141a607b07..d5b9a8781a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SRC_LIBCOM = lib_com SRC_LIBDEBUG = lib_debug SRC_LIBDEC = lib_dec SRC_LIBENC = lib_enc -SRC_LIBREND = lib_rend +SRC_LIBREND = lib_rend lib_rend/ivas_cldfb_trans_codec SRC_LIBUTIL = lib_util SRC_APP = apps BUILD = build diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c index 40d627e612..370aa0dbd1 100644 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c @@ -10,7 +10,7 @@ #include "RMSEnvDeltaHuff.h" #include "CQMFHuff.h" #include "NoiseGen.h" -#include "Bitstream.h" +#include "cldfb_codec_bitstream.h" typedef struct CQMF_DECODER{ int iSampleRate; diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c index a7db7969e9..6795f9327c 100644 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c @@ -10,7 +10,7 @@ #include "PerceptualModel.h" #include "RMSEnvDeltaHuff.h" #include "CQMFHuff.h" -#include "Bitstream.h" +#include "cldfb_codec_bitstream.h" typedef struct CQMF_ENCODER{ int iSampleRate; diff --git a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c index e542fcb15e..4317e0ec12 100644 --- a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c +++ b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c @@ -1,4 +1,4 @@ -#include "Bitstream.h" +#include "cldfb_codec_bitstream.h" #include #include -- GitLab From 649f4a5d250a0b7b30fc72992becfa00b4f3efc6 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 18 Jan 2023 15:04:44 +1100 Subject: [PATCH 0009/1418] fixing the msvs project file with new file name --- Workspace_msvc/lib_rend.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 0cef2758b9..979e35246c 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -197,7 +197,7 @@ - + -- GitLab From 295920de2e2c65c546f2f763648f6e56c897db46 Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 20 Jan 2023 11:52:44 +1100 Subject: [PATCH 0010/1418] debugging switch for CLDFB codec --- lib_com/options.h | 1 + lib_rend/ivas_splitRendererPre.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 1f12475cfb..486d61584e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,7 @@ //#define SPLIT_REND_WITH_HEAD_ROT_DEBUG // only for debugging purposes #define SPLIT_REND_BASE2_CODING //#define SPLIT_REND_SKIP_POST_REND +//#define SPLIT_REND_SKIP_CLDFB_CODEC #endif /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index f5f34302f9..0ad960cc4a 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1286,11 +1286,13 @@ ivas_error ivas_renderMultiBinToSplitBinaural( max_bands, pBits ); +#ifndef SPLIT_REND_SKIP_CLDFB_CODEC ivas_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal[0], Cldfb_In_BinImag[0], pBits ); +#endif /*CLFDB decoding and SPLIT post rendering MD based adjustments*/ @@ -1304,11 +1306,13 @@ ivas_error ivas_renderMultiBinToSplitBinaural( #endif MAX_SPLIT_REND_MD_BANDS ); +#ifndef SPLIT_REND_SKIP_CLDFB_CODEC ivas_splitBinLCLDDecProcess( hSplitBin->hSplitBinLCLDDec, pBits, Cldfb_In_BinReal[0], Cldfb_In_BinImag[0] ); +#endif ivas_rend_CldfbSplitPostRendProcess( hSplitBin->hBinHrSplitPostRend, -- GitLab From 55d707f438693d635e549342c7ca2e3953ec61ea Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Sun, 22 Jan 2023 16:57:15 +0200 Subject: [PATCH 0011/1418] Updates to contribution 26. --- apps/decoder.c | 14 +- lib_com/ivas_cnst.h | 1 + lib_com/ivas_ism_config.c | 28 ++- lib_com/ivas_prot.h | 11 +- lib_com/ivas_rom_com.c | 10 +- lib_dec/ivas_cpe_dec.c | 14 +- lib_dec/ivas_dec.c | 4 + lib_dec/ivas_init_dec.c | 4 +- lib_dec/ivas_masa_dec.c | 58 +++-- lib_dec/ivas_qmetadata_dec.c | 123 +++++++---- lib_enc/ivas_cpe_enc.c | 14 +- lib_enc/ivas_enc.c | 10 +- lib_enc/ivas_masa_enc.c | 387 ++++++++++++++++++++------------- lib_enc/ivas_qmetadata_enc.c | 403 ++++++++++++++++++++++++++--------- 14 files changed, 756 insertions(+), 325 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 79cfb67d4f..7f50bcda88 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -708,7 +708,7 @@ static bool parseCmdlIVAS_dec( int16_t i; char argv_to_upper[FILENAME_MAX]; #ifdef MASAISM_EDIT_OBJECTS - int32_t tmp; + int32_t tmp1; #endif #ifdef DEBUGGING float ftmp; @@ -998,21 +998,21 @@ static bool parseCmdlIVAS_dec( return false; } - if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + if ( sscanf( argv[i], "%d", &tmp1 ) > 0 ) { - arg->index_of_edited_ism = tmp; + arg->index_of_edited_ism = (int16_t) tmp1; i++; } - if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + if ( sscanf( argv[i], "%d", &tmp1 ) > 0 ) { - arg->azimuth_edited_ism = tmp; + arg->azimuth_edited_ism = (int16_t) tmp1; i++; } - if ( sscanf( argv[i], "%d", &tmp ) > 0 ) + if ( sscanf( argv[i], "%d", &tmp1 ) > 0 ) { - arg->elevation_edited_ism = tmp; + arg->elevation_edited_ism = (int16_t) tmp1; i++; } } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0e1aa45572..339d665031 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1105,6 +1105,7 @@ enum #define NO_BITS_MASA_ISM_NO_OBJ 2 #define MASA2TOTAL_THR 0.98f #define BITS_MASA2TOTTAL_DCT0 6 +#define STEP_M2T 0.1f #endif #define MASA_HEADER_BITS 2 #define MASA_SUBFRAME_BITS 1 diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 4869de36ce..2f4279a73c 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -532,11 +532,11 @@ ISM_MODE ivas_omasa_ism_mode_select( switch ( no_obj ) { case 1: - if ( ivas_total_brate >= IVAS_64k ) + if ( ivas_total_brate >= IVAS_24k4 ) { ism_mode = ISM_MASA_MODE_DISC; } - else if ( ivas_total_brate >= IVAS_48k ) + else if ( ivas_total_brate >= IVAS_24k4 ) { ism_mode = ISM_MASA_MODE_PARAM; } @@ -546,7 +546,25 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 2: - if ( ivas_total_brate >= IVAS_80k ) + if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + /* else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } */ + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 3: + if ( ivas_total_brate >= IVAS_128k ) { ism_mode = ISM_MASA_MODE_DISC; } @@ -563,14 +581,12 @@ ISM_MODE ivas_omasa_ism_mode_select( ism_mode = ISM_MODE_NONE; } break; - case 3: - case 4: if ( ivas_total_brate >= IVAS_160k ) { ism_mode = ISM_MASA_MODE_DISC; } - else if ( ivas_total_brate >= IVAS_80k ) + else if ( ivas_total_brate >= IVAS_64k ) { ism_mode = ISM_MASA_MODE_ONE_OBJ; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 8bd1d65bfb..8bcd60e1d5 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4425,7 +4425,8 @@ void ivas_masa_encode( ISM_MODE ism_mode, /* i : ISM format mode */ int16_t nchan_ism, /* i : number of ism channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ - int16_t idx_separated_object /* i : index of the separated object */ + int16_t idx_separated_object, /* i : index of the separated object */ + OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ #endif ); @@ -5112,14 +5113,18 @@ void ivas_masa_ism_set_edited_objects( void encode_masa_to_total( IVAS_QMETADATA_HANDLE hQMetaData, - BSTR_ENC_HANDLE hMetaData + BSTR_ENC_HANDLE hMetaData, + int16_t low_bitrate_mode, + int16_t nbands, + int16_t nblocks ); void decode_masa_to_total( uint16_t* bit_stream, int16_t* index, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], - int16_t nbands + int16_t nbands, + int16_t nblocks ); void modify_masa_energy_ratios( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 7c28e6b4f6..81c03f4791 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2784,13 +2784,13 @@ const float McMASA_LFEGain_vectors[64] = int32_t sep_object_brate[][MAX_NUM_OBJECTS] ={ {0, 0, 0, 0}, /* 13k2 */ {0, 0, 0, 0}, /* 16k4 */ - {0, 0, 0, 0}, /* 24k4 */ - {0, 0, 0, 0}, /* 32k */ - {0, 0, 0, 0}, /* 48k */ - {16000, 0, 0, 0}, /* 64k */ + {9600, 0, 0, 0}, /* 24k4 */ + {9600, 0, 0, 0}, /* 32k */ + {IVAS_13k2, 0, 0, 0}, /* 48k */ + {16000, IVAS_13k2, 0, 0}, /* 64k */ {20000, 16000, 0, 0}, /* 80k */ {IVAS_32k, 20000, 0, 0}, /* 96k */ - {IVAS_32k, IVAS_24k4, 0, 0}, /* 128k */ + {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 34d3584f7a..1ed3e91c35 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -164,7 +164,19 @@ ivas_error ivas_cpe_dec( { if ( st_ivas->hQMetaData != NULL && ivas_total_brate > IVAS_SID_5k2 ) { - stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.7f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); + } + else + { + +#endif + stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); +#ifdef MASA_AND_OBJECTS + } +#endif } else { diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 9ceaa52f68..998de0c8a6 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -630,6 +630,10 @@ ivas_error ivas_dec( ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ); } + if ( st_ivas->hCPE[0]->nchan_out == 1 ) + { + mvr2r( output[0], output[1], output_frame ); /* Copy mono signal to stereo output channels */ + } /* HP filtering */ for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7da5528fb0..4e77e6bf5a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -189,10 +189,10 @@ ivas_error ivas_dec_setup( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - st_ivas->nchan_transport = 2; + st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata*/ - st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 3] + 1; + st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 1] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + 1; st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); if ( st_ivas->ini_frame > 0 ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index dcb70abf57..b6d416819d 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -73,6 +73,7 @@ static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos ); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, int16_t no_ism, int16_t K ); +static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t n_ism, int16_t nbands, int16_t nblocks ); #endif /*-----------------------------------------------------------------------* @@ -139,9 +140,17 @@ ivas_error ivas_masa_decode( { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { - /* the number of MASA transport channels was read in ivas_dec_setup() */ - st->next_bit_pos -= MASA_TRANSP_BITS; - *nb_bits_read += MASA_TRANSP_BITS; +#ifdef MASA_AND_OBJECTS + if ( ivas_format != MASA_ISM_FORMAT ) + { + /* number of transport channels is always 2 for MASA_ISM format */ +#endif + /* the number of MASA transport channels was read in ivas_dec_setup() */ + st->next_bit_pos -= MASA_TRANSP_BITS; + *nb_bits_read += MASA_TRANSP_BITS; +#ifdef MASA_AND_OBJECTS + } +#endif #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { @@ -1728,8 +1737,15 @@ static void read_ism_ratio_index( } else { - /* read prediciton type */ - differential_subframe = bit_stream[( *next_bit_pos )--]; + if ( numCodingBands > 1 ) + { + /* read prediction type */ + differential_subframe = bit_stream[( *next_bit_pos )--]; + } + else + { + differential_subframe = 1; + } /* read GR order */ GR_order = bit_stream[( *next_bit_pos )--]; for ( b = 0; b < numCodingBands; b++ ) @@ -1789,15 +1805,16 @@ static void decode_ism_ratios( int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - int16_t n_ism ) + int16_t n_ism, + int16_t nbands, + int16_t numSf ) { int16_t sf, band; - int16_t nbands, numSf; int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; - nbands = hQMetaData->q_direction->cfg.nbands; - numSf = hQMetaData->q_direction->cfg.nblocks; + + /* hQMetaData->q_direction->cfg.nblocks; */ for ( sf = 0; sf < numSf; sf++ ) { /* read ism ratio indexes */ @@ -1818,6 +1835,23 @@ static void decode_ism_ratios( { reconstruct_ism_ratios( ratio_ism_idx[band], n_ism, 1.0f / (float) ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ), ratio_ism[sf][band] ); } + if ( nbands == 1 ) + { + for ( band = 1; band < 5; band++ ) + { + mvr2r( ratio_ism[sf][0], ratio_ism[sf][band], n_ism ); + } + } + } + if ( numSf == 1 ) + { + for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + for ( band = 0; band < nbands; band++ ) + { + mvr2r( ratio_ism[0][band], ratio_ism[sf][band], n_ism ); + } + } } } @@ -1842,15 +1876,15 @@ static int16_t ivas_decode_masaism_metadata( nb_bits_read = *next_bit_pos; nbands = hQMetaData->q_direction->cfg.nbands; - nblocks = hQMetaData->q_direction->cfg.nblocks; + nblocks = hQMetaData->q_direction->cfg.nblocks; /* To do: what if other value than 4? */ /* Read MASA-to-total energy ratios */ - decode_masa_to_total( bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio, nbands ); + decode_masa_to_total( bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio, nbands, nblocks ); if ( nchan_ism > 1 ) { /* read ISM ratios */ - decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism ); + decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism, nbands, nblocks ); /* calculate priority */ set_f( priority, 0.0f, nchan_ism ); diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index b5b145a30f..e26850f737 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -3312,9 +3312,11 @@ static void read_stream_dct_coeffs_omasa( { int16_t sign, nbits; int16_t i, j, i_min; - int16_t last_non_null; - float step = 0.1f; + float step; + int16_t GR1, GR2; + + step = STEP_M2T; nbits = 0; sign = 1; if ( first_line == 0 ) @@ -3338,35 +3340,44 @@ static void read_stream_dct_coeffs_omasa( if ( q_idx[0] != 0 ) { - /* read last non null position */ - last_non_null = 0; - j = (int16_t) ceilf( log2f( (float) ( len_stream ) ) ); - for ( i = 0; i < j; i++ ) - { - last_non_null = ( last_non_null << 1 ) + bit_stream[( *index )--]; - } - - nbits += j; - if ( last_non_null > 0 ) + if ( len_stream >= 8 ) { /* read index of last index encoded with GR2 */ i_min = 0; - j = (int16_t) ceilf( log2f( (float) ( last_non_null + 1 ) ) ); + j = 4; for ( i = 0; i < j; i++ ) { i_min = ( i_min << 1 ) + bit_stream[( *index )--]; } - nbits += j; + /* read GR orders */ + GR1 = bit_stream[( *index )--] + 1; + if ( GR1 == 2 ) + { + GR2 = bit_stream[( *index )--]; + } + else + { + GR2 = 0; + } /* read GR data */ for ( i = 1; i <= i_min; i++ ) { - q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, 2 ); + q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, GR1 ); + } + for ( i = i_min + 1; i < len_stream; i++ ) + { + q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, GR2 ); } - for ( i = i_min + 1; i <= last_non_null; i++ ) + } + else + { + /* read GR order (only one) */ + GR1 = bit_stream[( *index )--]; + for ( i = 1; i < len_stream; i++ ) { - q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, 0 ); + q_idx[i] = ivas_qmetadata_DecodeExtendedGR( bit_stream, index, 100, GR1 ); } } } @@ -3390,7 +3401,8 @@ void decode_masa_to_total( uint16_t *bit_stream, int16_t *index, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], - int16_t nbands ) + int16_t nbands, + int16_t nblocks ) { int16_t i, j, k; @@ -3402,24 +3414,16 @@ void decode_masa_to_total( int16_t n_streams, len_stream; /* Setup coding parameters */ - if ( nbands == 5 ) - { - n_streams = 1; - len_stream = nbands * 4; - } - else if ( nbands == 8 ) + n_streams = 1; + len_stream = nbands * nblocks; + if ( len_stream == 32 ) { n_streams = 4; len_stream = 8; } - else - { - n_streams = 4; - len_stream = nbands; - printf( "Unrecognized number of bands!" ); /* To do: finalize this */ - exit( -1 ); - } - set_s( q_idx, 0, nbands * MAX_PARAM_SPATIAL_SUBFRAMES ); + + + set_s( q_idx, 0, nbands * nblocks ); for ( i = 0; i < n_streams; i++ ) { read_stream_dct_coeffs_omasa( &q_idx[i * len_stream], &q_dct_data[i * len_stream], len_stream, bit_stream, index, i == 0 ); @@ -3427,19 +3431,34 @@ void decode_masa_to_total( /* inverse DCT2 transform */ - if ( nbands == 5 ) + switch ( len_stream ) { - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); /* reuse of variable*/ - } - else - { - assert( nbands == 8 ); - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); + case 4: + matrix_product( dct4, nblocks, nblocks, 1, q_dct_data, nblocks, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nblocks ); + break; + case 5: + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; + case 8: + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; + case 20: + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ + break; + case 32: + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); + break; + default: + break; } + k = 0; - for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + for ( i = 0; i < nblocks; i++ ) { for ( j = 0; j < nbands; j++ ) { @@ -3448,5 +3467,25 @@ void decode_masa_to_total( k++; } } + if ( nblocks == 1 ) + { + for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + for ( j = 0; j < nbands; j++ ) + { + masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[0][j]; + } + } + } + if ( nbands == 1 ) + { + for ( j = 1; j < 5; j++ ) + { + for ( i = 0; i < nblocks; i++ ) + { + masa_to_total_energy_ratio[i][j] = masa_to_total_energy_ratio[i][0]; + } + } + } } #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index e5c83ffb20..a2675ba1d8 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -271,7 +271,19 @@ ivas_error ivas_cpe_enc( { if ( st_ivas->hQMetaData != NULL ) { - stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); +#ifdef MASA_AND_OBJECTS + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) + { + stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.7f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); + } + else + { + +#endif + stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); +#ifdef MASA_AND_OBJECTS + } +#endif } else { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index bc2b6d33a0..b24233b6eb 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -90,7 +90,11 @@ ivas_error ivas_enc( input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); n_samples_chan = n_samples / nchan_inp; +#ifdef MASA_AND_OBJECTS + set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); +#else set_s( nb_bits_metadata, 0, MAX_SCE ); +#endif #ifdef SBA_BR_SWITCHING sba_reinit_flag = 0; if ( ivas_format == SBA_FORMAT ) @@ -257,7 +261,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0 + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0, NULL #endif ); } @@ -345,7 +349,7 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object ); + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Merge transport signals */ @@ -428,7 +432,7 @@ ivas_error ivas_enc( ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0 + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0, NULL #endif ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 05f5892005..fadf8e9fb8 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -64,7 +64,11 @@ static void ivas_merge_masa_metadatas( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[] /* i/o: ISM metadata handles */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t low_bitrate_mode, /* i: is low bitrate more? 1/0 */ + int16_t omasa_nbands, + int16_t omasa_nblocks + ); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); @@ -75,6 +79,8 @@ static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t n static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio ); +static void transform_index_and_GR_encode( int16_t *diff_idx, int16_t len, int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); +static void transform_difference_index( int16_t *diff_idx, int16_t *idx, int16_t len ); #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif @@ -241,7 +247,8 @@ void ivas_masa_encode( ISM_MODE ism_mode, /* i : ISM format mode */ int16_t nchan_ism, /* i : number of ism channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ - int16_t idx_separated_object /* i : index of the separated object */ + int16_t idx_separated_object, /* i : index of the separated object */ + OMASA_ENC_HANDLE hOMasa /* i: OMASA encoder handle */ #endif ) { @@ -249,10 +256,14 @@ void ivas_masa_encode( int16_t i, j; int16_t masa_sid_descriptor; +#ifdef MASA_AND_OBJECTS + int16_t low_bitrate_mode; +#endif masa_sid_descriptor = -1; h_orig_metadata = NULL; #ifdef MASA_AND_OBJECTS + low_bitrate_mode = 0; if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else if ( ivas_format == MASA_FORMAT ) @@ -317,13 +328,16 @@ void ivas_masa_encode( if ( ivas_format == MASA_FORMAT ) #endif { + +#ifndef MASA_AND_OBJECTS /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; +#endif #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) { - /* always write the number of objects in ISM_MASA format*/ + /* write the number of objects in ISM_MASA format*/ push_next_indice( hMetaData, nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ ); hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; @@ -334,6 +348,12 @@ void ivas_masa_encode( hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; } } + else + { + /* write the number of MASA transport channels */ + push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); + hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; + } #endif /* write placeholder data for descriptive metadata */ @@ -376,6 +396,7 @@ void ivas_masa_encode( { #ifdef MASA_AND_OBJECTS reduce_metadata_further( hMasa, hQMetaData, ivas_format, ism_mode ); + low_bitrate_mode = ( ivas_total_brate <= 32000 ); #else reduce_metadata_further( hMasa, hQMetaData, ivas_format ); #endif @@ -389,7 +410,7 @@ void ivas_masa_encode( if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { /* encode MASA/ISM energy ratios */ - ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData ); + ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes ); } else { @@ -397,7 +418,9 @@ void ivas_masa_encode( } #endif /* Encode metadata */ + ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); + #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { @@ -2107,6 +2130,47 @@ static int16_t index_slice_enum( return index; } +static void transform_difference_index( + int16_t *diff_idx, + int16_t *idx, + int16_t len ) +{ + int16_t i; + for ( i = 0; i < len; i++ ) + { + if ( diff_idx[i] <= 0 ) + { + idx[i] = -2 * diff_idx[i]; + } + else + { + idx[i] = 2 * diff_idx[i] - 1; + } + } + return; +} + + +static void transform_index_and_GR_encode( + int16_t *diff_idx, /* i: differenc eindex to encode */ + int16_t len, /*i: input length */ + int16_t GR_order, /* i: GR order */ + BSTR_ENC_HANDLE hMetaData /* i/o: bitstream */ +) +{ + int16_t i; + int16_t idx[IVAS_MAX_NUM_OBJECTS]; + /* transform difference index into positive */ + transform_difference_index( diff_idx, idx, len ); + /* GR encoding */ + + for ( i = 0; i < len; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, idx[i], 100, GR_order ); + } + return; +} + static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, @@ -2194,20 +2258,8 @@ static int16_t encode_ratio_ism_subframe( { /* take difference with respect to previous subframe */ v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); - /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) - { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } - } - /* GR encoding */ - + transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); + /* GR encoding estimate length */ for ( i = 0; i < no_ism - 1; i++ ) { nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); @@ -2224,151 +2276,100 @@ static int16_t encode_ratio_ism_subframe( GR_order = 1; nbits = nbits1; } - - /* try the difference from subband to subband; first subband is compared to previous subframe first subband*/ - /* take difference with respect to previous subframe only for first subband */ - nbits0 = 0; - nbits1 = 0; - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) + if ( numCodingBands > 1 ) { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } - } - /* GR encoding */ - - for ( i = 0; i < no_ism - 1; i++ ) - { - nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); - nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); - } - for ( b = 1; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + /* try the difference from subband to subband; first subband is compared to previous subframe first subband*/ + /* take difference with respect to previous subframe only for first subband */ + nbits0 = 0; + nbits1 = 0; + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) - { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } - } + transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); /* GR encoding */ - for ( i = 0; i < no_ism - 1; i++ ) { nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); } - } - - if ( nbits0 < nbits1 ) - { - GR_order_sb = 0; - } - else - { - GR_order_sb = 1; - nbits0 = nbits1; - } - - if ( nbits0 < nbits ) - { - differential_subframe = 0; - nbits = nbits0; - GR_order = GR_order_sb; - } - nbits++; /* for GR_order */ - nbits++; /* for the prediction type */ - - /* write prediction type */ - push_next_indice( hMetaData, differential_subframe, 1 ); - /* write GR order */ - push_next_indice( hMetaData, GR_order, 1 ); - /* write data */ - if ( differential_subframe ) - { - for ( b = 0; b < numCodingBands; b++ ) + for ( b = 1; b < numCodingBands; b++ ) { /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) - { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } - } + transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); /* GR encoding */ for ( i = 0; i < no_ism - 1; i++ ) { - ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); } } - } - else - { - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) + + if ( nbits0 < nbits1 ) { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } + GR_order_sb = 0; + } + else + { + GR_order_sb = 1; + nbits0 = nbits1; } - /* GR encoding */ - for ( i = 0; i < no_ism - 1; i++ ) + if ( nbits0 < nbits ) { - ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + differential_subframe = 0; + nbits = nbits0; + GR_order = GR_order_sb; } - for ( b = 1; b < numCodingBands; b++ ) + nbits++; /* for GR_order */ + nbits++; /* for the prediction type */ + + /* write prediction type */ + push_next_indice( hMetaData, differential_subframe, 1 ); + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + /* write data */ + if ( differential_subframe ) { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); - /* transform difference index into positive */ - for ( i = 0; i < no_ism - 1; i++ ) + for ( b = 0; b < numCodingBands; b++ ) { - if ( diff_idx[i] <= 0 ) - { - diff_idx[i] = -2 * diff_idx[i]; - } - else - { - diff_idx[i] = 2 * diff_idx[i] - 1; - } + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); } - /* GR encoding */ + } + else + { + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - for ( i = 0; i < no_ism - 1; i++ ) + for ( b = 1; b < numCodingBands; b++ ) { - ivas_qmetadata_encode_extended_gr( hMetaData, diff_idx[i], 100, GR_order ); + /* take difference with respect to previous subband */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); } } } + else + { + /* only differential wrt previous subframe is possible */ + /* write the differential to subframe case and no bit to signal the difference type */ + + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + nbits++; /* for GR_order */ + /* write data */ + + for ( b = 0; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); + } + } + #ifdef DEBUGGING assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); #endif @@ -2379,10 +2380,12 @@ static int16_t encode_ratio_ism_subframe( static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[] /* i/o: ISM metadata handles */ -) + IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + int16_t low_bitrate_mode, /* i: is low bitrate more? 1/0 */ + int16_t omasa_nbands, + int16_t omasa_nblocks ) { int16_t sf, band; uint8_t numCodingBands; @@ -2400,35 +2403,127 @@ static void ivas_encode_masaism_metadata( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; float step; int16_t inv_step; + float energy_ism, energy_ism_ind[MAX_NUM_OBJECTS]; - numCodingBands = hMasa->config.numCodingBands; - numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; - for ( sf = 0; sf < numSf; sf++ ) + /* use the values from hQMetaData */ + numCodingBands = (uint8_t) hQMetaData->q_direction->cfg.nbands; + numSf = (int8_t) hQMetaData->q_direction->cfg.nblocks; + + + if ( numCodingBands != omasa_nbands ) + { + assert( numCodingBands == 1 ); + + for ( sf = 0; sf < numSf; sf++ ) + { + if ( sum_f( hMasa->data.energy_ism[sf], omasa_nbands ) == 0.0f ) + { + hQMetaData->masa_to_total_energy_ratio[sf][0] = 1.0f; + } + else + { + brange[0] = hMasa->data.band_mapping[0]; + brange[1] = hMasa->data.band_mapping[omasa_nbands]; + eneBand = 0.0f; + for ( bin = brange[0]; bin < brange[1]; bin++ ) + { + eneBand += hMasa->data.energy[sf][bin]; + } + energy_ism = 0.0f; + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + energy_ism_ind[obj] = 0.0f; + } + for ( band = 0; band < omasa_nbands; band++ ) + { + energy_ism += hMasa->data.energy_ism[sf][band]; + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + energy_ism_ind[obj] += hMasa->data.energy_ism[sf][band] * hMasa->data.energy_ratio_ism[sf][band][obj]; + } + } + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + hMasa->data.energy_ratio_ism[sf][0][obj] = energy_ism_ind[obj] / energy_ism; + } + hQMetaData->masa_to_total_energy_ratio[sf][0] = eneBand / ( eneBand + energy_ism + EPSILON ); + } + } + } + else if ( numSf != omasa_nblocks ) { + assert( numSf == 1 ); + for ( band = 0; band < numCodingBands; band++ ) { - if ( hMasa->data.energy_ism[sf][band] == 0.0f ) + energy_ism = 0.0f; /* ISM energy for current subband */ + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + energy_ism_ind[obj] = 0.0f; + } + for ( sf = 0; sf < omasa_nblocks; sf++ ) + { + energy_ism += hMasa->data.energy_ism[sf][band]; + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + energy_ism_ind[obj] += hMasa->data.energy_ism[sf][band] * hMasa->data.energy_ratio_ism[sf][band][obj]; + } + } + if ( energy_ism == 0.0f ) { - hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f; + hQMetaData->masa_to_total_energy_ratio[0][band] = 1.0f; } else { + for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) + { + hMasa->data.energy_ratio_ism[0][band][obj] = energy_ism_ind[obj] / energy_ism; + } brange[0] = hMasa->data.band_mapping[band]; brange[1] = hMasa->data.band_mapping[band + 1]; eneBand = 0.0f; - for ( bin = brange[0]; bin < brange[1]; bin++ ) + for ( sf = 0; sf < omasa_nblocks; sf++ ) { - eneBand += hMasa->data.energy[sf][bin]; + for ( bin = brange[0]; bin < brange[1]; bin++ ) + { + eneBand += hMasa->data.energy[sf][bin]; + } } - hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hMasa->data.energy_ism[sf][band] + EPSILON ); + hQMetaData->masa_to_total_energy_ratio[0][band] = eneBand / ( eneBand + energy_ism + EPSILON ); } } } + else + { + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + if ( hMasa->data.energy_ism[sf][band] == 0.0f ) + { + hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f; + } + else + { + brange[0] = hMasa->data.band_mapping[band]; + brange[1] = hMasa->data.band_mapping[band + 1]; + + eneBand = 0.0f; + for ( bin = brange[0]; bin < brange[1]; bin++ ) + { + eneBand += hMasa->data.energy[sf][bin]; + } + hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hMasa->data.energy_ism[sf][band] + EPSILON ); + } + } + } + } + + encode_masa_to_total( hQMetaData, hMetaData, low_bitrate_mode, numCodingBands, numSf ); - encode_masa_to_total( hQMetaData, hMetaData ); /* quantize ism_ratios */ if ( hMasa->data.nchan_ism > 1 ) { diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 1c9eef86e8..fbc98dbe21 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -125,7 +125,9 @@ static void transform_azimuth_dir2( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *d static int16_t calc_var_azi( const IVAS_QDIRECTION *q_direction, const int16_t diffuseness_index_max_ec_frame, const float avg_azimuth, float *avg_azimuth_out ); #ifdef MASA_AND_OBJECTS -static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line ); +static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line, int16_t low_bitrate_mode ); +static int16_t find_optimal_GR_order( int16_t *q_idx, int16_t len, int16_t *GR ); +static int16_t find_optimal_GR_orders( int16_t *q_idx, int16_t len, int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ); #endif /*-----------------------------------------------------------------------* @@ -4922,14 +4924,138 @@ static float direction_distance( } #endif #ifdef MASA_AND_OBJECTS -static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line ) + +static int16_t divide_GR_orders( + int16_t *q_idx, + int16_t GR1, + int16_t GR2, + int16_t len, + int16_t len_max_GR1, + int16_t *i_min ) +{ + int16_t nb_GR_min; + int16_t i, j, nb_GR; + nb_GR_min = 1000; + *i_min = -1; + for ( i = 0; i < min( len_max_GR1, len ); i++ ) + { + nb_GR = 0; + + for ( j = 0; j <= i; j++ ) + { + nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR1 ); + } + for ( j = i + 1; j < len; j++ ) + { + nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR2 ); + } + + if ( nb_GR < nb_GR_min ) + { + nb_GR_min = nb_GR; + *i_min = i + 1; + } + } + return nb_GR_min; +} +static int16_t +find_optimal_GR_order( + int16_t *q_idx, + int16_t len, + int16_t *GR ) +{ + int16_t nb_GR_0, nb_GR_1; + int16_t i; + /* find optimum length of the part encoded with GR2 */ + nb_GR_0 = 0; + nb_GR_1 = 0; + for ( i = 0; i < len; i++ ) + { + nb_GR_0 += ivas_qmetadata_encode_extended_gr_length( q_idx[i], 100, 0 ); + nb_GR_1 += ivas_qmetadata_encode_extended_gr_length( q_idx[i], 100, 1 ); + } + + if ( nb_GR_0 < nb_GR_1 ) + { + *GR = 0; + return nb_GR_0; + } + else + { + *GR = 1; + return nb_GR_1; + } +} + + +static int16_t +find_optimal_GR_orders( + int16_t *q_idx, + int16_t len, + int16_t len_max_GR1, + int16_t *GR1, + int16_t *GR2, + int16_t *i_min ) +{ + int16_t nb_GR_20, nb_GR_21, nb_GR_10, nb_GR_min; + int16_t i_min_20, i_min_21, i_min_10; + /* find optimum length of the part encoded with GR2 */ + nb_GR_20 = divide_GR_orders( q_idx, 2, 0, len, len_max_GR1, &i_min_20 ); + nb_GR_21 = divide_GR_orders( q_idx, 2, 1, len, len_max_GR1, &i_min_21 ); + nb_GR_10 = divide_GR_orders( q_idx, 1, 0, len, len_max_GR1, &i_min_10 ); + + if ( nb_GR_20 < nb_GR_21 && nb_GR_20 < nb_GR_10 ) + { + *GR1 = 2; + *GR2 = 0; + nb_GR_min = nb_GR_20; + *i_min = i_min_20; + } + else + { + if ( nb_GR_21 < nb_GR_20 && nb_GR_21 < nb_GR_10 ) + { + *GR1 = 2; + *GR2 = 1; + nb_GR_min = nb_GR_21; + *i_min = i_min_21; + } + else + { + *GR1 = 1; + *GR2 = 0; + nb_GR_min = nb_GR_10; + *i_min = i_min_10; + } + } + return nb_GR_min; +} + +static int16_t write_stream_dct_coeffs_omasa( + int16_t *q_idx, /* i: array of indexes to be written */ + int16_t len_stream, /* i: array length */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream */ + int16_t first_line, /* i: is first line of the matrix? 1/0*/ + int16_t low_bitrate_mode /* i: is low bitrate mode? if yes, limit the number of bits written */ +) { int16_t nb_bits = 0, bits_pos; - int16_t last_non_null; - uint16_t nb_GR_min, i_min, nb_GR; + uint16_t nb_GR_min; int16_t i, j; + int16_t changed, update_needed; + + int16_t GR1, GR2, i_min; + int16_t max_bits; bits_pos = hMetaData->nb_bits_tot; + if ( low_bitrate_mode == 1 ) + { + max_bits = 50; /* To do : find optimal allowed value*/ + } + else + { + max_bits = 1000; + } /* write DCT 0 component */ /* write sign only if not the very first DCT coeff */ if ( first_line == 0 ) @@ -4937,7 +5063,7 @@ static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream if ( q_idx[0] > 0 ) { push_next_indice( hMetaData, 1, 1 ); - push_next_indice( hMetaData, q_idx[0], BITS_MASA2TOTTAL_DCT0 ); /* Todo : define constant */ + push_next_indice( hMetaData, q_idx[0], BITS_MASA2TOTTAL_DCT0 ); } else { @@ -4953,73 +5079,113 @@ static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream } - /* find last non-null position */ - last_non_null = -1; if ( q_idx[0] != 0 ) { - last_non_null = len_stream - 1; - while ( ( q_idx[last_non_null] == 0 ) && ( last_non_null >= 0 ) ) + i_min = 1; + GR2 = 0; + if ( len_stream >= 8 ) { - last_non_null--; + nb_GR_min = find_optimal_GR_orders( &q_idx[1], len_stream - 1, 15, &GR1, &GR2, &i_min ); + } + else + { + nb_GR_min = find_optimal_GR_order( &q_idx[1], len_stream - 1, &GR1 ); } - } - if ( last_non_null == -1 ) - { - /* all values are zero; no need to send anything else */ - assert( q_idx[0] == 0 ); - } - else - { - assert( q_idx[0] != 0 ); - /*last_non_null = max(4, last_non_null); */ - /* write index of last non null index on log2(len_stream) bits */ - j = (int16_t) ceilf( log2f( (float) ( len_stream ) ) ); - push_next_indice( hMetaData, last_non_null, j ); - nb_bits += j; - if ( last_non_null > 0 ) + assert( nb_GR_min < 1000 ); + changed = 1; + update_needed = 0; + while ( len_stream >= 8 && nb_GR_min > max_bits && changed >= 1 ) { - /* find optimum length of the part encoded with GR2 */ - nb_GR_min = 1000; - i_min = 0; - for ( i = 1; i <= last_non_null; i++ ) + update_needed = 1; + changed = 0; + for ( j = len_stream - 1; j > 6; j-- ) { - nb_GR = 0; - for ( j = 1; j <= i; j++ ) + if ( q_idx[j] >= 2 ) { - nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 2 ); + + if ( j > i_min ) + { + changed = 1; + nb_GR_min -= ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR2 ); + q_idx[j] -= 2; + nb_GR_min += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR2 ); + } + else + { + changed = 1; + nb_GR_min -= ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR1 ); + q_idx[j] -= 2; + nb_GR_min += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 0 ); + } } - for ( j = i + 1; j <= last_non_null; j++ ) + else if ( q_idx[j] == 1 ) { - nb_GR += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 0 ); + if ( j > i_min ) + { + changed = 1; + nb_GR_min -= ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR2 ); + q_idx[j] -= 1; + + nb_GR_min += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR2 ); + } + else + { + changed = 1; + nb_GR_min -= ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, GR1 ); + q_idx[j] -= 1; + nb_GR_min += ivas_qmetadata_encode_extended_gr_length( q_idx[j], 100, 0 ); + } } - if ( nb_GR < nb_GR_min ) + if ( nb_GR_min < max_bits ) { - nb_GR_min = nb_GR; - i_min = i; + break; } } - - assert( nb_GR_min < 1000 ); - - - /* write number of indexes encoded with GR2 */ - j = (int16_t) ceilf( log2f( (float) ( last_non_null + 1 ) ) ); - assert( i_min < ( 1 << j ) ); - push_next_indice( hMetaData, i_min, j ); - nb_bits += j; - + } + if ( update_needed == 1 ) + { + /* re-calculate */ + /* find optimum length of the part encoded with GR2 */ + nb_GR_min = find_optimal_GR_orders( &q_idx[1], len_stream - 1, 15, &GR1, &GR2, &i_min ); + } + if ( len_stream >= 8 ) + { + /* write number of indexes encoded with GR2 on 4 bits */ + push_next_indice( hMetaData, i_min, 4 ); + nb_bits += 4; + /* write GR orders */ + push_next_indice( hMetaData, GR1 - 1, 1 ); + nb_bits += 1; + if ( GR1 == 2 ) + { + push_next_indice( hMetaData, GR2, 1 ); + nb_bits += 1; + } /* write GR data */ for ( i = 1; i <= i_min; i++ ) { - ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, 2 ); + ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, GR1 ); + } + for ( i = i_min + 1; i < len_stream; i++ ) + { + ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, GR2 ); } - for ( i = i_min + 1; i <= last_non_null; i++ ) + } + else + { + /* len_stream <= 8 */ + /* write GR order */ + push_next_indice( hMetaData, GR1, 1 ); + nb_bits += 1; + for ( i = 1; i < len_stream; i++ ) { - ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, 0 ); + ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, GR1 ); } - nb_bits += nb_GR_min; } + + nb_bits += nb_GR_min; + assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); } return nb_bits; @@ -5027,23 +5193,27 @@ static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream void encode_masa_to_total( IVAS_QMETADATA_HANDLE hQMetaData, - BSTR_ENC_HANDLE hMetaData ) + BSTR_ENC_HANDLE hMetaData, + int16_t low_bitrate_mode, + int16_t nbands, + int16_t nblocks ) { int16_t i, j, k; float data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - float step = 0.1f; + float step = STEP_M2T; + int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - int16_t nbands; + int16_t bits_pos, nb_bits; int16_t n_streams, len_stream; - nbands = hQMetaData->numCodingBands; + #ifdef DEBUG_MODE_QMETADATA static FILE *pF = NULL; static FILE *pF_ratio = NULL; @@ -5055,44 +5225,55 @@ void encode_masa_to_total( #endif -#ifdef DEBUGGING - assert( ( nbands == 5 || nbands == 8 ) && "Number of subbands in parametric MASA_ISM should be 5 or 8 " ); -#endif + bits_pos = hMetaData->nb_bits_tot; k = 0; for ( i = 0; i < nbands; i++ ) { - for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) + for ( j = 0; j < nblocks; j++ ) { data[k] = hQMetaData->masa_to_total_energy_ratio[j][i]; k++; } } - /* DCT2 transform */ - if ( nbands == 5 ) - { - matrix_product( dct5, nbands, nbands, 0, data, MAX_PARAM_SPATIAL_SUBFRAMES, nbands, 1, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 1, dct_data ); - } - else - { - matrix_product( dct8, nbands, nbands, 0, data, MAX_PARAM_SPATIAL_SUBFRAMES, nbands, 1, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 1, dct_data ); + n_streams = 1; + len_stream = nbands * nblocks; + switch ( len_stream ) + { + case 4: + matrix_product( dct4, nblocks, nblocks, 0, data, 1, nblocks, 1, dct_data ); + n_streams = 1; + len_stream = 4; + break; + case 5: + matrix_product( dct5, nbands, nbands, 0, data, 1, nbands, 1, dct_data ); + n_streams = 1; + len_stream = nbands; + break; + case 8: + matrix_product( dct8, nbands, nbands, 0, data, 1, nbands, 1, dct_data ); + n_streams = 1; + len_stream = nbands; + break; + break; + case 20: + matrix_product( dct5, nbands, nbands, 0, data, nblocks, nbands, 1, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 1, dct_data ); + n_streams = 1; + len_stream = nbands * nblocks; + break; + case 32: + matrix_product( dct8, nbands, nbands, 0, data, nblocks, nbands, 1, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 1, dct_data ); + n_streams = nblocks; + len_stream = nbands; + break; + default: + break; } - /* Setup coding parameters */ - if ( nbands == 5 ) - { - n_streams = 1; - len_stream = nbands * MAX_PARAM_SPATIAL_SUBFRAMES; - } - else - { - n_streams = MAX_PARAM_SPATIAL_SUBFRAMES; - len_stream = 8; - } for ( k = 0; k < n_streams; k++ ) { @@ -5129,21 +5310,57 @@ void encode_masa_to_total( } + /* write data */ + nb_bits = 0; + for ( i = 0; i < n_streams; i++ ) + { + nb_bits += write_stream_dct_coeffs_omasa( &q_idx[i * len_stream], len_stream, hMetaData, ( i == 0 ), low_bitrate_mode ); + } + + /* reconstruct masa2total */ - /* inverse DCT2 transform */ - if ( nbands == 5 ) + q_dct_data[0] = q_idx[0] * step; + for ( i = 1; i < len_stream; i++ ) { - matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); /* reuse of variable*/ + if ( ( q_idx[i] % 2 ) == 0 ) + { + q_dct_data[i] = -( q_idx[i] >> 1 ) * step; + } + else + { + q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; + } } - else + /* inverse DCT2 transform */ + switch ( len_stream ) { - assert( nbands == 8 ); - matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct_data_tmp ); - matrix_product( dct_data_tmp, nbands, MAX_PARAM_SPATIAL_SUBFRAMES, 0, dct4, MAX_PARAM_SPATIAL_SUBFRAMES, MAX_PARAM_SPATIAL_SUBFRAMES, 0, q_dct_data ); + case 4: + matrix_product( dct4, nblocks, nblocks, 1, q_dct_data, nblocks, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nblocks ); + break; + case 5: + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; + case 8: + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; + case 20: + matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ + break; + case 32: + matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); + matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); + break; + default: + break; } + + k = 0; - for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + for ( i = 0; i < nblocks; i++ ) { for ( j = 0; j < nbands; j++ ) { @@ -5152,14 +5369,6 @@ void encode_masa_to_total( k++; } } - - /* write data */ - nb_bits = 0; - for ( i = 0; i < n_streams; i++ ) - { - nb_bits += write_stream_dct_coeffs_omasa( &q_idx[i * len_stream], len_stream, hMetaData, ( i == 0 ) ); - } - assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); #ifdef DEBUG_MODE_QMETADATA -- GitLab From b843c21ad535d2143ebb12ac8572d531bd406b83 Mon Sep 17 00:00:00 2001 From: advasila Date: Sun, 22 Jan 2023 20:49:18 +0200 Subject: [PATCH 0012/1418] 1obj DISC from 32k --- lib_com/ivas_ism_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 473491f8fd..7a9dedfc9f 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -532,7 +532,7 @@ ISM_MODE ivas_omasa_ism_mode_select( switch ( no_obj ) { case 1: - if ( ivas_total_brate >= IVAS_24k4 ) + if ( ivas_total_brate >= IVAS_32k ) { ism_mode = ISM_MASA_MODE_DISC; } -- GitLab From 12a463d124a70c63dd650e9ae0abb212e79864a9 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 23 Jan 2023 16:57:06 +1100 Subject: [PATCH 0013/1418] instrumentation error fixes --- Workspace_msvc/lib_rend.vcxproj | 6 +- lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c | 120 +- lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c | 1667 +++++++++-------- lib_rend/ivas_cldfb_trans_codec/NoiseGen.c | 10 +- .../ivas_cldfb_trans_codec/RMSEnvGrouping.c | 40 +- .../cldfb_codec_bitstream.c | 10 +- lib_rend/ivas_splitRend_lcld_dec.c | 16 +- lib_rend/ivas_splitRend_lcld_enc.c | 16 +- 8 files changed, 1007 insertions(+), 878 deletions(-) diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 979e35246c..1749b8e038 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -89,7 +89,7 @@ Disabled - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -126,7 +126,7 @@ Disabled - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) @@ -169,7 +169,7 @@ Neither false false - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;..\lib_rend;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c index 370aa0dbd1..7e388d8242 100644 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c @@ -5,6 +5,8 @@ #include #include #include "Tables.h" +#include "options.h" +#include "prot.h" #include "wmops.h" #include "PerceptualModel.h" #include "RMSEnvDeltaHuff.h" @@ -54,7 +56,7 @@ CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, assert(iSampleRate == 48000); //Fix - psCQMFDecoder = (CQMFDecoder*)malloc(sizeof(CQMFDecoder)); + psCQMFDecoder = (CQMFDecoder*)count_malloc(sizeof(CQMFDecoder)); psCQMFDecoder->iSampleRate = iSampleRate; psCQMFDecoder->iChannels = iChannels; psCQMFDecoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; @@ -64,42 +66,42 @@ CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, psCQMFDecoder->piBandwidths = c_aiBandwidths48; //Fix psCQMFDecoder->iMSMode = 0; - psCQMFDecoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->piMSFlags = (int*)count_malloc(MAX_BANDS * sizeof(int)); psCQMFDecoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo - psCQMFDecoder->piNumGroups = (int*)malloc(psCQMFDecoder->iChannels * sizeof(int)); - psCQMFDecoder->ppiGroupLengths = (int**)malloc(psCQMFDecoder->iChannels * sizeof(int*)); - psCQMFDecoder->pppiRMSEnvelope = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiSMR = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiExcitation = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiAlloc = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - - psCQMFDecoder->pppiCQMFSignReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiCQMFSignImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiQCQMFReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiQCQMFImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->piNumGroups = (int*)count_malloc(psCQMFDecoder->iChannels * sizeof(int)); + psCQMFDecoder->ppiGroupLengths = (int**)count_malloc(psCQMFDecoder->iChannels * sizeof(int*)); + psCQMFDecoder->pppiRMSEnvelope = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiSMR = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiExcitation = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiAlloc = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + + psCQMFDecoder->pppiCQMFSignReal = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiCQMFSignImag = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiQCQMFReal = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); + psCQMFDecoder->pppiQCQMFImag = (int***)count_malloc(psCQMFDecoder->iChannels * sizeof(int**)); for(n = 0; n < iChannels ; n ++){ int k; - psCQMFDecoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); - psCQMFDecoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->ppiGroupLengths[n] = (int*)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); + psCQMFDecoder->pppiRMSEnvelope[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiSMR[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiExcitation[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiAlloc[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiCQMFSignReal[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiCQMFSignImag[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiQCQMFReal[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); + psCQMFDecoder->pppiQCQMFImag[n] = (int**)count_malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - psCQMFDecoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiRMSEnvelope[n][k] = (int*)count_malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiSMR[n][k] = (int*)count_malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiExcitation[n][k] = (int*)count_malloc(MAX_BANDS * sizeof(int)); + psCQMFDecoder->pppiAlloc[n][k] = (int*)count_malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiCQMFSignReal[n][k] = (int*)count_malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiCQMFSignImag[n][k] = (int*)count_malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiQCQMFReal[n][k] = (int*)count_malloc(CQMF_BANDS * sizeof(int)); + psCQMFDecoder->pppiQCQMFImag[n][k] = (int*)count_malloc(CQMF_BANDS * sizeof(int)); } } @@ -117,19 +119,19 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) if(psCQMFDecoder != NULL){ if(psCQMFDecoder->piMSFlags != NULL){ - free(psCQMFDecoder->piMSFlags); + count_free(psCQMFDecoder->piMSFlags); } if(psCQMFDecoder->piNumGroups != NULL){ - free(psCQMFDecoder->piNumGroups); + count_free(psCQMFDecoder->piNumGroups); } if(psCQMFDecoder->ppiGroupLengths != NULL){ int n; for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - free(psCQMFDecoder->ppiGroupLengths[n]); + count_free(psCQMFDecoder->ppiGroupLengths[n]); } - free(psCQMFDecoder->ppiGroupLengths); + count_free(psCQMFDecoder->ppiGroupLengths); } if(psCQMFDecoder->pppiRMSEnvelope != NULL){ @@ -137,11 +139,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiRMSEnvelope[n][k]); + count_free(psCQMFDecoder->pppiRMSEnvelope[n][k]); } - free(psCQMFDecoder->pppiRMSEnvelope[n]); + count_free(psCQMFDecoder->pppiRMSEnvelope[n]); } - free(psCQMFDecoder->pppiRMSEnvelope); + count_free(psCQMFDecoder->pppiRMSEnvelope); } if(psCQMFDecoder->pppiSMR != NULL){ @@ -149,11 +151,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiSMR[n][k]); + count_free(psCQMFDecoder->pppiSMR[n][k]); } - free(psCQMFDecoder->pppiSMR[n]); + count_free(psCQMFDecoder->pppiSMR[n]); } - free(psCQMFDecoder->pppiSMR); + count_free(psCQMFDecoder->pppiSMR); } if(psCQMFDecoder->pppiExcitation != NULL){ @@ -161,11 +163,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiExcitation[n][k]); + count_free(psCQMFDecoder->pppiExcitation[n][k]); } - free(psCQMFDecoder->pppiExcitation[n]); + count_free(psCQMFDecoder->pppiExcitation[n]); } - free(psCQMFDecoder->pppiExcitation); + count_free(psCQMFDecoder->pppiExcitation); } if(psCQMFDecoder->pppiAlloc != NULL){ @@ -173,11 +175,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiAlloc[n][k]); + count_free(psCQMFDecoder->pppiAlloc[n][k]); } - free(psCQMFDecoder->pppiAlloc[n]); + count_free(psCQMFDecoder->pppiAlloc[n]); } - free(psCQMFDecoder->pppiAlloc); + count_free(psCQMFDecoder->pppiAlloc); } if(psCQMFDecoder->pppiCQMFSignReal != NULL){ @@ -185,11 +187,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiCQMFSignReal[n][k]); + count_free(psCQMFDecoder->pppiCQMFSignReal[n][k]); } - free(psCQMFDecoder->pppiCQMFSignReal[n]); + count_free(psCQMFDecoder->pppiCQMFSignReal[n]); } - free(psCQMFDecoder->pppiCQMFSignReal); + count_free(psCQMFDecoder->pppiCQMFSignReal); } if(psCQMFDecoder->pppiCQMFSignImag != NULL){ @@ -197,11 +199,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiCQMFSignImag[n][k]); + count_free(psCQMFDecoder->pppiCQMFSignImag[n][k]); } - free(psCQMFDecoder->pppiCQMFSignImag[n]); + count_free(psCQMFDecoder->pppiCQMFSignImag[n]); } - free(psCQMFDecoder->pppiCQMFSignImag); + count_free(psCQMFDecoder->pppiCQMFSignImag); } if(psCQMFDecoder->pppiQCQMFReal != NULL){ @@ -209,11 +211,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiQCQMFReal[n][k]); + count_free(psCQMFDecoder->pppiQCQMFReal[n][k]); } - free(psCQMFDecoder->pppiQCQMFReal[n]); + count_free(psCQMFDecoder->pppiQCQMFReal[n]); } - free(psCQMFDecoder->pppiQCQMFReal); + count_free(psCQMFDecoder->pppiQCQMFReal); } if(psCQMFDecoder->pppiQCQMFImag != NULL){ @@ -221,11 +223,11 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) for(n = 0; n < psCQMFDecoder->iChannels; n ++){ int k; for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiQCQMFImag[n][k]); + count_free(psCQMFDecoder->pppiQCQMFImag[n][k]); } - free(psCQMFDecoder->pppiQCQMFImag[n]); + count_free(psCQMFDecoder->pppiQCQMFImag[n]); } - free(psCQMFDecoder->pppiQCQMFImag); + count_free(psCQMFDecoder->pppiQCQMFImag); } if(psCQMFDecoder->psBSRead != NULL){ @@ -236,7 +238,7 @@ void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) DeleteNoiseGen(psCQMFDecoder->psNoiseGen); } - free(psCQMFDecoder); + count_free(psCQMFDecoder); } } diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c index 6795f9327c..5aa13f0fba 100644 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c +++ b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c @@ -5,6 +5,8 @@ #include #include #include "Tables.h" +#include "options.h" +#include "prot.h" #include "wmops.h" #include "RMSEnvGrouping.h" #include "PerceptualModel.h" @@ -12,511 +14,554 @@ #include "CQMFHuff.h" #include "cldfb_codec_bitstream.h" -typedef struct CQMF_ENCODER{ - int iSampleRate; - int iChannels; - int iNumBlocks; - - int iTargetBitRate; - int iTargetBitsPerFrame; - - int iNumBands; - const int *piBandwidths; - - int iMSMode; - int *piMSFlags; - +typedef struct CQMF_ENCODER +{ + int iSampleRate; + int iChannels; + int iNumBlocks; + + int iTargetBitRate; + int iTargetBitsPerFrame; + + int iNumBands; + const int *piBandwidths; + + int iMSMode; + int *piMSFlags; + RMSEnvelopeGrouping *psRMSEnvelopeGrouping; - int iCommonGrouping; - int *piNumGroups; - int **ppiGroupLengths; - - int ***pppiRMSEnvelope; - int ***pppiSMR; - int ***pppiExcitation; - int ***pppiAlloc; - - int iAllocOffset; - - int ***pppiCQMFSignReal; - int ***pppiCQMFSignImag; - int ***pppiQCQMFReal; - int ***pppiQCQMFImag; - - Bitstream *psBSWrite; - - int iLastError; -}CQMFEncoder; - -CQMFEncoder* CreateCQMFEncoder(const int iSampleRate, - const int iChannels, - const int iTargetBitRate) + int iCommonGrouping; + int *piNumGroups; + int **ppiGroupLengths; + + int ***pppiRMSEnvelope; + int ***pppiSMR; + int ***pppiExcitation; + int ***pppiAlloc; + + int iAllocOffset; + + int ***pppiCQMFSignReal; + int ***pppiCQMFSignImag; + int ***pppiQCQMFReal; + int ***pppiQCQMFImag; + + Bitstream *psBSWrite; + + int iLastError; +} CQMFEncoder; + +CQMFEncoder *CreateCQMFEncoder( const int iSampleRate, + const int iChannels, + const int iTargetBitRate ) { int n; CQMFEncoder *psCQMFEncoder = NULL; - - assert(iSampleRate == 48000); //Fix - - psCQMFEncoder = (CQMFEncoder*)malloc(sizeof(CQMFEncoder)); + + assert( iSampleRate == 48000 ); // Fix + + psCQMFEncoder = (CQMFEncoder *) count_malloc( sizeof( CQMFEncoder ) ); psCQMFEncoder->iSampleRate = iSampleRate; psCQMFEncoder->iChannels = iChannels; psCQMFEncoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; psCQMFEncoder->iAllocOffset = 0; - + psCQMFEncoder->iTargetBitRate = iTargetBitRate; psCQMFEncoder->iTargetBitsPerFrame = iTargetBitRate * CQMF_BLOCKS_PER_FRAME * CQMF_BANDS / iSampleRate; - - psCQMFEncoder->iNumBands = MAX_BANDS_48 - 1; //Fix - psCQMFEncoder->piBandwidths = c_aiBandwidths48; //Fix - + + psCQMFEncoder->iNumBands = MAX_BANDS_48 - 1; // Fix + psCQMFEncoder->piBandwidths = c_aiBandwidths48; // Fix + psCQMFEncoder->iMSMode = 0; - psCQMFEncoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFEncoder->psRMSEnvelopeGrouping = CreateRMSEnvelopeGrouping(psCQMFEncoder->iNumBlocks); - + psCQMFEncoder->piMSFlags = (int *) count_malloc( MAX_BANDS * sizeof( int ) ); + + psCQMFEncoder->psRMSEnvelopeGrouping = CreateRMSEnvelopeGrouping( psCQMFEncoder->iNumBlocks ); + psCQMFEncoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo - psCQMFEncoder->piNumGroups = (int*)malloc(psCQMFEncoder->iChannels * sizeof(int)); - psCQMFEncoder->ppiGroupLengths = (int**)malloc(psCQMFEncoder->iChannels * sizeof(int*)); - psCQMFEncoder->pppiRMSEnvelope = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiSMR = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiExcitation = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiAlloc = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - - psCQMFEncoder->pppiCQMFSignReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiCQMFSignImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiQCQMFReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiQCQMFImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - for(n = 0; n < iChannels ; n ++){ + psCQMFEncoder->piNumGroups = (int *) count_malloc( psCQMFEncoder->iChannels * sizeof( int ) ); + psCQMFEncoder->ppiGroupLengths = (int **) count_malloc( psCQMFEncoder->iChannels * sizeof( int * ) ); + psCQMFEncoder->pppiRMSEnvelope = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiSMR = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiExcitation = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiAlloc = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + + psCQMFEncoder->pppiCQMFSignReal = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiCQMFSignImag = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiQCQMFReal = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + psCQMFEncoder->pppiQCQMFImag = (int ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int ** ) ); + for ( n = 0; n < iChannels; n++ ) + { int k; - psCQMFEncoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); - psCQMFEncoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - - psCQMFEncoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - psCQMFEncoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFEncoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); + psCQMFEncoder->ppiGroupLengths[n] = (int *) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int ) ); + psCQMFEncoder->pppiRMSEnvelope[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiSMR[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiExcitation[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiAlloc[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + + psCQMFEncoder->pppiCQMFSignReal[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiCQMFSignImag[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiQCQMFReal[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + psCQMFEncoder->pppiQCQMFImag[n] = (int **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int * ) ); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + psCQMFEncoder->pppiRMSEnvelope[n][k] = (int *) count_malloc( MAX_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiSMR[n][k] = (int *) count_malloc( MAX_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiExcitation[n][k] = (int *) count_malloc( MAX_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiAlloc[n][k] = (int *) count_malloc( MAX_BANDS * sizeof( int ) ); + + psCQMFEncoder->pppiCQMFSignReal[n][k] = (int *) count_malloc( CQMF_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiCQMFSignImag[n][k] = (int *) count_malloc( CQMF_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiQCQMFReal[n][k] = (int *) count_malloc( CQMF_BANDS * sizeof( int ) ); + psCQMFEncoder->pppiQCQMFImag[n][k] = (int *) count_malloc( CQMF_BANDS * sizeof( int ) ); } } - - psCQMFEncoder->psBSWrite = CreateBitstream(BS_WRITE,4096); + + psCQMFEncoder->psBSWrite = CreateBitstream( BS_WRITE, 4096 ); psCQMFEncoder->iLastError = ENCODER_ERROR_NONE; - + return psCQMFEncoder; } -void DeleteCQMFEncoder(CQMFEncoder *psCQMFEncoder) +void DeleteCQMFEncoder( CQMFEncoder *psCQMFEncoder ) { - if(psCQMFEncoder != NULL){ - - if(psCQMFEncoder->piMSFlags != NULL){ - free(psCQMFEncoder->piMSFlags); + if ( psCQMFEncoder != NULL ) + { + + if ( psCQMFEncoder->piMSFlags != NULL ) + { + count_free( psCQMFEncoder->piMSFlags ); } - - if(psCQMFEncoder->piNumGroups != NULL){ - free(psCQMFEncoder->piNumGroups); + + if ( psCQMFEncoder->piNumGroups != NULL ) + { + count_free( psCQMFEncoder->piNumGroups ); } - - if(psCQMFEncoder->psRMSEnvelopeGrouping != NULL){ - DeleteRMSEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping); + + if ( psCQMFEncoder->psRMSEnvelopeGrouping != NULL ) + { + DeleteRMSEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping ); } - - if(psCQMFEncoder->ppiGroupLengths != NULL){ + + if ( psCQMFEncoder->ppiGroupLengths != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - free(psCQMFEncoder->ppiGroupLengths[n]); + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + count_free( psCQMFEncoder->ppiGroupLengths[n] ); } - free(psCQMFEncoder->ppiGroupLengths); + count_free( psCQMFEncoder->ppiGroupLengths ); } - - if(psCQMFEncoder->pppiRMSEnvelope != NULL){ + + if ( psCQMFEncoder->pppiRMSEnvelope != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiRMSEnvelope[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiRMSEnvelope[n][k] ); } - free(psCQMFEncoder->pppiRMSEnvelope[n]); + count_free( psCQMFEncoder->pppiRMSEnvelope[n] ); } - free(psCQMFEncoder->pppiRMSEnvelope); + count_free( psCQMFEncoder->pppiRMSEnvelope ); } - - if(psCQMFEncoder->pppiSMR != NULL){ + + if ( psCQMFEncoder->pppiSMR != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiSMR[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiSMR[n][k] ); } - free(psCQMFEncoder->pppiSMR[n]); + count_free( psCQMFEncoder->pppiSMR[n] ); } - free(psCQMFEncoder->pppiSMR); + count_free( psCQMFEncoder->pppiSMR ); } - - if(psCQMFEncoder->pppiExcitation != NULL){ + + if ( psCQMFEncoder->pppiExcitation != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiExcitation[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiExcitation[n][k] ); } - free(psCQMFEncoder->pppiExcitation[n]); + count_free( psCQMFEncoder->pppiExcitation[n] ); } - free(psCQMFEncoder->pppiExcitation); + count_free( psCQMFEncoder->pppiExcitation ); } - - if(psCQMFEncoder->pppiAlloc != NULL){ + + if ( psCQMFEncoder->pppiAlloc != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiAlloc[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiAlloc[n][k] ); } - free(psCQMFEncoder->pppiAlloc[n]); + count_free( psCQMFEncoder->pppiAlloc[n] ); } - free(psCQMFEncoder->pppiAlloc); + count_free( psCQMFEncoder->pppiAlloc ); } - - if(psCQMFEncoder->pppiCQMFSignReal != NULL){ + + if ( psCQMFEncoder->pppiCQMFSignReal != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiCQMFSignReal[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiCQMFSignReal[n][k] ); } - free(psCQMFEncoder->pppiCQMFSignReal[n]); + count_free( psCQMFEncoder->pppiCQMFSignReal[n] ); } - free(psCQMFEncoder->pppiCQMFSignReal); + count_free( psCQMFEncoder->pppiCQMFSignReal ); } - - if(psCQMFEncoder->pppiCQMFSignImag != NULL){ + + if ( psCQMFEncoder->pppiCQMFSignImag != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiCQMFSignImag[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiCQMFSignImag[n][k] ); } - free(psCQMFEncoder->pppiCQMFSignImag[n]); + count_free( psCQMFEncoder->pppiCQMFSignImag[n] ); } - free(psCQMFEncoder->pppiCQMFSignImag); + count_free( psCQMFEncoder->pppiCQMFSignImag ); } - - if(psCQMFEncoder->pppiQCQMFReal != NULL){ + + if ( psCQMFEncoder->pppiQCQMFReal != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiQCQMFReal[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiQCQMFReal[n][k] ); } - free(psCQMFEncoder->pppiQCQMFReal[n]); + count_free( psCQMFEncoder->pppiQCQMFReal[n] ); } - free(psCQMFEncoder->pppiQCQMFReal); + count_free( psCQMFEncoder->pppiQCQMFReal ); } - - if(psCQMFEncoder->pppiQCQMFImag != NULL){ + + if ( psCQMFEncoder->pppiQCQMFImag != NULL ) + { int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiQCQMFImag[n][k]); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiQCQMFImag[n][k] ); } - free(psCQMFEncoder->pppiQCQMFImag[n]); + count_free( psCQMFEncoder->pppiQCQMFImag[n] ); } - free(psCQMFEncoder->pppiQCQMFImag); + count_free( psCQMFEncoder->pppiQCQMFImag ); } - - DeleteBitstream(psCQMFEncoder->psBSWrite); - - free(psCQMFEncoder); + + DeleteBitstream( psCQMFEncoder->psBSWrite ); + + count_free( psCQMFEncoder ); } } -int CQMFEncoderGetError(CQMFEncoder *psCQMFEncoder) +int CQMFEncoderGetError( CQMFEncoder *psCQMFEncoder ) { return psCQMFEncoder->iLastError; } -static void MSModeCalculation(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - float ***pppfReal, - float ***pppfImag, - int *piMSMode, - int *piMSFlags); - -static void RemoveRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag); - -static void RemoveSign(const int iNumBlocks, - const int iNumCQMFBands, - float **ppfReal, - float **ppfImag, - int **ppiSignReal, - int **ppiSignImag); - -static int CountCQMFBits(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag); +static void MSModeCalculation( const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int *piMSMode, + int *piMSFlags ); + +static void RemoveRMSEnvelope( const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ); + +static void RemoveSign( const int iNumBlocks, + const int iNumCQMFBands, + float **ppfReal, + float **ppfImag, + int **ppiSignReal, + int **ppiSignImag ); + +static int CountCQMFBits( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag ); /* Currently only the number of bands in frame */ -static int WriteHeaderInformation(const int iNumBands, - Bitstream *psBSWrite); - -static int WriteMSInformation(const int iNumBands, - const int iMSMode, - const int *piMSFlags, - Bitstream *psBSWrite); - -static int WriteGroupInformation(const int iChannels, - const int iCommonGrouping, - const int *piNumGroups, - const int **ppiGroupLengths, - Bitstream *psBSWrite); - -static int WriteRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiRMSEnvelope, - Bitstream *psBSWrite); - -static int WriteAllocInformation(const int iAllocOffset, - Bitstream *psBSWrite); - -static int WriteCQMFData(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiSignReal, - const int **ppiSignImag, - const int **ppiQReal, - const int **ppiQImag, - Bitstream *psBSWrite); - -static int ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAvailableBits, - int *piAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag); - -static int ComputeAllocationByPass(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag); - - - -int EncodeFrame(CQMFEncoder *psCQMFEncoder, - float ***pppfCQMFReal, - float ***pppfCQMFImag, - int *piNumiBytes, - unsigned char *puchData) +static int WriteHeaderInformation( const int iNumBands, + Bitstream *psBSWrite ); + +static int WriteMSInformation( const int iNumBands, + const int iMSMode, + const int *piMSFlags, + Bitstream *psBSWrite ); + +static int WriteGroupInformation( const int iChannels, + const int iCommonGrouping, + const int *piNumGroups, + const int **ppiGroupLengths, + Bitstream *psBSWrite ); + +static int WriteRMSEnvelope( const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiRMSEnvelope, + Bitstream *psBSWrite ); + +static int WriteAllocInformation( const int iAllocOffset, + Bitstream *psBSWrite ); + +static int WriteCQMFData( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiSignReal, + const int **ppiSignImag, + const int **ppiQReal, + const int **ppiQImag, + Bitstream *psBSWrite ); + +static int ComputeAllocation( const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAvailableBits, + int *piAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag ); + +static int ComputeAllocationByPass( const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag ); + + +int EncodeFrame( CQMFEncoder *psCQMFEncoder, + float ***pppfCQMFReal, + float ***pppfCQMFImag, + int *piNumiBytes, + unsigned char *puchData ) { int n; int iAvailableBits; int iBitsWritten; int iCQMFBits; - + iAvailableBits = psCQMFEncoder->iTargetBitsPerFrame; // HCBR for now iBitsWritten = 0; - + /* Do MS calc here */ - if(psCQMFEncoder->iChannels == 2){ - MSModeCalculation(psCQMFEncoder->iNumBlocks, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - pppfCQMFReal, - pppfCQMFImag, - &psCQMFEncoder->iMSMode, - psCQMFEncoder->piMSFlags); - - if(psCQMFEncoder->iMSMode > 0){ + if ( psCQMFEncoder->iChannels == 2 ) + { + MSModeCalculation( psCQMFEncoder->iNumBlocks, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + pppfCQMFReal, + pppfCQMFImag, + &psCQMFEncoder->iMSMode, + psCQMFEncoder->piMSFlags ); + + if ( psCQMFEncoder->iMSMode > 0 ) + { psCQMFEncoder->iCommonGrouping = 1; // Make sure common grouping is enabled when MS is in use } } - - + + /* Compute Grouping and RMS Envelopes */ - if(psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1){ - ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, - psCQMFEncoder->iChannels, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)pppfCQMFReal, - (const float***)pppfCQMFImag, - 8.0, - 20.0, // Use these to trade off RMS Env bits and quantizer loading - &psCQMFEncoder->piNumGroups[0], - psCQMFEncoder->ppiGroupLengths[0], - psCQMFEncoder->pppiRMSEnvelope); - + if ( psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1 ) + { + ComputeEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float ***) pppfCQMFReal, + (const float ***) pppfCQMFImag, + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading + &psCQMFEncoder->piNumGroups[0], + psCQMFEncoder->ppiGroupLengths[0], + psCQMFEncoder->pppiRMSEnvelope ); + psCQMFEncoder->piNumGroups[1] = psCQMFEncoder->piNumGroups[0]; - for(n = 0; n < psCQMFEncoder->piNumGroups[0]; n ++){ + for ( n = 0; n < psCQMFEncoder->piNumGroups[0]; n++ ) + { psCQMFEncoder->ppiGroupLengths[1][n] = psCQMFEncoder->ppiGroupLengths[0][n]; } } - else{ - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, - psCQMFEncoder->iChannels, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)&pppfCQMFReal[n], - (const float***)&pppfCQMFImag[n], - 8.0, - 20.0, // Use these to trade off RMS Env bits and quantizer loading - &psCQMFEncoder->piNumGroups[n], - psCQMFEncoder->ppiGroupLengths[n], - &psCQMFEncoder->pppiRMSEnvelope[n]); + else + { + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + ComputeEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float ***) &pppfCQMFReal[n], + (const float ***) &pppfCQMFImag[n], + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading + &psCQMFEncoder->piNumGroups[n], + psCQMFEncoder->ppiGroupLengths[n], + &psCQMFEncoder->pppiRMSEnvelope[n] ); } } - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - RemoveSign(psCQMFEncoder->iNumBlocks, - CQMF_BANDS, - pppfCQMFReal[n], - pppfCQMFImag[n], - psCQMFEncoder->pppiCQMFSignReal[n], - psCQMFEncoder->pppiCQMFSignImag[n]); - - RemoveRMSEnvelope(psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - psCQMFEncoder->piNumGroups[n], - (const int*)psCQMFEncoder->ppiGroupLengths[n], - (const int **)psCQMFEncoder->pppiRMSEnvelope[n], - pppfCQMFReal[n], - pppfCQMFImag[n]); + + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + RemoveSign( psCQMFEncoder->iNumBlocks, + CQMF_BANDS, + pppfCQMFReal[n], + pppfCQMFImag[n], + psCQMFEncoder->pppiCQMFSignReal[n], + psCQMFEncoder->pppiCQMFSignImag[n] ); + + RemoveRMSEnvelope( psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + psCQMFEncoder->piNumGroups[n], + (const int *) psCQMFEncoder->ppiGroupLengths[n], + (const int **) psCQMFEncoder->pppiRMSEnvelope[n], + pppfCQMFReal[n], + pppfCQMFImag[n] ); } - - BSFlushBuffer(psCQMFEncoder->psBSWrite); - iBitsWritten += WriteHeaderInformation(psCQMFEncoder->iNumBands, - psCQMFEncoder->psBSWrite); - - if(psCQMFEncoder->iChannels == 2){ - iBitsWritten += WriteMSInformation(psCQMFEncoder->iNumBands, - psCQMFEncoder->iMSMode, - (const int*)psCQMFEncoder->piMSFlags, - psCQMFEncoder->psBSWrite); + + BSFlushBuffer( psCQMFEncoder->psBSWrite ); + iBitsWritten += WriteHeaderInformation( psCQMFEncoder->iNumBands, + psCQMFEncoder->psBSWrite ); + + if ( psCQMFEncoder->iChannels == 2 ) + { + iBitsWritten += WriteMSInformation( psCQMFEncoder->iNumBands, + psCQMFEncoder->iMSMode, + (const int *) psCQMFEncoder->piMSFlags, + psCQMFEncoder->psBSWrite ); } - - iBitsWritten += WriteGroupInformation(psCQMFEncoder->iChannels, - psCQMFEncoder->iCommonGrouping, - (const int*)psCQMFEncoder->piNumGroups, - (const int**)psCQMFEncoder->ppiGroupLengths, - psCQMFEncoder->psBSWrite); - - iBitsWritten += WriteRMSEnvelope(psCQMFEncoder->iChannels, - (const int*)psCQMFEncoder->piNumGroups, - psCQMFEncoder->iNumBands, - (const int***)psCQMFEncoder->pppiRMSEnvelope, - psCQMFEncoder->psBSWrite); - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ // This will be updated to support multiple sample rates + + iBitsWritten += WriteGroupInformation( psCQMFEncoder->iChannels, + psCQMFEncoder->iCommonGrouping, + (const int *) psCQMFEncoder->piNumGroups, + (const int **) psCQMFEncoder->ppiGroupLengths, + psCQMFEncoder->psBSWrite ); + + iBitsWritten += WriteRMSEnvelope( psCQMFEncoder->iChannels, + (const int *) psCQMFEncoder->piNumGroups, + psCQMFEncoder->iNumBands, + (const int ***) psCQMFEncoder->pppiRMSEnvelope, + psCQMFEncoder->psBSWrite ); + + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { // This will be updated to support multiple sample rates int k; - for(k = 0; k < psCQMFEncoder->piNumGroups[n]; k ++){ - PerceptualModel(psCQMFEncoder->iNumBands, - psCQMFEncoder->pppiRMSEnvelope[n][k], - psCQMFEncoder->pppiExcitation[n][k], - psCQMFEncoder->pppiSMR[n][k]); - + for ( k = 0; k < psCQMFEncoder->piNumGroups[n]; k++ ) + { + PerceptualModel( psCQMFEncoder->iNumBands, + psCQMFEncoder->pppiRMSEnvelope[n][k], + psCQMFEncoder->pppiExcitation[n][k], + psCQMFEncoder->pppiSMR[n][k] ); } } - + iAvailableBits -= iBitsWritten; - iCQMFBits = ComputeAllocation(psCQMFEncoder->iChannels, - (const int*)psCQMFEncoder->piNumGroups, - (const int**)psCQMFEncoder->ppiGroupLengths, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)pppfCQMFReal, - (const float***)pppfCQMFImag, - (const int***)psCQMFEncoder->pppiSMR, - iAvailableBits, - &psCQMFEncoder->iAllocOffset, - psCQMFEncoder->pppiAlloc, - psCQMFEncoder->pppiQCQMFReal, - psCQMFEncoder->pppiQCQMFImag); - - iBitsWritten += WriteAllocInformation(psCQMFEncoder->iAllocOffset,psCQMFEncoder->psBSWrite); - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - iBitsWritten += WriteCQMFData(psCQMFEncoder->piNumGroups[n], - (const int*)psCQMFEncoder->ppiGroupLengths[n], - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const int**)psCQMFEncoder->pppiAlloc[n], - (const int**)psCQMFEncoder->pppiCQMFSignReal[n], - (const int**)psCQMFEncoder->pppiCQMFSignImag[n], - (const int**)psCQMFEncoder->pppiQCQMFReal[n], - (const int**)psCQMFEncoder->pppiQCQMFImag[n], - psCQMFEncoder->psBSWrite); + iCQMFBits = ComputeAllocation( psCQMFEncoder->iChannels, + (const int *) psCQMFEncoder->piNumGroups, + (const int **) psCQMFEncoder->ppiGroupLengths, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const float ***) pppfCQMFReal, + (const float ***) pppfCQMFImag, + (const int ***) psCQMFEncoder->pppiSMR, + iAvailableBits, + &psCQMFEncoder->iAllocOffset, + psCQMFEncoder->pppiAlloc, + psCQMFEncoder->pppiQCQMFReal, + psCQMFEncoder->pppiQCQMFImag ); + + iBitsWritten += WriteAllocInformation( psCQMFEncoder->iAllocOffset, psCQMFEncoder->psBSWrite ); + + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + iBitsWritten += WriteCQMFData( psCQMFEncoder->piNumGroups[n], + (const int *) psCQMFEncoder->ppiGroupLengths[n], + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const int **) psCQMFEncoder->pppiAlloc[n], + (const int **) psCQMFEncoder->pppiCQMFSignReal[n], + (const int **) psCQMFEncoder->pppiCQMFSignImag[n], + (const int **) psCQMFEncoder->pppiQCQMFReal[n], + (const int **) psCQMFEncoder->pppiQCQMFImag[n], + psCQMFEncoder->psBSWrite ); } - - BSByteAlign(psCQMFEncoder->psBSWrite); - *piNumiBytes = BSGetByteCount(psCQMFEncoder->psBSWrite); - BSGetBytes(psCQMFEncoder->psBSWrite,puchData,*piNumiBytes); - - //printf("Bits Written %d\n",iBitsWritten); - + + BSByteAlign( psCQMFEncoder->psBSWrite ); + *piNumiBytes = BSGetByteCount( psCQMFEncoder->psBSWrite ); + BSGetBytes( psCQMFEncoder->psBSWrite, puchData, *piNumiBytes ); + + // printf("Bits Written %d\n",iBitsWritten); + return psCQMFEncoder->iLastError; } -static void MSModeCalculation(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - float ***pppfReal, - float ***pppfImag, - int *piMSMode, - int *piMSFlags) +static void MSModeCalculation( const int iNumBlocks, + const int iNumBands, + const int *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int *piMSMode, + int *piMSFlags ) { int b; int iFBOffset; int iNumMSBands; - + *piMSMode = 0; iFBOffset = 0; iNumMSBands = 0; - for(b = 0; b < iNumBands; b ++){ + for ( b = 0; b < iNumBands; b++ ) + { int n; float fLeftEnergy; float fRightEnergy; @@ -524,163 +569,190 @@ static void MSModeCalculation(const int iNumBlocks, float fSideEnergy; float fLRRatio; float fMSRatio; - + fLeftEnergy = 0.0; fRightEnergy = 0.0; fMidEnergy = 0.0; fSideEnergy = 0.0; - - for(n = 0; n < piBandwidths[b]; n ++){ + + for ( n = 0; n < piBandwidths[b]; n++ ) + { int k; - for(k = 0; k < iNumBlocks; k ++){ + for ( k = 0; k < iNumBlocks; k++ ) + { float fMidReal; float fMidImag; float fSideReal; float fSideImag; - - fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); - fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); - fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); - fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); - - fLeftEnergy += (pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset]); - fRightEnergy += (pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset]); - fMidEnergy += (fMidReal * fMidReal + fMidImag * fMidImag); - fSideEnergy += (fSideReal * fSideReal + fSideImag * fSideImag); + + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); + + fLeftEnergy += ( pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset] ); + fRightEnergy += ( pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); + fMidEnergy += ( fMidReal * fMidReal + fMidImag * fMidImag ); + fSideEnergy += ( fSideReal * fSideReal + fSideImag * fSideImag ); } - - iFBOffset ++; + + iFBOffset++; } - - fLeftEnergy = log10f(fLeftEnergy + 1e-12f); - fRightEnergy = log10f(fRightEnergy + 1e-12f); - fMidEnergy = log10f(fMidEnergy + 1e-12f); - fSideEnergy = log10f(fSideEnergy + 1e-12f); - - if(fLeftEnergy > fRightEnergy){ + + fLeftEnergy = log10f( fLeftEnergy + 1e-12f ); + fRightEnergy = log10f( fRightEnergy + 1e-12f ); + fMidEnergy = log10f( fMidEnergy + 1e-12f ); + fSideEnergy = log10f( fSideEnergy + 1e-12f ); + + if ( fLeftEnergy > fRightEnergy ) + { fLRRatio = fLeftEnergy - fRightEnergy; } - else{ + else + { fLRRatio = fRightEnergy - fLeftEnergy; } - - if(fMidEnergy > fSideEnergy){ + + if ( fMidEnergy > fSideEnergy ) + { fMSRatio = fMidEnergy - fSideEnergy; } - else{ + else + { fMSRatio = fSideEnergy - fMidEnergy; } - - if(fMSRatio > fLRRatio){ - iNumMSBands ++; + + if ( fMSRatio > fLRRatio ) + { + iNumMSBands++; piMSFlags[b] = 1; } - else{ + else + { piMSFlags[b] = 0; } } - - if(iNumMSBands == iNumBands){ + + if ( iNumMSBands == iNumBands ) + { *piMSMode = 1; } - else if(iNumMSBands > 0){ + else if ( iNumMSBands > 0 ) + { *piMSMode = 2; } - else{ + else + { *piMSMode = 0; } - - if(*piMSMode > 0){ + + if ( *piMSMode > 0 ) + { iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - if(piMSFlags[b] == 1){ + for ( b = 0; b < iNumBands; b++ ) + { + if ( piMSFlags[b] == 1 ) + { int n; - for(n = 0; n < piBandwidths[b]; n ++){ + for ( n = 0; n < piBandwidths[b]; n++ ) + { int k; - for(k = 0; k < iNumBlocks; k ++){ + for ( k = 0; k < iNumBlocks; k++ ) + { float fMidReal; float fMidImag; float fSideReal; float fSideImag; - - fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); - fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); - fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); - fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); - + + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); + pppfReal[0][k][iFBOffset] = fMidReal; pppfReal[1][k][iFBOffset] = fSideReal; pppfImag[0][k][iFBOffset] = fMidImag; pppfImag[1][k][iFBOffset] = fSideImag; } - iFBOffset ++; + iFBOffset++; } } - else{ + else + { iFBOffset += piBandwidths[b]; } } } } -static void RemoveRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag) +static void RemoveRMSEnvelope( const int iNumBands, + const int *piBandwidths, + const int iNumGroups, + const int *piGroupLengths, + const int **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ) { int n; int iBlockOffset; - + iBlockOffset = 0; - for(n = 0; n < iNumGroups; n ++){ + for ( n = 0; n < iNumGroups; n++ ) + { int k; - for(k = 0; k < piGroupLengths[n]; k ++){ + for ( k = 0; k < piGroupLengths[n]; k++ ) + { int b; int iFBOffset; iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iRMSEnv; + for ( b = 0; b < iNumBands; b++ ) + { + int m; + int iRMSEnv; float fGain; - + iRMSEnv = ppiRMSEnvelope[n][b]; fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER - iRMSEnv]; - for(m = 0; m < piBandwidths[b]; m ++){ + for ( m = 0; m < piBandwidths[b]; m++ ) + { ppfReal[iBlockOffset][iFBOffset] *= fGain; ppfImag[iBlockOffset][iFBOffset] *= fGain; - iFBOffset ++; + iFBOffset++; } } - iBlockOffset ++; + iBlockOffset++; } } } -static void RemoveSign(const int iNumBlocks, - const int iNumCQMFBands, - float **ppfReal, - float **ppfImag, - int **ppiSignReal, - int **ppiSignImag) +static void RemoveSign( const int iNumBlocks, + const int iNumCQMFBands, + float **ppfReal, + float **ppfImag, + int **ppiSignReal, + int **ppiSignImag ) { int n; - for(n = 0; n < iNumBlocks; n ++){ + for ( n = 0; n < iNumBlocks; n++ ) + { int b; - for(b = 0; b < iNumCQMFBands; b ++){ - if(ppfReal[n][b] > 0.0){ + for ( b = 0; b < iNumCQMFBands; b++ ) + { + if ( ppfReal[n][b] > 0.0 ) + { ppiSignReal[n][b] = 0; } - else{ + else + { ppfReal[n][b] = -ppfReal[n][b]; ppiSignReal[n][b] = 1; } - if(ppfImag[n][b] > 0.0){ + if ( ppfImag[n][b] > 0.0 ) + { ppiSignImag[n][b] = 0; } - else{ + else + { ppfImag[n][b] = -ppfImag[n][b]; ppiSignImag[n][b] = 1; } @@ -689,538 +761,587 @@ static void RemoveSign(const int iNumBlocks, } /* Rename */ -static void QuantizeSpectrum(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const float **ppfReal, - const float **ppfImag, - int **ppiQReal, - int **ppiQImag) +static void QuantizeCQMFSpectrum( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const float **ppfReal, + const float **ppfImag, + int **ppiQReal, + int **ppiQImag ) { int n; int iBlockOffest; - + iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ + for ( n = 0; n < iNumGroups; n++ ) + { int k; - for(k = 0; k < piGroupLengths[n]; k ++){ + for ( k = 0; k < piGroupLengths[n]; k++ ) + { int b; int iFBOffset; - + iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iMaxQuantVal; - float fSCFGain; - + for ( b = 0; b < iNumBands; b++ ) + { + int m; + int iAlloc; + int iMaxQuantVal; + float fSCFGain; + iAlloc = ppiAlloc[n][b]; fSCFGain = c_afScaleFactor[iAlloc]; iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; - for(m = 0; m < piBandwidths[b]; m ++){ + for ( m = 0; m < piBandwidths[b]; m++ ) + { int iQuantValue; - - iQuantValue = (int)(fSCFGain * ppfReal[iBlockOffest][iFBOffset] + 0.5); + + iQuantValue = (int) ( fSCFGain * ppfReal[iBlockOffest][iFBOffset] + 0.5 ); #ifdef _DEBUG_VERBOSE - if(iQuantValue > iMaxQuantVal){ - printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); + if ( iQuantValue > iMaxQuantVal ) + { + printf( "Value out of range %d\t%d\t%d\n", iAlloc, iQuantValue, iMaxQuantVal ); iQuantValue = iMaxQuantVal; } #else - iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; #endif ppiQReal[iBlockOffest][iFBOffset] = iQuantValue; - - iQuantValue = (int)(fSCFGain * ppfImag[iBlockOffest][iFBOffset] + 0.5); + + iQuantValue = (int) ( fSCFGain * ppfImag[iBlockOffest][iFBOffset] + 0.5 ); #ifdef _DEBUG_VERBOSE - if(iQuantValue > iMaxQuantVal){ - printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); + if ( iQuantValue > iMaxQuantVal ) + { + printf( "Value out of range %d\t%d\t%d\n", iAlloc, iQuantValue, iMaxQuantVal ); iQuantValue = iMaxQuantVal; } #else - iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; #endif ppiQImag[iBlockOffest][iFBOffset] = iQuantValue; - - iFBOffset ++; + + iFBOffset++; } - } - - iBlockOffest ++; + + iBlockOffest++; } } } -static int CountCQMFBits(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag) +static int CountCQMFBits( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiQReal, + const int **ppiQImag ) { int n; int iBits; int iBlockOffest; - + iBits = 0; iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ + for ( n = 0; n < iNumGroups; n++ ) + { int k; - for(k = 0; k < piGroupLengths[n]; k ++){ + for ( k = 0; k < piGroupLengths[n]; k++ ) + { int b; int iFBOffset; - + iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iHuffDim; - int iHuffMod; - + for ( b = 0; b < iNumBands; b++ ) + { + int m; + int iAlloc; + int iHuffDim; + int iHuffMod; + iAlloc = ppiAlloc[n][b]; - + iHuffDim = c_aiHuffmanDim[iAlloc]; iHuffMod = c_aiHuffmanMod[iAlloc]; - - - if(iAlloc > 0){ - const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? - - pauiHuffmanTable = GetHuffEncTable(iAlloc); - for(m = 0; m < piBandwidths[b]; m ++){ + + + if ( iAlloc > 0 ) + { + const unsigned int( *pauiHuffmanTable )[2] = NULL; // const? + + pauiHuffmanTable = GetHuffEncTable( iAlloc ); + for ( m = 0; m < piBandwidths[b]; m++ ) + { int iQuantValue1; int iQuantValue2; - + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; - - iBits += (iQuantValue1 > 0) ? 1 : 0; //Sign bit for vals > 0 - iBits += (iQuantValue2 > 0) ? 1 : 0; //Sign bit for vals > 0 - if(iHuffDim == 2){ + + iBits += ( iQuantValue1 > 0 ) ? 1 : 0; // Sign bit for vals > 0 + iBits += ( iQuantValue2 > 0 ) ? 1 : 0; // Sign bit for vals > 0 + if ( iHuffDim == 2 ) + { iQuantValue1 *= iHuffMod; iQuantValue1 += iQuantValue2; iBits += pauiHuffmanTable[iQuantValue1][0]; } - else{ + else + { iBits += pauiHuffmanTable[iQuantValue1][0]; iBits += pauiHuffmanTable[iQuantValue2][0]; } - - iFBOffset ++; + + iFBOffset++; } } - else{ + else + { iFBOffset += piBandwidths[b]; } - } - - iBlockOffest ++; + + iBlockOffest++; } } - + return iBits; } /* Currently only the number of bands in frame */ -static int WriteHeaderInformation(const int iNumBands, - Bitstream *psBSWrite) +static int WriteHeaderInformation( const int iNumBands, + Bitstream *psBSWrite ) { int iBitsWritten; - + iBitsWritten = 0; - BSPutBits(psBSWrite,iNumBands,5); + BSPutBits( psBSWrite, iNumBands, 5 ); iBitsWritten += 5; - + return iBitsWritten; } -static int WriteMSInformation(const int iNumBands, - const int iMSMode, - const int *piMSFlags, - Bitstream *psBSWrite) +static int WriteMSInformation( const int iNumBands, + const int iMSMode, + const int *piMSFlags, + Bitstream *psBSWrite ) { int iBitsWritten; - + iBitsWritten = 0; - - BSPutBits(psBSWrite,iMSMode,2); + + BSPutBits( psBSWrite, iMSMode, 2 ); iBitsWritten += 2; - if(iMSMode == 2){ + if ( iMSMode == 2 ) + { int n; - for(n = 0; n < iNumBands; n ++){ - BSPutBits(psBSWrite,piMSFlags[n],1); + for ( n = 0; n < iNumBands; n++ ) + { + BSPutBits( psBSWrite, piMSFlags[n], 1 ); iBitsWritten += 1; } } - + return iBitsWritten; } -static int WriteGroupInformation(const int iChannels, - const int iCommonGrouping, - const int *piNumGroups, - const int **ppiGroupLengths, - Bitstream *psBSWrite) +static int WriteGroupInformation( const int iChannels, + const int iCommonGrouping, + const int *piNumGroups, + const int **ppiGroupLengths, + Bitstream *psBSWrite ) { int iBitsWritten; - + iBitsWritten = 0; - if(iChannels == 2 && iCommonGrouping == 1){ + if ( iChannels == 2 && iCommonGrouping == 1 ) + { int k; - - BSPutBits(psBSWrite,iCommonGrouping,1); + + BSPutBits( psBSWrite, iCommonGrouping, 1 ); iBitsWritten += 1; - - BSPutBits(psBSWrite,(piNumGroups[0] - 1),4); + + BSPutBits( psBSWrite, ( piNumGroups[0] - 1 ), 4 ); iBitsWritten += 4; - - for(k = 0; k < piNumGroups[0]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[0][k] - 1),4); + + for ( k = 0; k < piNumGroups[0]; k++ ) + { + BSPutBits( psBSWrite, ( ppiGroupLengths[0][k] - 1 ), 4 ); iBitsWritten += 4; } } - else if(iChannels == 2){ + else if ( iChannels == 2 ) + { int n; - - BSPutBits(psBSWrite,iCommonGrouping,1); + + BSPutBits( psBSWrite, iCommonGrouping, 1 ); iBitsWritten += 1; - - for(n = 0; n < iChannels; n ++){ + + for ( n = 0; n < iChannels; n++ ) + { int k; - - BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); + + BSPutBits( psBSWrite, ( piNumGroups[n] - 1 ), 4 ); iBitsWritten += 4; - - for(k = 0; k < piNumGroups[n]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); + + for ( k = 0; k < piNumGroups[n]; k++ ) + { + BSPutBits( psBSWrite, ( ppiGroupLengths[n][k] - 1 ), 4 ); iBitsWritten += 4; } } } - else{ + else + { int n; - - for(n = 0; n < iChannels; n ++){ + + for ( n = 0; n < iChannels; n++ ) + { int k; - - BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); + + BSPutBits( psBSWrite, ( piNumGroups[n] - 1 ), 4 ); iBitsWritten += 4; - - for(k = 0; k < piNumGroups[n]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); + + for ( k = 0; k < piNumGroups[n]; k++ ) + { + BSPutBits( psBSWrite, ( ppiGroupLengths[n][k] - 1 ), 4 ); iBitsWritten += 4; } } } - + return iBitsWritten; } -static int WriteRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiRMSEnvelope, - Bitstream *psBSWrite) +static int WriteRMSEnvelope( const int iChannels, + const int *piNumGroups, + const int iNumBands, + const int ***pppiRMSEnvelope, + Bitstream *psBSWrite ) { int n; int iBitsWritten; - + iBitsWritten = 0; - for(n = 0; n < iChannels; n ++){ + for ( n = 0; n < iChannels; n++ ) + { int k; - for(k = 0; k < piNumGroups[n]; k ++){ + for ( k = 0; k < piNumGroups[n]; k++ ) + { int b; int iLastRMSVal; - + iLastRMSVal = pppiRMSEnvelope[n][k][0]; - iLastRMSVal = (iLastRMSVal > ENV_MIN) ? iLastRMSVal : ENV_MIN; - iLastRMSVal = (iLastRMSVal < ENV_MAX) ? iLastRMSVal : ENV_MAX; - BSPutBits(psBSWrite,(iLastRMSVal - ENV_MIN),ENV0_BITS); + iLastRMSVal = ( iLastRMSVal > ENV_MIN ) ? iLastRMSVal : ENV_MIN; + iLastRMSVal = ( iLastRMSVal < ENV_MAX ) ? iLastRMSVal : ENV_MAX; + BSPutBits( psBSWrite, ( iLastRMSVal - ENV_MIN ), ENV0_BITS ); iBitsWritten += ENV0_BITS; - - for(b = 1; b < iNumBands; b ++){ + + for ( b = 1; b < iNumBands; b++ ) + { int iDelta; - + iDelta = pppiRMSEnvelope[n][k][b] - iLastRMSVal; - iDelta = (iDelta > ENV_DELTA_MIN) ? iDelta : ENV_DELTA_MIN; - iDelta = (iDelta < ENV_DELTA_MAX) ? iDelta : ENV_DELTA_MAX; + iDelta = ( iDelta > ENV_DELTA_MIN ) ? iDelta : ENV_DELTA_MIN; + iDelta = ( iDelta < ENV_DELTA_MAX ) ? iDelta : ENV_DELTA_MAX; iDelta -= ENV_DELTA_MIN; - - BSPutBits(psBSWrite,c_aaiRMSEnvHuffEnc[iDelta][1],c_aaiRMSEnvHuffEnc[iDelta][0]); + + BSPutBits( psBSWrite, c_aaiRMSEnvHuffEnc[iDelta][1], c_aaiRMSEnvHuffEnc[iDelta][0] ); iBitsWritten += c_aaiRMSEnvHuffEnc[iDelta][0]; - + iLastRMSVal = pppiRMSEnvelope[n][k][b]; } } } - + return iBitsWritten; } -static int WriteAllocInformation(const int iAllocOffset, - Bitstream *psBSWrite) +static int WriteAllocInformation( const int iAllocOffset, + Bitstream *psBSWrite ) { int iBitsWritten; - + iBitsWritten = 0; - - if(iAllocOffset < MIN_ALLOC_OFFSET || iAllocOffset > MAX_ALLOC_OFFSET){ - printf("Serious error\n"); + + if ( iAllocOffset < MIN_ALLOC_OFFSET || iAllocOffset > MAX_ALLOC_OFFSET ) + { + printf( "Serious error\n" ); } - - BSPutBits(psBSWrite,(iAllocOffset - MIN_ALLOC_OFFSET),ALLOC_OFFSET_BITS); + + BSPutBits( psBSWrite, ( iAllocOffset - MIN_ALLOC_OFFSET ), ALLOC_OFFSET_BITS ); iBitsWritten += ALLOC_OFFSET_BITS; - + return iBitsWritten; } -static int WriteCQMFData(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiSignReal, - const int **ppiSignImag, - const int **ppiQReal, - const int **ppiQImag, - Bitstream *psBSWrite) +static int WriteCQMFData( const int iNumGroups, + const int *piGroupLengths, + const int iNumBands, + const int *piBandwidths, + const int **ppiAlloc, + const int **ppiSignReal, + const int **ppiSignImag, + const int **ppiQReal, + const int **ppiQImag, + Bitstream *psBSWrite ) { int n; int iBitsWritten; int iBlockOffest; - + iBitsWritten = 0; iBlockOffest = 0; - - for(n = 0; n < iNumGroups; n ++){ + + for ( n = 0; n < iNumGroups; n++ ) + { int k; - for(k = 0; k < piGroupLengths[n]; k ++){ + for ( k = 0; k < piGroupLengths[n]; k++ ) + { int b; int iFBOffset; - + iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iHuffDim; - int iHuffMod; - + for ( b = 0; b < iNumBands; b++ ) + { + int m; + int iAlloc; + int iHuffDim; + int iHuffMod; + iAlloc = ppiAlloc[n][b]; - + iHuffDim = c_aiHuffmanDim[iAlloc]; iHuffMod = c_aiHuffmanMod[iAlloc]; - - - if(iAlloc > 0){ - const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? - - pauiHuffmanTable = GetHuffEncTable(iAlloc); - for(m = 0; m < piBandwidths[b]; m ++){ + + + if ( iAlloc > 0 ) + { + const unsigned int( *pauiHuffmanTable )[2] = NULL; // const? + + pauiHuffmanTable = GetHuffEncTable( iAlloc ); + for ( m = 0; m < piBandwidths[b]; m++ ) + { int iQuantValue1; int iQuantValue2; - + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; - - - if(iHuffDim == 2){ + + + if ( iHuffDim == 2 ) + { int iSymbol; iSymbol = iQuantValue1; iSymbol *= iHuffMod; iSymbol += iQuantValue2; - BSPutBits(psBSWrite, pauiHuffmanTable[iSymbol][1], pauiHuffmanTable[iSymbol][0]); + BSPutBits( psBSWrite, pauiHuffmanTable[iSymbol][1], pauiHuffmanTable[iSymbol][0] ); iBitsWritten += pauiHuffmanTable[iSymbol][0]; } - else{ - BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue1][1], pauiHuffmanTable[iQuantValue1][0]); + else + { + BSPutBits( psBSWrite, pauiHuffmanTable[iQuantValue1][1], pauiHuffmanTable[iQuantValue1][0] ); iBitsWritten += pauiHuffmanTable[iQuantValue1][0]; - BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue2][1], pauiHuffmanTable[iQuantValue2][0]); + BSPutBits( psBSWrite, pauiHuffmanTable[iQuantValue2][1], pauiHuffmanTable[iQuantValue2][0] ); iBitsWritten += pauiHuffmanTable[iQuantValue2][0]; } - - if(iQuantValue1 > 0){ - BSPutBits(psBSWrite,ppiSignReal[iBlockOffest][iFBOffset],1); + + if ( iQuantValue1 > 0 ) + { + BSPutBits( psBSWrite, ppiSignReal[iBlockOffest][iFBOffset], 1 ); iBitsWritten += 1; } - if(iQuantValue2 > 0){ - BSPutBits(psBSWrite,ppiSignImag[iBlockOffest][iFBOffset],1); + if ( iQuantValue2 > 0 ) + { + BSPutBits( psBSWrite, ppiSignImag[iBlockOffest][iFBOffset], 1 ); iBitsWritten += 1; } - - iFBOffset ++; + + iFBOffset++; } } - else{ + else + { iFBOffset += piBandwidths[b]; } - } - - iBlockOffest ++; + + iBlockOffest++; } } - + return iBitsWritten; } -static int ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAvailableBits, - int *piAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag) +static int ComputeAllocation( const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAvailableBits, + int *piAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag ) { int iBitsUsed; int iDone; int iDelta; - + iBitsUsed = ALLOC_OFFSET_BITS; // Bits used for Alloc Offset - + iDone = 0; iDelta = -MIN_ALLOC_OFFSET; *piAllocOffset = 0; - while(iDone == 0){ + while ( iDone == 0 ) + { int n; int iLimitAllocOffset; iBitsUsed = ALLOC_OFFSET_BITS; - + iLimitAllocOffset = *piAllocOffset; - iLimitAllocOffset = (iLimitAllocOffset > MIN_ALLOC_OFFSET) ? iLimitAllocOffset : MIN_ALLOC_OFFSET; - iLimitAllocOffset = (iLimitAllocOffset < MAX_ALLOC_OFFSET) ? iLimitAllocOffset : MAX_ALLOC_OFFSET; - - for(n = 0; n < iChannels; n ++){ + iLimitAllocOffset = ( iLimitAllocOffset > MIN_ALLOC_OFFSET ) ? iLimitAllocOffset : MIN_ALLOC_OFFSET; + iLimitAllocOffset = ( iLimitAllocOffset < MAX_ALLOC_OFFSET ) ? iLimitAllocOffset : MAX_ALLOC_OFFSET; + + for ( n = 0; n < iChannels; n++ ) + { int k; - for(k = 0; k < piNumGroups[n]; k ++){ + for ( k = 0; k < piNumGroups[n]; k++ ) + { int b; - for(b = 0; b < iNumBands; b ++){ + for ( b = 0; b < iNumBands; b++ ) + { int iAlloc; - iAlloc = ((pppiSMR[n][k][b] + iLimitAllocOffset * ALLOC_OFFSET_SCALE) >> 5); - iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; - iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; + iAlloc = ( ( pppiSMR[n][k][b] + iLimitAllocOffset * ALLOC_OFFSET_SCALE ) >> 5 ); + iAlloc = ( iAlloc > MIN_ALLOC ) ? iAlloc : MIN_ALLOC; + iAlloc = ( iAlloc < MAX_ALLOC ) ? iAlloc : MAX_ALLOC; pppiAlloc[n][k][b] = iAlloc; } } - - QuantizeSpectrum(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const float**)pppfReal[n], - (const float**)pppfImag[n], - pppiQReal[n], - pppiQImag[n]); - - iBitsUsed += CountCQMFBits(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const int**)pppiQReal[n], - (const int**)pppiQImag[n]); + + QuantizeCQMFSpectrum( piNumGroups[n], + (const int *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int **) pppiAlloc[n], + (const float **) pppfReal[n], + (const float **) pppfImag[n], + pppiQReal[n], + pppiQImag[n] ); + + iBitsUsed += CountCQMFBits( piNumGroups[n], + (const int *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int **) pppiAlloc[n], + (const int **) pppiQReal[n], + (const int **) pppiQImag[n] ); } - - if(*piAllocOffset <= MIN_ALLOC_OFFSET && iBitsUsed > iAvailableBits){ + + if ( *piAllocOffset <= MIN_ALLOC_OFFSET && iBitsUsed > iAvailableBits ) + { #ifdef DEBUG_VERBOSE - printf("Frame can not be coded with the number of bits available\n"); + printf( "Frame can not be coded with the number of bits available\n" ); #endif - //iLastError = ENC_ERROR_STREAM_FAILURE; + // iLastError = ENC_ERROR_STREAM_FAILURE; return -1; } - else if(*piAllocOffset >= MAX_ALLOC_OFFSET && iBitsUsed < iAvailableBits){ + else if ( *piAllocOffset >= MAX_ALLOC_OFFSET && iBitsUsed < iAvailableBits ) + { *piAllocOffset = MAX_ALLOC_OFFSET; - iDone ++; + iDone++; } - else{ - if(iDelta == 0 && iBitsUsed > iAvailableBits){ + else + { + if ( iDelta == 0 && iBitsUsed > iAvailableBits ) + { iDelta = 1; } - else if(iDelta == 0 && iBitsUsed < iAvailableBits){ - iDone ++; + else if ( iDelta == 0 && iBitsUsed < iAvailableBits ) + { + iDone++; } - else if(iBitsUsed == iAvailableBits){ - iDone ++; + else if ( iBitsUsed == iAvailableBits ) + { + iDone++; } - - if(iBitsUsed > iAvailableBits){ + + if ( iBitsUsed > iAvailableBits ) + { *piAllocOffset -= iDelta; iDelta >>= 1; } - else if(iBitsUsed < iAvailableBits){ + else if ( iBitsUsed < iAvailableBits ) + { *piAllocOffset += iDelta; iDelta >>= 1; } } - } - - //printf("%d\t%d\t%d\t%d\n",*piAllocOffset,iAvailableBits,iBitsUsed,iAvailableBits - iBitsUsed); - + + // printf("%d\t%d\t%d\t%d\n",*piAllocOffset,iAvailableBits,iBitsUsed,iAvailableBits - iBitsUsed); + return iBitsUsed; } -static int ComputeAllocationByPass(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag) +static int ComputeAllocationByPass( const int iChannels, + const int *piNumGroups, + const int **ppiGroupLengths, + const int iNumBands, + const int *piBandwidths, + const float ***pppfReal, + const float ***pppfImag, + const int ***pppiSMR, + const int iAllocOffset, + int ***pppiAlloc, + int ***pppiQReal, + int ***pppiQImag ) { int n; int iBitsUsed; - + iBitsUsed = ALLOC_OFFSET_BITS; - - for(n = 0; n < iChannels; n ++){ + + for ( n = 0; n < iChannels; n++ ) + { int k; - for(k = 0; k < piNumGroups[n]; k ++){ + for ( k = 0; k < piNumGroups[n]; k++ ) + { int b; - for(b = 0; b < iNumBands; b ++){ + for ( b = 0; b < iNumBands; b++ ) + { int iAlloc; - iAlloc = ((pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE) >> 5); - iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; - iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; + iAlloc = ( ( pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE ) >> 5 ); + iAlloc = ( iAlloc > MIN_ALLOC ) ? iAlloc : MIN_ALLOC; + iAlloc = ( iAlloc < MAX_ALLOC ) ? iAlloc : MAX_ALLOC; pppiAlloc[n][k][b] = iAlloc; } } - - QuantizeSpectrum(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const float**)pppfReal[n], - (const float**)pppfImag[n], - pppiQReal[n], - pppiQImag[n]); - - iBitsUsed += CountCQMFBits(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const int**)pppiQReal[n], - (const int**)pppiQImag[n]); + + QuantizeCQMFSpectrum( piNumGroups[n], + (const int *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int **) pppiAlloc[n], + (const float **) pppfReal[n], + (const float **) pppfImag[n], + pppiQReal[n], + pppiQImag[n] ); + + iBitsUsed += CountCQMFBits( piNumGroups[n], + (const int *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int **) pppiAlloc[n], + (const int **) pppiQReal[n], + (const int **) pppiQImag[n] ); } - + return iBitsUsed; } diff --git a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c index e2f7ea62b1..03316c92f3 100644 --- a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c +++ b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c @@ -2,6 +2,8 @@ #include #include #include +#include "options.h" +#include "prot.h" #include "wmops.h" NoiseGen* CreateNoiseGen() @@ -10,12 +12,12 @@ NoiseGen* CreateNoiseGen() NoiseGen *psNoiseGen = NULL; - psNoiseGen = (NoiseGen*)malloc(sizeof(NoiseGen)); + psNoiseGen = (NoiseGen*)count_malloc(sizeof(NoiseGen)); psNoiseGen->iNoiseBufferLength = 2048; psNoiseGen->iNoiseBufferMask = 2047; psNoiseGen->iNoiseBufferIndex = 0; - psNoiseGen->pfNoiseBuffer = (float*)malloc(psNoiseGen->iNoiseBufferLength * sizeof(float)); + psNoiseGen->pfNoiseBuffer = (float*)count_malloc(psNoiseGen->iNoiseBufferLength * sizeof(float)); /* Generate Laplacian distributed noise */ for(n = 0; n < psNoiseGen->iNoiseBufferLength; n ++){ @@ -38,8 +40,8 @@ NoiseGen* CreateNoiseGen() void DeleteNoiseGen(NoiseGen *psNoiseGen) { - free(psNoiseGen->pfNoiseBuffer); - free(psNoiseGen); + count_free(psNoiseGen->pfNoiseBuffer); + count_free(psNoiseGen); } extern float GetNoise(NoiseGen *psNoiseGen); diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c index f51051d52d..68cf306c64 100644 --- a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c +++ b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c @@ -6,6 +6,8 @@ #include #include #include +#include "options.h" +#include "prot.h" #include "wmops.h" #include "Tables.h" @@ -29,26 +31,26 @@ typedef struct RMS_ENVELOPE_GROUPING RMSEnvelopeGrouping* CreateRMSEnvelopeGrouping(int iNumBlocks) { int n; - assert((iNumBlocks & 0x1) == 0); // remove this + //assert((iNumBlocks & 0x1) == 0); // remove this RMSEnvelopeGrouping *psRMSEnvelopeGrouping; - psRMSEnvelopeGrouping = (RMSEnvelopeGrouping*)malloc(sizeof(RMSEnvelopeGrouping)); + psRMSEnvelopeGrouping = (RMSEnvelopeGrouping*)count_malloc(sizeof(RMSEnvelopeGrouping)); psRMSEnvelopeGrouping->iNumBlocks = iNumBlocks; psRMSEnvelopeGrouping->iMaxGroups = iNumBlocks >> 1; // Change this - psRMSEnvelopeGrouping->ppfBandEnergy = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); - psRMSEnvelopeGrouping->ppfBandEnergydB = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); - psRMSEnvelopeGrouping->ppfWeight = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + psRMSEnvelopeGrouping->ppfBandEnergy = (float**)count_malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + psRMSEnvelopeGrouping->ppfBandEnergydB = (float**)count_malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); + psRMSEnvelopeGrouping->ppfWeight = (float**)count_malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - psRMSEnvelopeGrouping->ppfBandEnergy[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); /* 2 for stereo joint group calc */ - psRMSEnvelopeGrouping->ppfBandEnergydB[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); - psRMSEnvelopeGrouping->ppfWeight[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); + psRMSEnvelopeGrouping->ppfBandEnergy[n] = (float*)count_malloc(MAX_BANDS * 2 * sizeof(float)); /* 2 for stereo joint group calc */ + psRMSEnvelopeGrouping->ppfBandEnergydB[n] = (float*)count_malloc(MAX_BANDS * 2 * sizeof(float)); + psRMSEnvelopeGrouping->ppfWeight[n] = (float*)count_malloc(MAX_BANDS * 2 * sizeof(float)); } - psRMSEnvelopeGrouping->psGMNodes = (GMNode*)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(GMNode)); + psRMSEnvelopeGrouping->psGMNodes = (GMNode*)count_malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(GMNode)); for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); + psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB = (float*)count_malloc(MAX_BANDS * 2 * sizeof(float)); } return psRMSEnvelopeGrouping; @@ -59,20 +61,20 @@ void DeleteRMSEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping) int n; for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - free(psRMSEnvelopeGrouping->ppfBandEnergy[n]); - free(psRMSEnvelopeGrouping->ppfBandEnergydB[n]); - free(psRMSEnvelopeGrouping->ppfWeight[n]); + count_free(psRMSEnvelopeGrouping->ppfBandEnergy[n]); + count_free(psRMSEnvelopeGrouping->ppfBandEnergydB[n]); + count_free(psRMSEnvelopeGrouping->ppfWeight[n]); } - free(psRMSEnvelopeGrouping->ppfBandEnergy); - free(psRMSEnvelopeGrouping->ppfBandEnergydB); - free(psRMSEnvelopeGrouping->ppfWeight); + count_free(psRMSEnvelopeGrouping->ppfBandEnergy); + count_free(psRMSEnvelopeGrouping->ppfBandEnergydB); + count_free(psRMSEnvelopeGrouping->ppfWeight); for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - free(psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB); + count_free(psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB); } - free(psRMSEnvelopeGrouping->psGMNodes); + count_free(psRMSEnvelopeGrouping->psGMNodes); - free(psRMSEnvelopeGrouping); + count_free(psRMSEnvelopeGrouping); } diff --git a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c index 4317e0ec12..afd7ba3cd4 100644 --- a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c +++ b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c @@ -2,6 +2,8 @@ #include #include +#include "options.h" +#include "prot.h" #include "wmops.h" #define MAX_BUFFER 1024 @@ -22,7 +24,7 @@ Bitstream* CreateBitstream(const int iDirection, int n; Bitstream *psBitstream; - psBitstream = (Bitstream*)malloc(sizeof(Bitstream)); + psBitstream = (Bitstream*)count_malloc(sizeof(Bitstream)); psBitstream->iDirection =iDirection; psBitstream->iMaxBuffer = iMaxBuffer; @@ -35,7 +37,7 @@ Bitstream* CreateBitstream(const int iDirection, psBitstream->iMaxBuffer = MAX_BUFFER; } - psBitstream->puchBuffer = (unsigned char*)malloc(sizeof(unsigned char) * psBitstream->iMaxBuffer); + psBitstream->puchBuffer = (unsigned char*)count_malloc(sizeof(unsigned char) * psBitstream->iMaxBuffer); for(n = 0; n < psBitstream->iMaxBuffer; n ++){ psBitstream->puchBuffer[n] = 0; @@ -46,8 +48,8 @@ Bitstream* CreateBitstream(const int iDirection, void DeleteBitstream(Bitstream *psBitstream) { - free(psBitstream->puchBuffer); - free(psBitstream); + count_free(psBitstream->puchBuffer); + count_free(psBitstream); } void BSFlushBuffer(Bitstream *psBitstream) diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index f89564fffc..0087c1dde3 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -67,12 +67,12 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->iChannels = iChannels; splitBinLCLDDec->psCQMFDecoder = CreateCQMFDecoder( iSampleRate, iChannels ); - splitBinLCLDDec->pppfDecCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); - splitBinLCLDDec->pppfDecCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDDec->pppfDecCQMFReal = (float ***) count_malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDDec->pppfDecCQMFImag = (float ***) count_malloc( iChannels * sizeof( float ** ) ); for ( int32_t n = 0; n < splitBinLCLDDec->iChannels; n++ ) { - splitBinLCLDDec->pppfDecCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); - splitBinLCLDDec->pppfDecCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDDec->pppfDecCQMFReal[n] = (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDDec->pppfDecCQMFImag[n] = (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); } #ifdef CLDFB_DEBUG @@ -104,11 +104,11 @@ void ivas_splitBinLCLDDecClose( for ( int32_t n = 0; n < ( *hSplitBinLCLDDec )->iChannels; n++ ) { - free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal[n] ); - free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag[n] ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal[n] ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag[n] ); } - free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal ); - free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag ); #ifdef CLDFB_DEBUG if ( ( *hSplitBinLCLDDec )->cldfbOut != NULL ) diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index 97da222528..0dbd00733a 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -68,12 +68,12 @@ ivas_error ivas_splitBinLCLDEncOpen( splitBinLCLDEnc->iChannels = iChannels; splitBinLCLDEnc->psCQMFEncoder = CreateCQMFEncoder( iSampleRate, iChannels, iDataRate ); - splitBinLCLDEnc->pppfCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); - splitBinLCLDEnc->pppfCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDEnc->pppfCQMFReal = (float ***) count_malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDEnc->pppfCQMFImag = (float ***) count_malloc( iChannels * sizeof( float ** ) ); for ( int32_t n = 0; n < splitBinLCLDEnc->iChannels; n++ ) { - splitBinLCLDEnc->pppfCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); - splitBinLCLDEnc->pppfCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDEnc->pppfCQMFReal[n] = (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDEnc->pppfCQMFImag[n] = (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); } #ifdef CLDFB_DEBUG @@ -102,11 +102,11 @@ void ivas_splitBinLCLDEncClose( for ( int32_t n = 0; n < ( *hSplitBinLCLDEnc )->iChannels; n++ ) { - free( ( *hSplitBinLCLDEnc )->pppfCQMFReal[n] ); - free( ( *hSplitBinLCLDEnc )->pppfCQMFImag[n] ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFReal[n] ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFImag[n] ); } - free( ( *hSplitBinLCLDEnc )->pppfCQMFReal ); - free( ( *hSplitBinLCLDEnc )->pppfCQMFImag ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFReal ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFImag ); #ifdef CLDFB_DEBUG if ( ( *hSplitBinLCLDEnc )->cldfbIn != NULL ) -- GitLab From 90fc193be972d0d82208b81f8533b64f9dead81a Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 23 Jan 2023 12:09:39 +0100 Subject: [PATCH 0014/1418] initial branch --- lib_dec/ivas_masa_dec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 986829a015..0eec565504 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1798,6 +1798,8 @@ static void read_ism_ratio_index( } } } + + return; } static void decode_ism_ratios( @@ -1835,6 +1837,7 @@ static void decode_ism_ratios( { reconstruct_ism_ratios( ratio_ism_idx[band], n_ism, 1.0f / (float) ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ), ratio_ism[sf][band] ); } + if ( nbands == 1 ) { for ( band = 1; band < 5; band++ ) @@ -1843,6 +1846,7 @@ static void decode_ism_ratios( } } } + if ( numSf == 1 ) { for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) @@ -1853,6 +1857,8 @@ static void decode_ism_ratios( } } } + + return; } static int16_t ivas_decode_masaism_metadata( @@ -1969,6 +1975,13 @@ static int16_t ivas_decode_masaism_metadata( return ( nb_bits_read - *next_bit_pos ); } + +/*-------------------------------------------------------------------* + * ivas_masa_ism_set_edited_objects() + * + * + *-------------------------------------------------------------------*/ + void ivas_masa_ism_set_edited_objects( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) @@ -2012,6 +2025,8 @@ void ivas_masa_ism_set_edited_objects( } } } + + return; } -- GitLab From 4cef93cda89c12301f5774db0e48a9674005c468 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 23 Jan 2023 12:12:24 +0100 Subject: [PATCH 0015/1418] add returns --- lib_enc/ivas_masa_enc.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 4d70e7688f..0dbecbcb83 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2171,6 +2171,7 @@ static void transform_index_and_GR_encode( return; } + static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, @@ -2579,6 +2580,7 @@ static void ivas_encode_masaism_metadata( { bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); } + /* this is only the first version */ /* quantize directions */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) @@ -2586,14 +2588,23 @@ static void ivas_encode_masaism_metadata( idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); } + + return; } -void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], - float data_in_f2[][L_FRAME48k], - float data_out_f[][L_FRAME48k], - const int16_t input_frame, - const int16_t num_transport_channels ) +/*-------------------------------------------------------------------* + * ivas_merge_masa_transports() + * + * Merge MASA transport channels + *-------------------------------------------------------------------*/ + +void ivas_merge_masa_transports( + float data_in_f1[][L_FRAME48k], + float data_in_f2[][L_FRAME48k], + float data_out_f[][L_FRAME48k], + const int16_t input_frame, + const int16_t num_transport_channels ) { int16_t i, j; @@ -2604,5 +2615,7 @@ void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], data_out_f[i][j] = data_in_f1[i][j] + data_in_f2[i][j]; } } + + return; } #endif -- GitLab From 902f4b4735514b7ab8e016986fc5bef1694981e8 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 23 Jan 2023 16:39:04 +0100 Subject: [PATCH 0016/1418] Transfer defines: - #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs - #define OMASA_BRATE /* VA: combined format bit-budget distribution */ - #define OMASA_BRATE_FIX - #define DEBUG_VA --- Workspace_msvc/lib_dec.vcxproj | 1 + Workspace_msvc/lib_dec.vcxproj.filters | 3 + lib_com/bitstream.c | 34 +++ lib_com/ivas_cnst.h | 5 +- lib_com/ivas_ism_config.c | 182 ++++++++++++++- lib_com/ivas_prot.h | 124 +++++++--- lib_com/ivas_rom_com.c | 29 ++- lib_com/ivas_stat_com.h | 5 + lib_com/options.h | 6 + lib_dec/ivas_cpe_dec.c | 46 +++- lib_dec/ivas_dec.c | 25 ++- lib_dec/ivas_init_dec.c | 11 +- lib_dec/ivas_ism_metadata_dec.c | 55 ++++- lib_dec/ivas_masa_dec.c | 43 ++++ lib_dec/ivas_omasa_dec.c | 106 +++++++++ lib_dec/ivas_sce_dec.c | 11 +- lib_dec/ivas_stat_dec.h | 6 +- lib_dec/lib_dec.c | 11 + lib_enc/ivas_cpe_enc.c | 32 +++ lib_enc/ivas_enc.c | 102 ++++++++- lib_enc/ivas_init_enc.c | 12 +- lib_enc/ivas_ism_enc.c | 28 ++- lib_enc/ivas_ism_metadata_enc.c | 300 ++++++++++++++++++++----- lib_enc/ivas_masa_enc.c | 50 ++++- lib_enc/ivas_omasa_enc.c | 32 +++ lib_enc/ivas_sce_enc.c | 22 +- lib_enc/ivas_stat_enc.h | 10 +- lib_enc/ivas_stereo_mdct_core_enc.c | 4 + lib_enc/lib_enc.c | 7 +- 29 files changed, 1159 insertions(+), 143 deletions(-) create mode 100644 lib_dec/ivas_omasa_dec.c diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index 34b63eba78..a89d964e86 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -290,6 +290,7 @@ + diff --git a/Workspace_msvc/lib_dec.vcxproj.filters b/Workspace_msvc/lib_dec.vcxproj.filters index 4dcff8d503..4effb44669 100644 --- a/Workspace_msvc/lib_dec.vcxproj.filters +++ b/Workspace_msvc/lib_dec.vcxproj.filters @@ -503,6 +503,9 @@ dec_ivas_c + + dec_ivas_c + diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index e9d9cd13c5..b90c6d4ac7 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1812,6 +1812,12 @@ ivas_error preview_indices( else { st_ivas->ivas_format = MASA_FORMAT; +#ifdef MASA_AND_OBJECTS_VE + if ( bit_stream[3] ) + { + st_ivas->ivas_format = MASA_ISM_FORMAT; + } +#endif } break; } @@ -1968,6 +1974,34 @@ ivas_error preview_indices( ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ) ); } +#ifdef MASA_AND_OBJECTS_VE + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + /* read number of objects from the bitstream */ + st_ivas->nchan_transport = 0; + + if ( total_brate != SID_2k40 && total_brate != FRAME_NO_DATA ) + { + st_ivas->ism_mode = ivas_omasa_ism_mode_select( total_brate, st_ivas->nchan_ism ); + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + st_ivas->nchan_transport = 0; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + st_ivas->nchan_transport = 2 * st_ivas->bit_stream[total_brate / FRAMES_PER_SEC - 2] + st_ivas->bit_stream[total_brate / FRAMES_PER_SEC - 3] + 1; + } + + k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); + + { + st_ivas->nchan_transport++; + k--; + } + } + } +#endif } st_ivas->hDecoderConfig->ivas_total_brate = total_brate; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index fd1f3f10a4..3e36ec27db 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -300,7 +300,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 */ @@ -308,6 +308,9 @@ typedef enum #define ISM_METADATA_VAD_FLAG_BITS 1 #define ISM_METADATA_FLAG_BITS 2 +#ifdef OMASA_BRATE +#define ISM_INACTIVE_IMP 0 /* == ISM_NO_META */ +#endif #define ISM_NO_META 0 #define ISM_LOW_IMP 1 #define ISM_MEDIUM_IMP 2 diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 7a9dedfc9f..b5d12c0da2 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -63,7 +63,11 @@ * Convert bit-budget to bitrate *-------------------------------------------------------------------*/ +#ifdef OMASA_BRATE +void bitbudget_to_brate( +#else static void bitbudget_to_brate( +#endif const int16_t x[], /* i : bitbudgets */ int32_t y[], /* o : bitrates */ const int16_t N /* i : number of entries to be converted */ @@ -98,7 +102,7 @@ ivas_error ivas_ism_config( int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ #ifdef MASA_AND_OBJECTS , - int16_t masa_ism_flag /* i : flag indicating ISM MASA format */ + const int16_t combined_format_flag /* i : flag indicating combined format */ #endif ) { @@ -114,7 +118,7 @@ ivas_error ivas_ism_config( error = IVAS_ERR_OK; #ifdef MASA_AND_OBJECTS - if ( masa_ism_flag == 1 ) + if ( combined_format_flag == 1 ) { n_ISms = num_obj; } @@ -137,6 +141,40 @@ ivas_error ivas_ism_config( } } +#ifdef OMASA_BRATE + /* decision about bitrates per channel */ + if ( combined_format_flag ) + { + /* combined format: decision about bitrates per channel - variable during the session (at one ivas_total_brate) */ + bits_ism = (int16_t) ( ism_total_brate / FRMS_PER_SECOND ); + set_s( bits_element, bits_ism / n_ISms, n_ISms ); + bits_element[n_ISms - 1] += bits_ism % n_ISms; + + /* ISM common signaling bits are counted in MASA MD bit-budget */ + } + else + { + /* ISM format: decision about bitrates per channel - constant during the session (at one ivas_total_brate) */ + bits_ism = (int16_t) ( ism_total_brate / FRMS_PER_SECOND ); + set_s( bits_element, bits_ism / n_ISms, n_ISms ); + bits_element[n_ISms - 1] += bits_ism % n_ISms; + bitbudget_to_brate( bits_element, element_brate, n_ISms ); + + /* count ISm common signaling bits */ + if ( hIsmMeta != NULL ) + { + nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj; + + for ( ch = 0; ch < n_ISms; ch++ ) + { + if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) + { + nb_bits_metadata[0] += ISM_METADATA_VAD_FLAG_BITS; + } + } + } + } +#else /* decision about bitrates per channel - constant during the session (at one ivas_total_brate) */ bits_ism = (int16_t) ( ism_total_brate / FRMS_PER_SECOND ); set_s( bits_element, bits_ism / n_ISms, n_ISms ); @@ -148,7 +186,7 @@ ivas_error ivas_ism_config( { #ifdef MASA_AND_OBJECTS nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS; - if ( masa_ism_flag == 0 ) + if ( combined_format_flag == 0 ) { /* the bits for writing the number of objects are counted here for pure ISM modes */ nb_bits_metadata[0] += num_obj; @@ -165,6 +203,7 @@ ivas_error ivas_ism_config( } } } +#endif /* split metadata bitbudget equally between channels */ if ( nb_bits_metadata != NULL ) @@ -322,6 +361,31 @@ ivas_error ivas_ism_config( } } +#ifdef OMASA_BRATE + if ( combined_format_flag == 1 ) + { + if ( diff > 0 ) + { + for ( ch = 0; ch < n_ISms; ch++ ) + { + if ( ism_imp[ch] <= ISM_MEDIUM_IMP ) + { + if ( diff > limit_high ) + { + diff += bits_CoreCoder[ch] - limit_high; + bits_CoreCoder[ch] = limit_high; + } + else + { + bits_CoreCoder[ch] += diff; + break; + } + } + } + } + } +#endif + bitbudget_to_brate( bits_CoreCoder, total_brate, n_ISms ); } @@ -330,7 +394,11 @@ ivas_error ivas_ism_config( { int32_t tmpL; tmpL = sum_l( total_brate, n_ISms ) + bits_side * FRMS_PER_SECOND; +#ifdef OMASA_BRATE + if ( ism_total_brate != tmpL ) +#else if ( sum_l( element_brate, n_ISms ) != tmpL ) +#endif { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISm bit-budget distribution. Exiting!\n" ); } @@ -603,4 +671,112 @@ ISM_MODE ivas_omasa_ism_mode_select( return ism_mode; } + + +#ifdef OMASA_BRATE +/*--------------------------------------------------------------- + * ivas_interformat_brate() + * + * Bit-budget distribution in case of combined-format coding + * ---------------------------------------------------------------*/ + +#define GAMMA_ISM_LOW_IMP 0.8f +#define GAMMA_ISM_MEDIUM_IMP 1.2f +#define GAMMA_ISM_HIGH_IMP 1.4f + +/*! r: adjusted bitrate */ +int32_t ivas_interformat_brate( + const int32_t element_brate, /* i : element bitrate */ + const int16_t ism_imp /* i : ISM importance flag */ +) +{ + int32_t element_brate_out; + int16_t nBits, limit_low, limit_high; + + nBits = (int16_t) ( element_brate / FRAMES_PER_SEC ); + + if ( ism_imp == ISM_INACTIVE_IMP ) + { + nBits = BITS_ISM_INACTIVE; + } + else if ( ism_imp == ISM_LOW_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP ); + } + else if ( ism_imp == ISM_MEDIUM_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP ); + } + else /* ISM_HIGH_IMP */ + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP ); + } + + limit_low = MIN_BRATE_SWB_BWE / FRAMES_PER_SEC; + if ( ism_imp == ISM_INACTIVE_IMP ) + { + limit_low = BITS_ISM_INACTIVE; + } + else if ( element_brate >= SCE_CORE_16k_LOW_LIMIT ) + { + limit_low = SCE_CORE_16k_LOW_LIMIT / FRAMES_PER_SEC; + } + + limit_high = IVAS_512k / FRAMES_PER_SEC; + if ( element_brate < SCE_CORE_16k_LOW_LIMIT ) + { + limit_high = ACELP_12k8_HIGH_LIMIT / FRMS_PER_SECOND; + } + + nBits = check_bounds_s( nBits, limit_low, limit_high ); + + element_brate_out = nBits * FRAMES_PER_SEC; + + return element_brate_out; +} +#endif + + +#ifdef OMASA_BRATE_FIX +/*--------------------------------------------------------------- + * ivas_combined_format_brate_sanity() + * + * + * ---------------------------------------------------------------*/ + +void ivas_combined_format_brate_sanity( + const int32_t element_brate, /* i : element bitrate */ + const int32_t brate_surplus, /* i : surplus bitrate */ + int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ + const int16_t nchan_ism, /* i : number of objects */ + int16_t *diff_nBits /* o : number of differential bits */ +) +{ + /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by + low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget + for core-coding @12.8 kHz is too high => increase the ISM low-rate mode bit-rate */ + + int16_t nBits_CPE; + nBits_CPE = (int16_t) ( element_brate / FRAMES_PER_SEC ); + nBits_CPE -= nb_bits_metadata[0]; + nBits_CPE += (int16_t) ( brate_surplus / FRAMES_PER_SEC ); + nBits_CPE -= ( WB_TBE_0k35 / FRAMES_PER_SEC ); + nBits_CPE -= nb_bits_metadata[1]; + nBits_CPE -= 14; + + *diff_nBits = 0; + if ( nchan_ism == 1 && element_brate < ACELP_12k8_HIGH_LIMIT ) + { + int16_t limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; + + *diff_nBits = nBits_CPE - limit_high; + if ( *diff_nBits > 0 ) + { + nb_bits_metadata[0] += *diff_nBits; + } + } + + return; +} +#endif #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a9e1540ef4..00298890bd 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -797,10 +797,18 @@ ivas_error ivas_ism_config( int32_t total_brate[], /* o : total bitrate per object */ int16_t nb_bits_metadata[] /* i/o: number of metadata bits */ #ifdef MASA_AND_OBJECTS - , int16_t masa_ism_flag /* i : flag indicating ISM MASA format */ + , const int16_t combined_format_flag /* i : flag indicating combined format */ #endif ); +#ifdef OMASA_BRATE +void bitbudget_to_brate( + const int16_t x[], /* i : bitbudgets */ + int32_t y[], /* o : bitrates */ + const int16_t N /* i : number of entries to be converted */ +); +#endif + void ivas_ism_reset_metadata( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handles */ ); @@ -850,7 +858,11 @@ ivas_error ivas_ism_enc( ); ivas_error ivas_ism_metadata_enc( +#ifdef OMASA_BRATE + int32_t *ism_total_brate, /* i/o: ISms total bitrate */ +#else const int32_t ism_total_brate, /* i : ISms total bitrate */ +#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 */ @@ -861,7 +873,10 @@ ivas_error ivas_ism_metadata_enc( const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ #ifdef MASA_AND_OBJECTS , - int16_t n_ism /* i : number of ism-s */ + const int16_t n_ism /* i : number of objects */ +#ifdef OMASA_BRATE + ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ +#endif #endif ); @@ -4484,10 +4499,10 @@ void ivas_masa_encode( const int16_t element_mode /* i : element mode */ #ifdef MASA_AND_OBJECTS , - ISM_MODE ism_mode, /* i : ISM format mode */ - int16_t nchan_ism, /* i : number of ism channels */ + const ISM_MODE ism_mode, /* i : ISM format mode */ + const int16_t nchan_ism, /* i : number of ism channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ - int16_t idx_separated_object, /* i : index of the separated object */ + const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ #endif ); @@ -5102,56 +5117,93 @@ void ivas_filter_process( const int16_t length /* i : filter order */ ); + #ifdef MASA_AND_OBJECTS /* ----------------------------------------------------------------------------------* * OMASA prototypes * ----------------------------------------------------------------------------------*/ ivas_error ivas_omasa_enc_open( - Encoder_Struct* st_ivas /* i/o: IVAS encoder handle */ + Encoder_Struct* st_ivas /* i/o: IVAS encoder handle */ ); void ivas_omasa_enc_close( - OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ - const int16_t nchan_ism /* i : number of objects */ + OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ + const int16_t nchan_ism /* i : number of objects */ ); void ivas_omasa_set_config( - OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ - MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ - const int32_t input_Fs /* i : Input sample rate */ + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ + const int32_t input_Fs /* i : Input sample rate */ ); void ivas_omasa_enc( - OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ - IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ - MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ - float data_in_f[][L_FRAME48k], /* i : Input audio signals for parameter analysis */ - float data_out_f[][L_FRAME48k], /* o : Transport audio signals */ - const int16_t input_frame, /* i : Input frame size */ - const int16_t nchan_transport, /* i : Number of transport channels */ - const int16_t nchan_inp, /* i : Number of objects for parameter analysis */ - const ISM_MODE ism_mode, /* i : ISM mode */ - float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ - int16_t* idx_separated_object /* o : Index of the separated object */ + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ + float data_in_f[][L_FRAME48k], /* i : Input audio signals for parameter analysis */ + float data_out_f[][L_FRAME48k], /* o : Transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t nchan_transport, /* i : Number of transport channels */ + const int16_t nchan_inp, /* i : Number of objects for parameter analysis */ + const ISM_MODE ism_mode, /* i : ISM mode */ + float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ + int16_t* idx_separated_object /* o : Index of the separated object */ +); + +#ifdef OMASA_BRATE +void ivas_set_surplus_brate_enc( + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +); + +void ivas_set_surplus_brate_dec( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + int32_t *ism_total_brate /* i : ISM total bit-rate */ +); + +void set_ism_importance_interformat( + const int32_t ism_total_brate, /* i/o: ISms total bitrate */ + const int16_t nchan_transport, /* i : number of transported channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + const float lp_noise_CPE, /* i : LP filtered total noise estimation */ + int16_t ism_imp[] /* o : ISM importance flags */ +); + +/*! r: adjusted bitrate */ +int32_t ivas_interformat_brate( + const int32_t element_brate, /* i : element bitrate */ + const int16_t ism_imp /* i : ISM importance flag */ ); +#ifdef OMASA_BRATE_FIX +void ivas_combined_format_brate_sanity( + const int32_t element_brate, /* i : element bitrate */ + const int32_t brate_surplus, /* i : surplus bitrate */ + int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ + const int16_t nchan_ism, /* i : number of objects */ + int16_t *diff_nBits /* o : number of differential bits */ +); +#endif +#endif + ISM_MODE ivas_omasa_ism_mode_select( - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t no_obj /* i : number of input ISM's */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t no_obj /* i : number of input ISM's */ ); void ivas_merge_masa_transports( - float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ - float data_in_f2[][L_FRAME48k], /* i : Transport audio signals 2 */ - float data_out_f[][L_FRAME48k], /* o : Merged transport audio signals */ - const int16_t input_frame, /* i : Input frame size */ - const int16_t num_transport_channels /* i : Number of transport audio signals */ + float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ + float data_in_f2[][L_FRAME48k], /* i : Transport audio signals 2 */ + float data_out_f[][L_FRAME48k], /* o : Merged transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t num_transport_channels /* i : Number of transport audio signals */ ); void ivas_masa_ism_data_open( - Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ + Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); @@ -5165,14 +5217,14 @@ void preProcessStereoTransportsForMovedObjects( ); ivas_error ivas_masa_ism_separate_object_renderer_open( - Decoder_Struct* st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct* st_ivas /* i/o: IVAS decoder structure */ ); void ivas_masa_ism_separate_object_render( - Decoder_Struct* st_ivas, /* i/o: IVAS decoder structure */ - float input_f[][L_FRAME48k], /* i : separated object signal */ - float output_f[][L_FRAME48k], /* i/o: output signals */ - const int16_t output_frame /* i : output frame length per channel */ + Decoder_Struct* st_ivas, /* i/o: IVAS decoder structure */ + float input_f[][L_FRAME48k], /* i : separated object signal */ + float output_f[][L_FRAME48k], /* i/o: output signals */ + const int16_t output_frame /* i : output frame length per channel */ ); void ivas_masa_ism_set_edited_objects( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 2464229096..d7e3bd208f 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2780,18 +2780,23 @@ const float McMASA_LFEGain_vectors[64] = }; #ifdef MASA_AND_OBJECTS - -int32_t sep_object_brate[][MAX_NUM_OBJECTS] ={ - {0, 0, 0, 0}, /* 13k2 */ - {0, 0, 0, 0}, /* 16k4 */ - {9600, 0, 0, 0}, /* 24k4 */ - {9600, 0, 0, 0}, /* 32k */ - {IVAS_13k2, 0, 0, 0}, /* 48k */ - {16000, IVAS_13k2, 0, 0}, /* 64k */ - {20000, 16000, 0, 0}, /* 80k */ - {IVAS_32k, 20000, 0, 0}, /* 96k */ - {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ - {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ +// VE2Nokia: add "const" to the arrays +int32_t sep_object_brate[][MAX_NUM_OBJECTS] = +{ + {0, 0, 0, 0}, /* 13k2 */ + {0, 0, 0, 0}, /* 16k4 */ + {9600, 0, 0, 0}, /* 24k4 */ + {9600, 0, 0, 0}, /* 32k */ + {IVAS_13k2, 0, 0, 0}, /* 48k */ +#ifdef OMASA_BRATE_FIX + {16000, 12500, 0, 0}, /* 64k */ +#else + {16000, IVAS_13k2, 0, 0}, /* 64k */ +#endif + {20000, 16000, 0, 0}, /* 80k */ + {IVAS_32k, 20000, 0, 0}, /* 96k */ + {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index da715a482e..57420ceea8 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -58,6 +58,11 @@ typedef struct int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ +#ifdef OMASA_BRATE + int16_t ism_imp; /* ISM importance flag */ + int16_t ism_vad_flag; +#endif + } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index 7b3e297d78..6845dbbcaa 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,12 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ + +#define MASA_AND_OBJECTS_VE // VA: improve codec print-outs +#define OMASA_BRATE /* VA: combined format bit-budget distribution */ +#define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more work needed +#define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files + #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 8c24412dce..45b9ae6b0d 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -233,19 +233,27 @@ ivas_error ivas_cpe_dec( /* read DFT Stereo side info */ nb_bits = (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal ); #ifdef MASA_AND_OBJECTS +#ifdef OMASA_BRATE + cpe_brate = st_ivas->hCPE[0]->element_brate; +#else cpe_brate = ivas_total_brate; +#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifndef OMASA_BRATE cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); +#endif sts[1]->bit_stream = sts[0]->bit_stream + cpe_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; +#ifdef OMASA_BRATE + sts[1]->bit_stream += hCPE->brate_surplus / FRAMES_PER_SEC; +#endif } else - { #endif + { sts[1]->bit_stream = sts[0]->bit_stream + ivas_total_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; -#ifdef MASA_AND_OBJECTS } -#endif + if ( ivas_total_brate == IVAS_SID_5k2 ) { nb_bits -= SID_FORMAT_NBITS; @@ -269,6 +277,14 @@ ivas_error ivas_cpe_dec( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); + +#ifdef OMASA_BRATE + /* subtract bit-rate for combined format coding */ + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + sts[0]->total_brate += hCPE->brate_surplus; + } +#endif } else { @@ -287,6 +303,16 @@ ivas_error ivas_cpe_dec( } else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { +#ifdef OMASA_BRATE + /* compute bit-rate surplus per channel in combined format coding */ + int32_t brate_surplus[CPE_CHANNELS]; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; + brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; + } +#endif + if ( is_DTXrate( ivas_total_brate ) == 1 && ( sts[0]->first_CNG == 0 || sts[1]->first_CNG == 0 ) ) { if ( ( error = initMdctStereoDtxData( hCPE ) ) != IVAS_ERR_OK ) @@ -311,6 +337,15 @@ ivas_error ivas_cpe_dec( } sts[n]->bits_frame_nominal = (int16_t) ( sts[n]->total_brate / FRAMES_PER_SEC ); sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_channels ); + +#ifdef OMASA_BRATE + /* subtract bit-rate for combined format coding */ + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); + sts[n]->total_brate += brate_surplus[n]; + } +#endif } if ( !st_ivas->hMCT ) @@ -579,6 +614,7 @@ ivas_error create_cpe_dec( #ifdef MASA_AND_OBJECTS int32_t cpe_brate; #endif + error = IVAS_ERR_OK; /*-----------------------------------------------------------------* @@ -617,7 +653,7 @@ ivas_error create_cpe_dec( /* Note: nchan_out is considered to be related to the structure. This is nchan_out for CPE and for MASA_format is always 2. */ #ifdef MASA_AND_OBJECTS - if (st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MC_FORMAT ) + if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MC_FORMAT ) #else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MC_FORMAT ) #endif @@ -628,6 +664,7 @@ ivas_error create_cpe_dec( { hCPE->nchan_out = min( CPE_CHANNELS, st_ivas->hDecoderConfig->nchan_out ); } + #ifdef MASA_AND_OBJECTS if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -637,6 +674,7 @@ ivas_error create_cpe_dec( { cpe_brate = st_ivas->hDecoderConfig->ivas_total_brate; } + if ( ( ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index d950153165..d0e134f727 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -69,7 +69,7 @@ ivas_error ivas_dec( AUDIO_CONFIG output_config; ivas_error error; #ifdef MASA_AND_OBJECTS - int32_t ism_brate; + int32_t ism_total_brate; #endif error = IVAS_ERR_OK; @@ -550,9 +550,12 @@ ivas_error ivas_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - ism_brate = 0; +#ifndef OMASA_BRATE + ism_total_brate = 0; +#endif st = st_ivas->hCPE[0]->hCoreCoder[0]; +#ifndef OMASA_BRATE if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { st->bit_stream = &( st_ivas->bit_stream[( st_ivas->hSCE[0]->element_brate / FRAMES_PER_SEC )] ); @@ -561,10 +564,11 @@ ivas_error ivas_dec( { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - ism_brate += st_ivas->hSCE[n]->element_brate; + ism_total_brate += st_ivas->hSCE[n]->element_brate; } - st->bit_stream = &( st_ivas->bit_stream[( ism_brate / FRAMES_PER_SEC )] ); + st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); } +#endif nb_bits_metadata[0] = 0; set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); @@ -588,6 +592,16 @@ ivas_error ivas_dec( return error; } +#ifdef OMASA_BRATE + /* Configuration of combined-format bit-budget distribution */ + ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); + + st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); +#endif +#ifdef OMASA_BRATE_FIX + ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &n /* temp */ ); +#endif + /* Audio signal decoding */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { @@ -605,7 +619,7 @@ ivas_error ivas_dec( else { /* decode ISM format */ - ivas_ism_metadata_dec( ism_brate, &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL ); + ivas_ism_metadata_dec( ism_total_brate, &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL ); for ( n = 0; n < st_ivas->nSCE - 1; n++ ) { @@ -634,6 +648,7 @@ ivas_error ivas_dec( { mvr2r( output[0], output[1], output_frame ); /* Copy mono signal to stereo output channels */ } + /* HP filtering */ for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 53d103abe1..dcaf13dbd1 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -982,6 +982,13 @@ ivas_error ivas_init_decoder( create_sce_dec( st_ivas, 0, sce_brate ); reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); + +#ifdef OMASA_BRATE // VE: just 'ism_imp' parameter is needed - what about the other parameters? -> TBV + if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); + } +#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -998,10 +1005,10 @@ ivas_error ivas_init_decoder( { return error; } + reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); } - if ( ( error = create_ism_metadata_dec( st_ivas, st_ivas->nSCE, temp_brate ) ) != IVAS_ERR_OK ) { return error; @@ -1017,7 +1024,7 @@ ivas_error ivas_init_decoder( } st_ivas->nCPE = 1; - create_cpe_dec( st_ivas, 0, ( ( ivas_total_brate - sce_brate ) / st_ivas->nchan_transport ) * CPE_CHANNELS ); + create_cpe_dec( st_ivas, 0, ( ( ivas_total_brate - sce_brate ) / st_ivas->nchan_transport ) * CPE_CHANNELS ); // VE2Nokia: could be simplified - nchan_transport is always 2 here for ( n = 0; n < CPE_CHANNELS; n++ ) { diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 658dcaca4b..0d3b5fa572 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -164,7 +164,17 @@ ivas_error ivas_ism_metadata_dec( /* 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 ); +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + /* ISM importance flag is already read in ivas_masa_decode() */ + ism_imp[ch] = hIsmMeta[ch]->ism_imp; + } + else +#endif + { + ism_imp[ch] = get_next_indice( st0, ISM_METADATA_FLAG_BITS ); + } if ( ism_imp[ch] > ISM_NO_META ) { @@ -189,7 +199,17 @@ ivas_error ivas_ism_metadata_dec( { if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { - localVAD[ch] = get_next_indice( st0, ISM_METADATA_VAD_FLAG_BITS ); +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + /* VAD flag is already read in ivas_masa_decode() */ + localVAD[ch] = hIsmMeta[ch]->ism_vad_flag; + } + else +#endif + { + localVAD[ch] = get_next_indice( st0, ISM_METADATA_VAD_FLAG_BITS ); + } } else { @@ -469,6 +489,13 @@ ivas_error ivas_ism_metadata_dec( } } +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + ism_metadata_flag_global = 1; + } +#endif + /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ @@ -477,12 +504,22 @@ ivas_error ivas_ism_metadata_dec( { #ifdef MASA_AND_OBJECTS int16_t masa_ism_flag = 0; - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) // VE2Nokia: ISM_MASA_MODE_ONE_OBJ looks obsolete here { masa_ism_flag = 1; } #endif +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + for ( ch = 0; ch < *nchan_transport; ch++ ) + { + element_brate[ch] = hSCE[ch]->element_brate; + } + } +#endif + ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata #ifdef MASA_AND_OBJECTS , @@ -506,7 +543,12 @@ ivas_error ivas_ism_metadata_dec( } } - hSCE[ch]->element_brate = element_brate[ch]; +#ifdef OMASA_BRATE + if ( ism_mode != ISM_MASA_MODE_DISC ) +#endif + { + hSCE[ch]->element_brate = element_brate[ch]; + } hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; } @@ -567,6 +609,11 @@ ivas_error create_ism_metadata_dec( st_ivas->hIsmMetaData[ch]->last_azimuth_idx = 0; st_ivas->hIsmMetaData[ch]->last_elevation_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); +#ifdef OMASA_BRATE + st_ivas->hIsmMetaData[ch]->ism_imp = -1; + st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; +#endif + ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 0eec565504..db86d97fd9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -98,6 +98,9 @@ ivas_error ivas_masa_decode( ivas_error error; #ifdef MASA_AND_OBJECTS int16_t obj; +#ifdef OMASA_BRATE + int16_t i, ch, ism_imp; +#endif #endif error = IVAS_ERR_OK; @@ -167,6 +170,44 @@ ivas_error ivas_masa_decode( st_ivas->hMasaIsmData->idx_separated_ism = 2 * byteBuffer + st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read )++; } + +#ifdef OMASA_BRATE + /* read ISM importance flag (one per object) */ + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + ism_imp = 0; + for ( i = 0; i < ISM_METADATA_FLAG_BITS; i++ ) + { + byteBuffer = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read )++; + ism_imp = ( ism_imp << 1 ) + byteBuffer; + } + st_ivas->hIsmMetaData[0]->ism_imp = ism_imp; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) + { + ism_imp = 0; + for ( i = 0; i < ISM_METADATA_FLAG_BITS; i++ ) + { + byteBuffer = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read )++; + ism_imp = ( ism_imp << 1 ) + byteBuffer; + } + st_ivas->hIsmMetaData[ch]->ism_imp = ism_imp; + + /* reset */ + st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; + if ( st_ivas->hIsmMetaData[ch]->ism_imp == ISM_NO_META ) + { + /* read VAD flag */ + st_ivas->hIsmMetaData[ch]->ism_vad_flag = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read ) += ISM_METADATA_VAD_FLAG_BITS; + } + } + } +#endif } #endif /* Placeholder for descriptive metadata content */ @@ -365,7 +406,9 @@ ivas_error ivas_masa_decode( } if ( st_ivas->hDirAC != NULL ) { +#ifndef OMASA_BRATE int16_t i; +#endif int16_t b; int16_t block; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c new file mode 100644 index 0000000000..eacc84ef46 --- /dev/null +++ b/lib_dec/ivas_omasa_dec.c @@ -0,0 +1,106 @@ +/****************************************************************************************************** + + (C) 2022 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 "options.h" +#include +#include "ivas_cnst.h" +#include "ivas_prot.h" +#include "prot.h" +#ifdef DEBUGGING +#include "debug.h" +#endif + + +#ifdef OMASA_BRATE +/*--------------------------------------------------------------------------* + * ivas_set_surplus_brate_dec() + * + * set bit-rate surplus in combined format coding + *--------------------------------------------------------------------------*/ + +void ivas_set_surplus_brate_dec( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + int32_t *ism_total_brate /* i/o: ISM total bit-rate */ +) +{ + int16_t n, bits_ism, bits_element[MAX_NUM_OBJECTS]; + int32_t ism_total_brate_ref, element_brate[MAX_NUM_OBJECTS]; + + *ism_total_brate = 0; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + *ism_total_brate = ivas_interformat_brate( st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; + + /* set 'st->total_brate'; there are no meta-data in ISM_MASA_MODE_ONE_OBJ mode */ + st_ivas->hSCE[0]->hCoreCoder[0]->total_brate = *ism_total_brate; + + st_ivas->hSCE[0]->hCoreCoder[0]->low_rate_mode = 0; + if ( st_ivas->hIsmMetaData[0]->ism_imp == ISM_NO_META ) + { + st_ivas->hSCE[0]->hCoreCoder[0]->low_rate_mode = 1; + } + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + ism_total_brate_ref = 0; + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + ism_total_brate_ref += st_ivas->hSCE[n]->element_brate; + } + + bits_ism = (int16_t) ( ism_total_brate_ref / FRAMES_PER_SEC ); + set_s( bits_element, bits_ism / st_ivas->nchan_ism, st_ivas->nchan_ism ); + bits_element[st_ivas->nchan_ism - 1] += bits_ism % st_ivas->nchan_ism; + bitbudget_to_brate( bits_element, element_brate, st_ivas->nchan_ism ); + + *ism_total_brate = 0; + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + st_ivas->hSCE[n]->element_brate = element_brate[n]; + + *ism_total_brate += ivas_interformat_brate( st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); + } + st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; + + /* 'st->total_brate' is set in ivas_ism_config */ + } + else + { + st_ivas->hCPE[0]->brate_surplus = 0; + } + + return; +} +#endif diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 9a360f22a2..4cd2565a32 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -178,6 +178,9 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } +#ifdef OMASA_BRATE + else if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT ) /* note: total_brate[] is set in ivas_ism_config() or ivas_set_surplus_brate_dec() */ +#else #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -189,6 +192,7 @@ ivas_error ivas_sce_dec( } #endif else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ +#endif { st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; } @@ -199,7 +203,12 @@ ivas_error ivas_sce_dec( /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ #ifdef MASA_AND_OBJECTS - if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) + if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC +#ifdef OMASA_BRATE + || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ +#endif + ) && + st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) #else if ( st_ivas->ivas_format == ISM_FORMAT && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) #endif diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index e028cc6843..30191abcb0 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -670,7 +670,7 @@ typedef struct ivas_dirac_dec_data_structure int16_t numParametricDirections; /* 1 or 2 */ int16_t numIsmDirections; /* From 0 to MAX_NUM_OBJECTS */ #else - int16_t numSimultaneousDirections; /* 1 or 2 */ + int16_t numSimultaneousDirections; /* 1 or 2 */ #endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -963,6 +963,10 @@ typedef struct cpe_dec_data_structure float old_out_mdct[STEREO_MDCT2DFT_FADE_LEN_48k]; float old_outLB_mdct[2 * STEREO_MDCT2DFT_FADE_LEN_48k]; +#ifdef OMASA_BRATE + int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ +#endif + } CPE_DEC_DATA, *CPE_DEC_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3c4a1b1a5c..fab25168be 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1880,7 +1880,11 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Input configuration: MASA - %d channel(s)\n", st_ivas->nchan_transport ); } +#ifdef MASA_AND_OBJECTS_VE + else if ( st_ivas->ivas_format == MC_FORMAT ) +#else else /* MC_FORMAT */ +#endif { if ( ( error = get_channel_config( st_ivas->transport_config, &config_str[0] ) ) != IVAS_ERR_OK ) { @@ -1889,7 +1893,14 @@ static ivas_error printConfigInfo_dec( fprintf( stdout, "Input configuration: %s\n", config_str ); } +#ifdef MASA_AND_OBJECTS_VE + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + fprintf( stdout, "Input configuration: combined ISM and MASA (%i separated ISM stream(s)) \n", st_ivas->nchan_transport ); + } +#endif } + get_channel_config( st_ivas->hDecoderConfig->output_config, &config_str[0] ); fprintf( stdout, "Output configuration: %s\n", config_str ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 3332855cd7..ac489f0f1f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -306,6 +306,16 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode == IVAS_CPE_MDCT ) { +#ifdef OMASA_BRATE + /* compute bit-rate surplus per channel in combined format coding */ + int32_t brate_surplus[CPE_CHANNELS]; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; + brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; + } +#endif + /* this is just for initialization, the true values of "total_brate" and "bits_frame_channel" are set later */ for ( n = 0; n < n_CoreChannels; n++ ) { @@ -323,6 +333,15 @@ ivas_error ivas_cpe_enc( sts[n]->bits_frame_nominal = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_CoreChannels ); sts[n]->total_brate = hCPE->element_brate / n_CoreChannels; + +#ifdef OMASA_BRATE + /* subtract bit-rate for combined format coding */ + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); + sts[n]->total_brate += brate_surplus[n]; + } +#endif } } @@ -562,6 +581,7 @@ ivas_error ivas_cpe_enc( * DFT Stereo residual coding * DFT Stereo parameters writing into the bitstream *----------------------------------------------------------------*/ + #ifdef MASA_AND_OBJECTS cpe_brate = 0; #endif @@ -596,12 +616,16 @@ ivas_error ivas_cpe_enc( /* Write stereo bitstream */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_BRATE + cpe_brate = st_ivas->hCPE[0]->element_brate; +#else cpe_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT ) { cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); } +#endif if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && cpe_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) { @@ -655,6 +679,14 @@ ivas_error ivas_cpe_enc( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); + +#ifdef OMASA_BRATE + /* subtract bit-rate for combined format coding */ + if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + sts[0]->total_brate += hCPE->brate_surplus; + } +#endif } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 16e4080040..3bfa8bcfcc 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -310,7 +310,12 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { +#ifndef OMASA_BRATE float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; +#endif +#ifdef OMASA_BRATE_FIX + int16_t diff_nBits = 0; +#endif float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; @@ -327,6 +332,61 @@ ivas_error ivas_enc( /* nb_bits_metadata[0] = 0; */ set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); + +#ifdef OMASA_BRATE + /* Configure MASA encoder based on frame parameters */ + ivas_masa_enc_config( st_ivas ); // VE2Nokia: this function should return an error code + idx_separated_object = 0; + + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Configure oMASA analysis based on MASA config */ + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs ); + } + + /* Estimate TF-tile energy for the input MASA stream */ + ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[st_ivas->nchan_ism] ), input_frame, st_ivas->nchan_transport ); + + /* put audio object data in SCE's */ + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + // VE2Nokia: merge the following to one function in order to save some stack memory + float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; + + /* Estimate MASA parameters for the objects */ + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, data_transport_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); + + /* Merge transport signals */ + ivas_merge_masa_transports( data_transport_f, &( data_f[st_ivas->nchan_ism] ), data_f, input_frame, st_ivas->nchan_transport ); + } + + /* Encode ISMs transport channels */ + n = 0; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ); /* there are no metadata bits in SCE in this mode */ // VE2Nokia: this function should return an error code + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + /* Analysis, decision about bitrates per channel & core coding */ + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + { + return error; + } + n = st_ivas->nchan_ism; + } + + /* Encode MASA parameters and write MASA metadata bitstream */ + ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, + st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); + + /* Configuration of combined-format bit-budget distribution */ + ivas_set_surplus_brate_enc( st_ivas ); + +#ifdef OMASA_BRATE_FIX + ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &diff_nBits ); +#endif +#else if ( st_ivas->hQMetaData != NULL ) { /* Configure MASA encoder based on frame parameters */ @@ -377,11 +437,49 @@ ivas_error ivas_enc( } n = st_ivas->nchan_ism; } +#endif /* OMASA_BRATE */ + + /* Encode MASA transport channels */ + if ( st_ivas->nCPE == 1 ) // VE2Nokia: this condition is not necessary + { + ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); // VE2Nokia: this condition is unnecessary + } + +#ifdef OMASA_BRATE_FIX + if ( st_ivas->nchan_ism == 1 && st_ivas->hCPE[0]->element_brate < ACELP_12k8_HIGH_LIMIT && diff_nBits > 0 ) + { + while ( diff_nBits > 0 ) + { + i = min( diff_nBits, 16 ); + push_indice( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, IND_UNUSED, 0, i ); + diff_nBits -= i; + } + } +#endif - if ( st_ivas->nCPE == 1 ) /* Stereo DMX */ +#ifdef DEBUG_VA + if ( st_ivas->hSCE[0] != NULL ) { - ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); + float tmpF = 0; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); + } + else + { + for ( i = 0; i < st_ivas->nchan_ism; i++ ) + { + tmpF += st_ivas->hSCE[i]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[i + 1] * 50 ); + } + } + tmpF /= 1000.f; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_ISM" ); + tmpF = ivas_total_brate / 1000.0f - tmpF; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MASA" ); + tmpF = nb_bits_metadata[0] * 50 / 1000.0f; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MD" ); } +#endif } #endif else if ( ivas_format == MC_FORMAT ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 42c4cec050..cb8217d556 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -570,7 +570,8 @@ ivas_error ivas_init_encoder( st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); st_ivas->nchan_transport = 2; - create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ); + + create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ); // VE2Nokia: this function should return an error code /* the values of element_brate_tmp will be re-written in MASA_ISM_FORMAT because they are taken from sep_object_brate[][]*/ if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -589,7 +590,7 @@ ivas_error ivas_init_encoder( { /* use the bitrate for one object */ sce_brate = sep_object_brate[k - 2][0]; - create_sce_enc( st_ivas, 0, sce_brate ); + create_sce_enc( st_ivas, 0, sce_brate ); // VE2Nokia: this function should return an error code /* prepare bitstream buffers */ st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list = ind_list[0]; @@ -604,7 +605,7 @@ ivas_error ivas_init_encoder( for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { sce_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; - create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); + create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); // VE2Nokia: this function should return an error code /* prepare bitstream buffers */ st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list[sce_id]; @@ -614,8 +615,12 @@ ivas_error ivas_init_encoder( reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); } } + + // VE2Nokia: following functions should return an error code ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); + ivas_masa_enc_open( st_ivas ); + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { ivas_omasa_enc_open( st_ivas ); @@ -628,6 +633,7 @@ ivas_error ivas_init_encoder( { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; } + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - sce_brate ); diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 4a8a2b181f..8e89ed31ee 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -202,10 +202,20 @@ ivas_error ivas_ism_enc( st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i]; } - 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 + ivas_ism_metadata_enc( +#ifdef OMASA_BRATE + &st_ivas->hEncoderConfig->ivas_total_brate, +#else + st_ivas->hEncoderConfig->ivas_total_brate, +#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 #ifdef MASA_AND_OBJECTS - , - st_ivas->nSCE + , + st_ivas->nSCE +#ifdef OMASA_BRATE + , + -1 +#endif #endif ); } @@ -226,7 +236,19 @@ ivas_error ivas_ism_enc( ism_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; } +#ifdef OMASA_BRATE + int32_t ism_total_brate_ref = ism_total_brate; + + // VE: change the interface of the following function and call it with 'st_ivas' only + ivas_ism_metadata_enc( &ism_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, st_ivas->nSCE, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ); + + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - ism_total_brate; + } +#else ivas_ism_metadata_enc( ism_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, st_ivas->nSCE ); +#endif #else 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 ); #endif diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index fa2c4a1bd9..78997e6e79 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -138,6 +138,75 @@ static void rate_ism_importance( return; } + +#ifdef OMASA_BRATE +/*-------------------------------------------------------------------------* + * set_ism_importance_interformat() + * + * Set the importance of particular ISM streams in combined-format coding + *-------------------------------------------------------------------------*/ + +void set_ism_importance_interformat( + const int32_t ism_total_brate, /* i/o: ISms total bitrate */ + const int16_t nchan_transport, /* i : number of transported channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + const float lp_noise_CPE, /* i : LP filtered total noise estimation */ + int16_t ism_imp[] /* o : ISM importance flags */ +) +{ + Encoder_State *st; + int16_t ch, ctype, active_flag; + + for ( ch = 0; ch < nchan_transport; ch++ ) + { + st = hSCE[ch]->hCoreCoder[0]; + + active_flag = st->vad_flag; + + if ( active_flag == 0 ) + { + if ( st->lp_noise > 15 || lp_noise_CPE - st->lp_noise < 30 ) + { + active_flag = 1; + } + } + + /* do not use the low-rate core-coder mode at highest bit-rates */ + if ( ism_total_brate / nchan_transport > IVAS_48k ) + { + active_flag = 1; + } + + ctype = hSCE[ch]->hCoreCoder[0]->coder_type_raw; + + st->low_rate_mode = 0; + if ( active_flag == 0 ) + { + ism_imp[ch] = ISM_INACTIVE_IMP; + st->low_rate_mode = 1; + } + else if ( ctype == INACTIVE || ctype == UNVOICED ) + { + ism_imp[ch] = ISM_LOW_IMP; + } + else if ( ctype == VOICED ) + { + ism_imp[ch] = ISM_MEDIUM_IMP; + } + else /* GENERIC */ + { + ism_imp[ch] = ISM_HIGH_IMP; + } + + hIsmMeta[ch]->ism_metadata_flag = active_flag; /* flag is needed for the MD coding */ + } + + return; +} +#endif + + /*-------------------------------------------------------------------------* * ivas_ism_metadata_enc() * @@ -145,7 +214,11 @@ static void rate_ism_importance( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_enc( - const int32_t ism_total_brate, /* i : ISms total bitrate */ +#ifdef OMASA_BRATE + int32_t *ism_total_brate, /* i/o: ISms total bitrate */ +#else + const int32_t ism_total_brate, /* i : ISms total bitrate */ +#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 */ @@ -156,7 +229,11 @@ ivas_error ivas_ism_metadata_enc( const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ #ifdef MASA_AND_OBJECTS , - int16_t n_ism /* i : number of ism-s */ + const int16_t n_ism /* i : number of objects */ +#ifdef OMASA_BRATE + , + const float lp_noise_CPE +#endif #endif ) { @@ -213,82 +290,104 @@ ivas_error ivas_ism_metadata_enc( set_s( flag_abs_azimuth, 0, num_obj ); set_s( flag_abs_elevation, 0, num_obj ); - /*----------------------------------------------------------------* - * Set Metadata presence / importance flag - *----------------------------------------------------------------*/ +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + n_ch = num_obj; + } + else + { + n_ch = nchan_transport; + } - for ( ch = 0; ch < num_obj; ch++ ) + if ( ism_mode == ISM_MASA_MODE_DISC ) { - if ( ism_mode == ISM_MODE_PARAM ) + /*----------------------------------------------------------------* + * Rate importance of particular ISm streams in combined format coding + *----------------------------------------------------------------*/ + + set_ism_importance_interformat( *ism_total_brate, n_ch, hIsmMeta, hSCE, lp_noise_CPE, ism_imp ); + } + else +#endif + { + /*----------------------------------------------------------------* + * Set Metadata presence / importance flag + *----------------------------------------------------------------*/ + + for ( ch = 0; ch < num_obj; ch++ ) { - hIsmMeta[ch]->ism_metadata_flag = 1; - } + if ( ism_mode == ISM_MODE_PARAM ) + { + hIsmMeta[ch]->ism_metadata_flag = 1; + } #ifdef MASA_AND_OBJECTS - else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) + else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) #else - else if ( ism_mode == ISM_MODE_DISC ) + else if ( ism_mode == ISM_MODE_DISC ) #endif - { - hIsmMeta[ch]->ism_metadata_flag = localVAD[ch]; - - 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 ) ) ); + hIsmMeta[ch]->ism_metadata_flag = localVAD[ch]; - if ( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) + if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { - hIsmMeta[ch]->ism_metadata_flag = 1; + /* 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 ) ) ); + + if ( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) + { + hIsmMeta[ch]->ism_metadata_flag = 1; + } } - } - if ( hSCE[ch]->hCoreCoder[0]->tcxonly ) - { - /* at highest bitrates (with TCX core only) metadata are sent in every frame */ - hIsmMeta[ch]->ism_metadata_flag = 1; + if ( hSCE[ch]->hCoreCoder[0]->tcxonly ) + { + /* at highest bitrates (with TCX core only) metadata are sent in every frame */ + hIsmMeta[ch]->ism_metadata_flag = 1; + } } } - } - /*----------------------------------------------------------------* - * Rate importance of particular ISm streams - *----------------------------------------------------------------*/ + /*----------------------------------------------------------------* + * Rate importance of particular ISm streams + *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MASA_MODE_DISC ) - { - n_ch = num_obj; - } - else - { - n_ch = nchan_transport; - } + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + n_ch = num_obj; + } + else + { + n_ch = nchan_transport; + } - rate_ism_importance( n_ch, hIsmMeta, hSCE, ism_imp ); + rate_ism_importance( n_ch, hIsmMeta, hSCE, ism_imp ); #else - rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); + rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); #endif - /* relax the importance decision in "stereo" coding for noisy audio */ + /* relax the importance decision in "stereo" coding for noisy audio */ #ifdef MASA_AND_OBJECTS - if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && num_obj == 2 ) + if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && num_obj == 2 ) #else - if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) + if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) #endif - { - float diff_F; - - if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) { - for ( ch = 0; ch < num_obj; ch++ ) - { - diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; + float diff_F; - if ( hIsmMeta[ch]->ism_metadata_flag == 0 && diff_F < 25.0f ) + if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) + { + for ( ch = 0; ch < num_obj; ch++ ) { - hIsmMeta[ch]->ism_metadata_flag = 1; - ism_imp[ch] = ISM_LOW_IMP; + diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; + + if ( hIsmMeta[ch]->ism_metadata_flag == 0 && diff_F < 25.0f ) + { + hIsmMeta[ch]->ism_metadata_flag = 1; + ism_imp[ch] = ISM_LOW_IMP; + } } } } @@ -312,6 +411,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS } #endif + /* write ISm metadata flag (one per object) */ #ifdef MASA_AND_OBJECTS for ( ch = 0; ch < n_ch; ch++ ) @@ -319,7 +419,17 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_transport; ch++ ) #endif { - push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + /* ISM importance flag will be written in ivas_masa_encode() */ + hIsmMeta[ch]->ism_imp = ism_imp[ch]; + } + else +#endif + { + push_indice( hBstr, IND_ISM_METADATA_FLAG, ism_imp[ch], ISM_METADATA_FLAG_BITS ); + } } @@ -340,10 +450,28 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_transport; ch++ ) #endif { +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + /* reset */ + hIsmMeta[ch]->ism_vad_flag = 1; + } +#endif + if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { /* this flag distinguishes between coding of inactive frame and active frame w/o. metadata */ - push_indice( hBstr, IND_ISM_VAD_FLAG, localVAD[ch], ISM_METADATA_VAD_FLAG_BITS ); +#ifdef OMASA_BRATE + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + /* VAD flag will be written in ivas_masa_encode() */ + hIsmMeta[ch]->ism_vad_flag = localVAD[ch]; + } + else +#endif + { + push_indice( hBstr, IND_ISM_VAD_FLAG, localVAD[ch], ISM_METADATA_VAD_FLAG_BITS ); + } } } } @@ -756,12 +884,40 @@ ivas_error ivas_ism_metadata_enc( } } +#ifdef OMASA_BRATE + /*----------------------------------------------------------------* + * Take into account the combined format bit-budget distribution + *----------------------------------------------------------------*/ + + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; + + bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); + set_s( bits_element, bits_ism / num_obj, num_obj ); + bits_element[num_obj - 1] += bits_ism % num_obj; + bitbudget_to_brate( bits_element, element_brate, num_obj ); + + *ism_total_brate = 0; + for ( ch = 0; ch < num_obj; ch++ ) + { + *ism_total_brate += ivas_interformat_brate( hSCE[ch]->element_brate, ism_imp[ch] ); + } + ism_metadata_flag_global = 1; + } +#endif + /*----------------------------------------------------------------* * Configuration and decision about bitrates per channel *----------------------------------------------------------------*/ + #ifdef MASA_AND_OBJECTS - ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, - ( ism_mode == ISM_MASA_MODE_DISC ) ); +#ifdef OMASA_BRATE + ivas_ism_config( *ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, ism_mode == ISM_MASA_MODE_DISC ); // VE: this funtion should return an error +#else + + ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, ( ism_mode == ISM_MASA_MODE_DISC ) ); +#endif #else ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ); #endif @@ -770,9 +926,31 @@ ivas_error ivas_ism_metadata_enc( { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; } + #ifdef MASA_AND_OBJECTS for ( ch = 0; ch < n_ch; ch++ ) { +#ifdef OMASA_BRATE + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; + if ( ism_mode == ISM_MODE_DISC ) + { + if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) + { + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; + } + + hSCE[ch]->element_brate = element_brate[ch]; + } + else if ( ism_mode == ISM_MASA_MODE_DISC ) + { + if ( ism_imp[ch] == ISM_INACTIVE_IMP ) + { + hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; + } + } + + hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) { hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; @@ -784,6 +962,7 @@ ivas_error ivas_ism_metadata_enc( hSCE[ch]->element_brate = element_brate[ch]; hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; +#endif /* write metadata only in active frames */ if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) @@ -846,7 +1025,7 @@ ivas_error create_ism_metadata_enc( st_ivas->nCPE = 1; st_ivas->nSCE = 1; break; - case ISM_MODE_DISC: + case ISM_MODE_DISC: // VE2Nokia: this cannot happen st_ivas->nCPE = 1; st_ivas->nSCE = n_ISms; break; @@ -855,7 +1034,7 @@ ivas_error create_ism_metadata_enc( st_ivas->nSCE = n_ISms; break; case ISM_MODE_NONE: - if ( nchan_transport == 1 ) + if ( nchan_transport == 1 ) // VE2Nokia: this cannot happen { st_ivas->nSCE = 1; st_ivas->nCPE = 0; @@ -917,6 +1096,11 @@ ivas_error create_ism_metadata_enc( st_ivas->hIsmMetaData[ch]->elevation_diff_cnt = ISM_FEC_MAX - 1; st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; +#ifdef OMASA_BRATE + st_ivas->hIsmMetaData[ch]->ism_imp = -1; + st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; +#endif + ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } #ifdef MASA_AND_OBJECTS diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 0dbecbcb83..5ae88cead3 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -183,6 +183,10 @@ ivas_error ivas_masa_enc_open( set_zero( hMasa->data.lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES ); hMasa->data.prevq_lfeToTotalEnergyRatio = 0.0f; hMasa->data.prevq_lfeIndex = 0; +#ifdef OMASA_BRATE + hMasa->data.lp_noise_CPE = -1; +#endif + st_ivas->hMasa = hMasa; return error; @@ -244,11 +248,11 @@ void ivas_masa_encode( const int16_t element_mode /* i : element mode */ #ifdef MASA_AND_OBJECTS , - ISM_MODE ism_mode, /* i : ISM format mode */ - int16_t nchan_ism, /* i : number of ism channels */ + const ISM_MODE ism_mode, /* i : ISM format mode */ + const int16_t nchan_ism, /* i : number of ism channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ - int16_t idx_separated_object, /* i : index of the separated object */ - OMASA_ENC_HANDLE hOMasa /* i: OMASA encoder handle */ + const int16_t idx_separated_object, /* i : index of the separated object */ + OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ #endif ) { @@ -347,6 +351,30 @@ void ivas_masa_encode( push_next_indice( hMetaData, idx_separated_object, NO_BITS_MASA_ISM_NO_OBJ ); hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; } + +#ifdef OMASA_BRATE + /* write ISM importance flag (one per object) */ + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; + } + else if ( ism_mode == ISM_MASA_MODE_DISC ) + { + for ( i = 0; i < nchan_ism; i++ ) + { + push_next_indice( hMetaData, hIsmMetaData[i]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; + + if ( hIsmMetaData[i]->ism_metadata_flag == 0 ) + { + /* write VAD flag */ + push_next_indice( hMetaData, hIsmMetaData[i]->ism_vad_flag, ISM_METADATA_VAD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; + } + } + } +#endif } else { @@ -749,6 +777,20 @@ ivas_error ivas_masa_enc_config( #endif } +#ifdef OMASA_BRATE + if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) + { + st_ivas->hMasa->data.lp_noise_CPE = st_ivas->hCPE[0]->hCoreCoder[0]->lp_noise; + } + else + { + st_ivas->hMasa->data.lp_noise_CPE = ( st_ivas->hCPE[0]->hCoreCoder[0]->lp_noise + st_ivas->hCPE[0]->hCoreCoder[1]->lp_noise ) / CPE_CHANNELS; + } + } +#endif + return error; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index ae8e49d1a6..b7258bff9f 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -270,6 +270,8 @@ void ivas_omasa_set_config( { hOMasa->block_grouping[1] = hOMasa->block_grouping[MAX_PARAM_SPATIAL_SUBFRAMES]; } + + return; } @@ -484,6 +486,36 @@ void ivas_omasa_enc( } +#ifdef OMASA_BRATE +/*--------------------------------------------------------------------------* + * ivas_set_surplus_brate_enc() + * + * set bit-rate surplus in combined format coding + *--------------------------------------------------------------------------*/ + +void ivas_set_surplus_brate_enc( + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +) +{ + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + /* note: ISM st->total_brate is iset in ivas_sce_enc() */ + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + /* it is already set in ivas_ism_enc() */ + } + else + { + st_ivas->hCPE[0]->brate_surplus = 0; + } + + return; +} +#endif + + /*--------------------------------------------------------------------------* * Local functions *--------------------------------------------------------------------------*/ diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index f322c3ad3e..7b986c61f8 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -211,6 +211,19 @@ ivas_error ivas_sce_enc( reset_metadata_spatial( ivas_format, hSCE->hMetaData, hSCE->element_brate, &st->total_brate, st->core_brate, nb_bits_metadata, st_ivas->sba_mode ); +#ifdef OMASA_BRATE + /*----------------------------------------------------------------* + * Combined format coding: get the ISM importance and the bit-rate + *----------------------------------------------------------------*/ + + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); + + st->total_brate = ivas_interformat_brate( hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; + } +#endif + /*----------------------------------------------------------------* * Write IVAS format signaling in SID frames *----------------------------------------------------------------*/ @@ -229,6 +242,12 @@ ivas_error ivas_sce_enc( { st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->core_brate, 0, 0, -1, -1 ); } +#ifdef OMASA_BRATE + else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st->low_rate_mode ) + { + st->flag_ACELP16k = 0; + } +#endif else { st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->total_brate, 0, 0, -1, -1 ); @@ -329,8 +348,9 @@ ivas_error create_sce_enc( } copy_encoder_config( st_ivas, st, 1 ); + #ifdef MASA_AND_OBJECTS - if ( st_ivas->ism_mode >= ISM_MASA_MODE_PARAM ) + if ( st_ivas->ism_mode >= ISM_MASA_MODE_PARAM ) // VE2Nokia: ??? { st->element_mode = IVAS_SCE; /* To do: Nokia check as this is not optimal and verify if it influences other SCE modes */ } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index f715d1f5f5..bf574dbfcb 100755 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -731,8 +731,11 @@ typedef struct ivas_masa_encoder_data_struct float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t nchan_ism; - +#ifdef OMASA_BRATE + float lp_noise_CPE; /* LP filterend total noise estimation */ +#endif #endif + int16_t num_Cldfb_instances; HANDLE_CLDFB_FILTER_BANK cldfbAnaEnc[MAX_NUM_ENC_CLDFB_INSTANCES]; float *delay_buffer[MASA_MAX_TRANSPORT_CHANNELS]; @@ -930,6 +933,9 @@ typedef struct cpe_enc_data_structure float *input_mem[CPE_CHANNELS]; /* input channels buffers memory; needed to be up-to-date for TD->DFT stereo switching */ +#ifdef OMASA_BRATE + int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ +#endif #ifdef DEBUGGING int16_t stereo_mode_cmdl; /* stereo mode forced from the commaand-line */ #endif @@ -1095,7 +1101,7 @@ typedef struct /* high-level encoder parameters */ int16_t nchan_transport; /* number of transport channels */ #ifdef MASA_AND_OBJECTS - int16_t nchan_ism; + int16_t nchan_ism; // VE2Nokia: move it under hEncoderConfig, or remove it and replace it by "nchan_inp - 2" in the code #endif int16_t sba_analysis_order; /* Ambisonic (SBA) order used for analysis and coding */ int16_t codec_mode; /* Mode1 or Mode2 of core codec */ diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 1b8460cf07..f97d80e823 100755 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -436,7 +436,11 @@ void stereo_mdct_core_enc( sts[ch]->total_brate = ( sts[ch]->bits_frame_channel + sts[ch]->side_bits_frame_channel ) * FRAMES_PER_SEC; } stereo_bits += SMDCT_NBBITS_SPLIT_RATIO; +#ifdef OMASA_BRATE + assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate + hCPE->brate_surplus ); +#else assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate ); +#endif assert( hStereoMdct->split_ratio > 0 && hStereoMdct->split_ratio < SMDCT_BITRATE_RATIO_RANGE ); push_next_indice( hBstr, hStereoMdct->split_ratio, SMDCT_NBBITS_SPLIT_RATIO ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index e163b4810f..09e4b1e03f 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -384,7 +384,7 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( st_ivas = hIvasEnc->st_ivas; switch ( masaVariant ) { - case IVAS_ENC_MASA_1CH: + case IVAS_ENC_MASA_1CH: // VE2Nokia: seems not needeed st_ivas->hEncoderConfig->nchan_inp = 1 + numObjects; st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ break; @@ -1638,9 +1638,14 @@ static ivas_error printConfigInfo_enc( #ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { +#ifdef MASA_AND_OBJECTS_VE + fprintf( stdout, "IVAS format: combined ISM and MASA (%i ISM stream(s))\n", hEncoderConfig->nchan_inp - 2 ); +#else fprintf( stdout, "IVAS format: MASA and objects format\n" ); +#endif } #endif + /*-----------------------------------------------------------------* * Print CNG update interval, if DTX is activated *-----------------------------------------------------------------*/ -- GitLab From 190a901b579b2e157d0b1fe7ba3b7cdb4dd0a845 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 23 Jan 2023 20:02:52 +0100 Subject: [PATCH 0017/1418] two fixes --- lib_com/ivas_rom_com.c | 12 ++++++++---- lib_dec/core_switching_dec.c | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index d7e3bd208f..d9b341460d 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2786,7 +2786,11 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {0, 0, 0, 0}, /* 13k2 */ {0, 0, 0, 0}, /* 16k4 */ {9600, 0, 0, 0}, /* 24k4 */ +#ifdef OMASA_BRATE_FIX + {11000, 0, 0, 0}, /* 32k */ +#else {9600, 0, 0, 0}, /* 32k */ +#endif {IVAS_13k2, 0, 0, 0}, /* 48k */ #ifdef OMASA_BRATE_FIX {16000, 12500, 0, 0}, /* 64k */ @@ -2794,10 +2798,10 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif {20000, 16000, 0, 0}, /* 80k */ - {IVAS_32k, 20000, 0, 0}, /* 96k */ - {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ - {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ - {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ + {IVAS_32k, 20000, 0, 0}, /* 96k */ + {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ + {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 2d0e26b52c..46bb05f7aa 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -1039,7 +1039,11 @@ void bandwidth_switching_detect( { st->bws_cnt1 = 0; } - else if ( st->total_brate > ACELP_9k60 && st->last_core_brate < ACELP_9k60 && st->bwidth == SWB && st->last_bwidth == WB ) + else if ( st->total_brate > ACELP_9k60 && st->last_core_brate < ACELP_9k60 && st->bwidth == SWB && st->last_bwidth == WB +#ifdef OMASA_BRATE // VE: !!!!! TBV // VE: this likely breaks BE in pure ISM !!! + && st->last_core_brate != 2450 +#endif + ) { st->bws_cnt1++; } -- GitLab From c9f90ac8595ebb48a2f52d756032f886ab285a14 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 23 Jan 2023 20:21:43 +0100 Subject: [PATCH 0018/1418] - comments - fix uninitialized value --- lib_com/options.h | 2 +- lib_dec/core_switching_dec.c | 2 +- lib_dec/ivas_cpe_dec.c | 4 ++++ lib_enc/ivas_cpe_enc.c | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6845dbbcaa..e84936ec19 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs #define OMASA_BRATE /* VA: combined format bit-budget distribution */ -#define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more work needed +#define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more verification/tuning needed #define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 46bb05f7aa..3692d7653f 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -1040,7 +1040,7 @@ void bandwidth_switching_detect( st->bws_cnt1 = 0; } else if ( st->total_brate > ACELP_9k60 && st->last_core_brate < ACELP_9k60 && st->bwidth == SWB && st->last_bwidth == WB -#ifdef OMASA_BRATE // VE: !!!!! TBV // VE: this likely breaks BE in pure ISM !!! +#ifdef OMASA_BRATE // VE: !!!!! this breaks BE in pure ISM && st->last_core_brate != 2450 #endif ) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 45b9ae6b0d..99f68de6fc 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -691,6 +691,10 @@ ivas_error create_cpe_dec( set_f( hCPE->prev_synth[n], 0, NS2SA( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ) ); } +#ifdef OMASA_BRATE + hCPE->brate_surplus = 0; +#endif + /*-----------------------------------------------------------------* * DFT stereo I/O Buffers: allocate and initialize *-----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index ac489f0f1f..b106ac72ad 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -843,6 +843,10 @@ ivas_error create_cpe_enc( hCPE->hFrontVad[0] = NULL; hCPE->hFrontVad[1] = NULL; +#ifdef OMASA_BRATE + hCPE->brate_surplus = 0; +#endif + /*-----------------------------------------------------------------* * Input memory buffer: allocate and initialize *-----------------------------------------------------------------*/ -- GitLab From 6711b5640735a7707cee13848e0582150a33023c Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 10:54:58 +0100 Subject: [PATCH 0019/1418] - introduce OMASA_BRATE_FIX_ALT --- lib_com/ivas_ism_config.c | 44 +++++++++++++++++++++++++++++++++++++-- lib_com/ivas_prot.h | 9 ++++++++ lib_com/options.h | 3 ++- lib_dec/ivas_core_dec.c | 12 +++++++++++ lib_dec/ivas_dec.c | 2 ++ lib_enc/ivas_core_enc.c | 40 +++++++++++++++++++++++++++++++++++ lib_enc/ivas_enc.c | 8 +++++++ 7 files changed, 115 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index b5d12c0da2..62f7b4bf4b 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -741,9 +741,47 @@ int32_t ivas_interformat_brate( /*--------------------------------------------------------------- * ivas_combined_format_brate_sanity() * - * + * Sanity check in combined format coding * ---------------------------------------------------------------*/ +#ifdef OMASA_BRATE_FIX_ALT +void ivas_combined_format_brate_sanity( + const int32_t element_brate, /* i : element bitrate */ + const int16_t core, /* i : core */ + int32_t *core_brate, /* i/o: core bitrate */ + int16_t *diff_nBits /* o : number of differential bits */ +) +{ + int16_t limit_high, nBits; + + /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by + low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget + for ACELP core-coding @12.8 kHz is too high */ + + if ( element_brate < ACELP_12k8_HIGH_LIMIT ) + { + limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; + nBits = (int16_t) ( *core_brate / FRAMES_PER_SEC ); + + *diff_nBits = nBits - limit_high; + if ( *diff_nBits > 0 ) + { + if ( core == TCX_20_CORE || core == TCX_10_CORE ) + { + *diff_nBits = 0; + } + else /* ACELP core */ + { + *core_brate -= ( *diff_nBits * FRAMES_PER_SEC ); + } + } + } + + return; +} + +#else + void ivas_combined_format_brate_sanity( const int32_t element_brate, /* i : element bitrate */ const int32_t brate_surplus, /* i : surplus bitrate */ @@ -762,7 +800,8 @@ void ivas_combined_format_brate_sanity( nBits_CPE += (int16_t) ( brate_surplus / FRAMES_PER_SEC ); nBits_CPE -= ( WB_TBE_0k35 / FRAMES_PER_SEC ); nBits_CPE -= nb_bits_metadata[1]; - nBits_CPE -= 14; + nBits_CPE -= ( IVAS_FORMAT_SIGNALING_NBITS_SBA + 1 ); + nBits_CPE -= 10; *diff_nBits = 0; if ( nchan_ism == 1 && element_brate < ACELP_12k8_HIGH_LIMIT ) @@ -780,3 +819,4 @@ void ivas_combined_format_brate_sanity( } #endif #endif +#endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 00298890bd..2308525dc6 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5179,6 +5179,14 @@ int32_t ivas_interformat_brate( ); #ifdef OMASA_BRATE_FIX +#ifdef OMASA_BRATE_FIX_ALT +void ivas_combined_format_brate_sanity( + const int32_t element_brate, /* i : element bitrate */ + const int16_t core, /* i : core */ + int32_t *core_brate, /* i/o: core bitrate */ + int16_t *diff_nBits /* o : number of differential bits */ +); +#else void ivas_combined_format_brate_sanity( const int32_t element_brate, /* i : element bitrate */ const int32_t brate_surplus, /* i : surplus bitrate */ @@ -5188,6 +5196,7 @@ void ivas_combined_format_brate_sanity( ); #endif #endif +#endif ISM_MODE ivas_omasa_ism_mode_select( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ diff --git a/lib_com/options.h b/lib_com/options.h index e84936ec19..02f5388612 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +#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/" */ @@ -164,6 +164,7 @@ #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more verification/tuning needed +#define OMASA_BRATE_FIX_ALT #define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index e5cc40cd47..a9f3d1cb85 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -265,6 +265,18 @@ ivas_error ivas_core_dec( } } + +#ifdef OMASA_BRATE_FIX_ALT + /*------------------------------------------------------------------* + * Sanity check in combined format coding + *-----------------------------------------------------------------*/ + + if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT && hCPE->brate_surplus > 0 ) + { + ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, &( sts[0]->core_brate ), &tmps ); + } +#endif + /*------------------------------------------------------------------* * Core Decoding *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index d0e134f727..b12aadc91d 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -598,8 +598,10 @@ ivas_error ivas_dec( st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); #endif +#ifndef OMASA_BRATE_FIX_ALT #ifdef OMASA_BRATE_FIX ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &n /* temp */ ); +#endif #endif /* Audio signal decoding */ diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 1ee672efed..78a9f2af1b 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -102,6 +102,9 @@ ivas_error ivas_core_enc( float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; +#ifdef OMASA_BRATE_FIX_ALT + int16_t diff_nBits; +#endif ivas_error error; push_wmops( "ivas_core_enc" ); @@ -187,6 +190,27 @@ ivas_error ivas_core_enc( } } + +#ifdef OMASA_BRATE_FIX_ALT + /*------------------------------------------------------------------* + * Sanity check in combined format coding + *-----------------------------------------------------------------*/ + + diff_nBits = 0; + if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT && hCPE->brate_surplus > 0 ) + { + ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, &( sts[0]->core_brate ), &diff_nBits ); + } + +#ifdef DEBUG_VA + if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT ) + { + diff_nBits = max( diff_nBits, 0 ); + dbgwrite( &diff_nBits, 2, 1, 960, "res/_diff" ); + } +#endif +#endif + /*---------------------------------------------------------------------* * Core Encoding *---------------------------------------------------------------------*/ @@ -405,6 +429,22 @@ ivas_error ivas_core_enc( } } +#ifdef OMASA_BRATE_FIX_ALT + /*------------------------------------------------------------------* + * Write potentially unused bits in combined format coding + *-----------------------------------------------------------------*/ + + if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT && hCPE->brate_surplus > 0 ) + { + while ( diff_nBits > 0 ) + { + n = min( diff_nBits, 16 ); + push_indice( sts[0]->hBstr, IND_UNUSED, 0, n ); + diff_nBits -= n; + } + } +#endif + #ifdef DEBUG_MODE_INFO for ( n = 0; n < n_CoreChannels; n++ ) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 3bfa8bcfcc..554a6bb8d6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -313,8 +313,10 @@ ivas_error ivas_enc( #ifndef OMASA_BRATE float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; #endif +#ifndef OMASA_BRATE_FIX_ALT #ifdef OMASA_BRATE_FIX int16_t diff_nBits = 0; +#endif #endif float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; @@ -383,9 +385,11 @@ ivas_error ivas_enc( /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_enc( st_ivas ); +#ifndef OMASA_BRATE_FIX_ALT #ifdef OMASA_BRATE_FIX ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &diff_nBits ); #endif +#endif #else if ( st_ivas->hQMetaData != NULL ) { @@ -445,7 +449,10 @@ ivas_error ivas_enc( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); // VE2Nokia: this condition is unnecessary } +#ifndef OMASA_BRATE_FIX_ALT #ifdef OMASA_BRATE_FIX + diff_nBits = max( diff_nBits, 0 ); + //dbgwrite( &diff_nBits, 2, 1, 960, "res/_diff" ); if ( st_ivas->nchan_ism == 1 && st_ivas->hCPE[0]->element_brate < ACELP_12k8_HIGH_LIMIT && diff_nBits > 0 ) { while ( diff_nBits > 0 ) @@ -456,6 +463,7 @@ ivas_error ivas_enc( } } #endif +#endif #ifdef DEBUG_VA if ( st_ivas->hSCE[0] != NULL ) -- GitLab From 751cc3904f07bbe09069ea2416f6c8c0e19da552 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 14:01:32 +0100 Subject: [PATCH 0020/1418] - introduce OMASA_BRATE_TD - fix for 2ISM @64 kbps in ROM table --- lib_com/ivas_rom_com.c | 2 +- lib_com/options.h | 3 ++- lib_dec/ivas_cpe_dec.c | 3 +++ lib_dec/ivas_stereo_switching_dec.c | 4 +++ lib_dec/ivas_stereo_td_dec.c | 42 +++++++++++++++++++++++++++++ lib_enc/ivas_cpe_enc.c | 11 ++++++++ lib_enc/ivas_stereo_td_enc.c | 7 +++++ 7 files changed, 70 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index d9b341460d..90c962158d 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2793,7 +2793,7 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = #endif {IVAS_13k2, 0, 0, 0}, /* 48k */ #ifdef OMASA_BRATE_FIX - {16000, 12500, 0, 0}, /* 64k */ + {16000, 12000, 0, 0}, /* 64k */ #else {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif diff --git a/lib_com/options.h b/lib_com/options.h index 02f5388612..033be97812 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -#define DEBUG_MODE_INFO /* output most important parameters to the subdirectory "res/" */ +/*#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/" */ @@ -165,6 +165,7 @@ #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more verification/tuning needed #define OMASA_BRATE_FIX_ALT +#define OMASA_BRATE_TD // support of bitrate adaptation n TD stereo - work in progress #define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 99f68de6fc..356789d07f 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -296,6 +296,9 @@ ivas_error ivas_cpe_dec( /* signal bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); +#ifdef OMASA_BRATE_TD + sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); +#endif if ( st_ivas->hQMetaData != NULL ) { sts[1]->bits_frame_channel -= st_ivas->hQMetaData->metadata_max_bits; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 73ca81c997..bed57060a1 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -767,7 +767,11 @@ ivas_error stereo_memory_dec( if ( hCPE->hCoreCoder[0]->bfi == 0 ) { st = hCPE->hCoreCoder[1]; +#ifdef OMASA_BRATE_TD + hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate + hCPE->brate_surplus, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + ( hCPE->brate_surplus / FRAMES_PER_SEC ) - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); +#else hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); +#endif if ( hCPE->hStereoTD->tdm_LRTD_flag ) { diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index d636d12bd7..5ed7a4ed4b 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -94,10 +94,19 @@ void tdm_configure_dec( int16_t tdm_tmp_SM_LRTD_flag; int16_t mod_ct, core, bits_offset; int16_t idx_LRTD_pri_side, tdm_inst_ratio_idx; +#ifdef OMASA_BRATE_TD + int32_t element_brate_adapt; + int16_t bstr_last_pos; +#endif hStereoTD = hCPE->hStereoTD; sts = hCPE->hCoreCoder; +#ifdef OMASA_BRATE_TD + element_brate_adapt = hCPE->element_brate + hCPE->brate_surplus; + bstr_last_pos = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); +#endif + /*----------------------------------------------------------------* * Decode CoreCoder signaling *----------------------------------------------------------------*/ @@ -123,7 +132,11 @@ void tdm_configure_dec( /* Get few parameters needed to decode the bitrate allocated to each channel */ /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ +#ifdef OMASA_BRATE_TD + sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - nb_bits_metadata - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); +#else sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING ); +#endif /* Get the LRTD config flag: 1 = LRTD configuration, favor closer bitrate per channel; 0 = Pri/Sec configuration, bitrates linked wrt. the mono */ @@ -151,19 +164,31 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ /* Get the correlation ratio */ +#ifdef OMASA_BRATE_TD + *tdm_ratio_idx = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); +#else *tdm_ratio_idx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); +#endif hStereoTD->tdm_use_IAWB_Ave_lpc = 0; if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ +#ifdef OMASA_BRATE_TD + hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); +#else hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); +#endif hStereoTD->tdm_lp_reuse_flag = 1; } else { /* Get the flag on the LPC reusage */ +#ifdef OMASA_BRATE_TD + hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); +#else hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); +#endif } sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; /* the flag was already read in function stereo_memory_dec() */ @@ -219,7 +244,11 @@ void tdm_configure_dec( int16_t tmpS = 20; if ( hStereoTD->tdm_LRTD_flag == 0 ) { +#ifdef OMASA_BRATE_TD + tmpS = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); +#else tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); +#endif } hCPE->hStereoDftDmx->targetGain = usdequant( tmpS, STEREO_TCA_GDMIN, STEREO_TCA_GDSTEP ); hCPE->hStereoDftDmx->targetGain = powf( 10, hCPE->hStereoDftDmx->targetGain ); @@ -228,9 +257,15 @@ void tdm_configure_dec( { if ( hStereoTD->tdm_LRTD_flag == 0 ) { +#ifdef OMASA_BRATE_TD + hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS, STEREO_BITS_TCA_CHAN ); + hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN, STEREO_BITS_TCA_CORRSTATS ); + hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); +#else hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS ), STEREO_BITS_TCA_CHAN ); hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN ), STEREO_BITS_TCA_CORRSTATS ); hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); +#endif } else { @@ -265,7 +300,14 @@ void tdm_configure_dec( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ +#ifdef OMASA_BRATE_TD + tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); +#else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); +#endif return; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index b106ac72ad..518b5262bf 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -166,6 +166,14 @@ ivas_error ivas_cpe_enc( if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL ) { + +#ifdef OMASA_BRATE_TD // VE: !!!!! temp hack only + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + hCPE->stereo_mode_cmdl = IVAS_CPE_DFT; + } +#endif + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } @@ -396,6 +404,9 @@ ivas_error ivas_cpe_enc( /* signal the bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); +#ifdef OMASA_BRATE_TD + sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); +#endif if ( st_ivas->hQMetaData != NULL ) { sts[1]->bits_frame_channel -= st_ivas->hQMetaData->metadata_max_bits; diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 4823e2b5f1..4858131c34 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -452,7 +452,14 @@ void tdm_configure_enc( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ +#ifdef OMASA_BRATE_TD + tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); +#else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); +#endif if ( sts[0]->GSC_IVAS_mode > 0 && sts[0]->total_brate <= STEREO_GSC_BIT_RATE_ALLOC ) { -- GitLab From 3f8246afb1a1616ac64b390de954f4dee22f08cd Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 14:43:30 +0100 Subject: [PATCH 0021/1418] debugging code to force TD stereo --- lib_enc/ivas_cpe_enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 518b5262bf..5e87ea5247 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -171,6 +171,7 @@ ivas_error ivas_cpe_enc( if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { hCPE->stereo_mode_cmdl = IVAS_CPE_DFT; + //hCPE->stereo_mode_cmdl = IVAS_CPE_TD; } #endif -- GitLab From a40cb66218a9a26240a7cb123033aa7e1a05c44b Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 16:08:14 +0100 Subject: [PATCH 0022/1418] - patch for MDCT stereo 2 x TCX10_CORE (deactivated) --- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_stereo_mdct_core_enc.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 5ae88cead3..7986196a08 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2160,7 +2160,7 @@ static int16_t index_slice_enum( i = 0; while ( i <= x ) { - if ( valid( i, 7, no_ism - 1 ) ) + if ( valid_ratio_index( i, 7, no_ism - 1 ) ) { index++; } diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index f97d80e823..46f524fa4b 100755 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -175,6 +175,15 @@ void stereo_mdct_core_enc( sts[0]->hTcxEnc->tfm_mem = sts[1]->hTcxEnc->tfm_mem = sqrtf( 0.5f * ( sts[0]->hTcxEnc->tfm_mem * sts[0]->hTcxEnc->tfm_mem + sts[1]->hTcxEnc->tfm_mem * sts[1]->hTcxEnc->tfm_mem ) ); /* RMS */ sts[0]->hTcxEnc->tcxltp_norm_corr_past = sts[1]->hTcxEnc->tcxltp_norm_corr_past = 0.5f * ( sts[0]->hTcxEnc->tcxltp_norm_corr_past + sts[1]->hTcxEnc->tcxltp_norm_corr_past ); + +#if 0 + if ( sts[0]->bits_frame_channel + sts[1]->bits_frame_channel - meta_bits < 495 ) + { + sts[0]->hTranDet->transientDetector.bIsAttackPresent = 0; + sts[1]->hTranDet->transientDetector.bIsAttackPresent = 0; + } +#endif + for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { st = sts[ch]; -- GitLab From 7972e6ea96fe1d3a9c2af88749d4d1413cded808 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 16:10:20 +0100 Subject: [PATCH 0023/1418] - add 'ism_mode' parameter to the ivas_interformat_brate() - remove patch for MDCT stereo 2 x TCX10_CORE (deactivated) - rename function valid() to valid_ratio_index() + formatting --- lib_com/ivas_ism_config.c | 11 ++++++- lib_com/ivas_masa_com.c | 57 +++++++++++++++++++++++++-------- lib_com/ivas_prot.h | 31 ++++++++++-------- lib_dec/ivas_masa_dec.c | 2 +- lib_dec/ivas_omasa_dec.c | 4 +-- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 2 +- 8 files changed, 76 insertions(+), 35 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 62f7b4bf4b..8774bd9105 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -683,9 +683,11 @@ ISM_MODE ivas_omasa_ism_mode_select( #define GAMMA_ISM_LOW_IMP 0.8f #define GAMMA_ISM_MEDIUM_IMP 1.2f #define GAMMA_ISM_HIGH_IMP 1.4f +#define GAMMA_ISM_HIGH_IMP2 1.35f /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( + const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ ) @@ -709,7 +711,14 @@ int32_t ivas_interformat_brate( } else /* ISM_HIGH_IMP */ { - nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP ); + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP2 ); + } + else + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP ); + } } limit_low = MIN_BRATE_SWB_BWE / FRAMES_PER_SEC; diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 920985e81d..9211ec057d 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -422,17 +422,20 @@ void masa_sample_rate_band_correction( return; } + #ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------- - * valid() + * valid_ratio_index() * * Checking validity of the index of an ISM ratio index vector, * within the indexing function. *---------------------------------------------------------------*/ -int16_t valid( /* o: valid or not 1/0 */ - int16_t index, /* i: index to be checked */ - int16_t K, /* i: L1 norm to check against */ - int16_t len /* i: vector length */ + +/*! r: valid or not 1/0 */ +int16_t valid_ratio_index( + int16_t index, /* i : index to be checked */ + const int16_t K, /* i : L1 norm to check against */ + const int16_t len /* i : vector length */ ) { int16_t out; @@ -462,39 +465,47 @@ int16_t valid( /* o: valid or not 1/0 */ { out = 0; } + return out; } + /*--------------------------------------------------------------- * reconstruct_ism_ratios() * * Obtains ISM ratio values from the quantized indexes *---------------------------------------------------------------*/ + void reconstruct_ism_ratios( - int16_t *ratio_ism_idx, /* i: index vector */ - int16_t n_ism, /* i: number of components/objects */ - float step, /* i: quantization step */ - float *q_energy_ratio_ism /* o: reconstructed ISM values */ + int16_t *ratio_ism_idx, /* i : index vector */ + int16_t n_ism, /* i : number of components/objects */ + float step, /* i : quantization step */ + float *q_energy_ratio_ism /* o : reconstructed ISM values */ ) { int16_t i; float sum; + sum = 0; for ( i = 0; i < n_ism - 1; i++ ) { q_energy_ratio_ism[i] = ratio_ism_idx[i] * step; sum += q_energy_ratio_ism[i]; } + q_energy_ratio_ism[n_ism - 1] = 1.0f - sum; + return; } + /*--------------------------------------------------------------- * modify_masa_energy_ratios() * * Updates energy ratios by taking into account the MASA content contribution * to the total audio scene *---------------------------------------------------------------*/ + void modify_masa_energy_ratios( IVAS_QMETADATA_HANDLE hQMetaData /* i/o: Metadata handle */ ) @@ -519,13 +530,18 @@ void modify_masa_energy_ratios( } } } + + return; } + /*--------------------------------------------------------------- * ivas_get_stereo_panning_gains() * * + *---------------------------------------------------------------*/ + void ivas_get_stereo_panning_gains( float aziDeg, float eleDeg, @@ -559,13 +575,17 @@ void ivas_get_stereo_panning_gains( panningGains[0] = sqrtf( A3 ); panningGains[1] = sqrtf( 1.0f - A3 ); } + + return; } + /*--------------------------------------------------------------- * distribute_evenly_ism() * * Obtain ISM ratio indexes for even content distribution bbetween objects *---------------------------------------------------------------*/ + void distribute_evenly_ism( int16_t *idx, /* o: index values */ int16_t K, /* i: sum of indexes */ @@ -574,13 +594,16 @@ void distribute_evenly_ism( { int16_t i; int16_t sum; + sum = 0; for ( i = 0; i < no_ism; i++ ) { idx[i] = (int16_t) ( K / no_ism ); sum += idx[i]; } + assert( sum <= K ); + i = 0; while ( sum < K ) { @@ -592,19 +615,24 @@ void distribute_evenly_ism( sum++; i++; } + + return; } + /*--------------------------------------------------------------- * calculate_cpe_brate_MASA_ISM() * * Calculates bitrate for MASA_ISM mode that is not used for separated objects, * * but for the CPE part (metadata included) *---------------------------------------------------------------*/ -int32_t /* o: cpe bitrate value */ -calculate_cpe_brate_MASA_ISM( - ISM_MODE ism_mode, /* i: ism mode */ - int32_t ivas_total_brate, /* i: total bit rate for IVAS */ - int16_t n_ism ) /* i: number of objects */ + +/*! r: CPE bitrate value */ +int32_t calculate_cpe_brate_MASA_ISM( + const ISM_MODE ism_mode, /* i : ism mode */ + const int32_t ivas_total_brate, /* i : total bit rate for IVAS */ + const int16_t n_ism /* i : number of objects */ +) { int32_t cpe_brate; int16_t k, sce_id; @@ -632,6 +660,7 @@ calculate_cpe_brate_MASA_ISM( { cpe_brate = ivas_total_brate; } + return cpe_brate; } #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 2308525dc6..d2101fe446 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4535,10 +4535,11 @@ void ivas_masa_set_elements( ); #ifdef MASA_AND_OBJECTS -int16_t valid( - int16_t index, - int16_t K, - int16_t len +/*! r: valid or not 1/0 */ +int16_t valid_ratio_index( + int16_t index, /* i : index to be checked */ + const int16_t K, /* i : L1 norm to check against */ + const int16_t len /* i : vector length */ ); void reconstruct_ism_ratios( @@ -4567,16 +4568,17 @@ int16_t ivas_qmetadata_encode_extended_gr_length( const int16_t gr_param); void ivas_qmetadata_encode_extended_gr( - BSTR_ENC_HANDLE hMetaData, /* i/o: q_metadata handle */ - const uint16_t value, /* i : value to be encoded */ - const uint16_t alphabet_size, /* i : alphabet size */ - const int16_t gr_param); /* i : GR order */ - -int32_t /* o: cpe bitrate value */ -calculate_cpe_brate_MASA_ISM( - ISM_MODE ism_mode, /* i: ism mode */ - int32_t ivas_total_brate, /* i: total bit rate for IVAS */ - int16_t n_ism ); /* i: number of objects */ + BSTR_ENC_HANDLE hMetaData, /* i/o: q_metadata handle */ + const uint16_t value, /* i : value to be encoded */ + const uint16_t alphabet_size, /* i : alphabet size */ + const int16_t gr_param); /* i : GR order */ + +/*! r: CPE bitrate value */ +int32_t calculate_cpe_brate_MASA_ISM( + const ISM_MODE ism_mode, /* i : ism mode */ + const int32_t ivas_total_brate, /* i : total bit rate for IVAS */ + const int16_t n_ism /* i : number of objects */ +); #endif void ivas_masa_set_coding_config( @@ -5174,6 +5176,7 @@ void set_ism_importance_interformat( /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( + const ISM_MODE ism_mode, /* i : ISM mode */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ ); diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index db86d97fd9..83c194dbd2 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1654,7 +1654,7 @@ static void decode_index_slice( j = 0; while ( index >= 0 ) { - if ( valid( j, K, no_ism - 1 ) ) + if ( valid_ratio_index( j, K, no_ism - 1 ) ) { index--; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index eacc84ef46..133369e94c 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -59,7 +59,7 @@ void ivas_set_surplus_brate_dec( if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - *ism_total_brate = ivas_interformat_brate( st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + *ism_total_brate = ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; @@ -90,7 +90,7 @@ void ivas_set_surplus_brate_dec( { st_ivas->hSCE[n]->element_brate = element_brate[n]; - *ism_total_brate += ivas_interformat_brate( st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); + *ism_total_brate += ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 78997e6e79..d2a073d2b8 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -901,7 +901,7 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate = 0; for ( ch = 0; ch < num_obj; ch++ ) { - *ism_total_brate += ivas_interformat_brate( hSCE[ch]->element_brate, ism_imp[ch] ); + *ism_total_brate += ivas_interformat_brate( ism_mode, hSCE[ch]->element_brate, ism_imp[ch] ); } ism_metadata_flag_global = 1; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index b7258bff9f..8ef74b4e3a 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -499,7 +499,7 @@ void ivas_set_surplus_brate_enc( { if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); /* note: ISM st->total_brate is iset in ivas_sce_enc() */ } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 7b986c61f8..de1c0466ce 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -220,7 +220,7 @@ ivas_error ivas_sce_enc( { set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); - st->total_brate = ivas_interformat_brate( hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; + st->total_brate = ivas_interformat_brate( st_ivas->ism_mode, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; } #endif -- GitLab From fc2c6e4cba44208ab658396285775e2fb0cbdd6d Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 17:14:54 +0100 Subject: [PATCH 0024/1418] - debug code --- lib_com/options.h | 2 +- lib_enc/ivas_omasa_enc.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 033be97812..faa13745cd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,7 @@ #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more verification/tuning needed #define OMASA_BRATE_FIX_ALT -#define OMASA_BRATE_TD // support of bitrate adaptation n TD stereo - work in progress +#define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo - work in progress #define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 8ef74b4e3a..5ea2b75a3e 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -476,8 +476,11 @@ void ivas_omasa_enc( /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); - } +#ifdef DEBUG_VA + dbgwrite( &selected_object, 2, 1, input_frame, "res/selected_object" ); +#endif + } /* Downmix */ ivas_omasa_dmx( data_in_f, data_out_f, input_frame, nchan_transport, nchan_ism, hIsmMeta, hOMasa->prev_object_dm_gains, hOMasa->interpolator ); -- GitLab From 433c2e2f68aaec05ee753fe6c0836ca4ebcfa9b6 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 19:59:55 +0100 Subject: [PATCH 0025/1418] - updates within OMASA_BRATE_TD - remove the encoder hack within OMASA_BRATE_TD --- lib_dec/ivas_stereo_td_dec.c | 8 ++++++-- lib_enc/ivas_cpe_enc.c | 9 --------- lib_enc/ivas_stereo_td_enc.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 5ed7a4ed4b..2e6e447bd7 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -133,7 +133,7 @@ void tdm_configure_dec( /* Get few parameters needed to decode the bitrate allocated to each channel */ /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ #ifdef OMASA_BRATE_TD - sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - nb_bits_metadata - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); + sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); #else sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING ); #endif @@ -245,7 +245,7 @@ void tdm_configure_dec( if ( hStereoTD->tdm_LRTD_flag == 0 ) { #ifdef OMASA_BRATE_TD - tmpS = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); + tmpS = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); #else tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); #endif @@ -285,7 +285,11 @@ void tdm_configure_dec( #endif /* set the BW of the secondary channel */ +#ifdef OMASA_BRATE_TD + if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel > IVAS_16k4 / FRAMES_PER_SEC ) +#else if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 ) +#endif { /* set BW of the secondary channel in LRTD stereo mode as the BW of the primary channel at higher bitrates */ sts[1]->bwidth = sts[0]->bwidth; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5e87ea5247..536272a94c 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -166,15 +166,6 @@ ivas_error ivas_cpe_enc( if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL ) { - -#ifdef OMASA_BRATE_TD // VE: !!!!! temp hack only - if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) - { - hCPE->stereo_mode_cmdl = IVAS_CPE_DFT; - //hCPE->stereo_mode_cmdl = IVAS_CPE_TD; - } -#endif - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 4858131c34..c42b2fe748 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -419,6 +419,23 @@ void tdm_configure_enc( sts[1]->coder_type = GENERIC; } +#ifdef OMASA_BRATE_TD + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) + { + sts[1]->coder_type = INACTIVE; + hStereoTD->tdm_Pitch_reuse_flag = 0; + hStereoTD->tdm_lp_reuse_flag = 1; + } + + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 14700 ) + { + if ( sts[0]->coder_type == TRANSITION ) + { + sts[0]->coder_type = GENERIC; + } + } +#endif + mod_ct = AUDIO; if ( hCPE->element_brate < IVAS_24k4 ) { @@ -830,4 +847,6 @@ void stereo_tdm_prep_dwnmx( } } } + + return; } -- GitLab From b8248b67c42e26e39528109e3bfb1b982d1ea498 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 20:18:37 +0100 Subject: [PATCH 0026/1418] merge OMASA_BRATE_FIX and OMASA_BRATE_FIX_ALT into OMASA_BRATE --- lib_com/ivas_ism_config.c | 41 ------------------------------------ lib_com/ivas_prot.h | 13 ------------ lib_com/ivas_rom_com.c | 4 ++-- lib_com/options.h | 4 +--- lib_dec/core_switching_dec.c | 2 +- lib_dec/ivas_core_dec.c | 3 +-- lib_dec/ivas_dec.c | 5 ----- lib_dec/ivas_init_dec.c | 2 +- lib_enc/ivas_core_enc.c | 7 +++--- lib_enc/ivas_enc.c | 26 ----------------------- 10 files changed, 9 insertions(+), 98 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 8774bd9105..215c553168 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -743,17 +743,14 @@ int32_t ivas_interformat_brate( return element_brate_out; } -#endif -#ifdef OMASA_BRATE_FIX /*--------------------------------------------------------------- * ivas_combined_format_brate_sanity() * * Sanity check in combined format coding * ---------------------------------------------------------------*/ -#ifdef OMASA_BRATE_FIX_ALT void ivas_combined_format_brate_sanity( const int32_t element_brate, /* i : element bitrate */ const int16_t core, /* i : core */ @@ -789,43 +786,5 @@ void ivas_combined_format_brate_sanity( return; } -#else - -void ivas_combined_format_brate_sanity( - const int32_t element_brate, /* i : element bitrate */ - const int32_t brate_surplus, /* i : surplus bitrate */ - int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ - const int16_t nchan_ism, /* i : number of objects */ - int16_t *diff_nBits /* o : number of differential bits */ -) -{ - /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by - low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget - for core-coding @12.8 kHz is too high => increase the ISM low-rate mode bit-rate */ - - int16_t nBits_CPE; - nBits_CPE = (int16_t) ( element_brate / FRAMES_PER_SEC ); - nBits_CPE -= nb_bits_metadata[0]; - nBits_CPE += (int16_t) ( brate_surplus / FRAMES_PER_SEC ); - nBits_CPE -= ( WB_TBE_0k35 / FRAMES_PER_SEC ); - nBits_CPE -= nb_bits_metadata[1]; - nBits_CPE -= ( IVAS_FORMAT_SIGNALING_NBITS_SBA + 1 ); - nBits_CPE -= 10; - - *diff_nBits = 0; - if ( nchan_ism == 1 && element_brate < ACELP_12k8_HIGH_LIMIT ) - { - int16_t limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; - - *diff_nBits = nBits_CPE - limit_high; - if ( *diff_nBits > 0 ) - { - nb_bits_metadata[0] += *diff_nBits; - } - } - - return; -} -#endif #endif #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d2101fe446..135c3a6321 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5181,24 +5181,12 @@ int32_t ivas_interformat_brate( const int16_t ism_imp /* i : ISM importance flag */ ); -#ifdef OMASA_BRATE_FIX -#ifdef OMASA_BRATE_FIX_ALT void ivas_combined_format_brate_sanity( const int32_t element_brate, /* i : element bitrate */ const int16_t core, /* i : core */ int32_t *core_brate, /* i/o: core bitrate */ int16_t *diff_nBits /* o : number of differential bits */ ); -#else -void ivas_combined_format_brate_sanity( - const int32_t element_brate, /* i : element bitrate */ - const int32_t brate_surplus, /* i : surplus bitrate */ - int16_t nb_bits_metadata[], /* i/o: number of metadata bits */ - const int16_t nchan_ism, /* i : number of objects */ - int16_t *diff_nBits /* o : number of differential bits */ -); -#endif -#endif #endif ISM_MODE ivas_omasa_ism_mode_select( @@ -5218,7 +5206,6 @@ void ivas_masa_ism_data_open( Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); - void preProcessStereoTransportsForMovedObjects( Decoder_Struct* st_ivas, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 90c962158d..b42fb64fc4 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2786,13 +2786,13 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {0, 0, 0, 0}, /* 13k2 */ {0, 0, 0, 0}, /* 16k4 */ {9600, 0, 0, 0}, /* 24k4 */ -#ifdef OMASA_BRATE_FIX +#ifdef OMASA_BRATE {11000, 0, 0, 0}, /* 32k */ #else {9600, 0, 0, 0}, /* 32k */ #endif {IVAS_13k2, 0, 0, 0}, /* 48k */ -#ifdef OMASA_BRATE_FIX +#ifdef OMASA_BRATE {16000, 12000, 0, 0}, /* 64k */ #else {16000, IVAS_13k2, 0, 0}, /* 64k */ diff --git a/lib_com/options.h b/lib_com/options.h index faa13745cd..9ce2430088 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,9 +163,7 @@ #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs #define OMASA_BRATE /* VA: combined format bit-budget distribution */ -#define OMASA_BRATE_FIX // fix at lowest bitrates and 1 inactive ISM - more verification/tuning needed -#define OMASA_BRATE_FIX_ALT -#define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo - work in progress +#define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo #define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 3692d7653f..8818e0b3ff 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -1040,7 +1040,7 @@ void bandwidth_switching_detect( st->bws_cnt1 = 0; } else if ( st->total_brate > ACELP_9k60 && st->last_core_brate < ACELP_9k60 && st->bwidth == SWB && st->last_bwidth == WB -#ifdef OMASA_BRATE // VE: !!!!! this breaks BE in pure ISM +#ifdef OMASA_BRATE // VE: !!!!! this breaks BE in pure ISM unless FIX_299_ISM_BWS is activated && st->last_core_brate != 2450 #endif ) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index a9f3d1cb85..777cc74beb 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -265,8 +265,7 @@ ivas_error ivas_core_dec( } } - -#ifdef OMASA_BRATE_FIX_ALT +#ifdef OMASA_BRATE /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index b12aadc91d..df5cfb4253 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -597,11 +597,6 @@ ivas_error ivas_dec( ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); -#endif -#ifndef OMASA_BRATE_FIX_ALT -#ifdef OMASA_BRATE_FIX - ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &n /* temp */ ); -#endif #endif /* Audio signal decoding */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index dcaf13dbd1..2c2a26b315 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -983,7 +983,7 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifdef OMASA_BRATE // VE: just 'ism_imp' parameter is needed - what about the other parameters? -> TBV +#ifdef OMASA_BRATE if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 78a9f2af1b..c4f4b376c6 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -102,7 +102,7 @@ ivas_error ivas_core_enc( float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; -#ifdef OMASA_BRATE_FIX_ALT +#ifdef OMASA_BRATE int16_t diff_nBits; #endif ivas_error error; @@ -190,8 +190,7 @@ ivas_error ivas_core_enc( } } - -#ifdef OMASA_BRATE_FIX_ALT +#ifdef OMASA_BRATE /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ @@ -429,7 +428,7 @@ ivas_error ivas_core_enc( } } -#ifdef OMASA_BRATE_FIX_ALT +#ifdef OMASA_BRATE /*------------------------------------------------------------------* * Write potentially unused bits in combined format coding *-----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 554a6bb8d6..be021a9493 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -312,11 +312,6 @@ ivas_error ivas_enc( { #ifndef OMASA_BRATE float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; -#endif -#ifndef OMASA_BRATE_FIX_ALT -#ifdef OMASA_BRATE_FIX - int16_t diff_nBits = 0; -#endif #endif float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; @@ -385,11 +380,6 @@ ivas_error ivas_enc( /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_enc( st_ivas ); -#ifndef OMASA_BRATE_FIX_ALT -#ifdef OMASA_BRATE_FIX - ivas_combined_format_brate_sanity( st_ivas->hCPE[0]->element_brate, st_ivas->hCPE[0]->brate_surplus, nb_bits_metadata, st_ivas->nchan_ism, &diff_nBits ); -#endif -#endif #else if ( st_ivas->hQMetaData != NULL ) { @@ -449,22 +439,6 @@ ivas_error ivas_enc( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); // VE2Nokia: this condition is unnecessary } -#ifndef OMASA_BRATE_FIX_ALT -#ifdef OMASA_BRATE_FIX - diff_nBits = max( diff_nBits, 0 ); - //dbgwrite( &diff_nBits, 2, 1, 960, "res/_diff" ); - if ( st_ivas->nchan_ism == 1 && st_ivas->hCPE[0]->element_brate < ACELP_12k8_HIGH_LIMIT && diff_nBits > 0 ) - { - while ( diff_nBits > 0 ) - { - i = min( diff_nBits, 16 ); - push_indice( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, IND_UNUSED, 0, i ); - diff_nBits -= i; - } - } -#endif -#endif - #ifdef DEBUG_VA if ( st_ivas->hSCE[0] != NULL ) { -- GitLab From cb723a90e022e1675c1f977824de7ed691ca658e Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 24 Jan 2023 23:39:10 +0100 Subject: [PATCH 0027/1418] - FIX_24k4_ISM1_MODE - activate DISC mode at 24.4 kbps 1 object --- lib_com/ivas_ism_config.c | 16 +++++++++++++++- lib_com/options.h | 3 ++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 215c553168..dc715e8c69 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -600,14 +600,20 @@ ISM_MODE ivas_omasa_ism_mode_select( switch ( no_obj ) { case 1: +#ifdef FIX_24k4_ISM1_MODE + if ( ivas_total_brate >= IVAS_24k4 ) +#else if ( ivas_total_brate >= IVAS_32k ) +#endif { ism_mode = ISM_MASA_MODE_DISC; } +#ifndef FIX_24k4_ISM1_MODE else if ( ivas_total_brate >= IVAS_24k4 ) { ism_mode = ISM_MASA_MODE_PARAM; } +#endif else { ism_mode = ISM_MODE_NONE; @@ -681,6 +687,7 @@ ISM_MODE ivas_omasa_ism_mode_select( * ---------------------------------------------------------------*/ #define GAMMA_ISM_LOW_IMP 0.8f +#define GAMMA_ISM_LOW_IMP2 0.9f #define GAMMA_ISM_MEDIUM_IMP 1.2f #define GAMMA_ISM_HIGH_IMP 1.4f #define GAMMA_ISM_HIGH_IMP2 1.35f @@ -703,7 +710,14 @@ int32_t ivas_interformat_brate( } else if ( ism_imp == ISM_LOW_IMP ) { - nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP ); + if ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 9600 and 1 object */ + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP2 ); + } + else + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP ); + } } else if ( ism_imp == ISM_MEDIUM_IMP ) { diff --git a/lib_com/options.h b/lib_com/options.h index 9ce2430088..e7ec2bf9ae 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +#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/" */ @@ -161,6 +161,7 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ +#define FIX_24k4_ISM1_MODE // activate DISC mode at 24.4 kbps 1 object #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo -- GitLab From b4e756545a7da5c53c9e3f38afb4b398e459a6ad Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 25 Jan 2023 11:19:49 +1100 Subject: [PATCH 0028/1418] fix for head tracking input in quat format, added conversion from quat to euler in degrees --- lib_com/ivas_prot.h | 9 +++++++ lib_rend/ivas_binauralRenderer.c | 6 ++--- lib_rend/ivas_rotation.c | 39 +++++++++++++++++++++++++++++++ lib_rend/ivas_splitRendererPost.c | 6 ++--- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 62050015c6..11a8a43505 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4597,6 +4597,15 @@ void Quat2Euler( float *roll /* o : roll */ ); +#ifdef SPLIT_REND_WITH_HEAD_ROT +void Quat2EulerDegree( + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ +); +#endif + void SHrotmatgen( float SHrotmat[SBA_NHARM_HOA3][SBA_NHARM_HOA3], /* o : SHD rotation matrix */ float Rmat[3][3], /* i : real-space rotation matrix */ diff --git a/lib_rend/ivas_binauralRenderer.c b/lib_rend/ivas_binauralRenderer.c index ff85e0c73b..7df14b2adf 100644 --- a/lib_rend/ivas_binauralRenderer.c +++ b/lib_rend/ivas_binauralRenderer.c @@ -1223,9 +1223,9 @@ void ivas_binRenderer( if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) { Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; - Quaternions_rel.w = -3.0f; /*euler*/ - Quaternions_abs.w = -3.0f; /*euler*/ - Quat2Euler( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quaternions_rel.w = -3.0f; /*euler*/ + Quaternions_abs.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ // Quaternions_abs.x = Quaternions_ref->x; // Quaternions_abs.y = Quaternions_ref->y; // Quaternions_abs.z = Quaternions_ref->z; diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 1a7cd8b830..dfbe61e08d 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -150,6 +150,45 @@ void QuatToRotMat( return; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*------------------------------------------------------------------------- + * Quat2EulerDegree() + * + * Quaternion handling: calculate corresponding Euler angles in degrees + *------------------------------------------------------------------------*/ +void Quat2EulerDegree( + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ +) +{ + if ( quat.w != -3.0 ) + { + *yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) ); + *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) ); + *roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) ); + *yaw *= _180_OVER_PI; + *pitch *= _180_OVER_PI; + *roll *= _180_OVER_PI; + } + else + { + /* Euler angles in R_X(roll)*R_Y(pitch)*R_Z(yaw) convention + * + * yaw: rotate scene counter-clockwise in the horizontal plane + * pitch: rotate scene in the median plane, increase elevation with positive values + * roll: rotate scene from the right ear to the top + */ + *yaw = quat.z; + *pitch = quat.y; + *roll = quat.x; + } + + return; +} +#endif + /*------------------------------------------------------------------------- * Quat2Euler() * diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 56782f4989..693d81c61e 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -585,9 +585,9 @@ static void get_interpolation_vars( /*interpolation if actual pose is not same as one of assumed poses*/ /*get the deviation*/ - Quat2Euler( *Quaternions_ref, &quaternions_ref_euler.z, &quaternions_ref_euler.y, &quaternions_ref_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ - Quat2Euler( *Quaternions_act, &quaternions_act_euler.z, &quaternions_act_euler.y, &quaternions_act_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ - quaternions_diff.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_ref, &quaternions_ref_euler.z, &quaternions_ref_euler.y, &quaternions_ref_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quat2EulerDegree( *Quaternions_act, &quaternions_act_euler.z, &quaternions_act_euler.y, &quaternions_act_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + quaternions_diff.w = -3.0f; /*euler*/ quaternions_diff.x = quaternions_act_euler.x - quaternions_ref_euler.x; quaternions_diff.y = quaternions_act_euler.y - quaternions_ref_euler.y; quaternions_diff.z = quaternions_act_euler.z - quaternions_ref_euler.z; -- GitLab From ae50cf1e2fb2741053f2b9f3156bfc754033873c Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 25 Jan 2023 10:23:33 +0100 Subject: [PATCH 0029/1418] - tuning for 24.4 kbps 1-Obj - introduce file ivas_omasa_com.c - editorial improvements (formatting, 'const', comments) --- Workspace_msvc/lib_com.vcxproj | 3 +- Workspace_msvc/lib_com.vcxproj.filters | 3 + lib_com/ivas_cnst.h | 11 +- lib_com/ivas_ism_config.c | 134 +------------- lib_com/ivas_omasa_com.c | 182 ++++++++++++++++++++ lib_com/ivas_prot.h | 18 +- lib_com/ivas_rom_com.c | 6 + lib_com/options.h | 2 +- lib_dec/ivas_dirac_dec_binaural_functions.c | 25 ++- lib_dec/ivas_qmetadata_dec.c | 30 ++-- lib_enc/ivas_ism_metadata_enc.c | 68 -------- lib_enc/ivas_omasa_enc.c | 124 +++++++++---- lib_enc/ivas_qmetadata_enc.c | 84 +++++---- 13 files changed, 396 insertions(+), 294 deletions(-) create mode 100644 lib_com/ivas_omasa_com.c diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 994b1ec429..43f7d56fe6 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -254,6 +254,7 @@ + @@ -358,4 +359,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index f9d7920ca2..5b96c4d130 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -463,6 +463,9 @@ common_ivas_c + + common_ivas_c + diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3e36ec27db..ae19110407 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -316,6 +316,11 @@ typedef enum #define ISM_MEDIUM_IMP 2 #define ISM_HIGH_IMP 3 +#ifdef OMASA_BRATE +#define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM no meta / inactive frames */ +#define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC ) +#endif + #define ISM_AZIMUTH_NBITS 7 #define ISM_AZIMUTH_MIN -180.0f #define ISM_AZIMUTH_MAX 180.0f @@ -350,9 +355,9 @@ typedef enum ISM_MODE_PARAM /* parametric ISM */ #ifdef MASA_AND_OBJECTS , - ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ - ISM_MASA_MODE_ONE_OBJ, /* MASA ISM mode when one object is encoded separarately */ - ISM_MASA_MODE_DISC + ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ + ISM_MASA_MODE_ONE_OBJ, /* MASA ISM mode when one object is encoded separarately */ + ISM_MASA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ #endif } ISM_MODE; diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index dc715e8c69..5a44c7de09 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -50,8 +50,10 @@ #define FRMS_PER_SECOND ( 1000000000 / FRAME_SIZE_NS ) +#ifndef OMASA_BRATE #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISm inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRMS_PER_SECOND ) +#endif #define BETA_ISM_LOW_IMP 0.6f #define BETA_ISM_MEDIUM_IMP 0.8f @@ -115,7 +117,6 @@ ivas_error ivas_ism_config( int16_t n_ISms; ivas_error error; - error = IVAS_ERR_OK; #ifdef MASA_AND_OBJECTS if ( combined_format_flag == 1 ) @@ -425,11 +426,13 @@ void ivas_ism_reset_metadata( return; } + /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_API() * * Reset ISm metadata parameters *-------------------------------------------------------------------*/ + void ivas_ism_reset_metadata_API( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ) @@ -440,6 +443,7 @@ void ivas_ism_reset_metadata_API( return; } + /*-------------------------------------------------------------------* * ism_quant_meta() * @@ -582,7 +586,9 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } -#ifdef MASA_AND_OBJECTS + + +#ifdef MASA_AND_OBJECTS // VE2Nokia: move this function to the new file ivas_omasa_com.c (?) /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() * @@ -677,128 +683,4 @@ ISM_MODE ivas_omasa_ism_mode_select( return ism_mode; } - - -#ifdef OMASA_BRATE -/*--------------------------------------------------------------- - * ivas_interformat_brate() - * - * Bit-budget distribution in case of combined-format coding - * ---------------------------------------------------------------*/ - -#define GAMMA_ISM_LOW_IMP 0.8f -#define GAMMA_ISM_LOW_IMP2 0.9f -#define GAMMA_ISM_MEDIUM_IMP 1.2f -#define GAMMA_ISM_HIGH_IMP 1.4f -#define GAMMA_ISM_HIGH_IMP2 1.35f - -/*! r: adjusted bitrate */ -int32_t ivas_interformat_brate( - const ISM_MODE ism_mode, /* i : ISM mode */ - const int32_t element_brate, /* i : element bitrate */ - const int16_t ism_imp /* i : ISM importance flag */ -) -{ - int32_t element_brate_out; - int16_t nBits, limit_low, limit_high; - - nBits = (int16_t) ( element_brate / FRAMES_PER_SEC ); - - if ( ism_imp == ISM_INACTIVE_IMP ) - { - nBits = BITS_ISM_INACTIVE; - } - else if ( ism_imp == ISM_LOW_IMP ) - { - if ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 9600 and 1 object */ - { - nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP2 ); - } - else - { - nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP ); - } - } - else if ( ism_imp == ISM_MEDIUM_IMP ) - { - nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP ); - } - else /* ISM_HIGH_IMP */ - { - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP2 ); - } - else - { - nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP ); - } - } - - limit_low = MIN_BRATE_SWB_BWE / FRAMES_PER_SEC; - if ( ism_imp == ISM_INACTIVE_IMP ) - { - limit_low = BITS_ISM_INACTIVE; - } - else if ( element_brate >= SCE_CORE_16k_LOW_LIMIT ) - { - limit_low = SCE_CORE_16k_LOW_LIMIT / FRAMES_PER_SEC; - } - - limit_high = IVAS_512k / FRAMES_PER_SEC; - if ( element_brate < SCE_CORE_16k_LOW_LIMIT ) - { - limit_high = ACELP_12k8_HIGH_LIMIT / FRMS_PER_SECOND; - } - - nBits = check_bounds_s( nBits, limit_low, limit_high ); - - element_brate_out = nBits * FRAMES_PER_SEC; - - return element_brate_out; -} - - -/*--------------------------------------------------------------- - * ivas_combined_format_brate_sanity() - * - * Sanity check in combined format coding - * ---------------------------------------------------------------*/ - -void ivas_combined_format_brate_sanity( - const int32_t element_brate, /* i : element bitrate */ - const int16_t core, /* i : core */ - int32_t *core_brate, /* i/o: core bitrate */ - int16_t *diff_nBits /* o : number of differential bits */ -) -{ - int16_t limit_high, nBits; - - /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by - low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget - for ACELP core-coding @12.8 kHz is too high */ - - if ( element_brate < ACELP_12k8_HIGH_LIMIT ) - { - limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; - nBits = (int16_t) ( *core_brate / FRAMES_PER_SEC ); - - *diff_nBits = nBits - limit_high; - if ( *diff_nBits > 0 ) - { - if ( core == TCX_20_CORE || core == TCX_10_CORE ) - { - *diff_nBits = 0; - } - else /* ACELP core */ - { - *core_brate -= ( *diff_nBits * FRAMES_PER_SEC ); - } - } - } - - return; -} - -#endif #endif diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c new file mode 100644 index 0000000000..121ea78076 --- /dev/null +++ b/lib_com/ivas_omasa_com.c @@ -0,0 +1,182 @@ +/****************************************************************************************************** + + (C) 2022 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 "options.h" +#include +#include "ivas_cnst.h" +#include "ivas_prot.h" +#include "prot.h" +#ifdef DEBUGGING +#include "debug.h" +#endif + + +#ifdef OMASA_BRATE +/*--------------------------------------------------------------- + * Local constants + * ---------------------------------------------------------------*/ + + +#define GAMMA_ISM_LOW_IMP 0.8f +#define GAMMA_ISM_MEDIUM_IMP 1.2f +#define GAMMA_ISM_HIGH_IMP 1.4f + +#define GAMMA_ISM_LOW_IMP2 0.9f +#define GAMMA_ISM_MEDIUM_IMP2 1.2f +#define GAMMA_ISM_HIGH_IMP2 1.35f + + +/*--------------------------------------------------------------- + * ivas_interformat_brate() + * + * Bit-budget distribution in case of combined-format coding + * ---------------------------------------------------------------*/ + +/*! r: adjusted bitrate */ +int32_t ivas_interformat_brate( + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t element_brate, /* i : element bitrate */ + const int16_t ism_imp /* i : ISM importance flag */ +) +{ + int32_t element_brate_out; + int16_t nBits, limit_low, limit_high; + + nBits = (int16_t) ( element_brate / FRAMES_PER_SEC ); + + + if ( ism_imp == ISM_INACTIVE_IMP ) + { + nBits = BITS_ISM_INACTIVE; + } + else + { + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || + ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 9600 and 1 object */ + ) + { + if ( ism_imp == ISM_LOW_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP2 ); + } + else if ( ism_imp == ISM_MEDIUM_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP2 ); + } + else /* ISM_HIGH_IMP */ + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP2 ); + } + } + else + { + if ( ism_imp == ISM_LOW_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP ); + } + else if ( ism_imp == ISM_MEDIUM_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP ); + } + else /* ISM_HIGH_IMP */ + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP ); + } + } + } + + limit_low = MIN_BRATE_SWB_BWE / FRAMES_PER_SEC; + if ( ism_imp == ISM_INACTIVE_IMP ) + { + limit_low = BITS_ISM_INACTIVE; + } + else if ( element_brate >= SCE_CORE_16k_LOW_LIMIT ) + { + limit_low = SCE_CORE_16k_LOW_LIMIT / FRAMES_PER_SEC; + } + + limit_high = IVAS_512k / FRAMES_PER_SEC; + if ( element_brate < SCE_CORE_16k_LOW_LIMIT ) + { + limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; + } + + nBits = check_bounds_s( nBits, limit_low, limit_high ); + + element_brate_out = nBits * FRAMES_PER_SEC; + + return element_brate_out; +} + + +/*--------------------------------------------------------------- + * ivas_combined_format_brate_sanity() + * + * Sanity check in combined format coding + * ---------------------------------------------------------------*/ + +void ivas_combined_format_brate_sanity( + const int32_t element_brate, /* i : element bitrate */ + const int16_t core, /* i : core */ + int32_t *core_brate, /* i/o: core bitrate */ + int16_t *diff_nBits /* o : number of differential bits */ +) +{ + int16_t limit_high, nBits; + + /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by + low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget + for ACELP core-coding @12.8 kHz is too high */ + + if ( element_brate < ACELP_12k8_HIGH_LIMIT ) + { + limit_high = ACELP_12k8_HIGH_LIMIT / FRAMES_PER_SEC; + nBits = (int16_t) ( *core_brate / FRAMES_PER_SEC ); + + *diff_nBits = nBits - limit_high; + if ( *diff_nBits > 0 ) + { + if ( core == TCX_20_CORE || core == TCX_10_CORE ) + { + *diff_nBits = 0; + } + else /* ACELP core */ + { + *core_brate -= ( *diff_nBits * FRAMES_PER_SEC ); + } + } + } + + return; +} + +#endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 135c3a6321..7b7edd2f34 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5210,9 +5210,9 @@ void preProcessStereoTransportsForMovedObjects( Decoder_Struct* st_ivas, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - uint8_t nBins, - uint8_t firstSubframe, - uint8_t nSubframes + const uint8_t nBins, + const uint8_t firstSubframe, + const uint8_t nSubframes ); ivas_error ivas_masa_ism_separate_object_renderer_open( @@ -5227,23 +5227,23 @@ void ivas_masa_ism_separate_object_render( ); void ivas_masa_ism_set_edited_objects( - Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); void encode_masa_to_total( IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, - int16_t low_bitrate_mode, - int16_t nbands, - int16_t nblocks + const int16_t low_bitrate_mode, + const int16_t nbands, + const int16_t nblocks ); void decode_masa_to_total( uint16_t* bit_stream, int16_t* index, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], - int16_t nbands, - int16_t nblocks + const int16_t nbands, + const int16_t nblocks ); void modify_masa_energy_ratios( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index b42fb64fc4..641a5f5c84 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2780,6 +2780,10 @@ const float McMASA_LFEGain_vectors[64] = }; #ifdef MASA_AND_OBJECTS +/*----------------------------------------------------------------------------------* + * OMASA ROM tables + *----------------------------------------------------------------------------------*/ + // VE2Nokia: add "const" to the arrays int32_t sep_object_brate[][MAX_NUM_OBJECTS] = { @@ -2806,6 +2810,7 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ }; + /* column wise DCT matrices for 4 5, and 8 dim */ float dct4[] = { 0.5000f, 0.6533f, 0.5000f, 0.2706f, @@ -2821,6 +2826,7 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = 0.4472f, -0.3717f, -0.1954f, 0.6015f, -0.5117f, 0.4472f, -0.6015f, 0.5117f, -0.3717f, 0.1954f }; + float dct8[] = { 0.3536f, 0.4904f, 0.4619f, 0.4157f, 0.3536f, 0.2778f, 0.1913f, 0.0975f, 0.3536f, 0.4157f, 0.1913f, -0.0975f, -0.3536f, -0.4904f, -0.4619f, -0.2778f, 0.3536f, 0.2778f, -0.1913f, -0.4904f, diff --git a/lib_com/options.h b/lib_com/options.h index e7ec2bf9ae..d73306ae58 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -#define DEBUG_MODE_INFO /* output most important parameters to the subdirectory "res/" */ +/*#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/" */ diff --git a/lib_dec/ivas_dirac_dec_binaural_functions.c b/lib_dec/ivas_dirac_dec_binaural_functions.c index 7f4511c9c3..af97a8ba78 100644 --- a/lib_dec/ivas_dirac_dec_binaural_functions.c +++ b/lib_dec/ivas_dirac_dec_binaural_functions.c @@ -973,7 +973,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric #ifdef MASA_AND_OBJECTS float spectrumModVal; /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ - spectrumModVal = (1.0f - surCoh) + surCoh * surCohEne[min(bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1)]; + spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 )]; diffEne *= spectrumModVal; #else idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); @@ -1952,10 +1952,7 @@ static void hrtfShGetHrtf( int16_t k; float shVec[HRTF_SH_CHANNELS]; - ivas_dirac_dec_get_response( aziDeg, - eleDeg, - shVec, - HRTF_SH_ORDER ); + ivas_dirac_dec_get_response( aziDeg, eleDeg, shVec, HRTF_SH_ORDER ); *lRealp = 0.0f; *lImagp = 0.0f; @@ -1972,14 +1969,21 @@ static void hrtfShGetHrtf( return; } + #ifdef MASA_AND_OBJECTS +/*-------------------------------------------------------------------* + * preProcessStereoTransportsForMovedObjects() + * + * + *-------------------------------------------------------------------*/ + void preProcessStereoTransportsForMovedObjects( Decoder_Struct *st_ivas, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - uint8_t nBins, - uint8_t firstSubframe, - uint8_t nSubframes ) + const uint8_t nBins, + const uint8_t firstSubframe, + const uint8_t nSubframes ) { int16_t subframe, bin, ch, inCh, outCh, ismDirIndex, slot; DIRAC_DEC_HANDLE hDirAC; @@ -2070,6 +2074,7 @@ void preProcessStereoTransportsForMovedObjects( ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex], hMasaIsmData->elevation_ism[ismDirIndex], panGainsIn ); + if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) { ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism_edited[ismDirIndex], @@ -2116,6 +2121,7 @@ void preProcessStereoTransportsForMovedObjects( normEnes[ch] -= panEnesIn[ch] * ratio; } } + /* Any remaining (non-object) energy is set to be preserved at both channels */ remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); for ( ch = 0; ch < 2; ch++ ) @@ -2136,7 +2142,6 @@ void preProcessStereoTransportsForMovedObjects( ismPreprocMtxNew[1 - ch][ch] = sqrtf( hMasaIsmData->eneMoveIIR[ch][bin] / normVal ); } - /* Get increment value for temporal interpolation */ for ( inCh = 0; inCh < 2; inCh++ ) { @@ -2185,5 +2190,7 @@ void preProcessStereoTransportsForMovedObjects( } } } + + return; } #endif diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 1c8c7b88da..fc12917b8f 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -94,7 +94,7 @@ static int16_t read_GR_min_removed_data( uint16_t *bitstream, int16_t *p_bit_pos static int16_t decode_fixed_rate_composed_index_coherence( uint16_t *bitstream, int16_t *p_bit_pos, const int16_t no_bands, int16_t *no_cv_vec, uint16_t *decoded_index, const int16_t no_symb ); #ifdef MASA_AND_OBJECTS -static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, int16_t len_stream, uint16_t *bit_stream, int16_t *index, int16_t first_line ); +static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, const int16_t len_stream, uint16_t *bit_stream, int16_t *index, const int16_t first_line ); #endif /*-----------------------------------------------------------------------* @@ -3302,14 +3302,15 @@ static void decode_combined_index( return; } + #ifdef MASA_AND_OBJECTS static void read_stream_dct_coeffs_omasa( int16_t *q_idx, float *q_dct_data, - int16_t len_stream, + const int16_t len_stream, uint16_t *bit_stream, int16_t *index, - int16_t first_line ) + const int16_t first_line ) { int16_t sign, nbits; int16_t i, j, i_min; @@ -3382,6 +3383,7 @@ static void read_stream_dct_coeffs_omasa( } } } + /* deindex */ q_dct_data[0] = q_idx[0] * step; for ( i = 1; i < len_stream; i++ ) @@ -3395,25 +3397,29 @@ static void read_stream_dct_coeffs_omasa( q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; } } + return; } + +/*------------------------------------------------------------------------- + * decode_masa_to_total() + * + *------------------------------------------------------------------------*/ + void decode_masa_to_total( uint16_t *bit_stream, int16_t *index, float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], - int16_t nbands, - int16_t nblocks ) + const int16_t nbands, + const int16_t nblocks ) { int16_t i, j, k; - int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS], dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - - int16_t n_streams, len_stream; + /* Setup coding parameters */ n_streams = 1; len_stream = nbands * nblocks; @@ -3423,14 +3429,12 @@ void decode_masa_to_total( len_stream = 8; } - set_s( q_idx, 0, nbands * nblocks ); for ( i = 0; i < n_streams; i++ ) { read_stream_dct_coeffs_omasa( &q_idx[i * len_stream], &q_dct_data[i * len_stream], len_stream, bit_stream, index, i == 0 ); } - /* inverse DCT2 transform */ switch ( len_stream ) { @@ -3468,6 +3472,7 @@ void decode_masa_to_total( k++; } } + if ( nblocks == 1 ) { for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) @@ -3478,6 +3483,7 @@ void decode_masa_to_total( } } } + if ( nbands == 1 ) { for ( j = 1; j < 5; j++ ) @@ -3488,5 +3494,7 @@ void decode_masa_to_total( } } } + + return; } #endif diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index d2a073d2b8..bd9183f92f 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -139,74 +139,6 @@ static void rate_ism_importance( } -#ifdef OMASA_BRATE -/*-------------------------------------------------------------------------* - * set_ism_importance_interformat() - * - * Set the importance of particular ISM streams in combined-format coding - *-------------------------------------------------------------------------*/ - -void set_ism_importance_interformat( - const int32_t ism_total_brate, /* i/o: ISms total bitrate */ - const int16_t nchan_transport, /* i : number of transported channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ - const float lp_noise_CPE, /* i : LP filtered total noise estimation */ - int16_t ism_imp[] /* o : ISM importance flags */ -) -{ - Encoder_State *st; - int16_t ch, ctype, active_flag; - - for ( ch = 0; ch < nchan_transport; ch++ ) - { - st = hSCE[ch]->hCoreCoder[0]; - - active_flag = st->vad_flag; - - if ( active_flag == 0 ) - { - if ( st->lp_noise > 15 || lp_noise_CPE - st->lp_noise < 30 ) - { - active_flag = 1; - } - } - - /* do not use the low-rate core-coder mode at highest bit-rates */ - if ( ism_total_brate / nchan_transport > IVAS_48k ) - { - active_flag = 1; - } - - ctype = hSCE[ch]->hCoreCoder[0]->coder_type_raw; - - st->low_rate_mode = 0; - if ( active_flag == 0 ) - { - ism_imp[ch] = ISM_INACTIVE_IMP; - st->low_rate_mode = 1; - } - else if ( ctype == INACTIVE || ctype == UNVOICED ) - { - ism_imp[ch] = ISM_LOW_IMP; - } - else if ( ctype == VOICED ) - { - ism_imp[ch] = ISM_MEDIUM_IMP; - } - else /* GENERIC */ - { - ism_imp[ch] = ISM_HIGH_IMP; - } - - hIsmMeta[ch]->ism_metadata_flag = active_flag; /* flag is needed for the MD coding */ - } - - return; -} -#endif - - /*-------------------------------------------------------------------------* * ivas_ism_metadata_enc() * diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 5ea2b75a3e..0f50eecd54 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -30,15 +30,12 @@ *******************************************************************************************************/ +#include "options.h" +#include #include #include -#include -#include -#include "string.h" - #include "ivas_cnst.h" #include "ivas_prot.h" -#include "options.h" #include "prot.h" #include "ivas_rom_com.h" #include "ivas_rom_enc.h" @@ -57,7 +54,7 @@ static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HAND static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); -static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t num_transport_channels, const int16_t num_input_channels, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); +static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); @@ -67,7 +64,7 @@ static void computeReferencePower_omasa( const int16_t *band_grouping, float Cld /*--------------------------------------------------------------------------* * ivas_omasa_enc_open() * - * + * Allocate and initialize OMASA handle *--------------------------------------------------------------------------*/ ivas_error ivas_omasa_enc_open( @@ -173,7 +170,7 @@ ivas_error ivas_omasa_enc_open( /*--------------------------------------------------------------------------* * ivas_omasa_enc_close() * - O + * Close OMASA handle *--------------------------------------------------------------------------*/ void ivas_omasa_enc_close( @@ -183,7 +180,6 @@ void ivas_omasa_enc_close( { int16_t i, j; - for ( i = 0; i < nchan_ism; i++ ) { free( hOMasa->delay_buffer[i] ); @@ -278,7 +274,7 @@ void ivas_omasa_set_config( /*--------------------------------------------------------------------------* * ivas_omasa_enc() * - * + * Main OMASA encoding function *--------------------------------------------------------------------------*/ void ivas_omasa_enc( @@ -490,6 +486,73 @@ void ivas_omasa_enc( #ifdef OMASA_BRATE + +/*-------------------------------------------------------------------------* + * set_ism_importance_interformat() + * + * Set the importance of particular ISM streams in combined-format coding + *-------------------------------------------------------------------------*/ + +void set_ism_importance_interformat( + const int32_t ism_total_brate, /* i/o: ISms total bitrate */ + const int16_t nchan_transport, /* i : number of transported channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_ENC_HANDLE hSCE[], /* i/o: SCE encoder handles */ + const float lp_noise_CPE, /* i : LP filtered total noise estimation */ + int16_t ism_imp[] /* o : ISM importance flags */ +) +{ + Encoder_State *st; + int16_t ch, ctype, active_flag; + + for ( ch = 0; ch < nchan_transport; ch++ ) + { + st = hSCE[ch]->hCoreCoder[0]; + + active_flag = st->vad_flag; + + if ( active_flag == 0 ) + { + if ( st->lp_noise > 15 || lp_noise_CPE - st->lp_noise < 30 ) + { + active_flag = 1; + } + } + + /* do not use the low-rate core-coder mode at highest bit-rates */ + if ( ism_total_brate / nchan_transport > IVAS_48k ) + { + active_flag = 1; + } + + ctype = hSCE[ch]->hCoreCoder[0]->coder_type_raw; + + st->low_rate_mode = 0; + if ( active_flag == 0 ) + { + ism_imp[ch] = ISM_INACTIVE_IMP; + st->low_rate_mode = 1; + } + else if ( ctype == INACTIVE || ctype == UNVOICED ) + { + ism_imp[ch] = ISM_LOW_IMP; + } + else if ( ctype == VOICED ) + { + ism_imp[ch] = ISM_MEDIUM_IMP; + } + else /* GENERIC */ + { + ism_imp[ch] = ISM_HIGH_IMP; + } + + hIsmMeta[ch]->ism_metadata_flag = active_flag; /* flag is needed for the MD coding */ + } + + return; +} + + /*--------------------------------------------------------------------------* * ivas_set_surplus_brate_enc() * @@ -535,7 +598,7 @@ static void ivas_omasa_param_est_enc( float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], const int16_t input_frame, - const int16_t nchan_inp ) + const int16_t nchan_ism ) { float reference_power[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; int16_t ts, i, j, d, k; @@ -565,13 +628,13 @@ static void ivas_omasa_param_est_enc( set_zero( diffuseness_m, hOMasa->nbands ); /* Copy current frame to memory for delay compensation */ - for ( i = 0; i < nchan_inp; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); } /* Compute ISM to FOA matrices */ - for ( i = 0; i < nchan_inp; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { hOMasa->chnlToFoaMtx[0][i] = 1.0f; hOMasa->chnlToFoaMtx[1][i] = sinf( ( hIsmMeta[i]->azimuth / 180.0f * EVS_PI ) ) * cosf( ( hIsmMeta[i]->elevation / 180.0f * EVS_PI ) ); @@ -596,7 +659,7 @@ static void ivas_omasa_param_est_enc( for ( ts = mrange[0]; ts < mrange[1]; ts++ ) { - for ( i = 0; i < nchan_inp; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { if ( ts < hOMasa->num_slots_delay_comp ) { @@ -615,7 +678,7 @@ static void ivas_omasa_param_est_enc( brange[1] = hOMasa->band_grouping[i + 1]; for ( j = brange[0]; j < brange[1]; j++ ) { - for ( k = 0; k < nchan_inp; k++ ) + for ( k = 0; k < nchan_ism; k++ ) { hMasa->data.energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; } @@ -626,7 +689,7 @@ static void ivas_omasa_param_est_enc( /* W */ mvr2r( Chnl_RealBuffer[0], Foa_RealBuffer[0], num_freq_bins ); mvr2r( Chnl_ImagBuffer[0], Foa_ImagBuffer[0], num_freq_bins ); - for ( i = 1; i < nchan_inp; i++ ) + for ( i = 1; i < nchan_ism; i++ ) { v_add( Chnl_RealBuffer[i], Foa_RealBuffer[0], Foa_RealBuffer[0], num_freq_bins ); v_add( Chnl_ImagBuffer[i], Foa_ImagBuffer[0], Foa_ImagBuffer[0], num_freq_bins ); @@ -635,7 +698,7 @@ static void ivas_omasa_param_est_enc( /* Y */ v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[1][0], Foa_RealBuffer[1], num_freq_bins ); v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[1][0], Foa_ImagBuffer[1], num_freq_bins ); - for ( i = 1; i < nchan_inp; i++ ) + for ( i = 1; i < nchan_ism; i++ ) { v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[1][i], Foa_RealBuffer[1], num_freq_bins ); v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[1][i], Foa_ImagBuffer[1], num_freq_bins ); @@ -644,7 +707,7 @@ static void ivas_omasa_param_est_enc( /* Z */ v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[2][0], Foa_RealBuffer[2], num_freq_bins ); v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[2][0], Foa_ImagBuffer[2], num_freq_bins ); - for ( i = 1; i < nchan_inp; i++ ) + for ( i = 1; i < nchan_ism; i++ ) { v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[2][i], Foa_RealBuffer[2], num_freq_bins ); v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[2][i], Foa_ImagBuffer[2], num_freq_bins ); @@ -653,7 +716,7 @@ static void ivas_omasa_param_est_enc( /* X */ v_multc( Chnl_RealBuffer[0], hOMasa->chnlToFoaMtx[3][0], Foa_RealBuffer[3], num_freq_bins ); v_multc( Chnl_ImagBuffer[0], hOMasa->chnlToFoaMtx[3][0], Foa_ImagBuffer[3], num_freq_bins ); - for ( i = 1; i < nchan_inp; i++ ) + for ( i = 1; i < nchan_ism; i++ ) { v_multc_acc( Chnl_RealBuffer[i], hOMasa->chnlToFoaMtx[3][i], Foa_RealBuffer[3], num_freq_bins ); v_multc_acc( Chnl_ImagBuffer[i], hOMasa->chnlToFoaMtx[3][i], Foa_ImagBuffer[3], num_freq_bins ); @@ -724,7 +787,7 @@ static void ivas_omasa_param_est_enc( } /* Update memory */ - for ( i = 0; i < nchan_inp; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); } @@ -843,8 +906,8 @@ static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, - const int16_t num_transport_channels, - const int16_t num_input_channels, + const int16_t nchan_transport, + const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ) @@ -854,14 +917,14 @@ static void ivas_omasa_dmx( float gains[MASA_MAX_TRANSPORT_CHANNELS]; float g1, g2; - if ( num_transport_channels == 2 ) + if ( nchan_transport == 2 ) { - for ( i = 0; i < num_transport_channels; i++ ) + for ( i = 0; i < nchan_transport; i++ ) { set_zero( data_out_f[i], input_frame ); } - for ( i = 0; i < num_input_channels; i++ ) + for ( i = 0; i < nchan_ism; i++ ) { azimuth = hIsmMeta[i]->azimuth; elevation = hIsmMeta[i]->elevation; @@ -869,9 +932,9 @@ static void ivas_omasa_dmx( ivas_get_stereo_panning_gains( azimuth, elevation, gains ); /* Downmix using the panning gains */ - for ( j = 0; j < num_transport_channels; j++ ) + for ( j = 0; j < nchan_transport; j++ ) { - if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0 ) + if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f ) { for ( k = 0; k < input_frame; k++ ) { @@ -884,17 +947,19 @@ static void ivas_omasa_dmx( } } } - else if ( num_transport_channels == 1 ) + else if ( nchan_transport == 1 ) // VE2Nokia: is ti relevant? { for ( i = 0; i < input_frame; i++ ) { data_out_f[0][i] = 0.0f; - for ( j = 0; j < num_input_channels; j++ ) + for ( j = 0; j < nchan_ism; j++ ) { data_out_f[0][i] += data_in_f[j][i]; } } } + + return; } @@ -935,6 +1000,7 @@ static void computeIntensityVector_enc( return; } + static void computeReferencePower_omasa( const int16_t *band_grouping, /* i : Band grouping for estimation */ float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index d140dc79e6..5fb5427ebe 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -125,11 +125,14 @@ static void transform_azimuth_dir2( IVAS_QMETADATA_HANDLE hQMetaData, int16_t *d static int16_t calc_var_azi( const IVAS_QDIRECTION *q_direction, const int16_t diffuseness_index_max_ec_frame, const float avg_azimuth, float *avg_azimuth_out ); #ifdef MASA_AND_OBJECTS -static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, int16_t len_stream, BSTR_ENC_HANDLE hMetaData, int16_t first_line, int16_t low_bitrate_mode ); -static int16_t find_optimal_GR_order( int16_t *q_idx, int16_t len, int16_t *GR ); -static int16_t find_optimal_GR_orders( int16_t *q_idx, int16_t len, int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ); +static int16_t write_stream_dct_coeffs_omasa( int16_t *q_idx, const int16_t len_stream, BSTR_ENC_HANDLE hMetaData, const int16_t first_line, const int16_t low_bitrate_mode ); + +static int16_t find_optimal_GR_order( const int16_t *q_idx, const int16_t len, int16_t *GR ); + +static int16_t find_optimal_GR_orders( const int16_t *q_idx, const int16_t len, const int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ); #endif + /*-----------------------------------------------------------------------* * ivas_qmetadata_enc_encode() * @@ -2769,7 +2772,7 @@ static int16_t truncGR0( *-------------------------------------------------------------------*/ static int16_t truncGR0_chan( - float *data, + const float *data, float *data_hat, uint16_t *data_idx, const int16_t len, @@ -4918,14 +4921,15 @@ static float direction_distance( return d / (float) ( dim1 * dim2 ); } #endif + #ifdef MASA_AND_OBJECTS static int16_t divide_GR_orders( - int16_t *q_idx, - int16_t GR1, - int16_t GR2, - int16_t len, - int16_t len_max_GR1, + const int16_t *q_idx, + const int16_t GR1, + const int16_t GR2, + const int16_t len, + const int16_t len_max_GR1, int16_t *i_min ) { int16_t nb_GR_min; @@ -4951,12 +4955,14 @@ static int16_t divide_GR_orders( *i_min = i + 1; } } + return nb_GR_min; } -static int16_t -find_optimal_GR_order( - int16_t *q_idx, - int16_t len, + + +static int16_t find_optimal_GR_order( + const int16_t *q_idx, + const int16_t len, int16_t *GR ) { int16_t nb_GR_0, nb_GR_1; @@ -4978,16 +4984,16 @@ find_optimal_GR_order( else { *GR = 1; + return nb_GR_1; } } -static int16_t -find_optimal_GR_orders( - int16_t *q_idx, - int16_t len, - int16_t len_max_GR1, +static int16_t find_optimal_GR_orders( + const int16_t *q_idx, + const int16_t len, + const int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ) @@ -5023,15 +5029,17 @@ find_optimal_GR_orders( *i_min = i_min_10; } } + return nb_GR_min; } + static int16_t write_stream_dct_coeffs_omasa( - int16_t *q_idx, /* i: array of indexes to be written */ - int16_t len_stream, /* i: array length */ - BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream */ - int16_t first_line, /* i: is first line of the matrix? 1/0*/ - int16_t low_bitrate_mode /* i: is low bitrate mode? if yes, limit the number of bits written */ + int16_t *q_idx, /* i: array of indexes to be written */ + const int16_t len_stream, /* i: array length */ + BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream */ + const int16_t first_line, /* i: is first line of the matrix? 1/0*/ + const int16_t low_bitrate_mode /* i: is low bitrate mode? if yes, limit the number of bits written */ ) { int16_t nb_bits = 0, bits_pos; @@ -5144,6 +5152,7 @@ static int16_t write_stream_dct_coeffs_omasa( /* find optimum length of the part encoded with GR2 */ nb_GR_min = find_optimal_GR_orders( &q_idx[1], len_stream - 1, 15, &GR1, &GR2, &i_min ); } + if ( len_stream >= 8 ) { /* write number of indexes encoded with GR2 on 4 bits */ @@ -5157,11 +5166,13 @@ static int16_t write_stream_dct_coeffs_omasa( push_next_indice( hMetaData, GR2, 1 ); nb_bits += 1; } + /* write GR data */ for ( i = 1; i <= i_min; i++ ) { ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, GR1 ); } + for ( i = i_min + 1; i < len_stream; i++ ) { ivas_qmetadata_encode_extended_gr( hMetaData, q_idx[i], 100, GR2 ); @@ -5183,32 +5194,33 @@ static int16_t write_stream_dct_coeffs_omasa( assert( nb_bits == ( hMetaData->nb_bits_tot - bits_pos ) ); } + return nb_bits; } + +/*------------------------------------------------------------------------- + * encode_masa_to_total() + * + *------------------------------------------------------------------------*/ + void encode_masa_to_total( IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, - int16_t low_bitrate_mode, - int16_t nbands, - int16_t nblocks ) + const int16_t low_bitrate_mode, + const int16_t nbands, + const int16_t nblocks ) { int16_t i, j, k; float data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float q_dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - - float step = STEP_M2T; - int16_t q_idx[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float dct_data_tmp[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; float dct_data[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_FREQUENCY_BANDS]; - - int16_t bits_pos, nb_bits; int16_t n_streams, len_stream; - #ifdef DEBUG_MODE_QMETADATA static FILE *pF = NULL; static FILE *pF_ratio = NULL; @@ -5220,7 +5232,6 @@ void encode_masa_to_total( #endif - bits_pos = hMetaData->nb_bits_tot; k = 0; for ( i = 0; i < nbands; i++ ) @@ -5269,7 +5280,6 @@ void encode_masa_to_total( break; } - for ( k = 0; k < n_streams; k++ ) { j = k * len_stream; @@ -5280,7 +5290,9 @@ void encode_masa_to_total( { q_idx[j] = ( ( 1 << BITS_MASA2TOTTAL_DCT0 ) - 1 ); } + q_dct_data[j] = step * q_idx[j]; + if ( q_idx[j] == 0 ) { set_s( &q_idx[j], 0, len_stream ); @@ -5304,7 +5316,6 @@ void encode_masa_to_total( } } - /* write data */ nb_bits = 0; for ( i = 0; i < n_streams; i++ ) @@ -5312,7 +5323,6 @@ void encode_masa_to_total( nb_bits += write_stream_dct_coeffs_omasa( &q_idx[i * len_stream], len_stream, hMetaData, ( i == 0 ), low_bitrate_mode ); } - /* reconstruct masa2total */ q_dct_data[0] = q_idx[0] * step; for ( i = 1; i < len_stream; i++ ) @@ -5326,6 +5336,7 @@ void encode_masa_to_total( q_dct_data[i] = ( ( q_idx[i] + 1 ) >> 1 ) * step; } } + /* inverse DCT2 transform */ switch ( len_stream ) { @@ -5353,7 +5364,6 @@ void encode_masa_to_total( break; } - k = 0; for ( i = 0; i < nblocks; i++ ) { -- GitLab From 7fa3c751e4358bee8405d1024451007c49812489 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 10:45:26 +0100 Subject: [PATCH 0030/1418] move DEBUG_VA to ivas_set_surplus_brate_enc() --- lib_com/ivas_prot.h | 4 ++++ lib_enc/ivas_enc.c | 29 ++++------------------------- lib_enc/ivas_omasa_enc.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 7b7edd2f34..beb170708e 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5158,6 +5158,10 @@ void ivas_omasa_enc( #ifdef OMASA_BRATE void ivas_set_surplus_brate_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +#ifdef DEBUG_VA + , + const int16_t *nb_bits_metadata /* i : number of metadata bits */ +#endif ); void ivas_set_surplus_brate_dec( diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index be021a9493..d5ed2963c3 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -378,8 +378,11 @@ ivas_error ivas_enc( st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); /* Configuration of combined-format bit-budget distribution */ +#ifdef DEBUG_VA + ivas_set_surplus_brate_enc( st_ivas, nb_bits_metadata ); +#else ivas_set_surplus_brate_enc( st_ivas ); - +#endif #else if ( st_ivas->hQMetaData != NULL ) { @@ -438,30 +441,6 @@ ivas_error ivas_enc( { ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); // VE2Nokia: this condition is unnecessary } - -#ifdef DEBUG_VA - if ( st_ivas->hSCE[0] != NULL ) - { - float tmpF = 0; - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); - } - else - { - for ( i = 0; i < st_ivas->nchan_ism; i++ ) - { - tmpF += st_ivas->hSCE[i]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[i + 1] * 50 ); - } - } - tmpF /= 1000.f; - dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_ISM" ); - tmpF = ivas_total_brate / 1000.0f - tmpF; - dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MASA" ); - tmpF = nb_bits_metadata[0] * 50 / 1000.0f; - dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MD" ); - } -#endif } #endif else if ( ivas_format == MC_FORMAT ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 0f50eecd54..16758a4d77 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -561,6 +561,10 @@ void set_ism_importance_interformat( void ivas_set_surplus_brate_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +#ifdef DEBUG_VA + , + const int16_t *nb_bits_metadata /* i : number of metadata bits */ +#endif ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) @@ -577,6 +581,31 @@ void ivas_set_surplus_brate_enc( st_ivas->hCPE[0]->brate_surplus = 0; } +#ifdef DEBUG_VA + if ( st_ivas->hSCE[0] != NULL ) + { + int16_t input_frame = (int16_t) ( st_ivas->hEncoderConfig->input_Fs / FRAMES_PER_SEC ); + float tmpF = 0; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); + } + else + { + for ( int16_t i = 0; i < st_ivas->nchan_ism; i++ ) + { + tmpF += st_ivas->hSCE[i]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[i + 1] * 50 ); + } + } + tmpF /= 1000.f; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_ISM" ); /* == ism_total_brate incl. ISM MD */ + tmpF = st_ivas->hEncoderConfig->ivas_total_brate / 1000.0f - tmpF; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MASA" ); /* == masa_total_brate incl. MASA MD */ + tmpF = nb_bits_metadata[0] * FRAMES_PER_SEC / 1000.0f; + dbgwrite( &tmpF, 4, 1, input_frame, "res/brate_MASA_MD" ); /* == MASA MD bitrate */ + } +#endif + return; } #endif -- GitLab From 49117d2e5355274ca61962fbdd0d89fabca81b57 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 11:16:24 +0100 Subject: [PATCH 0031/1418] address "VE2Nokia" comments, part 1 --- lib_com/ivas_masa_com.c | 10 +- lib_com/ivas_prot.h | 33 +++-- lib_dec/ivas_dec.c | 287 ++++++++++++++++++++------------------- lib_dec/ivas_init_dec.c | 12 +- lib_dec/ivas_masa_dec.c | 27 ++-- lib_enc/ivas_enc.c | 22 +-- lib_enc/ivas_init_enc.c | 16 +-- lib_enc/ivas_masa_enc.c | 34 +++-- lib_enc/ivas_omasa_enc.c | 29 ++-- 9 files changed, 239 insertions(+), 231 deletions(-) diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 9211ec057d..867f9512e8 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -68,9 +68,9 @@ void ivas_masa_set_elements( int16_t *nCPE /* o : number of CPEs */ #ifdef MASA_AND_OBJECTS , - int16_t ivas_format, - const ISM_MODE ism_mode, - int32_t sce_brate + const int16_t ivas_format, /* i : IVAS format */ + const ISM_MODE ism_mode, /* i : ISM mode */ + const int32_t ism_total_brate /* i : initial ISM total bitrate */ #endif ) { @@ -97,7 +97,7 @@ void ivas_masa_set_elements( if ( ivas_total_brate > MIN_BRATE_MDCT_STEREO ) { *element_mode = IVAS_CPE_MDCT; - if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_ONE_OBJ ) && ( ivas_total_brate - sce_brate < MIN_BRATE_MDCT_STEREO ) ) + if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_ONE_OBJ ) && ( ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) ) { *element_mode = IVAS_CPE_DFT; } @@ -118,7 +118,7 @@ void ivas_masa_set_elements( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) { - hQMetaData->bits_frame_nominal -= (int16_t) ( sce_brate / FRAMES_PER_SEC ); + hQMetaData->bits_frame_nominal -= (int16_t) ( ism_total_brate / FRAMES_PER_SEC ); } #endif } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index beb170708e..b861e3aa1d 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4528,18 +4528,18 @@ void ivas_masa_set_elements( int16_t *nCPE /* o : number of CPEs */ #ifdef MASA_AND_OBJECTS , - int16_t ivas_format, /* i : IVAS format */ + const int16_t ivas_format, /* i : IVAS format */ const ISM_MODE ism_mode, /* i : ISM mode */ - int32_t sce_brate /* i : bitrate of SCE */ + const int32_t ism_total_brate /* i : initial ISM total bitrate */ #endif ); #ifdef MASA_AND_OBJECTS /*! r: valid or not 1/0 */ int16_t valid_ratio_index( - int16_t index, /* i : index to be checked */ - const int16_t K, /* i : L1 norm to check against */ - const int16_t len /* i : vector length */ + int16_t index, /* i : index to be checked */ + const int16_t K, /* i : L1 norm to check against */ + const int16_t len /* i : vector length */ ); void reconstruct_ism_ratios( @@ -5141,18 +5141,17 @@ void ivas_omasa_set_config( ); void ivas_omasa_enc( - OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ - IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ - MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ - float data_in_f[][L_FRAME48k], /* i : Input audio signals for parameter analysis */ - float data_out_f[][L_FRAME48k], /* o : Transport audio signals */ - const int16_t input_frame, /* i : Input frame size */ - const int16_t nchan_transport, /* i : Number of transport channels */ - const int16_t nchan_inp, /* i : Number of objects for parameter analysis */ - const ISM_MODE ism_mode, /* i : ISM mode */ - float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ - int16_t* idx_separated_object /* o : Index of the separated object */ + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ + float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t nchan_transport, /* i : Number of transport channels */ + const int16_t nchan_ism, /* i : Number of objects for parameter analysis*/ + const ISM_MODE ism_mode, /* i : ISM mode */ + float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ + int16_t* idx_separated_object /* o : Index of the separated object */ ); #ifdef OMASA_BRATE diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index df5cfb4253..a964c53a6c 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -355,6 +355,150 @@ ivas_error ivas_dec( ivas_sba_upmixer_renderer( st_ivas, output, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */ } } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { +#ifndef OMASA_BRATE + ism_total_brate = 0; +#endif + st = st_ivas->hCPE[0]->hCoreCoder[0]; + +#ifndef OMASA_BRATE + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + st->bit_stream = &( st_ivas->bit_stream[( st_ivas->hSCE[0]->element_brate / FRAMES_PER_SEC )] ); + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + ism_total_brate += st_ivas->hSCE[n]->element_brate; + } + st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); + } +#endif + + nb_bits_metadata[0] = 0; + set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); + + /* Set the number of objects for the parametric rendering */ + if ( st_ivas->hDirAC != NULL ) + { + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; + } + else + { + st_ivas->hDirAC->numIsmDirections = 0; + } + } + + /* MASA decoding */ + if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + +#ifdef OMASA_BRATE + /* Configuration of combined-format bit-budget distribution */ + ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); + + st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); +#endif + + /* Audio signal decoding */ + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + if ( st_ivas->nSCE == 1 ) + { + ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ); + } + else + { +#ifdef DEBUGGING + assert( ( st_ivas->nSCE <= 1 ) && "nSCE should be 1 if not in ISM_MASA_MODE_DISC." ); +#endif + } + } + else + { + /* decode ISM format */ + ivas_ism_metadata_dec( ism_total_brate, &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL ); + + for ( n = 0; n < st_ivas->nSCE - 1; n++ ) + { + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } + } + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + } + } + if ( st_ivas->nCPE == 1 ) + { + ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ); + } + + if ( st_ivas->hCPE[0]->nchan_out == 1 ) + { + mvr2r( output[0], output[1], output_frame ); /* Copy mono signal to stereo output channels */ + } + + /* HP filtering */ + for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) + { + hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + + /* Set edited object positions, if editing enabled */ + ivas_masa_ism_set_edited_objects( st_ivas ); + + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { + ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); + } + else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) + { + ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); + } + else if ( st_ivas->hDirAC ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + mvr2r( output[2], data_separated_objects[0], output_frame ); + } + else + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + } + } + + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); + } + else + { + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + } + } + } +#endif else if ( st_ivas->ivas_format == MC_FORMAT ) { st = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0]; @@ -547,150 +691,7 @@ ivas_error ivas_dec( } } } -#ifdef MASA_AND_OBJECTS - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { -#ifndef OMASA_BRATE - ism_total_brate = 0; -#endif - st = st_ivas->hCPE[0]->hCoreCoder[0]; - -#ifndef OMASA_BRATE - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - st->bit_stream = &( st_ivas->bit_stream[( st_ivas->hSCE[0]->element_brate / FRAMES_PER_SEC )] ); - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - ism_total_brate += st_ivas->hSCE[n]->element_brate; - } - st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); - } -#endif - - nb_bits_metadata[0] = 0; - set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); - - /* Set the number of objects for the parametric rendering */ - if ( st_ivas->hDirAC != NULL ) - { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; - } - else - { - st_ivas->hDirAC->numIsmDirections = 0; - } - } - - /* MASA decoding */ - if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - -#ifdef OMASA_BRATE - /* Configuration of combined-format bit-budget distribution */ - ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); - - st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); -#endif - - /* Audio signal decoding */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - if ( st_ivas->nSCE == 1 ) - { - ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ); - } - else - { -#ifdef DEBUGGING - assert( ( st_ivas->nSCE <= 1 ) && "nSCE should be 1 if not in ISM_MASA_MODE_DISC." ); -#endif - } - } - else - { - /* decode ISM format */ - ivas_ism_metadata_dec( ism_total_brate, &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL ); - for ( n = 0; n < st_ivas->nSCE - 1; n++ ) - { - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); - st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); - } - } - if ( st_ivas->nCPE == 1 ) - { - ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ); - } - - if ( st_ivas->hCPE[0]->nchan_out == 1 ) - { - mvr2r( output[0], output[1], output_frame ); /* Copy mono signal to stereo output channels */ - } - - /* HP filtering */ - for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) - { - hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - - /* Set edited object positions, if editing enabled */ - ivas_masa_ism_set_edited_objects( st_ivas ); - - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); - } - else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) - { - ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); - } - else if ( st_ivas->hDirAC ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - mvr2r( output[2], data_separated_objects[0], output_frame ); - } - else - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( output[n + 2], data_separated_objects[n], output_frame ); - } - } - - ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); - ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); - } - else - { - ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); - } - } - } -#endif /*----------------------------------------------------------------* * Write IVAS output channels diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 2c2a26b315..f20dbf1f09 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -664,7 +664,7 @@ ivas_error ivas_init_decoder( DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; #ifdef MASA_AND_OBJECTS - int32_t sce_brate; + int32_t ism_total_brate; #endif error = IVAS_ERR_OK; @@ -968,7 +968,7 @@ ivas_error ivas_init_decoder( ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); k = 0; - sce_brate = 0; + ism_total_brate = 0; while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) { k++; @@ -978,8 +978,8 @@ ivas_error ivas_init_decoder( /* one separated object */ st_ivas->nSCE = 1; - sce_brate = sep_object_brate[k - 2][0]; - create_sce_dec( st_ivas, 0, sce_brate ); + ism_total_brate = sep_object_brate[k - 2][0]; + create_sce_dec( st_ivas, 0, ism_total_brate ); reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); @@ -999,7 +999,7 @@ ivas_error ivas_init_decoder( { temp_brate[sce_id] = sep_object_brate[k - 2][st_ivas->nSCE - 1]; - sce_brate += temp_brate[sce_id]; + ism_total_brate += temp_brate[sce_id]; if ( ( error = create_sce_dec( st_ivas, sce_id, temp_brate[sce_id] ) ) != IVAS_ERR_OK ) { @@ -1024,7 +1024,7 @@ ivas_error ivas_init_decoder( } st_ivas->nCPE = 1; - create_cpe_dec( st_ivas, 0, ( ( ivas_total_brate - sce_brate ) / st_ivas->nchan_transport ) * CPE_CHANNELS ); // VE2Nokia: could be simplified - nchan_transport is always 2 here + create_cpe_dec( st_ivas, 0, ivas_total_brate - ism_total_brate ); for ( n = 0; n < CPE_CHANNELS; n++ ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 83c194dbd2..06646b2ab9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -497,26 +497,27 @@ ivas_error ivas_masa_dec_open( MASA_DECODER_HANDLE hMasa; #ifdef MASA_AND_OBJECTS int16_t i; - int32_t sce_brate; + int32_t ism_total_brate; #endif + if ( ( hMasa = (MASA_DECODER_HANDLE) malloc( sizeof( MASA_DECODER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) ); } #ifdef MASA_AND_OBJECTS - sce_brate = 0; + ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) { - sce_brate += st_ivas->hSCE[i]->element_brate; + ism_total_brate += st_ivas->hSCE[i]->element_brate; } } #endif ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE #ifdef MASA_AND_OBJECTS , - st_ivas->ivas_format, st_ivas->ism_mode, sce_brate + st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); @@ -655,7 +656,7 @@ static ivas_error ivas_masa_dec_config( ivas_error error; #ifdef MASA_AND_OBJECTS int32_t ivas_total_brate; - int32_t sce_brate; + int32_t ism_total_brate; #endif error = IVAS_ERR_OK; @@ -664,16 +665,16 @@ static ivas_error ivas_masa_dec_config( #ifdef MASA_AND_OBJECTS ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - sce_brate = 0; + ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) { - sce_brate += st_ivas->hSCE[i]->element_brate; + ism_total_brate += st_ivas->hSCE[i]->element_brate; } } - ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, sce_brate ); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -696,7 +697,6 @@ static ivas_error ivas_masa_dec_config( return error; } - st_ivas->hQMetaData->numTwoDirBands = st_ivas->hMasa->config.numTwoDirBands; st_ivas->hQMetaData->useLowerRes = 0; @@ -1281,7 +1281,7 @@ ivas_error ivas_masa_dec_reconfigure( int32_t ivas_total_brate, last_ivas_total_brate; ivas_error error; #ifdef MASA_AND_OBJECTS - int32_t sce_brate; + int32_t ism_total_brate; #endif error = IVAS_ERR_OK; @@ -1346,19 +1346,20 @@ ivas_error ivas_masa_dec_reconfigure( } } #ifdef MASA_AND_OBJECTS - sce_brate = 0; + ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( n = 0; n < st_ivas->nSCE; n++ ) { - sce_brate += st_ivas->hSCE[n]->element_brate; + ism_total_brate += st_ivas->hSCE[n]->element_brate; } } #endif + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp #ifdef MASA_AND_OBJECTS , - st_ivas->ivas_format, st_ivas->ism_mode, sce_brate + st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index d5ed2963c3..070554b9e2 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -332,7 +332,10 @@ ivas_error ivas_enc( #ifdef OMASA_BRATE /* Configure MASA encoder based on frame parameters */ - ivas_masa_enc_config( st_ivas ); // VE2Nokia: this function should return an error code + if ( ( error = ivas_masa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } idx_separated_object = 0; if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) @@ -347,21 +350,18 @@ ivas_error ivas_enc( /* put audio object data in SCE's */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { - // VE2Nokia: merge the following to one function in order to save some stack memory - float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; - /* Estimate MASA parameters for the objects */ - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, data_transport_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); - - /* Merge transport signals */ - ivas_merge_masa_transports( data_transport_f, &( data_f[st_ivas->nchan_ism] ), data_f, input_frame, st_ivas->nchan_transport ); + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); } /* Encode ISMs transport channels */ n = 0; if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ); /* there are no metadata bits in SCE in this mode */ // VE2Nokia: this function should return an error code + if ( ( error = ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) /* there are no metadata bits in SCE in this mode */ + { + return error; + } } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -437,9 +437,9 @@ ivas_error ivas_enc( #endif /* OMASA_BRATE */ /* Encode MASA transport channels */ - if ( st_ivas->nCPE == 1 ) // VE2Nokia: this condition is not necessary + if ( ( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) { - ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ); // VE2Nokia: this condition is unnecessary + return error; } } #endif diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index cb8217d556..63bba1d337 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -565,7 +565,7 @@ ivas_error ivas_init_encoder( else if ( ivas_format == MASA_ISM_FORMAT ) { int32_t element_brate_tmp[MAX_NUM_OBJECTS]; - int32_t sce_brate; + int32_t ism_total_brate; int16_t k; st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -580,7 +580,6 @@ ivas_error ivas_init_encoder( } k = 0; - sce_brate = 0; while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) { k++; @@ -589,8 +588,8 @@ ivas_error ivas_init_encoder( if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { /* use the bitrate for one object */ - sce_brate = sep_object_brate[k - 2][0]; - create_sce_enc( st_ivas, 0, sce_brate ); // VE2Nokia: this function should return an error code + ism_total_brate = sep_object_brate[k - 2][0]; + create_sce_enc( st_ivas, 0, ism_total_brate ); // VE2Nokia: this function should return an error code /* prepare bitstream buffers */ st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list = ind_list[0]; @@ -601,10 +600,10 @@ ivas_error ivas_init_encoder( } else { - sce_brate = 0; + ism_total_brate = 0; for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { - sce_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); // VE2Nokia: this function should return an error code /* prepare bitstream buffers */ @@ -625,7 +624,8 @@ ivas_error ivas_init_encoder( { ivas_omasa_enc_open( st_ivas ); } - if ( ivas_total_brate - sce_brate >= MIN_BRATE_MDCT_STEREO ) + + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } @@ -636,7 +636,7 @@ ivas_error ivas_init_encoder( for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { - create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - sce_brate ); + create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - ism_total_brate ); /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 7986196a08..5fca4c2222 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -111,8 +111,9 @@ ivas_error ivas_masa_enc_open( ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; #ifdef MASA_AND_OBJECTS - int32_t sce_brate; + int32_t ism_total_brate; #endif + error = IVAS_ERR_OK; if ( ( hMasa = (MASA_ENCODER_HANDLE) malloc( sizeof( MASA_ENCODER ) ) ) == NULL ) @@ -145,12 +146,12 @@ ivas_error ivas_masa_enc_open( } } #ifdef MASA_AND_OBJECTS - sce_brate = 0; + ism_total_brate = 0; if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) { - sce_brate += st_ivas->hSCE[i]->element_brate; + ism_total_brate += st_ivas->hSCE[i]->element_brate; } } #endif @@ -158,12 +159,13 @@ ivas_error ivas_masa_enc_open( st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE #ifdef MASA_AND_OBJECTS , - hEncoderConfig->ivas_format, st_ivas->ism_mode, sce_brate + hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); mvs2s( DirAC_block_grouping, hMasa->config.block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); mvs2s( MASA_band_grouping_24, hMasa->config.band_grouping, MASA_FREQUENCY_BANDS + 1 ); + #ifdef MASA_AND_OBJECTS if ( hEncoderConfig->ivas_format == MASA_FORMAT || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) #else @@ -628,21 +630,23 @@ ivas_error ivas_masa_enc_config( int32_t ivas_total_brate; ivas_error error; #ifdef MASA_AND_OBJECTS - int32_t sce_brate; + int32_t ism_total_brate; #endif + error = IVAS_ERR_OK; hMasa = st_ivas->hMasa; hQMetaData = st_ivas->hQMetaData; ivas_format = st_ivas->hEncoderConfig->ivas_format; ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; + #ifdef MASA_AND_OBJECTS - sce_brate = 0; + ism_total_brate = 0; if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) { - sce_brate += st_ivas->hSCE[i]->element_brate; + ism_total_brate += st_ivas->hSCE[i]->element_brate; } } #endif @@ -650,12 +654,11 @@ ivas_error ivas_masa_enc_config( hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE #ifdef MASA_AND_OBJECTS , - ivas_format, st_ivas->ism_mode, sce_brate + ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); hQMetaData->is_masa_ivas_format = 1; - #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else @@ -771,7 +774,7 @@ ivas_error ivas_masa_enc_config( #endif { #ifdef MASA_AND_OBJECTS - st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ( ivas_total_brate - sce_brate < MASA_STEREO_MIN_BITRATE ) ? 1 : 0; + st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ( ivas_total_brate - ism_total_brate < MASA_STEREO_MIN_BITRATE ) ? 1 : 0; #else st_ivas->hCPE[0]->hStereoDft->hConfig->force_mono_transmission = ivas_total_brate < MASA_STEREO_MIN_BITRATE ? 1 : 0; #endif @@ -1902,17 +1905,17 @@ void ivas_masa_enc_reconfigure( int16_t sce_id, cpe_id; int32_t ivas_total_brate; #ifdef MASA_AND_OBJECTS - int32_t sce_brate; + int32_t ism_total_brate; #endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; #ifdef MASA_AND_OBJECTS - sce_brate = 0; + ism_total_brate = 0; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { - sce_brate += st_ivas->hSCE[sce_id]->element_brate; + ism_total_brate += st_ivas->hSCE[sce_id]->element_brate; } } #endif @@ -1935,8 +1938,9 @@ 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 MASA_AND_OBJECTS - if ( ivas_total_brate - sce_brate < MASA_STEREO_MIN_BITRATE || ivas_total_brate - sce_brate < MIN_BRATE_MDCT_STEREO ) + if ( ivas_total_brate - ism_total_brate < MASA_STEREO_MIN_BITRATE || ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) { st_ivas->hCPE[cpe_id]->element_mode = IVAS_CPE_DFT; } @@ -1963,7 +1967,7 @@ void ivas_masa_enc_reconfigure( ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp #ifdef MASA_AND_OBJECTS , - st_ivas->hEncoderConfig->ivas_format, st_ivas->ism_mode, sce_brate + st_ivas->hEncoderConfig->ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 16758a4d77..d756f063e7 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -278,20 +278,21 @@ void ivas_omasa_set_config( *--------------------------------------------------------------------------*/ void ivas_omasa_enc( - OMASA_ENC_HANDLE hOMasa, - IVAS_QMETADATA_HANDLE hQMeta, - MASA_ENCODER_HANDLE hMasa, - ISM_METADATA_HANDLE hIsmMeta[], - float data_in_f[][L_FRAME48k], - float data_out_f[][L_FRAME48k], - const int16_t input_frame, - const int16_t nchan_transport, - const int16_t nchan_ism, - const ISM_MODE ism_mode, - float data_separated_object[L_FRAME48k], - int16_t *idx_separated_object ) + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ + IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ + float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ + const int16_t input_frame, /* i : Input frame size */ + const int16_t nchan_transport, /* i : Number of transport channels */ + const int16_t nchan_ism, /* i : Number of objects for parameter analysis */ + const ISM_MODE ism_mode, /* i : ISM mode */ + float data_separated_object[L_FRAME48k], /* o : Separated object audio signal */ + int16_t *idx_separated_object /* o : Index of the separated object */ +) { int16_t i, j; + float data_out_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* Analysis */ if ( ism_mode == ISM_MODE_NONE ) @@ -481,12 +482,14 @@ void ivas_omasa_enc( /* Downmix */ ivas_omasa_dmx( data_in_f, data_out_f, input_frame, nchan_transport, nchan_ism, hIsmMeta, hOMasa->prev_object_dm_gains, hOMasa->interpolator ); + /* Merge transport signals */ + ivas_merge_masa_transports( data_out_f, &( data_in_f[nchan_ism] ), data_in_f, input_frame, nchan_transport ); + return; } #ifdef OMASA_BRATE - /*-------------------------------------------------------------------------* * set_ism_importance_interformat() * -- GitLab From d4c50f64dd8e853c6d1fc208792586c5b8c92238 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 11:49:23 +0100 Subject: [PATCH 0032/1418] address "VE2Nokia" comments, part 2 --- lib_com/ivas_ism_config.c | 98 --------------------------------- lib_com/ivas_masa_com.c | 5 +- lib_com/ivas_omasa_com.c | 98 +++++++++++++++++++++++++++++++++ lib_com/ivas_prot.h | 10 +++- lib_dec/ivas_ism_metadata_dec.c | 2 +- lib_enc/ivas_init_enc.c | 62 ++++++++++----------- lib_enc/ivas_ism_metadata_enc.c | 20 ++----- lib_enc/ivas_omasa_enc.c | 50 +++++++---------- lib_enc/ivas_sce_enc.c | 4 +- 9 files changed, 166 insertions(+), 183 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 5a44c7de09..109e77e5cc 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -586,101 +586,3 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } - - -#ifdef MASA_AND_OBJECTS // VE2Nokia: move this function to the new file ivas_omasa_com.c (?) -/*--------------------------------------------------------------- - * ivas_omasa_ism_mode_select() - * - * selects the ISM mode base on bit-rate and number of objects in the combined ISM MASA format mode - * ---------------------------------------------------------------*/ - -/*! r : ISM format mode */ -ISM_MODE ivas_omasa_ism_mode_select( - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t no_obj /* i : number of objects */ -) -{ - ISM_MODE ism_mode = ISM_MODE_NONE; - - switch ( no_obj ) - { - case 1: -#ifdef FIX_24k4_ISM1_MODE - if ( ivas_total_brate >= IVAS_24k4 ) -#else - if ( ivas_total_brate >= IVAS_32k ) -#endif - { - ism_mode = ISM_MASA_MODE_DISC; - } -#ifndef FIX_24k4_ISM1_MODE - else if ( ivas_total_brate >= IVAS_24k4 ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } -#endif - else - { - ism_mode = ISM_MODE_NONE; - } - break; - case 2: - if ( ivas_total_brate >= IVAS_64k ) - { - ism_mode = ISM_MASA_MODE_DISC; - } - else if ( ivas_total_brate >= IVAS_32k ) - { - ism_mode = ISM_MASA_MODE_ONE_OBJ; - } - /* else if ( ivas_total_brate >= IVAS_32k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } */ - else - { - ism_mode = ISM_MODE_NONE; - } - break; - case 3: - if ( ivas_total_brate >= IVAS_128k ) - { - ism_mode = ISM_MASA_MODE_DISC; - } - else if ( ivas_total_brate >= IVAS_64k ) - { - ism_mode = ISM_MASA_MODE_ONE_OBJ; - } - else if ( ivas_total_brate >= IVAS_48k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } - else - { - ism_mode = ISM_MODE_NONE; - } - break; - case 4: - if ( ivas_total_brate >= IVAS_160k ) - { - ism_mode = ISM_MASA_MODE_DISC; - } - else if ( ivas_total_brate >= IVAS_64k ) - { - ism_mode = ISM_MASA_MODE_ONE_OBJ; - } - else if ( ivas_total_brate >= IVAS_48k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } - else - { - ism_mode = ISM_MODE_NONE; - } - break; - } - - return ism_mode; -} -#endif diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 867f9512e8..c8c8f2c3e6 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -511,6 +511,7 @@ void modify_masa_energy_ratios( ) { int16_t i, m, d, b; + for ( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ ) { if ( hQMetaData->q_direction[0].cfg.nblocks == 1 ) @@ -543,8 +544,8 @@ void modify_masa_energy_ratios( *---------------------------------------------------------------*/ void ivas_get_stereo_panning_gains( - float aziDeg, - float eleDeg, + const float aziDeg, + const float eleDeg, float panningGains[2] ) { float aziRad, eleRad; diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 121ea78076..59dc45abbc 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -55,6 +55,104 @@ #define GAMMA_ISM_HIGH_IMP2 1.35f +#ifdef MASA_AND_OBJECTS +/*--------------------------------------------------------------- + * ivas_omasa_ism_mode_select() + * + * selects the ISM mode base on bit-rate and number of objects in the combined ISM MASA format mode + * ---------------------------------------------------------------*/ + +/*! r : ISM format mode */ +ISM_MODE ivas_omasa_ism_mode_select( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t no_obj /* i : number of objects */ +) +{ + ISM_MODE ism_mode = ISM_MODE_NONE; + + switch ( no_obj ) + { + case 1: +#ifdef FIX_24k4_ISM1_MODE + if ( ivas_total_brate >= IVAS_24k4 ) +#else + if ( ivas_total_brate >= IVAS_32k ) +#endif + { + ism_mode = ISM_MASA_MODE_DISC; + } +#ifndef FIX_24k4_ISM1_MODE + else if ( ivas_total_brate >= IVAS_24k4 ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } +#endif + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 2: + if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + /* else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } */ + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 3: + if ( ivas_total_brate >= IVAS_128k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + else if ( ivas_total_brate >= IVAS_48k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } + else + { + ism_mode = ISM_MODE_NONE; + } + break; + case 4: + if ( ivas_total_brate >= IVAS_160k ) + { + ism_mode = ISM_MASA_MODE_DISC; + } + else if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_ONE_OBJ; + } + else if ( ivas_total_brate >= IVAS_48k ) + { + ism_mode = ISM_MASA_MODE_PARAM; + } + else + { + ism_mode = ISM_MODE_NONE; + } + break; + } + + return ism_mode; +} +#endif + + /*--------------------------------------------------------------- * ivas_interformat_brate() * diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b861e3aa1d..018c68eab7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3346,7 +3346,11 @@ void ivas_dirac_dec_binaural( ); #ifdef MASA_AND_OBJECTS -void ivas_get_stereo_panning_gains( float aziDeg, float eleDeg, float panningGains[2] ); +void ivas_get_stereo_panning_gains( + const float aziDeg, + const float eleDeg, + float panningGains[2] +); #endif ivas_error ivas_binaural_reverb_open( @@ -5121,9 +5125,9 @@ void ivas_filter_process( #ifdef MASA_AND_OBJECTS -/* ----------------------------------------------------------------------------------* +/*----------------------------------------------------------------------------------* * OMASA prototypes -* ----------------------------------------------------------------------------------*/ +*---------------------------------------------------------------------------------*/ ivas_error ivas_omasa_enc_open( Encoder_Struct* st_ivas /* i/o: IVAS encoder handle */ diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 0d3b5fa572..b5fa185a18 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -504,7 +504,7 @@ ivas_error ivas_ism_metadata_dec( { #ifdef MASA_AND_OBJECTS int16_t masa_ism_flag = 0; - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) // VE2Nokia: ISM_MASA_MODE_ONE_OBJ looks obsolete here + if ( ism_mode == ISM_MASA_MODE_DISC ) { masa_ism_flag = 1; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 63bba1d337..0e5114bfbe 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -571,12 +571,9 @@ ivas_error ivas_init_encoder( st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); st_ivas->nchan_transport = 2; - create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ); // VE2Nokia: this function should return an error code - /* the values of element_brate_tmp will be re-written in MASA_ISM_FORMAT because they are taken from sep_object_brate[][]*/ - - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + if ( ( error = create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) { - st_ivas->nSCE = st_ivas->nchan_ism; + return error; } k = 0; @@ -585,44 +582,42 @@ ivas_error ivas_init_encoder( k++; } - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - /* use the bitrate for one object */ - ism_total_brate = sep_object_brate[k - 2][0]; - create_sce_enc( st_ivas, 0, ism_total_brate ); // VE2Nokia: this function should return an error code + ism_total_brate = 0; - /* prepare bitstream buffers */ - st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list = ind_list[0]; - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); - st_ivas->hSCE[0]->hMetaData->ind_list = ind_list_metadata[0]; - reset_indices_enc( st_ivas->hSCE[0]->hMetaData, MAX_BITS_METADATA ); - } - else + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { - ism_total_brate = 0; - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + if ( ( error = create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ) ) != IVAS_ERR_OK ) { - ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; - create_sce_enc( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); // VE2Nokia: this function should return an error code + return error; + } - /* 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 ); + /* 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 ); - 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 ); - } + 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 ); } - // VE2Nokia: following functions should return an error code - ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); - ivas_masa_enc_open( st_ivas ); + if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( ( error = ivas_masa_enc_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { - ivas_omasa_enc_open( st_ivas ); + if ( ( error = ivas_omasa_enc_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } } if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) @@ -636,7 +631,10 @@ ivas_error ivas_init_encoder( for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { - create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - ism_total_brate ); + if ( ( error = create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; + } /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index bd9183f92f..131a2e3bfc 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -943,6 +943,8 @@ ivas_error create_ism_metadata_enc( ) { int16_t ch, nchan_transport; + + // VE: this part of the code is better to be moved to a separate function, e.g. ivas_set_omasa_TC() #ifdef MASA_AND_OBJECTS nchan_transport = st_ivas->nchan_transport; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) @@ -957,25 +959,14 @@ ivas_error create_ism_metadata_enc( st_ivas->nCPE = 1; st_ivas->nSCE = 1; break; - case ISM_MODE_DISC: // VE2Nokia: this cannot happen - st_ivas->nCPE = 1; - st_ivas->nSCE = n_ISms; - break; case ISM_MASA_MODE_DISC: st_ivas->nCPE = 1; st_ivas->nSCE = n_ISms; break; case ISM_MODE_NONE: - if ( nchan_transport == 1 ) // VE2Nokia: this cannot happen - { - st_ivas->nSCE = 1; - st_ivas->nCPE = 0; - } - else - { - st_ivas->nSCE = 0; - st_ivas->nCPE = 1; - } + st_ivas->nSCE = 0; + st_ivas->nCPE = 1; + break; default: break; @@ -1014,6 +1005,7 @@ ivas_error create_ism_metadata_enc( #ifdef MASA_AND_OBJECTS } #endif + /* allocate ISm metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) { diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index d756f063e7..96490893c7 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -949,48 +949,36 @@ static void ivas_omasa_dmx( float gains[MASA_MAX_TRANSPORT_CHANNELS]; float g1, g2; - if ( nchan_transport == 2 ) + + for ( i = 0; i < nchan_transport; i++ ) { - for ( i = 0; i < nchan_transport; i++ ) - { - set_zero( data_out_f[i], input_frame ); - } + set_zero( data_out_f[i], input_frame ); + } - for ( i = 0; i < nchan_ism; i++ ) - { - azimuth = hIsmMeta[i]->azimuth; - elevation = hIsmMeta[i]->elevation; + for ( i = 0; i < nchan_ism; i++ ) + { + azimuth = hIsmMeta[i]->azimuth; + elevation = hIsmMeta[i]->elevation; - ivas_get_stereo_panning_gains( azimuth, elevation, gains ); + ivas_get_stereo_panning_gains( azimuth, elevation, gains ); - /* Downmix using the panning gains */ - for ( j = 0; j < nchan_transport; j++ ) + /* Downmix using the panning gains */ + for ( j = 0; j < nchan_transport; j++ ) + { + if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f ) { - if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f ) + for ( k = 0; k < input_frame; k++ ) { - for ( k = 0; k < input_frame; k++ ) - { - g1 = interpolator[k]; - g2 = 1.0f - g1; - data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k]; - } + g1 = interpolator[k]; + g2 = 1.0f - g1; + data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k]; } - prev_gains[i][j] = gains[j]; - } - } - } - else if ( nchan_transport == 1 ) // VE2Nokia: is ti relevant? - { - for ( i = 0; i < input_frame; i++ ) - { - data_out_f[0][i] = 0.0f; - for ( j = 0; j < nchan_ism; j++ ) - { - data_out_f[0][i] += data_in_f[j][i]; } + prev_gains[i][j] = gains[j]; } } + return; } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index de1c0466ce..1bfe4773a1 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -350,9 +350,9 @@ ivas_error create_sce_enc( copy_encoder_config( st_ivas, st, 1 ); #ifdef MASA_AND_OBJECTS - if ( st_ivas->ism_mode >= ISM_MASA_MODE_PARAM ) // VE2Nokia: ??? + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { - st->element_mode = IVAS_SCE; /* To do: Nokia check as this is not optimal and verify if it influences other SCE modes */ + st->element_mode = IVAS_SCE; } #endif -- GitLab From af4fb067d299fb6c73ea2b150286f3c8f94ff97c Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 12:17:33 +0100 Subject: [PATCH 0033/1418] address "VE2Nokia" comments, part 3/3 --- lib_com/ivas_rom_com.c | 54 +++++++++++++++++++++------------------- lib_com/ivas_rom_com.h | 15 +++++------ lib_enc/ivas_enc.c | 19 +++++++------- lib_enc/ivas_init_enc.c | 9 +++---- lib_enc/ivas_omasa_enc.c | 4 +-- lib_enc/ivas_stat_enc.h | 6 ++--- lib_enc/lib_enc.c | 17 ++++--------- lib_enc/lib_enc.h | 2 +- 8 files changed, 60 insertions(+), 66 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 641a5f5c84..4e2ef7b596 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2784,8 +2784,7 @@ const float McMASA_LFEGain_vectors[64] = * OMASA ROM tables *----------------------------------------------------------------------------------*/ -// VE2Nokia: add "const" to the arrays -int32_t sep_object_brate[][MAX_NUM_OBJECTS] = +const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = { {0, 0, 0, 0}, /* 13k2 */ {0, 0, 0, 0}, /* 16k4 */ @@ -2812,29 +2811,34 @@ int32_t sep_object_brate[][MAX_NUM_OBJECTS] = }; /* column wise DCT matrices for 4 5, and 8 dim */ - float dct4[] = { - 0.5000f, 0.6533f, 0.5000f, 0.2706f, - 0.5000f, 0.2706f, -0.5000f, -0.6533f, - 0.5000f, -0.2706f, -0.5000f, 0.6533f, - 0.5000f, -0.6533f, 0.5000f, -0.2706f - }; - - float dct5[] = { - 0.4472f, 0.6015f, 0.5117f, 0.3717f, 0.1954f, - 0.4472f, 0.3717f, -0.1954f, -0.6015f, -0.5117f, - 0.4472f, 0.0000f, -0.6325f, -0.0000f, 0.6325f, - 0.4472f, -0.3717f, -0.1954f, 0.6015f, -0.5117f, - 0.4472f, -0.6015f, 0.5117f, -0.3717f, 0.1954f - }; - - float dct8[] = { - 0.3536f, 0.4904f, 0.4619f, 0.4157f, 0.3536f, 0.2778f, 0.1913f, 0.0975f, 0.3536f, 0.4157f, - 0.1913f, -0.0975f, -0.3536f, -0.4904f, -0.4619f, -0.2778f, 0.3536f, 0.2778f, -0.1913f, -0.4904f, - -0.3536f, 0.0975f, 0.4619f, 0.4157f, 0.3536f, 0.0975f, -0.4619f, -0.2778f, 0.3536f, 0.4157f, - -0.1913f, -0.4904f, 0.3536f, -0.0975f, -0.4619f, 0.2778f, 0.3536f, -0.4157f, -0.1913f, 0.4904f, - 0.3536f, -0.2778f, -0.1913f, 0.4904f, -0.3536f, -0.0975f, 0.4619f, -0.4157f, 0.3536f, -0.4157f, - 0.1913f, 0.0975f, -0.3536f, 0.4904f, -0.4619f, 0.2778f, 0.3536f, -0.4904f, 0.4619f, -0.4157f, - 0.3536f, -0.2778f, 0.1913f, -0.0975f }; +const float dct4[4*4] = +{ + 0.5000f, 0.6533f, 0.5000f, 0.2706f, + 0.5000f, 0.2706f, -0.5000f, -0.6533f, + 0.5000f, -0.2706f, -0.5000f, 0.6533f, + 0.5000f, -0.6533f, 0.5000f, -0.2706f +}; + +const float dct5[5*5] = +{ + 0.4472f, 0.6015f, 0.5117f, 0.3717f, 0.1954f, + 0.4472f, 0.3717f, -0.1954f, -0.6015f, -0.5117f, + 0.4472f, 0.0000f, -0.6325f, -0.0000f, 0.6325f, + 0.4472f, -0.3717f, -0.1954f, 0.6015f, -0.5117f, + 0.4472f, -0.6015f, 0.5117f, -0.3717f, 0.1954f +}; + +const float dct8[8*8] = +{ + 0.3536f, 0.4904f, 0.4619f, 0.4157f, 0.3536f, 0.2778f, 0.1913f, 0.0975f, + 0.3536f, 0.4157f, 0.1913f, -0.0975f, -0.3536f, -0.4904f, -0.4619f, -0.2778f, + 0.3536f, 0.2778f, -0.1913f, -0.4904f, -0.3536f, 0.0975f, 0.4619f, 0.4157f, + 0.3536f, 0.0975f, -0.4619f, -0.2778f, 0.3536f, 0.4157f, -0.1913f, -0.4904f, + 0.3536f, -0.0975f, -0.4619f, 0.2778f, 0.3536f, -0.4157f, -0.1913f, 0.4904f, + 0.3536f, -0.2778f, -0.1913f, 0.4904f, -0.3536f, -0.0975f, 0.4619f, -0.4157f, + 0.3536f, -0.4157f, 0.1913f, 0.0975f, -0.3536f, 0.4904f, -0.4619f, 0.2778f, + 0.3536f, -0.4904f, 0.4619f, -0.4157f, 0.3536f, -0.2778f, 0.1913f, -0.0975f +}; #endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index acf2a80924..036538a032 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -256,7 +256,6 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_combined_48_16bits[PARAM_MC_SZ_ extern const uint16_t ivas_param_mc_cum_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER]; extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1]; - /*----------------------------------------------------------------------------------* * MASA ROM tables *----------------------------------------------------------------------------------*/ @@ -313,11 +312,14 @@ extern const float cb_azi_chan[]; extern const float McMASA_LFEGain_vectors[64]; #ifdef MASA_AND_OBJECTS -/* MASA and ISM combined format */ -extern int32_t sep_object_brate[][MAX_NUM_OBJECTS]; -extern float dct4[]; -extern float dct5[]; -extern float dct8[]; +/*----------------------------------------------------------------------------------* + * MASA and ISM (OMASA) combined format ROM tables + *----------------------------------------------------------------------------------*/ + +extern const int32_t sep_object_brate[][MAX_NUM_OBJECTS]; +extern const float dct4[]; +extern const float dct5[]; +extern const float dct8[]; #endif /*----------------------------------------------------------------------------------* @@ -333,7 +335,6 @@ extern const float ism_elevation_borders[4]; extern const int16_t Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1]; - /*----------------------------------------------------------------------------------* * LFE coding ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 070554b9e2..a9e459bc81 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -266,7 +266,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0, NULL + ISM_MODE_NONE, -1, NULL, -1, NULL #endif ); } @@ -321,10 +321,10 @@ ivas_error ivas_enc( hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; /* Stereo transport is used also with monoMASA, duplicate mono if monoMASA */ - if ( ( st_ivas->hEncoderConfig->nchan_inp - st_ivas->nchan_ism ) == 1 ) + if ( ( st_ivas->hEncoderConfig->nchan_inp - hEncoderConfig->nchan_ism ) == 1 ) { - v_multc( data_f[st_ivas->nchan_ism], 1.0f / SQRT2, data_f[st_ivas->nchan_ism], input_frame ); - mvr2r( data_f[st_ivas->nchan_ism], data_f[st_ivas->nchan_ism + 1], input_frame ); + v_multc( data_f[hEncoderConfig->nchan_ism], 1.0f / SQRT2, data_f[hEncoderConfig->nchan_ism], input_frame ); + mvr2r( data_f[hEncoderConfig->nchan_ism], data_f[hEncoderConfig->nchan_ism + 1], input_frame ); } /* nb_bits_metadata[0] = 0; */ @@ -345,13 +345,13 @@ ivas_error ivas_enc( } /* Estimate TF-tile energy for the input MASA stream */ - ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[st_ivas->nchan_ism] ), input_frame, st_ivas->nchan_transport ); + ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport ); /* put audio object data in SCE's */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Estimate MASA parameters for the objects */ - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); } /* Encode ISMs transport channels */ @@ -370,12 +370,12 @@ ivas_error ivas_enc( { return error; } - n = st_ivas->nchan_ism; + n = st_ivas->hEncoderConfig->nchan_ism; } /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); /* Configuration of combined-format bit-budget distribution */ #ifdef DEBUG_VA @@ -496,11 +496,10 @@ ivas_error ivas_enc( ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, 0, NULL + ISM_MODE_NONE, -1, NULL, -1, NULL #endif ); - if ( st_ivas->hMcMasa->separateChannelEnabled ) { if ( ( error = ivas_sce_enc( st_ivas, 0, data_f[2], input_frame, 0 ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 0e5114bfbe..909115d63e 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -568,10 +568,10 @@ ivas_error ivas_init_encoder( int32_t ism_total_brate; int16_t k; - st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); + st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, hEncoderConfig->nchan_ism ); st_ivas->nchan_transport = 2; - if ( ( error = create_ism_metadata_enc( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) + if ( ( error = create_ism_metadata_enc( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -583,8 +583,6 @@ ivas_error ivas_init_encoder( } ism_total_brate = 0; - - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; @@ -601,7 +599,6 @@ ivas_error ivas_init_encoder( reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); } - if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) { return error; @@ -1103,7 +1100,7 @@ void ivas_destroy_enc( #ifdef MASA_AND_OBJECTS if ( st_ivas->hOMasa != NULL ) { - ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->nchan_ism ); + ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); st_ivas->hOMasa = NULL; } #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 96490893c7..edc2f77cbf 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -87,7 +87,7 @@ ivas_error ivas_omasa_enc_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for OMASA encoder\n" ) ); } - numAnalysisChannels = st_ivas->nchan_ism; + numAnalysisChannels = st_ivas->hEncoderConfig->nchan_ism; /* initialize delay compensation */ hOMasa->num_samples_delay_comp = NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS ); @@ -595,7 +595,7 @@ void ivas_set_surplus_brate_enc( } else { - for ( int16_t i = 0; i < st_ivas->nchan_ism; i++ ) + for ( int16_t i = 0; i < st_ivas->hEncoderConfig->nchan_ism; i++ ) { tmpF += st_ivas->hSCE[i]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[i + 1] * 50 ); } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index bf574dbfcb..ed07d884bd 100755 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1057,6 +1057,9 @@ typedef struct encoder_config_structure 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 MASA_AND_OBJECTS + int16_t nchan_ism; /* number of ISM input channels in combined format coding */ +#endif int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ @@ -1100,9 +1103,6 @@ typedef struct /* high-level encoder parameters */ int16_t nchan_transport; /* number of transport channels */ -#ifdef MASA_AND_OBJECTS - int16_t nchan_ism; // VE2Nokia: move it under hEncoderConfig, or remove it and replace it by "nchan_inp - 2" in the code -#endif int16_t sba_analysis_order; /* Ambisonic (SBA) order used for analysis and coding */ int16_t codec_mode; /* Mode1 or Mode2 of core codec */ int16_t last_codec_mode; /* previous frame Mode 1 or 2 */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 09e4b1e03f..3aaddb3c33 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -366,7 +366,7 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( 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 */ - const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ + const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ ) { Encoder_Struct *st_ivas; @@ -384,12 +384,8 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( st_ivas = hIvasEnc->st_ivas; switch ( masaVariant ) { - case IVAS_ENC_MASA_1CH: // VE2Nokia: seems not needeed - st_ivas->hEncoderConfig->nchan_inp = 1 + numObjects; - st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ - break; case IVAS_ENC_MASA_2CH: - st_ivas->hEncoderConfig->nchan_inp = 2 + numObjects; + st_ivas->hEncoderConfig->nchan_inp = CPE_CHANNELS + numObjects; st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ break; default: @@ -401,11 +397,8 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( /* Currently this is true but it is already shown in descriptive metadata that there can be inequality for this. */ st_ivas->nchan_transport = st_ivas->hEncoderConfig->nchan_inp - numObjects; - - st_ivas->hEncoderConfig->ivas_format = MASA_ISM_FORMAT; - - st_ivas->nchan_ism = numObjects; + st_ivas->hEncoderConfig->nchan_ism = numObjects; return configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); } @@ -870,9 +863,9 @@ static ivas_error configureEncoder( #ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { - st_ivas->ism_mode = ivas_omasa_ism_mode_select( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_ism ); + st_ivas->ism_mode = ivas_omasa_ism_mode_select( st_ivas->hEncoderConfig->ivas_total_brate, hEncoderConfig->nchan_ism ); - cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_ism ); + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, st_ivas->hEncoderConfig->ivas_total_brate, hEncoderConfig->nchan_ism ); /*adapt element_mode according to the bit-rate*/ if ( hEncoderConfig->element_mode_init != IVAS_SCE ) diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index d66e58e1dd..06b89f85fc 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -205,7 +205,7 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( 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 */ - const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ + const int16_t masaVariant /* i : index specifying the number of MASA transport channels */ ); #endif -- GitLab From 57e03bab9d039f7f3365c906cc8e0513d5230d52 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 12:30:21 +0100 Subject: [PATCH 0034/1418] add error code to return of ivas_masa_ism_data_open() --- lib_com/ivas_omasa_com.c | 3 ++- lib_com/ivas_prot.h | 2 +- lib_dec/ivas_init_dec.c | 13 ++++++++++--- lib_dec/ivas_masa_dec.c | 12 ++++++------ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 59dc45abbc..43f6344daa 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -59,7 +59,8 @@ /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() * - * selects the ISM mode base on bit-rate and number of objects in the combined ISM MASA format mode + * selects the ISM mode base on IVAS total bit-rate and + * the number of objects in the combined ISM MASA format mode * ---------------------------------------------------------------*/ /*! r : ISM format mode */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 018c68eab7..7057d8d350 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5209,7 +5209,7 @@ void ivas_merge_masa_transports( const int16_t num_transport_channels /* i : Number of transport audio signals */ ); -void ivas_masa_ism_data_open( +ivas_error ivas_masa_ism_data_open( Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f20dbf1f09..eb02830150 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1009,14 +1009,21 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); } - if ( ( error = create_ism_metadata_dec( st_ivas, st_ivas->nSCE, temp_brate ) ) != IVAS_ERR_OK ) + if ( ( error = create_ism_metadata_dec( st_ivas, st_ivas->nchan_ism, temp_brate ) ) != IVAS_ERR_OK ) { return error; } } - ivas_masa_dec_open( st_ivas ); - ivas_masa_ism_data_open( st_ivas ); + if ( ( error = ivas_masa_dec_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( ( error = ivas_masa_ism_data_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 06646b2ab9..09aff57be9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -558,18 +558,16 @@ ivas_error ivas_masa_dec_open( * *-------------------------------------------------------------------*/ -void ivas_masa_ism_data_open( +ivas_error ivas_masa_ism_data_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { MASA_ISM_DATA_HANDLE hMasaIsmData; - int16_t bin; - int16_t ch; + int16_t ch, bin; if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) { - fprintf( stderr, "Can not allocate memory for MASA_ISM data\n" ); - exit( -1 ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA ISM data\n" ) ); } for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) @@ -588,9 +586,11 @@ void ivas_masa_ism_data_open( hMasaIsmData->delayBuffer = NULL; st_ivas->hMasaIsmData = hMasaIsmData; - return; + return IVAS_ERR_OK; } #endif + + /*-----------------------------------------------------------------------* * ivas_masa_dec_close() * -- GitLab From bf1c0053a26de0a838e570a7e26478c6f3253397 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 13:02:51 +0100 Subject: [PATCH 0035/1418] remove DEBUG_MODE_INFO --- lib_com/ivas_prot.h | 2 +- lib_com/options.h | 1 - lib_enc/ivas_core_enc.c | 8 -------- lib_enc/ivas_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 8 ++------ 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 7057d8d350..637adbda6e 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5161,7 +5161,7 @@ void ivas_omasa_enc( #ifdef OMASA_BRATE void ivas_set_surplus_brate_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ -#ifdef DEBUG_VA +#ifdef DEBUG_MODE_INFO , const int16_t *nb_bits_metadata /* i : number of metadata bits */ #endif diff --git a/lib_com/options.h b/lib_com/options.h index d73306ae58..bf239e537c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,7 +165,6 @@ #define MASA_AND_OBJECTS_VE // VA: improve codec print-outs #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo -#define DEBUG_VA // output 'res/brate_ism' and 'res_brate_masa' bit-rates debugging files #endif diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index c4f4b376c6..a55d6bab69 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -200,14 +200,6 @@ ivas_error ivas_core_enc( { ivas_combined_format_brate_sanity( hCPE->element_brate, sts[0]->core, &( sts[0]->core_brate ), &diff_nBits ); } - -#ifdef DEBUG_VA - if ( hCPE != NULL && hCPE->element_mode == IVAS_CPE_DFT ) - { - diff_nBits = max( diff_nBits, 0 ); - dbgwrite( &diff_nBits, 2, 1, 960, "res/_diff" ); - } -#endif #endif /*---------------------------------------------------------------------* diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a9e459bc81..a452b6dbf1 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -378,7 +378,7 @@ ivas_error ivas_enc( st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); /* Configuration of combined-format bit-budget distribution */ -#ifdef DEBUG_VA +#ifdef DEBUG_MODE_INFO ivas_set_surplus_brate_enc( st_ivas, nb_bits_metadata ); #else ivas_set_surplus_brate_enc( st_ivas ); diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index edc2f77cbf..bb2e898af4 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -473,10 +473,6 @@ void ivas_omasa_enc( /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); - -#ifdef DEBUG_VA - dbgwrite( &selected_object, 2, 1, input_frame, "res/selected_object" ); -#endif } /* Downmix */ @@ -564,7 +560,7 @@ void set_ism_importance_interformat( void ivas_set_surplus_brate_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ -#ifdef DEBUG_VA +#ifdef DEBUG_MODE_INFO , const int16_t *nb_bits_metadata /* i : number of metadata bits */ #endif @@ -584,7 +580,7 @@ void ivas_set_surplus_brate_enc( st_ivas->hCPE[0]->brate_surplus = 0; } -#ifdef DEBUG_VA +#ifdef DEBUG_MODE_INFO if ( st_ivas->hSCE[0] != NULL ) { int16_t input_frame = (int16_t) ( st_ivas->hEncoderConfig->input_Fs / FRAMES_PER_SEC ); -- GitLab From 78b6266d59957ac09914d915f3f4599c8dd7872b Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 13:06:12 +0100 Subject: [PATCH 0036/1418] accept MASA_AND_OBJECTS and FIX_24k4_ISM1_MODE --- lib_com/bitstream.c | 4 ++-- lib_com/ivas_omasa_com.c | 10 ---------- lib_com/options.h | 3 +-- lib_dec/lib_dec.c | 4 ++-- lib_enc/lib_enc.c | 4 ---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index b90c6d4ac7..42df9966de 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1812,7 +1812,7 @@ ivas_error preview_indices( else { st_ivas->ivas_format = MASA_FORMAT; -#ifdef MASA_AND_OBJECTS_VE +#ifdef MASA_AND_OBJECTS if ( bit_stream[3] ) { st_ivas->ivas_format = MASA_ISM_FORMAT; @@ -1974,7 +1974,7 @@ ivas_error preview_indices( ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ) ); } -#ifdef MASA_AND_OBJECTS_VE +#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { /* read number of objects from the bitstream */ diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 43f6344daa..46ebcc6e9d 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -74,20 +74,10 @@ ISM_MODE ivas_omasa_ism_mode_select( switch ( no_obj ) { case 1: -#ifdef FIX_24k4_ISM1_MODE if ( ivas_total_brate >= IVAS_24k4 ) -#else - if ( ivas_total_brate >= IVAS_32k ) -#endif { ism_mode = ISM_MASA_MODE_DISC; } -#ifndef FIX_24k4_ISM1_MODE - else if ( ivas_total_brate >= IVAS_24k4 ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } -#endif else { ism_mode = ISM_MODE_NONE; diff --git a/lib_com/options.h b/lib_com/options.h index bf239e537c..9c1f24fd93 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,8 +161,7 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ -#define FIX_24k4_ISM1_MODE // activate DISC mode at 24.4 kbps 1 object -#define MASA_AND_OBJECTS_VE // VA: improve codec print-outs + #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index fab25168be..e0dbdc1a75 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1880,7 +1880,7 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Input configuration: MASA - %d channel(s)\n", st_ivas->nchan_transport ); } -#ifdef MASA_AND_OBJECTS_VE +#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MC_FORMAT ) #else else /* MC_FORMAT */ @@ -1893,7 +1893,7 @@ static ivas_error printConfigInfo_dec( fprintf( stdout, "Input configuration: %s\n", config_str ); } -#ifdef MASA_AND_OBJECTS_VE +#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { fprintf( stdout, "Input configuration: combined ISM and MASA (%i separated ISM stream(s)) \n", st_ivas->nchan_transport ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 3aaddb3c33..f600d0fa91 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1631,11 +1631,7 @@ static ivas_error printConfigInfo_enc( #ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { -#ifdef MASA_AND_OBJECTS_VE fprintf( stdout, "IVAS format: combined ISM and MASA (%i ISM stream(s))\n", hEncoderConfig->nchan_inp - 2 ); -#else - fprintf( stdout, "IVAS format: MASA and objects format\n" ); -#endif } #endif -- GitLab From c2d2b14e5e1d284da22a2f3641494fa524075fd0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 13:10:38 +0100 Subject: [PATCH 0037/1418] merge OMASA_BRATE_TD into OMASA_BRATE --- lib_com/options.h | 11 ++++------- lib_dec/ivas_cpe_dec.c | 4 +--- lib_dec/ivas_stereo_switching_dec.c | 2 +- lib_dec/ivas_stereo_td_dec.c | 20 ++++++++++---------- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_stereo_td_enc.c | 4 ++-- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9c1f24fd93..eae524fed2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,14 +157,11 @@ #define FIX_268 /* Issue 268: Add low cost dry-run of memory analysis */ #define LOW_RATE_TRANS_FIX /* Eri: Fix for critical item during transitions */ -#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ -#ifdef MASA_AND_OBJECTS -#define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ - - -#define OMASA_BRATE /* VA: combined format bit-budget distribution */ -#define OMASA_BRATE_TD // support of bitrate adaptation in TD stereo +#define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ +#ifdef MASA_AND_OBJECTS +#define OMASA_BRATE /* VA: combined format bit-budget distribution */ +#define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 356789d07f..3311e1e501 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -171,7 +171,6 @@ ivas_error ivas_cpe_dec( } else { - #endif stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); #ifdef MASA_AND_OBJECTS @@ -296,7 +295,7 @@ ivas_error ivas_cpe_dec( /* signal bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif if ( st_ivas->hQMetaData != NULL ) @@ -361,7 +360,6 @@ ivas_error ivas_cpe_dec( } } else - { /* subtract metadata bitbudget */ /* IVAS_fmToDo: TBC whether it is not better to distribute the metadata bits equally between 2 channels */ sts[0]->bits_frame_channel -= nb_bits_metadata; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index bed57060a1..eeb53ff011 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -767,7 +767,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hCoreCoder[0]->bfi == 0 ) { st = hCPE->hCoreCoder[1]; -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate + hCPE->brate_surplus, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + ( hCPE->brate_surplus / FRAMES_PER_SEC ) - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); #else hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 2e6e447bd7..0c6fe6213d 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -94,7 +94,7 @@ void tdm_configure_dec( int16_t tdm_tmp_SM_LRTD_flag; int16_t mod_ct, core, bits_offset; int16_t idx_LRTD_pri_side, tdm_inst_ratio_idx; -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE int32_t element_brate_adapt; int16_t bstr_last_pos; #endif @@ -102,7 +102,7 @@ void tdm_configure_dec( hStereoTD = hCPE->hStereoTD; sts = hCPE->hCoreCoder; -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE element_brate_adapt = hCPE->element_brate + hCPE->brate_surplus; bstr_last_pos = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif @@ -132,7 +132,7 @@ void tdm_configure_dec( /* Get few parameters needed to decode the bitrate allocated to each channel */ /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); #else sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING ); @@ -164,7 +164,7 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ /* Get the correlation ratio */ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE *tdm_ratio_idx = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); #else *tdm_ratio_idx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); @@ -174,7 +174,7 @@ void tdm_configure_dec( if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); #else hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); @@ -184,7 +184,7 @@ void tdm_configure_dec( else { /* Get the flag on the LPC reusage */ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); #else hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); @@ -244,7 +244,7 @@ void tdm_configure_dec( int16_t tmpS = 20; if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE tmpS = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); #else tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); @@ -257,7 +257,7 @@ void tdm_configure_dec( { if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS, STEREO_BITS_TCA_CHAN ); hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN, STEREO_BITS_TCA_CORRSTATS ); hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); @@ -285,7 +285,7 @@ void tdm_configure_dec( #endif /* set the BW of the secondary channel */ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel > IVAS_16k4 / FRAMES_PER_SEC ) #else if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 ) @@ -304,7 +304,7 @@ void tdm_configure_dec( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 536272a94c..013e1a2abd 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -396,7 +396,7 @@ ivas_error ivas_cpe_enc( /* signal the bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif if ( st_ivas->hQMetaData != NULL ) diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index c42b2fe748..8a7c10f5f3 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -419,7 +419,7 @@ void tdm_configure_enc( sts[1]->coder_type = GENERIC; } -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) { sts[1]->coder_type = INACTIVE; @@ -469,7 +469,7 @@ void tdm_configure_enc( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef OMASA_BRATE_TD +#ifdef OMASA_BRATE tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, -- GitLab From cfe0a8b7a20c893f841f6a3d07a13d5caec283a4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 26 Jan 2023 13:30:42 +0100 Subject: [PATCH 0038/1418] fix for 64 kbps 2 obj; under OMASA_BRATE --- lib_com/ivas_rom_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 4e2ef7b596..6d8d255aed 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2796,7 +2796,7 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = #endif {IVAS_13k2, 0, 0, 0}, /* 48k */ #ifdef OMASA_BRATE - {16000, 12000, 0, 0}, /* 64k */ + {16000, 11700, 0, 0}, /* 64k */ #else {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif -- GitLab From 5d295d691207e93e0e325e76950c09f708a3d922 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 27 Jan 2023 11:46:50 +0100 Subject: [PATCH 0039/1418] fix compilation when OMASA_BRATE is disabled --- lib_com/ivas_omasa_com.c | 9 ++++----- lib_com/options.h | 2 +- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_enc.c | 18 +++++------------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 46ebcc6e9d..38733ff97e 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -39,7 +39,7 @@ #include "debug.h" #endif - +#ifdef MASA_AND_OBJECTS #ifdef OMASA_BRATE /*--------------------------------------------------------------- * Local constants @@ -53,9 +53,8 @@ #define GAMMA_ISM_LOW_IMP2 0.9f #define GAMMA_ISM_MEDIUM_IMP2 1.2f #define GAMMA_ISM_HIGH_IMP2 1.35f +#endif - -#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() * @@ -141,9 +140,9 @@ ISM_MODE ivas_omasa_ism_mode_select( return ism_mode; } -#endif +#ifdef OMASA_BRATE /*--------------------------------------------------------------- * ivas_interformat_brate() * @@ -267,5 +266,5 @@ void ivas_combined_format_brate_sanity( return; } - +#endif #endif diff --git a/lib_com/options.h b/lib_com/options.h index eae524fed2..a6c9939967 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS -#define OMASA_BRATE /* VA: combined format bit-budget distribution */ +//#define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 013e1a2abd..b4d54d397f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -626,7 +626,7 @@ ivas_error ivas_cpe_enc( if ( ivas_format == MASA_ISM_FORMAT ) { - cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, hEncoderConfig->nchan_ism ); } #endif diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a452b6dbf1..68d0bcb873 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -310,9 +310,6 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS else if ( ivas_format == MASA_ISM_FORMAT ) { -#ifndef OMASA_BRATE - float data_transport_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; -#endif float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; @@ -396,27 +393,22 @@ ivas_error ivas_enc( } else { - st_ivas->nSCE = st_ivas->nchan_ism; + st_ivas->nSCE = hEncoderConfig->nchan_ism; } /* Estimate TF-tile energy for the input MASA stream */ - ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[st_ivas->nchan_ism] ), input_frame, st_ivas->nchan_transport ); + ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport ); /* put audio object data in SCE's */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Estimate MASA parameters for the objects */ - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, data_transport_f, input_frame, st_ivas->nchan_transport, st_ivas->nchan_ism, st_ivas->ism_mode, + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); } /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, st_ivas->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - /* Merge transport signals */ - ivas_merge_masa_transports( data_transport_f, &( data_f[st_ivas->nchan_ism] ), data_f, input_frame, st_ivas->nchan_transport ); - } + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); } /* Encode transport signals */ @@ -432,7 +424,7 @@ ivas_error ivas_enc( { return error; } - n = st_ivas->nchan_ism; + n = hEncoderConfig->nchan_ism; } #endif /* OMASA_BRATE */ -- GitLab From 7514365119a609914da2913f5c4c19d6f4c54562 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 27 Jan 2023 12:22:39 +0100 Subject: [PATCH 0040/1418] fix crash due to too high 'max_bits' for residual coding in DFT stereo --- lib_enc/ivas_cpe_enc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index b4d54d397f..6c33d77650 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -630,6 +630,7 @@ ivas_error ivas_cpe_enc( } #endif + /* DFT stereo side bits */ if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && cpe_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) { nb_bits = 0; /* Only mono downmix is transmitted in this case */ @@ -643,10 +644,19 @@ ivas_error ivas_cpe_enc( stereo_dft_enc_write_BS( hCPE, &nb_bits ); } + /* Residual coding in MDCT domain */ if ( !( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ( sts[0]->core_brate == SID_2k40 || sts[0]->core_brate == FRAME_NO_DATA ) ) ) { - /* Residual coding in MDCT domain */ - stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal - ( ( ivas_format == MASA_FORMAT ) ? nb_bits_metadata : 0 ) ) ); + int16_t max_bits = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal ); + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) + { + max_bits -= nb_bits_metadata; +#ifdef OMASA_BRATE + max_bits += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); +#endif + } + + stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits ); } #else if ( ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) -- GitLab From e2bca22e00c922f277a1c76f9098ac040d1dadd7 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 27 Jan 2023 12:28:03 +0100 Subject: [PATCH 0041/1418] formatting --- lib_com/options.h | 2 +- lib_enc/ivas_masa_enc.c | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a6c9939967..eae524fed2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS -//#define OMASA_BRATE /* VA: combined format bit-budget distribution */ +#define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #endif diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 5fca4c2222..466b422a85 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -61,25 +61,18 @@ static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR #ifdef MASA_AND_OBJECTS static void ivas_merge_masa_metadatas( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); -static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, - IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ - BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - int16_t low_bitrate_mode, /* i: is low bitrate more? 1/0 */ - int16_t omasa_nbands, - int16_t omasa_nblocks - -); +static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], int16_t low_bitrate_mode, int16_t omasa_nbands, int16_t omasa_nblocks ); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); - static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t no_ism, float masa_to_total_energy_ratio ); static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio ); + static void transform_index_and_GR_encode( int16_t *diff_idx, int16_t len, int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); + static void transform_difference_index( int16_t *diff_idx, int16_t *idx, int16_t len ); #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); -- GitLab From d4ded142c6fab96d83cecdd190f64be9c551f0f8 Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 28 Jan 2023 14:38:38 +0100 Subject: [PATCH 0042/1418] add TUNING_96kbps_3obj --- lib_com/ivas_omasa_com.c | 39 ++++++++++++++++++++++++++++----- lib_com/ivas_prot.h | 5 +++-- lib_com/ivas_rom_com.c | 4 ++++ lib_com/options.h | 3 +++ lib_dec/ivas_omasa_dec.c | 4 ++-- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 2 +- lib_enc/ivas_sce_enc.c | 2 +- 9 files changed, 49 insertions(+), 14 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 38733ff97e..7729929c96 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -53,6 +53,10 @@ #define GAMMA_ISM_LOW_IMP2 0.9f #define GAMMA_ISM_MEDIUM_IMP2 1.2f #define GAMMA_ISM_HIGH_IMP2 1.35f + +#define GAMMA_ISM_LOW_IMP3 0.85f +#define GAMMA_ISM_MEDIUM_IMP3 1.15f +#define GAMMA_ISM_HIGH_IMP3 1.3f #endif /*--------------------------------------------------------------- @@ -64,13 +68,13 @@ /*! r : ISM format mode */ ISM_MODE ivas_omasa_ism_mode_select( - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t no_obj /* i : number of objects */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t nchan_ism /* i : number of input ISM's */ ) { ISM_MODE ism_mode = ISM_MODE_NONE; - switch ( no_obj ) + switch ( nchan_ism ) { case 1: if ( ivas_total_brate >= IVAS_24k4 ) @@ -101,7 +105,11 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 3: +#ifdef TUNING_96kbps_3obj + if ( ivas_total_brate >= IVAS_96k ) +#else if ( ivas_total_brate >= IVAS_128k ) +#endif { ism_mode = ISM_MASA_MODE_DISC; } @@ -152,6 +160,7 @@ ISM_MODE ivas_omasa_ism_mode_select( /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( const ISM_MODE ism_mode, /* i : ISM mode */ + const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ ) @@ -168,9 +177,27 @@ int32_t ivas_interformat_brate( } else { - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || - ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 9600 and 1 object */ - ) +#ifdef TUNING_96kbps_3obj + if ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism == 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ + { + if ( ism_imp == ISM_LOW_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP3 ); + } + else if ( ism_imp == ISM_MEDIUM_IMP ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP3 ); + } + else /* ISM_HIGH_IMP */ + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP3 ); + } + } + else +#endif + if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || + ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 24400 and 1 object */ + ) { if ( ism_imp == ISM_LOW_IMP ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 784000dbed..557bb7e01b 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4525,7 +4525,7 @@ void ivas_masa_encode( #ifdef MASA_AND_OBJECTS , const ISM_MODE ism_mode, /* i : ISM format mode */ - const int16_t nchan_ism, /* i : number of ism channels */ + const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ @@ -5223,6 +5223,7 @@ void set_ism_importance_interformat( /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( const ISM_MODE ism_mode, /* i : ISM mode */ + const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ ); @@ -5237,7 +5238,7 @@ void ivas_combined_format_brate_sanity( ISM_MODE ivas_omasa_ism_mode_select( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ - const int16_t no_obj /* i : number of input ISM's */ + const int16_t nchan_ism /* i : number of input ISM's */ ); void ivas_merge_masa_transports( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 7cf193b0fe..bb4b888665 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2801,7 +2801,11 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif {20000, 16000, 0, 0}, /* 80k */ +#ifdef TUNING_96kbps_3obj + {IVAS_32k, 20000, 16000, 0}, /* 96k */ +#else {IVAS_32k, 20000, 0, 0}, /* 96k */ +#endif {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ diff --git a/lib_com/options.h b/lib_com/options.h index 4fb3b2b7e1..28e854a482 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,6 +169,9 @@ #ifdef MASA_AND_OBJECTS #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ + +#define TUNING_96kbps_3obj + #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 133369e94c..fa976ea5d0 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -59,7 +59,7 @@ void ivas_set_surplus_brate_dec( if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - *ism_total_brate = ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + *ism_total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; @@ -90,7 +90,7 @@ void ivas_set_surplus_brate_dec( { st_ivas->hSCE[n]->element_brate = element_brate[n]; - *ism_total_brate += ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); + *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 1ff51395cb..9126db68cb 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -833,7 +833,7 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate = 0; for ( ch = 0; ch < num_obj; ch++ ) { - *ism_total_brate += ivas_interformat_brate( ism_mode, hSCE[ch]->element_brate, ism_imp[ch] ); + *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, num_obj, hSCE[ch]->element_brate, ism_imp[ch] ); } ism_metadata_flag_global = 1; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index e041a9bd9e..2f568fb3a3 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -244,7 +244,7 @@ void ivas_masa_encode( #ifdef MASA_AND_OBJECTS , const ISM_MODE ism_mode, /* i : ISM format mode */ - const int16_t nchan_ism, /* i : number of ism channels */ + const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index bb2e898af4..b2587cd902 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -568,7 +568,7 @@ void ivas_set_surplus_brate_enc( { if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( st_ivas->ism_mode, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); /* note: ISM st->total_brate is iset in ivas_sce_enc() */ } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 1d5959c21a..7da0110a2c 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -220,7 +220,7 @@ ivas_error ivas_sce_enc( { set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); - st->total_brate = ivas_interformat_brate( st_ivas->ism_mode, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; + st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; } #endif -- GitLab From c621abbb2a0d4ae9775c3ed05d87d58af66af075 Mon Sep 17 00:00:00 2001 From: advasila Date: Mon, 30 Jan 2023 13:09:53 +0200 Subject: [PATCH 0043/1418] DISC 3 obj at 96 and DISC 4obj at 128 --- lib_com/ivas_omasa_com.c | 4 ++-- lib_com/ivas_rom_com.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 7729929c96..666fa45e60 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -127,7 +127,7 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 4: - if ( ivas_total_brate >= IVAS_160k ) + if ( ivas_total_brate >= IVAS_128k ) { ism_mode = ISM_MASA_MODE_DISC; } @@ -178,7 +178,7 @@ int32_t ivas_interformat_brate( else { #ifdef TUNING_96kbps_3obj - if ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism == 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ + if ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ { if ( ism_imp == ISM_LOW_IMP ) { diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index bb4b888665..16fa9d2c4d 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2806,7 +2806,7 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = #else {IVAS_32k, 20000, 0, 0}, /* 96k */ #endif - {IVAS_32k, IVAS_24k4, 20000, 0}, /* 128k */ + {IVAS_32k, IVAS_24k4, 20000, 16000}, /* 128k */ {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ -- GitLab From 73d4bc3dc1ebed9d80589a9b6ca5177458309c36 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 13:26:44 +0100 Subject: [PATCH 0044/1418] - add TUNING_48kbps_2obj --- lib_com/ivas_omasa_com.c | 4 ++++ lib_com/ivas_rom_com.c | 38 +++++++++++++++++++++----------------- lib_com/options.h | 1 + 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 666fa45e60..9dfb05bdbe 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -87,7 +87,11 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 2: +#ifdef TUNING_48kbps_2obj + if ( ivas_total_brate >= IVAS_48k ) +#else if ( ivas_total_brate >= IVAS_64k ) +#endif { ism_mode = ISM_MASA_MODE_DISC; } diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 16fa9d2c4d..66f08492f6 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2786,32 +2786,36 @@ const float McMASA_LFEGain_vectors[64] = const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = { - {0, 0, 0, 0}, /* 13k2 */ - {0, 0, 0, 0}, /* 16k4 */ - {9600, 0, 0, 0}, /* 24k4 */ + {0, 0, 0, 0}, /* 13k2 */ + {0, 0, 0, 0}, /* 16k4 */ + {9600, 0, 0, 0}, /* 24k4 */ #ifdef OMASA_BRATE - {11000, 0, 0, 0}, /* 32k */ + {11000, 0, 0, 0}, /* 32k */ #else - {9600, 0, 0, 0}, /* 32k */ + {9600, 0, 0, 0}, /* 32k */ +#endif +#ifdef TUNING_48kbps_2obj + {IVAS_13k2, 9600, 0, 0}, /* 48k */ +#else + {IVAS_13k2, 0, 0, 0}, /* 48k */ #endif - {IVAS_13k2, 0, 0, 0}, /* 48k */ #ifdef OMASA_BRATE - {16000, 11700, 0, 0}, /* 64k */ + {16000, 11700, 0, 0}, /* 64k */ #else - {16000, IVAS_13k2, 0, 0}, /* 64k */ + {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif - {20000, 16000, 0, 0}, /* 80k */ + {20000, 16000, 0, 0}, /* 80k */ #ifdef TUNING_96kbps_3obj - {IVAS_32k, 20000, 16000, 0}, /* 96k */ + {IVAS_32k, 20000, 16000, 0}, /* 96k */ #else - {IVAS_32k, 20000, 0, 0}, /* 96k */ + {IVAS_32k, 20000, 0, 0}, /* 96k */ #endif - {IVAS_32k, IVAS_24k4, 20000, 16000}, /* 128k */ - {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ - {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ - {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ - {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ - {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ + {IVAS_32k, IVAS_24k4, 20000, 16000}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ + {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ + {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ + {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ + {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ }; /* column wise DCT matrices for 4 5, and 8 dim */ diff --git a/lib_com/options.h b/lib_com/options.h index 28e854a482..7ecfb224a3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,7 @@ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define TUNING_96kbps_3obj +#define TUNING_48kbps_2obj #endif -- GitLab From 66176058699af08bacbad30ef74b047fca92ce68 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 13:27:32 +0100 Subject: [PATCH 0045/1418] fix debugging outpu files output.[sce,cpe] --- lib_dec/ivas_cpe_dec.c | 10 +++++++--- lib_dec/ivas_sce_dec.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index c94997536e..ade4764a21 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -583,9 +583,13 @@ ivas_error ivas_cpe_dec( { dbgwrite( output[j], sizeof( float ), output_frame, 1, fname( debug_dir, "output.cpe", j, cpe_id, DEC ) ); } - tmpF = 0; - dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.sce", 0, cpe_id, DEC ) ); - dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, cpe_id, DEC ) ); + + if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) + { + tmpF = 0; + dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.sce", 0, cpe_id, DEC ) ); + dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, cpe_id, DEC ) ); + } } } #endif diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 1ca5e01865..9ae6f59abf 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -309,9 +309,13 @@ ivas_error ivas_sce_dec( dbgwrite( &st->element_mode, sizeof( int16_t ), 1, output_frame, fname( debug_dir, "element_mode", 0, sce_id, DEC ) ); dbgwrite( output, sizeof( float ), output_frame, 1, fname( debug_dir, "output.sce", 0, sce_id, DEC ) ); - tmpF = 0; - dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.cpe", 0, sce_id, DEC ) ); - dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, sce_id, DEC ) ); + + if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) + { + tmpF = 0; + dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.cpe", 0, sce_id, DEC ) ); + dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, sce_id, DEC ) ); + } } } #endif -- GitLab From dccd851103a11300e587b01ff53eb7407f44644e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 13:28:35 +0100 Subject: [PATCH 0046/1418] correct (C) headers in OMASA added files --- lib_com/ivas_omasa_com.c | 2 +- lib_dec/ivas_omasa_dec.c | 2 +- lib_enc/ivas_omasa_enc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 9dfb05bdbe..b5b3e09f3e 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + (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 diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index fa976ea5d0..6e95f0710f 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + (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 diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index b2587cd902..cd2548701a 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -1,6 +1,6 @@ /****************************************************************************************************** - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, + (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 -- GitLab From 086dbba2db06cba86b0e5bcfdafd3c2602247c48 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 13:44:08 +0100 Subject: [PATCH 0047/1418] add 'error' returns --- lib_dec/ivas_dec.c | 6 ++++-- lib_dec/ivas_init_dec.c | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index c1d6ab32c4..0bdbeb2d1b 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -459,9 +459,10 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); } } - if ( st_ivas->nCPE == 1 ) + + if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) { - ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ); + return error; } if ( st_ivas->hCPE[0]->nchan_out == 1 ) @@ -505,6 +506,7 @@ ivas_error ivas_dec( } ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); } else diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index cc5252e02d..4aef38566b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1047,7 +1047,10 @@ ivas_error ivas_init_decoder( } st_ivas->nCPE = 1; - create_cpe_dec( st_ivas, 0, ivas_total_brate - ism_total_brate ); + if ( ( error = create_cpe_dec( st_ivas, 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; + } for ( n = 0; n < CPE_CHANNELS; n++ ) { -- GitLab From 6a83c01b239a65d5047fbb4e35f6a5ef53605a85 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 13:59:34 +0100 Subject: [PATCH 0048/1418] fix merging issue between FIX_197_CREND_INTERFACE into MASA_AND_OBJECTS --- lib_rend/ivas_stat_rend.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 1b6ca5f75b..4db55ba025 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -241,8 +241,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure float ChEneOut[BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float ChCrossReOut[CLDFB_NO_CHANNELS_MAX]; float ChCrossImOut[CLDFB_NO_CHANNELS_MAX]; +#ifdef MASA_AND_OBJECTS + float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; +#else float processMtxRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; /* +1 refers to SeparateChannel */ float processMtxIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; +#endif float processMtxDecRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float diffuseFieldCoherence[CLDFB_NO_CHANNELS_MAX]; @@ -253,8 +258,13 @@ typedef struct ivas_dirac_dec_binaural_data_structure REVERB_STRUCT_HANDLE hReverb; uint8_t renderStereoOutputInsteadOfBinaural; float frameMeanDiffuseness[CLDFB_NO_CHANNELS_MAX]; +#ifdef MASA_AND_OBJECTS + float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; + float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + MAX_NUM_OBJECTS][CLDFB_NO_CHANNELS_MAX]; +#else float processMtxRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; float processMtxImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS + 1][CLDFB_NO_CHANNELS_MAX]; +#endif float processMtxDecRePrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float processMtxDecImPrev[BINAURAL_CHANNELS][BINAURAL_CHANNELS][CLDFB_NO_CHANNELS_MAX]; uint16_t useSubframeMode; /* 0 = process in 20 ms frames, 1 = process in 5 ms subframes */ -- GitLab From 242310b429e5dc4e5a199500a24bf26e3452b9d9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 14:00:40 +0100 Subject: [PATCH 0049/1418] cleaning + formatting --- lib_com/ivas_masa_com.c | 1 - lib_dec/ivas_init_dec.c | 2 -- lib_dec/ivas_masa_dec.c | 1 + 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index c1e8d23656..289bf1e2c6 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -87,7 +87,6 @@ void ivas_masa_set_elements( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) { - *nCPE = 1; if ( *element_mode == -1 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 4aef38566b..e5b51d9451 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1013,7 +1013,6 @@ ivas_error ivas_init_decoder( for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { - temp_brate[sce_id] = sep_object_brate[k - 2][st_ivas->nSCE - 1]; ism_total_brate += temp_brate[sce_id]; @@ -1046,7 +1045,6 @@ ivas_error ivas_init_decoder( ivas_dirac_dec_open( st_ivas ); } - st_ivas->nCPE = 1; if ( ( error = create_cpe_dec( st_ivas, 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index b33b591684..3ffa921385 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -504,6 +504,7 @@ ivas_error ivas_masa_dec_open( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) ); } + #ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -- GitLab From 7433066a75658207401b3b5879bc977e1f4ea514 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 14:10:01 +0100 Subject: [PATCH 0050/1418] cleaning + comments --- lib_dec/ivas_init_dec.c | 10 +++++----- lib_enc/ivas_init_enc.c | 42 +++++++++++++++++------------------------ 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e5b51d9451..8ff3f19fd7 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -915,7 +915,7 @@ ivas_error ivas_init_decoder( } } - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_sce_dec( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK ) { @@ -1116,7 +1116,7 @@ ivas_error ivas_init_decoder( return error; } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nSCE + st_ivas->nCPE ) ) ) != IVAS_ERR_OK ) { @@ -1129,7 +1129,7 @@ ivas_error ivas_init_decoder( } } - if ( st_ivas->nCPE > 1 ) + if ( st_ivas->nCPE > 1 ) // VE: TBV - is this needed? { if ( ( error = create_mct_dec( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1179,7 +1179,7 @@ ivas_error ivas_init_decoder( ivas_mcmasa_split_brate( st_ivas->hOutSetup.separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe ); - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_sce_dec( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK ) { @@ -1189,7 +1189,7 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? { st_ivas->element_mode_init = IVAS_CPE_MDCT; /* element_mode_init was IVAS_SCE for SCE initialization */ if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_cpe ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index d2c6ab278a..4eea31458c 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -506,7 +506,7 @@ ivas_error ivas_init_encoder( } } - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_sce_enc( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK ) { @@ -626,27 +626,20 @@ ivas_error ivas_init_encoder( st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + if ( ( error = create_cpe_enc( st_ivas, 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) { - if ( ( error = create_cpe_enc( st_ivas, cpe_id, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* prepare bitstream buffers */ - for ( n = 0; n < CPE_CHANNELS; n++ ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list[st_ivas->nSCE + cpe_id * CPE_CHANNELS + n]; - reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); - } + return error; + } - /* 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 ); - } + /* prepare bitstream buffers */ + for ( n = 0; n < CPE_CHANNELS; n++ ) + { + st_ivas->hCPE[0]->hCoreCoder[n]->hBstr->ind_list = ind_list[st_ivas->nSCE + n]; + reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } + + st_ivas->hCPE[0]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; + reset_indices_enc( st_ivas->hCPE[0]->hMetaData, MAX_BITS_METADATA ); } #endif else if ( ivas_format == MC_FORMAT ) @@ -654,11 +647,10 @@ ivas_error ivas_init_encoder( st_ivas->mc_mode = ivas_mc_mode_select( hEncoderConfig->mc_input_setup, ivas_total_brate ); hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); - if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->nSCE = 0; - st_ivas->nCPE = hEncoderConfig->nchan_inp / 2; + st_ivas->nCPE = hEncoderConfig->nchan_inp / CPE_CHANNELS; for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { @@ -674,6 +666,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 ); } + /* Metadata only initialized for the last CPE index*/ if ( cpe_id == st_ivas->nCPE - 1 ) { @@ -701,14 +694,13 @@ ivas_error ivas_init_encoder( return error; } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_cpe_enc( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nCPE + st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) { return error; } - /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -755,7 +747,7 @@ ivas_error ivas_init_encoder( ivas_mcmasa_split_brate( st_ivas->hMcMasa->separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe ); - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? { if ( ( error = create_sce_enc( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK ) { @@ -770,7 +762,7 @@ ivas_error ivas_init_encoder( reset_indices_enc( st_ivas->hSCE[sce_id]->hMetaData, MAX_BITS_METADATA ); } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; -- GitLab From 8f9cb78d270a4b4f6563b16cadeb4d63b3f5d518 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 17:23:39 +0100 Subject: [PATCH 0051/1418] tuning within TUNING_48kbps_2obj --- lib_com/ivas_omasa_com.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index b5b3e09f3e..fd09a8adda 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -182,7 +182,11 @@ int32_t ivas_interformat_brate( else { #ifdef TUNING_96kbps_3obj - if ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ + if ( ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ +#ifdef TUNING_48kbps_2obj + || ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism == 2 && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 48000 and 2 objects */ +#endif + ) { if ( ism_imp == ISM_LOW_IMP ) { -- GitLab From ac2065bc7e5fb107aa1e75f09d82886c3576194d Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 30 Jan 2023 17:25:37 +0100 Subject: [PATCH 0052/1418] correction of one comment --- lib_com/ivas_omasa_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index fd09a8adda..ff81d8ccd6 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -182,7 +182,7 @@ int32_t ivas_interformat_brate( else { #ifdef TUNING_96kbps_3obj - if ( ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ + if ( ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects and 128 kbps and 4 objects */ #ifdef TUNING_48kbps_2obj || ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism == 2 && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 48000 and 2 objects */ #endif -- GitLab From b86192005e8e305f7041a28d91e5f563c062a96c Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Mon, 27 Feb 2023 11:41:29 +0200 Subject: [PATCH 0053/1418] Diffuseness-preserving MASA and ISM metadata merge in low-bitrate OMASA. OMASA metadata bitrate reduction and allocation update. --- lib_com/ivas_masa_com.c | 6 + lib_com/ivas_omasa_com.c | 127 +++++- lib_com/ivas_prot.h | 34 ++ lib_com/ivas_rom_com.c | 8 +- lib_com/ivas_stat_com.h | 11 + lib_com/options.h | 8 +- lib_dec/ivas_cpe_dec.c | 2 +- lib_dec/ivas_masa_dec.c | 393 +++++++++++++++-- lib_enc/ivas_cpe_enc.c | 5 +- lib_enc/ivas_enc.c | 28 +- lib_enc/ivas_ism_enc.c | 5 +- lib_enc/ivas_masa_enc.c | 925 ++++++++++++++++++++++++++++++++++++--- lib_enc/ivas_omasa_enc.c | 106 ++++- 13 files changed, 1549 insertions(+), 109 deletions(-) diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 289bf1e2c6..44d316ed88 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -493,6 +493,12 @@ void reconstruct_ism_ratios( } q_energy_ratio_ism[n_ism - 1] = 1.0f - sum; +#ifdef REDUCE_OMASA_META_BITS + if ( q_energy_ratio_ism[n_ism - 1] < 0 ) + { + q_energy_ratio_ism[n_ism - 1] = 0.0f; + } +#endif return; } diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index ff81d8ccd6..f825b41252 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -35,6 +35,9 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" +#ifdef REDUCE_OMASA_META_BITS +#include "ivas_rom_com.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -57,6 +60,11 @@ #define GAMMA_ISM_LOW_IMP3 0.85f #define GAMMA_ISM_MEDIUM_IMP3 1.15f #define GAMMA_ISM_HIGH_IMP3 1.3f +#ifdef TUNING_DISC_3_4obj +#define GAMMA_ISM_LOW_IMP4 0.6f +#define GAMMA_ISM_MEDIUM_IMP4 0.8f +#define GAMMA_ISM_HIGH_IMP4 1.0f +#endif #endif /*--------------------------------------------------------------- @@ -99,17 +107,13 @@ ISM_MODE ivas_omasa_ism_mode_select( { ism_mode = ISM_MASA_MODE_ONE_OBJ; } - /* else if ( ivas_total_brate >= IVAS_32k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } */ else { ism_mode = ISM_MODE_NONE; } break; case 3: -#ifdef TUNING_96kbps_3obj +#ifdef TUNING_DISC_3_4obj if ( ivas_total_brate >= IVAS_96k ) #else if ( ivas_total_brate >= IVAS_128k ) @@ -131,7 +135,11 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 4: + #ifdef TUNING_DISC_3_4obj if ( ivas_total_brate >= IVAS_128k ) +#else + if ( ivas_total_brate >= IVAS_160k ) + #endif { ism_mode = ISM_MASA_MODE_DISC; } @@ -181,24 +189,20 @@ int32_t ivas_interformat_brate( } else { -#ifdef TUNING_96kbps_3obj - if ( ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism >= 3 && element_brate == 16000 ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects and 128 kbps and 4 objects */ -#ifdef TUNING_48kbps_2obj - || ( ism_mode == ISM_MASA_MODE_DISC && nchan_ism == 2 && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 48000 and 2 objects */ -#endif - ) +#ifdef TUNING_DISC_3_4obj + if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) ) ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ { if ( ism_imp == ISM_LOW_IMP ) { - nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP3 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP4 ); } else if ( ism_imp == ISM_MEDIUM_IMP ) { - nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP3 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP4 ); } else /* ISM_HIGH_IMP */ { - nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP3 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP4 ); } } else @@ -209,15 +213,15 @@ int32_t ivas_interformat_brate( { if ( ism_imp == ISM_LOW_IMP ) { - nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP2 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP3 ); } else if ( ism_imp == ISM_MEDIUM_IMP ) { - nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP2 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP3 ); } else /* ISM_HIGH_IMP */ { - nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP2 ); + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP3 ); } } else @@ -302,4 +306,93 @@ void ivas_combined_format_brate_sanity( return; } #endif + +#ifdef REDUCE_OMASA_META_BITS +int16_t bits_index_ism_ratio( + int16_t no_ism +) +{ + int16_t bits_index; + + bits_index = 0; + if ( no_ism == 2 ) + { + bits_index = 3; + } + else if ( no_ism == 3 ) + { + bits_index = 6; + } + else if ( no_ism == 4 ) + { + bits_index = 7; + } + else + { + assert( ( no_ism >= 2 && no_ism <= 4 ) && "Wrong number of objects for MASA_ISM." ); + } + return bits_index; +} +#endif + +#ifdef REDUCE_OMASA_META_BITS +void calculate_nbits_meta( + int16_t n_ism, + float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + int16_t numSf, + int16_t numCodingBands, + int16_t *bits_ism, + int16_t idx_sep_obj, + int16_t ism_imp +) +{ + int16_t sf, band, obj; + float priority[MAX_NUM_OBJECTS], max_p; + + + if ( n_ism > 1 ) + { + set_f( priority, 0.0f, n_ism ); + for ( sf = 0; sf < numSf; sf++ ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + for ( obj = 0; obj < n_ism; obj++ ) + { + priority[obj] = max( priority[obj], ( q_energy_ratio_ism[sf][band][obj] * ( 1 - masa_to_total_energy_ratio[sf][band] ) ) ); + } + } + } + } + else + { + priority[0] = 1; + } + + + /* decide parameters for ISM metadata quantization */ + maximum( priority, n_ism, &max_p ); + for ( obj = 0; obj < n_ism; obj++ ) + { + if ( obj == idx_sep_obj ) + { + if ( ism_imp == 3 ) + { + priority[obj] = 1; + } + else if ( ism_imp == 2 ) + { + priority[obj] = ( 1 + max_p ) * 0.5f; + } + else + { + priority[obj] = max_p; + } + } + bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); + } + return; +} +#endif #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 557bb7e01b..4e700a7abe 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4529,6 +4529,10 @@ void ivas_masa_encode( ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ +#ifdef REDUCE_OMASA_META_BITS + , + int16_t ism_imp /* i: importance of separated object */ +#endif #endif ); @@ -4604,6 +4608,32 @@ int32_t calculate_cpe_brate_MASA_ISM( const int32_t ivas_total_brate, /* i : total bit rate for IVAS */ const int16_t n_ism /* i : number of objects */ ); +#ifdef OMASA_DIFFUSE_ISM_MERGE +void ivas_merge_masa_metadatas( + MASA_ENCODER_HANDLE hMasa, /* i/o: MASA enc handle. source for MASA metadata and combined metadata will be here */ + OMASA_SPATIAL_META_HANDLE hMasaMeta /* i: ISM-object metadata to be merged with the MASA metadata */ +); +void ivas_masa_combine_directions( + MASA_ENCODER_HANDLE hMasa /* i/o: MASA encoder handle */ +); +#endif /* OMASA_DIFFUSE_ISM_MERGE */ + +#ifdef REDUCE_OMASA_META_BITS +int16_t bits_index_ism_ratio( /* o : number of bits for ISM ratio index */ + int16_t no_ism /* i : number of objects */ +); + +void calculate_nbits_meta( + int16_t n_ism, + float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], + int16_t numSf, + int16_t numCodingBands, + int16_t* bits_ism, + int16_t idx_sep_obj, + int16_t ism_imp +); +#endif #endif void ivas_masa_set_coding_config( @@ -5181,6 +5211,10 @@ void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs /* i : Input sample rate */ +#ifdef OMASA_DIFFUSE_ISM_MERGE + , + ISM_MODE ismMode /* i : ISM mode */ +#endif ); void ivas_omasa_enc( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 66f08492f6..ec2b6c5b93 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2805,12 +2805,16 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {16000, IVAS_13k2, 0, 0}, /* 64k */ #endif {20000, 16000, 0, 0}, /* 80k */ -#ifdef TUNING_96kbps_3obj - {IVAS_32k, 20000, 16000, 0}, /* 96k */ +#ifdef TUNING_DISC_3_4obj + {IVAS_32k, 20000, 20000, 0}, /* 96k */ #else {IVAS_32k, 20000, 0, 0}, /* 96k */ #endif +#ifdef TUNING_DISC_3_4obj + {IVAS_32k, IVAS_24k4, 20000, 24000}, /* 128k */ +#else {IVAS_32k, IVAS_24k4, 20000, 16000}, /* 128k */ +#endif {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 9966630d43..d0a79ed586 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -419,6 +419,17 @@ typedef struct ivas_masa_common_spatial_meta_struct } MASA_COMMON_SPATIAL_META; +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE +typedef struct ivas_omasa_meta_struct +{ + uint8_t num_dirs; + MASA_DIRECTIONAL_SPATIAL_META directional_meta[MASA_MAXIMUM_DIRECTIONS]; + MASA_COMMON_SPATIAL_META common_meta; +} OMASA_SPATIAL_META, *OMASA_SPATIAL_META_HANDLE; +#endif +#endif + typedef struct ivas_masa_metadata_frame_struct { MASA_DECRIPTIVE_META descriptive_meta; diff --git a/lib_com/options.h b/lib_com/options.h index 7ecfb224a3..92cbca2b9f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,10 +170,14 @@ #define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ -#define TUNING_96kbps_3obj + #define TUNING_48kbps_2obj -#endif +#define TUNING_DISC_3_4obj /* Nokia: increase bitrate for objects in DISC mode at 128k 4obj and 96k 3 obj */ +#define REDUCE_OMASA_META_BITS /* Nokia: reduce metadata number of bits and fix directional metadata bit allocation */ +#define OMASA_DIFFUSE_ISM_MERGE /* Nokia: Diffuse-energy retaining merging of ISM and MASA */ + +#endif /* MASA_AND_OBJECTS */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index ade4764a21..c2f3aa7ed9 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -176,6 +176,7 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS } #endif + } else { @@ -370,7 +371,6 @@ ivas_error ivas_cpe_dec( /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ - for ( n = 0; n < n_channels; n++ ) { /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 3ffa921385..6ac0c3d63f 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -71,9 +71,24 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS -static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos ); +static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object, int16_t ism_imp +#endif +); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, int16_t no_ism, int16_t K ); -static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t n_ism, int16_t nbands, int16_t nblocks ); +static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t n_ism, int16_t nbands, int16_t nblocks +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object +#endif +); +#endif +#ifdef REDUCE_OMASA_META_BITS +static void read_ism_ratio_index(int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, + int16_t idx_sep_obj, int16_t *num_zeros ); #endif /*-----------------------------------------------------------------------* @@ -100,6 +115,9 @@ ivas_error ivas_masa_decode( int16_t obj; #ifdef OMASA_BRATE int16_t i, ch, ism_imp; +#ifdef REDUCE_OMASA_META_BITS + ism_imp = 0; +#endif #endif #endif @@ -170,6 +188,12 @@ ivas_error ivas_masa_decode( st_ivas->hMasaIsmData->idx_separated_ism = 2 * byteBuffer + st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read )++; } +#ifdef REDUCE_OMASA_META_BITS + else + { + st_ivas->hMasaIsmData->idx_separated_ism = -1; + } +#endif #ifdef OMASA_BRATE /* read ISM importance flag (one per object) */ @@ -276,7 +300,12 @@ ivas_error ivas_masa_decode( { if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { - *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos ); + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos +#ifdef REDUCE_OMASA_META_BITS + , + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp +#endif + ); } if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) @@ -293,7 +322,6 @@ ivas_error ivas_masa_decode( } #endif - *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos ); #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) @@ -1635,11 +1663,11 @@ static void compute_foa_cov_matrix( #ifdef MASA_AND_OBJECTS -static void decode_index_slice( - int16_t index, - int16_t *ratio_idx_ism, - int16_t no_ism, - int16_t K ) +static void decode_index_slice( + int16_t index, /* i: index to decode */ + int16_t *ratio_idx_ism, /* o: decodec array of integers */ + int16_t no_ism, /* i: number of elements in array (objects) */ + int16_t K ) /* i: sum of array elements */ { int16_t i, j, sum, elem; int16_t base[MAX_NUM_OBJECTS]; @@ -1684,6 +1712,273 @@ static void decode_index_slice( } } +#ifdef REDUCE_OMASA_META_BITS +static void read_ism_ratio_index( + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o: ISM read ratio indexes */ + int16_t no_ism, /* i: number of objects */ + int16_t numCodingBands, /* i: number of subbands */ + int16_t sf, /* i: index of subframe */ + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* i: previous subframe ISM ratio indexes */ + uint16_t *bit_stream, /* i: bitstream */ + int16_t *next_bit_pos, /* i/o: position in bitstream */ + float *masa_to_total_energy_ratio, /* i: masa to total ratios */ + int16_t idx_sep_obj, /* i: index of separated index, -1 if none*/ + int16_t *num_zeros /* i/o: number of zero values in first subframe for separated object */ +) +{ + int16_t b, i, b_signif; + int16_t index; + int16_t GR_order, differential_subframe; + int16_t buf; + int16_t no_levels_ratio_ism; + int16_t bits_index; + int16_t ratio_ism_idx_ref[MAX_NUM_OBJECTS]; + int16_t idx_sep_obj_local, shift_one; + idx_sep_obj_local = idx_sep_obj; + if ( idx_sep_obj > -1 ) + { + if ( idx_sep_obj == no_ism - 1 && no_ism > 2) + { + idx_sep_obj_local = 0; + } + } + b_signif = 0; + no_levels_ratio_ism = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); + while ( b_signif < numCodingBands && masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR ) + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b_signif], no_levels_ratio_ism, no_ism ); + b_signif++; + } + if ( b_signif == numCodingBands ) + { + return; + } + else + { + + if ( sf == 0 ) + { + bits_index = bits_index_ism_ratio( no_ism ); + + /* read coding type */ + if ( bit_stream[( *next_bit_pos )--] == 1 ) + { + /* independent coding*/ + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = 0; + for ( i = 0; i < bits_index; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); + if ( idx_sep_obj > -1 && ratio_ism_idx[b][idx_sep_obj_local] == 0 ) + { + (*num_zeros)++; + } + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + } + else + { + /* differential coding */ + index = 0; + for ( i = 0; i < bits_index; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + decode_index_slice( index, ratio_ism_idx[b_signif], no_ism, no_levels_ratio_ism ); + if ( idx_sep_obj > -1 && ratio_ism_idx[b_signif][idx_sep_obj_local] == 0 ) + { + ( *num_zeros )++; + } + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism ); + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; + for ( i = 0; i < no_ism - 1; i++ ) + { + buf = ivas_qmetadata_DecodeExtendedGR( bit_stream, next_bit_pos, 100, 0 ); + if ( ( buf % 2 ) == 0 ) + { + ratio_ism_idx[b][i] = -( buf >> 1 ); + } + else + { + ratio_ism_idx[b][i] = ( ( buf + 1 ) >> 1 ); + } + ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx_ref[i]; + ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; + } + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism ); + if ( idx_sep_obj > -1 && ratio_ism_idx[b][idx_sep_obj_local] == 0 ) + { + ( *num_zeros )++; + } + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + } + } + else + { + if ( numCodingBands > 1 ) + { + /* read prediction type */ + differential_subframe = bit_stream[( *next_bit_pos )--]; + } + else + { + differential_subframe = 1; + } + + if ( *num_zeros == numCodingBands ) + { + shift_one = 1; + } + else + { + shift_one = 0; + } + if ( shift_one == 1 && no_ism == 2 ) + { + /* nothing has been sent ; values can be inferred */ + for ( b = b_signif; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + if ( idx_sep_obj_local == 0 ) + { + ratio_ism_idx[b][0] = 0; + ratio_ism_idx[b][1] = 7; + } + else + { + ratio_ism_idx[b][0] = 7; + ratio_ism_idx[b][1] = 0; + } + } + } + } + else + { + /* read GR order */ + GR_order = bit_stream[( *next_bit_pos )--]; + for ( b = b_signif; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + for ( i = 0; i < no_ism - 1 - shift_one; i++ ) + { + buf = ivas_qmetadata_DecodeExtendedGR( bit_stream, next_bit_pos, 100, GR_order ); + if ( ( buf % 2 ) == 0 ) + { + ratio_ism_idx[b][i] = -( buf >> 1 ); + } + else + { + ratio_ism_idx[b][i] = ( ( buf + 1 ) >> 1 ); + } + } + /* insert separated obj */ + if ( shift_one ) + { + for ( i = no_ism - 1; i > idx_sep_obj_local; i-- ) + { + ratio_ism_idx[b][i] = ratio_ism_idx[b][i - 1]; + } + ratio_ism_idx[b][idx_sep_obj_local] = 0; /* this is only difference; need to pdate later as well */ + } + } + } + if ( differential_subframe ) + { + /* differential to previous subframe */ + for ( b = b_signif; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx_prev_sf[b][i]; + if ( shift_one && i == idx_sep_obj_local ) + { + ratio_ism_idx[b][i] = 0; + } + ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; + } + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + } + else + { + /* difference to previous subband */ + ratio_ism_idx[b_signif][no_ism - 1] = no_levels_ratio_ism; + + /* first significant subband - differential to previous subframe */ + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[b_signif][i] = ratio_ism_idx[b_signif][i] + ratio_ism_idx_prev_sf[b_signif][i]; + if ( shift_one && i == idx_sep_obj_local ) + { + ratio_ism_idx[b_signif][i] = 0; + } + ratio_ism_idx[b_signif][no_ism - 1] -= ratio_ism_idx[b_signif][i]; + } + /* rest of subbands differential to previous subband */ + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism ); + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; + for ( i = 0; i < no_ism - 1; i++ ) + { + ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx_ref[i]; + if ( shift_one && i == idx_sep_obj_local ) + { + ratio_ism_idx[b][i] = 0; + } + ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; + } + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism ); + } + else + { + /* distribute evenly the objects */ + distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); + } + } + } + } + } + + return; + } +} + + +#else static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, @@ -1846,26 +2141,40 @@ static void read_ism_ratio_index( return; } - +#endif static void decode_ism_ratios( - uint16_t *bit_stream, - int16_t *next_bit_pos, - IVAS_QMETADATA_HANDLE hQMetaData, - float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - int16_t n_ism, - int16_t nbands, - int16_t numSf ) + uint16_t *bit_stream, /* i: bitstream */ + int16_t *next_bit_pos, /* i/o: position in bitstream */ + IVAS_QMETADATA_HANDLE hQMetaData, /* i: Metadata handle */ + float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o: ISM ratios */ + int16_t n_ism, /* i: number of objects */ + int16_t nbands, /* i: number of subbands */ + int16_t numSf /* i: number of subframes */ +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object /* i: index of separated object */ +#endif +) { int16_t sf, band; int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; - - +#ifdef REDUCE_OMASA_META_BITS + float tmp; + int16_t num_zeros; + num_zeros = 0; +#endif /* hQMetaData->q_direction->cfg.nblocks; */ for ( sf = 0; sf < numSf; sf++ ) { /* read ism ratio indexes */ - read_ism_ratio_index( ratio_ism_idx, n_ism, nbands, sf, ratio_ism_idx_prev_sf, bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio[sf] ); + read_ism_ratio_index( ratio_ism_idx, n_ism, nbands, sf, ratio_ism_idx_prev_sf, bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio[sf] +#ifdef REDUCE_OMASA_META_BITS + , + idx_separated_object, + &num_zeros +#endif + ); /* save previous subframe index values */ if ( sf < numSf - 1 ) @@ -1882,7 +2191,21 @@ static void decode_ism_ratios( { reconstruct_ism_ratios( ratio_ism_idx[band], n_ism, 1.0f / (float) ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ), ratio_ism[sf][band] ); } - +#ifdef REDUCE_OMASA_META_BITS + if ( ( n_ism > 2 ) && ( idx_separated_object == n_ism - 1 ) ) + { + /* rotate */ + for ( band = 0; band < nbands; band++ ) + { + if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) + { + tmp = ratio_ism[sf][band][n_ism - 1]; + ratio_ism[sf][band][n_ism - 1] = ratio_ism[sf][band][0]; + ratio_ism[sf][band][0] = tmp; + } + } + } +#endif if ( nbands == 1 ) { for ( band = 1; band < 5; band++ ) @@ -1912,14 +2235,22 @@ static int16_t ivas_decode_masaism_metadata( MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, - int16_t *next_bit_pos ) + int16_t *next_bit_pos +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object, + int16_t ism_imp +#endif +) { int16_t sf, band, dir, nbands, nblocks, obj, i; float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t *band_mapping; int16_t b; +#ifndef REDUCE_OMASA_META_BITS float priority[MAX_NUM_OBJECTS]; +#endif int16_t bits_ism[MAX_NUM_OBJECTS], index; uint16_t idx_el, idx_az; float azimuth, elevation; @@ -1935,8 +2266,13 @@ static int16_t ivas_decode_masaism_metadata( if ( nchan_ism > 1 ) { /* read ISM ratios */ - decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism, nbands, nblocks ); - + decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism, nbands, nblocks +#ifdef REDUCE_OMASA_META_BITS + , + idx_separated_object +#endif + ); +#ifndef REDUCE_OMASA_META_BITS /* calculate priority */ set_f( priority, 0.0f, nchan_ism ); for ( sf = 0; sf < nblocks; sf++ ) @@ -1949,6 +2285,7 @@ static int16_t ivas_decode_masaism_metadata( } } } +#endif } else { @@ -1959,15 +2296,21 @@ static int16_t ivas_decode_masaism_metadata( energy_ratio_ism[sf][band][0] = 1.0f; } } +#ifndef REDUCE_OMASA_META_BITS priority[0] = 1; +#endif } /* read ISM metadata */ +#ifdef REDUCE_OMASA_META_BITS + calculate_nbits_meta( nchan_ism, energy_ratio_ism, hQMetaData->masa_to_total_energy_ratio, nblocks, nbands, bits_ism, idx_separated_object, ism_imp ); + +#else for ( obj = 0; obj < nchan_ism; obj++ ) { bits_ism[obj] = 11 - (int16_t) ( ( 1 - priority[obj] ) * 7 ); } - +#endif for ( obj = 0; obj < nchan_ism; obj++ ) { index = 0; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 429d5dac0b..6cd3c43327 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -266,6 +266,7 @@ ivas_error ivas_cpe_enc( sts[n]->element_mode = hCPE->element_mode; } + if ( hCPE->element_mode != IVAS_CPE_MDCT && ( hCPE->element_brate != hCPE->last_element_brate || hCPE->last_element_mode != hCPE->element_mode || sts[0]->ini_frame == 0 || sts[0]->last_core_brate <= SID_2k40 ) ) /* If the last frame was SID or NO_DATA, we need to run stereo_dft_config here since VAD decision is not known yet */ { @@ -274,7 +275,7 @@ ivas_error ivas_cpe_enc( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) { - stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.7f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); + stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.70f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else { @@ -291,6 +292,7 @@ ivas_error ivas_cpe_enc( stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, hCPE->element_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } } + if ( hCPE->element_mode == IVAS_CPE_TD ) { if ( hCPE->hStereoTD->tdm_LRTD_flag ) @@ -702,6 +704,7 @@ ivas_error ivas_cpe_enc( #endif } + /*----------------------------------------------------------------* * Core Encoder *----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 7e94041393..c0bf3caa93 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -267,6 +267,10 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS , ISM_MODE_NONE, -1, NULL, -1, NULL +#ifdef REDUCE_OMASA_META_BITS + , + 0 +#endif #endif ); } @@ -338,7 +342,12 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs ); + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs +#ifdef OMASA_DIFFUSE_ISM_MERGE + , + st_ivas->ism_mode +#endif + ); } /* Estimate TF-tile energy for the input MASA stream */ @@ -372,7 +381,11 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa +#ifdef REDUCE_OMASA_META_BITS + ,st_ivas->hIsmMetaData[0]->ism_imp +#endif + ); /* Configuration of combined-format bit-budget distribution */ #ifdef DEBUG_MODE_INFO @@ -389,7 +402,12 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs ); + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, +#ifdef OMASA_DIFFUSE_ISM_MERGE + , + st_ivas->ism_mode +#endif + ); } else { @@ -489,6 +507,10 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS , ISM_MODE_NONE, -1, NULL, -1, NULL +#ifdef REDUCE_OMASA_META_BITS + , + 0 +#endif #endif ); diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 8626d9e050..f18e87d9be 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -222,6 +222,9 @@ ivas_error ivas_ism_enc( else /* ISM_MODE_DISC */ { #ifdef MASA_AND_OBJECTS +#ifdef OMASA_BRATE + int32_t ism_total_brate_ref; +#endif int32_t ism_total_brate; if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -237,7 +240,7 @@ ivas_error ivas_ism_enc( } #ifdef OMASA_BRATE - int32_t ism_total_brate_ref = ism_total_brate; + ism_total_brate_ref = ism_total_brate; // VE: change the interface of the following function and call it with 'st_ivas' only ivas_ism_metadata_enc( &ism_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, st_ivas->nSCE, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 2f568fb3a3..59b76cdd7c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -45,8 +45,11 @@ *-----------------------------------------------------------------------*/ static void combine_freqbands_and_subframes( MASA_ENCODER_HANDLE hMasa ); - +#ifdef MASA_AND_OBJECTS +#ifndef OMASA_DIFFUSE_ISM_MERGE static void combine_directions( MASA_ENCODER_HANDLE hMasa ); +#endif +#endif static void find_n_largest( const float *input, int16_t *largestIndices, const int16_t numElements, const int16_t numLargest ); @@ -59,21 +62,47 @@ static void compensate_energy_ratios( MASA_ENCODER_HANDLE hMasa ); static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate ); #ifdef MASA_AND_OBJECTS +#ifndef OMASA_DIFFUSE_ISM_MERGE static void ivas_merge_masa_metadatas( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); +#endif -static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], int16_t low_bitrate_mode, int16_t omasa_nbands, int16_t omasa_nblocks ); +static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], int16_t low_bitrate_mode, int16_t omasa_nbands, int16_t omasa_nblocks +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object +#endif +#ifdef REDUCE_OMASA_META_BITS + , + int16_t ism_imp +#endif +); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); -static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t no_ism, float masa_to_total_energy_ratio ); +static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t no_ism, float masa_to_total_energy_ratio +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_sep_object +#endif +); static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); -static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio ); +static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], int16_t no_ism, int16_t numCodingBands, int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio +#ifdef REDUCE_OMASA_META_BITS + , int16_t shift_one, int16_t idx_sep_obj +#endif +); static void transform_index_and_GR_encode( int16_t *diff_idx, int16_t len, int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); static void transform_difference_index( int16_t *diff_idx, int16_t *idx, int16_t len ); +#ifdef REDUCE_OMASA_META_BITS +static void independent_coding_ratio_ism_idx( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const float *masa_to_total_energy_ratio, + int16_t no_ism, int16_t numCodingBands, int16_t bits_index, BSTR_ENC_HANDLE hMetaData ); + +static void remove_sep_obj( int16_t *diff_idx, int16_t no_ism, int16_t idx_sep_obj ); +#endif #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif @@ -248,6 +277,10 @@ void ivas_masa_encode( ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ +#ifdef REDUCE_OMASA_META_BITS + , + int16_t ism_imp /* i: importance of separated object */ +#endif #endif ) { @@ -307,9 +340,21 @@ void ivas_masa_encode( if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ivas_format == MASA_FORMAT ) #endif { +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE + if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) || ( ivas_format != MASA_ISM_FORMAT ) ) + { + /* Combine directions */ + ivas_masa_combine_directions( hMasa ); + } +#else /* Combine directions */ combine_directions( hMasa ); - +#endif +#else + /* Combine directions */ + combine_directions( hMasa ); +#endif /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) { @@ -401,7 +446,11 @@ void ivas_masa_encode( /* Move data from encoder to qmetadata */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) +#endif #else if ( ivas_format == MASA_FORMAT ) #endif @@ -409,10 +458,12 @@ void ivas_masa_encode( move_metadata_to_qmetadata( hMasa, hQMetaData ); } #ifdef MASA_AND_OBJECTS +#ifndef OMASA_DIFFUSE_ISM_MERGE else if ( ivas_format == MASA_ISM_FORMAT ) { ivas_merge_masa_metadatas( hMasa, hQMetaData ); } +#endif #endif if ( hMasa->config.max_metadata_bits < MINIMUM_BIT_BUDGET_NORMAL_META && !hMasa->config.joinedSubframes ) @@ -433,7 +484,15 @@ void ivas_masa_encode( if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) { /* encode MASA/ISM energy ratios */ - ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes ); + ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes +#ifdef REDUCE_OMASA_META_BITS + , idx_separated_object +#endif +#ifdef REDUCE_OMASA_META_BITS + , + ism_imp +#endif + ); } else { @@ -441,7 +500,6 @@ void ivas_masa_encode( } #endif /* Encode metadata */ - ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); #ifdef MASA_AND_OBJECTS @@ -485,8 +543,15 @@ void ivas_masa_encode( if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands ) { /* Combine directions */ +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE + ivas_masa_combine_directions( hMasa ); +#else combine_directions( hMasa ); - +#endif +#else + combine_directions( hMasa ); +#endif /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) { @@ -1021,8 +1086,15 @@ static void combine_freqbands_and_subframes( return; } - +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE +void ivas_masa_combine_directions( +#else static void combine_directions( +#endif +#else +static void combine_directions( +#endif MASA_ENCODER_HANDLE hMasa ) { int16_t i, j, k; @@ -1138,7 +1210,11 @@ static void combine_directions( ambience2dir = 1.0f - ratioSum; hMeta->directional_meta[0].energy_ratio[j][i] = sumVecLen[j][i] / ( hMeta->directional_meta[0].energy_ratio[j][i] + hMeta->directional_meta[1].energy_ratio[j][i] + ambience2dir / 2.0f ); - +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE + hMeta->directional_meta[1].energy_ratio[j][i] = 0.0f; +#endif /* OMASA_DIFFUSE_ISM_MERGE */ +#endif /* MASA_AND_OBJECTS */ if ( computeCoherence ) { ambience1dir = 1.0f - hMeta->directional_meta[0].energy_ratio[j][i]; @@ -1969,16 +2045,30 @@ void ivas_masa_enc_reconfigure( } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_DIFFUSE_ISM_MERGE +void ivas_merge_masa_metadatas( + MASA_ENCODER_HANDLE hMasa, + OMASA_SPATIAL_META_HANDLE hOMasaMeta +#else static void ivas_merge_masa_metadatas( MASA_ENCODER_HANDLE hMasa, - IVAS_QMETADATA_HANDLE hQMeta ) + IVAS_QMETADATA_HANDLE hQMeta +#endif /* OMASA_DIFFUSE_ISM_MERGE */ +) { int16_t sf, band; uint8_t numCodingBands; uint8_t numDirections; uint8_t numSf; MASA_METADATA_HANDLE hMeta; +#ifdef OMASA_DIFFUSE_ISM_MERGE + float energyTimesRatioISM; + float energyTimesRatioMASA[2]; + float total_diff_nrg; +#else float energyTimesRatio1, energyTimesRatio2; +#endif /* OMASA_DIFFUSE_ISM_MERGE */ + int16_t brange[2]; float eneBand; float energyMerged[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; @@ -1989,14 +2079,33 @@ static void ivas_merge_masa_metadatas( numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; hMeta = &( hMasa->masaMetadata ); +#ifndef OMASA_DIFFUSE_ISM_MERGE assert( numDirections == 1 && "MASA metadata merging currently implemented only for 1-direction metadata" ); /* Currently only 1-direction metadata is fed to merging */ +#endif for ( sf = 0; sf < numSf; sf++ ) { for ( band = 0; band < numCodingBands; band++ ) { +#ifdef OMASA_DIFFUSE_ISM_MERGE + int16_t merge_dest; + float dir_sum; + uint8_t band_n_dirs; + brange[0] = band; + brange[1] = band + 1; + /* TODO: if this stays, remove the unnecessary range loop from the code */ + if ( numDirections == 1 || ( numDirections == 2 && hMasa->data.twoDirBands[band] == 0 ) ) + { + band_n_dirs = 1; + } + else + { + band_n_dirs = 2; + } +#else brange[0] = hMasa->data.band_mapping[band]; brange[1] = hMasa->data.band_mapping[band + 1]; +#endif /* OMASA_DIFFUSE_ISM_MERGE */ /* Compute energies */ /* MASA energy is in the full 24 band resolution, whereas the ISM energy is already in the coding band resolution */ @@ -2008,6 +2117,66 @@ static void ivas_merge_masa_metadatas( energyMerged[sf][band] = eneBand + hMasa->data.energy_ism[sf][band]; /* Compute weights */ +#ifdef OMASA_DIFFUSE_ISM_MERGE + energyTimesRatioMASA[0] = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; + if ( band_n_dirs == 2 ) + { + energyTimesRatioMASA[1] = eneBand * hMeta->directional_meta[1].energy_ratio[sf][band]; + } + else + { + energyTimesRatioMASA[1] = 0.0f; + } + /* target is original MASA diffuseness */ + total_diff_nrg = eneBand * hMeta->common_meta.diffuse_to_total_ratio[sf][band]; + /* criterion is mean of ISM ratio and new ratio */ + energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ) ) ) / 2.0 * hMasa->data.energy_ism[sf][band]; + + /* Determine combined metadata based on the weights */ + merge_dest = -1; + if ( ( band_n_dirs == 1 && energyTimesRatioMASA[0] < energyTimesRatioISM ) || + ( band_n_dirs == 2 && energyTimesRatioMASA[0] < energyTimesRatioMASA[1] && energyTimesRatioMASA[0] < energyTimesRatioISM ) ) + { + /* 1dir and ISM the most energetic, or 2dir and ISM the more energetic than MASA1 */ + merge_dest = 0; + } + else if ( band_n_dirs == 2 && energyTimesRatioMASA[1] <= energyTimesRatioMASA[0] && energyTimesRatioMASA[1] < energyTimesRatioISM ) + { + /* 2dir and ISM the most energetic and MASA2 the least energetic */ + merge_dest = 1; + } + + if ( merge_dest >= 0 ) /* replace one MASA with ISM */ + { + hMeta->directional_meta[merge_dest].azimuth[sf][band] = hOMasaMeta->directional_meta[0].azimuth[sf][band]; + hMeta->directional_meta[merge_dest].elevation[sf][band] = hOMasaMeta->directional_meta[0].elevation[sf][band]; + /* limit with the earlier direct-energy ratio */ + dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ); /* new dir ratio */ + hMeta->directional_meta[merge_dest].energy_ratio[sf][band] = min( dir_sum, hOMasaMeta->directional_meta[0].energy_ratio[sf][band] ); /* clip with original ISM dir */ + hMeta->common_meta.diffuse_to_total_ratio[sf][band] = 1.0f - hMeta->directional_meta[merge_dest].energy_ratio[sf][band]; + + if ( hMasa->config.useCoherence ) /* TODO: is this correct condition? */ + { + hMeta->directional_meta[merge_dest].spread_coherence[sf][band] = hOMasaMeta->directional_meta[0].spread_coherence[sf][band]; + hMeta->common_meta.surround_coherence[sf][band] = hOMasaMeta->common_meta.surround_coherence[sf][band]; + } + + /* recompute direct energy ratios to match the diffuse ratio */ + float direct_quota, direct_scaler; + direct_quota = 1.0f - hMeta->common_meta.diffuse_to_total_ratio[sf][band]; + if ( band_n_dirs == 1 ) + { + hMeta->directional_meta[0].energy_ratio[sf][band] = direct_quota; + } + else + { + dir_sum = hMeta->directional_meta[0].energy_ratio[sf][band] + hMeta->directional_meta[1].energy_ratio[sf][band]; + direct_scaler = direct_quota / ( EPSILON + dir_sum ); + hMeta->directional_meta[0].energy_ratio[sf][band] *= direct_scaler; + hMeta->directional_meta[1].energy_ratio[sf][band] *= direct_scaler; + } + } +#else /* OMASA_DIFFUSE_ISM_MERGE */ energyTimesRatio1 = hMasa->data.energy_ism[sf][band] * hQMeta->q_direction[0].band_data[band].energy_ratio[sf]; energyTimesRatio2 = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; @@ -2026,6 +2195,7 @@ static void ivas_merge_masa_metadatas( hQMeta->surcoh_band_data[band].surround_coherence[sf] = (uint8_t) roundf( hMeta->common_meta.surround_coherence[sf][band] * UINT8_MAX ); } } +#endif /* OMASA_DIFFUSE_ISM_MERGE */ } } @@ -2043,12 +2213,136 @@ static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, int16_t no_ism, - float masa_to_total_energy_ratio ) + float masa_to_total_energy_ratio +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_sep_object +#endif +) { int16_t i, j, best_i, best_i2; float dist, div, tmp, dist2, best_dist; int16_t part_idx_sum, max_sum_idx; + +#ifdef REDUCE_OMASA_META_BITS + float ratio_ism_loc[MAX_NUM_OBJECTS]; + int16_t no_ism_loc; + max_sum_idx = ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1; + if ( idx_sep_object > -1 ) + { + if ( ratio_ism[idx_sep_object] < 1.0f / (float) ( max_sum_idx )) + { + /* take it out from quantize function */ + mvr2r( ratio_ism, ratio_ism_loc, idx_sep_object ); + mvr2r( &ratio_ism[idx_sep_object+1], &ratio_ism_loc[idx_sep_object], no_ism-idx_sep_object-1 ); + no_ism_loc = no_ism - 1; + } + else + { + no_ism_loc = no_ism; + mvr2r( ratio_ism, ratio_ism_loc, no_ism ); + } + } + else + { + no_ism_loc = no_ism; + mvr2r( ratio_ism, ratio_ism_loc, no_ism ); + } + + + if ( no_ism > 1 ) + { + if ( masa_to_total_energy_ratio >= MASA2TOTAL_THR ) + { + distribute_evenly_ism( idx, max_sum_idx, no_ism ); + } + else + { + if ( no_ism_loc > 1 ) + { + + dist = 0.0f; + div = 1.0f / (float) ( max_sum_idx ); + + part_idx_sum = 0; + + for ( i = 0; i < no_ism_loc; i++ ) + { + idx[i] = (int16_t) ( ( ratio_ism_loc[i] ) * ( max_sum_idx ) ); + part_idx_sum += idx[i]; + + tmp = ( ratio_ism_loc[i] - ( idx[i] * div ) ); + dist += ( tmp * tmp ); + } + best_dist = dist; + best_i2 = -1; + while ( part_idx_sum < max_sum_idx ) + { + best_i = -1; + /* check which index to increase by 1 for a possible improvement */ + + for ( i = 0; i < no_ism_loc; i++ ) + { + idx[i]++; + dist2 = 0.0f; + + + for ( j = 0; j < no_ism_loc; j++ ) + { + tmp = ( ratio_ism_loc[i] - ( idx[i] * div ) ); + dist2 += ( tmp * tmp ); + } + + if ( dist2 < best_dist ) + { + best_i2 = best_i; + best_i = i; + best_dist = dist2; + } + idx[i]--; + } + if ( best_i > -1 ) + { + idx[best_i]++; + part_idx_sum++; + } + else + { + if ( best_i2 > -1 ) + { + idx[best_i2]++; + part_idx_sum++; + } + else + { + idx[no_ism_loc - 1] += max_sum_idx - part_idx_sum; + part_idx_sum = max_sum_idx; + } + } + } + assert( sum_s( idx, no_ism_loc ) == max_sum_idx ); + } + else + { + idx[0] = max_sum_idx; + } + if ( no_ism_loc < no_ism ) + { + /* insert back the ratio of the separated object */ + for ( i = no_ism - 1; i > idx_sep_object; i-- ) + { + idx[i] = idx[i - 1]; + } + idx[idx_sep_object] = 0; + } + } + } + else + { + idx[0] = (int16_t) ( ( ratio_ism[0] ) * ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ) + 0.5f ); + } +#else max_sum_idx = ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1; if ( no_ism > 1 ) { @@ -2126,7 +2420,7 @@ static void quantize_ratio_ism_vector( idx[0] = (int16_t) ( ( ratio_ism[0] ) * ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ) + 0.5f ); } - +#endif return; } @@ -2210,6 +2504,401 @@ static void transform_index_and_GR_encode( return; } +static int16_t try_differential( + int16_t numCodingBands, + const float * masa_to_total_energy_ratio, + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t no_ism, + int16_t bits_index, + int16_t * p_b_signif) +{ + int16_t b, i; + int16_t nbits0; + int16_t b_signif; + int16_t ratio_ism_idx_ref[MAX_NUM_OBJECTS]; + int16_t diff_idx[MAX_NUM_OBJECTS]; + + + b_signif = 0; + while ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR && b_signif < numCodingBands ) + { + b_signif++; + } + nbits0 = 0; + if ( b_signif < numCodingBands ) + { + nbits0 = bits_index; + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism ); + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_ref, diff_idx, no_ism ); + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism ); + /* transform difference index into positive */ + transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + } + } + } + } + *p_b_signif = b_signif; + return nbits0; +} + +static void differential_coding_first_subframe( + BSTR_ENC_HANDLE hMetaData, + const float *masa_to_total_energy_ratio, + int16_t b_signif, + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t no_ism, + int16_t numCodingBands, + int16_t bits_index + ) +{ + int16_t index, b; + int16_t ratio_ism_idx_ref[MAX_NUM_OBJECTS]; + int16_t diff_idx[MAX_NUM_OBJECTS]; + + /* differential encoding*/ + push_next_indice( hMetaData, 0, 1 ); + if ( b_signif < numCodingBands ) + { + index = index_slice_enum( ratio_ism_idx[b_signif], no_ism ); + push_next_indice( hMetaData, index, bits_index ); + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism ); + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_ref, diff_idx, no_ism ); + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism ); + /* transform difference index into positive */ + transform_index_and_GR_encode( diff_idx, no_ism - 1, 0, hMetaData ); + } + } + } +} +#ifdef REDUCE_OMASA_META_BITS +static void independent_coding_ratio_ism_idx( + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* i: ISM ratios */ + const float *masa_to_total_energy_ratio, /* i: MASA to total ratios */ + int16_t no_ism, /* i: number of objects */ + int16_t numCodingBands, /* i: number of subbands */ + int16_t bits_index, /* i: number of bits per index */ + BSTR_ENC_HANDLE hMetaData /* i/o: bitstream */ + ) +{ + int16_t b, index; + + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + index = index_slice_enum( ratio_ism_idx[b], no_ism ); + push_next_indice( hMetaData, index, bits_index ); + } + } + +} + +static void remove_sep_obj( + int16_t *diff_idx, /* i/o: array of difference of indexes */ + int16_t no_ism, /* i: number of objects */ + int16_t idx_sep_obj /* i: index of separated object, to be taken out of array */ +) +{ + int16_t i; + for ( i = idx_sep_obj; i < no_ism-1; i++ ) + { + diff_idx[i] = diff_idx[i + 1]; + } + return; +} + +static void estimate_bits_subband_ism_ratio( + int16_t * ratio_ism_idx, + int16_t *ratio_ism_idx_ref, /* ( i/o ) */ + int16_t no_ism, + int16_t shift_one, + int16_t idx_sep_obj, + int16_t * p_nbits0, + int16_t * p_nbits1 +) +{ + int16_t diff_idx[MAX_NUM_OBJECTS]; + int16_t nbits0, nbits1; + int16_t i; + + nbits0 = 0; + nbits1 = 0; + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx, ratio_ism_idx_ref, diff_idx, no_ism ); + if ( shift_one ) + { + remove_sep_obj( diff_idx, no_ism, idx_sep_obj ); + } + /* transform difference index into positive */ + transform_difference_index( diff_idx, diff_idx, no_ism - 1 - shift_one ); + /* GR encoding */ + + for ( i = 0; i < no_ism - 1 - shift_one; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); + } + + + *p_nbits0 = nbits0; + *p_nbits1 = nbits1; + return; +} + +static int16_t encode_ratio_ism_subframe( + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t no_ism, + int16_t numCodingBands, + int16_t sf, + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + BSTR_ENC_HANDLE hMetaData, + const float *masa_to_total_energy_ratio, + int16_t shift_one, + int16_t idx_separated_obj +) +{ + int16_t b, b_signif; + int16_t diff_idx[MAX_NUM_OBJECTS]; + int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb, bits_pos0; + int16_t differential_subframe; + + int16_t ratio_ism_idx_ref[MAX_NUM_OBJECTS]; + int16_t bits_index; + int16_t nbits00, nbits11; + int16_t idx_sep_obj_local; + + idx_sep_obj_local = idx_separated_obj; + if ( idx_separated_obj > -1 ) + { + if ( idx_separated_obj == no_ism - 1 ) + { + idx_sep_obj_local = 0; + } + } + nbits = 0; + nbits0 = 0; + nbits1 = 0; + + bits_pos0 = hMetaData->nb_bits_tot; + differential_subframe = 1; /* the differences are taken with respect to previous subframe */ + + /* first subframe */ + bits_index = 0; + if ( sf == 0 ) + { + bits_index = bits_index_ism_ratio( no_ism ); + + nbits = 0; + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + nbits += bits_index; + } + } + + nbits0 = try_differential( numCodingBands, masa_to_total_energy_ratio, ratio_ism_idx, no_ism, bits_index, &b_signif ); + + if ( nbits <= nbits0 && nbits > 0 ) + { + /* independent encoding */ + push_next_indice( hMetaData, 1, 1 ); + independent_coding_ratio_ism_idx( ratio_ism_idx, masa_to_total_energy_ratio, no_ism, numCodingBands, bits_index, hMetaData ); + nbits = nbits + 1; + } + else + { + if ( nbits > 0 ) + { + differential_coding_first_subframe( hMetaData, masa_to_total_energy_ratio, b_signif, ratio_ism_idx, no_ism, numCodingBands, bits_index ); + nbits = nbits0 + 1; + } + } + +#ifdef DEBUGGING + assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); +#endif + } + else + { + /* not first subframe */ + if ( shift_one == 1 && no_ism == 2 ) + { + nbits = 0; + } + else + { + nbits0 = 0; + nbits1 = 0; + + + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + estimate_bits_subband_ism_ratio( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], no_ism, shift_one, idx_sep_obj_local, &nbits00, &nbits11 ); + nbits0 += nbits00; + nbits1 += nbits11; + } + } + if ( nbits0 < nbits1 ) + { + GR_order = 0; + nbits = nbits0; + } + else + { + GR_order = 1; + nbits = nbits1; + } + if ( numCodingBands > 1 ) + { + /* try the difference from subband to subband; first subband is compared to previous subframe first subband*/ + /* take difference with respect to previous subframe only for first subband */ + nbits0 = 0; + nbits1 = 0; + b_signif = 0; + while ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR && b_signif < numCodingBands ) + { + b_signif++; + } + if ( b_signif < numCodingBands ) + { + estimate_bits_subband_ism_ratio( ratio_ism_idx[b_signif], ratio_ism_idx_prev_sf[b_signif], no_ism, shift_one, idx_sep_obj_local, &nbits0, &nbits1 ); + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism ); + + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + estimate_bits_subband_ism_ratio( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism, shift_one, idx_sep_obj_local, &nbits00, &nbits11 ); + nbits0 += nbits00; + nbits1 += nbits11; + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism ); + } + } + + if ( nbits0 < nbits1 ) + { + GR_order_sb = 0; + } + else + { + GR_order_sb = 1; + nbits0 = nbits1; + } + + if ( nbits0 < nbits ) + { + differential_subframe = 0; + nbits = nbits0; + GR_order = GR_order_sb; + } + + if ( nbits > 0 ) + { + /* write prediction type */ + push_next_indice( hMetaData, differential_subframe, 1 ); + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + nbits++; /* for the prediction type */ + nbits++; /* for GR_order */ + + /* write data */ + if ( differential_subframe ) + { + for ( b = 0; b < numCodingBands; b++ ) + { + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + if ( shift_one ) + { + remove_sep_obj( diff_idx, no_ism, idx_sep_obj_local ); + } + transform_index_and_GR_encode( diff_idx, no_ism - 1 - shift_one, GR_order, hMetaData ); + } + } + } + else + { + v_sub_s( ratio_ism_idx[b_signif], ratio_ism_idx_prev_sf[b_signif], diff_idx, no_ism ); + if ( shift_one ) + { + remove_sep_obj( diff_idx, no_ism, idx_sep_obj_local ); + } + transform_index_and_GR_encode( diff_idx, no_ism - 1 - shift_one, GR_order, hMetaData ); + mvs2s( ratio_ism_idx[b_signif], ratio_ism_idx_ref, no_ism - shift_one); + for ( b = b_signif + 1; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subband */ + if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) + { + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_ref, diff_idx, no_ism ); + if ( shift_one ) + { + remove_sep_obj( diff_idx, no_ism, idx_sep_obj_local ); + } + transform_index_and_GR_encode( diff_idx, no_ism - 1 - shift_one, GR_order, hMetaData ); + mvs2s( ratio_ism_idx[b], ratio_ism_idx_ref, no_ism - shift_one ); + } + } + } + } + } + } + else + { + /* only differential wrt previous subframe is possible */ + /* write the differential to subframe case and no bit to signal the difference type */ + + if ( nbits > 0 ) + { + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + nbits++; /* for GR_order */ + /* write data */ + /* only one subband */ + if ( masa_to_total_energy_ratio[0] < MASA2TOTAL_THR ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); + if ( shift_one ) + { + remove_sep_obj( diff_idx, no_ism, idx_sep_obj_local ); + } + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); + } + } + } + + +#ifdef DEBUGGING + assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); +#endif + } + + + } + return nbits; +} + + +#else static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], @@ -2220,7 +2909,7 @@ static int16_t encode_ratio_ism_subframe( BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio ) { - int16_t b, i; + int16_t b, i, b_signif; int16_t diff_idx[MAX_NUM_OBJECTS], index; int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb, bits_pos0; int16_t differential_subframe; @@ -2235,6 +2924,7 @@ static int16_t encode_ratio_ism_subframe( { if ( no_ism == 2 ) { + for ( b = 0; b < numCodingBands; b++ ) { if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) @@ -2245,6 +2935,7 @@ static int16_t encode_ratio_ism_subframe( nbits += 3; } } + } else if ( no_ism == 3 ) { @@ -2322,28 +3013,33 @@ static int16_t encode_ratio_ism_subframe( /* take difference with respect to previous subframe only for first subband */ nbits0 = 0; nbits1 = 0; - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - /* transform difference index into positive */ - transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); - /* GR encoding */ - for ( i = 0; i < no_ism - 1; i++ ) - { - nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); - nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); - } - for ( b = 1; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); /* transform difference index into positive */ transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); /* GR encoding */ - for ( i = 0; i < no_ism - 1; i++ ) { nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); } + + + for ( b = 1; b < numCodingBands; b++ ) + { + + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + /* transform difference index into positive */ + transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); + /* GR encoding */ + + for ( i = 0; i < no_ism - 1; i++ ) + { + nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); + nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); + } + } if ( nbits0 < nbits1 ) @@ -2362,35 +3058,38 @@ static int16_t encode_ratio_ism_subframe( nbits = nbits0; GR_order = GR_order_sb; } - nbits++; /* for GR_order */ - nbits++; /* for the prediction type */ - /* write prediction type */ - push_next_indice( hMetaData, differential_subframe, 1 ); - /* write GR order */ - push_next_indice( hMetaData, GR_order, 1 ); - /* write data */ - if ( differential_subframe ) - { - for ( b = 0; b < numCodingBands; b++ ) + nbits++; /* for GR_order */ + nbits++; /* for the prediction type */ + + /* write prediction type */ + push_next_indice( hMetaData, differential_subframe, 1 ); + /* write GR order */ + push_next_indice( hMetaData, GR_order, 1 ); + /* write data */ + if ( differential_subframe ) { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - } - } - else - { - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); + for ( b = 0; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subframe */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - for ( b = 1; b < numCodingBands; b++ ) + } + } + else { - /* take difference with respect to previous subband */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); + + for ( b = 1; b < numCodingBands; b++ ) + { + /* take difference with respect to previous subband */ + v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); + transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); + } } - } + } else { @@ -2408,14 +3107,18 @@ static int16_t encode_ratio_ism_subframe( v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); } + } #ifdef DEBUGGING assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); #endif } + return nbits; } +#endif + static void ivas_encode_masaism_metadata( @@ -2425,7 +3128,13 @@ static void ivas_encode_masaism_metadata( ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ int16_t low_bitrate_mode, /* i: is low bitrate more? 1/0 */ int16_t omasa_nbands, - int16_t omasa_nblocks ) + int16_t omasa_nblocks +#ifdef REDUCE_OMASA_META_BITS + , + int16_t idx_separated_object, + int16_t ism_imp +#endif +) { int16_t sf, band; uint8_t numCodingBands; @@ -2434,7 +3143,9 @@ static void ivas_encode_masaism_metadata( float eneBand; int16_t bin; int16_t obj; +#ifndef REDUCE_OMASA_META_BITS float priority[MAX_NUM_OBJECTS]; +#endif int16_t bits_ism[MAX_NUM_OBJECTS]; uint16_t idx_sph; float theta_q, phi_q; @@ -2444,6 +3155,10 @@ static void ivas_encode_masaism_metadata( float step; int16_t inv_step; float energy_ism, energy_ism_ind[MAX_NUM_OBJECTS]; +#ifdef REDUCE_OMASA_META_BITS + int16_t tmp, rotate; + int16_t n_ism_tmp, i; +#endif /* use the values from hQMetaData */ @@ -2567,9 +3282,12 @@ static void ivas_encode_masaism_metadata( /* quantize ism_ratios */ if ( hMasa->data.nchan_ism > 1 ) { - inv_step = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); step = 1.0f / inv_step; +#ifdef REDUCE_OMASA_META_BITS + rotate = 0; + n_ism_tmp = 0; +#endif for ( sf = 0; sf < numSf; sf++ ) { for ( band = 0; band < numCodingBands; band++ ) @@ -2580,23 +3298,112 @@ static void ivas_encode_masaism_metadata( ratio_ism[band][obj] = hMasa->data.energy_ratio_ism[sf][band][obj]; } /* Quantize power ratios */ +#ifdef REDUCE_OMASA_META_BITS + quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band], idx_separated_object ); + if ( n_ism_tmp == numCodingBands && ratio_ism_idx[band][idx_separated_object] != 0 && hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) + { + i = 0; + while ( ratio_ism_idx[band][idx_separated_object] > 0 ) + { + if ( i != idx_separated_object ) + { + ratio_ism_idx[band][i]++; + ratio_ism_idx[band][idx_separated_object]--; + } + i++; + if ( i == hMasa->data.nchan_ism ) + { + i = 0; + } + } + } +#else quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band] ); +#endif /* reconstructed values */ reconstruct_ism_ratios( ratio_ism_idx[band], hMasa->data.nchan_ism, step, hMasa->data.q_energy_ratio_ism[sf][band] ); /* encode vector */ } +#ifdef REDUCE_OMASA_META_BITS + if ( ( hMasa->data.nchan_ism > 2 ) && ( idx_separated_object == hMasa->data.nchan_ism - 1 ) ) + { + /* rotate components */ + rotate = 1; + for ( band = 0; band < numCodingBands; band++ ) + { + if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) + { + tmp = ratio_ism_idx[band][hMasa->data.nchan_ism - 1]; + ratio_ism_idx[band][hMasa->data.nchan_ism - 1] = ratio_ism_idx[band][0]; + ratio_ism_idx[band][0] = tmp; + if ( sf == 0 && tmp == 0 ) + { + n_ism_tmp += 1; + } + + if ( n_ism_tmp == numCodingBands ) + { + assert( tmp == 0 ); + } + } + } + } + else + { + if ( idx_separated_object > -1 ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) + { + if ( ratio_ism_idx[band][idx_separated_object] == 0 && sf == 0 ) + { + n_ism_tmp++; + } + } + } + } + } +#endif /* encode data for current subframe */ + +#ifdef REDUCE_OMASA_META_BITS + if ( sf > 0 && n_ism_tmp == numCodingBands ) + { + encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf], 1, idx_separated_object ); + } + else + { + encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf], 0, idx_separated_object ); + } +#else encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf] ); +#endif + /* calculate quantized ISM ratios */ /* save previous subframe indexes */ for ( band = 0; band < numCodingBands; band++ ) { mvs2s( ratio_ism_idx[band], ratio_ism_idx_prev_sf[band], hMasa->data.nchan_ism ); } +#ifdef REDUCE_OMASA_META_BITS + if ( rotate ) + { + for ( band = 0; band < numCodingBands; band++ ) + { + if ( hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) + { + tmp = ratio_ism_idx[band][hMasa->data.nchan_ism - 1]; + ratio_ism_idx[band][hMasa->data.nchan_ism - 1] = ratio_ism_idx[band][0]; + ratio_ism_idx[band][0] = tmp; + } + } + } +#endif } - +#ifndef REDUCE_OMASA_META_BITS set_f( priority, 0.0f, hMasa->data.nchan_ism ); for ( sf = 0; sf < numSf; sf++ ) { @@ -2608,19 +3415,25 @@ static void ivas_encode_masaism_metadata( } } } +#endif } +#ifndef REDUCE_OMASA_META_BITS else { priority[0] = 1; } - +#endif +#ifdef REDUCE_OMASA_META_BITS + calculate_nbits_meta( hMasa->data.nchan_ism, hMasa->data.q_energy_ratio_ism, hQMetaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); +#else /* decide parameters for ISM metadata quantization */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) { bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); } +#endif - /* this is only the first version */ + /* quantize directions */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) { diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index cd2548701a..db156c61e7 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -50,7 +50,12 @@ * Local function prototypes *------------------------------------------------------------------------*/ -static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); +static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], +#ifdef OMASA_DIFFUSE_ISM_MERGE + float diffuseness_m[MASA_FREQUENCY_BANDS], +#endif + const int16_t input_frame, + const int16_t nchan_inp ); static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); @@ -126,8 +131,13 @@ ivas_error ivas_omasa_enc_open( for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { +#ifdef OMASA_DIFFUSE_ISM_MERGE + hOMasa->direction_vector_m[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ); + set_zero( hOMasa->direction_vector_m[i][j], MASA_FREQUENCY_BANDS ); +#else hOMasa->direction_vector_m[i][j] = (float *) malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); set_zero( hOMasa->direction_vector_m[i][j], MAXIMUM_OMASA_FREQ_BANDS ); +#endif } } @@ -135,8 +145,13 @@ ivas_error ivas_omasa_enc_open( { for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) { +#ifdef OMASA_DIFFUSE_ISM_MERGE + hOMasa->buffer_intensity_real[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ); + set_zero( hOMasa->buffer_intensity_real[i][j], MASA_FREQUENCY_BANDS ); +#else hOMasa->buffer_intensity_real[i][j] = (float *) malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); set_zero( hOMasa->buffer_intensity_real[i][j], MAXIMUM_OMASA_FREQ_BANDS ); +#endif } } @@ -225,12 +240,28 @@ void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs /* i : Input sample rate */ +#ifdef OMASA_DIFFUSE_ISM_MERGE + , + ISM_MODE ismMode /* i : ISM mode */ +#endif ) { int16_t i, maxBin; /* Determine the number of bands */ +#ifdef OMASA_DIFFUSE_ISM_MERGE + if ( ismMode == ISM_MODE_NONE ) + { + /* use full resolution for the ISM+MASA merge and reduce later */ + hOMasa->nbands = 24; + } + else + { + hOMasa->nbands = hMasa->config.numCodingBands; + } +#else hOMasa->nbands = hMasa->config.numCodingBands; +#endif hOMasa->nCodingBands = hMasa->config.numCodingBands; /* Determine the number of subframes */ @@ -297,6 +328,12 @@ void ivas_omasa_enc( /* Analysis */ if ( ism_mode == ISM_MODE_NONE ) { +#ifdef OMASA_DIFFUSE_ISM_MERGE + OMASA_SPATIAL_META OMasaMeta; /* working memory for the ISM-object MASA-parameters */ + OMASA_SPATIAL_META_HANDLE hOMasaMeta; + int16_t n_bands_orig, n_subframes_orig; + uint8_t numCodingBands_orig, joinedSubframes_orig; +#else float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float energyRatio[MASA_FREQUENCY_BANDS]; @@ -307,9 +344,66 @@ void ivas_omasa_enc( nBands = hOMasa->nbands; nBlocks = hOMasa->nSubframes; +#endif + +#ifdef OMASA_DIFFUSE_ISM_MERGE + hOMasaMeta = &OMasaMeta; + hOMasaMeta->num_dirs = 1; /* TODO: hard-coding for now */ + + /* merge MASA directions before adding ISM to the mixture */ + if ( hMasa->config.numberOfDirections == 2 ) + { + n_bands_orig = hMasa->config.numCodingBands; + hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; + + ivas_masa_combine_directions( hMasa ); + + hMasa->config.numCodingBands = n_bands_orig; + } + + // force computation into high resolution + n_bands_orig = hOMasa->nbands; + n_subframes_orig = hOMasa->nSubframes; + + hOMasa->nbands = MASA_FREQUENCY_BANDS; + hOMasa->nSubframes = MAX_PARAM_SPATIAL_SUBFRAMES; + /* Estimate MASA parameters from the objects */ + /* NB: only first direction is populated */ + /* NB2: in energy_ratios and surround_coherence only first sub-frame contains valid data */ + ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, hOMasaMeta->directional_meta[0].elevation, hOMasaMeta->directional_meta[0].azimuth, hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].spread_coherence, hOMasaMeta->common_meta.surround_coherence[0], + hOMasaMeta->common_meta.diffuse_to_total_ratio[0], + input_frame, nchan_ism ); + + /* copy energy_ratios and surrCoh from first sub-frame to the remaining ones */ + for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + mvr2r( hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].energy_ratio[i], MASA_FREQUENCY_BANDS ); + mvr2r( hOMasaMeta->common_meta.surround_coherence[0], hOMasaMeta->common_meta.surround_coherence[i], MASA_FREQUENCY_BANDS ); + mvr2r( hOMasaMeta->common_meta.diffuse_to_total_ratio[0], hOMasaMeta->common_meta.diffuse_to_total_ratio[i], MASA_FREQUENCY_BANDS ); + } +#else /* Estimate MASA parameters from the objects */ ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); +#endif + +#ifdef OMASA_DIFFUSE_ISM_MERGE + /* restore resolution parameters */ + hOMasa->nbands = n_bands_orig; + hOMasa->nSubframes = n_subframes_orig; + + /* perform MASA+ISM merge in full resolution */ + numCodingBands_orig = hMasa->config.numCodingBands; + joinedSubframes_orig = hMasa->config.joinedSubframes; + + hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; + hMasa->config.joinedSubframes = 0; + + ivas_merge_masa_metadatas( hMasa, hOMasaMeta ); /* => merge result in hMasa->masaMetadata */ + + hMasa->config.numCodingBands = numCodingBands_orig; + hMasa->config.joinedSubframes = joinedSubframes_orig; +#else /* Set analyzed values to the QMeta struct */ for ( i = 0; i < nBands; i++ ) @@ -349,9 +443,13 @@ void ivas_omasa_enc( } } } +#endif } else if ( ism_mode == ISM_MASA_MODE_PARAM ) { +#ifdef REDUCE_OMASA_META_BITS + *idx_separated_object = -1; +#endif /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); } @@ -625,6 +723,9 @@ static void ivas_omasa_param_est_enc( float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], +#ifdef OMASA_DIFFUSE_ISM_MERGE + float diffuseness_m[MASA_FREQUENCY_BANDS], +#endif const int16_t input_frame, const int16_t nchan_ism ) { @@ -640,7 +741,10 @@ static void ivas_omasa_param_est_enc( float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float diffuseness_vector[MASA_FREQUENCY_BANDS]; +#ifndef OMASA_DIFFUSE_ISM_MERGE float diffuseness_m[MASA_FREQUENCY_BANDS]; +#endif + int16_t band_m_idx, block_m_idx; float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; float norm_tmp; -- GitLab From e4789fa66bc098a5578f01ddde4a89cf8f31360d Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 15:10:51 +0100 Subject: [PATCH 0054/1418] fix MSVC compilation warnings --- lib_com/ivas_masa_com.c | 1 - lib_com/ivas_prot.h | 2 ++ lib_enc/ivas_enc.c | 4 ++++ lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 17 +++++++++-------- lib_enc/ivas_stat_enc.h | 6 +++--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index 8185680d54..c3082f53e1 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -600,7 +600,6 @@ int32_t calculate_cpe_brate_MASA_ISM( int16_t k, sce_id; k = 0; - while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) { k++; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index cf2595f1c4..da7a57efa6 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5036,7 +5036,9 @@ void ivas_omasa_set_config( void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ +#ifndef OMASA_DIFFUSE_ISM_MERGE IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ +#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index e5e4f2860b..a3adbda9b6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -340,7 +340,11 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Estimate MASA parameters for the objects */ +#ifdef OMASA_DIFFUSE_ISM_MERGE + ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); +#else ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); +#endif } /* Encode ISMs transport channels */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index b7c5b7f707..f31badf9b3 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2136,7 +2136,7 @@ static void ivas_merge_masa_metadata( /* target is original MASA diffuseness */ total_diff_nrg = eneBand * hMeta->common_meta.diffuse_to_total_ratio[sf][band]; /* criterion is mean of ISM ratio and new ratio */ - energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ) ) ) / 2.0 * hMasa->data.energy_ism[sf][band]; + energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ) ) ) / 2.0f * hMasa->data.energy_ism[sf][band]; /* Determine combined metadata based on the weights */ merge_dest = -1; diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index b82b2c4a4d..8b603c42fc 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -246,7 +246,7 @@ void ivas_omasa_set_config( #endif ) { - int16_t i, maxBin; + uint8_t i, maxBin; /* Determine the number of bands */ #ifdef OMASA_DIFFUSE_ISM_MERGE @@ -280,7 +280,7 @@ void ivas_omasa_set_config( } } - maxBin = (int16_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); + maxBin = (uint8_t) ( input_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); for ( i = 1; i < hOMasa->nbands + 1; i++ ) { @@ -309,8 +309,10 @@ void ivas_omasa_set_config( *--------------------------------------------------------------------------*/ void ivas_omasa_enc( - OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ - IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ + OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ +#ifndef OMASA_DIFFUSE_ISM_MERGE + IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ +#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ @@ -331,7 +333,7 @@ void ivas_omasa_enc( #ifdef OMASA_DIFFUSE_ISM_MERGE OMASA_SPATIAL_META OMasaMeta; /* working memory for the ISM-object MASA-parameters */ OMASA_SPATIAL_META_HANDLE hOMasaMeta; - int16_t n_bands_orig, n_subframes_orig; + uint8_t n_bands_orig, n_subframes_orig; uint8_t numCodingBands_orig, joinedSubframes_orig; #else float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; @@ -361,7 +363,7 @@ void ivas_omasa_enc( hMasa->config.numCodingBands = n_bands_orig; } - // force computation into high resolution + /* force computation into high resolution */ n_bands_orig = hOMasa->nbands; n_subframes_orig = hOMasa->nSubframes; @@ -372,8 +374,7 @@ void ivas_omasa_enc( /* NB: only first direction is populated */ /* NB2: in energy_ratios and surround_coherence only first sub-frame contains valid data */ ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, hOMasaMeta->directional_meta[0].elevation, hOMasaMeta->directional_meta[0].azimuth, hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].spread_coherence, hOMasaMeta->common_meta.surround_coherence[0], - hOMasaMeta->common_meta.diffuse_to_total_ratio[0], - input_frame, nchan_ism ); + hOMasaMeta->common_meta.diffuse_to_total_ratio[0], input_frame, nchan_ism ); /* copy energy_ratios and surrCoh from first sub-frame to the remaining ones */ for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index adcbc6b9ba..c1df19f243 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -841,9 +841,9 @@ typedef struct ivas_mcmasa_enc_data_structure typedef struct ivas_omasa_enc_data_structure { - int16_t nbands; - int16_t nCodingBands; - int16_t nSubframes; + uint8_t nbands; + uint8_t nCodingBands; + uint8_t nSubframes; /* delay compensation */ float *delay_buffer[MAX_NUM_OBJECTS]; /* Delay buffer for parameter estimation */ -- GitLab From 57edb8d536825b92cb0a24f409e0e8ecc9731c1b Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 15:51:27 +0100 Subject: [PATCH 0055/1418] fix to 4 ISMs 24 kbps case: when all objects are HIGH_IMP, keep 24 kbps bitrate, otherwise increase the 24 kbps bitrate; under FIX_4OBJ_128 --- lib_com/ivas_omasa_com.c | 20 +++++++++++++++++++- lib_com/ivas_prot.h | 3 +++ lib_com/options.h | 3 +++ lib_dec/ivas_omasa_dec.c | 24 ++++++++++++++++++++++-- lib_enc/ivas_ism_metadata_enc.c | 16 +++++++++++++++- lib_enc/ivas_omasa_enc.c | 7 ++++++- lib_enc/ivas_sce_enc.c | 8 +++++++- 7 files changed, 75 insertions(+), 6 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index bccda612fa..a14b4c908c 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -60,12 +60,19 @@ #define GAMMA_ISM_LOW_IMP3 0.85f #define GAMMA_ISM_MEDIUM_IMP3 1.15f #define GAMMA_ISM_HIGH_IMP3 1.3f + #ifdef TUNING_DISC_3_4obj +#ifdef FIX_4OBJ_128 +#define GAMMA_ISM_LOW_IMP4 0.8f +#define GAMMA_ISM_MEDIUM_IMP4 1.0f +#define GAMMA_ISM_HIGH_IMP4 1.2f +#else #define GAMMA_ISM_LOW_IMP4 0.6f #define GAMMA_ISM_MEDIUM_IMP4 0.8f #define GAMMA_ISM_HIGH_IMP4 1.0f #endif #endif +#endif /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() @@ -175,6 +182,10 @@ int32_t ivas_interformat_brate( const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ +#ifdef FIX_4OBJ_128 + , + const int16_t limit_flag /* i : flag to limit the bitrate increase */ +#endif ) { int32_t element_brate_out; @@ -182,7 +193,6 @@ int32_t ivas_interformat_brate( nBits = (int16_t) ( element_brate / FRAMES_PER_SEC ); - if ( ism_imp == ISM_INACTIVE_IMP ) { nBits = BITS_ISM_INACTIVE; @@ -192,6 +202,14 @@ int32_t ivas_interformat_brate( #ifdef TUNING_DISC_3_4obj if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) ) ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ { + +#ifdef FIX_4OBJ_128 + if ( limit_flag && ( nchan_ism == 4 && element_brate == 24000 ) ) + { + return element_brate; + } +#endif + if ( ism_imp == ISM_LOW_IMP ) { nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP4 ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index da7a57efa6..b20eb35e3b 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5079,6 +5079,9 @@ int32_t ivas_interformat_brate( const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ +#ifdef FIX_4OBJ_128 + , const int16_t limit_flag /* i : flag to limit the bitrate increase */ +#endif ); void ivas_combined_format_brate_sanity( diff --git a/lib_com/options.h b/lib_com/options.h index bf528b6761..d0fda9cf9f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,6 +179,9 @@ #define REDUCE_OMASA_META_BITS /* Nokia: reduce metadata number of bits and fix directional metadata bit allocation */ #define OMASA_DIFFUSE_ISM_MERGE /* Nokia: Diffuse-energy retaining merging of ISM and MASA */ +#define FIX_4OBJ_128 /* VA: fix to 4 ISMs 24 kbps case: when all objects are HIGH_IMP, keep 24 kbps bitrate, otherwise increase the 24 kbps bitrate */ + + #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 6e95f0710f..5ca00ff79e 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -59,7 +59,12 @@ void ivas_set_surplus_brate_dec( if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - *ism_total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + *ism_total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp +#ifdef FIX_4OBJ_128 + , + 0 +#endif + ); st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; @@ -74,6 +79,16 @@ void ivas_set_surplus_brate_dec( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { +#ifdef FIX_4OBJ_128 + int16_t brate_limit_flag = 0; + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + brate_limit_flag += st_ivas->hIsmMetaData[n]->ism_imp; + } + brate_limit_flag = brate_limit_flag >= 10 ? 1 : 0; +#endif + ism_total_brate_ref = 0; for ( n = 0; n < st_ivas->nchan_ism; n++ ) { @@ -90,7 +105,12 @@ void ivas_set_surplus_brate_dec( { st_ivas->hSCE[n]->element_brate = element_brate[n]; - *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp ); + *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp +#ifdef FIX_4OBJ_128 + , + brate_limit_flag +#endif + ); } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index aacf3dc0b6..43c498bcd0 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -824,6 +824,15 @@ ivas_error ivas_ism_metadata_enc( if ( ism_mode == ISM_MASA_MODE_DISC ) { int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; +#ifdef FIX_4OBJ_128 + int16_t brate_limit_flag = 0; + + for ( ch = 0; ch < num_obj; ch++ ) + { + brate_limit_flag += ism_imp[ch]; + } + brate_limit_flag = brate_limit_flag >= 10 ? 1 : 0; +#endif bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); set_s( bits_element, bits_ism / num_obj, num_obj ); @@ -833,7 +842,12 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate = 0; for ( ch = 0; ch < num_obj; ch++ ) { - *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, num_obj, hSCE[ch]->element_brate, ism_imp[ch] ); + *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, num_obj, hSCE[ch]->element_brate, ism_imp[ch] +#ifdef FIX_4OBJ_128 + , + brate_limit_flag +#endif + ); } ism_metadata_flag_global = 1; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 8b603c42fc..b7fe8ee27e 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -667,7 +667,12 @@ void ivas_set_surplus_brate_enc( { if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ); + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp +#ifdef FIX_4OBJ_128 + , + 0 +#endif + ); /* note: ISM st->total_brate is iset in ivas_sce_enc() */ } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index c600aa1436..dde49fb9cd 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -229,7 +229,13 @@ ivas_error ivas_sce_enc( { set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); - st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp ) - nb_bits_metadata * FRAMES_PER_SEC; + st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp +#ifdef FIX_4OBJ_128 + , + 0 +#endif + ) - + nb_bits_metadata * FRAMES_PER_SEC; } #endif -- GitLab From 0cc758c2f085cea8450381c7694060ad7b8bce74 Mon Sep 17 00:00:00 2001 From: advasila Date: Mon, 6 Mar 2023 18:26:09 +0200 Subject: [PATCH 0056/1418] fix compilation warnings --- lib_com/ivas_prot.h | 2 ++ lib_enc/ivas_enc.c | 6 +++++- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 4e700a7abe..7adc713c74 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5219,7 +5219,9 @@ void ivas_omasa_set_config( void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ +#ifndef OMASA_DIFFUSE_ISM_MERGE IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ +#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index c0bf3caa93..793c1a9885 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -357,7 +357,11 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Estimate MASA parameters for the objects */ - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); + ivas_omasa_enc( st_ivas->hOMasa, +#ifndef OMASA_DIFFUSE_ISM_MERGE + st_ivas->hQMetaData, +#endif + st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); } /* Encode ISMs transport channels */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 59b76cdd7c..ecfa7f0edb 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2130,7 +2130,7 @@ static void ivas_merge_masa_metadatas( /* target is original MASA diffuseness */ total_diff_nrg = eneBand * hMeta->common_meta.diffuse_to_total_ratio[sf][band]; /* criterion is mean of ISM ratio and new ratio */ - energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ) ) ) / 2.0 * hMasa->data.energy_ism[sf][band]; + energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.energy_ism[sf][band] ) ) ) / 2.0f * hMasa->data.energy_ism[sf][band]; /* Determine combined metadata based on the weights */ merge_dest = -1; diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index db156c61e7..a647ceeb9e 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -310,7 +310,9 @@ void ivas_omasa_set_config( void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ +#ifndef OMASA_DIFFUSE_ISM_MERGE IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ +#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ @@ -358,7 +360,7 @@ void ivas_omasa_enc( ivas_masa_combine_directions( hMasa ); - hMasa->config.numCodingBands = n_bands_orig; + hMasa->config.numCodingBands = (int8_t)n_bands_orig; } // force computation into high resolution -- GitLab From 6d5d3f18df800beebf7f05ba73054534b20cbd83 Mon Sep 17 00:00:00 2001 From: advasila Date: Tue, 7 Mar 2023 15:17:46 +0200 Subject: [PATCH 0057/1418] fix fp precision --- lib_com/ivas_omasa_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index f825b41252..da3a0cf503 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -390,7 +390,7 @@ void calculate_nbits_meta( priority[obj] = max_p; } } - bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); + bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - ( (int16_t) ( priority[obj] * 1000.0f ) ) * 0.001f ) * 7 ); } return; } -- GitLab From aabaaa86e190b40ecd718f9a802b2dbb244e4af6 Mon Sep 17 00:00:00 2001 From: advasila Date: Wed, 8 Mar 2023 11:51:32 +0200 Subject: [PATCH 0058/1418] remove TUNING_2obj switch --- lib_com/ivas_omasa_com.c | 4 ---- lib_com/ivas_rom_com.c | 4 ---- lib_com/options.h | 1 - 3 files changed, 9 deletions(-) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 0c6c35afab..e248cc5a9d 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -102,11 +102,7 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 2: -#ifdef TUNING_48kbps_2obj if ( ivas_total_brate >= IVAS_48k ) -#else - if ( ivas_total_brate >= IVAS_64k ) -#endif { ism_mode = ISM_MASA_MODE_DISC; } diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index ec2b6c5b93..66db7666f2 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2794,11 +2794,7 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = #else {9600, 0, 0, 0}, /* 32k */ #endif -#ifdef TUNING_48kbps_2obj {IVAS_13k2, 9600, 0, 0}, /* 48k */ -#else - {IVAS_13k2, 0, 0, 0}, /* 48k */ -#endif #ifdef OMASA_BRATE {16000, 11700, 0, 0}, /* 64k */ #else diff --git a/lib_com/options.h b/lib_com/options.h index d0fda9cf9f..4a4fefae31 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,7 +173,6 @@ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ -#define TUNING_48kbps_2obj #define TUNING_DISC_3_4obj /* Nokia: increase bitrate for objects in DISC mode at 128k 4obj and 96k 3 obj */ #define REDUCE_OMASA_META_BITS /* Nokia: reduce metadata number of bits and fix directional metadata bit allocation */ -- GitLab From a8f5f41389dcb7c7510fb20aa9ea3cc3a8bd8ee4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 8 Mar 2023 15:17:26 +0100 Subject: [PATCH 0059/1418] - support of bitrate switching in OMASA format; under OMASA_BRATE_SW --- lib_com/ivas_ism_config.c | 28 ++ lib_com/ivas_omasa_com.c | 41 +++ lib_com/ivas_prot.h | 38 ++- lib_com/options.h | 2 + lib_dec/ivas_corecoder_dec_reconfig.c | 2 + lib_dec/ivas_cpe_dec.c | 4 +- lib_dec/ivas_init_dec.c | 39 ++- lib_dec/ivas_ism_metadata_dec.c | 23 +- lib_dec/ivas_ism_renderer.c | 12 +- lib_dec/ivas_masa_dec.c | 45 +-- lib_dec/ivas_omasa_dec.c | 285 ++++++++++++++++++- lib_dec/ivas_stereo_switching_dec.c | 4 + lib_enc/ivas_corecoder_enc_reconfig.c | 16 +- lib_enc/ivas_cpe_enc.c | 6 +- lib_enc/ivas_enc.c | 11 + lib_enc/ivas_ism_metadata_enc.c | 8 +- lib_enc/ivas_masa_enc.c | 6 + lib_enc/ivas_omasa_enc.c | 121 +++++++- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 +- 19 files changed, 628 insertions(+), 67 deletions(-) diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 06ccd94a31..c329344804 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -586,3 +586,31 @@ ISM_MODE ivas_ism_mode_select( return ism_mode; } + + +#ifdef OMASA_BRATE_SW +/*------------------------------------------------------------------------- + * ivas_ism_metadata_close() + * + * Deallocate ISM metadata handles + *-------------------------------------------------------------------------*/ + +void ivas_ism_metadata_close( + ISM_METADATA_HANDLE *hIsmMetaData, /* i/o: ISM metadata handles */ + const int16_t first_idx /* i : index of first handle to deallocate */ +) +{ + int16_t n; + + for ( n = first_idx; n < MAX_NUM_OBJECTS; n++ ) + { + if ( hIsmMetaData[n] != NULL ) + { + free( hIsmMetaData[n] ); + hIsmMetaData[n] = NULL; + } + } + + return; +} +#endif diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index a14b4c908c..71a452dadd 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -169,6 +169,47 @@ ISM_MODE ivas_omasa_ism_mode_select( } +#ifdef OMASA_BRATE_SW +/*--------------------------------------------------------------- + * ivas_set_omasa_TC() + * + * set number of transport channels in OMASA format + * ---------------------------------------------------------------*/ + +void ivas_set_omasa_TC( + const ISM_MODE ism_mode, /* i : ISM mode */ + const int16_t nchan_ism, /* i : number of input ISMs */ + int16_t *nSCE, /* o : number of SCEs */ + int16_t *nCPE /* o : number of CPEs */ +) +{ + switch ( ism_mode ) + { + case ISM_MASA_MODE_PARAM: + *nCPE = 1; + *nSCE = 0; + break; + case ISM_MASA_MODE_ONE_OBJ: + *nCPE = 1; + *nSCE = 1; + break; + case ISM_MASA_MODE_DISC: + *nCPE = 1; + *nSCE = nchan_ism; + break; + case ISM_MODE_NONE: + *nCPE = 1; + *nSCE = 0; + break; + default: + break; + } + + return; +} +#endif + + #ifdef OMASA_BRATE /*--------------------------------------------------------------- * ivas_interformat_brate() diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b20eb35e3b..fb117e8e81 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -799,9 +799,16 @@ float ism_dequant_meta( ivas_error set_ism_metadata( ISM_METADATA_HANDLE hIsmMeta, /* i/o: ISM metadata handle */ float azimuth, /* i : azimuth */ - float elevation /* i : elevation */ + float elevation /* i : elevation */ ); +#ifdef OMASA_BRATE_SW +void ivas_ism_metadata_close( // VE: use it also at the encoder + ISM_METADATA_HANDLE *hIsmMetaData, /* i/o: ISM metadata handles */ + const int16_t first_idx /* i : index of first handle to deallocate */ +); +#endif + ivas_error create_ism_metadata_enc( Encoder_Struct *st_ivas, /* i/o: IVAS encoder structure */ const int16_t n_ISms, /* i : number of objects */ @@ -5024,13 +5031,23 @@ void ivas_omasa_enc_close( const int16_t nchan_ism /* i : number of objects */ ); +#ifdef OMASA_BRATE_SW +ivas_error ivas_omasa_enc_config( + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +); + +ivas_error ivas_omasa_dec_config( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +); +#endif + void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs /* i : Input sample rate */ #ifdef OMASA_DIFFUSE_ISM_MERGE , - ISM_MODE ismMode /* i : ISM mode */ + const ISM_MODE ismMode /* i : ISM mode */ #endif ); @@ -5061,7 +5078,7 @@ void ivas_set_surplus_brate_enc( void ivas_set_surplus_brate_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - int32_t *ism_total_brate /* i : ISM total bit-rate */ + int32_t *ism_total_brate /* i : ISM total bitrate */ ); void set_ism_importance_interformat( @@ -5097,6 +5114,15 @@ ISM_MODE ivas_omasa_ism_mode_select( const int16_t nchan_ism /* i : number of input ISM's */ ); +#ifdef OMASA_BRATE_SW +void ivas_set_omasa_TC( + const ISM_MODE ism_mode, /* i : ISM mode */ + const int16_t nchan_ism, /* i : number of input ISMs */ + int16_t *nSCE, /* o : number of SCEs */ + int16_t *nCPE /* o : number of CPEs */ +); +#endif + void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ float data_in_f2[][L_FRAME48k], /* i : Transport audio signals 2 */ @@ -5109,6 +5135,12 @@ ivas_error ivas_masa_ism_data_open( Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); +#ifdef OMASA_BRATE_SW +void ivas_masa_ism_data_close( + MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ +); +#endif + void preProcessStereoTransportsForMovedObjects( Decoder_Struct* st_ivas, float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], diff --git a/lib_com/options.h b/lib_com/options.h index d0fda9cf9f..710803fcbc 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,8 @@ #define FIX_4OBJ_128 /* VA: fix to 4 ISMs 24 kbps case: when all objects are HIGH_IMP, keep 24 kbps bitrate, otherwise increase the 24 kbps bitrate */ +#define OMASA_BRATE_SW /* VA: support of bitrate switching in OMASA format */ + #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index bb2b753181..5317781d55 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -512,10 +512,12 @@ ivas_error ivas_cldfb_dec_reconfig( } } } + /* CLDFB Interpolation weights */ if ( st_ivas->sba_mode == SBA_MODE_SPAR && ( numCldfbAnalyses_old != numCldfbAnalyses || numCldfbSyntheses_old != numCldfbSyntheses || nchan_transport_old != st_ivas->nchan_transport ) ) { ivas_spar_get_cldfb_gains( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); } + return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index eab7b7c340..545dc8fbb3 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -176,7 +176,6 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS } #endif - } else { @@ -711,10 +710,11 @@ ivas_error create_cpe_dec( { #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || + ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) #else if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || -#endif ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) +#endif { if ( ( hCPE->input_mem[i] = (float *) malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f530e8ecce..2d5a3168f2 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -71,7 +71,9 @@ ivas_error ivas_dec_setup( int32_t ivas_total_brate; ivas_error error; #ifdef MASA_AND_OBJECTS +#ifndef OMASA_BRATE_SW int32_t cpe_brate; +#endif #endif error = IVAS_ERR_OK; @@ -159,6 +161,12 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { +#ifdef OMASA_BRATE_SW + if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->nCPE == 1 ) { st_ivas->hCPE[0]->nchan_out = 1; @@ -170,6 +178,7 @@ ivas_error ivas_dec_setup( return error; } } +#endif } } } @@ -177,8 +186,8 @@ ivas_error ivas_dec_setup( else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ - /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata*/ + /* for the DISC mode the number of objects are written at the end of the bitstream, in the MASA metadata */ st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 1] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + 1; st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -187,6 +196,12 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { +#ifdef OMASA_BRATE_SW + if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } +#else cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) && st_ivas->nCPE == 1 ) { @@ -196,6 +211,7 @@ ivas_error ivas_dec_setup( { return error; } +#endif } } } @@ -1051,10 +1067,17 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); #ifdef OMASA_BRATE +#ifdef OMASA_BRATE_SW + if ( ( error = create_ism_metadata_dec( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } +#endif #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -1740,7 +1763,11 @@ void ivas_destroy_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { +#ifdef OMASA_BRATE_SW + int16_t i; +#else int16_t i, n; +#endif /* CLDFB handles */ for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) @@ -1807,6 +1834,9 @@ void ivas_destroy_dec( } /* ISM metadata handles */ +#ifdef OMASA_BRATE_SW + ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); +#else for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) { if ( st_ivas->hIsmMetaData[n] != NULL ) @@ -1815,6 +1845,7 @@ void ivas_destroy_dec( st_ivas->hIsmMetaData[n] = NULL; } } +#endif /* ISm renderer handle */ if ( st_ivas->hIsmRendererData != NULL ) @@ -1902,8 +1933,12 @@ void ivas_destroy_dec( free( st_ivas->hMonoDmxRenderer ); st_ivas->hMonoDmxRenderer = NULL; } + #ifdef MASA_AND_OBJECTS /* MASA ISM structure */ +#ifdef OMASA_BRATE_SW + ivas_masa_ism_data_close( &st_ivas->hMasaIsmData ); +#else if ( st_ivas->hMasaIsmData != NULL ) { if ( st_ivas->hMasaIsmData->delayBuffer != NULL ) @@ -1919,6 +1954,8 @@ void ivas_destroy_dec( st_ivas->hMasaIsmData = NULL; } #endif +#endif + /* Head track data handle */ if ( st_ivas->hHeadTrackData != NULL ) { diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index e72d691768..5e404c0ff9 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -596,10 +596,10 @@ ivas_error ivas_ism_metadata_dec( * Create, allocate, initialize and configure IVAS decoder ISM handles *-------------------------------------------------------------------------*/ -ivas_error create_ism_metadata_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - const int16_t n_ISms, /* i : number of objects */ - int32_t element_brate_tmp[] /* o : element bitrate per object */ +ivas_error create_ism_metadata_dec( // VE: rename to ivas_ism_metadata_dec_create + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int16_t n_ISms, /* i : number of objects */ + int32_t element_brate_tmp[] /* o : element bitrate per object */ ) { int16_t ch; @@ -624,12 +624,19 @@ ivas_error create_ism_metadata_dec( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } - ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL +#ifdef OMASA_BRATE_SW + if ( element_brate_tmp != NULL ) + { +#endif + ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL #ifdef MASA_AND_OBJECTS - , - 0 + , + 0 +#endif + ); +#ifdef OMASA_BRATE_SW + } #endif - ); return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index ef890a7482..30a32e03a6 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -252,10 +252,10 @@ void ivas_ism_get_stereo_gains( #ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------------* - * ivas_masa_ism_separate_object_renderer_open() - * - * Open structures, reserve memory, and init values. - *-------------------------------------------------------------------------*/ +* ivas_masa_ism_separate_object_renderer_open() +* + * Open structures, reserve memory, and init values. + *-------------------------------------------------------------------------*/ ivas_error ivas_masa_ism_separate_object_renderer_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ @@ -266,10 +266,9 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( if ( ( st_ivas->hIsmRendererData = (ISM_RENDERER_HANDLE) malloc( sizeof( ISM_RENDERER_DATA ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer \n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM renderer \n" ) ); } - for ( i = 0; i < MAX_NUM_OBJECTS; i++ ) { set_f( st_ivas->hIsmRendererData->prev_gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); @@ -296,6 +295,7 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); } + for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) { if ( ( st_ivas->hMasaIsmData->delayBuffer[i] = (float *) malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index f45b1527ff..6cd00b03e8 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -419,10 +419,12 @@ ivas_error ivas_masa_decode( } } } + if ( st_ivas->hDirAC != NULL ) { ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, SBA_MODE_NONE, 0 ); } + #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -433,6 +435,7 @@ ivas_error ivas_masa_decode( return error; } } + if ( st_ivas->hDirAC != NULL ) { #ifndef OMASA_BRATE @@ -461,7 +464,9 @@ ivas_error ivas_masa_decode( } } #endif + st->next_bit_pos = next_bit_pos_orig; + #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { @@ -581,45 +586,6 @@ ivas_error ivas_masa_dec_open( return IVAS_ERR_OK; } -#ifdef MASA_AND_OBJECTS -/*-------------------------------------------------------------------* - * ivas_masa_ism_data_open() - * - * - *-------------------------------------------------------------------*/ - -ivas_error ivas_masa_ism_data_open( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ -) -{ - MASA_ISM_DATA_HANDLE hMasaIsmData; - int16_t ch, bin; - - if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA ISM data\n" ) ); - } - - for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - for ( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->ismPreprocMatrix[ch][ch][bin] = 1.0f; - hMasaIsmData->ismPreprocMatrix[1 - ch][ch][bin] = 0.0f; - hMasaIsmData->eneMoveIIR[ch][bin] = 0.0f; - hMasaIsmData->enePreserveIIR[ch][bin] = 0.0f; - } - hMasaIsmData->preprocEneTarget[bin] = 0.0f; - hMasaIsmData->preprocEneRealized[bin] = 0.0f; - } - hMasaIsmData->objectsMoved = 0; - hMasaIsmData->delayBuffer = NULL; - st_ivas->hMasaIsmData = hMasaIsmData; - - return IVAS_ERR_OK; -} -#endif - /*-----------------------------------------------------------------------* * ivas_masa_dec_close() @@ -1374,6 +1340,7 @@ ivas_error ivas_masa_dec_reconfigure( } } } + #ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 5ca00ff79e..98e7b7eeee 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -35,11 +35,294 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" +#ifdef OMASA_BRATE_SW +#include "ivas_rom_com.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif +#ifdef MASA_AND_OBJECTS +/*-------------------------------------------------------------------* + * ivas_masa_ism_data_open() + * + * Allocate and initialize MASA_ISM rendering handle + *-------------------------------------------------------------------*/ + +ivas_error ivas_masa_ism_data_open( + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ +) +{ + MASA_ISM_DATA_HANDLE hMasaIsmData; + int16_t ch, bin; + + if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA ISM data\n" ) ); + } + + for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) + { + for ( ch = 0; ch < 2; ch++ ) + { + hMasaIsmData->ismPreprocMatrix[ch][ch][bin] = 1.0f; + hMasaIsmData->ismPreprocMatrix[1 - ch][ch][bin] = 0.0f; + hMasaIsmData->eneMoveIIR[ch][bin] = 0.0f; + hMasaIsmData->enePreserveIIR[ch][bin] = 0.0f; + } + hMasaIsmData->preprocEneTarget[bin] = 0.0f; + hMasaIsmData->preprocEneRealized[bin] = 0.0f; + } + + hMasaIsmData->objectsMoved = 0; + hMasaIsmData->delayBuffer = NULL; + st_ivas->hMasaIsmData = hMasaIsmData; + + return IVAS_ERR_OK; +} + + +#ifdef OMASA_BRATE_SW +/*-------------------------------------------------------------------* + * ivas_masa_ism_data_close() + * + * Deallocate MASA_ISM rendering handle + *-------------------------------------------------------------------*/ + +void ivas_masa_ism_data_close( + MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ +) +{ + int16_t i; + + if ( hMasaIsmData == NULL || *hMasaIsmData == NULL ) + { + return; + } + + if ( ( *hMasaIsmData )->delayBuffer != NULL ) + { + for ( i = 0; i < ( *hMasaIsmData )->delayBuffer_nchan; i++ ) + { + free( ( *hMasaIsmData )->delayBuffer[i] ); + } + free( ( *hMasaIsmData )->delayBuffer ); + ( *hMasaIsmData )->delayBuffer = NULL; + } + + free( *hMasaIsmData ); + *hMasaIsmData = NULL; + + return; +} +#endif +#endif + + +#ifdef OMASA_BRATE_SW +/*--------------------------------------------------------------------------* + * ivas_omasa_dec_config() + * + * oMASA decoder configuration + *--------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_dec_config( + Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ +) +{ + int16_t k, n, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; + int32_t ivas_total_brate, ism_total_brate, cpe_brate; + IVAS_FORMAT ivas_format_old; + ISM_MODE ism_mode_old; + ivas_error error; + + /* initializations */ + error = IVAS_ERR_OK; + ism_total_brate = 0; + ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; + + /* save previous frame parameters */ + ism_mode_old = ivas_omasa_ism_mode_select( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->nchan_ism ); + st_ivas->ism_mode = ism_mode_old; + + ivas_format_old = st_ivas->ivas_format; + if ( ism_mode_old == ISM_MASA_MODE_PARAM || ism_mode_old == ISM_MASA_MODE_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_DISC ) + { + st_ivas->ivas_format = MASA_ISM_FORMAT; + } + ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); + nSCE_old = st_ivas->nSCE; + nchan_hp20_old = getNumChanSynthesis( st_ivas ); + + /* reconstruct parameters */ + st_ivas->ivas_format = ivas_format_old; + if ( st_ivas->ivas_format == MASA_FORMAT ) + { + st_ivas->nchan_ism = 0; + } + + /* set ism_mode of current frame */ + st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); + + /* MASA reconfig. */ + cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) && st_ivas->nCPE == 1 ) + { + st_ivas->hCPE[0]->nchan_out = 1; + } + else if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* OMASA reconfig. */ + if ( st_ivas->hMasaIsmData == NULL && st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( ( error = ivas_masa_ism_data_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + ivas_set_omasa_TC( st_ivas->ism_mode, st_ivas->nchan_ism, &st_ivas->nSCE, &st_ivas->nCPE ); + + /* re-configure hp20 memories */ + if ( ( error = ivas_hp20_dec_reconfig( st_ivas, nchan_hp20_old ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* reconfigure core-coders for ISMs */ + if ( st_ivas->ivas_format == MASA_FORMAT ) + { + if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, -1, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + k = 0; + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) + { + k++; + } + + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + } + + if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + + if ( ism_mode_old != st_ivas->ism_mode ) + { + /* ISM MD reconfig. */ + n_MD = 0; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + n_MD = 1; + + if ( st_ivas->hIsmMetaData[0] == NULL ) + { + if ( ( error = create_ism_metadata_dec( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + n_MD = st_ivas->nchan_ism; + + ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); + + if ( ( error = create_ism_metadata_dec( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); + + /* CLDFB instances */ + if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) + { + return error; + } + + st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; + + /* objects renderer reconfig. */ + if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + { + if ( st_ivas->hIsmRendererData == NULL ) + { + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + { + for ( n = 1; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) + { + free( st_ivas->hMasaIsmData->delayBuffer[n] ); + } + + st_ivas->hMasaIsmData->delayBuffer_nchan = 1; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + float tmp[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; + + st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; + + mvr2r( st_ivas->hMasaIsmData->delayBuffer[0], tmp, st_ivas->hMasaIsmData->delayBuffer_size ); + free( st_ivas->hMasaIsmData->delayBuffer[0] ); + free( st_ivas->hMasaIsmData->delayBuffer ); + if ( ( st_ivas->hMasaIsmData->delayBuffer = (float **) malloc( st_ivas->hMasaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); + } + + for ( n = 0; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) + { + if ( ( st_ivas->hMasaIsmData->delayBuffer[n] = (float *) malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); + } + set_zero( st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); + } + mvr2r( tmp, st_ivas->hMasaIsmData->delayBuffer[0], st_ivas->hMasaIsmData->delayBuffer_size ); + } + } + else if ( st_ivas->ism_mode != ISM_MASA_MODE_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) + { + for ( n = 0; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) + { + free( st_ivas->hMasaIsmData->delayBuffer[n] ); + } + free( st_ivas->hMasaIsmData->delayBuffer ); + st_ivas->hMasaIsmData->delayBuffer = NULL; + + free( st_ivas->hIsmRendererData ); + st_ivas->hIsmRendererData = NULL; + } + } + + return error; +} +#endif + + #ifdef OMASA_BRATE /*--------------------------------------------------------------------------* * ivas_set_surplus_brate_dec() @@ -49,7 +332,7 @@ void ivas_set_surplus_brate_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ - int32_t *ism_total_brate /* i/o: ISM total bit-rate */ + int32_t *ism_total_brate /* i/o: ISM total bitrate */ ) { int16_t n, bits_ism, bits_element[MAX_NUM_OBJECTS]; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 20d03915c2..45257627a8 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -880,7 +880,11 @@ ivas_error stereo_memory_dec( * Bitrate switching in MASA format *---------------------------------------------------------------*/ +#ifdef OMASA_BRATE_SW + if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && nchan_transport == 2 ) +#else if ( ivas_format == MASA_FORMAT && nchan_transport == 2 ) +#endif { if ( hCPE->nchan_out == 1 ) { diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index e8486d7738..27c855ec6f 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -230,7 +230,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hCPE[0]->hStereoMdct = NULL; } - /* create missing core coder elements and set element bitrates for alrady existing ones */ + /* create missing core coder elements and set element bitrates for already existing ones */ if ( st_ivas->nSCE > 0 ) { nSCE_existing = min( nSCE_old, st_ivas->nSCE ); @@ -250,7 +250,11 @@ ivas_error ivas_corecoder_enc_reconfig( } /* propagate input audio buffers */ +#ifdef OMASA_BRATE_SW + if ( n_CoreCoder_existing > sce_id && hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) +#else if ( n_CoreCoder_existing > sce_id ) +#endif { mvr2r( input_buff[sce_id], st_ivas->hSCE[sce_id]->hCoreCoder[0]->input_buff, len_inp_memory ); } @@ -259,7 +263,11 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ +#ifdef OMASA_BRATE_SW + if ( sce_id > 0 || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) +#else if ( sce_id > 0 ) +#endif { reset_indices_enc( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr, MAX_NUM_INDICES ); } @@ -289,7 +297,13 @@ 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() */ st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; +#ifdef OMASA_BRATE_SW + if ( ( cpe_id * CPE_CHANNELS + n > 0 ) || + ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) || + ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 ) ) +#else if ( cpe_id * CPE_CHANNELS + n > 0 || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) ) +#endif { reset_indices_enc( st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr, MAX_NUM_INDICES ); } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index cf69b1e333..ab4567ad6f 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -268,7 +268,11 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode != IVAS_CPE_MDCT && ( hCPE->element_brate != hCPE->last_element_brate || hCPE->last_element_mode != hCPE->element_mode || - sts[0]->ini_frame == 0 || sts[0]->last_core_brate <= SID_2k40 ) ) /* If the last frame was SID or NO_DATA, we need to run stereo_dft_config here since VAD decision is not known yet */ + sts[0]->ini_frame == 0 || +#ifdef OMASA_BRATE_SW + ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) || +#endif + sts[0]->last_core_brate <= SID_2k40 ) ) /* If the last frame was SID or NO_DATA, we need to run stereo_dft_config here since VAD decision is not known yet */ { if ( st_ivas->hQMetaData != NULL ) { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a3adbda9b6..fef6c63211 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -300,7 +300,14 @@ ivas_error ivas_enc( float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; +#ifdef OMASA_BRATE_SW + if ( ( error = ivas_omasa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } +#else ivas_masa_enc_reconfigure( st_ivas ); +#endif hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; @@ -315,6 +322,9 @@ ivas_error ivas_enc( set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); #ifdef OMASA_BRATE +#ifdef OMASA_BRATE_SW + idx_separated_object = 0; +#else /* Configure MASA encoder based on frame parameters */ if ( ( error = ivas_masa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { @@ -332,6 +342,7 @@ ivas_error ivas_enc( #endif ); } +#endif /* Estimate TF-tile energy for the input MASA stream */ ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport ); diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 43c498bcd0..88a782ccbe 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -958,11 +958,13 @@ ivas_error create_ism_metadata_enc( { int16_t ch, nchan_transport; - // VE: this part of the code is better to be moved to a separate function, e.g. ivas_set_omasa_TC() #ifdef MASA_AND_OBJECTS nchan_transport = st_ivas->nchan_transport; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { +#ifdef OMASA_BRATE_SW + ivas_set_omasa_TC( st_ivas->ism_mode, n_ISms, &st_ivas->nSCE, &st_ivas->nCPE ); +#else switch ( st_ivas->ism_mode ) { case ISM_MASA_MODE_PARAM: @@ -985,6 +987,7 @@ ivas_error create_ism_metadata_enc( default: break; } +#endif } else { @@ -1041,12 +1044,13 @@ ivas_error create_ism_metadata_enc( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } + #ifdef MASA_AND_OBJECTS if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { - ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, 1, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ); + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, 1, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ); // VE: nchan_transport ????? } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index f31badf9b3..ac8380a503 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -707,6 +707,7 @@ ivas_error ivas_masa_enc_config( } } #endif + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, hQMetaData, &st_ivas->hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE #ifdef MASA_AND_OBJECTS @@ -714,6 +715,7 @@ ivas_error ivas_masa_enc_config( ivas_format, st_ivas->ism_mode, ism_total_brate #endif ); + hQMetaData->is_masa_ivas_format = 1; #ifdef MASA_AND_OBJECTS @@ -747,6 +749,7 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS } #endif + /* Setup importance weights for two-direction band selection. */ if ( hMasa->config.numberOfDirections == 2 ) { @@ -1977,6 +1980,7 @@ void ivas_masa_enc_reconfigure( #endif ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; + #ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) @@ -1987,6 +1991,7 @@ void ivas_masa_enc_reconfigure( } } #endif + if ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) { for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) @@ -2043,6 +2048,7 @@ void ivas_masa_enc_reconfigure( return; } + #ifdef MASA_AND_OBJECTS #ifdef OMASA_DIFFUSE_ISM_MERGE /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index b7fe8ee27e..e739410ffb 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -230,6 +230,123 @@ void ivas_omasa_enc_close( } +#ifdef OMASA_BRATE_SW +/*--------------------------------------------------------------------------* + * ivas_omasa_enc_config() + * + * oMASA encoder configuration + *--------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_enc_config( + Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ +) +{ + int16_t k, sce_id, nSCE_old; + int32_t ivas_total_brate, ism_total_brate; + ISM_MODE ism_mode_old; + ENCODER_CONFIG_HANDLE hEncoderConfig; + ivas_error error; + + error = IVAS_ERR_OK; + hEncoderConfig = st_ivas->hEncoderConfig; + ivas_total_brate = hEncoderConfig->ivas_total_brate; + + + //ivas_masa_enc_reconfigure( st_ivas ); // VE: might not be needed + + + ism_mode_old = st_ivas->ism_mode; + nSCE_old = st_ivas->nSCE; + + st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, hEncoderConfig->nchan_ism ); + st_ivas->nchan_transport = 2; + + /* reconfiguration in case of bitrate switching */ + if ( hEncoderConfig->last_ivas_total_brate != ivas_total_brate ) + { + ivas_set_omasa_TC( st_ivas->ism_mode, hEncoderConfig->nchan_ism, &st_ivas->nSCE, &st_ivas->nCPE ); + + k = 0; + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) + { + k++; + } + + ism_total_brate = 0; + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) // VE!!!!! + { + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1 ); + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nSCE, NULL, NULL, NULL, NULL, NULL, NULL, 1 ); + } + + /* reconfigure core-coders for ISMs */ + if ( ( error = ivas_corecoder_enc_reconfig( st_ivas, nSCE_old, 1, 2, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate, MC_MODE_NONE ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* re-write IVAS format signalling - actual 'ism_mode' was not known before */ + if ( st_ivas->nSCE > 0 ) + { + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->next_ind ); + } + else + { + reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->next_ind ); + } + + ivas_write_format( st_ivas ); + + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hOMasa == NULL ) + { + if ( ( error = ivas_omasa_enc_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hOMasa != NULL ) + { + ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); + st_ivas->hOMasa = NULL; + } + + st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; + + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) + { + hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; + } + else + { + hEncoderConfig->element_mode_init = IVAS_CPE_DFT; + } + } + + /* Configure MASA encoder based on frame parameters */ + if ( ( error = ivas_masa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) + { + /* Configure oMASA analysis based on MASA config */ + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); + } + + return error; +} +#endif + + /*--------------------------------------------------------------------------* * ivas_omasa_set_config() * @@ -242,7 +359,7 @@ void ivas_omasa_set_config( const int32_t input_Fs /* i : Input sample rate */ #ifdef OMASA_DIFFUSE_ISM_MERGE , - ISM_MODE ismMode /* i : ISM mode */ + const ISM_MODE ismMode /* i : ISM mode */ #endif ) { @@ -673,7 +790,7 @@ void ivas_set_surplus_brate_enc( 0 #endif ); - /* note: ISM st->total_brate is iset in ivas_sce_enc() */ + /* note: ISM st->total_brate is set in ivas_sce_enc() */ } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 72ac9311c5..89bff9f74a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1038,8 +1038,10 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric { #ifdef MASA_AND_OBJECTS float spectrumModVal; + + idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ - spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 )]; + spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; diffEne *= spectrumModVal; #else idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); -- GitLab From da8fdcd7936d9162257b25f0edd876319cb79ae3 Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 24 Mar 2023 11:59:43 +1100 Subject: [PATCH 0060/1418] split rendering updates --- Makefile | 2 +- Workspace_msvc/lib_rend.vcxproj | 31 +- Workspace_msvc/lib_util.vcxproj | 2 + .../split_renderer_config_384_3dof.txt | 7 + .../split_renderer_config_384_3dof_hq.txt | 7 + .../split_renderer_config_512_2dof.txt | 7 + .../split_renderer_config_768_1dof.txt | 7 + .../split_renderer_config_fc_384_3dof.txt | 7 + .../split_renderer_config_fc_384_3dof_hq.txt | 7 + .../split_renderer_config_fc_512_2dof.txt | 7 + .../split_renderer_config_fc_768_1dof.txt | 7 + .../split_renderer_config_pcm_1dof.txt | 10 + .../split_renderer_config_pcm_2dof.txt | 10 + .../split_renderer_config_pcm_3dof.txt | 10 + .../split_renderer_config_pcm_3dof_hq.txt | 10 + .../sample_split_rend_script_ivas_enc_dec.py | 138 + .../sample_split_rend_script_ivas_rend.py | 147 + .../post-renderer_pose_files/post_0static.csv | 4 + .../pre_pitch-20static.csv | 4 + .../pre_pitch20static.csv | 4 + .../pre_roll-20static.csv | 4 + .../pre_roll20static.csv | 4 + .../pre_yaw-20pitch-20static.csv | 4 + .../pre_yaw-20static.csv | 4 + .../pre_yaw20pitch20static.csv | 4 + .../pre_yaw20static.csv | 4 + apps/decoder.c | 299 +- apps/renderer.c | 675 ++- lib_com/common_api_types.h | 47 +- lib_com/delay_comp.c | 15 +- lib_com/ivas_cnst.h | 64 +- lib_com/ivas_prot.h | 83 +- lib_com/ivas_tools.c | 1 - lib_com/options.h | 26 +- lib_com/prot.h | 4 + lib_debug/debug.c | 12 +- lib_debug/debug.h | 2 +- lib_debug/mem_count.c | 2 +- lib_dec/ivas_dec.c | 44 +- lib_dec/ivas_dirac_dec.c | 9 +- lib_dec/ivas_init_dec.c | 59 +- lib_dec/ivas_mc_param_dec.c | 3 + lib_dec/ivas_rom_dec.c | 36 +- lib_dec/ivas_rom_dec.h | 18 +- lib_dec/ivas_sba_dec.c | 22 +- lib_dec/ivas_spar_decoder.c | 6 +- lib_dec/ivas_stat_dec.h | 96 +- lib_dec/lib_dec.c | 77 +- lib_dec/lib_dec.h | 11 +- lib_enc/lib_enc.c | 4 + lib_rend/ivas_CQMFDecoder.c | 1375 ++++++ lib_rend/ivas_CQMFDecoder.h | 64 + lib_rend/ivas_CQMFEncoder.c | 2050 ++++++++ lib_rend/ivas_CQMFEncoder.h | 69 + lib_rend/ivas_CQMFHuff.c | 4124 +++++++++++++++++ lib_rend/ivas_CQMFHuff.h | 350 ++ lib_rend/ivas_MSPred.c | 357 ++ lib_rend/ivas_MSPred.h | 62 + lib_rend/ivas_NoiseGen.c | 82 + lib_rend/ivas_NoiseGen.h | 68 + ...rceptualModel.c => ivas_PerceptualModel.c} | 239 +- lib_rend/ivas_PerceptualModel.h | 59 + lib_rend/ivas_PredDecoder.c | 259 ++ lib_rend/ivas_PredDecoder.h | 84 + lib_rend/ivas_PredEncoder.c | 476 ++ lib_rend/ivas_PredEncoder.h | 88 + lib_rend/ivas_PredTables.h | 53 + ...SEnvDeltaHuff.c => ivas_RMSEnvDeltaHuff.c} | 40 +- lib_rend/ivas_RMSEnvDeltaHuff.h | 57 + lib_rend/ivas_RMSEnvGrouping.c | 922 ++++ lib_rend/ivas_RMSEnvGrouping.h | 66 + lib_rend/ivas_Tables.c | 196 + lib_rend/ivas_Tables.h | 126 + lib_rend/ivas_binauralRenderer.c | 198 +- lib_rend/ivas_cldfb_codec_bitstream.c | 307 ++ lib_rend/ivas_cldfb_codec_bitstream.h | 101 + lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c | 912 ---- lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h | 32 - lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c | 1226 ----- lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h | 33 - lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c | 1457 ------ lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h | 305 -- lib_rend/ivas_cldfb_trans_codec/NoiseGen.c | 47 - lib_rend/ivas_cldfb_trans_codec/NoiseGen.h | 35 - .../ivas_cldfb_trans_codec/PerceptualModel.h | 18 - .../ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h | 25 - .../ivas_cldfb_trans_codec/RMSEnvGrouping.c | 378 -- .../ivas_cldfb_trans_codec/RMSEnvGrouping.h | 31 - lib_rend/ivas_cldfb_trans_codec/Tables.c | 116 - lib_rend/ivas_cldfb_trans_codec/Tables.h | 65 - .../cldfb_codec_bitstream.c | 226 - .../cldfb_codec_bitstream.h | 62 - lib_rend/ivas_crend.c | 213 +- lib_rend/ivas_lib_rend_internal.h | 77 +- lib_rend/ivas_output_init.c | 32 +- lib_rend/ivas_render_config.c | 9 +- lib_rend/ivas_rom_binaural_crend_head.c | 392 ++ lib_rend/ivas_rom_rend.h | 4 + lib_rend/ivas_rotation.c | 43 + lib_rend/ivas_splitRend_lcld_dec.c | 152 +- lib_rend/ivas_splitRend_lcld_enc.c | 149 +- lib_rend/ivas_splitRendererPost.c | 1715 +++++-- lib_rend/ivas_splitRendererPre.c | 1555 ++++--- lib_rend/ivas_splitRenderer_utils.c | 356 +- lib_rend/lib_rend.c | 1148 ++++- lib_rend/lib_rend.h | 19 +- lib_util/render_config_reader.c | 52 +- lib_util/split_render_file_read_write.c | 254 + lib_util/split_render_file_read_write.h | 61 + 109 files changed, 18179 insertions(+), 6959 deletions(-) create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt create mode 100644 Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py create mode 100644 Workspace_msvc/sample_split_rend_script_ivas_rend.py create mode 100644 Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch-20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll-20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20pitch-20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20pitch20static.csv create mode 100644 Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20static.csv create mode 100644 lib_rend/ivas_CQMFDecoder.c create mode 100644 lib_rend/ivas_CQMFDecoder.h create mode 100644 lib_rend/ivas_CQMFEncoder.c create mode 100644 lib_rend/ivas_CQMFEncoder.h create mode 100644 lib_rend/ivas_CQMFHuff.c create mode 100644 lib_rend/ivas_CQMFHuff.h create mode 100644 lib_rend/ivas_MSPred.c create mode 100644 lib_rend/ivas_MSPred.h create mode 100644 lib_rend/ivas_NoiseGen.c create mode 100644 lib_rend/ivas_NoiseGen.h rename lib_rend/{ivas_cldfb_trans_codec/PerceptualModel.c => ivas_PerceptualModel.c} (51%) create mode 100644 lib_rend/ivas_PerceptualModel.h create mode 100644 lib_rend/ivas_PredDecoder.c create mode 100644 lib_rend/ivas_PredDecoder.h create mode 100644 lib_rend/ivas_PredEncoder.c create mode 100644 lib_rend/ivas_PredEncoder.h create mode 100644 lib_rend/ivas_PredTables.h rename lib_rend/{ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c => ivas_RMSEnvDeltaHuff.c} (61%) create mode 100644 lib_rend/ivas_RMSEnvDeltaHuff.h create mode 100644 lib_rend/ivas_RMSEnvGrouping.c create mode 100644 lib_rend/ivas_RMSEnvGrouping.h create mode 100644 lib_rend/ivas_Tables.c create mode 100644 lib_rend/ivas_Tables.h create mode 100644 lib_rend/ivas_cldfb_codec_bitstream.c create mode 100644 lib_rend/ivas_cldfb_codec_bitstream.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/NoiseGen.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/NoiseGen.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/Tables.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/Tables.h delete mode 100644 lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c delete mode 100644 lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h create mode 100644 lib_util/split_render_file_read_write.c create mode 100644 lib_util/split_render_file_read_write.h diff --git a/Makefile b/Makefile index d5b9a8781a..141a607b07 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SRC_LIBCOM = lib_com SRC_LIBDEBUG = lib_debug SRC_LIBDEC = lib_dec SRC_LIBENC = lib_enc -SRC_LIBREND = lib_rend lib_rend/ivas_cldfb_trans_codec +SRC_LIBREND = lib_rend SRC_LIBUTIL = lib_util SRC_APP = apps BUILD = build diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 0cef2758b9..dc739ee392 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -89,7 +89,7 @@ Disabled - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) EnableFastChecks @@ -126,7 +126,7 @@ Disabled - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;..\lib_util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) @@ -169,7 +169,7 @@ Neither false false - ivas_cldfb_trans_codec;..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) + ..\lib_com;..\lib_debug;..\lib_dec;..\lib_enc;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;$(Macros);WIN32;%(PreprocessorDefinitions) true @@ -197,23 +197,26 @@ - - - - - - - - - + + + + + + + + + + + + - + - + diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 3e269dab4b..089554b323 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -157,6 +157,7 @@ + @@ -179,6 +180,7 @@ + diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt new file mode 100644 index 0000000000..a3f6373d69 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 384000; +DOF = 3; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt new file mode 100644 index 0000000000..3103a24b50 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 384000; +DOF = 3; +HQMODE = 1; + +[GENERAL] +RENDERER = CREND; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt new file mode 100644 index 0000000000..ef74dca52d --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 512000; +DOF = 2; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt new file mode 100644 index 0000000000..f1d2ed8168 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt new file mode 100644 index 0000000000..ef12d462c9 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 384000; +DOF = 3; +HQMODE = 0; + +[GENERAL] +RENDERER = FASTCONV; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt new file mode 100644 index 0000000000..56b6e2494f --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 384000; +DOF = 3; +HQMODE = 1; + +[GENERAL] +RENDERER = FASTCONV; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt new file mode 100644 index 0000000000..6dfcbbf0f8 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 512000; +DOF = 2; +HQMODE = 0; + +[GENERAL] +RENDERER = FASTCONV; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt new file mode 100644 index 0000000000..2c7a780f5c --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt @@ -0,0 +1,7 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; + +[GENERAL] +RENDERER = FASTCONV; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt new file mode 100644 index 0000000000..f70f7e67ce --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt @@ -0,0 +1,10 @@ +[SPLITREND] +BITRATE = 50000; +DOF = 1; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt new file mode 100644 index 0000000000..5bf2217ded --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt @@ -0,0 +1,10 @@ +[SPLITREND] +BITRATE = 50000; +DOF = 2; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt new file mode 100644 index 0000000000..193bc890a4 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt @@ -0,0 +1,10 @@ +[SPLITREND] +BITRATE = 70000; +DOF = 3; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt new file mode 100644 index 0000000000..e559a44f33 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt @@ -0,0 +1,10 @@ +[SPLITREND] +BITRATE = 70000; +DOF = 3; +HQMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py b/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py new file mode 100644 index 0000000000..4cfd0f32d1 --- /dev/null +++ b/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py @@ -0,0 +1,138 @@ +from scipy.io.wavfile import read, write +from scipy import signal +import subprocess +import numpy as np +import sys +import os + +## dimension of following 2 arrays should be same, that is for each file name there should be a tag +file_names = [ +'../scripts/testv/test_HOA3.wav' +]; +file_tags = [ +'test_HOA3' +]; + +## dimension of following 3 arrays should be same, that is for each pre file there should be a post file and a tag +pre_hr_file_names = [ +'trajectories/pre-renderer_pose_files/pre_yaw20static.csv' +]; +post_hr_file_names = [ +'trajectories/post-renderer_pose_files/post_0static.csv' +]; +hr_file_tags = [ +'yaw20static' +]; + +renderers = [ +('fast_conv_768_1dof', 'renderer_configs/split_renderer_config_fc_768_1dof.txt', '0'), +('fast_conv_512_2dof', 'renderer_configs/split_renderer_config_fc_512_2dof.txt', '0'), +('fast_conv_384_3dof', 'renderer_configs/split_renderer_config_fc_384_3dof.txt', '0'), +('fast_conv_384_3dof_hq', 'renderer_configs/split_renderer_config_fc_384_3dof_hq.txt', '0')]; + + +split_rend_file_outs = ['recons_out_pos0.wav', + 'recons_out_pos1.wav', + 'recons_out_pos2.wav', + 'rotated_ref_pos0.wav', + 'rotated_ref_pos1.wav', + 'rotated_ref_pos2.wav', + 'rotated_ref_RefPos.wav', + 'split_rend_MD_bitrate.txt'] + +def check_and_makedir(dir_path): + if not os.path.exists(dir_path): + try: + os.makedirs(dir_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise # raises the error again + + +def generate_split_rend_lis_items(file_dir, exe_dir, out_dir): + check_and_makedir(out_dir); + for idx in range(0, len(file_tags)): + for hr_idx in range(0, len(hr_file_tags)): + for rend in range(0, len(renderers)): + bitrate = '384000'; + filename = file_names[idx]; + file_in = os.path.join(file_dir, filename); + enc_exe = os.path.join(exe_dir, 'IVAS_cod.exe'); + dec_exe = os.path.join(exe_dir, 'IVAS_dec.exe'); + rend_exe = os.path.join(exe_dir, 'IVAS_rend.exe'); + file_pkt_name = '_'.join([file_tags[idx], bitrate, 'out.pkt']); + file_pkt = os.path.join(out_dir, file_pkt_name); + file_out_name = '_'.join([file_tags[idx], bitrate, renderers[rend][0], 'out.wav']); + file_out = os.path.join(out_dir, file_out_name); + bs_file_out_name = '_'.join([file_tags[idx], '_ivas_dec_out.pkt']); + bs_file_out = os.path.join(out_dir, bs_file_out_name); + + print(file_in) + print(file_pkt) + print(bs_file_out) + print(file_out) + + enc_cmd = [ + enc_exe, + '-sba', '3', + '-max_band', 'FB', + bitrate, + '48', + file_in, + file_pkt + ] + + hr_pre_file_name = pre_hr_file_names[hr_idx]; + hr_pre_file = os.path.join(file_dir, hr_pre_file_name); + hr_post_file_name = post_hr_file_names[hr_idx]; + hr_post_file = os.path.join(file_dir, hr_post_file_name); + + dec_cmd = [ + dec_exe, + '-RENDER_CONFIG', renderers[rend][1], + '-t', hr_pre_file, + 'SPLIT_BINAURAL', + '48', + file_pkt, + bs_file_out + ] + print(enc_cmd) + print(dec_cmd) + test_status = subprocess.call(enc_cmd, shell=False) + test_status = subprocess.call(dec_cmd, shell=False) + + post_rend_cmd = [ + rend_exe, + '-i', bs_file_out, + '-if', 'BINAURAL_SPLIT_CLDFB', + '-o', file_out, + '-of', 'BINAURAL', + '-fs', '48', + '-tf', hr_post_file, + ] + print(post_rend_cmd) + test_status = subprocess.call(post_rend_cmd, shell=False) + + if os.path.isfile(file_pkt): + os.remove(file_pkt) + + if os.path.exists(bs_file_out): + os.remove(bs_file_out); + + for fo in split_rend_file_outs: + file_old = os.path.join(os. getcwd(), fo); + file_out_name = '_'.join([file_tags[idx], hr_file_tags[hr_idx], fo]); + file_new = os.path.join(out_dir, file_out_name); + if os.path.exists(file_old): + os.rename(file_old, file_new); + + +def main(argv): + print('USAGE : python generate_split_rend_lis_items.py file_dir exe_dir out_dir') + if len(argv) < 3: + return print(len(argv)) + return generate_split_rend_lis_items(*argv[1:]) + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) \ No newline at end of file diff --git a/Workspace_msvc/sample_split_rend_script_ivas_rend.py b/Workspace_msvc/sample_split_rend_script_ivas_rend.py new file mode 100644 index 0000000000..c6ccd8e422 --- /dev/null +++ b/Workspace_msvc/sample_split_rend_script_ivas_rend.py @@ -0,0 +1,147 @@ +from scipy.io.wavfile import read, write +from scipy import signal +import subprocess +import numpy as np +import sys +import os + +## dimension of following 2 arrays should be same, that is for each file name there should be a tag +file_names = [ +'../scripts/testv/test_HOA3.wav' +]; +file_tags = [ +'test_HOA3' +]; + +## dimension of following 3 arrays should be same, that is for each pre file there should be a post file and a tag +pre_hr_file_names = [ +'trajectories/pre-renderer_pose_files/pre_yaw20static.csv' +]; +post_hr_file_names = [ +'trajectories/post-renderer_pose_files/post_0static.csv' +]; +hr_file_tags = [ +'yaw20static' +]; + +renderers = [ +('crend_768_1dof', 'renderer_configs/split_renderer_config_768_1dof.txt', '0'), +('crend_pcm_1dof', 'renderer_configs/split_renderer_config_pcm_1dof.txt', '1'), +('fast_conv_768_1dof', 'renderer_configs/split_renderer_config_fc_768_1dof.txt', '0'), +('crend_512_2dof', 'renderer_configs/split_renderer_config_512_2dof.txt', '0'), +('crend_pcm_2dof', 'renderer_configs/split_renderer_config_pcm_2dof.txt', '1'), +('fast_conv_512_2dof', 'renderer_configs/split_renderer_config_fc_512_2dof.txt', '0'), +('crend_384_3dof', 'renderer_configs/split_renderer_config_384_3dof.txt', '0'), +('crend_pcm_3dof', 'renderer_configs/split_renderer_config_pcm_3dof.txt', '1'), +('fast_conv_384_3dof', 'renderer_configs/split_renderer_config_fc_384_3dof.txt', '0'), +('crend_384_3dof_hq', 'renderer_configs/split_renderer_config_384_3dof_hq.txt', '0'), +('crend_pcm_3dof_hq', 'renderer_configs/split_renderer_config_pcm_3dof_hq.txt', '1'), +('fast_conv_384_3dof_hq', 'renderer_configs/split_renderer_config_fc_384_3dof_hq.txt', '0')]; + +split_md_file_name = 'split_md.bin'; + +split_rend_file_outs = ['recons_out_pos0.wav', + 'recons_out_pos1.wav', + 'recons_out_pos2.wav', + 'rotated_ref_pos0.wav', + 'rotated_ref_pos1.wav', + 'rotated_ref_pos2.wav', + 'rotated_ref_RefPos.wav', + 'split_rend_MD_bitrate.txt'] + + +def check_and_makedir(dir_path): + if not os.path.exists(dir_path): + try: + os.makedirs(dir_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise # raises the error again + + +def generate_split_rend_lis_items(file_dir, exe_dir, out_dir): + check_and_makedir(out_dir); + for idx in range(0, len(file_tags)): + for hr_idx in range(0, len(hr_file_tags)): + for rend in range(0, len(renderers)): + filename = file_names[idx]; + file_in = os.path.join(file_dir, filename); + rend_exe = os.path.join(exe_dir, 'IVAS_rend.exe'); + if renderers[rend][2] == '0': + bs_file_out_name = '_'.join([file_tags[idx], 'out.pkt']); + bs_file_out = os.path.join(out_dir, bs_file_out_name); + out_fmt = 'BINAURAL_SPLIT_CLDFB'; + else: + bs_file_out_name = '_'.join([file_tags[idx], 'out.wav']); + bs_file_out = os.path.join(out_dir, bs_file_out_name); + out_fmt = 'BINAURAL_SPLIT_PCM'; + md_out_arg = ['-om', split_md_file_name]; + md_in_arg = ['-im', split_md_file_name]; + file_out_name = '_'.join([file_tags[idx], renderers[rend][0], 'out.wav']); + file_out = os.path.join(out_dir, file_out_name); + + print(file_in) + print(bs_file_out) + print(file_out) + + hr_pre_file_name = pre_hr_file_names[hr_idx]; + hr_pre_file = os.path.join(file_dir, hr_pre_file_name); + hr_post_file_name = post_hr_file_names[hr_idx]; + hr_post_file = os.path.join(file_dir, hr_post_file_name); + + pre_rend_cmd = [ + rend_exe, + '-rc', renderers[rend][1], + md_out_arg[0], md_out_arg[1], + '-i', file_in, + '-if', 'HOA3', + '-o', bs_file_out, + '-of', out_fmt, + '-fs', '48', + '-tf', hr_pre_file, + ] + + + print(pre_rend_cmd) + test_status = subprocess.call(pre_rend_cmd, shell=False) + + + post_rend_cmd = [ + rend_exe, + md_in_arg[0], md_in_arg[1], + '-i', bs_file_out, + '-if', out_fmt, + '-o', file_out, + '-of', 'BINAURAL', + '-fs', '48', + '-tf', hr_post_file, + ] + + + print(post_rend_cmd) + test_status = subprocess.call(post_rend_cmd, shell=False) + + if os.path.exists(bs_file_out): + os.remove(bs_file_out); + + if os.path.exists(split_md_file_name): + os.remove(split_md_file_name); + + + for fo in split_rend_file_outs: + file_old = os.path.join(os. getcwd(), fo); + file_out_name = '_'.join([file_tags[idx], hr_file_tags[hr_idx], renderers[rend][0], fo]); + file_new = os.path.join(out_dir, file_out_name); + if os.path.exists(file_old): + os.rename(file_old, file_new); + + +def main(argv): + print('USAGE : python generate_split_rend_lis_items.py file_dir exe_dir out_dir') + if len(argv) < 3: + return print(len(argv)) + return generate_split_rend_lis_items(*argv[1:]) + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) \ No newline at end of file diff --git a/Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv b/Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv new file mode 100644 index 0000000000..a292a3576c --- /dev/null +++ b/Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv @@ -0,0 +1,4 @@ +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 +-3,0,0,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch-20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch-20static.csv new file mode 100644 index 0000000000..dab3c6940a --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch-20static.csv @@ -0,0 +1,4 @@ +-3,0,-20,0 +-3,0,-20,0 +-3,0,-20,0 +-3,0,-20,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch20static.csv new file mode 100644 index 0000000000..ae6ac9cd9c --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_pitch20static.csv @@ -0,0 +1,4 @@ +-3,0,20,0 +-3,0,20,0 +-3,0,20,0 +-3,0,20,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll-20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll-20static.csv new file mode 100644 index 0000000000..5db0b1cab3 --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll-20static.csv @@ -0,0 +1,4 @@ +-3,0,0,-20 +-3,0,0,-20 +-3,0,0,-20 +-3,0,0,-20 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll20static.csv new file mode 100644 index 0000000000..5bd8c2c4d9 --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_roll20static.csv @@ -0,0 +1,4 @@ +-3,0,0,20 +-3,0,0,20 +-3,0,0,20 +-3,0,0,20 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20pitch-20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20pitch-20static.csv new file mode 100644 index 0000000000..e48c0a58f5 --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20pitch-20static.csv @@ -0,0 +1,4 @@ +-3,-20,-20,0 +-3,-20,-20,0 +-3,-20,-20,0 +-3,-20,-20,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv new file mode 100644 index 0000000000..6e446847a9 --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv @@ -0,0 +1,4 @@ +-3,-20,0,0 +-3,-20,0,0 +-3,-20,0,0 +-3,-20,0,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20pitch20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20pitch20static.csv new file mode 100644 index 0000000000..58788cc7de --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20pitch20static.csv @@ -0,0 +1,4 @@ +-3,20,20,0 +-3,20,20,0 +-3,20,20,0 +-3,20,20,0 diff --git a/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20static.csv b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20static.csv new file mode 100644 index 0000000000..2d674f971b --- /dev/null +++ b/Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw20static.csv @@ -0,0 +1,4 @@ +-3,20,0,0 +-3,20,0,0 +-3,20,0,0 +-3,20,0,0 diff --git a/apps/decoder.c b/apps/decoder.c index 29d0e17119..1bd6168c96 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -57,6 +57,9 @@ #include "debug.h" #endif #include "render_config_reader.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "split_render_file_read_write.h" +#endif #define WMC_TOOL_MAN @@ -72,18 +75,19 @@ static #define MIN_NUM_BITS_ACTIVE_FRAME 56 #define NUM_BITS_SID_IVAS_5K2 104 -#define MAX_FRAME_SIZE ( 48000 / 50 ) +#define NUM_FRAMES_PER_SEC 50 +#define MAX_FRAME_SIZE ( 48000 / NUM_FRAMES_PER_SEC ) #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) #ifdef SPLIT_REND_WITH_HEAD_ROT -#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( 3750 ) /*temp buffer size for 1.5 mbps*/ +#define MAX_SPLIT_REND_BITRATE ( 768000 ) +#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) #endif #define IVAS_PUBLIC_ORIENT_TRK_REF 0 #define IVAS_PUBLIC_ORIENT_TRK_AVG 1 - typedef struct { char *inputBitstreamFilename; @@ -119,11 +123,6 @@ typedef struct FILE *agcBitstream; /* temporary */ #endif #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_SPLIT_REND_MODE splitRendMode; - char *postRendheadrotTrajFileName; -#endif - } DecArguments; @@ -135,7 +134,6 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, #ifdef SPLIT_REND_WITH_HEAD_ROT - HeadRotFileReader *postRendheadRotReader, uint8_t *splitRendBitsBuf, #endif IVAS_DEC_HANDLE hIvasDec, @@ -199,9 +197,6 @@ int main( LsCustomFileReader *hLsCustomReader = NULL; hrtfFileReader *hrtfReader = NULL; HeadRotFileReader *headRotReader = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT - HeadRotFileReader *postRendheadRotReader = NULL; -#endif ivas_error error = IVAS_ERR_UNKNOWN; int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE]; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -303,16 +298,6 @@ int main( goto cleanup; } } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.splitRendMode == SPLIT_REND_COMB ) - { - if ( ( error = HeadRotationFileReader_open( arg.postRendheadrotTrajFileName, &postRendheadRotReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Can't open post renderer head-rotation file %s \n\n", arg.postRendheadrotTrajFileName ); - goto cleanup; - } - } -#endif /*------------------------------------------------------------------------------------------* * Open custom loudspeaker layout file @@ -343,20 +328,17 @@ int main( /*------------------------------------------------------------------------------------------* * Configure the decoder *------------------------------------------------------------------------------------------*/ - -#ifdef DEBUGGING - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, #ifdef SPLIT_REND_WITH_HEAD_ROT - arg.splitRendMode, + if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) + { + arg.enableHeadRotation = true; + } #endif +#ifdef DEBUGGING + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.forceSubframeBinauralization ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - arg.enableSplitRendWithHeadRot -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -459,11 +441,19 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) && ( arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) ) + { + fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output OR when Split rendering mode is enabled. Exiting. \n" ); + exit( -1 ); + } +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) { fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n\n" ); goto cleanup; } +#endif if ( ( error = IVAS_DEC_GetRenderConfig( hIvasDec, &renderConfig ) ) != IVAS_ERR_OK ) { @@ -547,7 +537,7 @@ int main( { error = decodeG192( arg, hBsReader, headRotReader, #ifdef SPLIT_REND_WITH_HEAD_ROT - postRendheadRotReader, splitRendBitsBuf, + splitRendBitsBuf, #endif hIvasDec, pcmBuf ); } @@ -596,9 +586,6 @@ cleanup: CustomLsReader_close( &hLsCustomReader ); hrtfFileReader_close( &hrtfReader ); HeadRotationFileReader_close( &headRotReader ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - HeadRotationFileReader_close( &postRendheadRotReader ); -#endif RenderConfigReader_close( &renderConfigReader ); if ( BS_Reader_Close( &hBsReader ) != IVAS_ERR_OK ) @@ -697,6 +684,12 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( { output_config = IVAS_DEC_OUTPUT_BINAURAL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( strcmp( argv_to_upper, "SPLIT_BINAURAL" ) == 0 ) + { + output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB; + } +#endif else if ( strcmp( argv_to_upper, "BINAURAL_ROOM" ) == 0 ) { output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM; @@ -709,44 +702,6 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( return output_config; } - -#ifdef SPLIT_REND_WITH_HEAD_ROT -static int8_t parseSplitRendMode( - char *value, - IVAS_SPLIT_REND_MODE *SplitRendMode ) -{ - int16_t temp; - int8_t success; - success = 1; - to_upper( value ); - - temp = (int16_t) atoi( value ); - if ( temp == 0 ) - { - *SplitRendMode = SPLIT_REND_DISABLED; - } -#if 0 - else if ( temp == 1 ) - { - *SplitRendMode = SPLIT_REND_PRE; - } - else if ( temp == 2 ) - { - *SplitRendMode = SPLIT_REND_POST; - } -#endif - else if ( temp == 3 ) - { - *SplitRendMode = SPLIT_REND_COMB; - } - else - { - fprintf( stderr, "Error: Incorrect or unsupported value for split rendering mode specified!\n\n" ); - success = 0; - } - return success ? 0 : -1; -} -#endif /*---------------------------------------------------------------------* * parseCmdlIVAS_dec() * @@ -779,9 +734,6 @@ static bool parseCmdlIVAS_dec( arg->enableHeadRotation = false; arg->headrotTrajFileName = NULL; -#ifdef SPLIT_REND_WITH_HEAD_ROT - arg->postRendheadrotTrajFileName = NULL; -#endif arg->orientation_tracking = IVAS_PUBLIC_ORIENT_TRK_REF; @@ -805,10 +757,6 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; -#ifdef SPLIT_REND_WITH_HEAD_ROT - arg->splitRendMode = SPLIT_REND_DISABLED; -#endif - /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -960,41 +908,6 @@ static bool parseCmdlIVAS_dec( arg->headrotTrajFileName = argv[i]; i++; } -#ifdef SPLIT_REND_WITH_HEAD_ROT - else if ( strcmp( argv_to_upper, "-SBRM" ) == 0 ) - { - i++; - - if ( argc - i <= 4 || argv[i][0] == '-' ) - { - fprintf( stderr, "Error: Head rotation file name not specified!\n\n" ); - usage_dec(); - return false; - } - if ( parseSplitRendMode( argv[i], &arg->splitRendMode ) != 0 ) - { - fprintf( stderr, "Error: Invalid split rendering mode %s \n\n", argv[i] ); - usage_dec(); - return false; - } - i++; - } - else if ( strcmp( argv_to_upper, "-PRTF" ) == 0 ) - { - arg->enableHeadRotation = true; - i++; - - if ( argc - i <= 4 || argv[i][0] == '-' ) - { - fprintf( stderr, "Error: Head rotation file name not specified!\n\n" ); - usage_dec(); - return false; - } - - arg->postRendheadrotTrajFileName = argv[i]; - i++; - } -#endif else if ( strcmp( argv_to_upper, "-OTR" ) == 0 ) { if ( strlen( argv[i + 1] ) > 3 ) @@ -1171,8 +1084,13 @@ static void usage_dec( void ) fprintf( stdout, "Mandatory parameters:\n" ); fprintf( stdout, "---------------------\n" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); + fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, SPLIT_BINAURAL, EXT\n" ); +#else fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, EXT\n" ); +#endif fprintf( stdout, " By default, channel order and loudspeaker positions are equal to the\n" ); fprintf( stdout, " encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker\n" ); fprintf( stdout, " layout file. See readme.txt for details.\n" ); @@ -1203,10 +1121,6 @@ static void usage_dec( void ) fprintf( stdout, " which of the two supported formats is in use.\n" ); fprintf( stdout, " default bitstream file format is G.192\n" ); fprintf( stdout, "-T File : Head rotation specified by external trajectory File\n" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - fprintf( stdout, "-sbrm mode : split rendering mode (0 - disabled, 1 - PRE RENDERER, 2 - POST RENDERER, 3 - COMBINED PRE-POST RENDERING), by default disabled\n" ); - fprintf( stdout, "-prtf File : Head rotation for post renderer specified by external trajectory File (to be used with split rendering)\n" ); -#endif fprintf( stdout, "-hrtf File : HRTF filter File used in ISm format and BINAURAL output configuration\n" ); #ifdef DEBUGGING fprintf( stdout, "-force_subframe_bin : Forces parametric binauralizer code to use 5 ms time resolution even when\n" ); @@ -1255,7 +1169,6 @@ static ivas_error decodeG192( BS_READER_HANDLE hBsReader, HeadRotFileReader *headRotReader, #ifdef SPLIT_REND_WITH_HEAD_ROT - HeadRotFileReader *postRendheadRotReader, uint8_t *splitRendBitsBuf, #endif IVAS_DEC_HANDLE hIvasDec, @@ -1285,6 +1198,9 @@ static ivas_error decodeG192( #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_SPLIT_REND_BITS splitRendBits; + SplitFileReadWrite *hSplitRendFileReadWrite; + int16_t delayNumSamples_temp; + int32_t delayTimeScale_temp; #endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; @@ -1313,6 +1229,7 @@ static ivas_error decodeG192( splitRendBits.bits_read = 0; splitRendBits.bits_written = 0; splitRendBits.buf_len = MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES; + hSplitRendFileReadWrite = NULL; #endif /*------------------------------------------------------------------------------------------* @@ -1362,40 +1279,36 @@ static ivas_error decodeG192( if ( arg.enableHeadRotation ) { IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - - if ( ( error = HeadRotationFileReading( headRotReader, Quaternions, frame ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( headRotReader == NULL ) { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; + for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + Quaternions[i].w = -3.0f; + Quaternions[i].x = 0.0f; + Quaternions[i].y = 0.0f; + Quaternions[i].z = 0.0f; + } + } + else +#endif + { + if ( ( error = HeadRotationFileReading( headRotReader, Quaternions, frame ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } } - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions #ifdef SPLIT_REND_WITH_HEAD_ROT , - SPLIT_REND_PRE + DEFAULT_AXIS #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.splitRendMode == SPLIT_REND_COMB ) - { - if ( ( error = HeadRotationFileReading( postRendheadRotReader, Quaternions, frame ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading post rendering head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, SPLIT_REND_POST ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - } -#endif } /* Run decoder for one frame (get rendered output) */ @@ -1437,11 +1350,27 @@ static ivas_error decodeG192( goto cleanup; } - /* Open audio writer and write all previously skipped bad frames now that frame size is known */ - if ( ( error = AudioFileWriter_open( &afWriter, arg.outputWavFilename, arg.output_Fs, nOutChannels ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) { - fprintf( stderr, "\nUnable to open output file %s\n", arg.outputWavFilename ); - goto cleanup; + IVAS_DEC_GetDelay( hIvasDec, &delayNumSamples_temp, &delayTimeScale_temp ); + error = split_rend_writer_open( &hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp, delayTimeScale_temp ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", arg.outputWavFilename ); + exit( -1 ); + } + afWriter = NULL; + } + else +#endif + { + /* Open audio writer and write all previously skipped bad frames now that frame size is known */ + if ( ( error = AudioFileWriter_open( &afWriter, arg.outputWavFilename, arg.output_Fs, nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nUnable to open output file %s\n", arg.outputWavFilename ); + goto cleanup; + } } int16_t *zeroBuf = malloc( pcmFrameSize * sizeof( int16_t ) ); @@ -1449,18 +1378,34 @@ static ivas_error decodeG192( for ( i = 0; i < numInitialBadFrames; ++i ) { - if ( delayNumSamples < nOutSamples ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hSplitRendFileReadWrite != NULL ) { - if ( ( error = AudioFileWriter_write( afWriter, zeroBuf, nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + IVAS_SPLIT_REND_BITS splitRendBitsZero; + splitRendBitsZero.bits_written = 0; + splitRendBitsZero.bits_read = 0; + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nOutput audio file writer error\n" ); - goto cleanup; + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); + exit( -1 ); } - delayNumSamples = 0; } else +#endif { - delayNumSamples -= nOutSamples; + if ( delayNumSamples < nOutSamples ) + { + if ( ( error = AudioFileWriter_write( afWriter, zeroBuf, nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= nOutSamples; + } } } @@ -1569,18 +1514,31 @@ static ivas_error decodeG192( /* Write current frame */ if ( decodedGoodFrame ) { - if ( delayNumSamples < nOutSamples ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hSplitRendFileReadWrite != NULL ) { - if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nOutput audio file writer error\n" ); - goto cleanup; + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); + exit( -1 ); } - delayNumSamples = 0; } else +#endif { - delayNumSamples -= nOutSamples; + if ( delayNumSamples < nOutSamples ) + { + if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= nOutSamples; + } } } @@ -1678,10 +1636,13 @@ static ivas_error decodeG192( /* add zeros at the end to have equal length of synthesized signals */ memset( pcmBuf, 0, zeroPad * nOutChannels * sizeof( int16_t ) ); - if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, zeroPad * nOutChannels ) ) != IVAS_ERR_OK ) + if ( afWriter != NULL ) { - fprintf( stderr, "\nOutput audio file writer error\n" ); - goto cleanup; + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, zeroPad * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } } /*------------------------------------------------------------------------------------------* @@ -1691,8 +1652,16 @@ static ivas_error decodeG192( decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ cleanup: - - AudioFileWriter_close( &afWriter ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hSplitRendFileReadWrite != NULL ) + { + split_rend_reader_writer_close( &hSplitRendFileReadWrite ); + } + if ( afWriter != NULL ) +#endif + { + AudioFileWriter_close( &afWriter ); + } MasaFileWriter_close( &masaWriter ); for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { diff --git a/apps/renderer.c b/apps/renderer.c index 1fc6a5bad5..34b2b32f53 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -44,6 +44,9 @@ #include "masa_file_reader.h" #include "prot.h" #include "render_config_reader.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "split_render_file_read_write.h" +#endif #ifdef WMOPS #include "PROM_Size_lib_rend.h" #include "wmops.h" @@ -164,6 +167,10 @@ typedef struct IVAS_CUSTOM_LS_DATA inSetupCustom; RendererInput masaBuses[RENDERER_MAX_MASA_INPUTS]; uint16_t numMasaBuses; +#ifdef SPLIT_REND_WITH_HEAD_ROT + RendererInput binBuses[RENDERER_MAX_BIN_INPUTS]; + uint16_t numBinBuses; +#endif } InputConfig; typedef struct @@ -182,11 +189,10 @@ typedef struct OutputConfig outConfig; char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; - char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_SPLIT_REND_MODE splitRendMode; - char postRendheadRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; + char outMetadataFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; #endif + char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientationTracking; @@ -216,8 +222,7 @@ typedef enum CmdLnOptionId_listFormats, CmdLnOptionId_inputGain, #ifdef SPLIT_REND_WITH_HEAD_ROT - CmdLnOptionId_SplitRendMode, - CmdLnOptionId_PostRendtrajFile, + CmdLnOptionId_outputMetadata, #endif } CmdLnOptionId; @@ -238,7 +243,11 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_inputMetadata, .match = "input_metadata", .matchShort = "im", +#ifdef SPLIT_REND_WITH_HEAD_ROT + .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode", +#else .description = "Space-separated list of path to metadata files for ISM or MASA inputs", +#endif }, { .id = CmdLnOptionId_outputFile, @@ -262,20 +271,18 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_trajFile, .match = "trajectory_file", .matchShort = "tf", +#ifdef SPLIT_REND_WITH_HEAD_ROT + .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL, BINAURAL_SPLIT_PCM, BINAURAL_SPLIT_CLDFB and BINAURAL_ROOM outputs)", +#else .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, #ifdef SPLIT_REND_WITH_HEAD_ROT { - .id = CmdLnOptionId_SplitRendMode, - .match = "split_bin_rend_mode", - .matchShort = "sbrm", - .description = "Split rendering mode option (only for BINAURAL and BINAURAL_ROOM outputs)", - }, - { - .id = CmdLnOptionId_PostRendtrajFile, - .match = "post_rend_trajectory_file", - .matchShort = "prtf", - .description = "Split rendering option with head tracking data for post renderer (only for BINAURAL and BINAURAL_ROOM outputs)", + .id = CmdLnOptionId_outputMetadata, + .match = "output_metadata", + .matchShort = "om", + .description = "coded metadata file for BINAURAL_SPLIT_PCM output mode", }, #endif { @@ -435,8 +442,13 @@ static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSa #endif ); -static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); - +static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t cldfb_in, + HANDLE_CLDFB_FILTER_BANK *cldfbSyn +#endif +); static IVAS_REND_ReadOnlyAudioBuffer getReadOnlySubBuffer( IVAS_REND_AudioBuffer buffer, const int16_t chBeginIdx, const int16_t numChannels ) { @@ -454,7 +466,11 @@ static int16_t getTotalNumInChannels( IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS], IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS], IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS], - IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] ) + IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS], +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] +#endif +) { int16_t totalNumInChannels = 0; int16_t i, numInputChannels; @@ -525,6 +541,24 @@ static int16_t getTotalNumInChannels( totalNumInChannels += numInputChannels; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) + { + if ( splitBinIds[i] == 0 ) + { + /* Skip inactive inputs */ + continue; + } + + if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numInputChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + totalNumInChannels += numInputChannels; + } +#endif + return totalNumInChannels; } @@ -532,7 +566,12 @@ static void setupWithSingleFormatInput( CmdlnArgs args, char *audioFilePath, IsmPositionProvider *positionProvider, - MasaFileReader **masaReaders ) + MasaFileReader **masaReaders +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + SplitFileReadWrite **hhSplitRendFileReadWrite +#endif +) { /* With single-format input, inputFilePath is the path to input audio file. */ strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 ); @@ -578,6 +617,22 @@ static void setupWithSingleFormatInput( } } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( args.inConfig.numBinBuses != 0 ) + { + *hhSplitRendFileReadWrite = NULL; + if ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + ivas_error error; + error = split_rend_reader_open( hhSplitRendFileReadWrite, args.inMetadataFilePaths[0] ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] ); + exit( -1 ); + } + } + } +#endif } static float dBToLin( @@ -589,7 +644,9 @@ static float dBToLin( #ifdef SPLIT_REND_WITH_HEAD_ROT static int16_t rend_openCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], + HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS], const int16_t num_in_chs, + const int16_t num_out_chs, const int32_t output_Fs ) { int16_t n; @@ -601,10 +658,26 @@ static int16_t rend_openCldfb( return -1; } } + for ( ; n < MAX_INPUT_CHANNELS; n++ ) + { + cldfbAna[n] = NULL; + } + + for ( n = 0; n < num_out_chs; n++ ) + { + if ( openCldfb( &( cldfbSyn[n] ), CLDFB_SYNTHESIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) != IVAS_ERR_OK ) + { + return -1; + } + } + for ( ; n < MAX_INPUT_CHANNELS; n++ ) + { + cldfbSyn[n] = NULL; + } return 0; } -static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS] ) +static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS] ) { int16_t n; for ( n = 0; n < MAX_INPUT_CHANNELS; n++ ) @@ -614,21 +687,59 @@ static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNEL deleteCldfb( &( cldfbAna[n] ) ); cldfbAna[n] = NULL; } + + if ( cldfbSyn[n] != NULL ) + { + deleteCldfb( &( cldfbSyn[n] ) ); + cldfbSyn[n] = NULL; + } } return; } -static int16_t get_cldfb_in_flag( CmdlnArgs *args ) +static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig ) { int16_t cldfb_in; cldfb_in = 0; - if ( ( args->splitRendMode == SPLIT_REND_PRE ) || ( args->splitRendMode == SPLIT_REND_COMB ) ) + if ( renderConfig->renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) { +#ifdef DEBUGGING cldfb_in = 1; +#endif + if ( ( audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ) + { + cldfb_in = 1; + } } return cldfb_in; } + +static int16_t is_split_post_rend_mode( CmdlnArgs *args ) +{ + int16_t flag; + flag = 0; + if ( ( args->inConfig.numBinBuses > 0 ) && + ( ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) + { + flag = 1; + } + + return flag; +} + +static int16_t is_split_pre_rend_mode( CmdlnArgs *args ) +{ + int16_t flag; + flag = 0; + if ( ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + flag = 1; + } + + return flag; +} #endif /* ============================================================================ */ @@ -640,9 +751,9 @@ int main( IVAS_REND_HANDLE hIvasRend; HeadRotFileReader *headRotReader = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT - HeadRotFileReader *postRendHeadRotReader = NULL; HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS]; - int16_t cldfb_in; + HANDLE_CLDFB_FILTER_BANK cldfbSyn[MAX_INPUT_CHANNELS]; + int16_t cldfb_in, CLDFBframeSize_smpls; #endif hrtfFileReader *hrtfFileReader = NULL; IsmPositionProvider *positionProvider; @@ -654,12 +765,24 @@ int main( AudioFileWriter *audioWriter; int32_t inBufferSize; int32_t outBufferSize; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int32_t bitsBufferSize; +#endif int16_t *inpInt16Buffer; float *inFloatBuffer; int16_t *outInt16Buffer; float *outFloatBuffer; +#ifdef SPLIT_REND_WITH_HEAD_ROT + uint8_t *bitsBufferData; +#endif IVAS_REND_AudioBuffer inBuffer; IVAS_REND_AudioBuffer outBuffer; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_REND_BitstreamBuffer bitsBuffer; + SplitFileReadWrite *hSplitRendFileReadWrite; + int16_t delayNumSamples_temp; + int32_t delayTimeScale_temp; +#endif int16_t numSamplesRead; int16_t delayNumSamples = -1; int16_t delayNumSamples_orig = 0; @@ -686,6 +809,10 @@ int main( hMasaMetadata[i] = NULL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + hSplitRendFileReadWrite = NULL; +#endif + CmdlnArgs args = parseCmdlnArgs( argc, argv ); positionProvider = IsmPositionProvider_open(); @@ -699,13 +826,6 @@ int main( HeadRotationFileReader_open( args.headRotationFilePath, &headRotReader ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( args.splitRendMode == SPLIT_REND_COMB ) && !isEmptyString( args.postRendheadRotationFilePath ) ) - { - HeadRotationFileReader_open( args.postRendheadRotationFilePath, &postRendHeadRotReader ); - } -#endif - if ( !isEmptyString( args.customHrtfFilePath ) ) { hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ); @@ -725,15 +845,37 @@ int main( else { /* With single-format input, all information is given on command line. */ - setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders ); + setupWithSingleFormatInput( args, audioFilePath, positionProvider, masaReaders +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + &hSplitRendFileReadWrite +#endif + ); } int32_t inFileSampleRate = 0; - if ( AudioFileReader_open( &audioReader, audioFilePath, &inFileSampleRate ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + /*if split renderer is running in post renderer mode*/ + if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ) { - fprintf( stderr, "Error opening file: %s\n", audioFilePath ); - exit( -1 ); + error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath ); + exit( -1 ); + } + audioReader = NULL; + } + else +#endif + { + 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" ); @@ -750,22 +892,22 @@ int main( } const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); +#ifndef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT const int16_t CLDFBframeSize_smpls = (int16_t) frameSize_smpls * 2; cldfb_in = get_cldfb_in_flag( &args ); +#endif #endif IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; - - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig #ifdef SPLIT_REND_WITH_HEAD_ROT - , - args.splitRendMode + IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 }; #endif - ) ) != IVAS_ERR_OK ) + + if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -777,16 +919,30 @@ int main( exit( -1 ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + CLDFBframeSize_smpls = 0; + cldfb_in = 0; +#endif + if ( args.renderConfigFilePath[0] != '\0' ) { IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && !is_split_pre_rend_mode( &args ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) + { + fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" ); + exit( -1 ); + } +#else if ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output. Exiting. \n" ); exit( -1 ); } +#endif + if ( ( error = IVAS_REND_GetRenderConfig( hIvasRend, &renderConfig ) ) != IVAS_ERR_OK ) { @@ -805,8 +961,16 @@ int main( fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed\n" ); exit( -1 ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( !is_split_post_rend_mode( &args ) ) + { + CLDFBframeSize_smpls = frameSize_smpls * 2; + cldfb_in = get_cldfb_in_flag( args.outConfig.audioConfig, &renderConfig ); + } +#endif } + /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { @@ -872,6 +1036,23 @@ int main( } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < args.inConfig.numBinBuses; ++i ) + { + if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.binBuses[i].audioConfig, &splitBinIds[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( ( error = IVAS_REND_SetInputGain( hIvasRend, splitBinIds[i], args.inputGainGlobal * dBToLin( args.inConfig.binBuses[i].gain_dB ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#endif + for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.masaBuses[i].audioConfig, &masaIds[i] ) ) != IVAS_ERR_OK ) @@ -887,15 +1068,14 @@ int main( } } - const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); + const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( cldfb_in ) - { - rend_openCldfb( cldfbAna, totalNumInChannels, args.sampleRate ); - } + , + splitBinIds #endif + ); - if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ + if ( ( audioReader != NULL ) && AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) { fprintf( stderr, "Number of channels in input file does not match selected configuration\n" ); @@ -916,11 +1096,48 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in ) { - fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath ); - exit( -1 ); + rend_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ); + } +#endif + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ); + error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath ); + exit( -1 ); + } + audioWriter = NULL; } + else + { + if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ); + error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath ); + exit( -1 ); + } + } +#endif + if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath ); + exit( -1 ); + } +#ifdef SPLIT_REND_WITH_HEAD_ROT + } +#endif + #ifdef DEC_TO_REND_FLOAT_DUMP printf( "Warning: Renderer executable built with DEC_TO_REND_FLOAT_DUMP enabled!\n" ); printf( " Float dump file (./float_out.wav) will be forced as input.\n" ); @@ -928,23 +1145,41 @@ int main( inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( is_split_pre_rend_mode( &args ) || is_split_post_rend_mode( &args ) ) + { + bitsBufferSize = (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC; + bitsBufferSize = ( bitsBufferSize + 7 ) >> 3; + } + else + { + bitsBufferSize = 0; + } + +#endif + inpInt16Buffer = count_malloc( inBufferSize * sizeof( int16_t ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT if ( cldfb_in == 0 ) { inFloatBuffer = count_malloc( inBufferSize * sizeof( float ) ); inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; + outFloatBuffer = count_malloc( outBufferSize * sizeof( float ) ); + outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; } else { inFloatBuffer = count_malloc( CLDFBframeSize_smpls * totalNumInChannels * sizeof( float ) ); inBuffer.config.numSamplesPerChannel = (int16_t) CLDFBframeSize_smpls; + outFloatBuffer = count_malloc( CLDFBframeSize_smpls * totalNumInChannels * sizeof( float ) ); + outBuffer.config.numSamplesPerChannel = (int16_t) CLDFBframeSize_smpls; } #else inFloatBuffer = count_malloc( inBufferSize * sizeof( float ) ); + outFloatBuffer = count_malloc( outBufferSize * sizeof( float ) ); + outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; #endif outInt16Buffer = count_malloc( outBufferSize * sizeof( int16_t ) ); - outFloatBuffer = count_malloc( outBufferSize * sizeof( float ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT inBuffer.config.is_cldfb = cldfb_in; @@ -952,10 +1187,31 @@ int main( inBuffer.config.numChannels = (int16_t) totalNumInChannels; inBuffer.data = inFloatBuffer; - outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; +#ifdef SPLIT_REND_WITH_HEAD_ROT + outBuffer.config.is_cldfb = cldfb_in; +#endif outBuffer.config.numChannels = (int16_t) numOutChannels; outBuffer.data = outFloatBuffer; + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( bitsBufferSize > 0 ) + { + bitsBufferData = count_malloc( bitsBufferSize * sizeof( uint8_t ) ); + } + else + { + bitsBufferData = NULL; + } + +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + bitsBuffer.bits = bitsBufferData; + bitsBuffer.config.bitsRead = 0; + bitsBuffer.config.bitsWritten = 0; + bitsBuffer.config.bufLenInBytes = bitsBufferSize; +#endif + #ifdef WMOPS reset_wmops(); #endif @@ -975,11 +1231,35 @@ int main( int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; - /* Read the input data */ - if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + numSamplesRead = 0; + if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) ) { - fprintf( stderr, "\nError reading from file %s\n", audioFilePath ); - exit( -1 ); + ivas_error error_tmp; + numSamplesRead = (int16_t) inBufferSize; + error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ); + if ( error_tmp != IVAS_ERR_OK ) + { + if ( error_tmp == IVAS_ERR_END_OF_FILE ) + { + numSamplesRead = 0; + } + else + { + fprintf( stderr, "\nUnable to read from bitstream file!\n" ); + exit( -1 ); + } + } + } + if ( audioReader != NULL ) +#endif + { + /* Read the input data */ + if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError reading from file %s\n", audioFilePath ); + exit( -1 ); + } } if ( numSamplesRead == 0 ) @@ -1022,7 +1302,7 @@ int main( IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer #ifdef SPLIT_REND_WITH_HEAD_ROT , - SPLIT_REND_PRE + DEFAULT_AXIS #endif ); } @@ -1031,21 +1311,11 @@ int main( IVAS_REND_SetHeadRotation( hIvasRend, NULL #ifdef SPLIT_REND_WITH_HEAD_ROT , - SPLIT_REND_PRE + DEFAULT_AXIS #endif ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT - /* Read from post renderer head rotation trajectory file if specified */ - if ( postRendHeadRotReader != NULL ) - { - IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; - HeadRotationFileReading( postRendHeadRotReader, quatBuffer, frame ); - IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, SPLIT_REND_POST ); - } -#endif - for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, mcIds[i], &numChannels ) ) != IVAS_ERR_OK ) @@ -1122,25 +1392,65 @@ int main( } } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < args.inConfig.numBinBuses; ++i ) + { + if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + IVAS_REND_ReadOnlyAudioBuffer tmpBuffer = getReadOnlySubBuffer( inBuffer, (int16_t) args.inConfig.binBuses[i].inputChannelIndex, numChannels ); + + if ( ( error = IVAS_REND_FeedInputAudio( hIvasRend, splitBinIds[i], tmpBuffer ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } +#endif - IVAS_REND_GetSamples( hIvasRend, outBuffer ); + IVAS_REND_GetSamples( hIvasRend, outBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + &bitsBuffer +#endif + ); int16_t num_out_channels; num_out_channels = outBuffer.config.numChannels; /* Convert from float to int and from packed to interleaved. * Values in outFloatBuffer are guaranteed to be within range INT16_MIN:INT16_MAX */ - convertOutputBuffer( outFloatBuffer, frameSize_smpls, num_out_channels, outInt16Buffer ); + convertOutputBuffer( outFloatBuffer, outBuffer.config.numSamplesPerChannel, num_out_channels, outInt16Buffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + cldfb_in, + cldfbSyn +#endif + ); if ( delayNumSamples == -1 ) { - if ( args.delayCompensationEnabled ) + if ( args.delayCompensationEnabled +#ifdef SPLIT_REND_WITH_HEAD_ROT + && !is_split_pre_rend_mode( &args ) +#endif + ) { if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples, &delayTimeScale ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to get delay of renderer!\n" ); exit( -1 ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( is_split_post_rend_mode( &args ) && ( hSplitRendFileReadWrite != NULL ) ) + { + uint32_t pre_rend_delay_ns; + split_rend_read_pre_rend_delay_ns( hSplitRendFileReadWrite, &pre_rend_delay_ns ); + delayNumSamples += NS2SA( delayTimeScale, pre_rend_delay_ns ); + } +#endif delayNumSamples_orig = delayNumSamples; } else @@ -1150,19 +1460,37 @@ int main( zeroPad = delayNumSamples; } - if ( delayNumSamples < outBufferSize ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) { - if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ) != IVAS_ERR_OK ) { - fprintf( stderr, "Error writing audio file %s\n", args.outputFilePath ); + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); } - delayNumSamples = 0; } - else + if ( audioWriter != NULL ) +#endif { - delayNumSamples -= (int16_t) outBufferSize; + if ( delayNumSamples < outBufferSize ) + { + if ( AudioFileWriter_write( audioWriter, &outInt16Buffer[delayNumSamples * num_out_channels], outBufferSize - ( delayNumSamples * num_out_channels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error writing audio file %s\n", args.outputFilePath ); + exit( -1 ); + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= (int16_t) outBufferSize; + } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + bitsBuffer.config.bitsRead = 0; + bitsBuffer.config.bitsWritten = 0; +#endif + frame++; if ( !args.quietModeEnabled ) @@ -1176,11 +1504,16 @@ int main( } /* add zeros at the end to have equal length of synthesized signals */ - memset( outInt16Buffer, 0, zeroPad * outBuffer.config.numChannels * sizeof( int16_t ) ); - if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPad * outBuffer.config.numChannels ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( audioWriter != NULL ) +#endif { - fprintf( stderr, "\nOutput audio file writer error\n" ); - exit( -1 ); + memset( outInt16Buffer, 0, zeroPad * outBuffer.config.numChannels * sizeof( int16_t ) ); + if ( ( error = AudioFileWriter_write( audioWriter, outInt16Buffer, zeroPad * outBuffer.config.numChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + exit( -1 ); + } } if ( !args.quietModeEnabled && args.delayCompensationEnabled ) @@ -1207,6 +1540,12 @@ int main( count_free( inFloatBuffer ); count_free( outInt16Buffer ); count_free( outFloatBuffer ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( bitsBufferData != NULL ) + { + count_free( bitsBufferData ); + } +#endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { MasaFileReader_close( &masaReaders[i] ); @@ -1215,11 +1554,28 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( cldfb_in ) { - rend_closeCldfb( cldfbAna ); + rend_closeCldfb( cldfbAna, cldfbSyn ); } #endif - AudioFileReader_close( &audioReader ); - AudioFileWriter_close( &audioWriter ); + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( audioReader != NULL ) +#endif + { + AudioFileReader_close( &audioReader ); + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hSplitRendFileReadWrite != NULL ) + { + split_rend_reader_writer_close( &hSplitRendFileReadWrite ); + } + if ( audioWriter != NULL ) +#endif + { + AudioFileWriter_close( &audioWriter ); + } + HeadRotationFileReader_close( &headRotReader ); hrtfFileReader_close( &hrtfFileReader ); IVAS_REND_Close( &hIvasRend ); @@ -1272,7 +1628,9 @@ static bool parseInConfig( inConfig->numAmbisonicsBuses = 0; inConfig->numMultiChannelBuses = 0; inConfig->numMasaBuses = 0; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + inConfig->numBinBuses = 0; +#endif /* First check if input is being set to scene description file - this is not covered by parseAudioConfig(). */ strncpy( charBuf, inFormatStr, sizeof( charBuf ) - 1 ); to_upper( charBuf ); @@ -1308,6 +1666,15 @@ static bool parseInConfig( inConfig->ambisonicsBuses[0].inputChannelIndex = 0; inConfig->ambisonicsBuses[0].gain_dB = 0.0f; break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + inConfig->numBinBuses = 1; + inConfig->binBuses[0].audioConfig = audioConfig; + inConfig->binBuses[0].inputChannelIndex = 0; + inConfig->binBuses[0].gain_dB = 0.0f; + break; +#endif case IVAS_REND_AUDIO_CONFIG_MASA1: case IVAS_REND_AUDIO_CONFIG_MASA2: inConfig->numMasaBuses = 1; @@ -1427,44 +1794,6 @@ static int8_t parseDiegeticPan( return success ? 0 : -1; } -#ifdef SPLIT_REND_WITH_HEAD_ROT -static int8_t parseSplitRendMode( - char *value, - IVAS_SPLIT_REND_MODE *SplitRendMode ) -{ - int16_t temp; - int8_t success; - success = 1; - to_upper( value ); - - temp = (int16_t) atoi( value ); - if ( temp == 0 ) - { - *SplitRendMode = SPLIT_REND_DISABLED; - } -#if 0 - else if ( temp == 1 ) - { - *SplitRendMode = SPLIT_REND_PRE; - } - else if ( temp == 2 ) - { - *SplitRendMode = SPLIT_REND_POST; - } -#endif - else if ( temp == 3 ) - { - *SplitRendMode = SPLIT_REND_COMB; - } - else - { - fprintf( stderr, "Error: Incorrect or unsupported value for split rendering mode specified!\n\n" ); - success = 0; - } - return success ? 0 : -1; -} -#endif - static int8_t parseOrientationTracking( char *value, int8_t *tracking_type ) @@ -1571,6 +1900,16 @@ static IVAS_REND_AudioConfig parseAudioConfig( { return IVAS_REND_AUDIO_CONFIG_BINAURAL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 ) + { + return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; + } + if ( strcmp( charBuf, "BINAURAL_SPLIT_CLDFB" ) == 0 ) + { + return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB; + } +#endif return IVAS_REND_AUDIO_CONFIG_UNKNOWN; } @@ -1601,10 +1940,19 @@ static bool checkRequiredArgs( fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort ); missingRequiredArg = true; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + const bool singleInputSpecified = args.inConfig.numAudioObjects != 0 || + args.inConfig.numAmbisonicsBuses != 0 || + args.inConfig.numMultiChannelBuses != 0 || + args.inConfig.numMasaBuses != 0 || + args.inConfig.numBinBuses != 0; +#else const bool singleInputSpecified = args.inConfig.numAudioObjects != 0 || args.inConfig.numAmbisonicsBuses != 0 || args.inConfig.numMultiChannelBuses != 0 || args.inConfig.numMasaBuses != 0; +#endif + if ( !args.sceneDescriptionInput && !singleInputSpecified ) { /* Neither scene description input nor single-type input was specified on command line */ @@ -1662,8 +2010,7 @@ static CmdlnArgs defaultArgs( clearString( args.headRotationFilePath ); #ifdef SPLIT_REND_WITH_HEAD_ROT - args.splitRendMode = SPLIT_REND_DISABLED; - clearString( args.postRendheadRotationFilePath ); + clearString( args.outMetadataFilePath ); #endif clearString( args.customHrtfFilePath ); clearString( args.renderConfigFilePath ); @@ -1737,17 +2084,9 @@ static void parseOption( strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case CmdLnOptionId_PostRendtrajFile: + case CmdLnOptionId_outputMetadata: assert( numOptionValues == 1 ); - strncpy( args->postRendheadRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); - break; - case CmdLnOptionId_SplitRendMode: - assert( numOptionValues == 1 ); - if ( parseSplitRendMode( optionValues[0], &args->splitRendMode ) != 0 ) - { - fprintf( stderr, "Unknown option for split rendering mode: %s\n", optionValues[0] ); - exit( -1 ); - } + strncpy( args->outMetadataFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; #endif case CmdLnOptionId_customHrtfFile: @@ -2525,6 +2864,10 @@ static void printSupportedAudioConfigs() "MASAx (input only)", "BINAURAL (output only)", "BINAURAL_ROOM (output only)", +#ifdef SPLIT_REND_WITH_HEAD_ROT + "BINAURAL_SPLIT_PCM", + "BINAURAL_SPLIT_CLDFB", +#endif }; fprintf( stdout, "Supported audio formats:\n" ); @@ -2687,19 +3030,75 @@ static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, - int16_t *intBuffer ) + int16_t *intBuffer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t cldfb_in, + HANDLE_CLDFB_FILTER_BANK *cldfbSyn +#endif +) { int16_t chnl, smpl, i; i = 0; - for ( smpl = 0; smpl < numSamplesPerChannel; ++smpl ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( cldfb_in ) { + int16_t slotIdx, numCldfbBands, numPcmSamples, b; + float fIn[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + float re[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float im[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + numPcmSamples = numSamplesPerChannel >> 1; + numCldfbBands = numPcmSamples / CLDFB_NO_COL_MAX; + /* CLDFB Synthesis*/ + for ( chnl = 0; chnl < numChannels; ++chnl ) + { + for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ ) + { + for ( b = 0; b < numCldfbBands; b++ ) + { + re[chnl][slotIdx][b] = floatBuffer[( chnl * numSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands ) + b]; + im[chnl][slotIdx][b] = floatBuffer[numCldfbBands + ( chnl * numSamplesPerChannel ) + ( 2 * slotIdx * numCldfbBands ) + b]; + } + } + } + + /* Implement CLDFB synthesis */ for ( chnl = 0; chnl < numChannels; ++chnl ) { - intBuffer[i] = (int16_t) roundf( floatBuffer[chnl * numSamplesPerChannel + smpl] ); + float *RealBuffer[CLDFB_NO_COL_MAX]; + float *ImagBuffer[CLDFB_NO_COL_MAX]; + + for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; slotIdx++ ) + { + RealBuffer[slotIdx] = re[chnl][slotIdx]; + ImagBuffer[slotIdx] = im[chnl][slotIdx]; + } - ++i; + cldfbSynthesis( RealBuffer, ImagBuffer, &( fIn[chnl][0] ), numCldfbBands * CLDFB_NO_COL_MAX, cldfbSyn[chnl] ); + } + for ( smpl = 0; smpl < numPcmSamples; ++smpl ) + { + for ( chnl = 0; chnl < numChannels; ++chnl ) + { + intBuffer[i] = (int16_t) roundf( fIn[chnl][smpl] ); + ++i; + } + } + } + else +#endif + { + + for ( smpl = 0; smpl < numSamplesPerChannel; ++smpl ) + { + for ( chnl = 0; chnl < numChannels; ++chnl ) + { + intBuffer[i] = (int16_t) roundf( floatBuffer[chnl * numSamplesPerChannel + smpl] ); + + ++i; + } } } diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 39cbc82a1a..35f5954998 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -83,6 +83,19 @@ typedef struct } IVAS_QUATERNION; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef enum +{ + DEFAULT_AXIS, + YAW, + PITCH, + ROLL, + YAW_PITCH, + YAW_ROLL, + PITCH_ROLL +} IVAS_SPLIT_REND_ROT_AXIS; +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct ivas_split_rend_bits_t { @@ -98,7 +111,7 @@ typedef struct ivas_masa_qmetadata_frame_struct *IVAS_MASA_QMETADATA_HANDLE; typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) typedef enum { IVAS_RENDER_TYPE_OVERRIDE_NONE, @@ -120,12 +133,32 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG float inputPreDelay; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10] */ } IVAS_ROOM_ACOUSTICS_CONFIG_DATA; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct _IVAS_SPLIT_REND_CONFIG +{ + int32_t splitRendBitRate; /*Bit rate for split rendering mode, if "pcm_out" is set then "splitRendBitRate" is used as a limit for MD bitrate */ + int16_t hq_mode; /*High quality 3DOF mode with additional side information. Requires more pre-renditions. */ + int16_t dof; /*flag to specify if pose correction is needed for 1, 2 or 3 degree of freedoms*/ + /*The axis can be set dynamically per frame based on a file input */ + /*possible values: + 1 - (1dof correction. By default YAW correction) + 2 - (2dof correction. By default YAW and PITCH correction) + 3 - (3dof correction. By default YAW, PITCH and ROLL correction) + */ + int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ +} IVAS_SPLIT_REND_CONFIG_DATA; +#endif + typedef struct _IVAS_RENDER_CONFIG { -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) IVAS_RENDER_TYPE_OVERRIDE renderer_type_override; #endif IVAS_ROOM_ACOUSTICS_CONFIG_DATA room_acoustics; + +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_CONFIG_DATA split_rend_config; +#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct _IVAS_LS_CUSTOM_LAYOUT @@ -156,14 +189,4 @@ typedef struct _IVAS_JBM_TRACE_DATA } IVAS_JBM_TRACE_DATA; -#ifdef SPLIT_REND_WITH_HEAD_ROT -typedef enum _IVAS_SPLIT_REND_MODE -{ - SPLIT_REND_DISABLED = -1, - SPLIT_REND_PRE, - SPLIT_REND_POST, - SPLIT_REND_COMB -} IVAS_SPLIT_REND_MODE; -#endif - #endif /* COMMON_API_TYPES_H */ diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 4bcac1555e..3d3b5ddf54 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -57,6 +57,10 @@ int32_t get_delay( HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ RENDERER_TYPE renderer_type, /* i : IVAS rendering type */ const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + AUDIO_CONFIG output_config /* i : decoder output config */ +#endif ) { int32_t delay = 0; @@ -94,12 +98,17 @@ int32_t get_delay( else /* IVAS */ { delay = IVAS_DEC_DELAY_NS; - - if ( hCldfb != NULL || renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) +#endif { - delay += IVAS_FB_DEC_DELAY_NS; + if ( hCldfb != NULL || renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) + { + delay += IVAS_FB_DEC_DELAY_NS; + } } + /* compensate for Binaural renderer HRTF delay */ { delay += binaural_latency_ns; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 0c33ade4d7..2046b3de33 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -103,6 +103,9 @@ typedef enum AUDIO_CONFIG_OBA, /* object based audio */ AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */ AUDIO_CONFIG_BINAURAL_ROOM, /* binaural with HRIR and BRIR */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB, /* split binaural with CLDFB coded output */ +#endif AUDIO_CONFIG_ISM1, /* ISM1 */ AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ @@ -113,7 +116,7 @@ typedef enum } AUDIO_CONFIG; -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) typedef enum { RENDER_TYPE_OVERRIDE_NONE, @@ -1350,6 +1353,18 @@ typedef enum EFAP_DMX_INTENSITY } EFAP_VTX_DMX_TYPE; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef enum +{ + ANY_YAW, + PITCH_ONLY, + ANY_ROLL, + PRED_ONLY, + COM_GAIN_ONLY, + LR_GAIN_ONLY +} IVAS_SPLIT_REND_POSE_TYPE; +#endif + #define VBAP_NUM_SEARCH_SECTORS 4 /*----------------------------------------------------------------------------------* @@ -1362,22 +1377,50 @@ typedef enum #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_DECOR_ALPHA (0.25f) -#define MAX_YAW_ANGLES (3) -#define MAX_PITCH_ANGLES (1) -#define MAX_ROLL_ANGLES (1) -#define MAX_HEAD_ROT_POSES (MAX_YAW_ANGLES*MAX_PITCH_ANGLES*MAX_ROLL_ANGLES) + +#define SPLIT_REND_MAX_YAW_ONLY_POSES (2) +#define SPLIT_REND_MAX_PITCH_ONLY_POSES (2) +#define SPLIT_REND_MAX_ROLL_ONLY_POSES (2) +#define SPLIT_REND_MAX_ONE_AXIS_MD_POSES (2) +#define MAX_EXTRAPOLATION_ANGLE (15.0f) /* this means additional 15 degrees can be extrapolated on top of MD probing poses*/ + +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define MAX_HEAD_ROT_POSES (1 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) +#else +#define MAX_HEAD_ROT_POSES (1 + SPLIT_REND_MAX_YAW_ONLY_POSES) +#endif #define MAX_SPLIT_REND_MD_BANDS (20) #define COMPLEX_MD_BAND_THRESH (MAX_SPLIT_REND_MD_BANDS) +#define COMPLEX_MD_BAND_THRESH_LOW (5) -#ifdef SPLIT_REND_WITH_HEAD_ROT + +#define IVAS_SPLIT_REND_NUM_QUANT_STRATS (3) #define IVAS_SPLIT_REND_PRED_QUANT_PNTS ( 31 ) #define IVAS_SPLIT_REND_D_QUANT_PNTS ( 15 ) #define IVAS_SPLIT_REND_PRED_MIN_VAL ( -1.0f ) #define IVAS_SPLIT_REND_PRED_MAX_VAL ( 1.0f ) +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define IVAS_SPLIT_REND_PITCH_G_MIN_VAL (0.5f) +#define IVAS_SPLIT_REND_PITCH_G_MAX_VAL (1.5f) +#define IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS ( IVAS_SPLIT_REND_D_QUANT_PNTS ) +#define IVAS_SPLIT_REND_D_MIN_VAL ( 0.0f ) +#else #define IVAS_SPLIT_REND_D_MIN_VAL ( 0.0f ) +#endif #define IVAS_SPLIT_REND_D_MAX_VAL ( 1.0f ) + +#define IVAS_SPLIT_REND_PRED_Q_STEP (( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 )) +#define IVAS_SPLIT_REND_PRED_1BYQ_STEP (( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL )) +#define IVAS_SPLIT_REND_D_Q_STEP (( IVAS_SPLIT_REND_D_MAX_VAL - IVAS_SPLIT_REND_D_MIN_VAL ) / ( IVAS_SPLIT_REND_D_QUANT_PNTS - 1 )) +#define IVAS_SPLIT_REND_D_1BYQ_STEP (( IVAS_SPLIT_REND_D_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_D_MAX_VAL - IVAS_SPLIT_REND_D_MIN_VAL )) +#define IVAS_SPLIT_REND_PITCH_G_Q_STEP (( IVAS_SPLIT_REND_PITCH_G_MAX_VAL - IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) / ( IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS - 1 )) +#define IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP (( IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS - 1 )/( IVAS_SPLIT_REND_PITCH_G_MAX_VAL - IVAS_SPLIT_REND_PITCH_G_MIN_VAL )) + #define IVAS_SPLIT_REND_MAX_NUM_BYTES (4000) -#endif +#define IVAS_SPLIT_REND_HEAD_POSE_BITS (9) +#define IVAS_SPLIT_REND_DOF_BITS (2) +#define IVAS_SPLIT_REND_HQ_MODE_BITS (1) +#define IVAS_SPLIT_REND_ROT_AXIS_BITS (3) #endif #define HRTF_SH_ORDER 3 @@ -1617,6 +1660,13 @@ typedef enum #define SPAR_DIRAC_DTX_BANDS ( SPAR_DTX_BANDS + DIRAC_DTX_BANDS ) #define CLDFB_PAR_WEIGHT_START_BAND 7 +#define SIZE_SPLIT_REND_BRATE_TBL (4) +#define SPLIT_REND_256k 256000 +#define SPLIT_REND_384k 384000 +#define SPLIT_REND_512k 512000 +#define SPLIT_REND_768k 768000 +#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k + #endif /* clang-format on */ /* IVAS_CNST_H */ diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 62050015c6..c0414dc990 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4565,6 +4565,9 @@ void ivas_binaural_cldfb( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, #endif @@ -4597,6 +4600,15 @@ void Quat2Euler( float *roll /* o : roll */ ); +#ifdef SPLIT_REND_WITH_HEAD_ROT +void Quat2EulerDegree( + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ +); +#endif + void SHrotmatgen( float SHrotmat[SBA_NHARM_HOA3][SBA_NHARM_HOA3], /* o : SHD rotation matrix */ float Rmat[3][3], /* i : real-space rotation matrix */ @@ -4666,15 +4678,20 @@ void rotateFrame_sd_cldfb( void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, + IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, + HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ); void ivas_init_split_rend_handles( SPLIT_REND_WRAPPER *hSplitRendWrapper ); +void ivas_init_split_post_rend_handles( + SPLIT_POST_REND_WRAPPER *hSplitRendWrapper ); ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitBinRend, + const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const int32_t output_Fs, - const IVAS_SPLIT_REND_MODE splitRendMode, - const int16_t is_cldfb_in ); + const int16_t is_cldfb_in, + const int16_t is_pcm_out); void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend); @@ -4692,6 +4709,7 @@ void ivas_splitBinLCLDEncProcess( BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int32_t available_bits, ivas_split_rend_bits_t *pBits ); ivas_error ivas_splitBinLCLDDecOpen( @@ -4709,7 +4727,8 @@ void ivas_splitBinLCLDDecProcess( float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ); ivas_error ivas_splitBinPreRendOpen( - BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend + BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG , const int32_t output_Fs @@ -4718,32 +4737,48 @@ ivas_error ivas_splitBinPreRendOpen( ivas_error ivas_splitBinPostRendOpen( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, - const int32_t output_Fs ); + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int32_t output_Fs, + const int16_t is_cldfb_in ); + +void ivas_init_multi_bin_pose_data( + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); +void ivas_renderSplitGetMultiBinPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_SPLIT_REND_ROT_AXIS rot_axis); ivas_error ivas_renderMultiBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + const int32_t SplitRendBitRate, ivas_split_rend_bits_t *pBits, float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], - const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], const int16_t max_bands, - float out[][L_FRAME48k]); + float out[][L_FRAME48k], + const int16_t low_res_pre_rend_rot, + const int16_t pcm_out +); void ivas_rend_CldfbSplitPreRendProcess( const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t max_bands, - ivas_split_rend_bits_t *pBits ); + ivas_split_rend_bits_t *pBits, + const int32_t target_md_bits, + const int16_t low_res_pre_rend_rot); void ivas_rend_CldfbSplitPostRendProcess( BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, - const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], float Cldfb_RealBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float output[][L_FRAME48k] ); + float output[][L_FRAME48k], + const int16_t is_cldfb_in ); void ivas_splitBinPreRendClose( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend ); @@ -4754,6 +4789,7 @@ void ivas_splitBinPostRendClose( void ivas_splitBinPostRendMdDec( ivas_split_rend_bits_t *pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, #endif @@ -4761,29 +4797,30 @@ void ivas_splitBinPostRendMdDec( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG void ivas_log_cldfb2wav_data( - float Cldfb_In_Real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_In_Imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], HANDLE_CLDFB_FILTER_BANK *cldfbSyn, const int16_t num_chs, const int16_t num_freq_bands, const int32_t output_Fs, + const int16_t start_slot_idx, + const int16_t md_band_idx, const char *filename ); #endif void ivas_SplitRenderer_GetRotMd( BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ - float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - ivas_split_rend_bits_t *pBits, - int16_t sf_idx ); + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + int16_t low_res); void ivas_SplitRenderer_PostRenderer( - BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ - float Cldfb_RealBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ - float Cldfb_ImagBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ - int16_t sf_idx, - const IVAS_QUATERNION *Quaternions_ref, - const IVAS_QUATERNION *Quaternions_act ); + BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + float Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + const IVAS_QUATERNION Quaternions_act[MAX_PARAM_SPATIAL_SUBFRAMES]); #endif diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index b8fbaa833f..69ebb519aa 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -1119,7 +1119,6 @@ void v_sort_ind( return; } - /*-------------------------------------------------------------------* * is_IVAS_bitrate() * diff --git a/lib_com/options.h b/lib_com/options.h index 1f12475cfb..1868be25a5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,8 +157,30 @@ #define SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT //#define SPLIT_REND_WITH_HEAD_ROT_DEBUG // only for debugging purposes -#define SPLIT_REND_BASE2_CODING -//#define SPLIT_REND_SKIP_POST_REND +//#define DBG_WAV_WRITER + +#define SPLIT_SIN_SCALING_AND_EXTRAPOL_LIMIT + +#define SPLIT_REND_ZERO_OUT_YAW_D +//#define SPLIT_REND_REAL_ONLY_ROLL + +//#define SPIT_ABS_SCALING_INTERP + +//#define USE_DOLBY_HRTFS_WITH_LIB_REND_HOA3 + +//#define SPLIT_MD_CODING_DEBUG +#define FIX_376_SBA_ROTATE + + +/*CLDFB CODEC SWITCHES -- START*/ +#define ENABLE_MS_PRED +#define BUG_FIX_03_15_23_INIT_GROUPING +#define FORCE_GROUPS_OF_2 +#define USE_BIT_COUNT_MERGE_COST +#define OPTIMIZE_DPCM_QUANT +/*CLDFB CODEC SWITCHES -- END*/ + + #endif /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 973f15ef5a..d4a03b00a0 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -719,6 +719,10 @@ int32_t get_delay( HANDLE_CLDFB_FILTER_BANK hCldfb, /* i : Handle of Cldfb analysis */ RENDERER_TYPE renderer_type, /* i : IVAS rendering type */ const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + AUDIO_CONFIG output_config /* i : decoder output config */ +#endif ); void decision_matrix_enc( diff --git a/lib_debug/debug.c b/lib_debug/debug.c index dc3d0cb4d9..3d72aa637b 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -55,7 +55,7 @@ #else #endif #include "wmops.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER #include "tinywaveout_c.h" #endif @@ -93,17 +93,17 @@ int16_t debug_level = 0; static FILE *in_fileptr[N_FILEPTR]; static FILE *out_fileptr[N_FILEPTR]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER static WAVEFILEOUT *out_wavfileptr[N_FILEPTR]; #endif static char *in_filename[N_FILEPTR]; static char *out_filename[N_FILEPTR]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER static char *out_wavfilename[N_FILEPTR]; #endif static int16_t in_count = 0; static int16_t out_count = 0; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER static int16_t out_wav_count = 0; #endif @@ -401,7 +401,7 @@ void dbgclose() fclose( out_fileptr[i] ); free( out_filename[i] ); } -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER for ( i = 0; i < out_wav_count; i++ ) { CloseWav( out_wavfileptr[i] ); @@ -863,7 +863,7 @@ int16_t make_dirs( const char *const pathname ) return 0; } -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER int16_t dbgwrite_wav( const float *buffer[], /* i : Write buffer */ const int16_t count_per_ch, /* i : Number of elements */ diff --git a/lib_debug/debug.h b/lib_debug/debug.h index e228f11cf4..49aae558b0 100644 --- a/lib_debug/debug.h +++ b/lib_debug/debug.h @@ -95,7 +95,7 @@ int16_t dbgwrite( const char *const filename #endif ); -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG +#ifdef DBG_WAV_WRITER int16_t dbgwrite_wav( const float *buffer[], /* i : Write buffer */ const int16_t count_per_ch, /* i : Number of elements */ diff --git a/lib_debug/mem_count.c b/lib_debug/mem_count.c index 598b023df3..6315390d07 100644 --- a/lib_debug/mem_count.c +++ b/lib_debug/mem_count.c @@ -98,7 +98,7 @@ typedef INT64 int64_t; /* This is the maximum number of allocations for which to keep information. It can be increased if required. */ #ifdef SBA_BR_SWITCHING -#define MAX_INFO_RECORDS 9000 +#define MAX_INFO_RECORDS 15000 #else #define MAX_INFO_RECORDS 3000 #endif diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index cf887ab725..fd828a6c22 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -89,12 +89,6 @@ ivas_error ivas_dec( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->Opt_splitRendMode != SPLIT_REND_DISABLED ) - { - ivas_set_split_rend_setup( &st_ivas->splitBinRend, hSplitRendBits ); - } -#endif /*----------------------------------------------------------------* * Initialization of local vars after struct has been set *----------------------------------------------------------------*/ @@ -106,6 +100,14 @@ ivas_error ivas_dec( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); + ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hHeadTrackData, hSplitRendBits ); + } +#endif + /*----------------------------------------------------------------* * Decoding + Rendering *----------------------------------------------------------------*/ @@ -555,23 +557,21 @@ ivas_error ivas_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT /*split rendering process calls*/ - if ( st_ivas->hDecoderConfig->Opt_splitRendMode != SPLIT_REND_DISABLED ) + if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - if ( ( st_ivas->splitBinRend.splitrend.hBinHrSplitPreRend != NULL ) && ( st_ivas->splitBinRend.splitrend.hBinHrSplitPostRend != NULL ) ) - { - IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; - int16_t max_band; - hSplitBinRend = &st_ivas->splitBinRend; - max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); - ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, - hSplitBinRend->hSplitRendBits, - hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, - hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, - st_ivas->hHeadTrackData->Quaternions, - st_ivas->hPostRendheadTrackData->Quaternions, max_band, output ); - - dynamic_free( st_ivas->splitBinRend.hMultiBinCldfbData ); - } + IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; + int16_t max_band; + hSplitBinRend = &st_ivas->splitBinRend; + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); + ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, + st_ivas->hHeadTrackData->Quaternions, + st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, + hSplitBinRend->hSplitRendBits, + hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, + hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, + max_band, output, 1, 0 ); + + dynamic_free( st_ivas->splitBinRend.hMultiBinCldfbData ); } #endif /*----------------------------------------------------------------* diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8b07d7bb1d..e7301685fd 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2349,6 +2349,9 @@ void ivas_dirac_dec( /* Perform binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, +#ifdef SPLIT_REND_WITH_HEAD_ROT + &st_ivas->splitBinRend.splitrend.multiBinPoseData, +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG st_ivas->hPostRendheadTrackData, #endif @@ -2359,13 +2362,13 @@ void ivas_dirac_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hBinRenderer->splitRendMode == SPLIT_REND_PRE || st_ivas->hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { int16_t pos_idx; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES + 1; pos_idx++ ) + for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) #else - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) #endif { for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots; slot_idx++ ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 5d8d158739..bf3da79bf8 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -564,20 +564,6 @@ ivas_error ivas_init_decoder_front( } } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->Opt_splitRendMode == SPLIT_REND_COMB ) - { - if ( ( error = ivas_headTrack_open( &( st_ivas->hPostRendheadTrackData ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - st_ivas->hPostRendheadTrackData = NULL; - } -#endif - /*-------------------------------------------------------------------* * Allocate HRTF binary handle *--------------------------------------------------------------------*/ @@ -594,7 +580,11 @@ ivas_error ivas_init_decoder_front( * Allocate and initialize Binaural Renderer configuration handle *--------------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM ) + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { if ( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ) != IVAS_ERR_OK ) { @@ -1167,12 +1157,26 @@ ivas_error ivas_init_decoder( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif if ( ( error = ivas_binRenderer_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, hDecoderConfig->output_Fs, hDecoderConfig->Opt_splitRendMode, 1 ); + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, 1, 0 ); + } #endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) @@ -1665,6 +1669,9 @@ void ivas_destroy_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT /* Split binaural renderer handle */ ivas_split_renderer_close( &st_ivas->splitBinRend.splitrend ); + +#else + #endif /* Parametric binaural renderer handle */ @@ -1703,13 +1710,6 @@ void ivas_destroy_dec( count_free( st_ivas->hHeadTrackData ); st_ivas->hHeadTrackData = NULL; } -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hPostRendheadTrackData != NULL ) - { - count_free( st_ivas->hPostRendheadTrackData ); - st_ivas->hPostRendheadTrackData = NULL; - } -#endif /* Time Domain binaural renderer handle */ if ( st_ivas->hBinRendererTd != NULL ) @@ -1980,7 +1980,11 @@ static ivas_error doSanityChecks_IVAS( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { if ( !( output_config == AUDIO_CONFIG_BINAURAL || - output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) + output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) ) { return IVAS_ERROR( IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED, "Wrong set-up: Head-rotation not supported in this configuration" ); } @@ -1994,7 +1998,12 @@ static ivas_error doSanityChecks_IVAS( * - 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 ) ) + if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) || + !( 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." ); } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 7b8901fdec..e33a0596eb 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1057,6 +1057,9 @@ void ivas_param_mc_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, +#ifdef SPLIT_REND_WITH_HEAD_ROT + &st_ivas->splitBinRend.splitrend.multiBinPoseData, +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index d481ffa904..efab9efedd 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -556,9 +556,26 @@ const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENCE_BINS] /*----------------------------------------------------------------------* * split rendering ROM tables *-----------------------------------------------------------------------*/ -const float split_rend_relative_yaw_angles[MAX_YAW_ANGLES] = {0.0f, -15.0f, 30.0f}; /*actual rotations would be Ref, Ref - 15, Ref - 15 + 30 */ -const float split_rend_relative_pitch_angles[MAX_PITCH_ANGLES] = {0.0f}; -const float split_rend_relative_roll_angles[MAX_ROLL_ANGLES] = {0.0f}; + +/*----------------------------------------------------------------------------------* + * Table of Split rendering bitrates + *----------------------------------------------------------------------------------*/ +const int32_t split_rend_brate_tbl[SIZE_SPLIT_REND_BRATE_TBL] = +{ + SPLIT_REND_256k, SPLIT_REND_384k, SPLIT_REND_512k, SPLIT_REND_768k +}; + +/*rotations in this array are relative to ref rotation */ +const float split_rend_relative_yaw_pos_angles[SPLIT_REND_MAX_YAW_ONLY_POSES] = {-15.0f, 15.0f}; +const float split_rend_relative_pitch_pos_angles[SPLIT_REND_MAX_PITCH_ONLY_POSES] = {10.0f, 10.0f}; +const float split_rend_relative_roll_pos_angles[SPLIT_REND_MAX_PITCH_ONLY_POSES] = {10.0f, 10.0f}; +const float split_rend_relative_one_axis_pos_angles[SPLIT_REND_MAX_ONE_AXIS_MD_POSES] = {-15.0f, 15.0f}; + +const float split_rend_relative_yaw_pos_angles_hq[SPLIT_REND_MAX_YAW_ONLY_POSES] = {-15.0f, 15.0f}; +const float split_rend_relative_pitch_pos_angles_hq[SPLIT_REND_MAX_PITCH_ONLY_POSES] = {-15.0f, 15.0f}; +const float split_rend_relative_roll_pos_angles_hq[SPLIT_REND_MAX_PITCH_ONLY_POSES] = {-15.0f, 15.0f}; +const float split_rend_relative_one_axis_pos_angles_hq[SPLIT_REND_MAX_ONE_AXIS_MD_POSES] = {-15.0f, 15.0f}; + const int16_t SplitRend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1] = { //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 34, 36, 38, 40, 50, 60 @@ -567,6 +584,19 @@ const int16_t SplitRend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1] = //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 25, 40, 60 }; +const int32_t ivas_split_rend_huff_p_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3] = { +{0,8,252},{1,8,253},{2,7,124},{3,6,60},{4,5,28},{5,4,12}, +{6,3,4},{7,1,0},{8,3,5},{9,4,13},{10,5,29},{11,6,61}, +{12,7,125},{13,8,254},{14,8,255} +}; + +const int32_t ivas_split_rend_huff_p_d_diff_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3] = { + { 0, 1, 0 },{ 1, 2, 2 },{ 2, 3, 6 },{ 3, 4, 14 }, + { 4, 5, 30 },{ 5, 6, 62 },{ 6, 7, 126 },{ 7, 8, 254 }, + { 8, 9, 510 },{ 9, 10, 1022 },{ 10, 11, 2046 },{ 11, 12, 4094 }, + { 12, 13, 8190 },{ 13, 14, 16382 },{ 14, 14, 16383 } +}; + const int32_t ivas_split_rend_huff_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3] = { { 0, 1, 0 },{ 1, 2, 2 },{ 2, 3, 6 },{ 3, 4, 14 }, { 4, 5, 30 },{ 5, 6, 62 },{ 6, 7, 126 },{ 7, 8, 254 }, diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index aa5f48cbe9..0cbf968d4b 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -160,12 +160,24 @@ extern const float diffuseFieldCoherenceDifferenceZ[BINAURAL_COHERENCE_DIFFERENC /*----------------------------------------------------------------------* * split rendering ROM tables *-----------------------------------------------------------------------*/ -extern const float split_rend_relative_yaw_angles[MAX_YAW_ANGLES]; -extern const float split_rend_relative_pitch_angles[MAX_PITCH_ANGLES]; -extern const float split_rend_relative_roll_angles[MAX_ROLL_ANGLES]; +extern const float split_rend_relative_yaw_pos_angles[SPLIT_REND_MAX_YAW_ONLY_POSES]; +extern const float split_rend_relative_pitch_pos_angles[SPLIT_REND_MAX_PITCH_ONLY_POSES]; +extern const float split_rend_relative_roll_pos_angles[SPLIT_REND_MAX_PITCH_ONLY_POSES]; +extern const float split_rend_relative_one_axis_pos_angles[SPLIT_REND_MAX_ONE_AXIS_MD_POSES]; +extern const float split_rend_relative_one_axis_pos_angles_hq[SPLIT_REND_MAX_ONE_AXIS_MD_POSES]; + +extern const float split_rend_relative_yaw_pos_angles_hq[SPLIT_REND_MAX_YAW_ONLY_POSES]; +extern const float split_rend_relative_pitch_pos_angles_hq[SPLIT_REND_MAX_PITCH_ONLY_POSES]; +extern const float split_rend_relative_roll_pos_angles_hq[SPLIT_REND_MAX_PITCH_ONLY_POSES]; + + +extern const float split_rend_relative_pos_angles[MAX_HEAD_ROT_POSES][3]; extern const int16_t SplitRend_band_grouping[MAX_SPLIT_REND_MD_BANDS + 1]; extern const int32_t ivas_split_rend_huff_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3]; extern const int32_t ivas_split_rend_huff_pred_consts[IVAS_SPLIT_REND_PRED_QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_p_d_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3]; +extern const int32_t ivas_split_rend_huff_p_d_diff_consts[IVAS_SPLIT_REND_D_QUANT_PNTS][3]; +extern const int32_t split_rend_brate_tbl[]; #endif #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 3c02a05d9b..aa300a0a8f 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -446,7 +446,11 @@ ivas_error ivas_sba_dec_reinit( set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM ); } - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM ) + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { if ( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ) != IVAS_ERR_OK ) { @@ -459,12 +463,26 @@ ivas_error ivas_sba_dec_reinit( } if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + } +#endif if ( ( error = ivas_binRenderer_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, hDecoderConfig->output_Fs, hDecoderConfig->Opt_splitRendMode, 1 ); + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, 1, 0 ); + } #endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index ceed901c1a..678db72276 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1157,7 +1157,11 @@ void ivas_spar_dec_upmixer( } else { - if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) + if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) ) { for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 65d2af32f9..9a71525563 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -43,8 +43,8 @@ #include "common_api_types.h" // VE2AT: don't we want to avoid this include in the library? I admit that the rules hefre are not 100% clear to me but introducing it just for IVAS_QUATERNION is not necessry I think #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_cldfb_trans_codec/CQMFEncoder.h" -#include "ivas_cldfb_trans_codec/CQMFDecoder.h" +#include "ivas_CQMFEncoder.h" +#include "ivas_CQMFDecoder.h" #endif /*----------------------------------------------------------------------------------* @@ -1278,10 +1278,6 @@ typedef struct ivas_binaural_rendering_conv_module_struct int16_t numTapsArray[BINAURAL_CONVBANDS]; int16_t numTaps; -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t numPoses; -#endif - } BINRENDERER_CONV_MODULE, *BINRENDERER_CONV_MODULE_HANDLE; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1291,9 +1287,11 @@ typedef struct ivas_binaural_head_rot_split_rendering_md_struct float pred_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; float pred_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; float gd; + float gd2; int16_t pred_mat_re_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t pred_mat_im_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t gd_idx; + int16_t gd2_idx; } BIN_HR_SPLIT_REND_MD, *BIN_HR_SPLIT_REND_MD_HANDLE; typedef struct ivas_split_rend_huffman_cfg_t @@ -1312,12 +1310,19 @@ typedef struct ivas_binaural_head_rot_split_rendering_huff_struct ivas_split_rend_huffman_cfg_t gd; int16_t gd_base2_code_len; int16_t gd_idx_trav[IVAS_SPLIT_REND_D_QUANT_PNTS]; + ivas_split_rend_huffman_cfg_t p_gd; + int16_t p_gd_base2_code_len; + int16_t p_gd_idx_trav[IVAS_SPLIT_REND_D_QUANT_PNTS]; + ivas_split_rend_huffman_cfg_t p_gd_diff; + int16_t p_gd_diff_base2_code_len; + int16_t p_gd_diff_idx_trav[IVAS_SPLIT_REND_D_QUANT_PNTS]; } BIN_HR_SPLIT_REND_HUFF, *BIN_HR_SPLIT_REND_HUFF_HANDLE; typedef struct ivas_binaural_head_rot_split_pre_rendering_struct { BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; - float fix_pos_rot_mat[MAX_YAW_ANGLES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + IVAS_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; BIN_HR_SPLIT_REND_HUFF huff_cfg; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HANDLE_CLDFB_FILTER_BANK cldfbSynRotBinDec[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS]; @@ -1327,7 +1332,11 @@ typedef struct ivas_binaural_head_rot_split_pre_rendering_struct typedef struct ivas_binaural_head_rot_split_post_rendering_struct { BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS]; + IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES]; + int16_t low_Res; + float fix_pos_rot_mat[MAX_HEAD_ROT_POSES - 1][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + IVAS_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1]; BIN_HR_SPLIT_REND_HUFF huff_cfg; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG float mixer_mat_re[MAX_HEAD_ROT_POSES][MAX_SPLIT_REND_MD_BANDS][BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -1339,6 +1348,7 @@ typedef struct ivas_binaural_head_rot_split_post_rendering_struct float gd_mem[1][MAX_SPLIT_REND_MD_BANDS]; #endif int16_t cf_flag; + HANDLE_CLDFB_FILTER_BANK cldfbAna[BINAURAL_CHANNELS]; HANDLE_CLDFB_FILTER_BANK cldfbSyn[BINAURAL_CHANNELS]; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HANDLE_CLDFB_FILTER_BANK cldfbSynReconsBinDec[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS]; @@ -1348,41 +1358,63 @@ typedef struct ivas_binaural_head_rot_split_post_rendering_struct typedef struct ivas_binaural_head_rot_split_rendering_lcld_enc_struct { void *pLcld_enc; - int32_t iChannels; - CQMFEncoder *psCQMFEncoder; - float ***pppfCQMFReal; - float ***pppfCQMFImag; + int32_t iChannels; + CQMFEncoder *psCQMFEncoder; + float ***pppfCQMFReal; + float ***pppfCQMFImag; #ifdef CLDFB_DEBUG - FILE *cldfbIn; - int numFrame; + FILE *cldfbIn; + int numFrame; #endif } BIN_HR_SPLIT_LCLD_ENC, *BIN_HR_SPLIT_LCLD_ENC_HANDLE; typedef struct ivas_binaural_head_rot_split_rendering_lcld_dec_struct { void *pLcld_dec; - int32_t iChannels; - CQMFDecoder *psCQMFDecoder; - float ***pppfDecCQMFReal; - float ***pppfDecCQMFImag; + int32_t iChannels; + CQMFDecoder *psCQMFDecoder; + float ***pppfDecCQMFReal; + float ***pppfDecCQMFImag; #ifdef CLDFB_DEBUG - FILE *cldfbOut; - int numFrame; + FILE *cldfbOut; + int numFrame; #endif } BIN_HR_SPLIT_LCLD_DEC, *BIN_HR_SPLIT_LCLD_DEC_HANDLE; typedef struct { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HANDLE_CLDFB_FILTER_BANK cldfbAna[( 1 + MAX_HEAD_ROT_POSES ) * BINAURAL_CHANNELS]; +#else HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; +#endif } CLDFB_HANDLES_WRAPPER, *CLDFB_HANDLES_WRAPPER_HANDLE; + +#ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct { + int16_t num_poses; + float relative_head_poses[MAX_HEAD_ROT_POSES][3]; + int16_t dof; + int16_t hq_mode; + IVAS_SPLIT_REND_ROT_AXIS rot_axis; +} MULTI_BIN_REND_POSE_DATA; +#endif + +typedef struct +{ + MULTI_BIN_REND_POSE_DATA multiBinPoseData; BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend; BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc; - BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; - BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec; CLDFB_HANDLES_WRAPPER_HANDLE hCldfbHandles; } SPLIT_REND_WRAPPER; + +typedef struct +{ + MULTI_BIN_REND_POSE_DATA multiBinPoseData; + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend; + BIN_HR_SPLIT_LCLD_DEC_HANDLE hSplitBinLCLDDec; +} SPLIT_POST_REND_WRAPPER; #endif /* Fastconv binaural data structure */ @@ -1399,15 +1431,17 @@ typedef struct ivas_binaural_rendering_struct int16_t nInChannels; /* number input channels */ int8_t render_lfe; /* Flag to render LFE in binaural rendering*/ IVAS_FORMAT ivas_format; /* format; corresponds to st_ivas->ivas_format, unless the signal gets transormed to a different domain for rendering */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_SPLIT_REND_MODE splitRendMode; /*Split rendering mode, pre, post (OR combined in debug mode)*/ -#endif /* Convolution module structure */ BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; /* Variables related to reverb module */ float earlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; REVERB_STRUCT_HANDLE hReverb; + +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t numPoses; +#endif + } BINAURAL_RENDERER, *BINAURAL_RENDERER_HANDLE; @@ -1428,6 +1462,9 @@ typedef struct ivas_binaural_head_track_struct float lrSwitchInterpVal; int16_t shd_rot_max_order; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; +#endif } HEAD_TRACK_DATA, *HEAD_TRACK_DATA_HANDLE; @@ -1797,10 +1834,13 @@ typedef struct ivas_roomAcoustics_t typedef struct ivas_render_config_t { -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) ivas_renderTypeOverride renderer_type_override; #endif ivas_roomAcoustics_t roomAcoustics; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_CONFIG_DATA split_rend_config; +#endif } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; @@ -1989,10 +2029,7 @@ 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 SPLIT_REND_WITH_HEAD_ROT - IVAS_SPLIT_REND_MODE Opt_splitRendMode; /* Split rendering mode */ -#endif - int16_t orientation_tracking; /* indicates orientation tracking type */ + int16_t orientation_tracking; /* indicates orientation tracking type */ float no_diegetic_pan; int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ @@ -2109,7 +2146,6 @@ typedef struct Decoder_Struct #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_DEC_SPLIT_REND_WRAPPER splitBinRend; - HEAD_TRACK_DATA_HANDLE hPostRendheadTrackData; #endif } Decoder_Struct; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 676076fc1f..1261c93b2b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -36,6 +36,9 @@ #include "jbm_jb4sb.h" #include "jbm_pcmdsp_apa.h" #include "jbm_pcmdsp_fifo.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "ivas_rom_dec.h" +#endif #include #include #include @@ -203,6 +206,29 @@ ivas_error IVAS_DEC_Open( } +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*-------------------------------------------------------------------* + * is_SplitRend_BitRate() + * + * check if the bitrate is SPLIT REND supported active bitrate + *-------------------------------------------------------------------*/ +static int16_t is_SplitRend_BitRate( const int32_t splitRendBitRate ) +{ + int16_t j; + + j = 0; + while ( j < SIZE_SPLIT_REND_BRATE_TBL && splitRendBitRate != split_rend_brate_tbl[j] ) + { + j++; + } + if ( j >= SIZE_SPLIT_REND_BRATE_TBL ) + { + return 0; + } + return 1; +} +#endif + /*---------------------------------------------------------------------* * init_decoder_config() * @@ -333,6 +359,12 @@ static AUDIO_CONFIG mapOutputFormat( { output_config = AUDIO_CONFIG_BINAURAL_ROOM; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) + { + output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB; + } +#endif else { output_config = AUDIO_CONFIG_INVALID; @@ -387,10 +419,6 @@ ivas_error IVAS_DEC_Configure( 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 SPLIT_REND_WITH_HEAD_ROT - , - const IVAS_SPLIT_REND_MODE splitRendMode /* i : split rend mode */ -#endif #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ @@ -447,10 +475,6 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_Headrotation = enableHeadRotation; hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; -#ifdef SPLIT_REND_WITH_HEAD_ROT - hDecoderConfig->Opt_splitRendMode = splitRendMode; -#endif - /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) { @@ -850,7 +874,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_QUATERNION *orientation /* i : head-tracking data */ #ifdef SPLIT_REND_WITH_HEAD_ROT , - IVAS_SPLIT_REND_MODE splitRendMode /* i : flag to determine split rendering mode*/ + IVAS_SPLIT_REND_ROT_AXIS rot_axis #endif ) { @@ -863,12 +887,6 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } hHeadTrackData = hIvasDec->st_ivas->hHeadTrackData; -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( splitRendMode == SPLIT_REND_POST ) - { - hHeadTrackData = hIvasDec->st_ivas->hPostRendheadTrackData; - } -#endif if ( hHeadTrackData == NULL ) { @@ -886,6 +904,10 @@ ivas_error IVAS_DEC_FeedHeadTrackData( hHeadTrackData->num_quaternions = 0; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hHeadTrackData->sr_pose_pred_axis = rot_axis; +#endif + return IVAS_ERR_OK; } @@ -1010,6 +1032,13 @@ ivas_error IVAS_DEC_GetRenderConfig( 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 SPLIT_REND_WITH_HEAD_ROT + hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k; + hRCout->split_rend_config.dof = 3; + hRCout->split_rend_config.hq_mode = 0; + hRCout->split_rend_config.codec_delay_ms = 0; +#endif + return IVAS_ERR_OK; } @@ -1054,6 +1083,13 @@ ivas_error IVAS_DEC_FeedRenderConfig( 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 SPLIT_REND_WITH_HEAD_ROT + hRenderConfig->split_rend_config.splitRendBitRate = renderConfig.split_rend_config.splitRendBitRate; + hRenderConfig->split_rend_config.dof = renderConfig.split_rend_config.dof; + hRenderConfig->split_rend_config.hq_mode = renderConfig.split_rend_config.hq_mode; + hRenderConfig->split_rend_config.codec_delay_ms = renderConfig.split_rend_config.codec_delay_ms; +#endif + return IVAS_ERR_OK; } @@ -1080,8 +1116,11 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + *nSamples = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns, hDecoderConfig->output_config ) ); +#else *nSamples = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) ); +#endif *timeScale = hDecoderConfig->output_Fs; @@ -1705,6 +1744,12 @@ static ivas_error get_channel_config( { strcpy( str, "Binaural_ROOM" ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + strcpy( str, "Split_Binaural" ); + } +#endif else if ( config == AUDIO_CONFIG_EXTERNAL ) { strcpy( str, "External renderer" ); diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 4a052ba32b..d3889c626c 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -59,6 +59,9 @@ typedef enum _IVAS_DEC_OUTPUT_CONFIG IVAS_DEC_OUTPUT_HOA3, IVAS_DEC_OUTPUT_BINAURAL, IVAS_DEC_OUTPUT_BINAURAL_ROOM, +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB, +#endif IVAS_DEC_OUTPUT_EXT, IVAS_DEC_OUTPUT_UNKNOWN = 0xffff } IVAS_DEC_AUDIO_CONFIG; @@ -127,10 +130,6 @@ ivas_error IVAS_DEC_Configure( 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 SPLIT_REND_WITH_HEAD_ROT - , - const IVAS_SPLIT_REND_MODE splitRendMode /* i : split rendering mode */ -#endif #ifdef DEBUGGING , const int16_t forceSubframeBinauralization /* i : enable subframe binauralization */ @@ -181,9 +180,9 @@ 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 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT + #ifdef SPLIT_REND_WITH_HEAD_ROT , - IVAS_SPLIT_REND_MODE splitRendMode /* i : flag to determine split rendering mode*/ + IVAS_SPLIT_REND_ROT_AXIS rot_axis /*i : external control for rotation axis for split rendering*/ #endif ); diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index b4eb85915e..efbed2baf7 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -951,7 +951,11 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0, AUDIO_CONFIG_INVALID ) ); +#else *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) ); +#endif *delay *= hEncoderConfig->nchan_inp; diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c new file mode 100644 index 0000000000..37ae41bca0 --- /dev/null +++ b/lib_rend/ivas_CQMFDecoder.c @@ -0,0 +1,1375 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_CQMFDecoder.h" + +#include "ivas_CQMFHuff.h" +#include "ivas_NoiseGen.h" +#include "ivas_PerceptualModel.h" +#include "ivas_RMSEnvDeltaHuff.h" +#include "ivas_Tables.h" +#include "ivas_cldfb_codec_bitstream.h" +#include "options.h" +#include "prot.h" +#include "wmops.h" +#include +#include +#include +#include +#ifdef ENABLE_MS_PRED +#include "ivas_MSPred.h" +#endif + +#include "ivas_PredDecoder.h" +#include "ivas_lib_rend_internal.h" + +struct CQMF_DECODER +{ + int32_t iSampleRate; + int32_t iChannels; + int32_t iNumBlocks; + + int32_t iNumBands; + const int32_t *piBandwidths; + + int32_t iMSMode; + int32_t *piMSFlags; +#ifdef ENABLE_MS_PRED + int32_t piMSPredCoefs[MAX_BANDS]; + int32_t piLRPhaseDiffs[MAX_BANDS]; +#endif +#ifdef ENABLE_PMOD_ADJUST + int32_t **ppiHiSMRFlags; +#endif + // uint8_t *pReadBuff; + int32_t iCommonGrouping; + int32_t *piNumGroups; + int32_t **ppiGroupLengths; + + int32_t ***pppiRMSEnvelope; + int32_t ***pppiSMR; + int32_t ***pppiExcitation; + int32_t ***pppiAlloc; + + int32_t iAllocOffset; + + int32_t ***pppiCQMFSignReal; + int32_t ***pppiCQMFSignImag; + int32_t ***pppiQCQMFReal; + int32_t ***pppiQCQMFImag; + + PredictionDecoder *psPredictionDecoder; + + + NoiseGen *psNoiseGen; + + int32_t iLastError; +}; + +CQMFDecoder *CreateCQMFDecoder( const int32_t iSampleRate, + const int32_t iChannels ) +{ + int32_t n; + CQMFDecoder *psCQMFDecoder = NULL; + + assert( iSampleRate == 48000 ); // Fix + + psCQMFDecoder = (CQMFDecoder *) count_malloc( sizeof( CQMFDecoder ) ); + psCQMFDecoder->iSampleRate = iSampleRate; + psCQMFDecoder->iChannels = iChannels; + psCQMFDecoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; + psCQMFDecoder->iAllocOffset = 0; + + psCQMFDecoder->iNumBands = MAX_BANDS_48; // Fix + psCQMFDecoder->piBandwidths = c_aiBandwidths48; // Fix + + psCQMFDecoder->iMSMode = 0; + psCQMFDecoder->piMSFlags = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); +#ifdef ENABLE_MS_PRED + for ( n = 0; n < MAX_BANDS; n++ ) + { + psCQMFDecoder->piLRPhaseDiffs[n] = 0; + psCQMFDecoder->piMSPredCoefs[n] = 0; + } +#endif +#ifdef ENABLE_PMOD_ADJUST + psCQMFDecoder->ppiHiSMRFlags = + (int32_t **) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t * ) ); +#endif + + psCQMFDecoder->iCommonGrouping = + 1; // Common grouping always on only impacts stereo + psCQMFDecoder->piNumGroups = + (int32_t *) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ) ); + psCQMFDecoder->ppiGroupLengths = + (int32_t **) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t * ) ); + psCQMFDecoder->pppiRMSEnvelope = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiSMR = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiExcitation = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiAlloc = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + + psCQMFDecoder->pppiCQMFSignReal = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiCQMFSignImag = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiQCQMFReal = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + psCQMFDecoder->pppiQCQMFImag = + (int32_t ***) count_malloc( psCQMFDecoder->iChannels * sizeof( int32_t ** ) ); + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; +#ifdef ENABLE_PMOD_ADJUST + psCQMFDecoder->ppiHiSMRFlags[n] = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + ; +#endif + psCQMFDecoder->ppiGroupLengths[n] = + (int32_t *) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t ) ); + psCQMFDecoder->pppiRMSEnvelope[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiSMR[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiExcitation[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiAlloc[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + + psCQMFDecoder->pppiCQMFSignReal[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiCQMFSignImag[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiQCQMFReal[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFDecoder->pppiQCQMFImag[n] = + (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + psCQMFDecoder->pppiRMSEnvelope[n][k] = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiSMR[n][k] = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiExcitation[n][k] = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiAlloc[n][k] = + (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + + psCQMFDecoder->pppiCQMFSignReal[n][k] = + (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiCQMFSignImag[n][k] = + (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiQCQMFReal[n][k] = + (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFDecoder->pppiQCQMFImag[n][k] = + (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + } + } + + psCQMFDecoder->psPredictionDecoder = + CreatePredictionDecoder( iChannels, psCQMFDecoder->iNumBlocks ); + // psCQMFDecoder->pReadBuff = + // (uint8_t *) count_malloc( 4096 * sizeof( uint8_t ) ); + psCQMFDecoder->psNoiseGen = + NULL; // CreateNoiseGen(); // No noise fill for now + + psCQMFDecoder->iLastError = DECODER_ERROR_NONE; + + return psCQMFDecoder; +} + +void DeleteCQMFDecoder( CQMFDecoder *psCQMFDecoder ) +{ + if ( psCQMFDecoder != NULL ) + { + + if ( psCQMFDecoder->piMSFlags != NULL ) + { + count_free( psCQMFDecoder->piMSFlags ); + } + + if ( psCQMFDecoder->piNumGroups != NULL ) + { + count_free( psCQMFDecoder->piNumGroups ); + } + + if ( psCQMFDecoder->ppiGroupLengths != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + count_free( psCQMFDecoder->ppiGroupLengths[n] ); + } + count_free( psCQMFDecoder->ppiGroupLengths ); + } + + if ( psCQMFDecoder->pppiRMSEnvelope != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiRMSEnvelope[n][k] ); + } + count_free( psCQMFDecoder->pppiRMSEnvelope[n] ); + } + count_free( psCQMFDecoder->pppiRMSEnvelope ); + } + + if ( psCQMFDecoder->pppiSMR != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiSMR[n][k] ); + } + count_free( psCQMFDecoder->pppiSMR[n] ); + } + count_free( psCQMFDecoder->pppiSMR ); + } + + if ( psCQMFDecoder->pppiExcitation != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiExcitation[n][k] ); + } + count_free( psCQMFDecoder->pppiExcitation[n] ); + } + count_free( psCQMFDecoder->pppiExcitation ); + } + +#ifdef ENABLE_PMOD_ADJUST + if ( psCQMFDecoder->ppiHiSMRFlags != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + count_free( psCQMFDecoder->ppiHiSMRFlags[n] ); + } + count_free( psCQMFDecoder->ppiHiSMRFlags ); + } +#endif + + if ( psCQMFDecoder->pppiAlloc != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiAlloc[n][k] ); + } + count_free( psCQMFDecoder->pppiAlloc[n] ); + } + count_free( psCQMFDecoder->pppiAlloc ); + } + + if ( psCQMFDecoder->pppiCQMFSignReal != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiCQMFSignReal[n][k] ); + } + count_free( psCQMFDecoder->pppiCQMFSignReal[n] ); + } + count_free( psCQMFDecoder->pppiCQMFSignReal ); + } + + if ( psCQMFDecoder->pppiCQMFSignImag != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiCQMFSignImag[n][k] ); + } + count_free( psCQMFDecoder->pppiCQMFSignImag[n] ); + } + count_free( psCQMFDecoder->pppiCQMFSignImag ); + } + + if ( psCQMFDecoder->pppiQCQMFReal != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiQCQMFReal[n][k] ); + } + count_free( psCQMFDecoder->pppiQCQMFReal[n] ); + } + count_free( psCQMFDecoder->pppiQCQMFReal ); + } + + if ( psCQMFDecoder->pppiQCQMFImag != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFDecoder->pppiQCQMFImag[n][k] ); + } + count_free( psCQMFDecoder->pppiQCQMFImag[n] ); + } + count_free( psCQMFDecoder->pppiQCQMFImag ); + } + + // if ( psCQMFDecoder->pReadBuff != NULL ) + //{ + // count_free( psCQMFDecoder->pReadBuff ); + // } + + DeletePredictionDecoder( psCQMFDecoder->psPredictionDecoder ); + + if ( psCQMFDecoder->psNoiseGen != NULL ) + { + DeleteNoiseGen( psCQMFDecoder->psNoiseGen ); + } + + count_free( psCQMFDecoder ); + } +} + +int32_t CQMFDecoderGetError( CQMFDecoder *psCQMFDecoder ) +{ + return psCQMFDecoder->iLastError; +} + +static void ApplyRMSEnvelope( const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iNumGroups, + const int32_t *piGroupLengths, + int32_t **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ); + +static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumCQMFBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag ); + +static void +InvQuantizeSpectrum( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, int32_t **ppiAlloc, int32_t **ppiQReal, int32_t **ppiQImag, float **ppfReal, float **ppfImag, + NoiseGen *psNoiseGen ); // Nullable + +static void InvMSCoding( const int32_t iNumBlocks, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iMSMode, const int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + const int32_t *piLRPhaseDiffs, + const int32_t *piMSPredCoefs, +#endif + float ***pppfReal, + float ***pppfImag ); + +/* Currently only the number of bands in frame */ +static int32_t ReadHeaderInformation( int32_t *piNumBands, + ivas_split_rend_bits_t *pBits ); + +static int32_t ReadMSInformation( const int32_t iNumBands, int32_t *piMSMode, int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + int32_t *piLRPhaseDiffs, + int32_t *piMSPredCoefs, +#endif + ivas_split_rend_bits_t *pBits ); + +static int32_t ReadGroupInformation( const int32_t iChannels, + const int32_t iNumBlocks, + int32_t *piCommonGrouping, + int32_t *piNumGroups, + int32_t **ppiGroupLengths, + ivas_split_rend_bits_t *pBits ); + +static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZE], + int32_t *piSymbol, + ivas_split_rend_bits_t *pBits ); + +static int32_t ReadRMSEnvelope( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiRMSEnvelope, + ivas_split_rend_bits_t *pBits ); +static int32_t ReadAllocInformation( int32_t *piAllocOffset, + ivas_split_rend_bits_t *pBits ); + +static int32_t +ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ); + +static void ComputeAllocation( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiSMR, + const int32_t iAllocOffset, + int32_t ***pppiAlloc ); + +int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, + ivas_split_rend_bits_t *pBits, + float ***pppfCQMFReal, + float ***pppfCQMFImag ) +{ + int32_t n; + int32_t iBitsRead; + + iBitsRead = 0; + + iBitsRead += + ReadHeaderInformation( &psCQMFDecoder->iNumBands, pBits ); + + if ( psCQMFDecoder->iChannels == 2 ) + { + iBitsRead += ReadMSInformation( + psCQMFDecoder->iNumBands, &psCQMFDecoder->iMSMode, + psCQMFDecoder->piMSFlags, +#ifdef ENABLE_MS_PRED + psCQMFDecoder->piLRPhaseDiffs, psCQMFDecoder->piMSPredCoefs, +#endif + pBits ); + } + iBitsRead += ReadPredictors( psCQMFDecoder->psPredictionDecoder, + pBits ); + + + iBitsRead += ReadGroupInformation( + psCQMFDecoder->iChannels, psCQMFDecoder->iNumBlocks, + &psCQMFDecoder->iCommonGrouping, psCQMFDecoder->piNumGroups, + psCQMFDecoder->ppiGroupLengths, + pBits ); + + iBitsRead += ReadRMSEnvelope( + psCQMFDecoder->iChannels, (const int32_t *) psCQMFDecoder->piNumGroups, + psCQMFDecoder->iNumBands, psCQMFDecoder->pppiRMSEnvelope, + pBits ); + +#ifdef ENABLE_PMOD_ADJUST + iBitsRead += + ReadPmodInformation( psCQMFDecoder->ppiHiSMRFlags, psCQMFDecoder->psBSRead, + psCQMFDecoder->iChannels, psCQMFDecoder->iNumBands ); +#endif + + iBitsRead += ReadAllocInformation( &psCQMFDecoder->iAllocOffset, + pBits ); + + if ( psCQMFDecoder->iChannels == 2 && + psCQMFDecoder->iCommonGrouping == 1 ) + { // MS Mode? + int32_t k; + for ( k = 0; k < psCQMFDecoder->piNumGroups[0]; k++ ) + { + PerceptualModelStereo( psCQMFDecoder->iNumBands, psCQMFDecoder->piMSFlags, + psCQMFDecoder->pppiRMSEnvelope[0][k], + psCQMFDecoder->pppiRMSEnvelope[1][k], + psCQMFDecoder->pppiExcitation[0][k], + psCQMFDecoder->pppiExcitation[1][k], + psCQMFDecoder->pppiSMR[0][k], + psCQMFDecoder->pppiSMR[1][k] ); + } + } + else + { + for ( n = 0; n < psCQMFDecoder->iChannels; + n++ ) + { // This will be updated to support multiple sample rates + int32_t k; + for ( k = 0; k < psCQMFDecoder->piNumGroups[n]; k++ ) + { + PerceptualModel( + psCQMFDecoder->iNumBands, psCQMFDecoder->pppiRMSEnvelope[n][k], + psCQMFDecoder->pppiExcitation[n][k], psCQMFDecoder->pppiSMR[n][k] ); + } + } + } + + ComputeAllocation( + psCQMFDecoder->iChannels, (const int32_t *) psCQMFDecoder->piNumGroups, + psCQMFDecoder->iNumBands, psCQMFDecoder->pppiSMR, + psCQMFDecoder->iAllocOffset, psCQMFDecoder->pppiAlloc ); + + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + iBitsRead += ReadCQMFData( + psCQMFDecoder->piNumGroups[n], + (const int32_t *) psCQMFDecoder->ppiGroupLengths[n], + psCQMFDecoder->iNumBands, psCQMFDecoder->piBandwidths, + (const int32_t *) + psCQMFDecoder->psPredictionDecoder->ppiPredBandEnable[n], + psCQMFDecoder->pppiAlloc[n], + psCQMFDecoder->pppiCQMFSignReal[n], psCQMFDecoder->pppiCQMFSignImag[n], + psCQMFDecoder->pppiQCQMFReal[n], psCQMFDecoder->pppiQCQMFImag[n], + pBits ); + } + + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + InvQuantizeSpectrum( psCQMFDecoder->piNumGroups[n], + (const int32_t *) psCQMFDecoder->ppiGroupLengths[n], + psCQMFDecoder->iNumBands, psCQMFDecoder->piBandwidths, + psCQMFDecoder->pppiAlloc[n], + psCQMFDecoder->pppiQCQMFReal[n], + psCQMFDecoder->pppiQCQMFImag[n], + pppfCQMFReal[n], pppfCQMFImag[n], + psCQMFDecoder->psNoiseGen ); + + ReplaceSign( psCQMFDecoder->iNumBlocks, CQMF_BANDS, + psCQMFDecoder->pppiCQMFSignReal[n], + psCQMFDecoder->pppiCQMFSignImag[n], + pppfCQMFReal[n], pppfCQMFImag[n] ); + } + + ApplyInversePredictros( psCQMFDecoder->psPredictionDecoder, pppfCQMFReal, + pppfCQMFImag ); + + for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) + { + ApplyRMSEnvelope( psCQMFDecoder->iNumBands, psCQMFDecoder->piBandwidths, + psCQMFDecoder->piNumGroups[n], + (const int32_t *) psCQMFDecoder->ppiGroupLengths[n], + psCQMFDecoder->pppiRMSEnvelope[n], + pppfCQMFReal[n], pppfCQMFImag[n] ); + } + + if ( psCQMFDecoder->iChannels == 2 && psCQMFDecoder->iMSMode > 0 ) + { + InvMSCoding( psCQMFDecoder->iNumBlocks, psCQMFDecoder->iNumBands, + psCQMFDecoder->piBandwidths, psCQMFDecoder->iMSMode, + (const int32_t *) psCQMFDecoder->piMSFlags, +#ifdef ENABLE_MS_PRED + (const int32_t *) psCQMFDecoder->piLRPhaseDiffs, + (const int32_t *) psCQMFDecoder->piMSPredCoefs, +#endif + pppfCQMFReal, pppfCQMFImag ); + } + + return 0; +} + +static void ApplyRMSEnvelope( const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iNumGroups, + const int32_t *piGroupLengths, + int32_t **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ) +{ + int32_t n; + int32_t iBlockOffset; + + iBlockOffset = 0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iRMSEnv; + float fGain; + + iRMSEnv = ppiRMSEnvelope[n][b]; + fGain = + c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER + iRMSEnv]; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + ppfReal[iBlockOffset][iFBOffset] *= fGain; + ppfImag[iBlockOffset][iFBOffset] *= fGain; + iFBOffset++; + } + } + iBlockOffset++; + } + } +} + +static void ReplaceSign( const int32_t iNumBlocks, const int32_t iNumCQMFBands, int32_t **ppiSignReal, int32_t **ppiSignImag, float **ppfReal, float **ppfImag ) +{ + int32_t n; + for ( n = 0; n < iNumBlocks; n++ ) + { + int32_t b; + for ( b = 0; b < iNumCQMFBands; b++ ) + { + if ( ppiSignReal[n][b] == 1 ) + { + ppfReal[n][b] = -ppfReal[n][b]; + } + if ( ppiSignImag[n][b] == 1 ) + { + ppfImag[n][b] = -ppfImag[n][b]; + } + } + } +} + +static void InvQuantizeSpectrum( + const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + int32_t **ppiAlloc, + int32_t **ppiQReal, + int32_t **ppiQImag, + float **ppfReal, + float **ppfImag, + NoiseGen *psNoiseGen ) // Pass in NULL to swicth off noise gen +{ + int32_t n; + int32_t iBlockOffest; + + iBlockOffest = 0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iAlloc; + float fInvSCFGain; + + iAlloc = ppiAlloc[n][b]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + + if ( iAlloc > 0 ) + { + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t iQuantValue; + + iQuantValue = ppiQReal[iBlockOffest][iFBOffset]; + ppfReal[iBlockOffest][iFBOffset] = (float) iQuantValue * fInvSCFGain; + + iQuantValue = ppiQImag[iBlockOffest][iFBOffset]; + ppfImag[iBlockOffest][iFBOffset] = (float) iQuantValue * fInvSCFGain; + + iFBOffset++; + } + } + else if ( psNoiseGen != NULL ) + { + for ( m = 0; m < piBandwidths[b]; m++ ) + { + ppfReal[iBlockOffest][iFBOffset] = 0.7f * GetNoise( psNoiseGen ); + ppfImag[iBlockOffest][iFBOffset] = 0.7f * GetNoise( psNoiseGen ); + + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + + iBlockOffest++; + } + } +} + +static void InvMSCoding( const int32_t iNumBlocks, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t iMSMode, const int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + const int32_t *piLRPhaseDiffs, + const int32_t *piMSPredCoefs, +#endif + float ***pppfReal, + float ***pppfImag ) +{ + if ( iMSMode > 0 ) + { + int32_t b; + int32_t iFBOffset; +#ifdef ENABLE_MS_PRED + int32_t bms = 0; +#if defined SIMPLE_PHASE + void( *pFuncPhaseRotateOptions[4] ) = { &rot_zero, &rot_m_pi_2, &rot_pm_pi, + &rot_p_pi_2 }; +#endif +#endif + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + if ( piMSFlags[b] == 1 ) + { + int32_t n; +#if defined ENABLE_MS_PRED && defined SIMPLE_PHASE + void ( *pFuncPhaseRotate )( float *, float * ) = + pFuncPhaseRotateOptions[piLRPhaseDiffs[bms]]; +#endif + for ( n = 0; n < piBandwidths[b]; n++ ) + { + int32_t k; + for ( k = 0; k < iNumBlocks; k++ ) + { + float fLeftReal; + float fLeftImag; + float fRightReal; + float fRightImag; +#ifdef ENABLE_MS_PRED + if ( iMSMode == 3 ) + { + float fPred; + fPred = dequantPred( piMSPredCoefs[bms] ); + pppfReal[1][k][iFBOffset] += fPred * pppfReal[0][k][iFBOffset]; + pppfImag[1][k][iFBOffset] += fPred * pppfImag[0][k][iFBOffset]; + } +#endif + fLeftReal = ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fLeftImag = ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fRightReal = + ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fRightImag = + ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); +#ifdef ENABLE_MS_PRED + if ( iMSMode == 3 ) + { +#ifdef SIMPLE_PHASE + ( *pFuncPhaseRotate )( &fRightReal, &fRightImag ); +#else + int32_t phaseIdx; + phaseIdx = piLRPhaseDiffs[bms] - PHASE_MIN_VAL; + cplxmult( &fRightReal, &fRightImag, c_afRotRealImag[phaseIdx][0], + -c_afRotRealImag[phaseIdx][1] ); +#endif + } +#endif + pppfReal[0][k][iFBOffset] = fLeftReal; + pppfReal[1][k][iFBOffset] = fRightReal; + pppfImag[0][k][iFBOffset] = fLeftImag; + pppfImag[1][k][iFBOffset] = fRightImag; + } + iFBOffset++; + } +#ifdef ENABLE_MS_PRED + bms++; +#endif + } + else + { + iFBOffset += piBandwidths[b]; + } + } + } +} + +/* Currently only the number of bands in frame */ +static int32_t ReadHeaderInformation( int32_t *piNumBands, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead; + + iBitsRead = 0; + *piNumBands = ivas_split_rend_bitstream_read_int32( pBits, 5 ); + iBitsRead += 5; + + return iBitsRead; +} + +static int32_t ReadMSInformation( const int32_t iNumBands, int32_t *piMSMode, int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + int32_t *piLRPhaseDiffs, + int32_t *piMSPredCoefs, +#endif + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead; + + iBitsRead = 0; + *piMSMode = ivas_split_rend_bitstream_read_int32( pBits, 2 ); + iBitsRead += 2; + + if ( *piMSMode == 0 ) + { + int32_t n; + for ( n = 0; n < iNumBands; n++ ) + { + piMSFlags[n] = 0; + } + } + else if ( *piMSMode == 1 ) + { + int32_t n; + for ( n = 0; n < iNumBands; n++ ) + { + piMSFlags[n] = 1; + } + } + else if ( *piMSMode == 2 ) + { + int32_t n; + for ( n = 0; n < iNumBands; n++ ) + { + piMSFlags[n] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + } + } +#ifdef ENABLE_MS_PRED + else if ( *piMSMode == 3 ) + { + int32_t n; + int32_t iMSPredAll; + int32_t iNumMSPredBands = 0; + int32_t anyNonZero; + iMSPredAll = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + if ( iMSPredAll ) + { + iNumMSPredBands = iNumBands; + for ( n = 0; n < iNumBands; n++ ) + { + piMSFlags[n] = 1; + } + } + else + { + for ( n = 0; n < iNumBands; n++ ) + { + piMSFlags[n] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + if ( piMSFlags[n] ) + { + iNumMSPredBands++; + } + } + } + anyNonZero = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + if ( anyNonZero ) + { +#ifdef SIMPLE_PHASE + for ( n = 0; n < iNumMSPredBands; n++ ) + { + piLRPhaseDiffs[n] = BSGetBits( psBSRead, SIMPLE_PHASE_BITS ); + iBitsRead += SIMPLE_PHASE_BITS; + } +#else + piLRPhaseDiffs[0] = ivas_split_rend_bitstream_read_int32( pBits, PHASE_BAND0_BITS ); + piLRPhaseDiffs[0] += PHASE_MIN_VAL; + iBitsRead += PHASE_BAND0_BITS; + for ( n = 1; n < iNumMSPredBands; n++ ) + { + int32_t tabIdx; + iBitsRead += ReadHuff( c_aaiRMSEnvHuffDec, &tabIdx, pBits ); + piLRPhaseDiffs[n] = tabIdx + ENV_DELTA_MIN; + } + DecodePhase( piLRPhaseDiffs, iNumMSPredBands, PHASE_DIFF_DIM ); +#endif + } + else + { + for ( n = 0; n < iNumMSPredBands; n++ ) + { + piLRPhaseDiffs[n] = 0; + } + } + anyNonZero = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + if ( anyNonZero ) + { + piMSPredCoefs[0] = ivas_split_rend_bitstream_read_int32( pBits, PRED_BAND0_BITS ); + piMSPredCoefs[0] += PRED_MIN_VAL; + iBitsRead += PRED_BAND0_BITS; + for ( n = 1; n < iNumMSPredBands; n++ ) + { + int32_t tabIdx; + iBitsRead += ReadHuff( c_aaiRMSEnvHuffDec, &tabIdx, pBits ); + piMSPredCoefs[n] = tabIdx + ENV_DELTA_MIN; + } + DecodePredCoef( piMSPredCoefs, iNumMSPredBands ); + } + else + { + for ( n = 0; n < iNumMSPredBands; n++ ) + { + piMSPredCoefs[n] = 0; + } + } +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "ms_mode_dec.txt", "wt" ); + } + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSPredBands, + iNumBands, fid, piMSFlags ); + } +#endif + } +#endif + else + { + printf( "ERROR UNSUPPORTED MS MODE\n" ); + } + + return iBitsRead; +} + +static int32_t +ReadGroupInformation( const int32_t iChannels, const int32_t iNumBlocks, int32_t *piCommonGrouping, int32_t *piNumGroups, int32_t **ppiGroupLengths, ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead; + + iBitsRead = 0; + if ( iChannels == 2 ) + { + *piCommonGrouping = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( *piCommonGrouping == 1 ) + { + int32_t k; + + piNumGroups[0] = 0; + ppiGroupLengths[0][piNumGroups[0]] = 1; + for ( k = 0; k < ( iNumBlocks - 1 ); k++ ) + { + int32_t iGroupStart; + + iGroupStart = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( iGroupStart == 1 ) + { + piNumGroups[0]++; + ppiGroupLengths[0][piNumGroups[0]] = 1; + } + else + { + ppiGroupLengths[0][piNumGroups[0]]++; + } + } + piNumGroups[0]++; + + piNumGroups[1] = piNumGroups[0]; + for ( k = 0; k < piNumGroups[1]; k++ ) + { + ppiGroupLengths[1][k] = ppiGroupLengths[0][k]; + } + } + else + { + int32_t c; + + for ( c = 0; c < iChannels; c++ ) + { + int32_t k; + + piNumGroups[c] = 0; + ppiGroupLengths[c][piNumGroups[c]] = 1; + for ( k = 0; k < ( iNumBlocks - 1 ); k++ ) + { + int32_t iGroupStart; + + iGroupStart = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( iGroupStart == 1 ) + { + piNumGroups[c]++; + ppiGroupLengths[c][piNumGroups[c]] = 1; + } + else + { + ppiGroupLengths[c][piNumGroups[c]]++; + } + } + piNumGroups[c]++; + } + } + } + else + { + int32_t c; + + for ( c = 0; c < iChannels; c++ ) + { + int32_t k; + + piNumGroups[c] = 0; + ppiGroupLengths[c][piNumGroups[c]] = 1; + for ( k = 0; k < ( iNumBlocks - 1 ); k++ ) + { + int32_t iGroupStart; + + iGroupStart = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( iGroupStart == 1 ) + { + piNumGroups[c]++; + ppiGroupLengths[c][piNumGroups[c]] = 1; + } + else + { + ppiGroupLengths[c][piNumGroups[c]]++; + } + } + piNumGroups[c]++; + } + } + + return iBitsRead; +} + +static int32_t ReadHuff( const uint32_t ( *pauiHuffDecTable )[HUFF_DEC_TABLE_SIZE], + int32_t *piSymbol, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead; + int32_t iSymbol; + int32_t iIndex; + int32_t iVal; + + iVal = 0; + iIndex = 0; + iSymbol = 0xFFFF; + iBitsRead = 0; + while ( iSymbol == 0xFFFF ) + { + iIndex = ivas_split_rend_bitstream_read_int32( pBits, HUFF_READ_SIZE ); + iBitsRead += HUFF_READ_SIZE; + + iIndex = pauiHuffDecTable[iVal][iIndex]; + iSymbol = ( iIndex & 0xFFFF ); + + iVal = ( iIndex >> 16 ); + } + + if ( iVal ) + { + BSForceBack( + pBits, + iIndex, iVal ); + iBitsRead -= iVal; + } + + *piSymbol = iSymbol; + + return iBitsRead; +} + +static int32_t ReadRMSEnvelope( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiRMSEnvelope, + ivas_split_rend_bits_t *pBits ) +{ + int32_t n; + int32_t iBitsRead; + + iBitsRead = 0; + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < piNumGroups[n]; k++ ) + { + int32_t b; + int32_t iLastRMSVal; + + iLastRMSVal = ivas_split_rend_bitstream_read_int32( pBits, ENV0_BITS ); + iBitsRead += ENV0_BITS; + + iLastRMSVal += ENV_MIN; + pppiRMSEnvelope[n][k][0] = iLastRMSVal; + for ( b = 1; b < iNumBands; b++ ) + { + int32_t iDelta; + + iBitsRead += ReadHuff( c_aaiRMSEnvHuffDec, &iDelta, pBits ); + + iDelta += ENV_DELTA_MIN; + iLastRMSVal += iDelta; + pppiRMSEnvelope[n][k][b] = iLastRMSVal; + } + } + } + + return iBitsRead; +} + +#ifdef ENABLE_PMOD_ADJUST +static int32_t ReadPmodInformation( int32_t **ppiHiSMRFlags, Bitstream *psBSRead, int32_t iChannels, int32_t iNumBands ) +{ + int32_t iBitsRead; + int32_t c; + iBitsRead = 0; + for ( c = 0; c < iChannels; c++ ) + { + int32_t b; + int32_t iFlags = BSGetBits( psBSRead, 1 ); + iBitsRead += 1; + if ( iFlags ) + { + for ( b = 0; b < iNumBands; b++ ) + { + ppiHiSMRFlags[c][b] = BSGetBits( psBSRead, 1 ); + ; + iBitsRead += 1; + } + } + else + { + for ( b = 0; b < iNumBands; b++ ) + { + ppiHiSMRFlags[c][b] = 0; + } + } + } +#ifdef WRITE_HISMR_FLAGS + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "hismr_dec.txt", "wt" ); + } + for ( c = 0; c < iChannels; c++ ) + { + int32_t b; + for ( b = 0; b < iNumBands; b++ ) + { + if ( c == iChannels - 1 && b == iNumBands - 1 ) + { + fprintf( fid, "%d\n", ppiHiSMRFlags[c][b] ); + } + else + { + fprintf( fid, "%d ", ppiHiSMRFlags[c][b] ); + } + } + } + } +#endif + return iBitsRead; +} +#endif + +static int32_t ReadAllocInformation( int32_t *piAllocOffset, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead; + + iBitsRead = 0; + *piAllocOffset = ivas_split_rend_bitstream_read_int32( pBits, ALLOC_OFFSET_BITS ); + *piAllocOffset += MIN_ALLOC_OFFSET; + iBitsRead += ALLOC_OFFSET_BITS; + + return iBitsRead; +} + +static int32_t +ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ) +{ + int32_t n; + int32_t iBitsRead; + int32_t iBlockOffest; + + iBitsRead = 0; + iBlockOffest = 0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iAlloc; + int32_t iHuffDim; + int32_t iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + if ( iAlloc > 0 ) + { + const uint32_t( *pauiHuffmanTable )[HUFF_DEC_TABLE_SIZE] = NULL; + const uint32_t( *pauiHuffmanTableDPCM )[HUFF_DEC_TABLE_SIZE] = NULL; +#ifdef USE_DEMOD_TABLES + const int32_t( *paiDemodTable )[2] = NULL; +#endif + + pauiHuffmanTable = c_apauiHuffDecTables[iAlloc]; + pauiHuffmanTableDPCM = + c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; +#ifdef USE_DEMOD_TABLES + paiDemodTable = c_apaiDemodTables[iAlloc]; +#endif + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t iQuantValue1 = 0; + int32_t iQuantValue2 = 0; + + if ( piPredEnable[iFBOffset] == 1 ) + { + if ( iHuffDim == 2 ) + { + int32_t iSymbol; + iBitsRead += ReadHuff( pauiHuffmanTableDPCM, &iSymbol, pBits ); +#ifdef USE_DEMOD_TABLES + iQuantValue1 = paiDemodTable[iSymbol][0]; + iQuantValue2 = paiDemodTable[iSymbol][1]; +#else + iQuantValue1 = iSymbol / iHuffMod; + iQuantValue2 = iSymbol % iHuffMod; +#endif + } + else + { + iBitsRead += + ReadHuff( pauiHuffmanTableDPCM, &iQuantValue1, + pBits ); + iBitsRead += + ReadHuff( pauiHuffmanTableDPCM, &iQuantValue2, + pBits ); + } + } + else + { + if ( iHuffDim == 2 ) + { + int32_t iSymbol; + + iBitsRead += ReadHuff( pauiHuffmanTable, &iSymbol, + pBits ); +#ifdef USE_DEMOD_TABLES + iQuantValue1 = paiDemodTable[iSymbol][0]; + iQuantValue2 = paiDemodTable[iSymbol][1]; +#else + iQuantValue1 = iSymbol / iHuffMod; + iQuantValue2 = iSymbol % iHuffMod; +#endif + } + else + { + iBitsRead += + ReadHuff( pauiHuffmanTable, &iQuantValue1, + pBits ); + iBitsRead += + ReadHuff( pauiHuffmanTable, &iQuantValue2, + pBits ); + } + } + + ppiQReal[iBlockOffest][iFBOffset] = iQuantValue1; + ppiQImag[iBlockOffest][iFBOffset] = iQuantValue2; + + if ( iQuantValue1 > 0 ) + { + ppiSignReal[iBlockOffest][iFBOffset] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + } + if ( iQuantValue2 > 0 ) + { + ppiSignImag[iBlockOffest][iFBOffset] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + } + + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + + iBlockOffest++; + } + } + + return iBitsRead; +} + +static void ComputeAllocation( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiSMR, + const int32_t iAllocOffset, + int32_t ***pppiAlloc ) +{ + int32_t n; + + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < piNumGroups[n]; k++ ) + { + int32_t b; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t iAlloc; + iAlloc = ( ( pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE ) >> 5 ); + iAlloc = ( iAlloc > MIN_ALLOC ) ? iAlloc : MIN_ALLOC; + iAlloc = ( iAlloc < MAX_ALLOC ) ? iAlloc : MAX_ALLOC; + pppiAlloc[n][k][b] = iAlloc; + } + } + } +} diff --git a/lib_rend/ivas_CQMFDecoder.h b/lib_rend/ivas_CQMFDecoder.h new file mode 100644 index 0000000000..a68c2451fb --- /dev/null +++ b/lib_rend/ivas_CQMFDecoder.h @@ -0,0 +1,64 @@ +/****************************************************************************************************** + + (C) 2022 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_CQMF_DECODER_H_ +#define _IVAS_CQMF_DECODER_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "lib_rend.h" +#define DECODER_ERROR_NONE ( 0 ) +#define DECODER_ERROR_FS_NOT_SUPPORTED ( -1 ) +#define DECODER_ERROR_CHAN_NOT_SUPPORTED ( -2 ) +#define DECODER_ERROR_UNKNOWN ( -100 ) + + typedef struct CQMF_DECODER CQMFDecoder; + + CQMFDecoder *CreateCQMFDecoder( const int32_t iSampleRate, + const int32_t iChannels ); + + void DeleteCQMFDecoder( CQMFDecoder *psCQMFDecoder ); + + int32_t CQMFDecoderGetError( CQMFDecoder *psCQMFDecoder ); + + int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, + ivas_split_rend_bits_t *pBits, + float ***pppfCQMFReal, + float ***pppfCQMFImag ); + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_DECODER_H_ */ diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c new file mode 100644 index 0000000000..3f2906e7d5 --- /dev/null +++ b/lib_rend/ivas_CQMFEncoder.c @@ -0,0 +1,2050 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_CQMFEncoder.h" + +#include +#include +#include +#include +#include "ivas_Tables.h" +#include "options.h" +#include "prot.h" +#include "wmops.h" +#include "ivas_RMSEnvGrouping.h" +#include "ivas_PerceptualModel.h" +#include "ivas_RMSEnvDeltaHuff.h" +#include "ivas_CQMFHuff.h" +#include "ivas_cldfb_codec_bitstream.h" +#include "ivas_lib_rend_internal.h" +#ifdef ENABLE_MS_PRED +#include "ivas_MSPred.h" +#endif +#ifdef ENABLE_PMOD_ADJUST +#include "ton_corr.h" +#endif + +#include "ivas_PredEncoder.h" + +struct CQMF_ENCODER +{ + int32_t iSampleRate; + int32_t iChannels; + int32_t iNumBlocks; + + int32_t iTargetBitRate; + int32_t iTargetBitsPerFrame; + + int32_t iNumBands; + const int32_t *piBandwidths; + + int32_t iMSMode; + int32_t *piMSFlags; +#ifdef ENABLE_MS_PRED + int32_t piMSPredCoefs[MAX_BANDS]; + int32_t piLRPhaseDiffs[MAX_BANDS]; + int32_t iAllowSidePred; +#endif +#ifdef ENABLE_PMOD_ADJUST + int32_t **ppiHiSMRFlags; +#endif + + RMSEnvelopeGrouping *psRMSEnvelopeGrouping; + + int32_t iCommonGrouping; + int32_t *piNumGroups; + int32_t **ppiGroupLengths; + + int32_t ***pppiRMSEnvelope; + int32_t ***pppiSMR; + int32_t ***pppiExcitation; + int32_t ***pppiAlloc; + + int32_t iAllocOffset; + + int32_t ***pppiCQMFSignReal; + int32_t ***pppiCQMFSignImag; + int32_t ***pppiQCQMFReal; + int32_t ***pppiQCQMFImag; + + + PredictionEncoder *psPredictionEncoder; + int32_t iLastError; +}; + +CQMFEncoder *CreateCQMFEncoder( const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iTargetBitRate, + const int32_t iAllowSidePred ) +{ + int32_t n; + CQMFEncoder *psCQMFEncoder = NULL; + + assert( iSampleRate == 48000 ); // Fix + + psCQMFEncoder = (CQMFEncoder *) count_malloc( sizeof( CQMFEncoder ) ); + psCQMFEncoder->iSampleRate = iSampleRate; + psCQMFEncoder->iChannels = iChannels; + psCQMFEncoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; + psCQMFEncoder->iAllocOffset = 0; + + psCQMFEncoder->iTargetBitRate = iTargetBitRate; + psCQMFEncoder->iTargetBitsPerFrame = iTargetBitRate * CQMF_BLOCKS_PER_FRAME * CQMF_BANDS / iSampleRate; + + psCQMFEncoder->iNumBands = MAX_BANDS_48; // Fix + psCQMFEncoder->piBandwidths = c_aiBandwidths48; // Fix + + psCQMFEncoder->iMSMode = 0; + psCQMFEncoder->piMSFlags = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); +#ifdef ENABLE_MS_PRED + for ( n = 0; n < MAX_BANDS; n++ ) + { + psCQMFEncoder->piLRPhaseDiffs[n] = 0; + psCQMFEncoder->piMSPredCoefs[n] = 0; + } + psCQMFEncoder->iAllowSidePred = iAllowSidePred; +#endif + psCQMFEncoder->psRMSEnvelopeGrouping = CreateRMSEnvelopeGrouping( psCQMFEncoder->iNumBlocks ); + + psCQMFEncoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo + psCQMFEncoder->piNumGroups = (int32_t *) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ) ); + psCQMFEncoder->ppiGroupLengths = (int32_t **) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t * ) ); + psCQMFEncoder->pppiRMSEnvelope = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiSMR = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiExcitation = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiAlloc = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + + psCQMFEncoder->pppiCQMFSignReal = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiCQMFSignImag = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiQCQMFReal = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); + psCQMFEncoder->pppiQCQMFImag = (int32_t ***) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t ** ) ); +#ifdef ENABLE_PMOD_ADJUST + psCQMFEncoder->ppiHiSMRFlags = (int32_t **) count_malloc( psCQMFEncoder->iChannels * sizeof( int32_t * ) ); +#endif + + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; +#ifdef ENABLE_PMOD_ADJUST + psCQMFEncoder->ppiHiSMRFlags[n] = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + ; +#endif + psCQMFEncoder->ppiGroupLengths[n] = (int32_t *) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t ) ); + psCQMFEncoder->pppiRMSEnvelope[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiSMR[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiExcitation[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiAlloc[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + + psCQMFEncoder->pppiCQMFSignReal[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiCQMFSignImag[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiQCQMFReal[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + psCQMFEncoder->pppiQCQMFImag[n] = (int32_t **) count_malloc( CQMF_BLOCKS_PER_FRAME * sizeof( int32_t * ) ); + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + psCQMFEncoder->pppiRMSEnvelope[n][k] = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiSMR[n][k] = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiExcitation[n][k] = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiAlloc[n][k] = (int32_t *) count_malloc( MAX_BANDS * sizeof( int32_t ) ); + + psCQMFEncoder->pppiCQMFSignReal[n][k] = (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiCQMFSignImag[n][k] = (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiQCQMFReal[n][k] = (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + psCQMFEncoder->pppiQCQMFImag[n][k] = (int32_t *) count_malloc( CQMF_BANDS * sizeof( int32_t ) ); + } + } + + psCQMFEncoder->psPredictionEncoder = CreatePredictionEncoder( iChannels, psCQMFEncoder->iNumBlocks ); + psCQMFEncoder->iLastError = ENCODER_ERROR_NONE; + + return psCQMFEncoder; +} + +void DeleteCQMFEncoder( CQMFEncoder *psCQMFEncoder ) +{ + if ( psCQMFEncoder != NULL ) + { + + if ( psCQMFEncoder->piMSFlags != NULL ) + { + count_free( psCQMFEncoder->piMSFlags ); + } + + if ( psCQMFEncoder->piNumGroups != NULL ) + { + count_free( psCQMFEncoder->piNumGroups ); + } + + if ( psCQMFEncoder->psRMSEnvelopeGrouping != NULL ) + { + DeleteRMSEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping ); + } + + if ( psCQMFEncoder->ppiGroupLengths != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + count_free( psCQMFEncoder->ppiGroupLengths[n] ); + } + count_free( psCQMFEncoder->ppiGroupLengths ); + } +#ifdef ENABLE_PMOD_ADJUST + if ( psCQMFEncoder->ppiHiSMRFlags != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + count_free( psCQMFEncoder->ppiHiSMRFlags[n] ); + } + count_free( psCQMFEncoder->ppiHiSMRFlags ); + } +#endif + if ( psCQMFEncoder->pppiRMSEnvelope != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiRMSEnvelope[n][k] ); + } + count_free( psCQMFEncoder->pppiRMSEnvelope[n] ); + } + count_free( psCQMFEncoder->pppiRMSEnvelope ); + } + + if ( psCQMFEncoder->pppiSMR != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiSMR[n][k] ); + } + count_free( psCQMFEncoder->pppiSMR[n] ); + } + count_free( psCQMFEncoder->pppiSMR ); + } + + if ( psCQMFEncoder->pppiExcitation != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiExcitation[n][k] ); + } + count_free( psCQMFEncoder->pppiExcitation[n] ); + } + count_free( psCQMFEncoder->pppiExcitation ); + } + + if ( psCQMFEncoder->pppiAlloc != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiAlloc[n][k] ); + } + count_free( psCQMFEncoder->pppiAlloc[n] ); + } + count_free( psCQMFEncoder->pppiAlloc ); + } + + if ( psCQMFEncoder->pppiCQMFSignReal != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiCQMFSignReal[n][k] ); + } + count_free( psCQMFEncoder->pppiCQMFSignReal[n] ); + } + count_free( psCQMFEncoder->pppiCQMFSignReal ); + } + + if ( psCQMFEncoder->pppiCQMFSignImag != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiCQMFSignImag[n][k] ); + } + count_free( psCQMFEncoder->pppiCQMFSignImag[n] ); + } + count_free( psCQMFEncoder->pppiCQMFSignImag ); + } + + if ( psCQMFEncoder->pppiQCQMFReal != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiQCQMFReal[n][k] ); + } + count_free( psCQMFEncoder->pppiQCQMFReal[n] ); + } + count_free( psCQMFEncoder->pppiQCQMFReal ); + } + + if ( psCQMFEncoder->pppiQCQMFImag != NULL ) + { + int32_t n; + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < CQMF_BLOCKS_PER_FRAME; k++ ) + { + count_free( psCQMFEncoder->pppiQCQMFImag[n][k] ); + } + count_free( psCQMFEncoder->pppiQCQMFImag[n] ); + } + count_free( psCQMFEncoder->pppiQCQMFImag ); + } + + + DeletePredictionEncoder( psCQMFEncoder->psPredictionEncoder ); + count_free( psCQMFEncoder ); + } +} + +int32_t CQMFEncoderGetError( CQMFEncoder *psCQMFEncoder ) +{ + return psCQMFEncoder->iLastError; +} + +static int32_t MSModeCalculation( const int32_t iNumBlocks, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int32_t *piMSMode, +#ifdef ENABLE_MS_PRED + int32_t *piLRPhaseDiff, + int32_t *piMSPredCoef, + const int32_t iAllowSidePred, +#endif + int32_t *piMSFlags ); + +static void RemoveRMSEnvelope( const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iNumGroups, + const int32_t *piGroupLengths, + int32_t **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ); + + +static int32_t CountCQMFBits( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t *piPredEnable, + int32_t **ppiAlloc, + int32_t **ppiQReal, + int32_t **ppiQImag ); + +/* Currently only the number of bands in frame */ +static int32_t WriteHeaderInformation( const int32_t iNumBands, + ivas_split_rend_bits_t *pBits ); + +static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, + Bitstream *psBSWrite, + int32_t iChannels, + int32_t iNumBands ); + +static int32_t WriteMSInformation( const int32_t iNumBands, + const int32_t iMSMode, + const int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + const int32_t *piLRPhaseDiffs, + const int32_t *piMSPredCoefs, + int32_t iNumMSPredBands, +#endif + ivas_split_rend_bits_t *pBits ); + +static int32_t WriteGroupInformation( const int32_t iChannels, + const int32_t iCommonGrouping, + const int32_t *piNumGroups, + int32_t **ppiGroupLengths, + ivas_split_rend_bits_t *pBits ); + +static int32_t WriteRMSEnvelope( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiRMSEnvelope, + ivas_split_rend_bits_t *pBits ); + +static int32_t WriteAllocInformation( const int32_t iAllocOffset, + ivas_split_rend_bits_t *pBits ); + +static int32_t WriteCQMFData( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t *piPredEnable, + int32_t **ppiAlloc, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + int32_t **ppiQReal, + int32_t **ppiQImag, + ivas_split_rend_bits_t *pBits ); + +static int32_t ComputeAllocation( const int32_t iChannels, + const int32_t *piNumGroups, + int32_t **ppiGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int32_t ***pppiSMR, + const int32_t iAvailableBits, + int32_t *piAllocOffset, + int32_t ***pppiAlloc, + int32_t ***pppiQReal, + int32_t ***pppiQImag, + int32_t ***pppiSignReal, + int32_t ***pppiSignImag, + int32_t **ppiPredEnable, + float **ppfA1Real, + float **ppfA1Imag ); + +int32_t EncodeFrame( CQMFEncoder *psCQMFEncoder, float ***pppfCQMFReal, float ***pppfCQMFImag, int32_t *piBitsWritten, const int32_t available_bits, ivas_split_rend_bits_t *pBits ) +{ + int32_t n; + int32_t iAvailableBits, iBitsWritten; + // int32_t iCQMFBits; + int32_t iNumMSBands = 0; + iAvailableBits = available_bits; // HCBR for now + iBitsWritten = 0; + + /* Do MS calc here */ + if ( psCQMFEncoder->iChannels == 2 ) + { + iNumMSBands = MSModeCalculation( psCQMFEncoder->iNumBlocks, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + pppfCQMFReal, + pppfCQMFImag, + &psCQMFEncoder->iMSMode, +#ifdef ENABLE_MS_PRED + psCQMFEncoder->piLRPhaseDiffs, + psCQMFEncoder->piMSPredCoefs, + psCQMFEncoder->iAllowSidePred, +#endif + psCQMFEncoder->piMSFlags ); + + if ( psCQMFEncoder->iMSMode > 0 ) + { + psCQMFEncoder->iCommonGrouping = 1; // Make sure common grouping is enabled when MS is in use + } + } + +#ifdef ENABLE_PMOD_ADJUST + CalcTonQuotas( psCQMFEncoder->iChannels, psCQMFEncoder->iNumBands, psCQMFEncoder->piBandwidths, pppfCQMFReal, pppfCQMFImag, psCQMFEncoder->ppiHiSMRFlags ); +#endif + + /* Compute Grouping and RMS Envelopes */ + if ( psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1 ) + { + ComputeEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + pppfCQMFReal, + pppfCQMFImag, +#ifndef USE_BIT_COUNT_MERGE_COST + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading +#endif + &psCQMFEncoder->piNumGroups[0], + psCQMFEncoder->ppiGroupLengths[0], + psCQMFEncoder->pppiRMSEnvelope ); + + psCQMFEncoder->piNumGroups[1] = psCQMFEncoder->piNumGroups[0]; + for ( n = 0; n < psCQMFEncoder->piNumGroups[0]; n++ ) + { + psCQMFEncoder->ppiGroupLengths[1][n] = psCQMFEncoder->ppiGroupLengths[0][n]; + } + } + else + { + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + ComputeEnvelopeGrouping( psCQMFEncoder->psRMSEnvelopeGrouping, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + &pppfCQMFReal[n], + &pppfCQMFImag[n], +#ifndef USE_BIT_COUNT_MERGE_COST + 8.0, + 20.0, // Use these to trade off RMS Env bits and quantizer loading +#endif + &psCQMFEncoder->piNumGroups[n], + psCQMFEncoder->ppiGroupLengths[n], + &psCQMFEncoder->pppiRMSEnvelope[n] ); + } + } + + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + RemoveRMSEnvelope( psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + psCQMFEncoder->piNumGroups[n], + (const int32_t *) psCQMFEncoder->ppiGroupLengths[n], + psCQMFEncoder->pppiRMSEnvelope[n], + pppfCQMFReal[n], + pppfCQMFImag[n] ); + } + + ComputePredictors( psCQMFEncoder->psPredictionEncoder, + pppfCQMFReal, + pppfCQMFImag ); + + iBitsWritten += WriteHeaderInformation( psCQMFEncoder->iNumBands, + pBits ); + + if ( psCQMFEncoder->iChannels == 2 ) + { + iBitsWritten += WriteMSInformation( psCQMFEncoder->iNumBands, + psCQMFEncoder->iMSMode, + (const int32_t *) psCQMFEncoder->piMSFlags, +#ifdef ENABLE_MS_PRED + (const int32_t *) psCQMFEncoder->piLRPhaseDiffs, + (const int32_t *) psCQMFEncoder->piMSPredCoefs, + iNumMSBands, +#endif + pBits ); + } + + + iBitsWritten += WritePredictors( psCQMFEncoder->psPredictionEncoder, + pBits ); + + iBitsWritten += WriteGroupInformation( psCQMFEncoder->iChannels, + psCQMFEncoder->iCommonGrouping, + (const int32_t *) psCQMFEncoder->piNumGroups, + psCQMFEncoder->ppiGroupLengths, + pBits ); + + iBitsWritten += WriteRMSEnvelope( psCQMFEncoder->iChannels, + (const int32_t *) psCQMFEncoder->piNumGroups, + psCQMFEncoder->iNumBands, + psCQMFEncoder->pppiRMSEnvelope, + pBits ); + +#ifdef ENABLE_PMOD_ADJUST + iBitsWritten += WritePmodInformation( psCQMFEncoder->ppiHiSMRFlags, + psCQMFEncoder->psBSWrite, + psCQMFEncoder->iChannels, + psCQMFEncoder->iNumBands ); +#endif + + if ( psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1 ) + { + int32_t k; + for ( k = 0; k < psCQMFEncoder->piNumGroups[0]; k++ ) + { + PerceptualModelStereo( psCQMFEncoder->iNumBands, + psCQMFEncoder->piMSFlags, + psCQMFEncoder->pppiRMSEnvelope[0][k], + psCQMFEncoder->pppiRMSEnvelope[1][k], + psCQMFEncoder->pppiExcitation[0][k], + psCQMFEncoder->pppiExcitation[1][k], + psCQMFEncoder->pppiSMR[0][k], + psCQMFEncoder->pppiSMR[1][k] ); + } + } + else + { + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < psCQMFEncoder->piNumGroups[n]; k++ ) + { + PerceptualModel( psCQMFEncoder->iNumBands, + psCQMFEncoder->pppiRMSEnvelope[n][k], + psCQMFEncoder->pppiExcitation[n][k], + psCQMFEncoder->pppiSMR[n][k] ); + } + } + } + + iAvailableBits -= iBitsWritten; + ComputeAllocation( psCQMFEncoder->iChannels, + (const int32_t *) psCQMFEncoder->piNumGroups, + psCQMFEncoder->ppiGroupLengths, + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + pppfCQMFReal, + pppfCQMFImag, + psCQMFEncoder->pppiSMR, + iAvailableBits, + &psCQMFEncoder->iAllocOffset, + psCQMFEncoder->pppiAlloc, + psCQMFEncoder->pppiQCQMFReal, + psCQMFEncoder->pppiQCQMFImag, + psCQMFEncoder->pppiCQMFSignReal, + psCQMFEncoder->pppiCQMFSignImag, + psCQMFEncoder->psPredictionEncoder->ppiPredBandEnable, + psCQMFEncoder->psPredictionEncoder->ppfA1Real, + psCQMFEncoder->psPredictionEncoder->ppfA1Imag ); + + iBitsWritten += WriteAllocInformation( psCQMFEncoder->iAllocOffset, + pBits ); + + for ( n = 0; n < psCQMFEncoder->iChannels; n++ ) + { + iBitsWritten += WriteCQMFData( psCQMFEncoder->piNumGroups[n], + (const int32_t *) psCQMFEncoder->ppiGroupLengths[n], + psCQMFEncoder->iNumBands, + psCQMFEncoder->piBandwidths, + (const int32_t *) psCQMFEncoder->psPredictionEncoder->ppiPredBandEnable[n], + psCQMFEncoder->pppiAlloc[n], + psCQMFEncoder->pppiCQMFSignReal[n], + psCQMFEncoder->pppiCQMFSignImag[n], + psCQMFEncoder->pppiQCQMFReal[n], + psCQMFEncoder->pppiQCQMFImag[n], + pBits ); + } + *piBitsWritten = iBitsWritten; + return 0; +} + +int32_t GetNumGroups( CQMFEncoder *psCQMFEncoder ) +{ + return psCQMFEncoder->piNumGroups[0]; +} + +static int32_t MSModeCalculation( const int32_t iNumBlocks, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int32_t *piMSMode, +#ifdef ENABLE_MS_PRED + int32_t *piLRPhaseDiffs, + int32_t *piMSPredCoefs, + const int32_t iAllowSidePred, +#endif + int32_t *piMSFlags ) +{ + int32_t b; + int32_t iFBOffset; + int32_t iNumMSBands; +#ifdef ENABLE_MS_PRED + int32_t piMSPredFlags[MAX_BANDS] = { 0 }; + int32_t iNumMSPredBands = 0; + float msBitsReduction = 0.0f; + float msPredBitsReduction = 0.0f; + int32_t msBits; + int32_t msPredBits; + float fPred; +#if defined ENABLE_MS_PRED && defined SIMPLE_PHASE + void( *pFuncPhaseRotateOptions[4] ) = { &rot_zero, &rot_p_pi_2, &rot_pm_pi, &rot_m_pi_2 }; +#endif + const float one_by_log10_2 = 3.32192809488736f; +#endif + *piMSMode = 0; + iFBOffset = 0; + iNumMSBands = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t n; + float fLeftEnergy; + float fRightEnergy; + float fMidEnergy; + float fSideEnergy; + float fLRRatio; + float fMSRatio; +#ifdef ENABLE_MS_PRED + float fMSPredRatio; + float fMidEnergyPred; + float fSideEnergyPred; + float fLRCovReal = 0.0f; + float fLRCovImag = 0.0f; + int32_t iPhase; + int32_t iPred; + int32_t tabIdx = 0; +#endif + + fLeftEnergy = 0.0f; + fRightEnergy = 0.0f; + fMidEnergy = 0.0; + fSideEnergy = 0.0; + + for ( n = 0; n < piBandwidths[b]; n++ ) + { + int32_t k; + for ( k = 0; k < iNumBlocks; k++ ) + { + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; + + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); + + fLeftEnergy += ( pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset] ); + fRightEnergy += ( pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); + fMidEnergy += ( fMidReal * fMidReal + fMidImag * fMidImag ); + fSideEnergy += ( fSideReal * fSideReal + fSideImag * fSideImag ); + +#ifdef ENABLE_MS_PRED + fLRCovReal += ( pppfReal[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[1][k][iFBOffset] ); + fLRCovImag += ( pppfImag[0][k][iFBOffset] * pppfReal[1][k][iFBOffset] - pppfImag[1][k][iFBOffset] * pppfReal[0][k][iFBOffset] ); +#endif + } + + iFBOffset++; + } +#ifdef ENABLE_MS_PRED + /* compute L/R phase difference if high coherence */ + if ( fLRCovReal * fLRCovReal + fLRCovImag * fLRCovImag > 0.5f * fLeftEnergy * fRightEnergy ) + { + float fPhase = (float) atan2( fLRCovImag, fLRCovReal ); + iPhase = quantPhase( fPhase ); + } + else + { + iPhase = 0; + } + piLRPhaseDiffs[b] = iPhase; + + /* adjust covariance based on phase rotation */ +#ifdef SIMPLE_PHASE + cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImagSimple[iPhase][0], -c_afRotRealImagSimple[iPhase][1] ); +#else + tabIdx = iPhase - PHASE_MIN_VAL; + cplxmult( &fLRCovReal, &fLRCovImag, c_afRotRealImag[tabIdx][0], -c_afRotRealImag[tabIdx][1] ); +#endif + /* compute MS prediction coefficient based on LR covariance*/ + fMidEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy + 2.0f * fLRCovReal ); + fSideEnergyPred = 0.25f * ( fLeftEnergy + fRightEnergy - 2.0f * fLRCovReal ); + + /* M/S prediction */ + fPred = fMidEnergyPred == 0.0f ? 0.0f : 0.25f * ( fLeftEnergy - fRightEnergy ) / fMidEnergyPred; + iPred = quantPred( fPred ); + fPred = dequantPred( iPred ); + piMSPredCoefs[b] = iPred; + + /* evaluation */ + fSideEnergyPred += ( fPred * fPred * fMidEnergyPred - 2.0f * fPred * 0.25f * ( fLeftEnergy - fRightEnergy ) ); + /* -= fPred * fPred * fMidEnergyPred doesn't work because fPred is quantized and does not match MS/MM exactly */ + fMSPredRatio = (float) log10f( ( fMidEnergyPred + 1e-12f ) / ( fSideEnergyPred + 1e-12f ) ); +#endif + fLeftEnergy = log10f( fLeftEnergy + 1e-12f ); + fRightEnergy = log10f( fRightEnergy + 1e-12f ); + fMidEnergy = log10f( fMidEnergy + 1e-12f ); + fSideEnergy = log10f( fSideEnergy + 1e-12f ); + + if ( fLeftEnergy > fRightEnergy ) + { + fLRRatio = fLeftEnergy - fRightEnergy; + } + else + { + fLRRatio = fRightEnergy - fLeftEnergy; + } + + if ( fMidEnergy > fSideEnergy ) + { + fMSRatio = fMidEnergy - fSideEnergy; + } + else + { + fMSRatio = fSideEnergy - fMidEnergy; + } + + if ( fMSRatio > fLRRatio ) + { + iNumMSBands++; + piMSFlags[b] = 1; + } + else + { + piMSFlags[b] = 0; + } +#ifdef ENABLE_MS_PRED + if ( fMSRatio > fLRRatio ) + { + float maskThresShift_dB_by_10 = ( fMSRatio - fLRRatio ) * (float) c_aiDefaultTheta48[b] / 16.0f; + msBitsReduction += (float) ( piBandwidths[b] * iNumBlocks * 2 ) * one_by_log10_2 * maskThresShift_dB_by_10; /* * 2 for real/imag */ + } + if ( fMSPredRatio > fLRRatio ) + { + float maskThresShift_dB_by_10 = ( fMSPredRatio - fLRRatio ) * (float) c_aiDefaultTheta48[b] / 16.0f; + msPredBitsReduction += (float) ( piBandwidths[b] * iNumBlocks * 2 ) * one_by_log10_2 * maskThresShift_dB_by_10; + iNumMSPredBands++; + piMSPredFlags[b] = 1; + } + else + { + piMSPredFlags[b] = 0; + } +#endif + } + +#ifdef ENABLE_MS_PRED + msPredBits = CountMSBits( iNumBands, 3, piMSPredFlags, piLRPhaseDiffs, piMSPredCoefs ); + msPredBitsReduction = max( msPredBitsReduction - (float) msPredBits, 0.0f ); + msBits = CountMSBits( iNumBands, 2, piMSFlags, NULL, NULL ); + msBitsReduction = max( msBitsReduction - (float) msBits, 0.0f ); +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "bit_red.txt", "wt" ); + } + fprintf( fid, "%.1f %.1f %d %d\n", msBitsReduction, msPredBitsReduction, msBits, msPredBits ); + } +#endif + if ( iAllowSidePred && msPredBitsReduction > 1.1f * msBitsReduction ) + { + *piMSMode = 3; + for ( b = 0; b < iNumBands; b++ ) + { + piMSFlags[b] = piMSPredFlags[b]; + } + iNumMSBands = iNumMSPredBands; + } + else +#endif + if ( iNumMSBands == iNumBands ) + { + *piMSMode = 1; + } + else if ( iNumMSBands > 0 ) + { + *piMSMode = 2; + } + else + { + *piMSMode = 0; + } + + if ( *piMSMode > 0 ) + { + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { +#if defined ENABLE_MS_PRED && defined SIMPLE_PHASE + void ( *pFuncPhaseRotate )( float *, float * ) = pFuncPhaseRotateOptions[piLRPhaseDiffs[b]]; +#endif + if ( piMSFlags[b] == 1 ) + { + int32_t n; + for ( n = 0; n < piBandwidths[b]; n++ ) + { + int32_t k; + for ( k = 0; k < iNumBlocks; k++ ) + { + float fMidReal; + float fMidImag; + float fSideReal; + float fSideImag; +#ifdef ENABLE_MS_PRED + if ( *piMSMode == 3 ) + { +#ifdef SIMPLE_PHASE + ( *pFuncPhaseRotate )( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset] ); +#else + int32_t phaseIdx; + + phaseIdx = piLRPhaseDiffs[b] - PHASE_MIN_VAL; + cplxmult( &pppfReal[1][k][iFBOffset], &pppfImag[1][k][iFBOffset], c_afRotRealImag[phaseIdx][0], c_afRotRealImag[phaseIdx][1] ); +#endif + } +#endif + fMidReal = 0.5f * ( pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset] ); + fMidImag = 0.5f * ( pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset] ); + fSideReal = 0.5f * ( pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset] ); + fSideImag = 0.5f * ( pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset] ); +#ifdef ENABLE_MS_PRED + if ( *piMSMode == 3 ) + { + fPred = dequantPred( piMSPredCoefs[b] ); + fSideReal -= fPred * fMidReal; + fSideImag -= fPred * fMidImag; + } +#endif + pppfReal[0][k][iFBOffset] = fMidReal; + pppfReal[1][k][iFBOffset] = fSideReal; + pppfImag[0][k][iFBOffset] = fMidImag; + pppfImag[1][k][iFBOffset] = fSideImag; + } + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + } +#ifdef ENABLE_MS_PRED +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "ms_mode_enc_raw.txt", "wt" ); + } + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumBands, iNumBands, fid, piMSFlags ); + } +#endif + if ( *piMSMode == 3 ) + { + /* Differential Coding of Phase Data*/ + PrepEncode( piLRPhaseDiffs, piMSFlags, iNumBands ); + PrepEncode( piMSPredCoefs, piMSFlags, iNumBands ); +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "ms_mode_enc.txt", "wt" ); + } + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); + } +#endif + /* Differential Coding*/ +#ifndef SIMPLE_PHASE + EncodePhase( piLRPhaseDiffs, iNumMSBands, PHASE_DIFF_DIM ); +#endif + EncodePredCoef( piMSPredCoefs, iNumMSBands ); +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "ms_mode_enc_diff.txt", "wt" ); + } + writeMSPred( piLRPhaseDiffs, piMSPredCoefs, *piMSMode, iNumMSBands, iNumBands, fid, piMSFlags ); + } +#endif + } +#endif + + return iNumMSBands; +} + +static void RemoveRMSEnvelope( const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iNumGroups, + const int32_t *piGroupLengths, + int32_t **ppiRMSEnvelope, + float **ppfReal, + float **ppfImag ) +{ + int32_t n; + int32_t iBlockOffset; + + iBlockOffset = 0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iRMSEnv; + float fGain; + + iRMSEnv = ppiRMSEnvelope[n][b]; + fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER - iRMSEnv]; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + ppfReal[iBlockOffset][iFBOffset] *= fGain; + ppfImag[iBlockOffset][iFBOffset] *= fGain; + iFBOffset++; + } + } + iBlockOffset++; + } + } +} + +static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + int32_t **ppiAlloc, + float **ppfReal, + float **ppfImag, + int32_t **ppiQReal, + int32_t **ppiQImag, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + int32_t *piPredEnable, + float *pfA1Real, + float *pfA1Imag ) // Pass in 2 previous value buffers NULLABLE +{ + + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t n; + int32_t iBlockOffset; + float fPrevReal; + float fPrevImag; + + iBlockOffset = 0; + fPrevReal = 0.0; + fPrevImag = 0.0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + int32_t iAlloc; + int32_t iMaxQuantVal; + float fSCFGain; + float fInvSCFGain; + + + iAlloc = ppiAlloc[n][b]; + iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; + fSCFGain = c_afScaleFactor[iAlloc]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + + if ( piPredEnable[iFBOffset] == 1 ) + { + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t iQuantValue; + float fPredReal = 0.0; + float fPredImag = 0.0; + float fVal; + + fPredReal = pfA1Real[iFBOffset] * fPrevReal - pfA1Imag[iFBOffset] * fPrevImag; + fPredImag = pfA1Real[iFBOffset] * fPrevImag + pfA1Imag[iFBOffset] * fPrevReal; + + fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 1; + } + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; + + ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; + + fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 1; + } + + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; + ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; + + + if ( ppiSignReal[iBlockOffset][iFBOffset] == 0 ) + { + fPrevReal = fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; + } + else + { + fPrevReal = -fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; + } + if ( ppiSignImag[iBlockOffset][iFBOffset] == 0 ) + { + fPrevImag = fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; + } + else + { + fPrevImag = -fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; + } + + iBlockOffset++; + } + } + else + { + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t iQuantValue; + float fVal; + + fVal = ppfReal[iBlockOffset][iFBOffset]; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 1; + } + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; + + ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; + + fVal = ppfImag[iBlockOffset][iFBOffset]; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 1; + } + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; + ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; + iBlockOffset++; + } + } + } + + iFBOffset++; + } + } +} + +static void QuantizeSpectrumDPCM( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + int32_t **ppiAlloc, + float **ppfReal, + float **ppfImag, + int32_t **ppiQReal, + int32_t **ppiQImag, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + int32_t *piPredEnable, + float *pfA1Real, + float *pfA1Imag ) // Pass in 2 previous value buffers NULLABLE +{ + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t n; + int32_t iBlockOffset; + float fPrevReal; + float fPrevImag; + + iBlockOffset = 0; + fPrevReal = 0.0; + fPrevImag = 0.0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + int32_t iAlloc; + int32_t iMaxQuantVal; + float fSCFGain; + float fInvSCFGain; + + + iAlloc = ppiAlloc[n][b]; + iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; + fSCFGain = c_afScaleFactor[iAlloc]; + fInvSCFGain = c_afInvScaleFactor[iAlloc]; + + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t iQuantValue; + float fPredReal = 0.0; + float fPredImag = 0.0; + float fVal; + + if ( piPredEnable[iFBOffset] == 1 ) + { + fPredReal = pfA1Real[iFBOffset] * fPrevReal - pfA1Imag[iFBOffset] * fPrevImag; + fPredImag = pfA1Real[iFBOffset] * fPrevImag + pfA1Imag[iFBOffset] * fPrevReal; + } + else + { // don't need + fPredReal = 0.0; + fPredImag = 0.0; + } + + fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignReal[iBlockOffset][iFBOffset] = 1; + } +#ifdef _DEBUG_VERBOSE + if ( iQuantValue > iMaxQuantVal ) + { + printf( "Value out of range %d\t%d\t%d\t%d\n", b, iAlloc, iQuantValue, iMaxQuantVal ); + iQuantValue = iMaxQuantVal; + } +#else + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; +#endif + + ppiQReal[iBlockOffset][iFBOffset] = iQuantValue; + + fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; + if ( fVal > 0.0 ) + { + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 0; + } + else + { + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + ppiSignImag[iBlockOffset][iFBOffset] = 1; + } + +#ifdef _DEBUG_VERBOSE + if ( iQuantValue > iMaxQuantVal ) + { + printf( "Value out of range %d\t%d\t%d\t%d\n", b, iAlloc, iQuantValue, iMaxQuantVal ); + iQuantValue = iMaxQuantVal; + } +#else + iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; +#endif + ppiQImag[iBlockOffset][iFBOffset] = iQuantValue; + + if ( piPredEnable[iFBOffset] == 1 ) + { + if ( ppiSignReal[iBlockOffset][iFBOffset] == 0 ) + { + fPrevReal = fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; + } + else + { + fPrevReal = -fInvSCFGain * (float) ppiQReal[iBlockOffset][iFBOffset] - fPredReal; + } + if ( ppiSignImag[iBlockOffset][iFBOffset] == 0 ) + { + fPrevImag = fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; + } + else + { + fPrevImag = -fInvSCFGain * (float) ppiQImag[iBlockOffset][iFBOffset] - fPredImag; + } + } + else + { // don't need + fPrevReal = 0.0; + fPrevImag = 0.0; + } + + iBlockOffset++; + } + } + + iFBOffset++; + } + } +} + +static int32_t CountCQMFBits( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t *piPredEnable, + int32_t **ppiAlloc, + int32_t **ppiQReal, + int32_t **ppiQImag ) +{ + int32_t n; + int32_t iBits; + int32_t iBlockOffest; + + iBits = 0; + iBlockOffest = 0; + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iAlloc; + int32_t iHuffDim; + int32_t iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + + if ( iAlloc > 0 ) + { + const uint32_t( *pauiHuffmanTable )[2] = NULL; + const uint32_t( *pauiHuffmanTableDPCM )[2] = NULL; + + // pauiHuffmanTable = GetHuffEncTable(iAlloc); + pauiHuffmanTable = c_apauiHuffEncTabels[iAlloc]; + pauiHuffmanTableDPCM = c_apauiHuffEncTabels[ALLOC_TABLE_SIZE + iAlloc]; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t iQuantValue1; + int32_t iQuantValue2; + + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; + iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; + + iBits += ( iQuantValue1 > 0 ) ? 1 : 0; // Sign bit for vals > 0 + iBits += ( iQuantValue2 > 0 ) ? 1 : 0; // Sign bit for vals > 0 + + if ( piPredEnable[iFBOffset] == 1 ) + { + if ( iHuffDim == 2 ) + { + iQuantValue1 *= iHuffMod; + iQuantValue1 += iQuantValue2; + iBits += pauiHuffmanTableDPCM[iQuantValue1][0]; + } + else + { + iBits += pauiHuffmanTableDPCM[iQuantValue1][0]; + iBits += pauiHuffmanTableDPCM[iQuantValue2][0]; + } + } + else + { + if ( iHuffDim == 2 ) + { + iQuantValue1 *= iHuffMod; + iQuantValue1 += iQuantValue2; + iBits += pauiHuffmanTable[iQuantValue1][0]; + } + else + { + iBits += pauiHuffmanTable[iQuantValue1][0]; + iBits += pauiHuffmanTable[iQuantValue2][0]; + } + } + + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + + iBlockOffest++; + } + } + + return iBits; +} + +/* Currently only the number of bands in frame */ +static int32_t WriteHeaderInformation( const int32_t iNumBands, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsWritten; + + iBitsWritten = 0; + ivas_split_rend_bitstream_write_int32( pBits, iNumBands, 5 ); + iBitsWritten += 5; + + return iBitsWritten; +} + +static int32_t WriteMSInformation( const int32_t iNumBands, + const int32_t iMSMode, + const int32_t *piMSFlags, +#ifdef ENABLE_MS_PRED + const int32_t *piLRPhaseDiff, + const int32_t *piMSPredCoef, + int32_t iNumMSPredBands, +#endif + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsWritten; +#ifdef ENABLE_MS_PRED + int32_t iMSPredAll = ( iNumMSPredBands == iNumBands ); +#ifdef DEBUG_WRITE_MS_PRED + int32_t iBitsWrittenTmp = 0; +#endif +#endif + iBitsWritten = 0; + ivas_split_rend_bitstream_write_int32( pBits, iMSMode, 2 ); + iBitsWritten += 2; +#ifdef ENABLE_MS_PRED + if ( iMSMode == 3 ) + { + ivas_split_rend_bitstream_write_int32( pBits, iMSPredAll, 1 ); + iBitsWritten += 1; + } + if ( iMSMode == 2 || ( iMSMode == 3 && !iMSPredAll ) ) +#else + if ( iMSMode == 2 ) +#endif + { + int32_t n; + for ( n = 0; n < iNumBands; n++ ) + { + ivas_split_rend_bitstream_write_int32( pBits, piMSFlags[n], 1 ); + iBitsWritten += 1; + } + } +#ifdef ENABLE_MS_PRED +#ifdef DEBUG_WRITE_MS_PRED + iBitsWrittenTmp = iBitsWritten; +#endif + if ( iMSMode == 3 ) + { + int32_t b; + int32_t anyNonZero; + anyNonZero = 0; + for ( b = 0; b < iNumMSPredBands; b++ ) + { + if ( piLRPhaseDiff[b] != 0 ) + { + anyNonZero = 1; + break; + } + } + ivas_split_rend_bitstream_write_int32( pBits, anyNonZero, 1 ); + iBitsWritten++; + if ( anyNonZero ) + { +#ifdef SIMPLE_PHASE + for ( b = 0; b < iNumMSPredBands; b++ ) + { + BSPutBits( psBSWrite, piLRPhaseDiff[b], SIMPLE_PHASE_BITS ); + iBitsWritten += SIMPLE_PHASE_BITS; + } +#else + ivas_split_rend_bitstream_write_int32( + pBits, piLRPhaseDiff[0] - PHASE_MIN_VAL, PHASE_BAND0_BITS ); + iBitsWritten += PHASE_BAND0_BITS; + for ( b = 1; b < iNumMSPredBands; b++ ) + { + int32_t tabIdx = piLRPhaseDiff[b] - ENV_DELTA_MIN; + ivas_split_rend_bitstream_write_int32( + pBits, c_aaiRMSEnvHuffEnc[tabIdx][1], + c_aaiRMSEnvHuffEnc[tabIdx][0] ); + iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; + } +#endif + } + anyNonZero = 0; + for ( b = 0; b < iNumMSPredBands; b++ ) + { + if ( piMSPredCoef[b] != 0 ) + { + anyNonZero = 1; + break; + } + } + ivas_split_rend_bitstream_write_int32( pBits, anyNonZero, + 1 ); + iBitsWritten++; + if ( anyNonZero ) + { + ivas_split_rend_bitstream_write_int32( + pBits, piMSPredCoef[0] - PRED_MIN_VAL, PRED_BAND0_BITS ); + iBitsWritten += PRED_BAND0_BITS; + for ( b = 1; b < iNumMSPredBands; b++ ) + { + int32_t tabIdx = piMSPredCoef[b] - ENV_DELTA_MIN; + ivas_split_rend_bitstream_write_int32( + pBits, c_aaiRMSEnvHuffEnc[tabIdx][1], + c_aaiRMSEnvHuffEnc[tabIdx][0] ); + iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; + } + } + } +#ifdef DEBUG_WRITE_MS_PRED + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "ms_pred_bitrate.txt", "wt" ); + } + fprintf( fid, "%f\n", (float) ( ( iBitsWritten - iBitsWrittenTmp ) * ( iMSMode == 3 ) * 50 ) / 1000.0f ); /*kb/s*/ + } +#endif +#endif + + return iBitsWritten; +} + +static int32_t WriteGroupInformation( const int32_t iChannels, + const int32_t iCommonGrouping, + const int32_t *piNumGroups, + int32_t **ppiGroupLengths, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsWritten; + + iBitsWritten = 0; + if ( iChannels == 2 && iCommonGrouping == 1 ) + { + int32_t n; + ivas_split_rend_bitstream_write_int32( pBits, iCommonGrouping, + 1 ); + iBitsWritten += 1; + + for ( n = 0; n < piNumGroups[0]; n++ ) + { + int32_t k; + for ( k = 1; k < ppiGroupLengths[0][n]; k++ ) + { + ivas_split_rend_bitstream_write_int32( pBits, 0, 1 ); + iBitsWritten += 1; + } + if ( n < ( piNumGroups[0] - 1 ) ) + { + ivas_split_rend_bitstream_write_int32( pBits, 1, 1 ); + iBitsWritten += 1; + } + } + } + else if ( iChannels == 2 ) + { + int32_t c; + ivas_split_rend_bitstream_write_int32( pBits, iCommonGrouping, 1 ); + iBitsWritten += 1; + + for ( c = 0; c < iChannels; c++ ) + { + int32_t n; + + for ( n = 0; n < piNumGroups[c]; n++ ) + { + int32_t k; + for ( k = 1; k < ppiGroupLengths[c][n]; k++ ) + { + ivas_split_rend_bitstream_write_int32( pBits, 0, + 1 ); + iBitsWritten += 1; + } + if ( n < ( piNumGroups[c] - 1 ) ) + { + ivas_split_rend_bitstream_write_int32( pBits, 1, 1 ); + iBitsWritten += 1; + } + } + } + } + else + { + int32_t c; + + for ( c = 0; c < iChannels; c++ ) + { + int32_t n; + + for ( n = 0; n < piNumGroups[c]; n++ ) + { + int32_t k; + for ( k = 1; k < ppiGroupLengths[c][n]; k++ ) + { + ivas_split_rend_bitstream_write_int32( pBits, 0, 1 ); + iBitsWritten += 1; + } + if ( n < ( piNumGroups[c] - 1 ) ) + { + ivas_split_rend_bitstream_write_int32( pBits, 1, 1 ); + iBitsWritten += 1; + } + } + } + } + + return iBitsWritten; +} + +static int32_t WriteRMSEnvelope( const int32_t iChannels, + const int32_t *piNumGroups, + const int32_t iNumBands, + int32_t ***pppiRMSEnvelope, + ivas_split_rend_bits_t *pBits ) +{ + int32_t n; + int32_t iBitsWritten; + + iBitsWritten = 0; + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < piNumGroups[n]; k++ ) + { + int32_t b; + int32_t iLastRMSVal; + + iLastRMSVal = pppiRMSEnvelope[n][k][0]; + iLastRMSVal = ( iLastRMSVal > ENV_MIN ) ? iLastRMSVal : ENV_MIN; + iLastRMSVal = ( iLastRMSVal < ENV_MAX ) ? iLastRMSVal : ENV_MAX; + ivas_split_rend_bitstream_write_int32( pBits, ( iLastRMSVal - ENV_MIN ), ENV0_BITS ); + iBitsWritten += ENV0_BITS; + + for ( b = 1; b < iNumBands; b++ ) + { + int32_t iDelta; + + iDelta = pppiRMSEnvelope[n][k][b] - iLastRMSVal; + iDelta = ( iDelta > ENV_DELTA_MIN ) ? iDelta : ENV_DELTA_MIN; + iDelta = ( iDelta < ENV_DELTA_MAX ) ? iDelta : ENV_DELTA_MAX; + iDelta -= ENV_DELTA_MIN; + ivas_split_rend_bitstream_write_int32( + pBits, c_aaiRMSEnvHuffEnc[iDelta][1], + c_aaiRMSEnvHuffEnc[iDelta][0] ); + iBitsWritten += c_aaiRMSEnvHuffEnc[iDelta][0]; + + iLastRMSVal = pppiRMSEnvelope[n][k][b]; + } + } + } + + return iBitsWritten; +} + +#ifdef ENABLE_PMOD_ADJUST +static int32_t WritePmodInformation( const int32_t **ppiHiSMRFlags, Bitstream *psBSWrite, int32_t iChannels, int32_t iNumBands ) +{ + int32_t iBitsWritten, c, b; + + iBitsWritten = 0; + + for ( c = 0; c < iChannels; c++ ) + { + int32_t anyNonZero = 0; + const int32_t *flags = ppiHiSMRFlags[c]; + for ( b = 0; b < iNumBands; b++ ) + { + if ( flags[b] ) + { + anyNonZero = 1; + break; + } + } + BSPutBits( psBSWrite, anyNonZero, 1 ); + iBitsWritten += 1; + if ( anyNonZero ) + { + for ( b = 0; b < iNumBands; b++ ) + { + BSPutBits( psBSWrite, flags[b], 1 ); + iBitsWritten += 1; + } + } + } +#ifdef WRITE_HISMR_FLAGS + { + static FILE *fid = 0; + if ( !fid ) + { + fid = fopen( "hismr_enc.txt", "wt" ); + } + for ( c = 0; c < iChannels; c++ ) + { + int32_t b; + for ( b = 0; b < iNumBands; b++ ) + { + if ( c == iChannels - 1 && b == iNumBands - 1 ) + { + fprintf( fid, "%d\n", ppiHiSMRFlags[c][b] ); + } + else + { + fprintf( fid, "%d ", ppiHiSMRFlags[c][b] ); + } + } + } + } +#endif + + return iBitsWritten; +} +#endif + +static int32_t WriteAllocInformation( const int32_t iAllocOffset, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsWritten; + + iBitsWritten = 0; + + if ( iAllocOffset < MIN_ALLOC_OFFSET || iAllocOffset > MAX_ALLOC_OFFSET ) + { + printf( "Serious error\n" ); + } + ivas_split_rend_bitstream_write_int32( pBits, + ( iAllocOffset - MIN_ALLOC_OFFSET ), ALLOC_OFFSET_BITS ); + iBitsWritten += ALLOC_OFFSET_BITS; + + return iBitsWritten; +} + +static int32_t WriteCQMFData( const int32_t iNumGroups, + const int32_t *piGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t *piPredEnable, + int32_t **ppiAlloc, + int32_t **ppiSignReal, + int32_t **ppiSignImag, + int32_t **ppiQReal, + int32_t **ppiQImag, + ivas_split_rend_bits_t *pBits ) +{ + int32_t n; + int32_t iBitsWritten; + int32_t iBlockOffest; + + iBitsWritten = 0; + iBlockOffest = 0; + + + for ( n = 0; n < iNumGroups; n++ ) + { + int32_t k; + for ( k = 0; k < piGroupLengths[n]; k++ ) + { + int32_t b; + int32_t iFBOffset; + + iFBOffset = 0; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + int32_t iAlloc; + int32_t iHuffDim; + int32_t iHuffMod; + + iAlloc = ppiAlloc[n][b]; + + iHuffDim = c_aiHuffmanDim[iAlloc]; + iHuffMod = c_aiHuffmanMod[iAlloc]; + + + if ( iAlloc > 0 ) + { + const uint32_t( *pauiHuffmanTable )[2] = NULL; + const uint32_t( *pauiHuffmanTableDPCM )[2] = NULL; + + // pauiHuffmanTable = GetHuffEncTable(iAlloc); + pauiHuffmanTable = c_apauiHuffEncTabels[iAlloc]; + pauiHuffmanTableDPCM = c_apauiHuffEncTabels[ALLOC_TABLE_SIZE + iAlloc]; + for ( m = 0; m < piBandwidths[b]; m++ ) + { + int32_t iQuantValue1; + int32_t iQuantValue2; + + iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; + iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; + + if ( piPredEnable[iFBOffset] == 1 ) + { + if ( iHuffDim == 2 ) + { + int32_t iSymbol; + iSymbol = iQuantValue1; + iSymbol *= iHuffMod; + iSymbol += iQuantValue2; + ivas_split_rend_bitstream_write_int32( + pBits, pauiHuffmanTableDPCM[iSymbol][1], + pauiHuffmanTableDPCM[iSymbol][0] ); + iBitsWritten += pauiHuffmanTableDPCM[iSymbol][0]; + } + else + { + ivas_split_rend_bitstream_write_int32( + pBits, pauiHuffmanTableDPCM[iQuantValue1][1], + pauiHuffmanTableDPCM[iQuantValue1][0] ); + iBitsWritten += pauiHuffmanTableDPCM[iQuantValue1][0]; + + ivas_split_rend_bitstream_write_int32( + pBits, + pauiHuffmanTableDPCM[iQuantValue2][1], + pauiHuffmanTableDPCM[iQuantValue2][0] ); + iBitsWritten += pauiHuffmanTableDPCM[iQuantValue2][0]; + } + } + else + { + if ( iHuffDim == 2 ) + { + int32_t iSymbol; + iSymbol = iQuantValue1; + iSymbol *= iHuffMod; + iSymbol += iQuantValue2; + ivas_split_rend_bitstream_write_int32( + pBits, pauiHuffmanTable[iSymbol][1], + pauiHuffmanTable[iSymbol][0] ); + iBitsWritten += pauiHuffmanTable[iSymbol][0]; + } + else + { + ivas_split_rend_bitstream_write_int32( + pBits, pauiHuffmanTable[iQuantValue1][1], + pauiHuffmanTable[iQuantValue1][0] ); + iBitsWritten += pauiHuffmanTable[iQuantValue1][0]; + + ivas_split_rend_bitstream_write_int32( + pBits, pauiHuffmanTable[iQuantValue2][1], + pauiHuffmanTable[iQuantValue2][0] ); + iBitsWritten += pauiHuffmanTable[iQuantValue2][0]; + } + } + + if ( iQuantValue1 > 0 ) + { + ivas_split_rend_bitstream_write_int32( + pBits, ppiSignReal[iBlockOffest][iFBOffset], + 1 ); + iBitsWritten += 1; + } + if ( iQuantValue2 > 0 ) + { + ivas_split_rend_bitstream_write_int32( + pBits, ppiSignImag[iBlockOffest][iFBOffset], 1 ); + iBitsWritten += 1; + } + + iFBOffset++; + } + } + else + { + iFBOffset += piBandwidths[b]; + } + } + + iBlockOffest++; + } + } + + return iBitsWritten; +} + +static int32_t ComputeAllocation( const int32_t iChannels, + const int32_t *piNumGroups, + int32_t **ppiGroupLengths, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + int32_t ***pppiSMR, + const int32_t iAvailableBits, + int32_t *piAllocOffset, + int32_t ***pppiAlloc, + int32_t ***pppiQReal, + int32_t ***pppiQImag, + int32_t ***pppiSignReal, + int32_t ***pppiSignImag, + int32_t **ppiPredEnable, + float **ppfA1Real, + float **ppfA1Imag ) +{ + int32_t iBitsUsed; + int32_t iDone; + int32_t iDelta; + + iBitsUsed = ALLOC_OFFSET_BITS; // Bits used for Alloc Offset + + iDone = 0; + iDelta = -MIN_ALLOC_OFFSET; + *piAllocOffset = 0; + + while ( iDone == 0 ) + { + int32_t n; + int32_t iLimitAllocOffset; + iBitsUsed = ALLOC_OFFSET_BITS; + + iLimitAllocOffset = *piAllocOffset; + iLimitAllocOffset = ( iLimitAllocOffset > MIN_ALLOC_OFFSET ) ? iLimitAllocOffset : MIN_ALLOC_OFFSET; + iLimitAllocOffset = ( iLimitAllocOffset < MAX_ALLOC_OFFSET ) ? iLimitAllocOffset : MAX_ALLOC_OFFSET; + + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < piNumGroups[n]; k++ ) + { + int32_t b; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t iAlloc; + iAlloc = ( ( pppiSMR[n][k][b] + iLimitAllocOffset * ALLOC_OFFSET_SCALE ) >> 5 ); + iAlloc = ( iAlloc > MIN_ALLOC ) ? iAlloc : MIN_ALLOC; + iAlloc = ( iAlloc < MAX_ALLOC ) ? iAlloc : MAX_ALLOC; + pppiAlloc[n][k][b] = iAlloc; + } + } +#ifdef OPTIMIZE_DPCM_QUANT + QuantizeSpectrumDPCM_Opt( piNumGroups[n], + (const int32_t *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + pppiAlloc[n], + pppfReal[n], + pppfImag[n], + pppiQReal[n], + pppiQImag[n], + pppiSignReal[n], + pppiSignImag[n], + ppiPredEnable[n], + ppfA1Real[n], + ppfA1Imag[n] ); +#else + QuantizeSpectrumDPCM( piNumGroups[n], + (const int32_t *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + pppiAlloc[n], + pppfReal[n], + pppfImag[n], + pppiQReal[n], + pppiQImag[n], + pppiSignReal[n], + pppiSignImag[n], + ppiPredEnable[n], + ppfA1Real[n], + ppfA1Imag[n] ); +#endif + + iBitsUsed += CountCQMFBits( piNumGroups[n], + (const int32_t *) ppiGroupLengths[n], + iNumBands, + piBandwidths, + (const int32_t *) ppiPredEnable[n], + pppiAlloc[n], + pppiQReal[n], + pppiQImag[n] ); + } + + if ( *piAllocOffset <= MIN_ALLOC_OFFSET && iBitsUsed > iAvailableBits ) + { +#ifdef DEBUG_VERBOSE + printf( "Frame can not be coded with the number of bits available\n" ); +#endif + // iLastError = ENC_ERROR_STREAM_FAILURE; + return -1; + } + else if ( *piAllocOffset >= MAX_ALLOC_OFFSET && iBitsUsed < iAvailableBits ) + { + *piAllocOffset = MAX_ALLOC_OFFSET; + iDone++; + } + else + { + if ( iDelta == 0 && iBitsUsed > iAvailableBits ) + { + iDelta = 1; + } + else if ( iDelta == 0 && iBitsUsed < iAvailableBits ) + { + iDone++; + } + else if ( iBitsUsed == iAvailableBits ) + { + iDone++; + } + + if ( iBitsUsed > iAvailableBits ) + { + *piAllocOffset -= iDelta; + iDelta >>= 1; + } + else if ( iBitsUsed < iAvailableBits ) + { + *piAllocOffset += iDelta; + iDelta >>= 1; + } + } + } + + // printf("%d\n",*piAllocOffset); + // printf("%d\t%d\t%d\n",pppiAlloc[0][0][0],pppiAlloc[0][0][1],pppiAlloc[0][0][22]); + + // printf("%d\t%d\t%d\t%d\n",*piAllocOffset,iAvailableBits,iBitsUsed,iAvailableBits - iBitsUsed); + + return iBitsUsed; +} diff --git a/lib_rend/ivas_CQMFEncoder.h b/lib_rend/ivas_CQMFEncoder.h new file mode 100644 index 0000000000..3466eae6b4 --- /dev/null +++ b/lib_rend/ivas_CQMFEncoder.h @@ -0,0 +1,69 @@ +/****************************************************************************************************** + + (C) 2022 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_CQMF_ENCODER_H_ +#define _IVAS_CQMF_ENCODER_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "lib_rend.h" +#define ENCODER_ERROR_NONE ( 0 ) +#define ENCODER_ERROR_FS_NOT_SUPPORTED ( -1 ) +#define ENCODER_ERROR_CHAN_NOT_SUPPORTED ( -2 ) +#define ENCODER_ERROR_UNKNOWN ( -100 ) + + typedef struct CQMF_ENCODER CQMFEncoder; + + CQMFEncoder *CreateCQMFEncoder( const int32_t iSampleRate, + const int32_t iChannels, + const int32_t iTargetBitRate, + const int32_t iAllowSidePred ); + + void DeleteCQMFEncoder( CQMFEncoder *psCQMFEncoder ); + + int32_t CQMFEncoderGetError( CQMFEncoder *psCQMFEncoder ); + int32_t EncodeFrame( + CQMFEncoder *psCQMFEncoder, + float ***pppfCQMFReal, + float ***pppfCQMFImag, + int32_t *piNumiBites, + const int32_t available_bits, + ivas_split_rend_bits_t *pBits ); + int32_t GetNumGroups( CQMFEncoder *psCQMFEncoder ); + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_ENCODER_H_ */ diff --git a/lib_rend/ivas_CQMFHuff.c b/lib_rend/ivas_CQMFHuff.c new file mode 100644 index 0000000000..aea5a98a47 --- /dev/null +++ b/lib_rend/ivas_CQMFHuff.c @@ -0,0 +1,4124 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_CQMFHuff.h" +#include "wmops.h" + +/* clang-format off */ +const uint32_t c_aauiCQMFHuffEnc1[16][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000b, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0001}, + {0x0006, 0x0001}, {0x0008, 0x0001}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, +}; + +const uint32_t c_aauiCQMFHuffDec1[3][16] = +{ + {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc2[16][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000c, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000c, 0x0001}, + {0x0006, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000b, 0x0003}, +}; + +const uint32_t c_aauiCQMFHuffDec2[3][16] = +{ + {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00000003, 0x00000007, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0001000f, 0x0001000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc3[25][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, + {0x000d, 0x0002}, {0x000d, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0009, 0x0001}, + {0x000c, 0x0007}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, + {0x000d, 0x000d}, + +}; + +const uint32_t c_aauiCQMFHuffDec3[10][16] = +{ + {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x0000000c, 0x00010007, 0x00010007, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x00000010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, +}; + +const uint32_t c_aauiCQMFHuffEnc4[36][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0000}, {0x0010, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, + {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000e, 0x0006}, + {0x0010, 0x0004}, {0x0010, 0x0005}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000e, 0x0007}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0010, 0x0008}, + {0x0010, 0x0009}, {0x0010, 0x000a}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0010, 0x0010}, + {0x0010, 0x0011}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, + +}; + +const uint32_t c_aauiCQMFHuffDec4[5][16] = +{ + {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x0000000e, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x0004ffff, 0x0003ffff, 0x00010003, 0x00010003, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0000001f, 0x00000020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, + {0x00000004, 0x00000005, 0x0000000a, 0x0000000b, 0x00000010, 0x00000011, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, }, +}; + +const uint32_t c_aauiCQMFHuffEnc5[36][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, + {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0008}, {0x0012, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000c, 0x0001}, + {0x0012, 0x0002}, {0x0012, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000d, 0x0001}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, + {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, + {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0011, 0x000b}, + +}; + +const uint32_t c_aauiCQMFHuffDec5[10][16] = +{ + {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x0000000e, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x0003ffff, 0x0000000f, 0x00010009, 0x00010009, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0004ffff, 0x0005ffff, 0x00010004, 0x00010004, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, + {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, +}; + +const uint32_t c_aauiCQMFHuffEnc6[49][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0003}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0002, 0x0001}, + {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x0010, 0x0004}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, + {0x0008, 0x0001}, {0x000d, 0x0001}, {0x0012, 0x0007}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x000a, 0x0003}, {0x000b, 0x0001}, {0x000c, 0x0001}, + {0x0011, 0x0004}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0010, 0x0005}, {0x000f, 0x0003}, {0x0011, 0x0005}, {0x0014, 0x0009}, + {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0013, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, + {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, + {0x0014, 0x0019}, + +}; + +const uint32_t c_aauiCQMFHuffDec6[7][16] = +{ + {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000010, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0003ffff, 0x00000017, 0x00010016, 0x00010016, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000004, 0x0000000b, 0x0000001c, 0x0001001d, 0x0001001d, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010024, 0x00010024, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00000005, 0x00000006, 0x0000000c, 0x0000000d, 0x00000013, 0x00000014, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000025, 0x00000026, }, +}; + +const uint32_t c_aauiCQMFHuffEnc7[64][2] = +{ + {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0002}, {0x0015, 0x0000}, {0x0015, 0x0001}, {0x0015, 0x0002}, + {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000f, 0x0003}, {0x0014, 0x0011}, {0x0015, 0x0003}, {0x0015, 0x0004}, + {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0002}, {0x0015, 0x0005}, {0x0015, 0x0006}, {0x0015, 0x0007}, + {0x000a, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0001}, {0x000f, 0x0004}, {0x0012, 0x0006}, {0x0015, 0x0008}, {0x0015, 0x0009}, {0x0015, 0x000a}, + {0x000f, 0x0005}, {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0012, 0x0007}, {0x0014, 0x0012}, {0x0015, 0x000b}, {0x0015, 0x000c}, {0x0015, 0x000d}, + {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0013, 0x000b}, {0x0014, 0x0015}, {0x0015, 0x000e}, {0x0015, 0x000f}, {0x0015, 0x0010}, {0x0015, 0x0011}, + {0x0015, 0x0012}, {0x0015, 0x0013}, {0x0015, 0x0014}, {0x0015, 0x0015}, {0x0015, 0x0016}, {0x0015, 0x0017}, {0x0015, 0x0018}, {0x0015, 0x0019}, + {0x0015, 0x001a}, {0x0015, 0x001b}, {0x0015, 0x001c}, {0x0015, 0x001d}, {0x0015, 0x001e}, {0x0015, 0x001f}, {0x0015, 0x0020}, {0x0015, 0x0021}, +}; + +const uint32_t c_aauiCQMFHuffDec7[25][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x0003ffff, 0x0004ffff, 0x00010012, 0x00010012, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x0005ffff, 0x0000001a, 0x00010013, 0x00010013, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x0007ffff, 0x0006ffff, 0x00000014, 0x00000022, 0x00010004, 0x00010004, 0x0001000c, 0x0001000c, 0x0001001b, 0x0001001b, 0x00010020, 0x00010020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, + {0x0018ffff, 0x0000000d, 0x00000024, 0x00000028, 0x00000029, 0x0000002b, 0x0001002a, 0x0001002a, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x000effff, 0x000affff, 0x000bffff, 0x000cffff, 0x0008ffff, 0x0009ffff, 0x000dffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc8[81][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0002}, {0x0014, 0x0008}, {0x0017, 0x0000}, {0x0017, 0x0001}, + {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0004}, {0x0015, 0x000d}, + {0x0017, 0x0003}, {0x0017, 0x0004}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000c, 0x0001}, {0x0010, 0x0002}, {0x0013, 0x0005}, + {0x0017, 0x0005}, {0x0017, 0x0006}, {0x0017, 0x0007}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000b, 0x0001}, {0x000f, 0x0004}, {0x0012, 0x0005}, + {0x0016, 0x0015}, {0x0017, 0x0008}, {0x0017, 0x0009}, {0x0017, 0x000a}, {0x000f, 0x0005}, {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0012, 0x0006}, + {0x0014, 0x0009}, {0x0017, 0x000b}, {0x0017, 0x000c}, {0x0017, 0x000d}, {0x0017, 0x000e}, {0x0013, 0x0006}, {0x0012, 0x0007}, {0x0013, 0x0007}, + {0x0015, 0x000e}, {0x0017, 0x000f}, {0x0017, 0x0010}, {0x0017, 0x0011}, {0x0017, 0x0012}, {0x0017, 0x0013}, {0x0016, 0x0016}, {0x0016, 0x0017}, + {0x0015, 0x000f}, {0x0016, 0x0018}, {0x0017, 0x0014}, {0x0017, 0x0015}, {0x0017, 0x0016}, {0x0017, 0x0017}, {0x0017, 0x0018}, {0x0017, 0x0019}, + {0x0017, 0x001a}, {0x0017, 0x001b}, {0x0017, 0x001c}, {0x0017, 0x001d}, {0x0017, 0x001e}, {0x0017, 0x001f}, {0x0017, 0x0020}, {0x0017, 0x0021}, + {0x0017, 0x0022}, {0x0017, 0x0023}, {0x0017, 0x0024}, {0x0017, 0x0025}, {0x0017, 0x0026}, {0x0017, 0x0027}, {0x0017, 0x0028}, {0x0017, 0x0029}, + {0x0016, 0x0019}, + +}; + +const uint32_t c_aauiCQMFHuffDec8[16][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0004ffff, 0x00010014, 0x00010014, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x0005ffff, 0x00000015, 0x0001001d, 0x0001001d, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0007ffff, 0x0006ffff, 0x00000016, 0x00000026, 0x00010004, 0x00010004, 0x0001000d, 0x0001000d, 0x0001001e, 0x0001001e, 0x00010024, 0x00010024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, + {0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000028, 0x00010017, 0x00010017, 0x0001002d, 0x0001002d, 0x0001002f, 0x0001002f, }, + {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, }, + {0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, }, + {0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x00010031, 0x00010031, }, + {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, + {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, +}; + +const uint32_t c_aauiCQMFHuffEnc9[100][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000d, 0x0002}, {0x0011, 0x0004}, {0x0014, 0x000a}, {0x0017, 0x0000}, + {0x0017, 0x0001}, {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0003}, {0x0010, 0x0004}, + {0x0013, 0x0007}, {0x0016, 0x0018}, {0x0017, 0x0003}, {0x0017, 0x0004}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, + {0x000e, 0x0002}, {0x0011, 0x0005}, {0x0014, 0x000b}, {0x0016, 0x0019}, {0x0017, 0x0005}, {0x0017, 0x0006}, {0x0009, 0x0003}, {0x0008, 0x0003}, + {0x000b, 0x0003}, {0x000d, 0x0004}, {0x0010, 0x0005}, {0x0012, 0x0006}, {0x0015, 0x000f}, {0x0017, 0x0007}, {0x0017, 0x0008}, {0x0017, 0x0009}, + {0x000d, 0x0005}, {0x000c, 0x0003}, {0x000e, 0x0003}, {0x0010, 0x0006}, {0x0012, 0x0007}, {0x0014, 0x000c}, {0x0017, 0x000a}, {0x0016, 0x001a}, + {0x0017, 0x000b}, {0x0017, 0x000c}, {0x0011, 0x0006}, {0x0010, 0x0007}, {0x0011, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0015, 0x0010}, + {0x0017, 0x000d}, {0x0017, 0x000e}, {0x0017, 0x000f}, {0x0017, 0x0010}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0014, 0x000d}, {0x0015, 0x0011}, + {0x0017, 0x0011}, {0x0016, 0x001b}, {0x0017, 0x0012}, {0x0017, 0x0013}, {0x0017, 0x0014}, {0x0017, 0x0015}, {0x0017, 0x0016}, {0x0015, 0x0012}, + {0x0015, 0x0013}, {0x0017, 0x0017}, {0x0016, 0x001c}, {0x0017, 0x0018}, {0x0017, 0x0019}, {0x0017, 0x001a}, {0x0017, 0x001b}, {0x0017, 0x001c}, + {0x0017, 0x001d}, {0x0017, 0x001e}, {0x0017, 0x001f}, {0x0017, 0x0020}, {0x0017, 0x0021}, {0x0017, 0x0022}, {0x0017, 0x0023}, {0x0017, 0x0024}, + {0x0017, 0x0025}, {0x0017, 0x0026}, {0x0017, 0x0027}, {0x0017, 0x0028}, {0x0017, 0x0029}, {0x0017, 0x002a}, {0x0017, 0x002b}, {0x0017, 0x002c}, + {0x0017, 0x002d}, {0x0017, 0x002e}, {0x0017, 0x002f}, {0x0016, 0x001d}, + +}; + +const uint32_t c_aauiCQMFHuffDec9[22][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0004ffff, 0x00000016, 0x0000001f, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000029, 0x00010017, 0x00010017, 0x00010020, 0x00010020, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x000bffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x0000000f, 0x00000022, 0x0000002b, 0x00000033, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x000fffff, 0x000dffff, 0x000cffff, 0x000effff, 0x00000006, 0x0000001a, 0x0000002d, 0x0000003e, 0x00010010, 0x00010010, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, + {0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, + {0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x00010025, 0x00010025, }, + {0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x0001002e, 0x0001002e, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, + {0x0001003b, 0x0001003b, 0x00010040, 0x00010040, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010049, 0x00010049, }, + {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, + {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, + {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, +}; + +const uint32_t c_aauiCQMFHuffEnc10[169][2] = +{ + {0x0001, 0x0001}, {0x0004, 0x0002}, {0x0005, 0x0002}, {0x0007, 0x0002}, {0x000a, 0x0002}, {0x000e, 0x0004}, {0x0011, 0x0007}, {0x0013, 0x0012}, + {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0004}, + {0x0007, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0004}, {0x0010, 0x0007}, {0x0013, 0x0013}, {0x0015, 0x0035}, {0x0016, 0x0005}, {0x0016, 0x0006}, + {0x0016, 0x0007}, {0x0016, 0x0008}, {0x0005, 0x0003}, {0x0004, 0x0005}, {0x0006, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000e, 0x0005}, + {0x0010, 0x0008}, {0x0013, 0x0014}, {0x0014, 0x001d}, {0x0016, 0x0009}, {0x0016, 0x000a}, {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0007, 0x0004}, + {0x0007, 0x0005}, {0x0008, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0005}, {0x000f, 0x0005}, {0x0011, 0x0008}, {0x0014, 0x001e}, {0x0014, 0x001f}, + {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, {0x000a, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0006}, + {0x000f, 0x0006}, {0x0011, 0x0009}, {0x0013, 0x0015}, {0x0014, 0x0020}, {0x0016, 0x0011}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0016, 0x0014}, + {0x0016, 0x0015}, {0x000e, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x000f, 0x0007}, {0x0011, 0x000a}, {0x0012, 0x000c}, {0x0016, 0x0016}, + {0x0016, 0x0017}, {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0016, 0x001a}, {0x0016, 0x001b}, {0x0016, 0x001c}, {0x0011, 0x000b}, {0x0010, 0x0009}, + {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0013, 0x0016}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, {0x0016, 0x0021}, + {0x0016, 0x0022}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0012, 0x000d}, {0x0013, 0x0017}, {0x0016, 0x0025}, + {0x0016, 0x0026}, {0x0016, 0x0027}, {0x0016, 0x0028}, {0x0016, 0x0029}, {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, {0x0016, 0x002d}, + {0x0015, 0x0036}, {0x0015, 0x0037}, {0x0014, 0x0023}, {0x0015, 0x0038}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0016, 0x0031}, + {0x0016, 0x0032}, {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, + {0x0016, 0x003a}, {0x0016, 0x003b}, {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, + {0x0016, 0x0042}, {0x0016, 0x0043}, {0x0016, 0x0044}, {0x0016, 0x0045}, {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, + {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, + {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, + {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, + {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, + {0x0015, 0x0039}, + +}; + +const uint32_t c_aauiCQMFHuffDec10[45][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000001, 0x0000000d, 0x0000000f, 0x0000001b, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x0004ffff, 0x0003ffff, 0x0000001d, 0x00000029, 0x00010003, 0x00010003, 0x00010010, 0x00010010, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001001e, 0x0001001e, 0x00010036, 0x00010036, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, + {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020043, 0x00020043, 0x00020043, 0x00020043, }, + {0x0012ffff, 0x000effff, 0x000dffff, 0x000affff, 0x0009ffff, 0x000bffff, 0x000cffff, 0x00000013, 0x00000020, 0x0000004f, 0x0001002c, 0x0001002c, 0x00010038, 0x00010038, 0x00010044, 0x00010044, }, + {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, + {0x0000003b, 0x0000005b, 0x0000005c, 0x0000006a, 0x00010007, 0x00010007, 0x00010014, 0x00010014, 0x00010021, 0x00010021, 0x0001003a, 0x0001003a, 0x00010052, 0x00010052, 0x0001005e, 0x0001005e, }, + {0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x00000022, 0x0000002e, 0x0000002f, }, + {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, + {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, + {0x0014ffff, 0x0017ffff, 0x0015ffff, 0x0016ffff, 0x001cffff, 0x0013ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, }, + {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, + {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, + {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, + {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, }, + {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, }, + {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, }, + {0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, }, + {0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, }, + {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, }, + {0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, + {0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, }, + {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, + {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, }, + {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, }, + {0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, + {0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, + {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, + {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, + {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, + {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, + {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, + {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, }, + {0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, }, + {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, + {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, +}; + +const uint32_t c_aauiCQMFHuffEnc11[196][2] = +{ + {0x0001, 0x0001}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x000f, 0x0005}, {0x0012, 0x000d}, + {0x0014, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0004}, {0x0003, 0x0003}, + {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0004}, {0x000e, 0x0005}, {0x0010, 0x0007}, {0x0012, 0x000e}, {0x0014, 0x0020}, + {0x0016, 0x0005}, {0x0016, 0x0006}, {0x0016, 0x0007}, {0x0016, 0x0008}, {0x0005, 0x0005}, {0x0004, 0x0005}, {0x0006, 0x0004}, {0x0007, 0x0003}, + {0x000a, 0x0004}, {0x000c, 0x0005}, {0x000e, 0x0006}, {0x0011, 0x000a}, {0x0012, 0x000f}, {0x0015, 0x003b}, {0x0016, 0x0009}, {0x0016, 0x000a}, + {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0007, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0005}, + {0x000f, 0x0006}, {0x0012, 0x0010}, {0x0014, 0x0021}, {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, {0x0016, 0x0011}, + {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0006}, {0x000f, 0x0007}, {0x0011, 0x000b}, {0x0013, 0x0017}, + {0x0014, 0x0022}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0016, 0x0014}, {0x0016, 0x0015}, {0x0016, 0x0016}, {0x000c, 0x0006}, {0x000b, 0x0007}, + {0x000c, 0x0007}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x0010, 0x0008}, {0x0012, 0x0011}, {0x0014, 0x0023}, {0x0015, 0x003c}, {0x0016, 0x0017}, + {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0016, 0x001a}, {0x0016, 0x001b}, {0x000f, 0x0008}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0009}, + {0x0011, 0x000c}, {0x0013, 0x0018}, {0x0014, 0x0024}, {0x0016, 0x001c}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, + {0x0016, 0x0021}, {0x0016, 0x0022}, {0x0011, 0x000d}, {0x0010, 0x0009}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0014, 0x0025}, {0x0015, 0x003d}, + {0x0014, 0x0026}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0016, 0x0025}, {0x0016, 0x0026}, {0x0016, 0x0027}, {0x0016, 0x0028}, {0x0016, 0x0029}, + {0x0014, 0x0027}, {0x0013, 0x0019}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, + {0x0016, 0x002d}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0016, 0x0031}, {0x0016, 0x0032}, {0x0014, 0x002b}, {0x0014, 0x002c}, + {0x0014, 0x002d}, {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, + {0x0016, 0x003a}, {0x0016, 0x003b}, {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, + {0x0016, 0x0042}, {0x0016, 0x0043}, {0x0016, 0x0044}, {0x0016, 0x0045}, {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, + {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, + {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, + {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, + {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, + {0x0016, 0x006a}, {0x0016, 0x006b}, {0x0016, 0x006c}, {0x0016, 0x006d}, {0x0016, 0x006e}, {0x0016, 0x006f}, {0x0016, 0x0070}, {0x0016, 0x0071}, + {0x0016, 0x0072}, {0x0016, 0x0073}, {0x0016, 0x0074}, {0x0016, 0x0075}, + +}; + +const uint32_t c_aauiCQMFHuffDec11[50][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x0000000e, 0x0000001d, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0007ffff, 0x0005ffff, 0x0004ffff, 0x0006ffff, 0x00010003, 0x00010003, 0x0001001f, 0x0001001f, 0x0001002a, 0x0001002a, 0x0001002c, 0x0001002c, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x000bffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000021, 0x00000046, 0x00000048, 0x00010013, 0x00010013, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, + {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x00010054, 0x00010054, 0x00010057, 0x00010057, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, + {0x0014ffff, 0x0011ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x000cffff, 0x000dffff, 0x00000015, 0x0000004b, 0x00000063, 0x00010006, 0x00010006, 0x00010030, 0x00010030, 0x0001003d, 0x0001003d, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, }, + {0x00010059, 0x00010059, 0x00010071, 0x00010071, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, + {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, + {0x00000017, 0x00000032, 0x00000040, 0x0000004d, 0x0000005a, 0x00000066, 0x00000068, 0x00000070, 0x00000072, 0x00000073, 0x00000074, 0x0000007e, 0x0000007f, 0x00000080, 0x0001003f, 0x0001003f, }, + {0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0013ffff, 0x0012ffff, 0x00000008, }, + {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, + {0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x001affff, 0x0019ffff, 0x0015ffff, 0x0018ffff, 0x001dffff, 0x0016ffff, 0x0017ffff, 0x001bffff, 0x001cffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, + {0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, + {0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, + {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, }, + {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, + {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, + {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, + {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, }, + {0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, }, + {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, + {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, + {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, + {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, + {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, + {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, + {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, + {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, + {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, }, + {0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, }, + {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, + {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, + {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, + {0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, }, + {0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, }, + {0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, }, + {0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200b9, }, + {0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, }, + {0x000200be, 0x000200be, 0x000200be, 0x000200be, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, }, +}; + +const uint32_t c_aauiCQMFHuffEnc12[289][2] = +{ + {0x0001, 0x0001}, {0x0004, 0x0004}, {0x0005, 0x0004}, {0x0007, 0x0004}, {0x0008, 0x0002}, {0x000b, 0x0004}, {0x000e, 0x0006}, {0x0010, 0x0009}, + {0x0012, 0x0014}, {0x0013, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0016, 0x0005}, + {0x0016, 0x0006}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0005, 0x0005}, {0x0006, 0x0003}, {0x0008, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0006}, + {0x000f, 0x0008}, {0x0011, 0x000c}, {0x0013, 0x0020}, {0x0016, 0x0007}, {0x0015, 0x0063}, {0x0016, 0x0008}, {0x0016, 0x0009}, {0x0016, 0x000a}, + {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0005, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0007}, {0x0006, 0x0004}, {0x0008, 0x0004}, {0x000b, 0x0005}, + {0x000d, 0x0007}, {0x0010, 0x000a}, {0x0012, 0x0015}, {0x0015, 0x0064}, {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, + {0x0016, 0x0011}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0008, 0x0005}, {0x000a, 0x0005}, + {0x000c, 0x0005}, {0x000e, 0x0007}, {0x0010, 0x000b}, {0x0012, 0x0016}, {0x0014, 0x0037}, {0x0015, 0x0065}, {0x0016, 0x0014}, {0x0016, 0x0015}, + {0x0016, 0x0016}, {0x0016, 0x0017}, {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0008, 0x0006}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x000a, 0x0006}, + {0x000c, 0x0006}, {0x000e, 0x0008}, {0x0010, 0x000c}, {0x0011, 0x000d}, {0x0013, 0x0021}, {0x0015, 0x0066}, {0x0016, 0x001a}, {0x0016, 0x001b}, + {0x0016, 0x001c}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, {0x000b, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0007}, + {0x000c, 0x0007}, {0x000e, 0x0009}, {0x000f, 0x0009}, {0x0011, 0x000e}, {0x0013, 0x0022}, {0x0015, 0x0067}, {0x0015, 0x0068}, {0x0016, 0x0021}, + {0x0016, 0x0022}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0016, 0x0025}, {0x0016, 0x0026}, {0x0016, 0x0027}, {0x000e, 0x000a}, {0x000d, 0x0008}, + {0x000d, 0x0009}, {0x000e, 0x000b}, {0x000f, 0x000a}, {0x0011, 0x000f}, {0x0013, 0x0023}, {0x0014, 0x0038}, {0x0016, 0x0028}, {0x0016, 0x0029}, + {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, {0x0016, 0x002d}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0010, 0x000d}, + {0x000f, 0x000b}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0012, 0x0017}, {0x0013, 0x0024}, {0x0014, 0x0039}, {0x0016, 0x0031}, {0x0016, 0x0032}, + {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, {0x0016, 0x003a}, + {0x0013, 0x0025}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0016, 0x003b}, + {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, {0x0016, 0x0042}, {0x0016, 0x0043}, + {0x0016, 0x0044}, {0x0015, 0x0069}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0015, 0x006a}, {0x0015, 0x006b}, {0x0015, 0x006c}, {0x0016, 0x0045}, + {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, + {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, {0x0015, 0x006d}, {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, + {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, + {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, + {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, {0x0016, 0x006a}, {0x0016, 0x006b}, {0x0016, 0x006c}, + {0x0016, 0x006d}, {0x0016, 0x006e}, {0x0016, 0x006f}, {0x0016, 0x0070}, {0x0016, 0x0071}, {0x0016, 0x0072}, {0x0016, 0x0073}, {0x0016, 0x0074}, + {0x0016, 0x0075}, {0x0016, 0x0076}, {0x0016, 0x0077}, {0x0016, 0x0078}, {0x0016, 0x0079}, {0x0016, 0x007a}, {0x0016, 0x007b}, {0x0016, 0x007c}, + {0x0016, 0x007d}, {0x0016, 0x007e}, {0x0016, 0x007f}, {0x0016, 0x0080}, {0x0016, 0x0081}, {0x0016, 0x0082}, {0x0016, 0x0083}, {0x0016, 0x0084}, + {0x0016, 0x0085}, {0x0016, 0x0086}, {0x0016, 0x0087}, {0x0016, 0x0088}, {0x0016, 0x0089}, {0x0016, 0x008a}, {0x0016, 0x008b}, {0x0016, 0x008c}, + {0x0016, 0x008d}, {0x0016, 0x008e}, {0x0016, 0x008f}, {0x0016, 0x0090}, {0x0016, 0x0091}, {0x0016, 0x0092}, {0x0016, 0x0093}, {0x0016, 0x0094}, + {0x0016, 0x0095}, {0x0016, 0x0096}, {0x0016, 0x0097}, {0x0016, 0x0098}, {0x0016, 0x0099}, {0x0016, 0x009a}, {0x0016, 0x009b}, {0x0016, 0x009c}, + {0x0016, 0x009d}, {0x0016, 0x009e}, {0x0016, 0x009f}, {0x0016, 0x00a0}, {0x0016, 0x00a1}, {0x0016, 0x00a2}, {0x0016, 0x00a3}, {0x0016, 0x00a4}, + {0x0016, 0x00a5}, {0x0016, 0x00a6}, {0x0016, 0x00a7}, {0x0016, 0x00a8}, {0x0016, 0x00a9}, {0x0016, 0x00aa}, {0x0016, 0x00ab}, {0x0016, 0x00ac}, + {0x0016, 0x00ad}, {0x0016, 0x00ae}, {0x0016, 0x00af}, {0x0016, 0x00b0}, {0x0016, 0x00b1}, {0x0016, 0x00b2}, {0x0016, 0x00b3}, {0x0016, 0x00b4}, + {0x0016, 0x00b5}, {0x0016, 0x00b6}, {0x0016, 0x00b7}, {0x0016, 0x00b8}, {0x0016, 0x00b9}, {0x0016, 0x00ba}, {0x0016, 0x00bb}, {0x0016, 0x00bc}, + {0x0016, 0x00bd}, {0x0016, 0x00be}, {0x0016, 0x00bf}, {0x0016, 0x00c0}, {0x0016, 0x00c1}, {0x0016, 0x00c2}, {0x0016, 0x00c3}, {0x0016, 0x00c4}, + {0x0016, 0x00c5}, + +}; + +const uint32_t c_aauiCQMFHuffDec12[76][16] = +{ + {0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x00000011, 0x00000012, 0x00000023, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x0006ffff, 0x0005ffff, 0x00000004, 0x00000015, 0x00000026, 0x00000036, 0x00000044, 0x00000046, 0x00010003, 0x00010003, 0x00010045, 0x00010045, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, }, + {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x000bffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000038, 0x00000048, 0x00000058, 0x00010005, 0x00010005, 0x00010027, 0x00010027, 0x00010055, 0x00010055, 0x00010057, 0x00010057, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, + {0x00010018, 0x00010018, 0x0001005a, 0x0001005a, 0x0001006a, 0x0001006a, 0x00010078, 0x00010078, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, + {0x0018ffff, 0x0029ffff, 0x003affff, 0x0010ffff, 0x0011ffff, 0x000fffff, 0x000cffff, 0x000dffff, 0x000effff, 0x00000007, 0x00000029, 0x0000003a, 0x0000004a, 0x00000077, 0x00000079, 0x0000007a, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, + {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, + {0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, + {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, }, + {0x004bffff, 0x0012ffff, 0x0015ffff, 0x0013ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x0000003c, 0x0000006d, 0x0000007d, 0x0000008d, 0x0000008e, 0x0000009a, 0x0000009b, 0x00010009, 0x00010009, }, + {0x0001001a, 0x0001001a, 0x0001004c, 0x0001004c, 0x0001005c, 0x0001005c, 0x0001006c, 0x0001006c, 0x0001007c, 0x0001007c, 0x00010088, 0x00010088, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, }, + {0x0002011f, 0x0002011f, 0x0002011f, 0x0002011f, 0x00020120, 0x00020120, 0x00020120, 0x00020120, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, + {0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, }, + {0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, }, + {0x0025ffff, 0x001fffff, 0x0019ffff, 0x0020ffff, 0x001effff, 0x0021ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, }, + {0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, + {0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, + {0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, }, + {0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, + {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, + {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, + {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, + {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, }, + {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, + {0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, + {0x00020085, 0x00020085, 0x00020085, 0x00020085, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, }, + {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, }, + {0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, }, + {0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, 0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, }, + {0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, + {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, + {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, + {0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, }, + {0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, }, + {0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, }, + {0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, }, + {0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200be, 0x000200be, 0x000200be, 0x000200be, }, + {0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, }, + {0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c6, 0x000200c6, 0x000200c6, 0x000200c6, }, + {0x000200c7, 0x000200c7, 0x000200c7, 0x000200c7, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200ca, 0x000200ca, 0x000200ca, 0x000200ca, }, + {0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cd, 0x000200cd, 0x000200cd, 0x000200cd, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, }, + {0x000200cf, 0x000200cf, 0x000200cf, 0x000200cf, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d2, 0x000200d2, 0x000200d2, 0x000200d2, }, + {0x000200d3, 0x000200d3, 0x000200d3, 0x000200d3, 0x000200d4, 0x000200d4, 0x000200d4, 0x000200d4, 0x000200d5, 0x000200d5, 0x000200d5, 0x000200d5, 0x000200d6, 0x000200d6, 0x000200d6, 0x000200d6, }, + {0x000200d7, 0x000200d7, 0x000200d7, 0x000200d7, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d9, 0x000200d9, 0x000200d9, 0x000200d9, 0x000200da, 0x000200da, 0x000200da, 0x000200da, }, + {0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, }, + {0x000200db, 0x000200db, 0x000200db, 0x000200db, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200de, 0x000200de, 0x000200de, 0x000200de, }, + {0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200e0, 0x000200e0, 0x000200e0, 0x000200e0, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e2, 0x000200e2, 0x000200e2, 0x000200e2, }, + {0x000200e3, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e6, 0x000200e6, 0x000200e6, 0x000200e6, }, + {0x000200e7, 0x000200e7, 0x000200e7, 0x000200e7, 0x000200e8, 0x000200e8, 0x000200e8, 0x000200e8, 0x000200e9, 0x000200e9, 0x000200e9, 0x000200e9, 0x000200ea, 0x000200ea, 0x000200ea, 0x000200ea, }, + {0x000200eb, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200ec, 0x000200ec, 0x000200ec, 0x000200ec, 0x000200ed, 0x000200ed, 0x000200ed, 0x000200ed, 0x000200ee, 0x000200ee, 0x000200ee, 0x000200ee, }, + {0x000200ef, 0x000200ef, 0x000200ef, 0x000200ef, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f1, 0x000200f1, 0x000200f1, 0x000200f1, 0x000200f2, 0x000200f2, 0x000200f2, 0x000200f2, }, + {0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f6, 0x000200f6, 0x000200f6, 0x000200f6, }, + {0x000200f7, 0x000200f7, 0x000200f7, 0x000200f7, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200fa, 0x000200fa, 0x000200fa, 0x000200fa, }, + {0x000200fb, 0x000200fb, 0x000200fb, 0x000200fb, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fe, 0x000200fe, 0x000200fe, 0x000200fe, }, + {0x000200ff, 0x000200ff, 0x000200ff, 0x000200ff, 0x00020100, 0x00020100, 0x00020100, 0x00020100, 0x00020101, 0x00020101, 0x00020101, 0x00020101, 0x00020102, 0x00020102, 0x00020102, 0x00020102, }, + {0x00020103, 0x00020103, 0x00020103, 0x00020103, 0x00020104, 0x00020104, 0x00020104, 0x00020104, 0x00020105, 0x00020105, 0x00020105, 0x00020105, 0x00020106, 0x00020106, 0x00020106, 0x00020106, }, + {0x00020107, 0x00020107, 0x00020107, 0x00020107, 0x00020108, 0x00020108, 0x00020108, 0x00020108, 0x00020109, 0x00020109, 0x00020109, 0x00020109, 0x0002010a, 0x0002010a, 0x0002010a, 0x0002010a, }, + {0x0002010b, 0x0002010b, 0x0002010b, 0x0002010b, 0x0002010c, 0x0002010c, 0x0002010c, 0x0002010c, 0x0002010d, 0x0002010d, 0x0002010d, 0x0002010d, 0x0002010e, 0x0002010e, 0x0002010e, 0x0002010e, }, + {0x0002010f, 0x0002010f, 0x0002010f, 0x0002010f, 0x00020110, 0x00020110, 0x00020110, 0x00020110, 0x00020111, 0x00020111, 0x00020111, 0x00020111, 0x00020112, 0x00020112, 0x00020112, 0x00020112, }, + {0x00020113, 0x00020113, 0x00020113, 0x00020113, 0x00020114, 0x00020114, 0x00020114, 0x00020114, 0x00020115, 0x00020115, 0x00020115, 0x00020115, 0x00020116, 0x00020116, 0x00020116, 0x00020116, }, + {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002011a, 0x0002011a, 0x0002011a, 0x0002011a, }, + {0x0002011b, 0x0002011b, 0x0002011b, 0x0002011b, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011e, 0x0002011e, 0x0002011e, 0x0002011e, }, +}; + +const uint32_t c_aauiCQMFHuffEnc13[324][2] = +{ + {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0006, 0x0004}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x0007}, + {0x000e, 0x000b}, {0x0010, 0x0011}, {0x0012, 0x002d}, {0x0015, 0x0000}, {0x0014, 0x0035}, {0x0015, 0x0001}, {0x0015, 0x0002}, {0x0015, 0x0003}, + {0x0015, 0x0004}, {0x0015, 0x0005}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0006, 0x0005}, {0x0008, 0x0006}, + {0x0009, 0x0006}, {0x000c, 0x0008}, {0x000d, 0x0009}, {0x0010, 0x0012}, {0x0011, 0x001a}, {0x0015, 0x0006}, {0x0015, 0x0007}, {0x0015, 0x0008}, + {0x0015, 0x0009}, {0x0015, 0x000a}, {0x0015, 0x000b}, {0x0015, 0x000c}, {0x0005, 0x0007}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x0008}, + {0x0006, 0x0006}, {0x0008, 0x0007}, {0x000a, 0x0006}, {0x000c, 0x0009}, {0x000e, 0x000c}, {0x0010, 0x0013}, {0x0012, 0x002e}, {0x0015, 0x000d}, + {0x0015, 0x000e}, {0x0015, 0x000f}, {0x0015, 0x0010}, {0x0015, 0x0011}, {0x0015, 0x0012}, {0x0015, 0x0013}, {0x0005, 0x0009}, {0x0004, 0x000d}, + {0x0005, 0x000a}, {0x0006, 0x0007}, {0x0007, 0x0005}, {0x0009, 0x0007}, {0x000b, 0x0008}, {0x000d, 0x000a}, {0x000f, 0x000e}, {0x0010, 0x0014}, + {0x0011, 0x001b}, {0x0014, 0x0036}, {0x0015, 0x0014}, {0x0015, 0x0015}, {0x0015, 0x0016}, {0x0015, 0x0017}, {0x0015, 0x0018}, {0x0015, 0x0019}, + {0x0006, 0x0008}, {0x0005, 0x000b}, {0x0006, 0x0009}, {0x0007, 0x0006}, {0x0009, 0x0008}, {0x000a, 0x0007}, {0x000c, 0x000a}, {0x000e, 0x000d}, + {0x0010, 0x0015}, {0x0011, 0x001c}, {0x0013, 0x0053}, {0x0015, 0x001a}, {0x0015, 0x001b}, {0x0015, 0x001c}, {0x0015, 0x001d}, {0x0015, 0x001e}, + {0x0015, 0x001f}, {0x0015, 0x0020}, {0x0008, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0009}, {0x0009, 0x0009}, {0x000a, 0x0008}, {0x000c, 0x000b}, + {0x000d, 0x000b}, {0x000f, 0x000f}, {0x0010, 0x0016}, {0x0011, 0x001d}, {0x0014, 0x0037}, {0x0015, 0x0021}, {0x0015, 0x0022}, {0x0015, 0x0023}, + {0x0015, 0x0024}, {0x0015, 0x0025}, {0x0015, 0x0026}, {0x0015, 0x0027}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000b, 0x0009}, + {0x000c, 0x000c}, {0x000d, 0x000c}, {0x000f, 0x0010}, {0x0010, 0x0017}, {0x0012, 0x002f}, {0x0015, 0x0028}, {0x0015, 0x0029}, {0x0015, 0x002a}, + {0x0015, 0x002b}, {0x0015, 0x002c}, {0x0015, 0x002d}, {0x0015, 0x002e}, {0x0015, 0x002f}, {0x0015, 0x0030}, {0x000c, 0x000d}, {0x000c, 0x000e}, + {0x000c, 0x000f}, {0x000d, 0x000d}, {0x000e, 0x000e}, {0x000f, 0x0011}, {0x0010, 0x0018}, {0x0011, 0x001e}, {0x0014, 0x0038}, {0x0015, 0x0031}, + {0x0015, 0x0032}, {0x0015, 0x0033}, {0x0015, 0x0034}, {0x0015, 0x0035}, {0x0015, 0x0036}, {0x0015, 0x0037}, {0x0015, 0x0038}, {0x0015, 0x0039}, + {0x000f, 0x0012}, {0x000e, 0x000f}, {0x000e, 0x0010}, {0x000e, 0x0011}, {0x000f, 0x0013}, {0x0010, 0x0019}, {0x0011, 0x001f}, {0x0013, 0x0054}, + {0x0015, 0x003a}, {0x0014, 0x0039}, {0x0015, 0x003b}, {0x0015, 0x003c}, {0x0015, 0x003d}, {0x0015, 0x003e}, {0x0015, 0x003f}, {0x0015, 0x0040}, + {0x0015, 0x0041}, {0x0015, 0x0042}, {0x0010, 0x001a}, {0x000f, 0x0014}, {0x000f, 0x0015}, {0x0010, 0x001b}, {0x0011, 0x0020}, {0x0012, 0x0030}, + {0x0013, 0x0055}, {0x0015, 0x0043}, {0x0015, 0x0044}, {0x0014, 0x003a}, {0x0015, 0x0045}, {0x0015, 0x0046}, {0x0015, 0x0047}, {0x0015, 0x0048}, + {0x0015, 0x0049}, {0x0015, 0x004a}, {0x0015, 0x004b}, {0x0015, 0x004c}, {0x0012, 0x0031}, {0x0011, 0x0021}, {0x0013, 0x0056}, {0x0013, 0x0057}, + {0x0012, 0x0032}, {0x0015, 0x004d}, {0x0015, 0x004e}, {0x0015, 0x004f}, {0x0015, 0x0050}, {0x0015, 0x0051}, {0x0015, 0x0052}, {0x0015, 0x0053}, + {0x0015, 0x0054}, {0x0015, 0x0055}, {0x0015, 0x0056}, {0x0015, 0x0057}, {0x0015, 0x0058}, {0x0015, 0x0059}, {0x0015, 0x005a}, {0x0014, 0x003b}, + {0x0012, 0x0033}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0015, 0x005b}, {0x0015, 0x005c}, {0x0015, 0x005d}, {0x0015, 0x005e}, {0x0015, 0x005f}, + {0x0015, 0x0060}, {0x0015, 0x0061}, {0x0015, 0x0062}, {0x0015, 0x0063}, {0x0015, 0x0064}, {0x0015, 0x0065}, {0x0015, 0x0066}, {0x0015, 0x0067}, + {0x0015, 0x0068}, {0x0015, 0x0069}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, + {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, + {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, + {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, + {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, + {0x0014, 0x0062}, {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, + {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, + {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, + {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, + {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, + {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, + {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, + {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, + {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, + +}; + +const uint32_t c_aauiCQMFHuffDec13[89][16] = +{ + {0x0006ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000001, 0x00000012, 0x00000014, 0x00000015, 0x00000025, 0x00000026, 0x00000037, 0x00010013, 0x00010013, }, + {0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x000bffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000005, 0x00000017, 0x00000029, 0x0000005a, 0x0000005c, 0x0001003a, 0x0001003a, 0x0001004b, 0x0001004b, 0x0001005b, 0x0001005b, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, + {0x0001003c, 0x0001003c, 0x0001006f, 0x0001006f, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, }, + {0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, + {0x0012ffff, 0x0011ffff, 0x0010ffff, 0x000fffff, 0x000dffff, 0x000cffff, 0x000effff, 0x00000007, 0x00000019, 0x0000002b, 0x0000004e, 0x0000005f, 0x00000070, 0x0000007e, 0x0000007f, 0x00000080, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, + {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, + {0x00010072, 0x00010072, 0x00010083, 0x00010083, 0x00010090, 0x00010090, 0x00010094, 0x00010094, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, + {0x0016ffff, 0x00000009, 0x0000001b, 0x0000002d, 0x0000003f, 0x00000050, 0x00000062, 0x00000073, 0x00000084, 0x00000095, 0x000000a2, 0x000000a5, 0x0001003e, 0x0001003e, 0x00010061, 0x00010061, }, + {0x0021ffff, 0x0024ffff, 0x003dffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0019ffff, 0x0017ffff, 0x0018ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, }, + {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, + {0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, + {0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, }, + {0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, + {0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, }, + {0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00010052, 0x00010052, 0x00010097, 0x00010097, 0x000100a8, 0x000100a8, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, }, + {0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0000000c, 0x00000041, 0x00000064, 0x00000086, 0x00000099, 0x000000ab, 0x000000c7, 0x000000da, 0x000000db, 0x000000dc, 0x000000dd, }, + {0x000000de, 0x000000df, 0x000000e0, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, }, + {0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, }, + {0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, }, + {0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, }, + {0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, 0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, }, + {0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, }, + {0x0026ffff, 0x002dffff, 0x0037ffff, 0x0023ffff, 0x0044ffff, 0x002effff, 0x003affff, 0x0022ffff, 0x002cffff, 0x0035ffff, 0x002fffff, 0x0036ffff, 0x0040ffff, 0x0049ffff, 0x0030ffff, 0x0038ffff, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0041ffff, 0x004affff, 0x0042ffff, 0x0025ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0039ffff, 0x003bffff, 0x003cffff, }, + {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, }, + {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, + {0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, }, + {0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, }, + {0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, + {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, + {0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, }, + {0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, }, + {0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, }, + {0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, + {0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, }, + {0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, }, + {0x003effff, 0x003fffff, 0x0043ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, }, + {0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, }, + {0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, + {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, + {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, + {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, }, + {0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, }, + {0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, }, + {0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, }, + {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, + {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, + {0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, }, + {0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, }, + {0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, }, + {0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, }, + {0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, }, + {0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, }, + {0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, }, + {0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, }, + {0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, }, + {0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, }, + {0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, }, + {0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, }, + {0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, }, + {0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, +}; + +const uint32_t c_aauiCQMFHuffEnc14[400][2] = +{ + {0x0005, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x0008}, + {0x000d, 0x000c}, {0x000f, 0x0013}, {0x0010, 0x001b}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, + {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x000a}, + {0x0005, 0x000b}, {0x0006, 0x0007}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000a}, {0x000e, 0x000e}, {0x000f, 0x0014}, {0x0011, 0x002a}, + {0x0012, 0x004a}, {0x0013, 0x0084}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, + {0x0005, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x000d}, {0x0006, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0007}, {0x000a, 0x0008}, + {0x000c, 0x000b}, {0x000e, 0x000f}, {0x000f, 0x0015}, {0x0012, 0x004b}, {0x0013, 0x0085}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, + {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0005, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x000f}, {0x0005, 0x0010}, + {0x0006, 0x0009}, {0x0008, 0x0008}, {0x0009, 0x0008}, {0x000b, 0x0009}, {0x000d, 0x000d}, {0x000e, 0x0010}, {0x0010, 0x001c}, {0x0011, 0x002b}, + {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, + {0x0006, 0x000a}, {0x0005, 0x0011}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x000a, 0x0009}, {0x000c, 0x000c}, + {0x000e, 0x0011}, {0x000f, 0x0016}, {0x0010, 0x001d}, {0x0012, 0x004c}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, + {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0007, 0x0009}, {0x0006, 0x000d}, {0x0007, 0x000a}, {0x0007, 0x000b}, + {0x0009, 0x0009}, {0x000a, 0x000a}, {0x000b, 0x000a}, {0x000d, 0x000e}, {0x000f, 0x0017}, {0x0011, 0x002c}, {0x0010, 0x001e}, {0x0014, 0x0024}, + {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, + {0x0009, 0x000a}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000b}, {0x000d, 0x000f}, {0x000e, 0x0012}, + {0x000f, 0x0018}, {0x0011, 0x002d}, {0x0011, 0x002e}, {0x0013, 0x0086}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, + {0x0014, 0x0031}, {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x000b, 0x000c}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x000d}, + {0x000c, 0x000d}, {0x000d, 0x0010}, {0x000e, 0x0013}, {0x000f, 0x0019}, {0x0010, 0x001f}, {0x0013, 0x0087}, {0x0014, 0x0035}, {0x0014, 0x0036}, + {0x0013, 0x0088}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, + {0x000d, 0x0011}, {0x000c, 0x000e}, {0x000c, 0x000f}, {0x000d, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0014}, {0x0010, 0x0020}, {0x0010, 0x0021}, + {0x0012, 0x004d}, {0x0011, 0x002f}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, + {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x000f, 0x001a}, {0x000e, 0x0015}, {0x000e, 0x0016}, {0x000e, 0x0017}, + {0x000f, 0x001b}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0014, 0x0048}, {0x0014, 0x0049}, + {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, + {0x0010, 0x0022}, {0x0010, 0x0023}, {0x0010, 0x0024}, {0x0010, 0x0025}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0012, 0x004e}, {0x0012, 0x004f}, + {0x0014, 0x0052}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, + {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0011, 0x0034}, {0x0011, 0x0035}, {0x0012, 0x0050}, {0x0012, 0x0051}, + {0x0013, 0x008e}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, + {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, + {0x0012, 0x0052}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0014, 0x006b}, {0x0013, 0x0091}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, + {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, + {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0013, 0x0092}, {0x0012, 0x0053}, + {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, + {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, + {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0013, 0x0093}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, + {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, + {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, + {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, + {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, + {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, + {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, + {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, + {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, + {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, + {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, + {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, + {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, + {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, + {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, +}; + +const uint32_t c_aauiCQMFHuffDec14[53][16] = +{ + {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x00000001, 0x00000014, 0x00000015, 0x00000016, 0x00000029, 0x0000002a, 0x0000003d, }, + {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, + {0x00010054, 0x00010054, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, + {0x000fffff, 0x000dffff, 0x000effff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000001a, 0x0000002e, 0x00000041, 0x00000055, 0x00000079, 0x0000007a, 0x00010005, 0x00010005, 0x0001002d, 0x0001002d, }, + {0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, + {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, + {0x00010007, 0x00010007, 0x00010043, 0x00010043, 0x0001006a, 0x0001006a, 0x0001007d, 0x0001007d, 0x0001008c, 0x0001008c, 0x0001008f, 0x0001008f, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, }, + {0x0024ffff, 0x0018ffff, 0x0017ffff, 0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000001c, 0x00000030, 0x00000057, 0x00000090, 0x000000a1, 0x000000a2, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, + {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, }, + {0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, }, + {0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, }, + {0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020092, 0x00020092, 0x00020092, 0x00020092, }, + {0x00010080, 0x00010080, 0x00010093, 0x00010093, 0x000100b4, 0x000100b4, 0x000100b8, 0x000100b8, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x00020031, 0x00020031, 0x00020031, 0x00020031, }, + {0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, }, + {0x000000a6, 0x000000a7, 0x000000c8, 0x000000c9, 0x000000ca, 0x000000cb, 0x00010009, 0x00010009, 0x0001001e, 0x0001001e, 0x00010032, 0x00010032, 0x00010059, 0x00010059, 0x0001006c, 0x0001006c, }, + {0x0022ffff, 0x0023ffff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x0000000a, 0x00000046, 0x0000005a, 0x0000006e, 0x00000094, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, + {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, + {0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, }, + {0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, }, + {0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, }, + {0x000100f2, 0x000100f2, 0x000100f4, 0x000100f4, 0x00010106, 0x00010106, 0x0001011a, 0x0001011a, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, + {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200cf, 0x000200cf, 0x000200cf, 0x000200cf, }, + {0x000200de, 0x000200de, 0x000200de, 0x000200de, 0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x00020107, 0x00020107, 0x00020107, 0x00020107, }, + {0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x00010021, 0x00010021, 0x00010034, 0x00010034, 0x00010083, 0x00010083, 0x00010095, 0x00010095, }, + {0x00010098, 0x00010098, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100e0, 0x000100e0, 0x000100f1, 0x000100f1, }, + {0x0025ffff, 0x0026ffff, 0x0028ffff, 0x0027ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, }, + {0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000035, 0x00000036, 0x00000037, }, + {0x00000038, 0x00000039, 0x0000003a, 0x0000003b, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, }, + {0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x00000096, 0x00000097, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000aa, 0x000000ab, }, + {0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000084, 0x00000085, 0x00000086, }, + {0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, }, + {0x000000c6, 0x000000c7, 0x000000d0, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, 0x000000d9, 0x000000da, 0x000000db, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, }, + {0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f3, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, }, + {0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000108, 0x00000109, 0x0000010a, }, + {0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011b, }, + {0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, 0x0000012a, 0x0000012b, }, + {0x0000012c, 0x0000012d, 0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, }, + {0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, 0x0000014a, 0x0000014b, }, + {0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, }, + {0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, 0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, 0x0000016a, 0x0000016b, }, + {0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, }, + {0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, }, +}; + +const uint32_t c_aauiCQMFHuffEnc15[576][2] = +{ + {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0008}, + {0x000b, 0x000b}, {0x000d, 0x000e}, {0x000e, 0x0011}, {0x000f, 0x001a}, {0x0012, 0x006e}, {0x0014, 0x0000}, {0x0013, 0x00cc}, {0x0014, 0x0001}, + {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, + {0x0005, 0x000d}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x000b}, {0x0007, 0x0009}, {0x0008, 0x000a}, + {0x000a, 0x000a}, {0x000c, 0x000c}, {0x000d, 0x000f}, {0x000f, 0x001b}, {0x0011, 0x003d}, {0x0011, 0x003e}, {0x0013, 0x00cd}, {0x0014, 0x000a}, + {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, + {0x0005, 0x0010}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0006, 0x000c}, {0x0007, 0x000a}, {0x0009, 0x0009}, + {0x000a, 0x000b}, {0x000c, 0x000d}, {0x000e, 0x0012}, {0x0010, 0x0027}, {0x0011, 0x003f}, {0x0012, 0x006f}, {0x0014, 0x0013}, {0x0014, 0x0014}, + {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, + {0x0006, 0x000d}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0006, 0x000e}, {0x0007, 0x000b}, {0x0008, 0x000b}, {0x0009, 0x000a}, + {0x000b, 0x000c}, {0x000c, 0x000e}, {0x000e, 0x0013}, {0x000f, 0x001c}, {0x0011, 0x0040}, {0x0012, 0x0070}, {0x0014, 0x001d}, {0x0014, 0x001e}, + {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, + {0x0006, 0x000f}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0007, 0x000c}, {0x0009, 0x000b}, {0x000a, 0x000c}, + {0x000b, 0x000d}, {0x000d, 0x0010}, {0x000e, 0x0014}, {0x0010, 0x0028}, {0x0011, 0x0041}, {0x0013, 0x00ce}, {0x0014, 0x0027}, {0x0014, 0x0028}, + {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, + {0x0007, 0x000d}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x000c}, {0x0009, 0x000c}, {0x000b, 0x000e}, + {0x000c, 0x000f}, {0x000e, 0x0015}, {0x0010, 0x0029}, {0x0011, 0x0042}, {0x0014, 0x0031}, {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, + {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, + {0x0008, 0x000d}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000e}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x000b, 0x000f}, {0x000c, 0x0010}, + {0x000d, 0x0011}, {0x000f, 0x001d}, {0x0010, 0x002a}, {0x0011, 0x0043}, {0x0014, 0x003d}, {0x0013, 0x00cf}, {0x0014, 0x003e}, {0x0014, 0x003f}, + {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, + {0x0009, 0x000f}, {0x0008, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x000d}, {0x000b, 0x0010}, {0x000c, 0x0011}, {0x000d, 0x0012}, + {0x000e, 0x0016}, {0x0010, 0x002b}, {0x0011, 0x0044}, {0x0012, 0x0071}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, + {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, + {0x000b, 0x0011}, {0x000a, 0x000e}, {0x000a, 0x000f}, {0x000b, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0017}, + {0x0010, 0x002c}, {0x0012, 0x0072}, {0x0011, 0x0045}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, + {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, + {0x000c, 0x0013}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000e, 0x0018}, {0x000f, 0x001e}, {0x0010, 0x002d}, + {0x0011, 0x0046}, {0x0011, 0x0047}, {0x0011, 0x0048}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, + {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, + {0x000e, 0x0019}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000e, 0x001a}, {0x000e, 0x001b}, {0x000f, 0x001f}, {0x0010, 0x002e}, {0x0011, 0x0049}, + {0x0012, 0x0073}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, + {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, + {0x0010, 0x002f}, {0x000f, 0x0020}, {0x0010, 0x0030}, {0x000f, 0x0021}, {0x0010, 0x0031}, {0x0011, 0x004a}, {0x0011, 0x004b}, {0x0012, 0x0074}, + {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0013, 0x00d2}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, + {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, + {0x0012, 0x0075}, {0x0010, 0x0032}, {0x0010, 0x0033}, {0x0011, 0x004c}, {0x0011, 0x004d}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0012, 0x0076}, + {0x0013, 0x00d5}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, + {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, + {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0012, 0x0077}, {0x0012, 0x0078}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0013, 0x00d8}, {0x0014, 0x009b}, + {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, + {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, + {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0012, 0x0079}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, + {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, + {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, + {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, + {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, + {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, + {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, + {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, + {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, + {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, + {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, + {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, + {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, + {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, + {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, + {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, + {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, + {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, + {0x0014, 0x0139}, {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, + {0x0014, 0x0141}, {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, + {0x0014, 0x0149}, {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, + {0x0014, 0x0151}, {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, + {0x0014, 0x0159}, {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, + {0x0014, 0x0161}, {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, + {0x0014, 0x0169}, {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, + {0x0014, 0x0171}, {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, + {0x0014, 0x0179}, {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, + {0x0014, 0x0181}, {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, + {0x0014, 0x0189}, {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, + {0x0014, 0x0191}, {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0013, 0x00db}, +}; + +const uint32_t c_aauiCQMFHuffDec15[73][16] = +{ + {0x000cffff, 0x000bffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000019, 0x0000001a, 0x00000031, 0x00000032, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, + {0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, }, + {0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020060, 0x00020060, 0x00020060, 0x00020060, }, + {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, + {0x00010005, 0x00010005, 0x0001001e, 0x0001001e, 0x00010036, 0x00010036, 0x0001004d, 0x0001004d, 0x00010065, 0x00010065, 0x00010078, 0x00010078, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, }, + {0x0015ffff, 0x0014ffff, 0x0012ffff, 0x0013ffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x00000006, 0x0000001f, 0x0000004e, 0x0000007d, 0x00000090, 0x00000093, 0x000000a9, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, }, + {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, }, + {0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, + {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, }, + {0x000100ad, 0x000100ad, 0x000100c0, 0x000100c0, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020038, 0x00020038, 0x00020038, 0x00020038, }, + {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, }, + {0x00000097, 0x000000ae, 0x000000c5, 0x000000d8, 0x000000d9, 0x000000da, 0x00010008, 0x00010008, 0x00010050, 0x00010050, 0x00010068, 0x00010068, 0x0001007f, 0x0001007f, 0x00010096, 0x00010096, }, + {0x002fffff, 0x0020ffff, 0x001fffff, 0x001effff, 0x001bffff, 0x001cffff, 0x001dffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000021, 0x00000039, 0x00000051, 0x00000080, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, + {0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, }, + {0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, }, + {0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, }, + {0x00010109, 0x00010109, 0x0001010b, 0x0001010b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, + {0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200c7, 0x000200c7, 0x000200c7, 0x000200c7, }, + {0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, }, + {0x0000010a, 0x0000010c, 0x00000121, 0x00000122, 0x0001000b, 0x0001000b, 0x00010023, 0x00010023, 0x00010053, 0x00010053, 0x00010099, 0x00010099, 0x000100de, 0x000100de, 0x000100f5, 0x000100f5, }, + {0x0024ffff, 0x0022ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x0000003b, 0x0000006b, 0x00000082, 0x0000009a, 0x000000b1, 0x000000c8, 0x000000df, 0x000000f6, 0x00000108, }, + {0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x002dffff, 0x002effff, 0x002affff, 0x002bffff, 0x002cffff, 0x0021ffff, 0x0023ffff, }, + {0x0002013b, 0x0002013b, 0x0002013b, 0x0002013b, 0x00020154, 0x00020154, 0x00020154, 0x00020154, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, }, + {0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, }, + {0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, }, + {0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, }, + {0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, }, + {0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, }, + {0x0001013e, 0x0001013e, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001023f, 0x0001023f, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, + {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, }, + {0x0002010f, 0x0002010f, 0x0002010f, 0x0002010f, 0x00020120, 0x00020120, 0x00020120, 0x00020120, 0x00020127, 0x00020127, 0x00020127, 0x00020127, 0x0002013a, 0x0002013a, 0x0002013a, 0x0002013a, }, + {0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, 0x0000023e, 0x0001000e, 0x0001000e, 0x00010026, 0x00010026, 0x0001006d, 0x0001006d, 0x0001009d, 0x0001009d, }, + {0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x00010112, 0x00010112, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010128, 0x00010128, 0x00010138, 0x00010138, 0x00010139, 0x00010139, }, + {0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, }, + {0x0000000d, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, }, + {0x0000002d, 0x0000002e, 0x0000002f, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000056, 0x00000057, 0x00000058, }, + {0x00000059, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, }, + {0x00000077, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x0000008f, 0x0000009c, 0x0000009e, 0x0000009f, }, + {0x000000a0, 0x000000a1, 0x000000a2, 0x000000a3, 0x000000a4, 0x000000a5, 0x000000a6, 0x000000a7, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, 0x000000ba, 0x000000bb, }, + {0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000e3, }, + {0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, }, + {0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000110, 0x00000111, 0x00000113, 0x00000114, 0x00000115, }, + {0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000129, 0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, 0x0000012e, }, + {0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x0000013c, 0x0000013d, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, }, + {0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, 0x0000014a, 0x0000014b, 0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, }, + {0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, }, + {0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, 0x0000016a, 0x0000016b, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, }, + {0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, 0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, }, + {0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00000190, 0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x00000195, 0x00000196, }, + {0x00000197, 0x00000198, 0x00000199, 0x0000019a, 0x0000019b, 0x0000019c, 0x0000019d, 0x0000019e, 0x0000019f, 0x000001a0, 0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, }, + {0x000001a7, 0x000001a8, 0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b0, 0x000001b1, 0x000001b2, 0x000001b3, 0x000001b4, 0x000001b5, 0x000001b6, }, + {0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, 0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, 0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, }, + {0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cc, 0x000001cd, 0x000001ce, 0x000001cf, 0x000001d0, 0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, }, + {0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, 0x000001de, 0x000001df, 0x000001e0, 0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, }, + {0x000001e7, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, 0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, 0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, }, + {0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, 0x000001fe, 0x000001ff, 0x00000200, 0x00000201, 0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, }, + {0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, 0x0000020e, 0x0000020f, 0x00000210, 0x00000211, 0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, }, + {0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, }, + {0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, }, +}; + +const uint32_t c_aauiCQMFHuffEnc16[729][2] = +{ + {0x0006, 0x000d}, {0x0005, 0x0010}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x000a}, + {0x0009, 0x000b}, {0x000b, 0x000d}, {0x000c, 0x000e}, {0x000e, 0x0016}, {0x0010, 0x002d}, {0x0011, 0x0051}, {0x0012, 0x008c}, {0x0014, 0x0000}, + {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, + {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0005, 0x0011}, {0x0004, 0x000f}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, + {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0007, 0x000c}, {0x0008, 0x000b}, {0x000a, 0x000c}, {0x000b, 0x000e}, {0x000d, 0x0010}, {0x000e, 0x0017}, + {0x000f, 0x001c}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, + {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0006, 0x0013}, {0x0005, 0x0015}, + {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0006, 0x0014}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0009, 0x000c}, {0x000a, 0x000d}, + {0x000c, 0x000f}, {0x000d, 0x0011}, {0x000f, 0x001d}, {0x0011, 0x0052}, {0x0012, 0x008d}, {0x0012, 0x008e}, {0x0014, 0x0017}, {0x0014, 0x0018}, + {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, + {0x0014, 0x0021}, {0x0006, 0x0015}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0007, 0x000f}, + {0x0008, 0x000c}, {0x0009, 0x000d}, {0x000b, 0x000f}, {0x000c, 0x0010}, {0x000d, 0x0012}, {0x000f, 0x001e}, {0x0012, 0x008f}, {0x0014, 0x0022}, + {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, + {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0006, 0x0018}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0006, 0x0019}, + {0x0006, 0x001a}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000d}, {0x000a, 0x000e}, {0x000b, 0x0010}, {0x000c, 0x0011}, {0x000e, 0x0018}, + {0x0010, 0x002e}, {0x0012, 0x0090}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, + {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0007, 0x0012}, + {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0008, 0x000e}, {0x0009, 0x000e}, {0x000b, 0x0011}, + {0x000c, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0019}, {0x0010, 0x002f}, {0x0012, 0x0091}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, + {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, + {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0007, 0x0015}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0007, 0x0016}, {0x0007, 0x0017}, {0x0008, 0x000f}, + {0x0009, 0x000f}, {0x000a, 0x000f}, {0x000b, 0x0012}, {0x000d, 0x0014}, {0x000e, 0x001a}, {0x000f, 0x001f}, {0x0013, 0x010f}, {0x0011, 0x0053}, + {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, + {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0008, 0x0010}, {0x0007, 0x0018}, {0x0007, 0x0019}, + {0x0008, 0x0011}, {0x0008, 0x0012}, {0x0009, 0x0010}, {0x000a, 0x0010}, {0x000b, 0x0013}, {0x000c, 0x0013}, {0x000e, 0x001b}, {0x000f, 0x0020}, + {0x0010, 0x0030}, {0x0012, 0x0092}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, + {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, + {0x0009, 0x0011}, {0x0008, 0x0013}, {0x0009, 0x0012}, {0x0009, 0x0013}, {0x000a, 0x0011}, {0x000a, 0x0012}, {0x000b, 0x0014}, {0x000c, 0x0014}, + {0x000d, 0x0015}, {0x000e, 0x001c}, {0x000f, 0x0021}, {0x0013, 0x0110}, {0x0012, 0x0093}, {0x0012, 0x0094}, {0x0014, 0x0062}, {0x0014, 0x0063}, + {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, + {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x000b, 0x0015}, {0x000a, 0x0013}, {0x000a, 0x0014}, {0x000a, 0x0015}, {0x000b, 0x0016}, + {0x000c, 0x0015}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000f, 0x0022}, {0x0010, 0x0031}, {0x0012, 0x0095}, {0x0012, 0x0096}, {0x0014, 0x006f}, + {0x0013, 0x0111}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, + {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x000c, 0x0016}, {0x000b, 0x0017}, + {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000d, 0x0018}, {0x000e, 0x001d}, {0x000f, 0x0023}, {0x000f, 0x0024}, {0x0011, 0x0054}, + {0x0012, 0x0097}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, + {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, + {0x0014, 0x008c}, {0x000e, 0x001e}, {0x000d, 0x0019}, {0x000d, 0x001a}, {0x000d, 0x001b}, {0x000e, 0x001f}, {0x000f, 0x0025}, {0x000f, 0x0026}, + {0x0010, 0x0032}, {0x0010, 0x0033}, {0x0012, 0x0098}, {0x0013, 0x0112}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, + {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, + {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x000f, 0x0027}, {0x000f, 0x0028}, {0x000f, 0x0029}, {0x000f, 0x002a}, + {0x0010, 0x0034}, {0x000f, 0x002b}, {0x0011, 0x0055}, {0x0012, 0x0099}, {0x0012, 0x009a}, {0x0012, 0x009b}, {0x0014, 0x009d}, {0x0013, 0x0113}, + {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, + {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0011, 0x0056}, + {0x0010, 0x0035}, {0x0010, 0x0036}, {0x0010, 0x0037}, {0x0011, 0x0057}, {0x0012, 0x009c}, {0x0012, 0x009d}, {0x0012, 0x009e}, {0x0014, 0x00ad}, + {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, + {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, + {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0012, 0x009f}, {0x0011, 0x0058}, {0x0012, 0x00a0}, {0x0014, 0x00c0}, {0x0011, 0x0059}, {0x0013, 0x0114}, + {0x0012, 0x00a1}, {0x0014, 0x00c1}, {0x0013, 0x0115}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, + {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, + {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, + {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, + {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, + {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, + {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, + {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, + {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, + {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, + {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, + {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, + {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0013, 0x0116}, + {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, + {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, + {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, {0x0014, 0x0139}, {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, + {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, {0x0014, 0x0141}, {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, + {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, {0x0014, 0x0149}, {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, + {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, {0x0014, 0x0151}, {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, + {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, {0x0014, 0x0159}, {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, + {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, {0x0014, 0x0161}, {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, + {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, {0x0014, 0x0169}, {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, + {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, {0x0014, 0x0171}, {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, + {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, {0x0014, 0x0179}, {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, + {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, {0x0014, 0x0181}, {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, + {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, {0x0014, 0x0189}, {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, + {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, {0x0014, 0x0191}, {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, + {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0014, 0x0198}, {0x0014, 0x0199}, {0x0014, 0x019a}, {0x0014, 0x019b}, {0x0014, 0x019c}, {0x0014, 0x019d}, + {0x0014, 0x019e}, {0x0014, 0x019f}, {0x0014, 0x01a0}, {0x0014, 0x01a1}, {0x0014, 0x01a2}, {0x0014, 0x01a3}, {0x0014, 0x01a4}, {0x0014, 0x01a5}, + {0x0014, 0x01a6}, {0x0014, 0x01a7}, {0x0014, 0x01a8}, {0x0014, 0x01a9}, {0x0014, 0x01aa}, {0x0014, 0x01ab}, {0x0014, 0x01ac}, {0x0014, 0x01ad}, + {0x0014, 0x01ae}, {0x0014, 0x01af}, {0x0014, 0x01b0}, {0x0014, 0x01b1}, {0x0014, 0x01b2}, {0x0014, 0x01b3}, {0x0014, 0x01b4}, {0x0014, 0x01b5}, + {0x0014, 0x01b6}, {0x0014, 0x01b7}, {0x0014, 0x01b8}, {0x0014, 0x01b9}, {0x0014, 0x01ba}, {0x0014, 0x01bb}, {0x0014, 0x01bc}, {0x0014, 0x01bd}, + {0x0014, 0x01be}, {0x0014, 0x01bf}, {0x0014, 0x01c0}, {0x0014, 0x01c1}, {0x0014, 0x01c2}, {0x0014, 0x01c3}, {0x0014, 0x01c4}, {0x0014, 0x01c5}, + {0x0014, 0x01c6}, {0x0014, 0x01c7}, {0x0014, 0x01c8}, {0x0014, 0x01c9}, {0x0014, 0x01ca}, {0x0014, 0x01cb}, {0x0014, 0x01cc}, {0x0014, 0x01cd}, + {0x0014, 0x01ce}, {0x0014, 0x01cf}, {0x0014, 0x01d0}, {0x0014, 0x01d1}, {0x0014, 0x01d2}, {0x0014, 0x01d3}, {0x0014, 0x01d4}, {0x0014, 0x01d5}, + {0x0014, 0x01d6}, {0x0014, 0x01d7}, {0x0014, 0x01d8}, {0x0014, 0x01d9}, {0x0014, 0x01da}, {0x0014, 0x01db}, {0x0014, 0x01dc}, {0x0014, 0x01dd}, + {0x0014, 0x01de}, {0x0014, 0x01df}, {0x0014, 0x01e0}, {0x0014, 0x01e1}, {0x0014, 0x01e2}, {0x0014, 0x01e3}, {0x0014, 0x01e4}, {0x0014, 0x01e5}, + {0x0014, 0x01e6}, {0x0014, 0x01e7}, {0x0014, 0x01e8}, {0x0014, 0x01e9}, {0x0014, 0x01ea}, {0x0014, 0x01eb}, {0x0014, 0x01ec}, {0x0014, 0x01ed}, + {0x0014, 0x01ee}, {0x0014, 0x01ef}, {0x0014, 0x01f0}, {0x0014, 0x01f1}, {0x0014, 0x01f2}, {0x0014, 0x01f3}, {0x0014, 0x01f4}, {0x0014, 0x01f5}, + {0x0014, 0x01f6}, {0x0014, 0x01f7}, {0x0014, 0x01f8}, {0x0014, 0x01f9}, {0x0014, 0x01fa}, {0x0014, 0x01fb}, {0x0014, 0x01fc}, {0x0014, 0x01fd}, + {0x0014, 0x01fe}, {0x0014, 0x01ff}, {0x0014, 0x0200}, {0x0014, 0x0201}, {0x0014, 0x0202}, {0x0014, 0x0203}, {0x0014, 0x0204}, {0x0014, 0x0205}, + {0x0014, 0x0206}, {0x0014, 0x0207}, {0x0014, 0x0208}, {0x0014, 0x0209}, {0x0014, 0x020a}, {0x0014, 0x020b}, {0x0014, 0x020c}, {0x0014, 0x020d}, + {0x0014, 0x020e}, {0x0014, 0x020f}, {0x0014, 0x0210}, {0x0014, 0x0211}, {0x0014, 0x0212}, {0x0014, 0x0213}, {0x0014, 0x0214}, {0x0014, 0x0215}, + {0x0013, 0x0117}, + +}; + +const uint32_t c_aauiCQMFHuffDec16[85][16] = +{ + {0x000fffff, 0x000dffff, 0x000effff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0000001c, }, + {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, + {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, + {0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, }, + {0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, }, + {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, + {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020088, 0x00020088, 0x00020088, 0x00020088, }, + {0x00020089, 0x00020089, 0x00020089, 0x00020089, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, }, + {0x000000bd, 0x000000c0, 0x000000c1, 0x000000d9, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010022, 0x00010022, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x00010057, 0x00010057, }, + {0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010087, 0x00010087, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x000100a2, 0x000100a2, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, }, + {0x0019ffff, 0x0017ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0012ffff, 0x0010ffff, 0x0011ffff, 0x0013ffff, 0x0014ffff, 0x00000007, 0x00000023, 0x00000058, 0x00000073, 0x0000008d, 0x000000a7, }, + {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, }, + {0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, + {0x000200f5, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f6, 0x000200f6, 0x000200f6, 0x000200f6, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, }, + {0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, + {0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, }, + {0x0000005b, 0x00000076, 0x00000090, 0x000000c5, 0x000000df, 0x000000f8, 0x0000010e, 0x00000110, 0x00000111, 0x00000112, 0x00010009, 0x00010009, 0x00010025, 0x00010025, 0x0001005a, 0x0001005a, }, + {0x00010075, 0x00010075, 0x0001008f, 0x0001008f, 0x000100aa, 0x000100aa, 0x000100c4, 0x000100c4, 0x000100de, 0x000100de, 0x000100f3, 0x000100f3, 0x000100f7, 0x000100f7, 0x0001010f, 0x0001010f, }, + {0x0032ffff, 0x0043ffff, 0x0025ffff, 0x0023ffff, 0x0024ffff, 0x0021ffff, 0x0020ffff, 0x0022ffff, 0x001cffff, 0x001affff, 0x001bffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0000000a, 0x00000040, }, + {0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, + {0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, }, + {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, + {0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, }, + {0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, }, + {0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, }, + {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c6, 0x000200c6, 0x000200c6, 0x000200c6, }, + {0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010149, 0x00010149, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, + {0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x00020114, 0x00020114, 0x00020114, 0x00020114, 0x00020129, 0x00020129, 0x00020129, 0x00020129, 0x0002012d, 0x0002012d, 0x0002012d, 0x0002012d, }, + {0x000000c8, 0x000000fc, 0x00000130, 0x00000131, 0x00000148, 0x00000160, 0x00000161, 0x00000162, 0x00010028, 0x00010028, 0x00010042, 0x00010042, 0x0001005d, 0x0001005d, 0x000100ad, 0x000100ad, }, + {0x000100c7, 0x000100c7, 0x000100e2, 0x000100e2, 0x000100fb, 0x000100fb, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010144, 0x00010144, }, + {0x0054ffff, 0x0031ffff, 0x0030ffff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0027ffff, 0x0026ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0000000c, 0x00000078, 0x00000093, }, + {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, }, + {0x0002017c, 0x0002017c, 0x0002017c, 0x0002017c, 0x00020180, 0x00020180, 0x00020180, 0x00020180, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, }, + {0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, }, + {0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, + {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e4, }, + {0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fe, 0x000200fe, 0x000200fe, 0x000200fe, 0x00020118, 0x00020118, 0x00020118, 0x00020118, }, + {0x00020132, 0x00020132, 0x00020132, 0x00020132, 0x0002014b, 0x0002014b, 0x0002014b, 0x0002014b, 0x0002014c, 0x0002014c, 0x0002014c, 0x0002014c, 0x0002014d, 0x0002014d, 0x0002014d, 0x0002014d, }, + {0x00020164, 0x00020164, 0x00020164, 0x00020164, 0x00020165, 0x00020165, 0x00020165, 0x00020165, 0x00020166, 0x00020166, 0x00020166, 0x00020166, 0x0002017a, 0x0002017a, 0x0002017a, 0x0002017a, }, + {0x000100e3, 0x000100e3, 0x00010100, 0x00010100, 0x00010133, 0x00010133, 0x0001014f, 0x0001014f, 0x0001017f, 0x0001017f, 0x00010182, 0x00010182, 0x000101e7, 0x000101e7, 0x000102d8, 0x000102d8, }, + {0x000002d2, 0x000002d3, 0x000002d4, 0x000002d5, 0x000002d6, 0x000002d7, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x000100ae, 0x000100ae, }, + {0x0034ffff, 0x0033ffff, 0x0035ffff, 0x0036ffff, 0x0039ffff, 0x0037ffff, 0x0038ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, }, + {0x0000002f, 0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, }, + {0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, }, + {0x0000004f, 0x00000050, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000007c, }, + {0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, }, + {0x000000b9, 0x000000ba, 0x000000bb, 0x000000bc, 0x000000ca, 0x000000cb, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, }, + {0x000000d6, 0x000000d7, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000ff, }, + {0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, }, + {0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x00000119, 0x0000011a, 0x0000011b, }, + {0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000134, 0x00000135, 0x00000136, }, + {0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x0000014e, 0x00000150, 0x00000151, }, + {0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x00000167, 0x00000168, 0x00000169, }, + {0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, }, + {0x0000017d, 0x00000181, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00000190, }, + {0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x00000195, 0x00000196, 0x00000197, 0x00000198, 0x00000199, 0x0000019a, 0x0000019b, 0x0000019c, 0x0000019d, 0x0000019e, 0x0000019f, 0x000001a0, }, + {0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, 0x000001a7, 0x000001a8, 0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b0, }, + {0x000001b1, 0x000001b2, 0x000001b3, 0x000001b4, 0x000001b5, 0x000001b6, 0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, 0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, }, + {0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, }, + {0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, 0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cc, 0x000001cd, 0x000001ce, 0x000001cf, 0x000001d0, }, + {0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, 0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, 0x000001de, 0x000001df, 0x000001e0, }, + {0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, 0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, }, + {0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, 0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, 0x000001fe, 0x000001ff, 0x00000200, 0x00000201, }, + {0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, 0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, 0x0000020e, 0x0000020f, 0x00000210, 0x00000211, }, + {0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, 0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, }, + {0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, 0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, }, + {0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, 0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, 0x0000023e, 0x0000023f, 0x00000240, 0x00000241, }, + {0x00000242, 0x00000243, 0x00000244, 0x00000245, 0x00000246, 0x00000247, 0x00000248, 0x00000249, 0x0000024a, 0x0000024b, 0x0000024c, 0x0000024d, 0x0000024e, 0x0000024f, 0x00000250, 0x00000251, }, + {0x00000252, 0x00000253, 0x00000254, 0x00000255, 0x00000256, 0x00000257, 0x00000258, 0x00000259, 0x0000025a, 0x0000025b, 0x0000025c, 0x0000025d, 0x0000025e, 0x0000025f, 0x00000260, 0x00000261, }, + {0x00000262, 0x00000263, 0x00000264, 0x00000265, 0x00000266, 0x00000267, 0x00000268, 0x00000269, 0x0000026a, 0x0000026b, 0x0000026c, 0x0000026d, 0x0000026e, 0x0000026f, 0x00000270, 0x00000271, }, + {0x00000272, 0x00000273, 0x00000274, 0x00000275, 0x00000276, 0x00000277, 0x00000278, 0x00000279, 0x0000027a, 0x0000027b, 0x0000027c, 0x0000027d, 0x0000027e, 0x0000027f, 0x00000280, 0x00000281, }, + {0x00000282, 0x00000283, 0x00000284, 0x00000285, 0x00000286, 0x00000287, 0x00000288, 0x00000289, 0x0000028a, 0x0000028b, 0x0000028c, 0x0000028d, 0x0000028e, 0x0000028f, 0x00000290, 0x00000291, }, + {0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, 0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, }, + {0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, 0x000002ae, 0x000002af, 0x000002b0, 0x000002b1, }, + {0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x000002b6, 0x000002b7, 0x000002b8, 0x000002b9, 0x000002ba, 0x000002bb, 0x000002bc, 0x000002bd, 0x000002be, 0x000002bf, 0x000002c0, 0x000002c1, }, + {0x000002c2, 0x000002c3, 0x000002c4, 0x000002c5, 0x000002c6, 0x000002c7, 0x000002c8, 0x000002c9, 0x000002ca, 0x000002cb, 0x000002cc, 0x000002cd, 0x000002ce, 0x000002cf, 0x000002d0, 0x000002d1, }, +}; + +const uint32_t c_aauiCQMFHuffEnc17[729][2] = +{ + {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000e}, + {0x0008, 0x000f}, {0x0009, 0x000f}, {0x000a, 0x000f}, {0x000c, 0x0011}, {0x000d, 0x0014}, {0x000e, 0x0017}, {0x0010, 0x002d}, {0x0011, 0x004c}, + {0x0012, 0x008a}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, + {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0006, 0x0016}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0006, 0x0017}, + {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0008, 0x0010}, {0x000a, 0x0010}, {0x000b, 0x0011}, {0x000c, 0x0012}, + {0x000e, 0x0018}, {0x000f, 0x0020}, {0x0011, 0x004d}, {0x0013, 0x00e4}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, + {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0006, 0x001a}, {0x0005, 0x001b}, + {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0007, 0x0014}, {0x0008, 0x0011}, {0x0009, 0x0010}, + {0x000a, 0x0011}, {0x000b, 0x0012}, {0x000c, 0x0013}, {0x000e, 0x0019}, {0x000f, 0x0021}, {0x0010, 0x002e}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, + {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, + {0x0014, 0x001c}, {0x0006, 0x001e}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, + {0x0007, 0x0015}, {0x0008, 0x0012}, {0x0009, 0x0011}, {0x000a, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0014}, {0x000e, 0x001a}, {0x000f, 0x0022}, + {0x0010, 0x002f}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, + {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0006, 0x0023}, {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, + {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0007, 0x0016}, {0x0007, 0x0017}, {0x0008, 0x0013}, {0x0009, 0x0012}, {0x000a, 0x0013}, {0x000c, 0x0015}, + {0x000d, 0x0015}, {0x000f, 0x0023}, {0x0010, 0x0030}, {0x0011, 0x004e}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, + {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0007, 0x0018}, + {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0008, 0x0014}, {0x0009, 0x0013}, + {0x000a, 0x0014}, {0x000b, 0x0014}, {0x000c, 0x0016}, {0x000d, 0x0016}, {0x000f, 0x0024}, {0x0010, 0x0031}, {0x0011, 0x004f}, {0x0014, 0x0031}, + {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, + {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0007, 0x001b}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0007, 0x001c}, {0x0007, 0x001d}, + {0x0008, 0x0015}, {0x0009, 0x0014}, {0x000a, 0x0015}, {0x000a, 0x0016}, {0x000c, 0x0017}, {0x000d, 0x0017}, {0x000e, 0x001b}, {0x000f, 0x0025}, + {0x0011, 0x0050}, {0x0011, 0x0051}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, + {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0008, 0x0016}, {0x0007, 0x001e}, {0x0007, 0x001f}, + {0x0007, 0x0020}, {0x0007, 0x0021}, {0x0008, 0x0017}, {0x0008, 0x0018}, {0x0009, 0x0015}, {0x000a, 0x0017}, {0x000b, 0x0015}, {0x000c, 0x0018}, + {0x000e, 0x001c}, {0x000e, 0x001d}, {0x0010, 0x0032}, {0x0012, 0x008b}, {0x0012, 0x008c}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, + {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, + {0x0008, 0x0019}, {0x0007, 0x0022}, {0x0007, 0x0023}, {0x0008, 0x001a}, {0x0008, 0x001b}, {0x0009, 0x0016}, {0x0009, 0x0017}, {0x000a, 0x0018}, + {0x000b, 0x0016}, {0x000c, 0x0019}, {0x000d, 0x0018}, {0x000e, 0x001e}, {0x0010, 0x0033}, {0x0011, 0x0052}, {0x0014, 0x0052}, {0x0013, 0x00e9}, + {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, + {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0009, 0x0018}, {0x0008, 0x001c}, {0x0008, 0x001d}, {0x0009, 0x0019}, {0x0009, 0x001a}, + {0x000a, 0x0019}, {0x000a, 0x001a}, {0x000b, 0x0017}, {0x000c, 0x001a}, {0x000d, 0x0019}, {0x000e, 0x001f}, {0x000f, 0x0026}, {0x0010, 0x0034}, + {0x0012, 0x008d}, {0x0013, 0x00ea}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, + {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x000b, 0x0018}, {0x0009, 0x001b}, + {0x000a, 0x001b}, {0x000a, 0x001c}, {0x000a, 0x001d}, {0x000b, 0x0019}, {0x000b, 0x001a}, {0x000c, 0x001b}, {0x000d, 0x001a}, {0x000e, 0x0020}, + {0x000f, 0x0027}, {0x0012, 0x008e}, {0x0011, 0x0053}, {0x0013, 0x00eb}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, + {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, + {0x0014, 0x0076}, {0x000c, 0x001c}, {0x000b, 0x001b}, {0x000b, 0x001c}, {0x000b, 0x001d}, {0x000c, 0x001d}, {0x000c, 0x001e}, {0x000d, 0x001b}, + {0x000d, 0x001c}, {0x000e, 0x0021}, {0x0010, 0x0035}, {0x0010, 0x0036}, {0x0011, 0x0054}, {0x0013, 0x00ec}, {0x0014, 0x0077}, {0x0014, 0x0078}, + {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, + {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x000d, 0x001d}, {0x000c, 0x001f}, {0x000c, 0x0020}, {0x000c, 0x0021}, + {0x000d, 0x001e}, {0x000d, 0x001f}, {0x000e, 0x0022}, {0x000f, 0x0028}, {0x0010, 0x0037}, {0x0010, 0x0038}, {0x0010, 0x0039}, {0x0012, 0x008f}, + {0x0013, 0x00ed}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, + {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x000e, 0x0023}, + {0x000d, 0x0020}, {0x000d, 0x0021}, {0x000e, 0x0024}, {0x000e, 0x0025}, {0x000e, 0x0026}, {0x000f, 0x0029}, {0x0010, 0x003a}, {0x0010, 0x003b}, + {0x0012, 0x0090}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, + {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, + {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x000f, 0x002a}, {0x000e, 0x0027}, {0x000f, 0x002b}, {0x000f, 0x002c}, {0x000f, 0x002d}, {0x0010, 0x003c}, + {0x0010, 0x003d}, {0x0011, 0x0055}, {0x0011, 0x0056}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, + {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, + {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0012, 0x0091}, {0x0010, 0x003e}, {0x0010, 0x003f}, + {0x0011, 0x0057}, {0x0011, 0x0058}, {0x0011, 0x0059}, {0x0012, 0x0092}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0012, 0x0093}, {0x0014, 0x00b6}, + {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, + {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, + {0x0013, 0x00f0}, {0x0012, 0x0094}, {0x0012, 0x0095}, {0x0012, 0x0096}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, + {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, + {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, + {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0012, 0x0097}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, + {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, + {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, + {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, + {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, + {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, + {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, + {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, + {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, + {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, + {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, + {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, {0x0014, 0x0139}, + {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, {0x0014, 0x0141}, + {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, {0x0014, 0x0149}, + {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, {0x0014, 0x0151}, + {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, {0x0014, 0x0159}, + {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, {0x0014, 0x0161}, + {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, {0x0014, 0x0169}, + {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, {0x0014, 0x0171}, + {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, {0x0014, 0x0179}, + {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, {0x0014, 0x0181}, + {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, {0x0014, 0x0189}, + {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, {0x0014, 0x0191}, + {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0014, 0x0198}, {0x0014, 0x0199}, + {0x0014, 0x019a}, {0x0014, 0x019b}, {0x0014, 0x019c}, {0x0014, 0x019d}, {0x0014, 0x019e}, {0x0014, 0x019f}, {0x0014, 0x01a0}, {0x0014, 0x01a1}, + {0x0014, 0x01a2}, {0x0014, 0x01a3}, {0x0014, 0x01a4}, {0x0014, 0x01a5}, {0x0014, 0x01a6}, {0x0014, 0x01a7}, {0x0014, 0x01a8}, {0x0014, 0x01a9}, + {0x0014, 0x01aa}, {0x0014, 0x01ab}, {0x0014, 0x01ac}, {0x0014, 0x01ad}, {0x0014, 0x01ae}, {0x0014, 0x01af}, {0x0014, 0x01b0}, {0x0014, 0x01b1}, + {0x0014, 0x01b2}, {0x0014, 0x01b3}, {0x0014, 0x01b4}, {0x0014, 0x01b5}, {0x0014, 0x01b6}, {0x0014, 0x01b7}, {0x0014, 0x01b8}, {0x0014, 0x01b9}, + {0x0014, 0x01ba}, {0x0014, 0x01bb}, {0x0014, 0x01bc}, {0x0014, 0x01bd}, {0x0014, 0x01be}, {0x0014, 0x01bf}, {0x0014, 0x01c0}, {0x0014, 0x01c1}, + {0x0014, 0x01c2}, {0x0014, 0x01c3}, {0x0014, 0x01c4}, {0x0014, 0x01c5}, {0x0014, 0x01c6}, {0x0014, 0x01c7}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, + {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, + {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, + {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, + {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, + {0x0013, 0x0113}, + +}; + +const uint32_t c_aauiCQMFHuffDec17[93][16] = +{ + {0x0010ffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0006ffff, 0x0005ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, + {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, + {0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, }, + {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, + {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, + {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, }, + {0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, }, + {0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, + {0x00000024, 0x0000003e, 0x00000059, 0x00000074, 0x0000008e, 0x000000a8, 0x000000bd, 0x000000c2, 0x000000c3, 0x000000d8, 0x000000db, 0x000000dc, 0x000000f4, 0x000000f5, 0x00010004, 0x00010004, }, + {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0001003d, 0x0001003d, 0x00010058, 0x00010058, 0x00010072, 0x00010072, 0x00010073, 0x00010073, }, + {0x00010087, 0x00010087, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x000100a2, 0x000100a2, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, + {0x001effff, 0x001dffff, 0x001cffff, 0x0019ffff, 0x0018ffff, 0x001affff, 0x001bffff, 0x0012ffff, 0x0011ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x00000007, 0x00000008, }, + {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, + {0x00020111, 0x00020111, 0x00020111, 0x00020111, 0x00020112, 0x00020112, 0x00020112, 0x00020112, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, }, + {0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, }, + {0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, }, + {0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, }, + {0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, }, + {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, + {0x0001010e, 0x0001010e, 0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, + {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c5, }, + {0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200f9, 0x00020110, 0x00020110, 0x00020110, 0x00020110, }, + {0x00000146, 0x00000147, 0x00010026, 0x00010026, 0x00010041, 0x00010041, 0x0001005c, 0x0001005c, 0x00010091, 0x00010091, 0x000100c6, 0x000100c6, 0x000100e0, 0x000100e0, 0x000100fa, 0x000100fa, }, + {0x0025ffff, 0x0000000b, 0x00000027, 0x00000042, 0x0000005d, 0x00000077, 0x00000092, 0x000000ac, 0x000000c7, 0x000000e1, 0x000000fb, 0x00000115, 0x00000129, 0x0000012d, 0x0000012e, 0x00000145, }, + {0x0040ffff, 0x0039ffff, 0x002dffff, 0x002cffff, 0x002bffff, 0x0028ffff, 0x0026ffff, 0x0027ffff, 0x0029ffff, 0x002affff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, + {0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, }, + {0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, }, + {0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, }, + {0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, }, + {0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, }, + {0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, }, + {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, }, + {0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, }, + {0x0001014b, 0x0001014b, 0x00010165, 0x00010165, 0x0001017a, 0x0001017a, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020131, 0x00020131, 0x00020131, 0x00020131, 0x0002014a, 0x0002014a, 0x0002014a, 0x0002014a, 0x0002015f, 0x0002015f, 0x0002015f, 0x0002015f, }, + {0x00020162, 0x00020162, 0x00020162, 0x00020162, 0x00020163, 0x00020163, 0x00020163, 0x00020163, 0x00020164, 0x00020164, 0x00020164, 0x00020164, 0x0002017b, 0x0002017b, 0x0002017b, 0x0002017b, }, + {0x00010029, 0x00010029, 0x00010044, 0x00010044, 0x0001005f, 0x0001005f, 0x00010079, 0x00010079, 0x00010094, 0x00010094, 0x000100af, 0x000100af, 0x000100fe, 0x000100fe, 0x00010118, 0x00010118, }, + {0x0000007a, 0x00000095, 0x000000ca, 0x000000e4, 0x000000ff, 0x00000132, 0x00000133, 0x0000014c, 0x0000014d, 0x0000014e, 0x00000166, 0x00000167, 0x0000017f, 0x00000180, 0x00000196, 0x00000197, }, + {0x003effff, 0x003fffff, 0x0036ffff, 0x0035ffff, 0x0037ffff, 0x0038ffff, 0x0031ffff, 0x002effff, 0x0032ffff, 0x002fffff, 0x0030ffff, 0x0033ffff, 0x0034ffff, 0x0000000e, 0x00000045, 0x00000060, }, + {0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, + {0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, }, + {0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, }, + {0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, }, + {0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, }, + {0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x00020100, 0x00020100, 0x00020100, 0x00020100, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002014f, 0x0002014f, 0x0002014f, 0x0002014f, }, + {0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x000102d8, 0x000102d8, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, }, + {0x00020168, 0x00020168, 0x00020168, 0x00020168, 0x00020195, 0x00020195, 0x00020195, 0x00020195, 0x0002019b, 0x0002019b, 0x0002019b, 0x0002019b, 0x0002019e, 0x0002019e, 0x0002019e, 0x0002019e, }, + {0x000201b1, 0x000201b1, 0x000201b1, 0x000201b1, 0x000201b2, 0x000201b2, 0x000201b2, 0x000201b2, 0x000201b3, 0x000201b3, 0x000201b3, 0x000201b3, 0x000201cc, 0x000201cc, 0x000201cc, 0x000201cc, }, + {0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x003bffff, 0x003affff, 0x003cffff, 0x003dffff, }, + {0x00010062, 0x00010062, 0x000100e7, 0x000100e7, 0x00010101, 0x00010101, 0x0001011b, 0x0001011b, 0x00010135, 0x00010135, 0x00010150, 0x00010150, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, }, + {0x000002ae, 0x000002af, 0x000002b0, 0x000002b1, 0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x0001002b, 0x0001002b, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010061, 0x00010061, }, + {0x000101b0, 0x000101b0, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, 0x000102bc, 0x000102bc, }, + {0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, 0x000102c4, 0x000102c4, }, + {0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, 0x000102cc, 0x000102cc, }, + {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, + {0x0044ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0045ffff, 0x0048ffff, 0x0046ffff, 0x0047ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, }, + {0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000063, 0x00000064, 0x00000065, }, + {0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000007c, 0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, }, + {0x00000086, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, }, + {0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, }, + {0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, 0x000000ba, 0x000000bb, 0x000000bc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, }, + {0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, }, + {0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, }, + {0x000000d6, 0x000000d7, 0x000000e6, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x00000102, 0x00000103, }, + {0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, }, + {0x0000015c, 0x0000015d, 0x0000015e, 0x00000169, 0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, }, + {0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, }, + {0x0000018f, 0x00000190, 0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x0000019f, 0x000001a0, 0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, 0x000001a7, 0x000001a8, }, + {0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b4, 0x000001b5, 0x000001b6, 0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, }, + {0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, 0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, 0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cd, }, + {0x000001ce, 0x000001cf, 0x000001d0, 0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, 0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, }, + {0x000001de, 0x000001df, 0x000001e0, 0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, 0x000001e7, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, }, + {0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, 0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, 0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, }, + {0x000001fe, 0x000001ff, 0x00000200, 0x00000201, 0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, 0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, }, + {0x0000020e, 0x0000020f, 0x00000210, 0x00000211, 0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, 0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, }, + {0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, 0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, }, + {0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, 0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, }, + {0x0000023e, 0x0000023f, 0x00000240, 0x00000241, 0x00000242, 0x00000243, 0x00000244, 0x00000245, 0x00000246, 0x00000247, 0x00000248, 0x00000249, 0x0000024a, 0x0000024b, 0x0000024c, 0x0000024d, }, + {0x0000024e, 0x0000024f, 0x00000250, 0x00000251, 0x00000252, 0x00000253, 0x00000254, 0x00000255, 0x00000256, 0x00000257, 0x00000258, 0x00000259, 0x0000025a, 0x0000025b, 0x0000025c, 0x0000025d, }, + {0x0000025e, 0x0000025f, 0x00000260, 0x00000261, 0x00000262, 0x00000263, 0x00000264, 0x00000265, 0x00000266, 0x00000267, 0x00000268, 0x00000269, 0x0000026a, 0x0000026b, 0x0000026c, 0x0000026d, }, + {0x0000026e, 0x0000026f, 0x00000270, 0x00000271, 0x00000272, 0x00000273, 0x00000274, 0x00000275, 0x00000276, 0x00000277, 0x00000278, 0x00000279, 0x0000027a, 0x0000027b, 0x0000027c, 0x0000027d, }, + {0x0000027e, 0x0000027f, 0x00000280, 0x00000281, 0x00000282, 0x00000283, 0x00000284, 0x00000285, 0x00000286, 0x00000287, 0x00000288, 0x00000289, 0x0000028a, 0x0000028b, 0x0000028c, 0x0000028d, }, + {0x0000028e, 0x0000028f, 0x00000290, 0x00000291, 0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, }, + {0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, 0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, }, +}; + +const uint32_t c_aauiCQMFHuffEnc18[28][2] = +{ + {0x0004, 0x0001}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0002}, + {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, + {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0011, 0x0003}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, + {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0004}, {0x0012, 0x0005}, + +}; + +const uint32_t c_aauiCQMFHuffDec18[6][16] = +{ + {0x0001ffff, 0x00000000, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, }, + {0x0002ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003ffff, 0x00000010, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0005ffff, 0x0004ffff, 0x00010013, 0x00010013, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, +}; + +const uint32_t c_aauiCQMFHuffEnc19[29][2] = +{ + {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, + {0x0004, 0x0005}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, + {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0012, 0x0002}, + {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0012, 0x0003}, + +}; + +const uint32_t c_aauiCQMFHuffDec19[6][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00000000, 0x00000006, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, }, + {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0004ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x0005ffff, 0x00000016, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, +}; + +const uint32_t c_aauiCQMFHuffEnc20[32][2] = +{ + {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, + {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, + {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, + {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0011, 0x0001}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, +}; + +const uint32_t c_aauiCQMFHuffDec20[6][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003ffff, 0x00000011, 0x00010010, 0x00010010, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0004ffff, 0x00000015, 0x00010014, 0x00010014, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x0005ffff, 0x00000019, 0x00010018, 0x00010018, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x0000001b, 0x0000001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc21[37][2] = +{ + {0x0005, 0x0002}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, + {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0002}, + {0x0006, 0x0003}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0001}, {0x000b, 0x0001}, + {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0011, 0x0001}, + {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + +}; + +const uint32_t c_aauiCQMFHuffDec21[7][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0004ffff, 0x00000013, 0x00000014, 0x00000015, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, + {0x0005ffff, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x0006ffff, 0x0000001e, 0x0001001d, 0x0001001d, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x00000020, 0x00000021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc22[39][2] = +{ + {0x0005, 0x0002}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, + {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, + {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0002}, {0x0008, 0x0003}, + {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0001}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, + {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000f, 0x0001}, {0x000e, 0x0003}, {0x0011, 0x0000}, {0x0010, 0x0001}, {0x0011, 0x0001}, + +}; + +const uint32_t c_aauiCQMFHuffDec22[9][16] = +{ + {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x0006ffff, 0x0005ffff, 0x00000016, 0x00000017, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x0007ffff, 0x0000001d, 0x0000001e, 0x0000001f, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x0008ffff, 0x00000025, 0x00010022, 0x00010022, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, +}; + +const uint32_t c_aauiCQMFHuffEnc23[46][2] = +{ + {0x0005, 0x0003}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, + {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, + {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, + {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, + {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0001}, {0x000e, 0x0002}, + {0x000e, 0x0003}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x0001}, + +}; + +const uint32_t c_aauiCQMFHuffDec23[12][16] = +{ + {0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x0008ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x000affff, 0x0009ffff, 0x00000022, 0x00000023, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x000bffff, 0x0000002a, 0x00010029, 0x00010029, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, + {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, +}; + +const uint32_t c_aauiCQMFHuffEnc24[55][2] = +{ + {0x0005, 0x0004}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, + {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, + {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, + {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, + {0x0009, 0x0002}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, + {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0001}, + {0x000f, 0x0002}, {0x000f, 0x0003}, {0x0010, 0x0001}, {0x0011, 0x0001}, {0x0013, 0x0000}, {0x0012, 0x0001}, {0x0013, 0x0001}, + +}; + +const uint32_t c_aauiCQMFHuffDec24[17][16] = +{ + {0x0008ffff, 0x0009ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, }, + {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x000cffff, 0x000affff, 0x000bffff, 0x0000001d, 0x0000001e, 0x0000001f, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, + {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, + {0x000fffff, 0x000dffff, 0x000effff, 0x00000028, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, + {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x0010ffff, 0x00000032, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, + {0x00010034, 0x00010034, 0x00010036, 0x00010036, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, +}; + +const uint32_t c_aauiCQMFHuffEnc25[65][2] = +{ + {0x0005, 0x0005}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x0006}, {0x0004, 0x000f}, {0x0005, 0x0007}, {0x0005, 0x0008}, + {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, + {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0006, 0x0004}, + {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, + {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, + {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0002}, {0x000c, 0x0003}, + {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0003}, {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000f, 0x0003}, {0x000e, 0x0005}, {0x000f, 0x0004}, + {0x0010, 0x0001}, {0x000f, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0011, 0x0001}, {0x0012, 0x0000}, + {0x0012, 0x0001}, + +}; + +const uint32_t c_aauiCQMFHuffDec25[19][16] = +{ + {0x000cffff, 0x000bffff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000001, 0x00000002, 0x00000003, 0x00000005, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x000fffff, 0x000dffff, 0x000effff, 0x00000022, 0x00000023, 0x00000024, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, + {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, + {0x0011ffff, 0x0010ffff, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, + {0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x0012ffff, 0x00000038, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010037, 0x00010037, 0x00010039, 0x00010039, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, + {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, +}; + +const uint32_t c_aauiCQMFHuffEnc26[77][2] = +{ + {0x0006, 0x0004}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, + {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, + {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, + {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, + {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0004}, + {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, + {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, + {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000e, 0x0002}, {0x000d, 0x0005}, {0x000e, 0x0003}, {0x000e, 0x0004}, + {0x000f, 0x0003}, {0x000e, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0011, 0x0002}, {0x0012, 0x0001}, {0x0010, 0x0005}, + {0x0012, 0x0002}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, + +}; + +const uint32_t c_aauiCQMFHuffDec26[26][16] = +{ + {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, + {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x0017ffff, 0x0015ffff, 0x0016ffff, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, + {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, + {0x0019ffff, 0x0018ffff, 0x00000042, 0x00000043, 0x00000044, 0x00000047, 0x00010040, 0x00010040, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, }, + {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc27[91][2] = +{ + {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, + {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, + {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0007}, {0x0006, 0x0008}, + {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, + {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, + {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, + {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0004}, {0x000a, 0x0005}, + {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, + {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0003}, {0x000e, 0x0004}, + {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000f, 0x0003}, {0x000f, 0x0004}, {0x0010, 0x0003}, {0x000f, 0x0005}, {0x0012, 0x0000}, + {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0012, 0x0003}, {0x0012, 0x0004}, + {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + +}; + +const uint32_t c_aauiCQMFHuffDec27[28][16] = +{ + {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, + {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, + {0x0014ffff, 0x0013ffff, 0x0011ffff, 0x0012ffff, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x0017ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, + {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, + {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x001affff, 0x001bffff, 0x0019ffff, 0x0000004d, 0x00000050, 0x00000051, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004e, 0x0001004e, 0x00020046, 0x00020046, 0x00020046, 0x00020046, }, + {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, + {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc28[109][2] = +{ + {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, + {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, + {0x0006, 0x0009}, {0x0005, 0x001f}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, + {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, + {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, + {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, + {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0005}, + {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0004}, + {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, + {0x000d, 0x0007}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x0010, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0005}, + {0x000f, 0x0006}, {0x000f, 0x0007}, {0x0010, 0x0006}, {0x0011, 0x0006}, {0x0010, 0x0007}, {0x0013, 0x0000}, {0x0010, 0x0008}, {0x0010, 0x0009}, + {0x0013, 0x0001}, {0x0011, 0x0007}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, + {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, + +}; + +const uint32_t c_aauiCQMFHuffDec28[30][16] = +{ + {0x000fffff, 0x0010ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, }, + {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, + {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, + {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, + {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, + {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, + {0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, + {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, + {0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, + {0x001bffff, 0x001cffff, 0x001dffff, 0x001affff, 0x00000055, 0x00000057, 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005f, 0x00010056, 0x00010056, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, + {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, + {0x0001005d, 0x0001005d, 0x00010060, 0x00010060, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, + {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, + {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, +}; + +const uint32_t c_aauiCQMFHuffEnc29[129][2] = +{ + {0x0006, 0x0009}, {0x0005, 0x0019}, {0x0006, 0x000a}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0006, 0x000b}, {0x0005, 0x001d}, + {0x0005, 0x001e}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0005, 0x001f}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, + {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, + {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, + {0x0006, 0x0022}, {0x0006, 0x0023}, {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, + {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, + {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, + {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, + {0x0009, 0x000b}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, + {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, + {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, + {0x000d, 0x000b}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, + {0x000f, 0x0007}, {0x0011, 0x0007}, {0x000f, 0x0008}, {0x0012, 0x0000}, {0x000f, 0x0009}, {0x0010, 0x0005}, {0x000f, 0x000a}, {0x000f, 0x000b}, + {0x0012, 0x0001}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, + {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0011, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, + {0x0011, 0x0009}, + +}; + +const uint32_t c_aauiCQMFHuffDec29[34][16] = +{ + {0x000fffff, 0x0010ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, + {0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020006, 0x00020006, 0x00020006, 0x00020006, }, + {0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, + {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, + {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, + {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, + {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, }, + {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, }, + {0x0016ffff, 0x0014ffff, 0x0015ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000003b, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00010030, 0x00010030, }, + {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, }, + {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, + {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, + {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, + {0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, + {0x001cffff, 0x001bffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, + {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, + {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, + {0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, }, + {0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, + {0x0001006a, 0x0001006a, 0x0001006c, 0x0001006c, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, + {0x001fffff, 0x0020ffff, 0x0021ffff, 0x001dffff, 0x001effff, 0x0000006d, 0x00000071, 0x00000072, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, }, + {0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, + {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, }, + {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, + {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, + {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, +}; + +const uint32_t c_aauiCQMFHuffEnc30[153][2] = +{ + {0x0007, 0x0009}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, + {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, + {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, {0x0006, 0x0023}, {0x0006, 0x0024}, + {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, + {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, {0x0006, 0x0032}, {0x0006, 0x0033}, {0x0006, 0x0034}, + {0x0006, 0x0035}, {0x0006, 0x0036}, {0x0006, 0x0037}, {0x0006, 0x0038}, {0x0006, 0x0039}, {0x0006, 0x003a}, {0x0006, 0x003b}, {0x0006, 0x003c}, + {0x0006, 0x003d}, {0x0006, 0x003e}, {0x0006, 0x003f}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, + {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, + {0x0007, 0x0017}, {0x0007, 0x0018}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0007, 0x001b}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0009, 0x0007}, + {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x000a, 0x0008}, + {0x0009, 0x000f}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x0007}, {0x000b, 0x0008}, + {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x0008}, {0x000b, 0x000e}, {0x000b, 0x000f}, + {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000d, 0x0008}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000d, 0x0009}, {0x000c, 0x000d}, {0x000d, 0x000a}, + {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000e, 0x0008}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000e, 0x0009}, {0x000e, 0x000a}, + {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000f, 0x0006}, {0x000f, 0x0007}, {0x000f, 0x0008}, {0x0010, 0x0006}, {0x000e, 0x000d}, {0x000e, 0x000e}, + {0x000e, 0x000f}, {0x0010, 0x0007}, {0x000f, 0x0009}, {0x0010, 0x0008}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, + {0x0010, 0x0009}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x000f, 0x000e}, {0x0010, 0x000a}, {0x0011, 0x0003}, {0x0011, 0x0004}, + {0x0011, 0x0005}, {0x000f, 0x000f}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, + {0x0010, 0x000b}, + +}; + +const uint32_t c_aauiCQMFHuffDec30[39][16] = +{ + {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, + {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, + {0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, }, + {0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, + {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, + {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, + {0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, + {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, + {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, + {0x0000004d, 0x0000004e, 0x00010000, 0x00010000, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, }, + {0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, }, + {0x0017ffff, 0x0018ffff, 0x0016ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, }, + {0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, + {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, + {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, + {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, + {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, + {0x001fffff, 0x0020ffff, 0x001dffff, 0x001effff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x00000065, 0x00000068, 0x00000069, 0x0000006b, 0x0000006c, 0x0000006e, 0x0001005e, 0x0001005e, }, + {0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, }, + {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, + {0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, + {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, }, + {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, }, + {0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, + {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, + {0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0000007d, 0x00000081, 0x00000083, 0x00000088, 0x0000008d, 0x00000098, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, }, + {0x0001007c, 0x0001007c, 0x00010082, 0x00010082, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x0001008c, 0x0001008c, 0x00010091, 0x00010091, }, + {0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, + {0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, }, + {0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, }, + {0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, }, + {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, }, + {0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, }, +}; + +const uint32_t c_aauiCQMFHuffEnc31[181][2] = +{ + {0x0007, 0x000b}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, + {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, {0x0006, 0x0023}, + {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, + {0x0006, 0x002c}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, {0x0006, 0x0032}, {0x0006, 0x0033}, + {0x0006, 0x0034}, {0x0006, 0x0035}, {0x0006, 0x0036}, {0x0006, 0x0037}, {0x0006, 0x0038}, {0x0006, 0x0039}, {0x0006, 0x003a}, {0x0006, 0x003b}, + {0x0006, 0x003c}, {0x0006, 0x003d}, {0x0006, 0x003e}, {0x0007, 0x000c}, {0x0006, 0x003f}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, + {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, {0x0007, 0x0017}, + {0x0007, 0x0018}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0007, 0x001b}, {0x0007, 0x001c}, {0x0007, 0x001d}, {0x0007, 0x001e}, {0x0007, 0x001f}, + {0x0007, 0x0020}, {0x0007, 0x0021}, {0x0007, 0x0022}, {0x0007, 0x0023}, {0x0007, 0x0024}, {0x0007, 0x0025}, {0x0007, 0x0026}, {0x0007, 0x0027}, + {0x0007, 0x0028}, {0x0007, 0x0029}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, + {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0008, 0x0012}, {0x0008, 0x0013}, {0x0008, 0x0014}, {0x0008, 0x0015}, {0x0009, 0x0008}, + {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, + {0x0009, 0x0011}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, + {0x000a, 0x000f}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000b, 0x000e}, + {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000b, 0x000f}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000d, 0x0008}, + {0x000c, 0x000e}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000c, 0x000f}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, + {0x000d, 0x000f}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000e, 0x000d}, {0x000e, 0x000e}, + {0x000e, 0x000f}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x0010, 0x0009}, {0x000f, 0x000d}, {0x000f, 0x000e}, + {0x0010, 0x000a}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0011, 0x000a}, {0x0010, 0x000e}, {0x000f, 0x000f}, {0x0010, 0x000f}, + {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0010, 0x0010}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0011, 0x000d}, + {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0010, 0x0011}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, + {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, + {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, + +}; + +const uint32_t c_aauiCQMFHuffDec31[43][16] = +{ + {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, + {0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, }, + {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, }, + {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, + {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00010000, 0x00010000, 0x0001002b, 0x0001002b, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, }, + {0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, }, + {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, }, + {0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, + {0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, }, + {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, + {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, + {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, + {0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, }, + {0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, + {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, + {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, + {0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010072, 0x00010072, }, + {0x0021ffff, 0x0020ffff, 0x001effff, 0x001fffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x00000070, 0x00000071, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000078, 0x0000007b, }, + {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, }, + {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, }, + {0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, }, + {0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, }, + {0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, + {0x00020085, 0x00020085, 0x00020085, 0x00020085, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, }, + {0x0000009c, 0x000000a4, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010096, 0x00010096, }, + {0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0000008d, 0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000095, 0x00000097, }, + {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, }, + {0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, }, + {0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, }, + {0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, + {0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, }, + {0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, }, + {0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, }, + {0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, }, + {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, +}; + +const uint32_t c_aauiCQMFHuffEnc33[16][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, + {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, +}; + +const uint32_t c_aauiCQMFHuffDec33[2][16] = +{ + {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc34[16][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, + {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, +}; + +const uint32_t c_aauiCQMFHuffDec34[2][16] = +{ + {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc35[25][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0007, 0x0006}, {0x0009, 0x0000}, {0x0009, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0009, 0x0002}, + {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0007, 0x0007}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, + {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, + +}; + +const uint32_t c_aauiCQMFHuffDec35[9][16] = +{ + {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0007ffff, 0x0008ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00010002, 0x00010002, 0x0001000a, 0x0001000a, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, +}; + +const uint32_t c_aauiCQMFHuffEnc36[36][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0000}, {0x000b, 0x0001}, {0x000b, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, + {0x0008, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0003}, {0x000b, 0x0006}, {0x000b, 0x0007}, + {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000b, 0x000e}, {0x000b, 0x000f}, + {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, {0x000a, 0x000f}, + {0x000a, 0x0010}, {0x000a, 0x0011}, {0x000a, 0x0012}, {0x000a, 0x0013}, + +}; + +const uint32_t c_aauiCQMFHuffDec36[7][16] = +{ + {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0006ffff, 0x0005ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000008, 0x0001000d, 0x0001000d, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, + {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, + {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, + {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, }, + {0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +}; + +const uint32_t c_aauiCQMFHuffEnc37[36][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, + {0x0006, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x000a, 0x0007}, {0x000c, 0x0006}, + {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000c, 0x000e}, + {0x000c, 0x000f}, {0x000c, 0x0010}, {0x000c, 0x0011}, {0x000c, 0x0012}, {0x000c, 0x0013}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000c, 0x0016}, + {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000b, 0x000d}, + +}; + +const uint32_t c_aauiCQMFHuffDec37[4][16] = +{ + {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x0001000d, 0x0001000d, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, + {0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00010023, 0x00010023, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x00000003, 0x00000004, 0x00000005, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, }, +}; + +const uint32_t c_aauiCQMFHuffEnc38[49][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0012}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x000d, 0x0002}, {0x0002, 0x0001}, + {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x000a}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, + {0x0009, 0x0003}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000c, 0x0013}, {0x000b, 0x000b}, {0x000d, 0x000a}, + {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000d, 0x0010}, {0x000d, 0x0011}, {0x000d, 0x0012}, + {0x000d, 0x0013}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000d, 0x0018}, {0x000d, 0x0019}, {0x000d, 0x001a}, + {0x000d, 0x001b}, {0x000d, 0x001c}, {0x000d, 0x001d}, {0x000d, 0x001e}, {0x000d, 0x001f}, {0x000d, 0x0020}, {0x000d, 0x0021}, {0x000d, 0x0022}, + {0x000d, 0x0023}, + +}; + +const uint32_t c_aauiCQMFHuffDec38[22][16] = +{ + {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x0014ffff, 0x0015ffff, 0x00000003, 0x00000015, 0x0001000a, 0x0001000a, 0x00010016, 0x00010016, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, + {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, +}; + +const uint32_t c_aauiCQMFHuffEnc39[64][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x000f, 0x0003}, + {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, {0x000f, 0x0007}, + {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0009, 0x0003}, {0x000d, 0x000e}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, + {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000d, 0x000f}, {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x000f, 0x000f}, {0x000f, 0x0010}, + {0x000f, 0x0011}, {0x000f, 0x0012}, {0x000f, 0x0013}, {0x000f, 0x0014}, {0x000f, 0x0015}, {0x000f, 0x0016}, {0x000f, 0x0017}, {0x000f, 0x0018}, + {0x000f, 0x0019}, {0x000f, 0x001a}, {0x000f, 0x001b}, {0x000f, 0x001c}, {0x000f, 0x001d}, {0x000f, 0x001e}, {0x000f, 0x001f}, {0x000f, 0x0020}, + {0x000f, 0x0021}, {0x000f, 0x0022}, {0x000f, 0x0023}, {0x000f, 0x0024}, {0x000f, 0x0025}, {0x000f, 0x0026}, {0x000f, 0x0027}, {0x000f, 0x0028}, + {0x000f, 0x0029}, {0x000e, 0x0015}, {0x000e, 0x0016}, {0x000e, 0x0017}, {0x000e, 0x0018}, {0x000e, 0x0019}, {0x000e, 0x001a}, {0x000e, 0x001b}, +}; + +const uint32_t c_aauiCQMFHuffDec39[12][16] = +{ + {0x0001ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0002ffff, 0x0001000a, 0x0001000a, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, + {0x0008ffff, 0x0007ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0005ffff, 0x0006ffff, 0x0004ffff, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, + {0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, }, + {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, + {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, }, + {0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, + {0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, + {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, + {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, }, +}; + +const uint32_t c_aauiCQMFHuffEnc40[81][2] = +{ + {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x0011}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, + {0x0011, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x000e, 0x0009}, {0x0011, 0x0004}, {0x0011, 0x0005}, + {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0005}, {0x0011, 0x0008}, {0x0011, 0x0009}, + {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000c, 0x0003}, {0x0011, 0x000d}, {0x0011, 0x000e}, + {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, + {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, + {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, + {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0011, 0x002a}, {0x0011, 0x002b}, {0x0011, 0x002c}, {0x0011, 0x002d}, {0x0011, 0x002e}, + {0x0011, 0x002f}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0011, 0x0034}, {0x0011, 0x0035}, {0x0011, 0x0036}, + {0x0011, 0x0037}, {0x0011, 0x0038}, {0x0011, 0x0039}, {0x0011, 0x003a}, {0x0011, 0x003b}, {0x0010, 0x001e}, {0x0010, 0x001f}, {0x0010, 0x0020}, + {0x0010, 0x0021}, + +}; + +const uint32_t c_aauiCQMFHuffDec40[36][16] = +{ + {0x0001ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000014, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x0000001d, 0x00010003, 0x00010003, 0x0001001b, 0x0001001b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x0000004f, 0x00000050, 0x00010004, 0x00010004, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000004d, 0x0000004e, }, + {0x0023ffff, 0x000affff, 0x0006ffff, 0x000bffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, }, + {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, + {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, + {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, + {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, + {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, + {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, + {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, +}; + +const uint32_t c_aauiCQMFHuffEnc41[100][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0014}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x000b}, {0x0013, 0x0005}, + {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0002}, + {0x0011, 0x0015}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x000a, 0x0002}, {0x000a, 0x0003}, + {0x000d, 0x0003}, {0x0010, 0x000c}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, + {0x0010, 0x000d}, {0x000f, 0x0007}, {0x0012, 0x0027}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, + {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, + {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, + {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, + {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, + {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, + {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, + {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, + +}; + +const uint32_t c_aauiCQMFHuffDec41[16][16] = +{ + {0x0001ffff, 0x0000000b, 0x00010001, 0x00010001, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0002ffff, 0x00000016, 0x0001000c, 0x0001000c, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x0004ffff, 0x0003ffff, 0x00010003, 0x00010003, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0006ffff, 0x0005ffff, 0x0000000e, 0x00000021, 0x00000028, 0x00010029, 0x00010029, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, + {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, }, + {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x00010022, 0x00010022, }, + {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, + {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, + {0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, + {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, + {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, + {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, +}; + +const uint32_t c_aauiCQMFHuffEnc42[169][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000e, 0x0006}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, + {0x0009, 0x0002}, {0x000d, 0x0004}, {0x0010, 0x0013}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, + {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000b}, {0x0011, 0x0025}, + {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0009, 0x0003}, + {0x0008, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0005}, {0x0010, 0x0014}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, + {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x0010, 0x0015}, + {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, + {0x0013, 0x0026}, {0x0012, 0x0045}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, + {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, + {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, + {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, + {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, + {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, + {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, + {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, + {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, + {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, + {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, + {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, + {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0012, 0x0046}, {0x0012, 0x0047}, {0x0012, 0x0048}, + {0x0012, 0x0049}, + +}; + +const uint32_t c_aauiCQMFHuffDec42[28][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0003ffff, 0x0004ffff, 0x0000001c, 0x00000028, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x000affff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001001d, 0x0001001d, 0x00010029, 0x00010029, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, + {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, + {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x001bffff, 0x0009ffff, 0x0008ffff, 0x00000012, 0x0000002b, 0x00000037, 0x0001001e, 0x0001001e, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, + {0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, + {0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, }, + {0x000dffff, 0x000bffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, }, + {0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00010020, 0x00010020, }, + {0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, + {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, }, + {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, + {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010042, 0x00010042, }, + {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, + {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, + {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, + {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, + {0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, }, + {0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, }, + {0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, }, + {0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, }, + {0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, + {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, + {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, }, + {0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, }, +}; + +const uint32_t c_aauiCQMFHuffEnc43[196][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x0010, 0x0017}, {0x0013, 0x0000}, {0x0013, 0x0001}, + {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, + {0x0005, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x0010, 0x0018}, {0x0012, 0x0050}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, + {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0003}, {0x000a, 0x0002}, + {0x000d, 0x0004}, {0x0011, 0x002a}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, + {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000c, 0x0005}, {0x000f, 0x000d}, {0x0012, 0x0051}, + {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, + {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0005}, {0x000f, 0x000e}, {0x0011, 0x002b}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, + {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0011, 0x002c}, {0x000f, 0x000f}, + {0x0010, 0x0019}, {0x0012, 0x0052}, {0x0012, 0x0053}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, + {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0011, 0x002d}, {0x0013, 0x0032}, {0x0013, 0x0033}, + {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, + {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, + {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, + {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, + {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, + {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, + {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, + {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, + {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, + {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, + {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, + {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, + {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, + {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, + +}; + +const uint32_t c_aauiCQMFHuffDec43[32][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x0005ffff, 0x0003ffff, 0x0004ffff, 0x0000001e, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x000bffff, 0x0007ffff, 0x0006ffff, 0x00000004, 0x00000012, 0x0000002d, 0x00000038, 0x00000039, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, + {0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000013, 0x00000048, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, + {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, + {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, + {0x000dffff, 0x000effff, 0x000cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, }, + {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x00010030, 0x00010030, }, + {0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, }, + {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010022, 0x00010022, }, + {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003d, 0x0001003d, }, + {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, + {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, }, + {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, }, + {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, + {0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, }, + {0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, }, + {0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, }, + {0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, }, + {0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, }, + {0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, }, + {0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, }, + {0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, }, + {0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, + {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, + {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, +}; + +const uint32_t c_aauiCQMFHuffEnc44[289][2] = +{ + {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0002}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000a}, {0x0011, 0x0022}, {0x0014, 0x0000}, + {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, + {0x0014, 0x0009}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0003}, {0x000e, 0x0007}, {0x0012, 0x003f}, + {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, + {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0006, 0x0003}, {0x0005, 0x0003}, {0x0007, 0x0003}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x000f, 0x000b}, + {0x0012, 0x0040}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, + {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0004}, {0x000d, 0x0005}, + {0x0010, 0x0013}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, + {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000e, 0x0008}, + {0x0011, 0x0023}, {0x0012, 0x0041}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0013, 0x007b}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, + {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, {0x000f, 0x000c}, {0x000e, 0x0009}, {0x000f, 0x000d}, + {0x0011, 0x0024}, {0x0012, 0x0042}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, + {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0013, 0x007c}, {0x0011, 0x0025}, + {0x0012, 0x0043}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, + {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, + {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, + {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, + {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, + {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, + {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, + {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, + {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, + {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, + {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, + {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, + {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, + {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, + {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, + {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, + {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, + {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, + {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, + {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, + {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, + {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, + {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, + {0x0013, 0x007d}, + +}; + +const uint32_t c_aauiCQMFHuffDec44[27][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00010001, 0x00010001, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, + {0x0004ffff, 0x0003ffff, 0x00000003, 0x00000014, 0x00000033, 0x00000034, 0x00010024, 0x00010024, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x000affff, 0x0006ffff, 0x0005ffff, 0x00000026, 0x00010004, 0x00010004, 0x00010015, 0x00010015, 0x00010036, 0x00010036, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, }, + {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000038, 0x00010005, 0x00010005, 0x00010027, 0x00010027, 0x00010055, 0x00010055, 0x00010057, 0x00010057, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, + {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, + {0x000dffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x000bffff, }, + {0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x0001004c, 0x0001004c, 0x00010066, 0x00010066, 0x00010120, 0x00010120, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, + {0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x00000032, 0x00000039, 0x0000003a, }, + {0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, }, + {0x0000003b, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x0000004a, 0x0000004b, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000051, }, + {0x00000052, 0x00000053, 0x00000054, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000069, }, + {0x0000006a, 0x0000006b, 0x0000006c, 0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, }, + {0x0000007a, 0x0000007b, 0x0000007c, 0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, }, + {0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, }, + {0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000a2, 0x000000a3, 0x000000a4, 0x000000a5, 0x000000a6, 0x000000a7, 0x000000a8, 0x000000a9, }, + {0x000000aa, 0x000000ab, 0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, }, + {0x000000ba, 0x000000bb, 0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, 0x000000c6, 0x000000c7, 0x000000c8, 0x000000c9, }, + {0x000000ca, 0x000000cb, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, 0x000000d9, }, + {0x000000da, 0x000000db, 0x000000dc, 0x000000dd, 0x000000de, 0x000000df, 0x000000e0, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, }, + {0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, }, + {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, + {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, +}; + +const uint32_t c_aauiCQMFHuffEnc45[324][2] = +{ + {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x0010, 0x0025}, {0x0012, 0x0088}, + {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, + {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0004}, + {0x000f, 0x0014}, {0x0011, 0x0048}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, + {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0005, 0x0005}, {0x0004, 0x0003}, {0x0006, 0x0004}, {0x0007, 0x0003}, + {0x000a, 0x0004}, {0x000d, 0x0007}, {0x000f, 0x0015}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, + {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0007, 0x0004}, {0x0006, 0x0005}, + {0x0007, 0x0005}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0008}, {0x0010, 0x0026}, {0x0012, 0x0089}, {0x0012, 0x008a}, {0x0013, 0x001f}, + {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, + {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0009}, {0x000f, 0x0016}, {0x0011, 0x0049}, {0x0013, 0x0028}, + {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, + {0x0013, 0x0031}, {0x0013, 0x0032}, {0x000c, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000e, 0x000d}, {0x0010, 0x0027}, {0x0012, 0x008b}, + {0x0012, 0x008c}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, + {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x000f, 0x0017}, {0x000f, 0x0018}, {0x000f, 0x0019}, {0x0012, 0x008d}, + {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, + {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0012, 0x008e}, + {0x0012, 0x008f}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, + {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, + {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, + {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, + {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, + {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, + {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, + {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, + {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, + {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, + {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, + {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, + {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, + {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, + {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, + {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, + {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, + {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, + {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, + {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, + {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, + {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, + {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, + {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, + {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, + +}; + +const uint32_t c_aauiCQMFHuffDec45[50][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000025, 0x00010001, 0x00010001, 0x00010013, 0x00010013, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x0007ffff, 0x0005ffff, 0x0004ffff, 0x0006ffff, 0x00010003, 0x00010003, 0x00010027, 0x00010027, 0x00010036, 0x00010036, 0x00010038, 0x00010038, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, + {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, + {0x000effff, 0x001fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x0000005a, 0x0000005c, 0x00010017, 0x00010017, 0x0001003a, 0x0001003a, 0x0001004b, 0x0001004b, 0x0001005b, 0x0001005b, }, + {0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, + {0x0030ffff, 0x0031ffff, 0x000cffff, 0x000dffff, 0x000bffff, 0x00000006, 0x0000003c, 0x0000005e, 0x00010018, 0x00010018, 0x0001002a, 0x0001002a, 0x0001004d, 0x0001004d, 0x0001006c, 0x0001006c, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, }, + {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, + {0x0010ffff, 0x0011ffff, 0x0012ffff, 0x000fffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, }, + {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x0001003f, 0x0001003f, }, + {0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, + {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, }, + {0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, + {0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, + {0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, }, + {0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, }, + {0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, + {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, }, + {0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, }, + {0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, }, + {0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, }, + {0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, }, + {0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, }, + {0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, }, + {0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, + {0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, }, + {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, + {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, + {0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, }, + {0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, }, + {0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, }, + {0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, }, + {0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, }, + {0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, }, + {0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, }, + {0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, }, + {0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, }, + {0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010113, 0x00010113, }, + {0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, }, + {0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, }, + {0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, }, + {0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, }, + {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, + {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, +}; + +const uint32_t c_aauiCQMFHuffEnc46[400][2] = +{ + {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0004}, {0x0009, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x000a}, {0x000f, 0x0018}, + {0x0012, 0x00a6}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, + {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0004}, {0x0006, 0x0004}, + {0x0008, 0x0004}, {0x000a, 0x0006}, {0x000c, 0x0008}, {0x000e, 0x0011}, {0x0012, 0x00a7}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, + {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0007, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0007}, {0x000d, 0x000b}, {0x000f, 0x0019}, + {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, + {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0007, 0x0006}, {0x0006, 0x0005}, {0x0007, 0x0007}, {0x0008, 0x0005}, + {0x000a, 0x0007}, {0x000c, 0x0009}, {0x000e, 0x0012}, {0x000f, 0x001a}, {0x0012, 0x00a8}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, + {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, + {0x0009, 0x0007}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x000a, 0x0008}, {0x000b, 0x0008}, {0x000d, 0x000c}, {0x000e, 0x0013}, {0x0010, 0x002c}, + {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, + {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x000b, 0x0009}, {0x000a, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, + {0x000d, 0x000d}, {0x000f, 0x001b}, {0x0010, 0x002d}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, + {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, + {0x000d, 0x000e}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000d, 0x000f}, {0x000f, 0x001c}, {0x000f, 0x001d}, {0x0013, 0x0046}, {0x0013, 0x0047}, + {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, + {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x000f, 0x001e}, {0x000f, 0x001f}, {0x000f, 0x0020}, {0x000f, 0x0021}, + {0x0010, 0x002e}, {0x0012, 0x00a9}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0012, 0x00aa}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, + {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, + {0x0013, 0x0061}, {0x0010, 0x002f}, {0x0013, 0x0062}, {0x0011, 0x0057}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, + {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, + {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, + {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, + {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, + {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, + {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, + {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, + {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, + {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, + {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, + {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, + {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, + {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, + {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, + {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, + {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, + {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, + {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, + {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, + {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, + {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, + {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, + {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, + {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, + {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, + {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, + {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, + {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, + {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0012, 0x00ab}, {0x0012, 0x00ac}, {0x0012, 0x00ad}, +}; + +const uint32_t c_aauiCQMFHuffDec46[61][16] = +{ + {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x00010015, 0x00010015, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, + {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, + {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000018, 0x0000003f, 0x00000051, 0x00000052, 0x00010003, 0x00010003, 0x0001002b, 0x0001002b, 0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, }, + {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, + {0x00010054, 0x00010054, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, + {0x0012ffff, 0x0023ffff, 0x000effff, 0x000dffff, 0x000cffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001a, 0x00000041, 0x00000079, 0x0000007a, 0x00010005, 0x00010005, 0x0001002d, 0x0001002d, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, + {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, + {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, + {0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, + {0x00010007, 0x00010007, 0x0001002f, 0x0001002f, 0x00010043, 0x00010043, 0x00010069, 0x00010069, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, }, + {0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x0010ffff, 0x0011ffff, 0x000fffff, 0x00000057, 0x0000006a, 0x00000090, 0x000000a1, }, + {0x0002018e, 0x0002018e, 0x0002018e, 0x0002018e, 0x0002018f, 0x0002018f, 0x0002018f, 0x0002018f, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, + {0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, + {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x0002018d, 0x0002018d, 0x0002018d, 0x0002018d, }, + {0x0013ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0014ffff, 0x0015ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, }, + {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, }, + {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, + {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, + {0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, + {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, + {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, + {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, + {0x00010063, 0x00010063, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, + {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, }, + {0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, }, + {0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010095, 0x00010095, 0x00010096, 0x00010096, }, + {0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, }, + {0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a2, 0x000100a2, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, }, + {0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, }, + {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, + {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, }, + {0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, }, + {0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, }, + {0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, }, + {0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, }, + {0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, }, + {0x000100e1, 0x000100e1, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, }, + {0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, }, + {0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, }, + {0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, }, + {0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, }, + {0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, }, + {0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, + {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, + {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, + {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, }, + {0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, + {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, + {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, }, + {0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, }, + {0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, }, + {0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, }, + {0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, }, + {0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, }, + {0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, }, + {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, + {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, +}; + +const uint32_t c_aauiCQMFHuffEnc47[576][2] = +{ + {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0005}, {0x0006, 0x0004}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000b}, {0x000d, 0x000d}, + {0x0010, 0x0041}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, + {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, + {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0007}, {0x000d, 0x000e}, + {0x000f, 0x0025}, {0x000f, 0x0026}, {0x0012, 0x00f6}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, + {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, + {0x0005, 0x0006}, {0x0004, 0x0005}, {0x0005, 0x0007}, {0x0006, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x000b, 0x0008}, {0x000d, 0x000f}, + {0x000f, 0x0027}, {0x0012, 0x00f7}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, + {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, + {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0006}, {0x0009, 0x0008}, {0x000a, 0x0008}, {0x000c, 0x000c}, {0x000e, 0x0017}, + {0x0010, 0x0042}, {0x0012, 0x00f8}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, + {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, + {0x0008, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0009}, {0x0009, 0x0009}, {0x000a, 0x0009}, {0x000b, 0x0009}, {0x000d, 0x0010}, {0x000f, 0x0028}, + {0x000f, 0x0029}, {0x0011, 0x007f}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, + {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, + {0x000a, 0x000a}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000a}, {0x000d, 0x0011}, {0x000f, 0x002a}, {0x0010, 0x0043}, + {0x0012, 0x00f9}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, + {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, + {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x000d}, {0x000d, 0x0012}, {0x000e, 0x0018}, {0x0010, 0x0044}, {0x0013, 0x0055}, + {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, + {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, + {0x000e, 0x0019}, {0x000d, 0x0013}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000f, 0x002b}, {0x0010, 0x0045}, {0x0013, 0x0066}, {0x0012, 0x00fa}, + {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, + {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, + {0x0010, 0x0046}, {0x000f, 0x002c}, {0x000f, 0x002d}, {0x0010, 0x0047}, {0x0011, 0x0080}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, + {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, + {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, + {0x0013, 0x008a}, {0x0010, 0x0048}, {0x0010, 0x0049}, {0x0011, 0x0081}, {0x0013, 0x008b}, {0x0012, 0x00fb}, {0x0013, 0x008c}, {0x0013, 0x008d}, + {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, + {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, + {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0012, 0x00fc}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, + {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, + {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, + {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, + {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, + {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, + {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, + {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, + {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, + {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, + {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, + {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, + {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, + {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, + {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, + {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, + {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, + {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, + {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, + {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, + {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, + {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, + {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, + {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, + {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, + {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, + {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, + {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, + {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, + {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, + {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, + {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, + {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, + {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, + {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, + {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, + {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, + {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, + {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, + {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, + {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, {0x0013, 0x01e4}, + {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, {0x0012, 0x00fd}, +}; + +const uint32_t c_aauiCQMFHuffDec47[87][16] = +{ + {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x0000001a, 0x00000031, 0x00010001, 0x00010001, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, + {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, + {0x000affff, 0x0008ffff, 0x0009ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000004, 0x00000034, 0x00000060, 0x00000062, 0x0001001c, 0x0001001c, 0x0001004b, 0x0001004b, 0x00010061, 0x00010061, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, + {0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, }, + {0x00010036, 0x00010036, 0x00010065, 0x00010065, 0x0001007c, 0x0001007c, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00020005, 0x00020005, 0x00020005, 0x00020005, }, + {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, }, + {0x0017ffff, 0x0028ffff, 0x0039ffff, 0x0012ffff, 0x0011ffff, 0x0010ffff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000006, 0x0000004e, 0x00000093, 0x0001001e, 0x0001001e, }, + {0x00020095, 0x00020095, 0x00020095, 0x00020095, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, + {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, }, + {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, + {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, }, + {0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x0001007e, 0x0001007e, 0x000100ac, 0x000100ac, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, + {0x0014ffff, 0x00000008, 0x00000050, 0x0000007f, 0x00000096, 0x000000ad, 0x000000c0, 0x000000c3, 0x000000d9, 0x000000da, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010038, 0x00010038, }, + {0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0016ffff, 0x0015ffff, 0x0013ffff, }, + {0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x0002023f, 0x0002023f, 0x0002023f, 0x0002023f, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, + {0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, }, + {0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, }, + {0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x001bffff, 0x001affff, 0x001dffff, 0x001cffff, 0x0020ffff, 0x0018ffff, 0x0019ffff, 0x001effff, 0x001fffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, }, + {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, + {0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, }, + {0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010023, 0x00010023, }, + {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, }, + {0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, + {0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, }, + {0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, + {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010081, 0x00010081, 0x00010082, 0x00010082, }, + {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, + {0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, + {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, }, + {0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, }, + {0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100ae, 0x000100ae, 0x000100b0, 0x000100b0, }, + {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, + {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c5, 0x000100c5, }, + {0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, }, + {0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, }, + {0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, + {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100dc, 0x000100dc, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, }, + {0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, }, + {0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, }, + {0x000100f2, 0x000100f2, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, }, + {0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, }, + {0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, }, + {0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, }, + {0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, 0x0001011a, 0x0001011a, }, + {0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, 0x00010122, 0x00010122, }, + {0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x00010129, 0x00010129, 0x0001012a, 0x0001012a, }, + {0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, }, + {0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, }, + {0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, }, + {0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, }, + {0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, }, + {0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, }, + {0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, }, + {0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, }, + {0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, }, + {0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, }, + {0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, }, + {0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, }, + {0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, }, + {0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, }, + {0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, }, + {0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, }, + {0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, }, + {0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, }, + {0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, }, + {0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, }, + {0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, }, + {0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, }, + {0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, }, + {0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, }, + {0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, }, + {0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, }, + {0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, }, + {0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, }, + {0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, }, + {0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, }, + {0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, }, + {0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, }, + {0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, }, + {0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, }, + {0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc48[729][2] = +{ + {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0006}, {0x0006, 0x0006}, {0x0008, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x000b}, {0x000c, 0x000d}, + {0x000f, 0x0030}, {0x0010, 0x0055}, {0x0012, 0x0136}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, + {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, + {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0005, 0x0007}, {0x0006, 0x0007}, {0x0007, 0x0007}, + {0x0008, 0x0007}, {0x000a, 0x0008}, {0x000c, 0x000e}, {0x000d, 0x0012}, {0x000f, 0x0031}, {0x0011, 0x00a0}, {0x0013, 0x0010}, {0x0013, 0x0011}, + {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, + {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0005, 0x0008}, {0x0004, 0x0005}, + {0x0005, 0x0009}, {0x0006, 0x0008}, {0x0007, 0x0008}, {0x0008, 0x0008}, {0x000a, 0x0009}, {0x000c, 0x000f}, {0x000d, 0x0013}, {0x000f, 0x0032}, + {0x0011, 0x00a1}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, + {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, + {0x0013, 0x002f}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0009}, {0x0008, 0x0009}, {0x0009, 0x0008}, {0x000b, 0x000c}, + {0x000d, 0x0014}, {0x000e, 0x001d}, {0x000f, 0x0033}, {0x0012, 0x0137}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, + {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, + {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0008, 0x000a}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x000b}, + {0x0009, 0x0009}, {0x000a, 0x000a}, {0x000c, 0x0010}, {0x000d, 0x0015}, {0x000f, 0x0034}, {0x0010, 0x0056}, {0x0012, 0x0138}, {0x0013, 0x0040}, + {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, + {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0009, 0x000a}, + {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000c, 0x0011}, {0x000d, 0x0016}, {0x000e, 0x001e}, {0x0010, 0x0057}, + {0x0011, 0x00a2}, {0x0011, 0x00a3}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, + {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, + {0x0013, 0x005e}, {0x0013, 0x005f}, {0x000b, 0x000d}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x000e}, {0x000c, 0x0012}, {0x000d, 0x0017}, + {0x000e, 0x001f}, {0x0010, 0x0058}, {0x0012, 0x0139}, {0x0011, 0x00a4}, {0x0012, 0x013a}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, + {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, + {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x000c, 0x0013}, {0x000b, 0x000f}, {0x000c, 0x0014}, + {0x000c, 0x0015}, {0x000d, 0x0018}, {0x000e, 0x0020}, {0x000f, 0x0035}, {0x0012, 0x013b}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, + {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, + {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, + {0x000e, 0x0021}, {0x000d, 0x0019}, {0x000e, 0x0022}, {0x000e, 0x0023}, {0x000f, 0x0036}, {0x0010, 0x0059}, {0x0011, 0x00a5}, {0x0013, 0x0083}, + {0x0011, 0x00a6}, {0x0012, 0x013c}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, + {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, + {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0010, 0x005a}, {0x000f, 0x0037}, {0x000f, 0x0038}, {0x000f, 0x0039}, {0x0010, 0x005b}, + {0x0010, 0x005c}, {0x0013, 0x0095}, {0x0011, 0x00a7}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, + {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, + {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0010, 0x005d}, {0x0010, 0x005e}, + {0x0013, 0x00a9}, {0x0010, 0x005f}, {0x0013, 0x00aa}, {0x0012, 0x013d}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, + {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, + {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, + {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0011, 0x00a8}, {0x0013, 0x00c1}, {0x0011, 0x00a9}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, + {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, + {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, + {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0012, 0x013e}, {0x0013, 0x00db}, + {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, + {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, + {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, + {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, + {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, + {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, + {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, + {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, + {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, + {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, + {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, + {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, + {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, + {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, + {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, + {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, + {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, + {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, + {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, + {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, + {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, + {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, + {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, + {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, + {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, + {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, + {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, + {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, + {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, + {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, + {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, + {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, + {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, + {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, + {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, {0x0013, 0x01f3}, + {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, {0x0013, 0x01fb}, + {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, {0x0013, 0x01ff}, {0x0013, 0x0200}, {0x0013, 0x0201}, {0x0013, 0x0202}, {0x0013, 0x0203}, + {0x0013, 0x0204}, {0x0013, 0x0205}, {0x0013, 0x0206}, {0x0013, 0x0207}, {0x0013, 0x0208}, {0x0013, 0x0209}, {0x0013, 0x020a}, {0x0013, 0x020b}, + {0x0013, 0x020c}, {0x0013, 0x020d}, {0x0013, 0x020e}, {0x0013, 0x020f}, {0x0013, 0x0210}, {0x0013, 0x0211}, {0x0013, 0x0212}, {0x0013, 0x0213}, + {0x0013, 0x0214}, {0x0013, 0x0215}, {0x0013, 0x0216}, {0x0013, 0x0217}, {0x0013, 0x0218}, {0x0013, 0x0219}, {0x0013, 0x021a}, {0x0013, 0x021b}, + {0x0013, 0x021c}, {0x0013, 0x021d}, {0x0013, 0x021e}, {0x0013, 0x021f}, {0x0013, 0x0220}, {0x0013, 0x0221}, {0x0013, 0x0222}, {0x0013, 0x0223}, + {0x0013, 0x0224}, {0x0013, 0x0225}, {0x0013, 0x0226}, {0x0013, 0x0227}, {0x0013, 0x0228}, {0x0013, 0x0229}, {0x0013, 0x022a}, {0x0013, 0x022b}, + {0x0013, 0x022c}, {0x0013, 0x022d}, {0x0013, 0x022e}, {0x0013, 0x022f}, {0x0013, 0x0230}, {0x0013, 0x0231}, {0x0013, 0x0232}, {0x0013, 0x0233}, + {0x0013, 0x0234}, {0x0013, 0x0235}, {0x0013, 0x0236}, {0x0013, 0x0237}, {0x0013, 0x0238}, {0x0013, 0x0239}, {0x0013, 0x023a}, {0x0013, 0x023b}, + {0x0013, 0x023c}, {0x0013, 0x023d}, {0x0013, 0x023e}, {0x0013, 0x023f}, {0x0013, 0x0240}, {0x0013, 0x0241}, {0x0013, 0x0242}, {0x0013, 0x0243}, + {0x0013, 0x0244}, {0x0013, 0x0245}, {0x0013, 0x0246}, {0x0013, 0x0247}, {0x0013, 0x0248}, {0x0013, 0x0249}, {0x0013, 0x024a}, {0x0013, 0x024b}, + {0x0013, 0x024c}, {0x0013, 0x024d}, {0x0013, 0x024e}, {0x0013, 0x024f}, {0x0013, 0x0250}, {0x0013, 0x0251}, {0x0013, 0x0252}, {0x0013, 0x0253}, + {0x0013, 0x0254}, {0x0013, 0x0255}, {0x0013, 0x0256}, {0x0013, 0x0257}, {0x0013, 0x0258}, {0x0013, 0x0259}, {0x0013, 0x025a}, {0x0013, 0x025b}, + {0x0013, 0x025c}, {0x0013, 0x025d}, {0x0013, 0x025e}, {0x0013, 0x025f}, {0x0013, 0x0260}, {0x0013, 0x0261}, {0x0013, 0x0262}, {0x0013, 0x0263}, + {0x0013, 0x0264}, {0x0013, 0x0265}, {0x0013, 0x0266}, {0x0013, 0x0267}, {0x0013, 0x0268}, {0x0013, 0x0269}, {0x0013, 0x026a}, {0x0013, 0x026b}, + {0x0012, 0x013f}, + +}; + +const uint32_t c_aauiCQMFHuffDec48[110][16] = +{ + {0x0005ffff, 0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000037, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, + {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x0001003a, 0x0001003a, 0x00010054, 0x00010054, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, + {0x000bffff, 0x000affff, 0x0009ffff, 0x0008ffff, 0x0006ffff, 0x0007ffff, 0x00000004, 0x00000020, 0x0000003b, 0x00000055, 0x0000006c, 0x0000006f, 0x00000088, 0x00000089, 0x0001001f, 0x0001001f, }, + {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, + {0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, + {0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, }, + {0x00000072, 0x0000008c, 0x000000a6, 0x000000bd, 0x000000bf, 0x000000c0, 0x00010006, 0x00010006, 0x00010057, 0x00010057, 0x000100a2, 0x000100a2, 0x000100a5, 0x000100a5, 0x000100be, 0x000100be, }, + {0x001dffff, 0x002effff, 0x003fffff, 0x0050ffff, 0x0019ffff, 0x0013ffff, 0x0012ffff, 0x0010ffff, 0x0011ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000007, 0x00000022, 0x0000003d, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, + {0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, }, + {0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, + {0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, }, + {0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200da, 0x000200da, 0x000200da, 0x000200da, 0x000200db, 0x000200db, 0x000200db, 0x000200db, }, + {0x00010008, 0x00010008, 0x00010024, 0x00010024, 0x0001003f, 0x0001003f, 0x0001005a, 0x0001005a, 0x00010074, 0x00010074, 0x000100c3, 0x000100c3, 0x000100dc, 0x000100dc, 0x000100f4, 0x000100f4, }, + {0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x00000009, 0x00000075, 0x0000008f, 0x000000a9, 0x000000dd, 0x000000f3, 0x000000f7, 0x000000f8, 0x0000010e, 0x0000010f, 0x00000111, }, + {0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, }, + {0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, }, + {0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, }, + {0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, 0x0067ffff, 0x0068ffff, 0x0069ffff, 0x006affff, 0x006bffff, 0x006cffff, 0x006dffff, 0x001bffff, 0x001affff, 0x001cffff, }, + {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, }, + {0x000102d4, 0x000102d4, 0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, + {0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x00020113, 0x00020113, 0x00020113, 0x00020113, 0x00020146, 0x00020146, 0x00020146, 0x00020146, 0x000202d8, 0x000202d8, 0x000202d8, 0x000202d8, }, + {0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0027ffff, 0x0025ffff, 0x0026ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, }, + {0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, }, + {0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, }, + {0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, + {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, + {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, }, + {0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, }, + {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, }, + {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, }, + {0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, }, + {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, + {0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, }, + {0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, }, + {0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, }, + {0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, }, + {0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, }, + {0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, }, + {0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, }, + {0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100df, 0x000100df, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, }, + {0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, }, + {0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f9, 0x000100f9, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, }, + {0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, }, + {0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, }, + {0x0001010d, 0x0001010d, 0x00010110, 0x00010110, 0x00010112, 0x00010112, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, + {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, + {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, + {0x00010129, 0x00010129, 0x0001012b, 0x0001012b, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, }, + {0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, }, + {0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, }, + {0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, }, + {0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, }, + {0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, }, + {0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, }, + {0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, }, + {0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, }, + {0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, }, + {0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, }, + {0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, }, + {0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, }, + {0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, }, + {0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, }, + {0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, }, + {0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, }, + {0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, }, + {0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, }, + {0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, }, + {0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, }, + {0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, }, + {0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, }, + {0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, }, + {0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, }, + {0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, }, + {0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, }, + {0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, }, + {0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, }, + {0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, }, + {0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, }, + {0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, }, + {0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, }, + {0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, }, + {0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, }, + {0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, }, + {0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, }, + {0x00010244, 0x00010244, 0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, }, + {0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, }, + {0x00010254, 0x00010254, 0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, }, + {0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, }, + {0x00010264, 0x00010264, 0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, }, + {0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, 0x00010271, 0x00010271, 0x00010272, 0x00010272, 0x00010273, 0x00010273, }, + {0x00010274, 0x00010274, 0x00010275, 0x00010275, 0x00010276, 0x00010276, 0x00010277, 0x00010277, 0x00010278, 0x00010278, 0x00010279, 0x00010279, 0x0001027a, 0x0001027a, 0x0001027b, 0x0001027b, }, + {0x0001027c, 0x0001027c, 0x0001027d, 0x0001027d, 0x0001027e, 0x0001027e, 0x0001027f, 0x0001027f, 0x00010280, 0x00010280, 0x00010281, 0x00010281, 0x00010282, 0x00010282, 0x00010283, 0x00010283, }, + {0x00010284, 0x00010284, 0x00010285, 0x00010285, 0x00010286, 0x00010286, 0x00010287, 0x00010287, 0x00010288, 0x00010288, 0x00010289, 0x00010289, 0x0001028a, 0x0001028a, 0x0001028b, 0x0001028b, }, + {0x0001028c, 0x0001028c, 0x0001028d, 0x0001028d, 0x0001028e, 0x0001028e, 0x0001028f, 0x0001028f, 0x00010290, 0x00010290, 0x00010291, 0x00010291, 0x00010292, 0x00010292, 0x00010293, 0x00010293, }, + {0x00010294, 0x00010294, 0x00010295, 0x00010295, 0x00010296, 0x00010296, 0x00010297, 0x00010297, 0x00010298, 0x00010298, 0x00010299, 0x00010299, 0x0001029a, 0x0001029a, 0x0001029b, 0x0001029b, }, + {0x0001029c, 0x0001029c, 0x0001029d, 0x0001029d, 0x0001029e, 0x0001029e, 0x0001029f, 0x0001029f, 0x000102a0, 0x000102a0, 0x000102a1, 0x000102a1, 0x000102a2, 0x000102a2, 0x000102a3, 0x000102a3, }, + {0x000102a4, 0x000102a4, 0x000102a5, 0x000102a5, 0x000102a6, 0x000102a6, 0x000102a7, 0x000102a7, 0x000102a8, 0x000102a8, 0x000102a9, 0x000102a9, 0x000102aa, 0x000102aa, 0x000102ab, 0x000102ab, }, + {0x000102ac, 0x000102ac, 0x000102ad, 0x000102ad, 0x000102ae, 0x000102ae, 0x000102af, 0x000102af, 0x000102b0, 0x000102b0, 0x000102b1, 0x000102b1, 0x000102b2, 0x000102b2, 0x000102b3, 0x000102b3, }, + {0x000102b4, 0x000102b4, 0x000102b5, 0x000102b5, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, }, + {0x000102bc, 0x000102bc, 0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, }, + {0x000102c4, 0x000102c4, 0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, }, + {0x000102cc, 0x000102cc, 0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, }, +}; + +const uint32_t c_aauiCQMFHuffEnc49[729][2] = +{ + {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0007}, {0x0007, 0x000a}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0009, 0x0009}, {0x000b, 0x000d}, + {0x000d, 0x0014}, {0x000d, 0x0015}, {0x0010, 0x0052}, {0x0011, 0x0098}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, + {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0005, 0x0008}, {0x0006, 0x000a}, {0x0007, 0x000b}, + {0x0008, 0x000b}, {0x0008, 0x000c}, {0x000a, 0x000a}, {0x000b, 0x000e}, {0x000d, 0x0016}, {0x000f, 0x0031}, {0x0010, 0x0053}, {0x0012, 0x012a}, + {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, + {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0005, 0x0009}, {0x0005, 0x000a}, + {0x0005, 0x000b}, {0x0006, 0x000b}, {0x0007, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x000a}, {0x000a, 0x000b}, {0x000c, 0x000f}, {0x000d, 0x0017}, + {0x000f, 0x0032}, {0x0010, 0x0054}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, + {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, + {0x0013, 0x002b}, {0x0007, 0x000d}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x000e}, {0x0009, 0x000b}, + {0x000b, 0x000f}, {0x000c, 0x0010}, {0x000e, 0x001d}, {0x000f, 0x0033}, {0x0011, 0x0099}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, + {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, + {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0008, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, + {0x0008, 0x0010}, {0x0009, 0x000c}, {0x000a, 0x000c}, {0x000c, 0x0011}, {0x000d, 0x0018}, {0x000e, 0x001e}, {0x0011, 0x009a}, {0x0011, 0x009b}, + {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, + {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0008, 0x0011}, + {0x0007, 0x0013}, {0x0008, 0x0012}, {0x0008, 0x0013}, {0x0009, 0x000d}, {0x000a, 0x000d}, {0x000b, 0x0010}, {0x000c, 0x0012}, {0x000e, 0x001f}, + {0x000e, 0x0020}, {0x0010, 0x0055}, {0x0011, 0x009c}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, + {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, + {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x000e}, {0x000b, 0x0011}, + {0x000c, 0x0013}, {0x000d, 0x0019}, {0x000e, 0x0021}, {0x0010, 0x0056}, {0x0010, 0x0057}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, + {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, + {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x000b, 0x0012}, {0x000a, 0x000f}, {0x000a, 0x0010}, + {0x000a, 0x0011}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000d, 0x001a}, {0x000e, 0x0022}, {0x0010, 0x0058}, {0x0010, 0x0059}, {0x0013, 0x0069}, + {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, + {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, + {0x000c, 0x0016}, {0x000b, 0x0013}, {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000e, 0x0023}, {0x000e, 0x0024}, {0x000f, 0x0034}, + {0x0010, 0x005a}, {0x0011, 0x009d}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, + {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, + {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x000e, 0x0025}, {0x000d, 0x001b}, {0x000d, 0x001c}, {0x000d, 0x001d}, {0x000e, 0x0026}, + {0x000f, 0x0035}, {0x0010, 0x005b}, {0x0011, 0x009e}, {0x0011, 0x009f}, {0x0012, 0x012b}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, + {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, + {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0010, 0x005c}, {0x000f, 0x0036}, + {0x000e, 0x0027}, {0x000f, 0x0037}, {0x000f, 0x0038}, {0x0010, 0x005d}, {0x0011, 0x00a0}, {0x0013, 0x009c}, {0x0012, 0x012c}, {0x0013, 0x009d}, + {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, + {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, + {0x0013, 0x00ae}, {0x0010, 0x005e}, {0x000f, 0x0039}, {0x0010, 0x005f}, {0x0010, 0x0060}, {0x0011, 0x00a1}, {0x0010, 0x0061}, {0x0013, 0x00af}, + {0x0013, 0x00b0}, {0x0012, 0x012d}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, + {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, + {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0012, 0x012e}, {0x0011, 0x00a2}, {0x0011, 0x00a3}, {0x0013, 0x00c3}, + {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, + {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, + {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, + {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0012, 0x012f}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, + {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, + {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, + {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, + {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, + {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, + {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, + {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, + {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, + {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, + {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, + {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, + {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, + {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, + {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, + {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, + {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, + {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, + {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, + {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, + {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, + {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, + {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, + {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, + {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, + {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, + {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, + {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, + {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, + {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, + {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, + {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, + {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, + {0x0013, 0x01e3}, {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, + {0x0013, 0x01eb}, {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, + {0x0013, 0x01f3}, {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, + {0x0013, 0x01fb}, {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, {0x0013, 0x01ff}, {0x0013, 0x0200}, {0x0013, 0x0201}, {0x0013, 0x0202}, + {0x0013, 0x0203}, {0x0013, 0x0204}, {0x0013, 0x0205}, {0x0013, 0x0206}, {0x0013, 0x0207}, {0x0013, 0x0208}, {0x0013, 0x0209}, {0x0013, 0x020a}, + {0x0013, 0x020b}, {0x0013, 0x020c}, {0x0013, 0x020d}, {0x0013, 0x020e}, {0x0013, 0x020f}, {0x0013, 0x0210}, {0x0013, 0x0211}, {0x0013, 0x0212}, + {0x0013, 0x0213}, {0x0013, 0x0214}, {0x0013, 0x0215}, {0x0013, 0x0216}, {0x0013, 0x0217}, {0x0013, 0x0218}, {0x0013, 0x0219}, {0x0013, 0x021a}, + {0x0013, 0x021b}, {0x0013, 0x021c}, {0x0013, 0x021d}, {0x0013, 0x021e}, {0x0013, 0x021f}, {0x0013, 0x0220}, {0x0013, 0x0221}, {0x0013, 0x0222}, + {0x0013, 0x0223}, {0x0013, 0x0224}, {0x0013, 0x0225}, {0x0013, 0x0226}, {0x0013, 0x0227}, {0x0013, 0x0228}, {0x0013, 0x0229}, {0x0013, 0x022a}, + {0x0013, 0x022b}, {0x0013, 0x022c}, {0x0013, 0x022d}, {0x0013, 0x022e}, {0x0013, 0x022f}, {0x0013, 0x0230}, {0x0013, 0x0231}, {0x0013, 0x0232}, + {0x0013, 0x0233}, {0x0013, 0x0234}, {0x0013, 0x0235}, {0x0013, 0x0236}, {0x0013, 0x0237}, {0x0013, 0x0238}, {0x0013, 0x0239}, {0x0013, 0x023a}, + {0x0013, 0x023b}, {0x0013, 0x023c}, {0x0013, 0x023d}, {0x0013, 0x023e}, {0x0013, 0x023f}, {0x0013, 0x0240}, {0x0013, 0x0241}, {0x0013, 0x0242}, + {0x0013, 0x0243}, {0x0013, 0x0244}, {0x0013, 0x0245}, {0x0013, 0x0246}, {0x0013, 0x0247}, {0x0013, 0x0248}, {0x0013, 0x0249}, {0x0013, 0x024a}, + {0x0013, 0x024b}, {0x0013, 0x024c}, {0x0013, 0x024d}, {0x0013, 0x024e}, {0x0013, 0x024f}, {0x0013, 0x0250}, {0x0013, 0x0251}, {0x0013, 0x0252}, + {0x0013, 0x0253}, + +}; + +const uint32_t c_aauiCQMFHuffDec49[113][16] = +{ + {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, + {0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010088, 0x00010088, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x00000070, 0x00000087, 0x00000089, 0x0000008a, 0x00010003, 0x00010003, 0x0001001f, 0x0001001f, 0x0001003a, 0x0001003a, 0x00010051, 0x00010051, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, + {0x000fffff, 0x000effff, 0x000cffff, 0x000dffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x00000004, 0x00000005, 0x00000020, 0x00000021, 0x0000003b, 0x00000056, 0x0000006c, }, + {0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, + {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, }, + {0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, + {0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, }, + {0x0001008d, 0x0001008d, 0x000100a7, 0x000100a7, 0x000100bd, 0x000100bd, 0x000100d9, 0x000100d9, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, + {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200be, 0x000200be, 0x000200be, 0x000200be, }, + {0x00000059, 0x00000073, 0x0000008e, 0x000000a8, 0x000000c1, 0x000000c2, 0x000000d8, 0x000000da, 0x000000db, 0x000000dc, 0x00010007, 0x00010007, 0x00010023, 0x00010023, 0x00010058, 0x00010058, }, + {0x0023ffff, 0x0034ffff, 0x0045ffff, 0x0056ffff, 0x001affff, 0x0019ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0011ffff, 0x0010ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0000003e, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, + {0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, }, + {0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, }, + {0x00010112, 0x00010112, 0x0001012a, 0x0001012a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, }, + {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, }, + {0x000200de, 0x000200de, 0x000200de, 0x000200de, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f7, 0x000200f7, 0x000200f7, 0x000200f7, 0x00020110, 0x00020110, 0x00020110, 0x00020110, }, + {0x0000012c, 0x0000012e, 0x00010025, 0x00010025, 0x00010040, 0x00010040, 0x0001005b, 0x0001005b, 0x000100df, 0x000100df, 0x000100f8, 0x000100f8, 0x0001010f, 0x0001010f, 0x00010111, 0x00010111, }, + {0x001fffff, 0x0020ffff, 0x0000000a, 0x00000026, 0x00000041, 0x00000091, 0x000000ab, 0x000000ac, 0x000000c5, 0x000000c6, 0x000000e0, 0x000000f9, 0x0000010e, 0x00000113, 0x00000129, 0x0000012b, }, + {0x0067ffff, 0x0068ffff, 0x0069ffff, 0x006affff, 0x006bffff, 0x006cffff, 0x006dffff, 0x006effff, 0x006fffff, 0x0070ffff, 0x0021ffff, 0x0022ffff, 0x001cffff, 0x001bffff, 0x001dffff, 0x001effff, }, + {0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, + {0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, }, + {0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, }, + {0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, }, + {0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, }, + {0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x000102d8, 0x000102d8, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, }, + {0x00020116, 0x00020116, 0x00020116, 0x00020116, 0x00020131, 0x00020131, 0x00020131, 0x00020131, 0x00020144, 0x00020144, 0x00020144, 0x00020144, 0x00020164, 0x00020164, 0x00020164, 0x00020164, }, + {0x0025ffff, 0x0026ffff, 0x0028ffff, 0x002affff, 0x002effff, 0x0029ffff, 0x0027ffff, 0x0033ffff, 0x002dffff, 0x0024ffff, 0x002bffff, 0x002cffff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, }, + {0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, + {0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, + {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x00010028, 0x00010028, }, + {0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, }, + {0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, }, + {0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, }, + {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, + {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, + {0x000100a1, 0x000100a1, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, + {0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, }, + {0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, }, + {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, + {0x000100bc, 0x000100bc, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, }, + {0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, + {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, }, + {0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, }, + {0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, }, + {0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, + {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, }, + {0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, }, + {0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x00010115, 0x00010115, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, }, + {0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, }, + {0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x0001012f, 0x0001012f, }, + {0x00010130, 0x00010130, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, + {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, + {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, }, + {0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, }, + {0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, }, + {0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, }, + {0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, }, + {0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, }, + {0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, }, + {0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, }, + {0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, }, + {0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, }, + {0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, }, + {0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, }, + {0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, }, + {0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, }, + {0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, }, + {0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, }, + {0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, }, + {0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, }, + {0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, }, + {0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, }, + {0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, }, + {0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, }, + {0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, }, + {0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, }, + {0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, }, + {0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, }, + {0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, }, + {0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, }, + {0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, }, + {0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, }, + {0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, }, + {0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, }, + {0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, }, + {0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, }, + {0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, }, + {0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, }, + {0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, }, + {0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, }, + {0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, }, + {0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, 0x00010271, 0x00010271, 0x00010272, 0x00010272, 0x00010273, 0x00010273, 0x00010274, 0x00010274, }, + {0x00010275, 0x00010275, 0x00010276, 0x00010276, 0x00010277, 0x00010277, 0x00010278, 0x00010278, 0x00010279, 0x00010279, 0x0001027a, 0x0001027a, 0x0001027b, 0x0001027b, 0x0001027c, 0x0001027c, }, + {0x0001027d, 0x0001027d, 0x0001027e, 0x0001027e, 0x0001027f, 0x0001027f, 0x00010280, 0x00010280, 0x00010281, 0x00010281, 0x00010282, 0x00010282, 0x00010283, 0x00010283, 0x00010284, 0x00010284, }, + {0x00010285, 0x00010285, 0x00010286, 0x00010286, 0x00010287, 0x00010287, 0x00010288, 0x00010288, 0x00010289, 0x00010289, 0x0001028a, 0x0001028a, 0x0001028b, 0x0001028b, 0x0001028c, 0x0001028c, }, + {0x0001028d, 0x0001028d, 0x0001028e, 0x0001028e, 0x0001028f, 0x0001028f, 0x00010290, 0x00010290, 0x00010291, 0x00010291, 0x00010292, 0x00010292, 0x00010293, 0x00010293, 0x00010294, 0x00010294, }, + {0x00010295, 0x00010295, 0x00010296, 0x00010296, 0x00010297, 0x00010297, 0x00010298, 0x00010298, 0x00010299, 0x00010299, 0x0001029a, 0x0001029a, 0x0001029b, 0x0001029b, 0x0001029c, 0x0001029c, }, + {0x0001029d, 0x0001029d, 0x0001029e, 0x0001029e, 0x0001029f, 0x0001029f, 0x000102a0, 0x000102a0, 0x000102a1, 0x000102a1, 0x000102a2, 0x000102a2, 0x000102a3, 0x000102a3, 0x000102a4, 0x000102a4, }, + {0x000102a5, 0x000102a5, 0x000102a6, 0x000102a6, 0x000102a7, 0x000102a7, 0x000102a8, 0x000102a8, 0x000102a9, 0x000102a9, 0x000102aa, 0x000102aa, 0x000102ab, 0x000102ab, 0x000102ac, 0x000102ac, }, + {0x000102ad, 0x000102ad, 0x000102ae, 0x000102ae, 0x000102af, 0x000102af, 0x000102b0, 0x000102b0, 0x000102b1, 0x000102b1, 0x000102b2, 0x000102b2, 0x000102b3, 0x000102b3, 0x000102b4, 0x000102b4, }, + {0x000102b5, 0x000102b5, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, 0x000102bc, 0x000102bc, }, + {0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, 0x000102c4, 0x000102c4, }, + {0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, 0x000102cc, 0x000102cc, }, + {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, +}; + +const uint32_t c_aauiCQMFHuffEnc50[28][2] = +{ + {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, + {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, + {0x0011, 0x0003}, {0x0012, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, + +}; + +const uint32_t c_aauiCQMFHuffDec50[6][16] = +{ + {0x0001ffff, 0x00000004, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, + {0x0002ffff, 0x00000008, 0x00010007, 0x00010007, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x0003ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0005ffff, 0x0004ffff, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, + {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, }, +}; + +const uint32_t c_aauiCQMFHuffEnc51[29][2] = +{ + {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, + {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, + {0x000e, 0x0001}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0013, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + +}; + +const uint32_t c_aauiCQMFHuffDec51[6][16] = +{ + {0x0001ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0002ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0004ffff, 0x0005ffff, 0x00000011, 0x00000012, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, + {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, +}; + +const uint32_t c_aauiCQMFHuffEnc52[32][2] = +{ + {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0005, 0x0002}, + {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, + {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0014, 0x0000}, + {0x0013, 0x0003}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0004}, {0x0013, 0x0005}, +}; + +const uint32_t c_aauiCQMFHuffDec52[7][16] = +{ + {0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0003ffff, 0x0000000b, 0x0001000a, 0x0001000a, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x0004ffff, 0x0000000f, 0x0001000e, 0x0001000e, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0006ffff, 0x0005ffff, 0x00010013, 0x00010013, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00000017, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, +}; + +const uint32_t c_aauiCQMFHuffEnc53[37][2] = +{ + {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0002}, {0x0005, 0x0003}, + {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000b, 0x0002}, + {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0002}, + {0x000f, 0x0003}, {0x0011, 0x0004}, {0x0010, 0x0003}, {0x0011, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0001}, {0x0012, 0x0002}, + {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + +}; + +const uint32_t c_aauiCQMFHuffDec53[9][16] = +{ + {0x0002ffff, 0x0001ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x0003ffff, 0x0000000d, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, + {0x0005ffff, 0x0004ffff, 0x00000011, 0x00000012, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x0007ffff, 0x0008ffff, 0x0006ffff, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, + {0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, +}; + +const uint32_t c_aauiCQMFHuffEnc54[39][2] = +{ + {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, + {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0008, 0x0002}, + {0x0008, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, + {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0002}, {0x000f, 0x0003}, {0x0011, 0x0002}, {0x0010, 0x0002}, {0x0010, 0x0003}, + {0x0011, 0x0003}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + +}; + +const uint32_t c_aauiCQMFHuffDec54[9][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x0004ffff, 0x0000000e, 0x0000000f, 0x00000010, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, + {0x0006ffff, 0x0005ffff, 0x00000015, 0x00000016, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, + {0x0008ffff, 0x0007ffff, 0x0000001e, 0x0000001f, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, + {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, +}; + +const uint32_t c_aauiCQMFHuffEnc55[46][2] = +{ + {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, + {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0007, 0x0004}, + {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, + {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0003}, + {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, + {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + +}; + +const uint32_t c_aauiCQMFHuffDec55[10][16] = +{ + {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0005ffff, 0x0004ffff, 0x00000011, 0x00000012, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, + {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, + {0x0007ffff, 0x0006ffff, 0x00000019, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0009ffff, 0x0008ffff, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x0001001f, 0x0001001f, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, + {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, +}; + +const uint32_t c_aauiCQMFHuffEnc56[55][2] = +{ + {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0005, 0x0004}, + {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0003}, {0x0007, 0x0004}, + {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, + {0x000a, 0x0003}, {0x000b, 0x0003}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, + {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, + {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0013, 0x0000}, {0x0011, 0x0003}, {0x0012, 0x0005}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, + +}; + +const uint32_t c_aauiCQMFHuffDec56[12][16] = +{ + {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000004, 0x00000005, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0006ffff, 0x0005ffff, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, + {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x00010019, 0x00010019, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, }, + {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, + {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, + {0x000bffff, 0x000affff, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, }, +}; + +const uint32_t c_aauiCQMFHuffEnc57[65][2] = +{ + {0x0003, 0x0004}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0004}, + {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, + {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, + {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, + {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000d, 0x0003}, {0x000c, 0x0005}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0003}, {0x000e, 0x0004}, + {0x000e, 0x0005}, {0x000f, 0x0003}, {0x0010, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0013, 0x0000}, + {0x0011, 0x0005}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0012, 0x0007}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0012, 0x0008}, {0x0012, 0x0009}, + {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, + {0x0013, 0x000d}, + +}; + +const uint32_t c_aauiCQMFHuffDec57[14][16] = +{ + {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000014, 0x00000015, 0x00000016, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, + {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, + {0x000affff, 0x0008ffff, 0x0009ffff, 0x00000020, 0x00000021, 0x00000023, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, + {0x000dffff, 0x000cffff, 0x000bffff, 0x0000002a, 0x0000002d, 0x0000002e, 0x00010029, 0x00010029, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, + {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, + {0x0001002f, 0x0001002f, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, +}; + +const uint32_t c_aauiCQMFHuffEnc58[77][2] = +{ + {0x0004, 0x0005}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, + {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, + {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, + {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, + {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, + {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, + {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, {0x0010, 0x0004}, {0x000f, 0x0007}, {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, + {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0006}, {0x0011, 0x0007}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + {0x0012, 0x0007}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0012, 0x0008}, + {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, + +}; + +const uint32_t c_aauiCQMFHuffDec58[17][16] = +{ + {0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, + {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, + {0x0008ffff, 0x0006ffff, 0x0007ffff, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, + {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, + {0x000cffff, 0x000bffff, 0x0009ffff, 0x000affff, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, }, + {0x0010ffff, 0x000effff, 0x000fffff, 0x000dffff, 0x00000033, 0x00000035, 0x00000036, 0x00000037, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, }, + {0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, + {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, + {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, +}; + +const uint32_t c_aauiCQMFHuffEnc59[91][2] = +{ + {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0006}, + {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, + {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, + {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, + {0x0008, 0x0009}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, + {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0003}, + {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000f, 0x0003}, + {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0013, 0x0000}, {0x0011, 0x000a}, {0x0013, 0x0001}, {0x0013, 0x0002}, + {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0011, 0x000b}, {0x0013, 0x0006}, {0x0013, 0x0007}, + {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, + {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, + {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0012, 0x000f}, + +}; + +const uint32_t c_aauiCQMFHuffDec59[20][16] = +{ + {0x0006ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x0009ffff, 0x0008ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, + {0x000dffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, }, + {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, + {0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, + {0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, }, + {0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, +}; + +const uint32_t c_aauiCQMFHuffEnc60[109][2] = +{ + {0x0004, 0x0007}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, + {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, + {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, + {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, + {0x0008, 0x000b}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, + {0x0009, 0x000b}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, + {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000c, 0x0007}, + {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000f, 0x0005}, {0x000e, 0x0009}, {0x000f, 0x0006}, {0x0010, 0x0006}, + {0x000f, 0x0007}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x0010, 0x0007}, {0x0010, 0x0008}, {0x0010, 0x0009}, {0x0011, 0x000a}, {0x0013, 0x0000}, + {0x0011, 0x000b}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, + {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, + {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0012, 0x0013}, + +}; + +const uint32_t c_aauiCQMFHuffDec60[24][16] = +{ + {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, + {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, + {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, + {0x000dffff, 0x000cffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00010013, 0x00010013, 0x00010014, 0x00010014, }, + {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, + {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, + {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, + {0x0011ffff, 0x0010ffff, 0x000fffff, 0x000effff, 0x00000031, 0x00000032, 0x00000033, 0x00000037, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, }, + {0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0013ffff, 0x0012ffff, 0x0000003f, 0x00000043, 0x00000044, 0x00000045, 0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, 0x00010040, 0x00010040, }, + {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, + {0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, + {0x00010047, 0x00010047, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, + {0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, + {0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, }, + {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, }, +}; + +const uint32_t c_aauiCQMFHuffEnc61[129][2] = +{ + {0x0004, 0x0008}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0008}, {0x0005, 0x0009}, + {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x0008}, {0x0006, 0x0009}, + {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0007, 0x0008}, {0x0007, 0x0009}, + {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0006}, {0x0008, 0x0007}, + {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, + {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x000a, 0x0005}, {0x000a, 0x0006}, + {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, + {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0005}, {0x000d, 0x0006}, + {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000e, 0x0008}, {0x000d, 0x000b}, {0x000e, 0x0009}, {0x000f, 0x0009}, + {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x0010, 0x000c}, {0x0011, 0x0015}, {0x0010, 0x000d}, + {0x000f, 0x000f}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0012, 0x0000}, {0x0011, 0x0016}, {0x0010, 0x0010}, {0x0010, 0x0011}, {0x0011, 0x0017}, + {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, + {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, + {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, + {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, + {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, + {0x0012, 0x0029}, + +}; + +const uint32_t c_aauiCQMFHuffDec61[33][16] = +{ + {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00000005, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, + {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, + {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, + {0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, }, + {0x000effff, 0x000cffff, 0x000dffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, }, + {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, + {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, + {0x0014ffff, 0x0013ffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, }, + {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, + {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, + {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, + {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, + {0x00000055, 0x00000056, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00010050, 0x00010050, }, + {0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0016ffff, 0x0015ffff, 0x0000004d, 0x0000004f, 0x00000051, 0x00000052, }, + {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, + {0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, + {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, + {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, + {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, + {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, + {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, }, + {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, + {0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, }, + {0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, + {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, + {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, }, +}; + +const uint32_t c_aauiCQMFHuffEnc62[153][2] = +{ + {0x0004, 0x0009}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, + {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, + {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0007, 0x0009}, + {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, + {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, + {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, + {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x0004}, {0x000a, 0x0005}, + {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, + {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000d, 0x0007}, + {0x000c, 0x000d}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000e, 0x0008}, {0x000d, 0x000c}, {0x000d, 0x000d}, + {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000f, 0x000c}, {0x000e, 0x000d}, {0x000f, 0x000d}, {0x000f, 0x000e}, + {0x000f, 0x000f}, {0x0010, 0x000f}, {0x0010, 0x0010}, {0x0011, 0x0019}, {0x0010, 0x0011}, {0x0010, 0x0012}, {0x0010, 0x0013}, {0x0010, 0x0014}, + {0x0010, 0x0015}, {0x0012, 0x0000}, {0x0010, 0x0016}, {0x0011, 0x001a}, {0x0010, 0x0017}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, + {0x0011, 0x001b}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, + {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, + {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0011, 0x001c}, {0x0012, 0x0019}, + {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, {0x0012, 0x0021}, + {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, {0x0012, 0x0029}, + {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, {0x0012, 0x002f}, {0x0012, 0x0030}, {0x0012, 0x0031}, + {0x0011, 0x001d}, + +}; + +const uint32_t c_aauiCQMFHuffDec62[41][16] = +{ + {0x0009ffff, 0x0008ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, + {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, + {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, + {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, + {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, + {0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, + {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, + {0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, + {0x00000029, 0x0000002a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, }, + {0x0012ffff, 0x0010ffff, 0x0011ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, }, + {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, + {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, + {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, + {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, + {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, + {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, + {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, + {0x0019ffff, 0x0018ffff, 0x0017ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000048, 0x00010040, 0x00010040, }, + {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, + {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, + {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, + {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, + {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, + {0x0000005a, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000062, 0x00000064, 0x00010054, 0x00010054, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, }, + {0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x00000059, }, + {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, + {0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, + {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, + {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, }, + {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, + {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, }, + {0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, + {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, + {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, }, + {0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, + {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, + {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, + {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, + {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, + {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, +}; + +const uint32_t c_aauiCQMFHuffEnc63[181][2] = +{ + {0x0004, 0x0008}, {0x0003, 0x0005}, {0x0002, 0x0003}, {0x0004, 0x0009}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, + {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, + {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, + {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, + {0x0007, 0x0017}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0008, 0x0012}, + {0x0008, 0x0013}, {0x0008, 0x0014}, {0x0008, 0x0015}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, + {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x0009, 0x0012}, {0x0009, 0x0013}, {0x0009, 0x0014}, + {0x0009, 0x0015}, {0x000a, 0x0007}, {0x0009, 0x0016}, {0x0009, 0x0017}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, + {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000a, 0x000f}, {0x000b, 0x000b}, + {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000c, 0x000e}, + {0x000c, 0x000f}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, + {0x000d, 0x000f}, {0x000d, 0x0010}, {0x000d, 0x0011}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, + {0x000e, 0x000c}, {0x000e, 0x000d}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, + {0x000f, 0x000c}, {0x0010, 0x0009}, {0x0010, 0x000a}, {0x000f, 0x000d}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0011, 0x000e}, + {0x0011, 0x000f}, {0x0010, 0x000e}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0012, 0x0014}, {0x0014, 0x0000}, {0x0010, 0x000f}, {0x0012, 0x0015}, + {0x0012, 0x0016}, {0x0014, 0x0001}, {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0013, 0x0010}, {0x0012, 0x001a}, {0x0014, 0x0002}, + {0x0012, 0x001b}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0011}, {0x0014, 0x0006}, {0x0013, 0x0012}, {0x0014, 0x0007}, + {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0013, 0x0013}, + {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, + {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, + {0x0014, 0x001f}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, + {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, + {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, + +}; + +const uint32_t c_aauiCQMFHuffDec63[39][16] = +{ + {0x0008ffff, 0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x00000000, 0x00000003, 0x00010001, 0x00010001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, + {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, + {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, + {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, + {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, + {0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, }, + {0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, }, + {0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x00000021, 0x00000022, 0x00000023, 0x00000024, }, + {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, + {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, + {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, + {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, + {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, + {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, + {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, + {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, + {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, + {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, + {0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020046, 0x00020046, 0x00020046, 0x00020046, }, + {0x001dffff, 0x001affff, 0x001bffff, 0x001cffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, }, + {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, + {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, + {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, + {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, + {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, + {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x0001006b, 0x0001006b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, + {0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, }, + {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, }, + {0x0026ffff, 0x0025ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0020ffff, 0x0021ffff, 0x001effff, 0x001fffff, 0x00000069, 0x0000006a, 0x0000006c, 0x0000006d, 0x0000006e, 0x00000071, 0x00000076, }, + {0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, + {0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, + {0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, + {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, + {0x0001007d, 0x0001007d, 0x00010084, 0x00010084, 0x00010086, 0x00010086, 0x0001008f, 0x0001008f, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, }, + {0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, }, + {0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, }, + {0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, }, + {0x00000075, 0x00000079, 0x0000007f, 0x00000081, 0x00000082, 0x00000083, 0x00000085, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, }, +}; + +const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = { + NULL, + c_aauiCQMFHuffEnc1, + c_aauiCQMFHuffEnc2, + c_aauiCQMFHuffEnc3, + c_aauiCQMFHuffEnc4, + c_aauiCQMFHuffEnc5, + c_aauiCQMFHuffEnc6, + c_aauiCQMFHuffEnc7, + c_aauiCQMFHuffEnc8, + c_aauiCQMFHuffEnc9, + c_aauiCQMFHuffEnc10, + c_aauiCQMFHuffEnc11, + c_aauiCQMFHuffEnc12, + c_aauiCQMFHuffEnc13, + c_aauiCQMFHuffEnc14, + c_aauiCQMFHuffEnc15, + c_aauiCQMFHuffEnc16, + c_aauiCQMFHuffEnc17, + c_aauiCQMFHuffEnc18, + c_aauiCQMFHuffEnc19, + c_aauiCQMFHuffEnc20, + c_aauiCQMFHuffEnc21, + c_aauiCQMFHuffEnc22, + c_aauiCQMFHuffEnc23, + c_aauiCQMFHuffEnc24, + c_aauiCQMFHuffEnc25, + c_aauiCQMFHuffEnc26, + c_aauiCQMFHuffEnc27, + c_aauiCQMFHuffEnc28, + c_aauiCQMFHuffEnc29, + c_aauiCQMFHuffEnc30, + c_aauiCQMFHuffEnc31, + NULL, + c_aauiCQMFHuffEnc33, + c_aauiCQMFHuffEnc34, + c_aauiCQMFHuffEnc35, + c_aauiCQMFHuffEnc36, + c_aauiCQMFHuffEnc37, + c_aauiCQMFHuffEnc38, + c_aauiCQMFHuffEnc39, + c_aauiCQMFHuffEnc40, + c_aauiCQMFHuffEnc41, + c_aauiCQMFHuffEnc42, + c_aauiCQMFHuffEnc43, + c_aauiCQMFHuffEnc44, + c_aauiCQMFHuffEnc45, + c_aauiCQMFHuffEnc46, + c_aauiCQMFHuffEnc47, + c_aauiCQMFHuffEnc48, + c_aauiCQMFHuffEnc49, + c_aauiCQMFHuffEnc50, + c_aauiCQMFHuffEnc51, + c_aauiCQMFHuffEnc52, + c_aauiCQMFHuffEnc53, + c_aauiCQMFHuffEnc54, + c_aauiCQMFHuffEnc55, + c_aauiCQMFHuffEnc56, + c_aauiCQMFHuffEnc57, + c_aauiCQMFHuffEnc58, + c_aauiCQMFHuffEnc59, + c_aauiCQMFHuffEnc60, + c_aauiCQMFHuffEnc61, + c_aauiCQMFHuffEnc62, + c_aauiCQMFHuffEnc63, +}; + +const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] = { + NULL, + c_aauiCQMFHuffDec1, + c_aauiCQMFHuffDec2, + c_aauiCQMFHuffDec3, + c_aauiCQMFHuffDec4, + c_aauiCQMFHuffDec5, + c_aauiCQMFHuffDec6, + c_aauiCQMFHuffDec7, + c_aauiCQMFHuffDec8, + c_aauiCQMFHuffDec9, + c_aauiCQMFHuffDec10, + c_aauiCQMFHuffDec11, + c_aauiCQMFHuffDec12, + c_aauiCQMFHuffDec13, + c_aauiCQMFHuffDec14, + c_aauiCQMFHuffDec15, + c_aauiCQMFHuffDec16, + c_aauiCQMFHuffDec17, + c_aauiCQMFHuffDec18, + c_aauiCQMFHuffDec19, + c_aauiCQMFHuffDec20, + c_aauiCQMFHuffDec21, + c_aauiCQMFHuffDec22, + c_aauiCQMFHuffDec23, + c_aauiCQMFHuffDec24, + c_aauiCQMFHuffDec25, + c_aauiCQMFHuffDec26, + c_aauiCQMFHuffDec27, + c_aauiCQMFHuffDec28, + c_aauiCQMFHuffDec29, + c_aauiCQMFHuffDec30, + c_aauiCQMFHuffDec31, + NULL, + c_aauiCQMFHuffDec33, + c_aauiCQMFHuffDec34, + c_aauiCQMFHuffDec35, + c_aauiCQMFHuffDec36, + c_aauiCQMFHuffDec37, + c_aauiCQMFHuffDec38, + c_aauiCQMFHuffDec39, + c_aauiCQMFHuffDec40, + c_aauiCQMFHuffDec41, + c_aauiCQMFHuffDec42, + c_aauiCQMFHuffDec43, + c_aauiCQMFHuffDec44, + c_aauiCQMFHuffDec45, + c_aauiCQMFHuffDec46, + c_aauiCQMFHuffDec47, + c_aauiCQMFHuffDec48, + c_aauiCQMFHuffDec49, + c_aauiCQMFHuffDec50, + c_aauiCQMFHuffDec51, + c_aauiCQMFHuffDec52, + c_aauiCQMFHuffDec53, + c_aauiCQMFHuffDec54, + c_aauiCQMFHuffDec55, + c_aauiCQMFHuffDec56, + c_aauiCQMFHuffDec57, + c_aauiCQMFHuffDec58, + c_aauiCQMFHuffDec59, + c_aauiCQMFHuffDec60, + c_aauiCQMFHuffDec61, + c_aauiCQMFHuffDec62, + c_aauiCQMFHuffDec63, +}; + +#ifdef USE_DEMOD_TABLES +const int32_t c_aaiHuffDemod1[16][2] = { + 0,0,0,1,0,2,0,3,1,0,1,1,1,2,1,3,2,0,2,1,2,2,2,3,3,0,3,1,3,2,3,3, +}; + +const int32_t c_aaiHuffDemod2[16][2] = { + 0,0,0,1,0,2,0,3,1,0,1,1,1,2,1,3,2,0,2,1,2,2,2,3,3,0,3,1,3,2,3,3, +}; + +const int32_t c_aaiHuffDemod3[25][2] = { + 0,0,0,1,0,2,0,3,0,4,1,0,1,1,1,2,1,3,1,4,2,0,2,1,2,2,2,3,2,4,3,0, + 3,1,3,2,3,3,3,4,4,0,4,1,4,2,4,3,4,4, +}; + +const int32_t c_aaiHuffDemod4[36][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,1,0,1,1,1,2,1,3,1,4,1,5,2,0,2,1,2,2,2,3, + 2,4,2,5,3,0,3,1,3,2,3,3,3,4,3,5,4,0,4,1,4,2,4,3,4,4,4,5,5,0,5,1, + 5,2,5,3,5,4,5,5, +}; + +const int32_t c_aaiHuffDemod5[36][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,1,0,1,1,1,2,1,3,1,4,1,5,2,0,2,1,2,2,2,3, + 2,4,2,5,3,0,3,1,3,2,3,3,3,4,3,5,4,0,4,1,4,2,4,3,4,4,4,5,5,0,5,1, + 5,2,5,3,5,4,5,5, +}; + +const int32_t c_aaiHuffDemod6[49][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,1,0,1,1,1,2,1,3,1,4,1,5,1,6,2,0,2,1, + 2,2,2,3,2,4,2,5,2,6,3,0,3,1,3,2,3,3,3,4,3,5,3,6,4,0,4,1,4,2,4,3, + 4,4,4,5,4,6,5,0,5,1,5,2,5,3,5,4,5,5,5,6,6,0,6,1,6,2,6,3,6,4,6,5, + 6,6, +}; + +const int32_t c_aaiHuffDemod7[64][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7, + 2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7, + 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7, + 6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7, +}; + +const int32_t c_aaiHuffDemod8[81][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,1,0,1,1,1,2,1,3,1,4,1,5,1,6, + 1,7,1,8,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,3,0,3,1,3,2,3,3,3,4, + 3,5,3,6,3,7,3,8,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,5,0,5,1,5,2, + 5,3,5,4,5,5,5,6,5,7,5,8,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,7,0, + 7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, + 8,8, +}; + +const int32_t c_aaiHuffDemod9[100][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,1,0,1,1,1,2,1,3,1,4,1,5, + 1,6,1,7,1,8,1,9,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,3,0,3,1, + 3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, + 4,8,4,9,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,6,0,6,1,6,2,6,3, + 6,4,6,5,6,6,6,7,6,8,6,9,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9, + 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,9,0,9,1,9,2,9,3,9,4,9,5, + 9,6,9,7,9,8,9,9, +}; + +const int32_t c_aaiHuffDemod10[169][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,1,0,1,1,1,2, + 1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,2,0,2,1,2,2,2,3,2,4,2,5, + 2,6,2,7,2,8,2,9,2,10,2,11,2,12,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8, + 3,9,3,10,3,11,3,12,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11, + 4,12,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10,5,11,5,12,6,0,6,1, + 6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,7,0,7,1,7,2,7,3,7,4, + 7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, + 8,8,8,9,8,10,8,11,8,12,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10, + 9,11,9,12,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,11,0, + 11,1,11,2,11,3,11,4,11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,12,0,12,1,12,2,12,3, + 12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12, +}; + +const int32_t c_aaiHuffDemod11[196][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,1,0,1,1, + 1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,2,0,2,1,2,2,2,3, + 2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,3,0,3,1,3,2,3,3,3,4,3,5, + 3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, + 4,8,4,9,4,10,4,11,4,12,4,13,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9, + 5,10,5,11,5,12,5,13,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11, + 6,12,6,13,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13, + 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,9,0,9,1, + 9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12,9,13,10,0,10,1,10,2,10,3, + 10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,11,0,11,1,11,2,11,3,11,4,11,5, + 11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7, + 12,8,12,9,12,10,12,11,12,12,12,13,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9, + 13,10,13,11,13,12,13,13, +}; + +const int32_t c_aaiHuffDemod12[289][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14, + 1,15,1,16,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13, + 2,14,2,15,2,16,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12, + 3,13,3,14,3,15,3,16,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11, + 4,12,4,13,4,14,4,15,4,16,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10, + 5,11,5,12,5,13,5,14,5,15,5,16,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9, + 6,10,6,11,6,12,6,13,6,14,6,15,6,16,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8, + 7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, + 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,9,0,9,1,9,2,9,3,9,4,9,5,9,6, + 9,7,9,8,9,9,9,10,9,11,9,12,9,13,9,14,9,15,9,16,10,0,10,1,10,2,10,3,10,4,10,5, + 10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,11,0,11,1,11,2,11,3,11,4, + 11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,12,0,12,1,12,2,12,3, + 12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12,16,13,0,13,1,13,2, + 13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,14,0,14,1, + 14,2,14,3,14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,15,0, + 15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16, +}; + +const int32_t c_aaiHuffDemod13[324][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,0,17,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13, + 1,14,1,15,1,16,1,17,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11, + 2,12,2,13,2,14,2,15,2,16,2,17,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9, + 3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, + 4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,5,0,5,1,5,2,5,3,5,4,5,5, + 5,6,5,7,5,8,5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,6,0,6,1,6,2,6,3, + 6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15,6,16,6,17,7,0,7,1, + 7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17, + 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, + 8,16,8,17,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12,9,13, + 9,14,9,15,9,16,9,17,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11, + 10,12,10,13,10,14,10,15,10,16,10,17,11,0,11,1,11,2,11,3,11,4,11,5,11,6,11,7,11,8,11,9, + 11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7, + 12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12,16,12,17,13,0,13,1,13,2,13,3,13,4,13,5, + 13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,13,17,14,0,14,1,14,2,14,3, + 14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,15,0,15,1, + 15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16,16,17,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13, + 17,14,17,15,17,16,17,17, +}; + +const int32_t c_aaiHuffDemod14[400][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,0,17,0,18,0,19,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11, + 1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7, + 2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,3,0,3,1,3,2,3,3, + 3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,3,18,3,19, + 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15, + 4,16,4,17,4,18,4,19,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10,5,11, + 5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7, + 6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15,6,16,6,17,6,18,6,19,7,0,7,1,7,2,7,3, + 7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18,7,19, + 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, + 8,16,8,17,8,18,8,19,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11, + 9,12,9,13,9,14,9,15,9,16,9,17,9,18,9,19,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7, + 10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17,10,18,10,19,11,0,11,1,11,2,11,3, + 11,4,11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19, + 12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15, + 12,16,12,17,12,18,12,19,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11, + 13,12,13,13,13,14,13,15,13,16,13,17,13,18,13,19,14,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7, + 14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,15,0,15,1,15,2,15,3, + 15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16,16,17,16,18,16,19,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7,17,8,17,9,17,10,17,11, + 17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7, + 18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,19,0,19,1,19,2,19,3, + 19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14,19,15,19,16,19,17,19,18,19,19, +}; + +const int32_t c_aaiHuffDemod15[576][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7, + 1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20,1,21,1,22,1,23, + 2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15, + 2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7, + 3,8,3,9,3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23, + 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15, + 4,16,4,17,4,18,4,19,4,20,4,21,4,22,4,23,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7, + 5,8,5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23, + 6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15, + 6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7, + 7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18,7,19,7,20,7,21,7,22,7,23, + 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, + 8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7, + 9,8,9,9,9,10,9,11,9,12,9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23, + 10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15, + 10,16,10,17,10,18,10,19,10,20,10,21,10,22,10,23,11,0,11,1,11,2,11,3,11,4,11,5,11,6,11,7, + 11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22,11,23, + 12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15, + 12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7, + 13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,13,17,13,18,13,19,13,20,13,21,13,22,13,23, + 14,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15, + 14,16,14,17,14,18,14,19,14,20,14,21,14,22,14,23,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7, + 15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7, + 17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20,17,21,17,22,17,23, + 18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15, + 18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7, + 19,8,19,9,19,10,19,11,19,12,19,13,19,14,19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23, + 20,0,20,1,20,2,20,3,20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15, + 20,16,20,17,20,18,20,19,20,20,20,21,20,22,20,23,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7, + 21,8,21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23, + 22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13,22,14,22,15, + 22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,23,0,23,1,23,2,23,3,23,4,23,5,23,6,23,7, + 23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18,23,19,23,20,23,21,23,22,23,23, +}; + +const int32_t c_aaiHuffDemod16[729][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,1,0,1,1,1,2,1,3,1,4, + 1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20, + 1,21,1,22,1,23,1,24,1,25,1,26,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9, + 2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,2,24,2,25, + 2,26,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14, + 3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23,3,24,3,25,3,26,4,0,4,1,4,2,4,3, + 4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,4,18,4,19, + 4,20,4,21,4,22,4,23,4,24,4,25,4,26,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8, + 5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23,5,24, + 5,25,5,26,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13, + 6,14,6,15,6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,6,24,6,25,6,26,7,0,7,1,7,2, + 7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18, + 7,19,7,20,7,21,7,22,7,23,7,24,7,25,7,26,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, + 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23, + 8,24,8,25,8,26,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12, + 9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23,9,24,9,25,9,26,10,0,10,1, + 10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17, + 10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,26,11,0,11,1,11,2,11,3,11,4,11,5,11,6, + 11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22, + 11,23,11,24,11,25,11,26,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11, + 12,12,12,13,12,14,12,15,12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,12,24,12,25,12,26,13,0, + 13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16, + 13,17,13,18,13,19,13,20,13,21,13,22,13,23,13,24,13,25,13,26,14,0,14,1,14,2,14,3,14,4,14,5, + 14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,14,20,14,21, + 14,22,14,23,14,24,14,25,14,26,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10, + 15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23,15,24,15,25,15,26, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,17,0,17,1,17,2,17,3,17,4, + 17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20, + 17,21,17,22,17,23,17,24,17,25,17,26,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9, + 18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,18,24,18,25, + 18,26,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14, + 19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23,19,24,19,25,19,26,20,0,20,1,20,2,20,3, + 20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15,20,16,20,17,20,18,20,19, + 20,20,20,21,20,22,20,23,20,24,20,25,20,26,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7,21,8, + 21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23,21,24, + 21,25,21,26,22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13, + 22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,22,24,22,25,22,26,23,0,23,1,23,2, + 23,3,23,4,23,5,23,6,23,7,23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18, + 23,19,23,20,23,21,23,22,23,23,23,24,23,25,23,26,24,0,24,1,24,2,24,3,24,4,24,5,24,6,24,7, + 24,8,24,9,24,10,24,11,24,12,24,13,24,14,24,15,24,16,24,17,24,18,24,19,24,20,24,21,24,22,24,23, + 24,24,24,25,24,26,25,0,25,1,25,2,25,3,25,4,25,5,25,6,25,7,25,8,25,9,25,10,25,11,25,12, + 25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,25,24,25,25,25,26,26,0,26,1, + 26,2,26,3,26,4,26,5,26,6,26,7,26,8,26,9,26,10,26,11,26,12,26,13,26,14,26,15,26,16,26,17, + 26,18,26,19,26,20,26,21,26,22,26,23,26,24,26,25,26,26, +}; + +const int32_t c_aaiHuffDemod17[729][2] = { + 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, + 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,1,0,1,1,1,2,1,3,1,4, + 1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20, + 1,21,1,22,1,23,1,24,1,25,1,26,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9, + 2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,2,24,2,25, + 2,26,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14, + 3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23,3,24,3,25,3,26,4,0,4,1,4,2,4,3, + 4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,4,18,4,19, + 4,20,4,21,4,22,4,23,4,24,4,25,4,26,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8, + 5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23,5,24, + 5,25,5,26,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13, + 6,14,6,15,6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,6,24,6,25,6,26,7,0,7,1,7,2, + 7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18, + 7,19,7,20,7,21,7,22,7,23,7,24,7,25,7,26,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, + 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23, + 8,24,8,25,8,26,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12, + 9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23,9,24,9,25,9,26,10,0,10,1, + 10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17, + 10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,26,11,0,11,1,11,2,11,3,11,4,11,5,11,6, + 11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22, + 11,23,11,24,11,25,11,26,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11, + 12,12,12,13,12,14,12,15,12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,12,24,12,25,12,26,13,0, + 13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16, + 13,17,13,18,13,19,13,20,13,21,13,22,13,23,13,24,13,25,13,26,14,0,14,1,14,2,14,3,14,4,14,5, + 14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,14,20,14,21, + 14,22,14,23,14,24,14,25,14,26,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10, + 15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23,15,24,15,25,15,26, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,17,0,17,1,17,2,17,3,17,4, + 17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20, + 17,21,17,22,17,23,17,24,17,25,17,26,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9, + 18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,18,24,18,25, + 18,26,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14, + 19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23,19,24,19,25,19,26,20,0,20,1,20,2,20,3, + 20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15,20,16,20,17,20,18,20,19, + 20,20,20,21,20,22,20,23,20,24,20,25,20,26,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7,21,8, + 21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23,21,24, + 21,25,21,26,22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13, + 22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,22,24,22,25,22,26,23,0,23,1,23,2, + 23,3,23,4,23,5,23,6,23,7,23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18, + 23,19,23,20,23,21,23,22,23,23,23,24,23,25,23,26,24,0,24,1,24,2,24,3,24,4,24,5,24,6,24,7, + 24,8,24,9,24,10,24,11,24,12,24,13,24,14,24,15,24,16,24,17,24,18,24,19,24,20,24,21,24,22,24,23, + 24,24,24,25,24,26,25,0,25,1,25,2,25,3,25,4,25,5,25,6,25,7,25,8,25,9,25,10,25,11,25,12, + 25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,25,24,25,25,25,26,26,0,26,1, + 26,2,26,3,26,4,26,5,26,6,26,7,26,8,26,9,26,10,26,11,26,12,26,13,26,14,26,15,26,16,26,17, + 26,18,26,19,26,20,26,21,26,22,26,23,26,24,26,25,26,26, +}; +}; + +const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { + NULL, + c_aaiHuffDemod1, + c_aaiHuffDemod2, + c_aaiHuffDemod3, + c_aaiHuffDemod4, + c_aaiHuffDemod5, + c_aaiHuffDemod6, + c_aaiHuffDemod7, + c_aaiHuffDemod8, + c_aaiHuffDemod9, + c_aaiHuffDemod10, + c_aaiHuffDemod11, + c_aaiHuffDemod12, + c_aaiHuffDemod13, + c_aaiHuffDemod14, + c_aaiHuffDemod15, + c_aaiHuffDemod16, + c_aaiHuffDemod17, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + +#endif + + +/* clang-format on */ diff --git a/lib_rend/ivas_CQMFHuff.h b/lib_rend/ivas_CQMFHuff.h new file mode 100644 index 0000000000..3e6eebaba4 --- /dev/null +++ b/lib_rend/ivas_CQMFHuff.h @@ -0,0 +1,350 @@ +/****************************************************************************************************** + + (C) 2022 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_CQMF_HUFF_H_ +#define _IVAS_CQMF_HUFF_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "ivas_Tables.h" + +//#define USE_DEMOD_TABLES + +#ifndef HUFF_READ_SIZE +#define HUFF_READ_SIZE (4) +#endif + +#ifndef HUFF_DEC_TABLE_SIZE +#define HUFF_DEC_TABLE_SIZE (16) +#endif + +#include // For NULL +#include +extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; + +extern const uint32_t c_aauiCQMFHuffDec1[3][16]; + +extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; + +extern const uint32_t c_aauiCQMFHuffDec2[3][16]; + +extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; + +extern const uint32_t c_aauiCQMFHuffDec3[10][16]; + +extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; + +extern const uint32_t c_aauiCQMFHuffDec4[5][16]; + +extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; + +extern const uint32_t c_aauiCQMFHuffDec5[10][16]; + +extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; + +extern const uint32_t c_aauiCQMFHuffDec6[7][16]; + +extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; + +extern const uint32_t c_aauiCQMFHuffDec7[25][16]; + +extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; + +extern const uint32_t c_aauiCQMFHuffDec8[16][16]; + +extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; + +extern const uint32_t c_aauiCQMFHuffDec9[22][16]; + +extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; + +extern const uint32_t c_aauiCQMFHuffDec10[45][16]; + +extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; + +extern const uint32_t c_aauiCQMFHuffDec11[50][16]; + +extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; + +extern const uint32_t c_aauiCQMFHuffDec12[76][16]; + +extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; + +extern const uint32_t c_aauiCQMFHuffDec13[89][16]; + +extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; + +extern const uint32_t c_aauiCQMFHuffDec14[53][16]; + +extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; + +extern const uint32_t c_aauiCQMFHuffDec15[73][16]; + +extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; + +extern const uint32_t c_aauiCQMFHuffDec16[85][16]; + +extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; + +extern const uint32_t c_aauiCQMFHuffDec17[93][16]; + +extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; + +extern const uint32_t c_aauiCQMFHuffDec18[6][16]; + +extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; + +extern const uint32_t c_aauiCQMFHuffDec19[6][16]; + +extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; + +extern const uint32_t c_aauiCQMFHuffDec20[6][16]; + +extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; + +extern const uint32_t c_aauiCQMFHuffDec21[7][16]; + +extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; + +extern const uint32_t c_aauiCQMFHuffDec22[9][16]; + +extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; + +extern const uint32_t c_aauiCQMFHuffDec23[12][16]; + +extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; + +extern const uint32_t c_aauiCQMFHuffDec24[17][16]; + +extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; + +extern const uint32_t c_aauiCQMFHuffDec25[19][16]; + +extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; + +extern const uint32_t c_aauiCQMFHuffDec26[26][16]; + +extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; + +extern const uint32_t c_aauiCQMFHuffDec27[28][16]; + +extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; + +extern const uint32_t c_aauiCQMFHuffDec28[30][16]; + +extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; + +extern const uint32_t c_aauiCQMFHuffDec29[34][16]; + +extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; + +extern const uint32_t c_aauiCQMFHuffDec30[39][16]; + +extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; + +extern const uint32_t c_aauiCQMFHuffDec31[43][16]; + +extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; + +extern const uint32_t c_aauiCQMFHuffDec33[2][16]; + +extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; + +extern const uint32_t c_aauiCQMFHuffDec34[2][16]; + +extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; + +extern const uint32_t c_aauiCQMFHuffDec35[9][16]; + +extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; + +extern const uint32_t c_aauiCQMFHuffDec36[7][16]; + +extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; + +extern const uint32_t c_aauiCQMFHuffDec37[4][16]; + +extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; + +extern const uint32_t c_aauiCQMFHuffDec38[22][16]; + +extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; + +extern const uint32_t c_aauiCQMFHuffDec39[12][16]; + +extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; + +extern const uint32_t c_aauiCQMFHuffDec40[36][16]; + +extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; + +extern const uint32_t c_aauiCQMFHuffDec41[16][16]; + +extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; + +extern const uint32_t c_aauiCQMFHuffDec42[28][16]; + +extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; + +extern const uint32_t c_aauiCQMFHuffDec43[32][16]; + +extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; + +extern const uint32_t c_aauiCQMFHuffDec44[27][16]; + +extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; + +extern const uint32_t c_aauiCQMFHuffDec45[50][16]; + +extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; + +extern const uint32_t c_aauiCQMFHuffDec46[61][16]; + +extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; + +extern const uint32_t c_aauiCQMFHuffDec47[87][16]; + +extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; + +extern const uint32_t c_aauiCQMFHuffDec48[110][16]; + +extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; + +extern const uint32_t c_aauiCQMFHuffDec49[113][16]; + +extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; + +extern const uint32_t c_aauiCQMFHuffDec50[6][16]; + +extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; + +extern const uint32_t c_aauiCQMFHuffDec51[6][16]; + +extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; + +extern const uint32_t c_aauiCQMFHuffDec52[7][16]; + +extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; + +extern const uint32_t c_aauiCQMFHuffDec53[9][16]; + +extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; + +extern const uint32_t c_aauiCQMFHuffDec54[9][16]; + +extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; + +extern const uint32_t c_aauiCQMFHuffDec55[10][16]; + +extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; + +extern const uint32_t c_aauiCQMFHuffDec56[12][16]; + +extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; + +extern const uint32_t c_aauiCQMFHuffDec57[14][16]; + +extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; + +extern const uint32_t c_aauiCQMFHuffDec58[17][16]; + +extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; + +extern const uint32_t c_aauiCQMFHuffDec59[20][16]; + +extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; + +extern const uint32_t c_aauiCQMFHuffDec60[24][16]; + +extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; + +extern const uint32_t c_aauiCQMFHuffDec61[33][16]; + +extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; + +extern const uint32_t c_aauiCQMFHuffDec62[41][16]; + +extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; + +extern const uint32_t c_aauiCQMFHuffDec63[39][16]; + + +extern const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2]; + +extern const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE]; + +#ifdef USE_DEMOD_TABLES +extern const int32_t c_aaiHuffDemod1[16][2]; + +extern const int32_t c_aaiHuffDemod2[16][2]; + +extern const int32_t c_aaiHuffDemod3[25][2]; + +extern const int32_t c_aaiHuffDemod4[36][2]; + +extern const int32_t c_aaiHuffDemod5[36][2]; + +extern const int32_t c_aaiHuffDemod6[49][2]; + +extern const int32_t c_aaiHuffDemod7[64][2]; + +extern const int32_t c_aaiHuffDemod8[81][2]; + +extern const int32_t c_aaiHuffDemod9[100][2]; + +extern const int32_t c_aaiHuffDemod10[169][2]; + +extern const int32_t c_aaiHuffDemod11[196][2]; + +extern const int32_t c_aaiHuffDemod12[289][2]; + +extern const int32_t c_aaiHuffDemod13[324][2]; + +extern const int32_t c_aaiHuffDemod14[400][2]; + +extern const int32_t c_aaiHuffDemod15[576][2]; + +extern const int32_t c_aaiHuffDemod16[729][2]; + +extern const int32_t c_aaiHuffDemod17[729][2]; + +extern const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2]; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _CQMF_HUFF_H_ */ diff --git a/lib_rend/ivas_MSPred.c b/lib_rend/ivas_MSPred.c new file mode 100644 index 0000000000..97157de348 --- /dev/null +++ b/lib_rend/ivas_MSPred.c @@ -0,0 +1,357 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_MSPred.h" +#include "ivas_Tables.h" +#include "ivas_RMSEnvDeltaHuff.h" +#include +#include +#include "options.h" +#include "prot.h" +#include "wmops.h" + +int32_t _round( float val ) +{ + return ( val > 0.0f ? (int32_t) ( val + 0.5f ) : (int32_t) ( val - 0.5f ) ); +} + +int32_t quantPhase( float phase ) +{ +#ifdef SIMPLE_PHASE + int32_t phaseQ; + if ( phase < 0.0f ) + { + phase += 2.0f * _PI_; + } + phaseQ = _round( phase * SIMPLE_PHASE_QUANT_FACTOR ); + phaseQ = ( phaseQ > SIMPLE_PHASE_MAX_VAL ? SIMPLE_PHASE_MIN_VAL : phaseQ ); +#else + int32_t phaseQ; + + phaseQ = _round( phase * PHASE_QUANT_FACTOR ); + if ( phaseQ == PHASE_MAX_VAL ) + { + phaseQ = PHASE_MIN_VAL; + } +#endif + return phaseQ; +} + +void rot_pm_pi( float *pr, float *pi ) +{ + /* (-1 + j0) */ + *pr = -( *pr ); + *pi = -( *pi ); +} + +void rot_p_pi_2( float *pr, float *pi ) +{ + /* (0 + j) */ + float r = *pr; + *pr = -( *pi ); + *pi = r; +} + +void rot_m_pi_2( float *pr, float *pi ) +{ + /* (0 - j) */ + float r = *pr; + *pr = *pi; + *pi = -r; +} + +void cplxmult( float *pr1, float *pi1, float r2, float i2 ) +{ + float r1 = *pr1, i1 = *pi1; + *pr1 = r1 * r2 - i1 * i2; + *pi1 = r1 * i2 + i1 * r2; +} + +int32_t requantPhase( int32_t phaseQ ) +{ + + if ( phaseQ >= PHASE_MAX_VAL ) + { + phaseQ += PHASE_MAX_VAL; + phaseQ %= ( 2 * PHASE_MAX_VAL ); + phaseQ -= PHASE_MAX_VAL; + } + else if ( phaseQ < PHASE_MIN_VAL ) + { + phaseQ -= PHASE_MAX_VAL; + phaseQ %= ( 2 * PHASE_MAX_VAL ); + phaseQ += PHASE_MAX_VAL; + if ( phaseQ == PHASE_MAX_VAL ) + { + phaseQ = PHASE_MIN_VAL; + } + } + + return phaseQ; +} + +int32_t quantPred( float pred ) +{ + int32_t predQ = _round( pred * PRED_QUANT_FACTOR ); + predQ = predQ > PRED_MAX_VAL ? PRED_MAX_VAL : predQ; + predQ = predQ < PRED_MIN_VAL ? PRED_MIN_VAL : predQ; + + return predQ; +} + +float dequantPhase( int32_t phaseQ ) +{ +#ifdef SIMPLE_PHASE + return (float) phaseQ / SIMPLE_PHASE_QUANT_FACTOR; +#else + return (float) phaseQ / PHASE_QUANT_FACTOR; +#endif +} + +float dequantPred( int32_t predQ ) +{ + return (float) predQ / PRED_QUANT_FACTOR; +} + +int32_t PrepEncode( int32_t *piQuant, const int32_t *piMSFlags, const int32_t numBands ) +{ + int32_t b, numMSBands = 0; + for ( b = 0; b < numBands; b++ ) + { + if ( piMSFlags[b] ) + { + piQuant[numMSBands++] = piQuant[b]; + } + } + for ( b = numMSBands; b < numBands; b++ ) + { + piQuant[b] = 0; + } + return numMSBands; +} + +void EncodePhase( int32_t *phaseQuant, int32_t numMSBands, int32_t diffDim ) +{ + int32_t b; + if ( diffDim > 0 ) + { + int32_t tmp1, tmp2; + tmp1 = phaseQuant[0]; + for ( b = 1; b < numMSBands; b++ ) + { + tmp2 = phaseQuant[b]; + phaseQuant[b] -= tmp1; + tmp1 = tmp2; + } + } + if ( diffDim > 1 ) + { + int32_t tmp1, tmp2; + tmp1 = phaseQuant[1]; + for ( b = 2; b < numMSBands; b++ ) + { + tmp2 = phaseQuant[b]; + phaseQuant[b] -= tmp1; + tmp1 = tmp2; + } + } + for ( b = 1; b < numMSBands; b++ ) + { + phaseQuant[b] = requantPhase( phaseQuant[b] ); + } +} + +void DecodePhase( int32_t *phaseQuant, int32_t numMSBands, int32_t diffDim ) +{ + int32_t b; + if ( diffDim > 1 ) + { + for ( b = 2; b < numMSBands; b++ ) + { + phaseQuant[b] += phaseQuant[b - 1]; + } + } + if ( diffDim > 0 ) + { + for ( b = 1; b < numMSBands; b++ ) + { + phaseQuant[b] += phaseQuant[b - 1]; + } + } + for ( b = 1; b < numMSBands; b++ ) + { + phaseQuant[b] = requantPhase( phaseQuant[b] ); + } +} + +int32_t EncodePredCoef( int32_t *predQuant, int32_t numMSBands ) +{ + int32_t b, tmp1, tmp2; + tmp1 = predQuant[0]; + for ( b = 1; b < numMSBands; b++ ) + { + tmp2 = predQuant[b]; + predQuant[b] -= tmp1; + tmp1 = tmp2; + } + return numMSBands; +} + +void DecodePredCoef( int32_t *phaseQuant, int32_t numMSBands ) +{ + int32_t b; + for ( b = 1; b < numMSBands; b++ ) + { + phaseQuant[b] += phaseQuant[b - 1]; + } +} + +int32_t CountMSBits( int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiff, const int32_t *piMSPredCoef ) +{ + int32_t iBitsWritten = 0; + int32_t b; + int32_t anyNonZero; + int32_t iNumMSBands = 0; + int32_t piPhaseCopy[MAX_BANDS_48] = { 0 }; + int32_t piPredCopy[MAX_BANDS_48] = { 0 }; + + iBitsWritten += 2; /* iMSMode */ + for ( b = 0; b < iNumBands; b++ ) + { + iNumMSBands += ( piMSFlags[b] != 0 ); + } + + if ( iNumMSBands == 0 ) + { + return iBitsWritten; + } + + if ( iNumMSBands < iNumBands ) + { + iBitsWritten += iNumBands; /* piMSFlags */ + } + + if ( iMSMode < 3 ) + { + return iBitsWritten; + } + + /* prepare arrays for coding evaluation */ + for ( b = 0; b < iNumBands; b++ ) + { + piPhaseCopy[b] = piLRPhaseDiff[b]; + piPredCopy[b] = piMSPredCoef[b]; + } + + /* Differential Coding of Phase Data*/ + PrepEncode( piPhaseCopy, piMSFlags, iNumBands ); + PrepEncode( piPredCopy, piMSFlags, iNumBands ); +#ifndef SIMPLE_PHASE + EncodePhase( piPhaseCopy, iNumMSBands, PHASE_DIFF_DIM ); +#endif + EncodePredCoef( piPredCopy, iNumMSBands ); + + iBitsWritten += 1; /* iMSPredAll */ + anyNonZero = 0; /* phase */ + for ( b = 0; b < iNumMSBands; b++ ) + { + if ( piPhaseCopy[b] != 0 ) + { + anyNonZero = 1; + break; + } + } + iBitsWritten++; /*anyNonZero Phase*/ + if ( anyNonZero ) + { +#ifdef SIMPLE_PHASE + iBitsWritten += iNumMSBands * SIMPLE_PHASE_BITS; +#else + iBitsWritten += PHASE_BAND0_BITS; + for ( b = 1; b < iNumMSBands; b++ ) + { + int32_t tabIdx = piPhaseCopy[b] - ENV_DELTA_MIN; + iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; + } +#endif + } + anyNonZero = 0; /* prediction */ + for ( b = 0; b < iNumMSBands; b++ ) + { + if ( piPredCopy[b] != 0 ) + { + anyNonZero = 1; + break; + } + } + + iBitsWritten++; /* any nonZero Pred */ + if ( anyNonZero ) + { + iBitsWritten += PRED_BAND0_BITS; + for ( b = 1; b < iNumMSBands; b++ ) + { + int32_t tabIdx = piPredCopy[b] - ENV_DELTA_MIN; + iBitsWritten += c_aaiRMSEnvHuffEnc[tabIdx][0]; + } + } + + return iBitsWritten; +} + +void writeMSPred( int32_t *phaseQuant, int32_t *predQuant, int32_t MSMode, int32_t numMSBands, int32_t numBands, void *fid, int32_t *piMsFlags ) +{ + int32_t b; + fid = (FILE *) fid; + fprintf( fid, "%d %d", MSMode, numMSBands ); + for ( b = 0; b < numMSBands; b++ ) + { + fprintf( fid, " %d", phaseQuant[b] ); + } + for ( b = numMSBands; b < numBands; b++ ) + { + fprintf( fid, " %d", 0 ); + } + for ( b = 0; b < numMSBands; b++ ) + { + fprintf( fid, " %d", predQuant[b] ); + } + for ( b = numMSBands; b < numBands; b++ ) + { + fprintf( fid, " %d", 0 ); + } + for ( b = 0; b < numBands; b++ ) + { + fprintf( fid, " %d", piMsFlags[b] ); + } + fprintf( fid, "\n" ); +} diff --git a/lib_rend/ivas_MSPred.h b/lib_rend/ivas_MSPred.h new file mode 100644 index 0000000000..a2e94b7ba7 --- /dev/null +++ b/lib_rend/ivas_MSPred.h @@ -0,0 +1,62 @@ +/****************************************************************************************************** + + (C) 2022 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_MS_PRED_H_ +#define _IVAS_MS_PRED_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include + int32_t _round( float val ); + int32_t quantPhase( float phase ); + void cplxmult( float *pr1, float *pi1, float r2, float i2 ); + void rot_pm_pi( float *pr, float *pi ); + void rot_p_pi_2( float *pr, float *pi ); + void rot_m_pi_2( float *pr, float *pi ); + int32_t requantPhase( int32_t phaseQ ); + int32_t quantPred( float pred ); + float dequantPhase( int32_t phaseQ ); + float dequantPred( int32_t predQ ); + int32_t PrepEncode( int32_t *piQuant, const int32_t *piMSFlags, const int32_t numBands ); + void EncodePhase( int32_t *phaseQuant, int32_t numMSBands, int32_t diffDim ); + void DecodePhase( int32_t *phaseQuant, int32_t numMSBands, int32_t diffDim ); + int32_t EncodePredCoef( int32_t *predQuant, int32_t numMSBands ); + void DecodePredCoef( int32_t *phaseQuant, int32_t numMSBands ); + void writeMSPred( int32_t *phaseQuant, int32_t *predQuant, int32_t MSMode, int32_t numMSBands, int32_t numBands, void *fid, int32_t *piMsFlags ); + int32_t CountMSBits( int32_t iNumBands, const int32_t iMSMode, const int32_t *piMSFlags, const int32_t *piLRPhaseDiff, const int32_t *piMSPredCoef ); +#ifdef __cplusplus +} +#endif + +#endif /* _MS_PRED_H_ */ diff --git a/lib_rend/ivas_NoiseGen.c b/lib_rend/ivas_NoiseGen.c new file mode 100644 index 0000000000..c0d6bbd5d3 --- /dev/null +++ b/lib_rend/ivas_NoiseGen.c @@ -0,0 +1,82 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_NoiseGen.h" +#include +#include +#include +#include "options.h" +#include "prot.h" +#include "wmops.h" + +NoiseGen *CreateNoiseGen( void ) +{ + int32_t n; + + NoiseGen *psNoiseGen = NULL; + + psNoiseGen = (NoiseGen *) count_malloc( sizeof( NoiseGen ) ); + psNoiseGen->iNoiseBufferLength = 2048; + psNoiseGen->iNoiseBufferMask = 2047; + psNoiseGen->iNoiseBufferIndex = 0; + + psNoiseGen->pfNoiseBuffer = (float *) count_malloc( psNoiseGen->iNoiseBufferLength * sizeof( float ) ); + + /* Generate Laplacian distributed noise */ + for ( n = 0; n < psNoiseGen->iNoiseBufferLength; n++ ) + { + float fNoise = 0.0f; + float fScale = 0.707f; + fNoise = (float) ( ( rand() & ( RAND_MAX - 1 ) ) - ( RAND_MAX >> 1 ) ) / (float) RAND_MAX; + + if ( fNoise < 0.0 ) + { + fNoise = fScale * (float) logf( 1.0f + 1.9999999f * fNoise ); + } + else + { + fNoise = -fScale * (float) logf( 1.0f - 1.9999999f * fNoise ); + } + + psNoiseGen->pfNoiseBuffer[n] = fNoise; + } + + return psNoiseGen; +} + +void DeleteNoiseGen( NoiseGen *psNoiseGen ) +{ + count_free( psNoiseGen->pfNoiseBuffer ); + count_free( psNoiseGen ); +} + +extern float GetNoise( NoiseGen *psNoiseGen ); diff --git a/lib_rend/ivas_NoiseGen.h b/lib_rend/ivas_NoiseGen.h new file mode 100644 index 0000000000..b56b1f9f84 --- /dev/null +++ b/lib_rend/ivas_NoiseGen.h @@ -0,0 +1,68 @@ +/****************************************************************************************************** + + (C) 2022 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_NOISE_GEN_H_ +#define _IVAS_NOISE_GEN_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include + typedef struct NOISE_GEN + { + int32_t iNoiseBufferLength; + int32_t iNoiseBufferMask; + int32_t iNoiseBufferIndex; + float *pfNoiseBuffer; + } NoiseGen; + + NoiseGen *CreateNoiseGen( void ); + + void DeleteNoiseGen( NoiseGen *psNoiseGen ); + + inline float GetNoise( NoiseGen *psNoiseGen ) + { + float fNoiseSample; + + fNoiseSample = psNoiseGen->pfNoiseBuffer[psNoiseGen->iNoiseBufferIndex]; + psNoiseGen->iNoiseBufferIndex++; + psNoiseGen->iNoiseBufferIndex &= psNoiseGen->iNoiseBufferMask; + + return fNoiseSample; + } + +#ifdef __cplusplus +} +#endif + +#endif /* _NOISE_GEN_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c similarity index 51% rename from lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c rename to lib_rend/ivas_PerceptualModel.c index 2e7e8568e7..ab136f5e08 100644 --- a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -1,10 +1,48 @@ -#include "PerceptualModel.h" -#include "Tables.h" +/****************************************************************************************************** + + (C) 2022 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 "ivas_PerceptualModel.h" +#include "ivas_Tables.h" +#include "options.h" +#include "prot.h" #include "wmops.h" +#include + +/* clang-format off */ #define LOG_ADD_TABLE_LENGTH (512) -const int c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { +/*TODO : rtyag : move this to tables.c*/ +const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D, 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39, 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, 0x31, 0x31, 0x31, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2B, @@ -39,10 +77,9 @@ const int c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - -static inline int LogAdd(int iVal1,int iVal2) +static inline int32_t LogAdd(int32_t iVal1,int32_t iVal2) { - int iRetVal; + int32_t iRetVal; if(iVal1 > iVal2){ iRetVal = iVal1 - iVal2; @@ -58,20 +95,40 @@ static inline int LogAdd(int iVal1,int iVal2) return iRetVal; } -const int c_aiBandwidthAdjust48[MAX_BANDS_48] = { +#define PERCEPTUAL_MODEL_SCALE (64) + +#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) + +#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) + +#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) + +#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) + +#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (8)//(4) + +const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48] = { 0,0,0,0,0,0,0,0,0,0,0,64,64,64,64,64, 101,101,128,165,165,180,213,}; -const int c_aiAbsoluteThresh48[MAX_BANDS_48] = { +const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48] = { -1787,-1787,-1787,-1787,-1787,-1787,-1787,-1787,-1782,-1761,-1737,-1679,-1638,-1613,-1590,-1568, -1516,-1459,-1395,-1289,-671,-409,-401,}; -const int c_aiDefaultTheta48[MAX_BANDS_48] = { + +#if PERCEPTUAL_MODEL_SLGAIN_SHIFT == 4 +const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { 7,7,6,5,5,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4, }; - -const int c_aaiSpreadFunction48[MAX_BANDS_48][MAX_BANDS_48] = { +#elif PERCEPTUAL_MODEL_SLGAIN_SHIFT == 8 +const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { + 112,112,96,80,80,64,64,64,64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64, +}; +#endif + +const int32_t c_aaiSpreadFunction48[MAX_BANDS_48*MAX_BANDS_48] = { 0,-1561,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, -2552,-2552,-2552,-2552,-2552,-2552,-2552,-289,-4,-1234,-2295,-2552,-2552,-2552,-2552,-2552, -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-569,-229, @@ -107,54 +164,152 @@ const int c_aaiSpreadFunction48[MAX_BANDS_48][MAX_BANDS_48] = { -1003,-921,-852,-792,-737,-665,-580,-505,-441,-385,-326,-271,-222,-224,-176,-121,-114, }; -#define PERCEPTUAL_MODEL_SCALE (64) - -#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) -#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) +/* clang-format on */ -#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) -#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) +void PerceptualModel( const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR ) +{ + int32_t n; -#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (4) + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t iSLOffset; -void PerceptualModel(const int iMaxQuantBands, - const int *piRMSEnvelope, - int *piExcitation, - int *piSMR) -{ - int n; - - for(n = 0; n < iMaxQuantBands; n ++){ - int iSLOffset; - piExcitation[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n]; // Calculate sensation level offset - iSLOffset = c_aiDefaultTheta48[n] * (piExcitation[n] - c_aiAbsoluteThresh48[n]) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; - //iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; - // Offset envelope by sensation level offset + iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; + // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; + // Offset envelope by sensation level offset piExcitation[n] -= iSLOffset; // Convert to loudness domain (x^0.3) piExcitation[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; } - + // Spread excitation function - for(n = 0; n < iMaxQuantBands; n ++){ - int k; - const int *piSpread; - - piSpread = c_aaiSpreadFunction48[n]; + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t k; + const int32_t *piSpread; + + piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; piSMR[n] = piExcitation[n] + piSpread[n]; - for(k = 0; k < iMaxQuantBands; k ++){ - if(k != n){ - piSMR[n] = LogAdd(piSMR[n],piExcitation[k] + piSpread[k]); + for ( k = 0; k < iMaxQuantBands; k++ ) + { + if ( k != n ) + { + piSMR[n] = LogAdd( piSMR[n], piExcitation[k] + piSpread[k] ); } } } - - for(n = 0; n < iMaxQuantBands; n ++){ + + for ( n = 0; n < iMaxQuantBands; n++ ) + { piSMR[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; piSMR[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope[n] + c_aiBandwidthAdjust48[n] - piSMR[n]; } } + +void PerceptualModelStereo( const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1 ) +{ + int32_t n; + + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t iMaxRMSEnv; + int32_t iSLOffset; + + iMaxRMSEnv = piRMSEnvelope0[n]; + + piExcitation0[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; // piRMSEnvelope0[n] + // Calculate sensation level offset + iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation0[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; + // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; + // Offset envelope by sensation level offset + piExcitation0[n] -= iSLOffset; + // Convert to loudness domain (x^0.3) + piExcitation0[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + } + + // Spread excitation function + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t k; + const int32_t *piSpread; + + piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; + piSMR0[n] = piExcitation0[n] + piSpread[n]; + for ( k = 0; k < iMaxQuantBands; k++ ) + { + if ( k != n ) + { + piSMR0[n] = LogAdd( piSMR0[n], piExcitation0[k] + piSpread[k] ); + } + } + } + + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t iMaxRMSEnv; + int32_t iSLOffset; + + iMaxRMSEnv = piRMSEnvelope1[n]; + + piExcitation1[n] = PERCEPTUAL_MODEL_SCALE * iMaxRMSEnv + c_aiBandwidthAdjust48[n]; // piRMSEnvelope1[n] + // Calculate sensation level offset + iSLOffset = c_aiDefaultTheta48[n] * ( piExcitation1[n] - c_aiAbsoluteThresh48[n] ) >> PERCEPTUAL_MODEL_SLGAIN_SHIFT; + // iSLOffset = (iSLOffset > 0) ? iSLOffset : 0; + // Offset envelope by sensation level offset + piExcitation1[n] -= iSLOffset; + // Convert to loudness domain (x^0.3) + piExcitation1[n] = PERCEPTUAL_MODEL_ALPHA_SCALE * piExcitation1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + } + + // Spread excitation function + for ( n = 0; n < iMaxQuantBands; n++ ) + { + int32_t k; + const int32_t *piSpread; + + piSpread = &c_aaiSpreadFunction48[n * MAX_BANDS_48]; + piSMR1[n] = piExcitation1[n] + piSpread[n]; + for ( k = 0; k < iMaxQuantBands; k++ ) + { + if ( k != n ) + { + piSMR1[n] = LogAdd( piSMR1[n], piExcitation1[k] + piSpread[k] ); + } + } + } + + for ( n = 0; n < iMaxQuantBands; n++ ) + { + if ( piMSFlags[n] == 1 ) + { + piSMR0[n] = ( piSMR0[n] > piSMR1[n] ) ? piSMR0[n] : piSMR1[n]; + piSMR1[n] = piSMR0[n]; + } + } + + for ( n = 0; n < iMaxQuantBands; n++ ) + { + piSMR0[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR0[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + piSMR0[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope0[n] + c_aiBandwidthAdjust48[n] - piSMR0[n]; + } + + for ( n = 0; n < iMaxQuantBands; n++ ) + { + piSMR1[n] = PERCEPTUAL_MODEL_ALPHA_INV_SCALE * piSMR1[n] >> PERCEPTUAL_MODEL_ALPHA_SHIFT; + piSMR1[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope1[n] + c_aiBandwidthAdjust48[n] - piSMR1[n]; + } +} diff --git a/lib_rend/ivas_PerceptualModel.h b/lib_rend/ivas_PerceptualModel.h new file mode 100644 index 0000000000..2d3346183f --- /dev/null +++ b/lib_rend/ivas_PerceptualModel.h @@ -0,0 +1,59 @@ +/****************************************************************************************************** + + (C) 2022 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_PERCEPTUAL_MODEL_H_ +#define _IVAS_PERCEPTUAL_MODEL_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +void PerceptualModel(const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR); + +void PerceptualModelStereo(const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1); + +#ifdef __cplusplus +} +#endif + +#endif /* _PERCEPTUAL_MODEL_H_ */ diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c new file mode 100644 index 0000000000..4cfb776154 --- /dev/null +++ b/lib_rend/ivas_PredDecoder.c @@ -0,0 +1,259 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_PredDecoder.h" +#include +#include +#include +#include "options.h" +#include "prot.h" +#include "wmops.h" +#include "ivas_Tables.h" +#include "ivas_PredTables.h" +#include "ivas_cldfb_codec_bitstream.h" + + +PredictionDecoder *CreatePredictionDecoder( const int32_t iChannels, + const int32_t iNumBlocks ) +{ + int32_t n; + + PredictionDecoder *psPredictionDecoder = NULL; + + psPredictionDecoder = (PredictionDecoder *) count_malloc( sizeof( PredictionDecoder ) ); + + psPredictionDecoder->iChannels = iChannels; + psPredictionDecoder->iNumBlocks = iNumBlocks; + + psPredictionDecoder->piPredChanEnable = (int32_t *) count_malloc( sizeof( int32_t ) * iChannels ); + psPredictionDecoder->piNumPredBands = (int32_t *) count_malloc( sizeof( int32_t ) * iChannels ); + + psPredictionDecoder->ppfEstPredGain = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionDecoder->ppiPredBandEnable = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + psPredictionDecoder->ppfA1Real = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionDecoder->ppfA1Imag = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionDecoder->ppiA1Mag = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + psPredictionDecoder->ppiA1Phase = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) + { + psPredictionDecoder->ppfEstPredGain[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionDecoder->ppiPredBandEnable[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + psPredictionDecoder->ppfA1Real[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionDecoder->ppfA1Imag[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionDecoder->ppiA1Mag[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + psPredictionDecoder->ppiA1Phase[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + } + + /* pre-define these tables? */ + psPredictionDecoder->pfMagLUT = (float *) count_malloc( sizeof( float ) * ( 1 << PRED_QUNAT_FILTER_MAG_BITS ) ); + psPredictionDecoder->pfP2RRealLUT = (float *) count_malloc( sizeof( float ) * ( 1 << PRED_QUANT_FILTER_PHASE_BITS ) ); + psPredictionDecoder->pfP2RImagLUT = (float *) count_malloc( sizeof( float ) * ( 1 << PRED_QUANT_FILTER_PHASE_BITS ) ); + + for ( n = 0; n < ( 1 << PRED_QUNAT_FILTER_MAG_BITS ); n++ ) + { + const float fInvMagScale = M_PI / ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ); + psPredictionDecoder->pfMagLUT[n] = sinf( fInvMagScale * (float) n ); + } + + for ( n = 0; n < ( 1 << PRED_QUANT_FILTER_PHASE_BITS ); n++ ) + { + const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); + int32_t iVal; + + iVal = n + PRED_QUANT_FILTER_PHASE_MIN; + psPredictionDecoder->pfP2RRealLUT[n] = cosf( fInvPhaseScale * (float) iVal ); + psPredictionDecoder->pfP2RImagLUT[n] = sinf( fInvPhaseScale * (float) iVal ); + } + + + return psPredictionDecoder; +} + +void DeletePredictionDecoder( PredictionDecoder *psPredictionDecoder ) +{ + int32_t n; + + for ( n = 0; n < psPredictionDecoder->iChannels; n++ ) + { + count_free( psPredictionDecoder->ppfEstPredGain[n] ); + count_free( psPredictionDecoder->ppiPredBandEnable[n] ); + count_free( psPredictionDecoder->ppfA1Real[n] ); + count_free( psPredictionDecoder->ppfA1Imag[n] ); + count_free( psPredictionDecoder->ppiA1Mag[n] ); + count_free( psPredictionDecoder->ppiA1Phase[n] ); + } + count_free( psPredictionDecoder->piPredChanEnable ); + count_free( psPredictionDecoder->piNumPredBands ); + count_free( psPredictionDecoder->ppfEstPredGain ); + count_free( psPredictionDecoder->ppiPredBandEnable ); + count_free( psPredictionDecoder->ppfA1Real ); + count_free( psPredictionDecoder->ppfA1Imag ); + count_free( psPredictionDecoder->ppiA1Mag ); + count_free( psPredictionDecoder->ppiA1Phase ); + + count_free( psPredictionDecoder->pfMagLUT ); + count_free( psPredictionDecoder->pfP2RRealLUT ); + count_free( psPredictionDecoder->pfP2RImagLUT ); + + count_free( psPredictionDecoder ); +} +#define USE_TABLE_LOOKUP +int32_t ReadPredictors( PredictionDecoder *psPredictionDecoder, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsRead = 0; + int32_t c; + + for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) + { + psPredictionDecoder->piPredChanEnable[c] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( psPredictionDecoder->piPredChanEnable[c] ) + { + int32_t b; + + for ( b = 0; b < CQMF_BANDS; b++ ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = 0; + } + psPredictionDecoder->piNumPredBands[c] = ivas_split_rend_bitstream_read_int32( pBits, 6 ); + iBitsRead += 6; + + for ( b = 0; b < psPredictionDecoder->piNumPredBands[c]; b++ ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + iBitsRead += 1; + + if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) + { +#ifdef USE_TABLE_LOOKUP + int32_t iA1Mag; + int32_t iA1Phase; + float fA1Real; + float fA1Imag; + iA1Mag = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUNAT_FILTER_MAG_BITS ); + iBitsRead += PRED_QUNAT_FILTER_MAG_BITS; + iA1Phase = ivas_split_rend_bitstream_read_int32( pBits, PRED_QUANT_FILTER_PHASE_BITS ); + iBitsRead += PRED_QUANT_FILTER_PHASE_BITS; + + psPredictionDecoder->ppiA1Mag[c][b] = iA1Mag; + psPredictionDecoder->ppiA1Phase[c][b] = iA1Phase + PRED_QUANT_FILTER_PHASE_MIN; + + fA1Real = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RRealLUT[iA1Phase]; + fA1Imag = psPredictionDecoder->pfMagLUT[iA1Mag] * psPredictionDecoder->pfP2RImagLUT[iA1Phase]; + + psPredictionDecoder->ppfA1Real[c][b] = fA1Real; + psPredictionDecoder->ppfA1Imag[c][b] = fA1Imag; +#else + const float fInvMagScale = M_PI / ( 2.0 * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0 ); + const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); + int32_t iA1Mag; + int32_t iA1Phase; + float fA1Mag; + float fA1Phase; + float fA1Real; + float fA1Imag; + + iA1Mag = BSGetBits( psBSRead, PRED_QUNAT_FILTER_MAG_BITS ); + iBitsRead += PRED_QUNAT_FILTER_MAG_BITS; + + iA1Phase = BSGetBits( psBSRead, PRED_QUANT_FILTER_PHASE_BITS ); + iBitsRead += PRED_QUANT_FILTER_PHASE_BITS; + iA1Phase += PRED_QUANT_FILTER_PHASE_MIN; + + psPredictionDecoder->ppiA1Mag[c][b] = iA1Mag; + psPredictionDecoder->ppiA1Phase[c][b] = iA1Phase; + + fA1Mag = sinf( fInvMagScale * (float) iA1Mag ); + fA1Phase = fInvPhaseScale * (float) iA1Phase; + + fA1Real = fA1Mag * cosf( fA1Phase ); + fA1Imag = fA1Mag * sinf( fA1Phase ); + + psPredictionDecoder->ppfA1Real[c][b] = fA1Real; + psPredictionDecoder->ppfA1Imag[c][b] = fA1Imag; + + // printf("Dec %f\t%f\t%f\n",fA1Real,fA1Imag,fA1Real * fA1Real + fA1Imag * fA1Imag); +#endif + } + } + } + else + { + int32_t b; + for ( b = 0; b < CQMF_BANDS; b++ ) + { + psPredictionDecoder->ppiPredBandEnable[c][b] = 0; + } + } + } + + return iBitsRead; +} + +void ApplyInversePredictros( PredictionDecoder *psPredictionDecoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + for ( c = 0; c < psPredictionDecoder->iChannels; c++ ) + { + if ( psPredictionDecoder->piPredChanEnable[c] == 1 ) + { + int32_t b; + for ( b = 0; b < psPredictionDecoder->piNumPredBands[c]; b++ ) + { + if ( psPredictionDecoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t n; + float fA1Real; + float fA1Imag; + + fA1Real = psPredictionDecoder->ppfA1Real[c][b]; + fA1Imag = psPredictionDecoder->ppfA1Imag[c][b]; + for ( n = 1; n < psPredictionDecoder->iNumBlocks; n++ ) + { + float fReal; + float fImag; + + fReal = pppfReal[c][n][b] - fA1Real * pppfReal[c][n - 1][b] + fA1Imag * pppfImag[c][n - 1][b]; + fImag = pppfImag[c][n][b] - fA1Real * pppfImag[c][n - 1][b] - fA1Imag * pppfReal[c][n - 1][b]; + + pppfReal[c][n][b] = fReal; + pppfImag[c][n][b] = fImag; + } + } + } + } + } +} diff --git a/lib_rend/ivas_PredDecoder.h b/lib_rend/ivas_PredDecoder.h new file mode 100644 index 0000000000..435c4f2238 --- /dev/null +++ b/lib_rend/ivas_PredDecoder.h @@ -0,0 +1,84 @@ +/****************************************************************************************************** + + (C) 2022 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_PRED_DECODER_H_ +#define _IVAS_PRED_DECODER_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "ivas_cldfb_codec_bitstream.h" + + // typedef struct PREDICTION_DECODER PredictionDecoder; + + typedef struct PREDICTION_DECODER + { + int32_t iChannels; + int32_t iNumBlocks; + + int32_t *piPredChanEnable; + int32_t *piNumPredBands; + + float **ppfEstPredGain; + int32_t **ppiPredBandEnable; + + float **ppfA1Real; + float **ppfA1Imag; + + int32_t **ppiA1Mag; + int32_t **ppiA1Phase; + + float *pfMagLUT; + float *pfP2RRealLUT; + float *pfP2RImagLUT; + } PredictionDecoder; + + PredictionDecoder *CreatePredictionDecoder( const int32_t iChannels, + const int32_t iNumBlocks ); + + void DeletePredictionDecoder( PredictionDecoder *psPredictionDecoder ); + + int32_t ReadPredictors( PredictionDecoder *psPredictionDecoder, + ivas_split_rend_bits_t *pBits ); + + void ApplyInversePredictros( PredictionDecoder *psPredictionDecoder, + float ***pppfReal, + float ***pppfImag ); + + +#ifdef __cplusplus +} +#endif + +#endif /* _PRED_DECODER_H_ */ diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c new file mode 100644 index 0000000000..fc8bd14502 --- /dev/null +++ b/lib_rend/ivas_PredEncoder.c @@ -0,0 +1,476 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_PredEncoder.h" +#include +#include +#include +#include "ivas_Tables.h" +#include "ivas_PredTables.h" +#include "options.h" +#include "prot.h" +#include "wmops.h" +#include "ivas_cldfb_codec_bitstream.h" + + +PredictionEncoder *CreatePredictionEncoder( const int32_t iChannels, + const int32_t iNumBlocks ) +{ + int32_t n; + + PredictionEncoder *psPredictionEncoder = NULL; + + psPredictionEncoder = (PredictionEncoder *) count_malloc( sizeof( PredictionEncoder ) ); + + psPredictionEncoder->iChannels = iChannels; + psPredictionEncoder->iNumBlocks = iNumBlocks; + + psPredictionEncoder->pfWindow = (float *) count_malloc( sizeof( float ) * iNumBlocks ); + for ( n = 0; n < iNumBlocks; n++ ) + { + psPredictionEncoder->pfWindow[n] = 0.54f - 0.46f * cosf( 2.0f * M_PI * ( (float) n + 0.5f ) / (float) iNumBlocks ); + } + + + psPredictionEncoder->pfRxxReal = (float *) count_malloc( sizeof( float ) * 2 ); + psPredictionEncoder->pfRxxImag = (float *) count_malloc( sizeof( float ) * 2 ); + + psPredictionEncoder->piPredChanEnable = (int32_t *) count_malloc( sizeof( int32_t ) * iChannels ); + psPredictionEncoder->piNumPredBands = (int32_t *) count_malloc( sizeof( int32_t ) * iChannels ); + for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) + { + psPredictionEncoder->piPredChanEnable[n] = 0; + psPredictionEncoder->piNumPredBands[n] = 40; // Will need to be set correctly + } + + psPredictionEncoder->ppfEstPredGain = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionEncoder->ppfEstPredBitGain = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionEncoder->ppiPredBandEnable = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + psPredictionEncoder->ppfA1Real = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionEncoder->ppfA1Imag = (float **) count_malloc( sizeof( float * ) * iChannels ); + psPredictionEncoder->ppiA1Mag = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + psPredictionEncoder->ppiA1Phase = (int32_t **) count_malloc( sizeof( int32_t * ) * iChannels ); + for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) + { + int32_t k; + + psPredictionEncoder->ppfEstPredGain[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionEncoder->ppfEstPredBitGain[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionEncoder->ppiPredBandEnable[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + psPredictionEncoder->ppfA1Real[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionEncoder->ppfA1Imag[n] = (float *) count_malloc( sizeof( float ) * CQMF_BANDS ); + psPredictionEncoder->ppiA1Mag[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + psPredictionEncoder->ppiA1Phase[n] = (int32_t *) count_malloc( sizeof( int32_t ) * CQMF_BANDS ); + for ( k = 0; k < CQMF_BANDS; k++ ) + { + psPredictionEncoder->ppiPredBandEnable[n][k] = 0; + psPredictionEncoder->ppfA1Real[n][k] = 0.0; + psPredictionEncoder->ppfA1Imag[n][k] = 0.0; + } + } + + return psPredictionEncoder; +} + +void DeletePredictionEncoder( PredictionEncoder *psPredictionEncoder ) +{ + int32_t n; + + count_free( psPredictionEncoder->pfWindow ); + count_free( psPredictionEncoder->pfRxxReal ); + count_free( psPredictionEncoder->pfRxxImag ); + + for ( n = 0; n < psPredictionEncoder->iChannels; n++ ) + { + count_free( psPredictionEncoder->ppfEstPredGain[n] ); + count_free( psPredictionEncoder->ppfEstPredBitGain[n] ); + count_free( psPredictionEncoder->ppiPredBandEnable[n] ); + count_free( psPredictionEncoder->ppfA1Real[n] ); + count_free( psPredictionEncoder->ppfA1Imag[n] ); + count_free( psPredictionEncoder->ppiA1Mag[n] ); + count_free( psPredictionEncoder->ppiA1Phase[n] ); + } + count_free( psPredictionEncoder->piPredChanEnable ); + count_free( psPredictionEncoder->piNumPredBands ); + count_free( psPredictionEncoder->ppfEstPredGain ); + count_free( psPredictionEncoder->ppfEstPredBitGain ); + count_free( psPredictionEncoder->ppiPredBandEnable ); + count_free( psPredictionEncoder->ppfA1Real ); + count_free( psPredictionEncoder->ppfA1Imag ); + count_free( psPredictionEncoder->ppiA1Mag ); + count_free( psPredictionEncoder->ppiA1Phase ); + + count_free( psPredictionEncoder ); +} +//#define USE_RXX_WINDOW +int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + int32_t iPredictionBits = 0; + + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + float fChanPredictionGainBits; + psPredictionEncoder->piNumPredBands[c] = 50; + fChanPredictionGainBits = 0.0; + for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) + { + int32_t n; + int32_t iNumBlocks; + float fGain = 0.0; + float fBitGain = 0.0; + float *pfRxxReal; + float *pfRxxImag; + float fA1Real; + float fA1Imag; + // int32_t iA1Real; + // int32_t iA1Imag; + int32_t iA1Mag; + int32_t iA1Phase; + + iNumBlocks = psPredictionEncoder->iNumBlocks; + + pfRxxReal = psPredictionEncoder->pfRxxReal; + pfRxxImag = psPredictionEncoder->pfRxxImag; + + pfRxxReal[0] = 0.0; + pfRxxImag[0] = 0.0; + for ( n = 0; n < iNumBlocks; n++ ) + { +#ifdef USE_RXX_WINDOW + float fReal; + float fImag; + fReal = psPredictionEncoder->pfWindow[n] * pppfReal[c][n][b]; + fImag = psPredictionEncoder->pfWindow[n] * pppfImag[c][n][b]; + pfRxxReal[0] += ( fReal * fReal + fImag * fImag ); +#else + pfRxxReal[0] += ( pppfReal[c][n][b] * pppfReal[c][n][b] + pppfImag[c][n][b] * pppfImag[c][n][b] ); +#endif + } + + pfRxxReal[1] = 0.0; + pfRxxImag[1] = 0.0; + for ( n = 1; n < iNumBlocks; n++ ) + { +#ifdef USE_RXX_WINDOW + float fReal1; + float fImag1; + float fReal2; + float fImag2; + fReal1 = psPredictionEncoder->pfWindow[n] * pppfReal[c][n][b]; + fImag1 = psPredictionEncoder->pfWindow[n] * pppfImag[c][n][b]; + fReal2 = psPredictionEncoder->pfWindow[n - 1] * pppfReal[c][n - 1][b]; + fImag2 = psPredictionEncoder->pfWindow[n - 1] * pppfImag[c][n - 1][b]; + pfRxxReal[1] += ( fReal1 * fReal2 + fImag1 * fImag2 ); + pfRxxImag[1] += ( fImag1 * fReal2 - fReal1 * fImag2 ); +#else + pfRxxReal[1] += ( pppfReal[c][n][b] * pppfReal[c][n - 1][b] + pppfImag[c][n][b] * pppfImag[c][n - 1][b] ); + pfRxxImag[1] += ( pppfImag[c][n][b] * pppfReal[c][n - 1][b] - pppfReal[c][n][b] * pppfImag[c][n - 1][b] ); +#endif + } + + if ( pfRxxReal[0] > 1e-12f ) + { + float fA1Mag; + float fA1Phase; + float fGain2; + float fBitGain2; + + const float fMagScale = ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ) / M_PI; + const float fInvMagScale = M_PI / ( 2.0f * (float) ( 1 << ( PRED_QUNAT_FILTER_MAG_BITS ) ) + 1.0f ); + const float fPhaseScale = (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ) / M_PI; + const float fInvPhaseScale = M_PI / (float) ( 1 << ( PRED_QUANT_FILTER_PHASE_BITS - 1 ) ); + + // Compute filter coefficeints + fA1Real = -pfRxxReal[1] / pfRxxReal[0]; + fA1Imag = -pfRxxImag[1] / pfRxxReal[0]; + + // compute these before quant + // Compute est coding gain based on quantized filter coefficients + fGain = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); + fBitGain = 0.6f * log2f( fGain ) * (float) ( iNumBlocks ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) + + fA1Mag = sqrtf( fA1Real * fA1Real + fA1Imag * fA1Imag ); + fA1Mag = fMagScale * asinf( fA1Mag ); + iA1Mag = (int32_t) ( fA1Mag + 0.5f ); + iA1Mag = ( iA1Mag > PRED_QUANT_FILTER_MAG_MIN ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MIN; + iA1Mag = ( iA1Mag < PRED_QUANT_FILTER_MAG_MAX ) ? iA1Mag : PRED_QUANT_FILTER_MAG_MAX; + fA1Mag = sinf( fInvMagScale * (float) iA1Mag ); + + fA1Phase = atan2f( fA1Imag, fA1Real ); + fA1Phase = fPhaseScale * fA1Phase; + iA1Phase = ( fA1Phase > 0.0f ) ? (int32_t) ( fA1Phase + 0.5f ) : (int32_t) ( fA1Phase - 0.5f ); + iA1Phase = ( iA1Phase > PRED_QUANT_FILTER_PHASE_MIN ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MIN; + iA1Phase = ( iA1Phase < PRED_QUANT_FILTER_PHASE_MAX ) ? iA1Phase : PRED_QUANT_FILTER_PHASE_MAX; // Is this the correct way to deal with this? should wrap? + fA1Phase = fInvPhaseScale * (float) iA1Phase; + + fA1Real = fA1Mag * cosf( fA1Phase ); + fA1Imag = fA1Mag * sinf( fA1Phase ); + + fGain2 = 1.0f / ( 1.0f - fA1Real * fA1Real - fA1Imag * fA1Imag ); + fBitGain2 = 0.6f * log2f( fGain ) * (float) ( iNumBlocks ) - (float) ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); // Wrong fix (iNumBlocks-1) + + fGain = ( fGain < fGain2 ) ? fGain : fGain2; + fBitGain = ( fBitGain < fBitGain2 ) ? fBitGain : fBitGain2; + } + else + { + psPredictionEncoder->ppfEstPredGain[c][b] = 0.0f; + fA1Real = 0.0f; + fA1Imag = 0.0f; + // iA1Real = 0; + // iA1Imag = 0; + iA1Mag = 0; + iA1Phase = 0; + fGain = -10.0f; // Fix this + } + + psPredictionEncoder->ppfEstPredGain[c][b] = fGain; + psPredictionEncoder->ppfEstPredBitGain[c][b] = fBitGain; + psPredictionEncoder->ppiPredBandEnable[c][b] = ( fBitGain > 0 ) ? 1 : 0; // Initial prediction enable + psPredictionEncoder->ppfA1Real[c][b] = fA1Real; + psPredictionEncoder->ppfA1Imag[c][b] = fA1Imag; + psPredictionEncoder->ppiA1Mag[c][b] = iA1Mag; + psPredictionEncoder->ppiA1Phase[c][b] = iA1Phase; + + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + fChanPredictionGainBits += fBitGain; // change this calculation + } + } +#if 0 + // Estimate if the savings outway the signaling cost + if(fChanPredictionGainBits > 1e20){//}(float)(psPredictionEncoder->piNumPredBands[c] + 6)){ + psPredictionEncoder->piPredChanEnable[c] = 1; + //printf("Prediction Enabled\n"); + iPredictionBits += 1; + iPredictionBits += 6; + for(b = 0; b < psPredictionEncoder->piNumPredBands[c]; b ++){ + iPredictionBits += 1; + if(psPredictionEncoder->ppiPredBandEnable[c][b] == 1){ + iPredictionBits += (PRED_QUANT_FILTER_BITS * 2); + printf("%f, ",(psPredictionEncoder->ppfEstPredGain[c][b])); + } + } + printf("\n"); + } + else{ + psPredictionEncoder->piPredChanEnable[c] = 0; + for(b = 0; b < psPredictionEncoder->piNumPredBands[c]; b ++){ + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + //printf("Prediction Disabled\n"); + iPredictionBits += 1; + } +#else + { + /*int32_t iDone; + int32_t iPredBands; + + iDone = 0; + iPredBands = 30; + while(iPredBands > 0 && iDone == 0){ + int32_t b; + float fBitGain; + + fBitGain = -7.0; + for(b = 0; b < iPredBands; b ++){ + fBitGain -= 1.0; + if(psPredictionEncoder->ppiPredBandEnable[c][b] == 1){ + fBitGain += psPredictionEncoder->ppfEstPredBitGain[c][b]; + } + } + if(fBitGain > 0.0){ //thresh + iDone ++; + } + else{ + iPredBands --; + } + }*/ + // int32_t b; + float fBestCost; + int32_t iPredBands; + float fBitGain; + + fBestCost = 0.0; + iPredBands = 0; + fBitGain = -7.0; + for ( b = 0; b < 30; b++ ) + { // still getting this decision wrong! + fBitGain -= 1.0; + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + fBitGain += psPredictionEncoder->ppfEstPredBitGain[c][b]; + } + if ( fBitGain > fBestCost ) + { + fBestCost = fBitGain; + iPredBands = b; + } + } + + // printf("%d\t%f\n",iPredBands,fBestCost); + /*if(fBestCost < 300.0){ + iPredBands = 0; + }*/ + + if ( iPredBands > 0 ) + { + // int32_t b; + iPredictionBits += 1; + iPredictionBits += 6; + for ( b = 0; b < iPredBands; b++ ) + { + iPredictionBits += 1; + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + iPredictionBits += ( PRED_QUNAT_FILTER_MAG_BITS + PRED_QUANT_FILTER_PHASE_BITS ); + } + } + for ( b = iPredBands; b < CQMF_BANDS; b++ ) + { + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + psPredictionEncoder->piPredChanEnable[c] = 1; + psPredictionEncoder->piNumPredBands[c] = iPredBands; + } + else + { + // int32_t b; + iPredictionBits += 1; + for ( b = 0; b < CQMF_BANDS; b++ ) + { + psPredictionEncoder->ppiPredBandEnable[c][b] = 0; + } + psPredictionEncoder->piPredChanEnable[c] = 0; + psPredictionEncoder->piNumPredBands[c] = 0; + } + } +#endif + } + + return iPredictionBits; +} + +void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ) +{ + int32_t c; + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + if ( psPredictionEncoder->piPredChanEnable[c] == 1 ) + { + for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) + { + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t n; + float fOldReal; + float fOldImag; + float fA1Real; + float fA1Imag; + + fOldReal = pppfReal[c][0][b]; + fOldImag = pppfImag[c][0][b]; + fA1Real = psPredictionEncoder->ppfA1Real[c][b]; + fA1Imag = psPredictionEncoder->ppfA1Imag[c][b]; + for ( n = 1; n < psPredictionEncoder->iNumBlocks; n++ ) + { + float fReal; + float fImag; + + fReal = pppfReal[c][n][b] + fA1Real * fOldReal - fA1Imag * fOldImag; + fImag = pppfImag[c][n][b] + fA1Real * fOldImag + fA1Imag * fOldReal; + + fOldReal = pppfReal[c][n][b]; + fOldImag = pppfImag[c][n][b]; + + pppfReal[c][n][b] = fReal; + pppfImag[c][n][b] = fImag; + } + } + } + } + } +} + +int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, + ivas_split_rend_bits_t *pBits ) +{ + int32_t iBitsWritten = 0; + int32_t c; + + for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) + { + int32_t b; + ivas_split_rend_bitstream_write_int32( + pBits, psPredictionEncoder->piPredChanEnable[c], + 1 ); + iBitsWritten += 1; + + if ( psPredictionEncoder->piPredChanEnable[c] == 1 ) + { + ivas_split_rend_bitstream_write_int32( + pBits, psPredictionEncoder->piNumPredBands[c], 6 ); + iBitsWritten += 6; + + for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) + { + ivas_split_rend_bitstream_write_int32( + pBits, psPredictionEncoder->ppiPredBandEnable[c][b], 1 ); + iBitsWritten += 1; + + if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) + { + int32_t iA1Mag; + int32_t iA1Phase; + + iA1Mag = psPredictionEncoder->ppiA1Mag[c][b]; + iA1Phase = psPredictionEncoder->ppiA1Phase[c][b] - PRED_QUANT_FILTER_PHASE_MIN; + ivas_split_rend_bitstream_write_int32( + pBits, iA1Mag, PRED_QUNAT_FILTER_MAG_BITS ); + iBitsWritten += PRED_QUNAT_FILTER_MAG_BITS; + ivas_split_rend_bitstream_write_int32( + pBits, iA1Phase, PRED_QUANT_FILTER_PHASE_BITS ); + iBitsWritten += PRED_QUANT_FILTER_PHASE_BITS; + } + } + } + } + + return iBitsWritten; +} diff --git a/lib_rend/ivas_PredEncoder.h b/lib_rend/ivas_PredEncoder.h new file mode 100644 index 0000000000..5ebbe7b48d --- /dev/null +++ b/lib_rend/ivas_PredEncoder.h @@ -0,0 +1,88 @@ +/****************************************************************************************************** + + (C) 2022 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_PRED_ENCODER_H_ +#define _IVAS_PRED_ENCODER_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "ivas_cldfb_codec_bitstream.h" + + typedef struct PREDICTION_ENCODER + { + int32_t iChannels; + int32_t iNumBlocks; + + float *pfWindow; + float *pfRxxReal; + float *pfRxxImag; + + int32_t *piPredChanEnable; + int32_t *piNumPredBands; + + float **ppfEstPredGain; + float **ppfEstPredBitGain; + int32_t **ppiPredBandEnable; + + float **ppfA1Real; + float **ppfA1Imag; + + int32_t **ppiA1Mag; + int32_t **ppiA1Phase; + } PredictionEncoder; + + PredictionEncoder *CreatePredictionEncoder( const int32_t iChannels, + const int32_t iNumBlocks ); + + void DeletePredictionEncoder( PredictionEncoder *psPredictionEncoder ); + + int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ); + + void ApplyForwardPredictors( PredictionEncoder *psPredictionEncoder, + float ***pppfReal, + float ***pppfImag ); + + + int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, + ivas_split_rend_bits_t *pBits ); + + +#ifdef __cplusplus +} +#endif + +#endif /* _PRED_ENCODER_H_ */ diff --git a/lib_rend/ivas_PredTables.h b/lib_rend/ivas_PredTables.h new file mode 100644 index 0000000000..ee9caf425a --- /dev/null +++ b/lib_rend/ivas_PredTables.h @@ -0,0 +1,53 @@ +/****************************************************************************************************** + + (C) 2022 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_PRED_TABLE_H_ +#define _IVAS_PRED_TABLE_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#define PRED_QUNAT_FILTER_MAG_BITS (3) +#define PRED_QUANT_FILTER_PHASE_BITS (5) +#define PRED_QUANT_FILTER_MAG_MIN (0) +#define PRED_QUANT_FILTER_MAG_MAX (7) +#define PRED_QUANT_FILTER_PHASE_MIN (-16) +#define PRED_QUANT_FILTER_PHASE_MAX (15) + +#ifdef __cplusplus +} +#endif + +#endif /* _PRED_TABLE_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c b/lib_rend/ivas_RMSEnvDeltaHuff.c similarity index 61% rename from lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c rename to lib_rend/ivas_RMSEnvDeltaHuff.c index 9e314fcd08..16e2ee0f49 100644 --- a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.c +++ b/lib_rend/ivas_RMSEnvDeltaHuff.c @@ -1,7 +1,40 @@ -#include "RMSEnvDeltaHuff.h" +/****************************************************************************************************** + + (C) 2022 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 "ivas_RMSEnvDeltaHuff.h" #include "wmops.h" -const unsigned int c_aaiRMSEnvHuffEnc[64][2] = +/* clang-format off */ +const uint32_t c_aaiRMSEnvHuffEnc[64][2] = { {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0012, 0x000b}, {0x000d, 0x0002}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000d, 0x0003}, @@ -13,7 +46,7 @@ const unsigned int c_aaiRMSEnvHuffEnc[64][2] = {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, }; -const unsigned int c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = +const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = { {0x0002ffff, 0x0001ffff, 0x0000001d, 0x00000022, 0x0001001e, 0x0001001e, 0x00010021, 0x00010021, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, @@ -29,3 +62,4 @@ const unsigned int c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, }; +/* clang-format on */ \ No newline at end of file diff --git a/lib_rend/ivas_RMSEnvDeltaHuff.h b/lib_rend/ivas_RMSEnvDeltaHuff.h new file mode 100644 index 0000000000..13120d100e --- /dev/null +++ b/lib_rend/ivas_RMSEnvDeltaHuff.h @@ -0,0 +1,57 @@ +/****************************************************************************************************** + + (C) 2022 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_RMS_ENV_DELTA_HUFF_H_ +#define _IVAS_RMS_ENV_DELTA_HUFF_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef HUFF_READ_SIZE +#define HUFF_READ_SIZE (4) +#endif + +#ifndef HUFF_DEC_TABLE_SIZE +#define HUFF_DEC_TABLE_SIZE (16) +#endif +#include +extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; + +extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; + +#ifdef __cplusplus +} +#endif + +#endif /* _RMS_ENV_DELTA_HUFF_H_ */ diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c new file mode 100644 index 0000000000..061678770b --- /dev/null +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -0,0 +1,922 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_RMSEnvGrouping.h" + +/* Double check cost function calculation */ + +#include +#include +#include +#include +#include "options.h" +#include "prot.h" +#include "wmops.h" +#include "ivas_Tables.h" +#include "ivas_RMSEnvDeltaHuff.h" // To compute RMS transmission cost + + +typedef struct GMNODE +{ + int32_t iGroupStart; + int32_t iGroupLength; + float *pfMergedEnergydB; + int32_t *piQRMSEnvelope; + + int32_t iGroupRMSEnvelopeCost; + float fGroupSNRPenalty; + + struct GMNODE *psNext; +} GMNode; + +struct RMS_ENVELOPE_GROUPING +{ + int32_t iNumBlocks; + int32_t iMaxGroups; + float **ppfBandEnergy; + float **ppfBandEnergydB; + float **ppfWeight; + GMNode *psGMNodes; +}; + +RMSEnvelopeGrouping *CreateRMSEnvelopeGrouping( int32_t iNumBlocks ) +{ + int32_t n; + // assert( ( iNumBlocks & 0x1 ) == 0 ); // remove this + + RMSEnvelopeGrouping *psRMSEnvelopeGrouping; + + psRMSEnvelopeGrouping = (RMSEnvelopeGrouping *) count_malloc( sizeof( RMSEnvelopeGrouping ) ); + psRMSEnvelopeGrouping->iNumBlocks = iNumBlocks; +#ifdef FORCE_GROUPS_OF_2 + psRMSEnvelopeGrouping->iMaxGroups = iNumBlocks >> 1; +#else + psRMSEnvelopeGrouping->iMaxGroups = iNumBlocks; +#endif + + psRMSEnvelopeGrouping->ppfBandEnergy = (float **) count_malloc( psRMSEnvelopeGrouping->iNumBlocks * sizeof( float * ) ); + psRMSEnvelopeGrouping->ppfBandEnergydB = (float **) count_malloc( psRMSEnvelopeGrouping->iNumBlocks * sizeof( float * ) ); + psRMSEnvelopeGrouping->ppfWeight = (float **) count_malloc( psRMSEnvelopeGrouping->iNumBlocks * sizeof( float * ) ); + for ( n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n++ ) + { + psRMSEnvelopeGrouping->ppfBandEnergy[n] = (float *) count_malloc( MAX_BANDS * 2 * sizeof( float ) ); /* 2 for stereo joint group calc */ + psRMSEnvelopeGrouping->ppfBandEnergydB[n] = (float *) count_malloc( MAX_BANDS * 2 * sizeof( float ) ); + psRMSEnvelopeGrouping->ppfWeight[n] = (float *) count_malloc( MAX_BANDS * 2 * sizeof( float ) ); + } + + psRMSEnvelopeGrouping->psGMNodes = (GMNode *) count_malloc( psRMSEnvelopeGrouping->iNumBlocks * sizeof( GMNode ) ); + for ( n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n++ ) + { + psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB = (float *) count_malloc( MAX_BANDS * 2 * sizeof( float ) ); + psRMSEnvelopeGrouping->psGMNodes[n].piQRMSEnvelope = (int32_t *) count_malloc( MAX_BANDS * 2 * sizeof( int32_t ) ); + psRMSEnvelopeGrouping->psGMNodes[n].iGroupRMSEnvelopeCost = -1; + psRMSEnvelopeGrouping->psGMNodes[n].fGroupSNRPenalty = -1.0; + } + + return psRMSEnvelopeGrouping; +} + +void DeleteRMSEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping ) +{ + int32_t n; + + for ( n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n++ ) + { + count_free( psRMSEnvelopeGrouping->ppfBandEnergy[n] ); + count_free( psRMSEnvelopeGrouping->ppfBandEnergydB[n] ); + count_free( psRMSEnvelopeGrouping->ppfWeight[n] ); + } + count_free( psRMSEnvelopeGrouping->ppfBandEnergy ); + count_free( psRMSEnvelopeGrouping->ppfBandEnergydB ); + count_free( psRMSEnvelopeGrouping->ppfWeight ); + + for ( n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n++ ) + { + count_free( psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB ); + count_free( psRMSEnvelopeGrouping->psGMNodes[n].piQRMSEnvelope ); + } + count_free( psRMSEnvelopeGrouping->psGMNodes ); + + count_free( psRMSEnvelopeGrouping ); +} + +const float c_afThreshQuiet48[23] = { + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.40653699e+01f, + -8.38067304e+01f, + -8.28409495e+01f, + -8.17031225e+01f, + -7.89799501e+01f, + -7.70607916e+01f, + -7.58484320e+01f, + -7.47976303e+01f, + -7.37491303e+01f, + -7.13163746e+01f, + -6.86144293e+01f, + -6.56295695e+01f, + -6.06521800e+01f, + -3.15408065e+01f, + -1.92542188e+01f, + -1.88401753e+01f, +}; + +static void ComputeBandEnergy( const int32_t iChannels, + const int32_t iNumBlocks, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, + float **ppfBandEnergy, + float **ppfBandEnergydB, + float **ppfWeight ) +{ + int32_t n; + + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + int32_t iChanOffset; + + iChanOffset = n * iNumBands; + for ( k = 0; k < iNumBlocks; k++ ) + { + int32_t b; + int32_t iFBOffset; + float fMaxWeight; + + + iFBOffset = 0; + fMaxWeight = 0.0f; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t m; + float fEnergy = 1e-12f; + float fWeight; + + for ( m = 0; m < piBandwidths[b]; m++ ) + { + fEnergy += ( pppfReal[n][k][iFBOffset] * pppfReal[n][k][iFBOffset] + pppfImag[n][k][iFBOffset] * pppfImag[n][k][iFBOffset] ); + iFBOffset++; + } + fEnergy /= (float) ( piBandwidths[b] ); // Correction removed normalization by 2 + ppfBandEnergy[k][iChanOffset + b] = fEnergy; + + fWeight = 0.33f * powf( 10.0f, 0.0068f * ( 10.0f * log10f( fEnergy ) - c_afThreshQuiet48[b] ) ); + fWeight = ( fWeight > 0.33f ) ? fWeight : 0.33f; + fWeight = ( fWeight < 1.0f ) ? fWeight : 1.0f; + fMaxWeight = ( fMaxWeight > fWeight ) ? fMaxWeight : fWeight; + ppfWeight[k][iChanOffset + b] = fWeight; + +#ifdef APPLY_TEMPORAL_SMOOTHING + if ( k > 0 ) + { + float fSmoothEnergy; + fSmoothEnergy = 0.7f * ppfBandEnergy[k - 1][iChanOffset + b] + 0.3f * fEnergy; + + fEnergy = ( fEnergy > fSmoothEnergy ) ? fEnergy : fSmoothEnergy; + } +#endif + fEnergy = 10.0f * log10f( fEnergy ); + ppfBandEnergydB[k][iChanOffset + b] = fEnergy; + } + for ( b = 0; b < iNumBands; b++ ) + { + ppfWeight[k][iChanOffset + b] /= fMaxWeight; + } + } + } +} + +/* THis is temporary cost function */ +static float TryMerge( const int32_t iNumBands, + const int32_t iStartBlock, + const int32_t iGroupLength, + const float fMaxAllowedDiffdB, + float **ppfBandEnergy, + float **ppfBandEnergydB, +#ifdef APPLY_WEIGHT + float **ppfWeight, +#endif + float *pfMegredEnergydB ) +{ + int32_t b; + int32_t n; + float fMeanCost; + float fMaxCost; + float fMinDiffCost; + float fMaxDiffCost; + float fInvGroupSize = 1.0f / (float) iGroupLength; + float fInvNumBands = 1.0f / (float) iNumBands; + + for ( b = 0; b < iNumBands; b++ ) + { + float fGroupEnergy; + + + fGroupEnergy = 0.0; + for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) + { + fGroupEnergy += ppfBandEnergy[n][b]; + } + fGroupEnergy *= fInvGroupSize; + fGroupEnergy = 10.0f * log10f( fGroupEnergy ); // Note epsolon was added when computing BandEnergy; + + pfMegredEnergydB[b] = fGroupEnergy; + } + + fMeanCost = 0.0; + fMaxCost = 0.0; + fMinDiffCost = 0.0; + fMaxDiffCost = 0.0; + for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) + { + float fMeanAbsDiff; + float fMaxAbsDiff; + float fMaxDiff; + float fMinDiff; + + fMeanAbsDiff = 0.0; + fMaxAbsDiff = 0.0; + fMaxDiff = 0.0; + fMinDiff = 0.0; + for ( b = 0; b < iNumBands; b++ ) + { + float fDiff; + float fAbsDiff; + + fDiff = pfMegredEnergydB[b] - ppfBandEnergydB[n][b]; // Changed the order of this + fAbsDiff = fabsf( fDiff ); +#ifdef APPLY_WEIGHT + fAbsDiff *= ppfWeight[n][b]; +#endif + + fMeanAbsDiff += fAbsDiff; + fMaxAbsDiff = ( fMaxAbsDiff > fAbsDiff ) ? fMaxAbsDiff : fAbsDiff; + + + fMaxDiff = ( fMaxDiff > fDiff ) ? fMaxDiff : fDiff; + fMinDiff = ( fMinDiff < fDiff ) ? fMinDiff : fDiff; + } + fMeanAbsDiff *= fInvNumBands; + + fMeanCost = ( fMeanCost > fMeanAbsDiff ) ? fMeanCost : fMeanAbsDiff; + fMaxCost = ( fMaxCost > fMaxAbsDiff ) ? fMaxCost : fMaxAbsDiff; + + fMaxDiffCost = ( fMaxDiffCost > fMaxDiff ) ? fMaxDiffCost : fMaxDiff; + fMinDiffCost = ( fMinDiffCost < fMinDiff ) ? fMinDiffCost : fMinDiff; + } + + // printf("%f\t%f\t%f\t%f\n",fMeanCost,fMaxCost,fMaxDiffCost,fMinDiffCost); + + /*if(fMinDiffCost < -9.0){ // This prevents cliping + fMeanCost = 1e12; //Some large value + }*/ + + if ( fMaxCost > fMaxAllowedDiffdB ) + { + fMeanCost = 1e12f; // Some large value + } + + return fMeanCost; +} + +static void ComputeMergeRMS( const int32_t iNumBands, + const int32_t iStartBlock, + const int32_t iGroupLength, + float **ppfBandEnergy, + float *pfMergedEnergydB, + int32_t *piQRMSEnvelope ) +{ + int32_t b; + float fInvGroupSize = 1.0f / (float) iGroupLength; + + for ( b = 0; b < iNumBands; b++ ) + { + int32_t n; + float fGroupEnergy; + float fRMSEnvelope; + int32_t iQRMSEnvelope; + + fGroupEnergy = 0.0; + for ( n = iStartBlock; n < ( iStartBlock + iGroupLength ); n++ ) + { + fGroupEnergy += ppfBandEnergy[n][b]; + } + fGroupEnergy *= fInvGroupSize; + + fRMSEnvelope = log2f( fGroupEnergy ); + iQRMSEnvelope = ( fRMSEnvelope > 0.0 ) ? (int32_t) ( fRMSEnvelope + 0.5 ) : (int32_t) ( fRMSEnvelope - 0.5 ); + + fGroupEnergy = 10.0f * log10f( fGroupEnergy ); // Note epsolon was added when computing BandEnergy; + + pfMergedEnergydB[b] = fGroupEnergy; + piQRMSEnvelope[b] = iQRMSEnvelope; + } +} + + +static int32_t ComputeRMSEnvelopeBits( const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piQRMSEnevelope ) +{ + int32_t n; + int32_t iRMSEnvelopeBits = 0; + int32_t iChanOffset = 0; + + for ( n = 0; n < iChannels; n++ ) + { + int32_t b; + int32_t iLastRMSVal; + + iRMSEnvelopeBits += ENV0_BITS; + iLastRMSVal = piQRMSEnevelope[iChanOffset]; + for ( b = 1; b < iNumBands; b++ ) + { + int32_t iDelta; + + iDelta = piQRMSEnevelope[iChanOffset + b] - iLastRMSVal; + iDelta = ( iDelta > ENV_DELTA_MIN ) ? iDelta : ENV_DELTA_MIN; + iDelta = ( iDelta < ENV_DELTA_MAX ) ? iDelta : ENV_DELTA_MAX; + iDelta -= ENV_DELTA_MIN; + iRMSEnvelopeBits += c_aaiRMSEnvHuffEnc[iDelta][0]; + + iLastRMSVal = piQRMSEnevelope[iChanOffset + b]; + } + iChanOffset += iNumBands; + } + + return iRMSEnvelopeBits; +} + +static const float c_fiDefaultTheta48[MAX_BANDS_48] = { + 0.4375, + 0.4375, + 0.375, + 0.3125, + 0.3125, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, + 0.25, +}; + +static float ComputeSNRPenalty( const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iStartBlock, + const int32_t iGroupLength, + float **ppfBandEnergydB, + const int32_t *piRMSEnvelope ) +{ + int32_t n; + int32_t iChanOffset; + float fSNRPenalty = 0.0; + + iChanOffset = 0; + for ( n = 0; n < iChannels; n++ ) + { + int32_t b; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t k; + float fRMSVal; + + fRMSVal = 3.0103f * (float) piRMSEnvelope[iChanOffset + b]; + + for ( k = iStartBlock; k < ( iStartBlock + iGroupLength ); k++ ) + { + float fDeltadB; + + fDeltadB = fRMSVal - ppfBandEnergydB[k][iChanOffset + b]; + if ( fDeltadB < -9.0309f ) + { + fSNRPenalty += 1e10f; // Some large number to prevent clipping + } + else /*if(fDeltadB < 0.0)*/ + { + fSNRPenalty += fabsf( c_fiDefaultTheta48[b] * fDeltadB - fDeltadB ) * 2.0f * (float) piBandwidths[b] / 6.0f; + } + } + } + iChanOffset += iNumBands; + } + + + return fSNRPenalty; +} + +static float TryMegre2( const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths, + float **ppfBandEnergy, + float **ppfBandEnergydB, + GMNode *psGMNode1, + GMNode *psGMNode2 ) +{ + int32_t iRMSEnvBits1; + int32_t iRMSEnvBits2; + int32_t iRMSEnvBitsMerged; + float fSNRPenalty1; + float fSNRPenalty2; + float fSNRPenaltyMerged; + float fMergedCost = 0.0; + + /* First compute current RMS Envelope for each group */ + if ( psGMNode1->iGroupRMSEnvelopeCost == -1 || psGMNode1->fGroupSNRPenalty == -1.0 ) + { + ComputeMergeRMS( iNumBands * iChannels, + psGMNode1->iGroupStart, + psGMNode1->iGroupLength, + ppfBandEnergy, + psGMNode1->pfMergedEnergydB, + psGMNode1->piQRMSEnvelope ); + + iRMSEnvBits1 = ComputeRMSEnvelopeBits( iChannels, + iNumBands, + psGMNode1->piQRMSEnvelope ); + + fSNRPenalty1 = ComputeSNRPenalty( iChannels, + iNumBands, + piBandwidths, + psGMNode1->iGroupStart, + psGMNode1->iGroupLength, + ppfBandEnergydB, + psGMNode1->piQRMSEnvelope ); + + psGMNode1->iGroupRMSEnvelopeCost = iRMSEnvBits1; + psGMNode1->fGroupSNRPenalty = fSNRPenalty1; + } + else + { + iRMSEnvBits1 = psGMNode1->iGroupRMSEnvelopeCost; + fSNRPenalty1 = psGMNode1->fGroupSNRPenalty; + } + + if ( psGMNode2->iGroupRMSEnvelopeCost == -1 || psGMNode2->fGroupSNRPenalty == -1.0 ) + { + ComputeMergeRMS( iNumBands * iChannels, + psGMNode2->iGroupStart, + psGMNode2->iGroupLength, + ppfBandEnergy, + psGMNode2->pfMergedEnergydB, + psGMNode2->piQRMSEnvelope ); + + iRMSEnvBits2 = ComputeRMSEnvelopeBits( iChannels, + iNumBands, + psGMNode2->piQRMSEnvelope ); + + fSNRPenalty2 = ComputeSNRPenalty( iChannels, + iNumBands, + piBandwidths, + psGMNode2->iGroupStart, + psGMNode2->iGroupLength, + ppfBandEnergydB, + psGMNode2->piQRMSEnvelope ); + + psGMNode2->iGroupRMSEnvelopeCost = iRMSEnvBits2; + psGMNode2->fGroupSNRPenalty = fSNRPenalty2; + } + else + { + iRMSEnvBits2 = psGMNode2->iGroupRMSEnvelopeCost; + fSNRPenalty2 = psGMNode2->fGroupSNRPenalty; + } + + /* Compute the merged group */ + ComputeMergeRMS( iNumBands * iChannels, + psGMNode1->iGroupStart, + psGMNode1->iGroupLength + psGMNode2->iGroupLength, + ppfBandEnergy, + psGMNode1->pfMergedEnergydB, + psGMNode1->piQRMSEnvelope ); + + /* Compute the RMS Envelope cost for merged group */ + iRMSEnvBitsMerged = ComputeRMSEnvelopeBits( iChannels, + iNumBands, + psGMNode1->piQRMSEnvelope ); + + /* Compute an approximation of the bit cost based on SNR increase/decrease due to merging */ + fSNRPenaltyMerged = ComputeSNRPenalty( iChannels, + iNumBands, + piBandwidths, + psGMNode1->iGroupStart, + psGMNode1->iGroupLength + psGMNode2->iGroupLength, + ppfBandEnergydB, + psGMNode1->piQRMSEnvelope ); + + + fMergedCost = fSNRPenaltyMerged - fSNRPenalty1 - fSNRPenalty2 + (float) iRMSEnvBitsMerged - (float) iRMSEnvBits1 - (float) iRMSEnvBits2; + + return fMergedCost; +} + +static void ComputeGreedyGroups( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB ) +{ + float fBestMeanCost; + + fBestMeanCost = 0.0; + while ( fBestMeanCost < fMeanAllowedDiffdB ) + { + GMNode *psGMNode; + GMNode *psBestGMNode; + + fBestMeanCost = fMeanAllowedDiffdB; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while ( psGMNode->psNext != NULL ) + { + float fMeanCost; + int32_t iGroupLength; + + iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; + + fMeanCost = TryMerge( iNumBands * iChannels, + psGMNode->iGroupStart, + iGroupLength, // psGMNode->iGroupLength, //Fix this bug + fMaxAllowedDiffdB, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, +#ifdef APPLY_WEIGHT + psRMSEnvelopeGrouping->ppfWeight, +#endif + psGMNode->pfMergedEnergydB ); + + + if ( fMeanCost < fBestMeanCost ) + { + fBestMeanCost = fMeanCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + + if ( fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) + { + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + } + } +} + +static void ComputeGreedyGroups2( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths ) +{ + float fBestMergeCost; + // int32_t iDone = 0; + fBestMergeCost = -1.0; + + while ( fBestMergeCost < 0.0 ) + { + GMNode *psGMNode; + GMNode *psBestGMNode; + + fBestMergeCost = 0.0; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while ( psGMNode->psNext != NULL ) + { + float fMergeCost; + + fMergeCost = TryMegre2( iChannels, + iNumBands, + piBandwidths, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, + psGMNode, + psGMNode->psNext ); + + if ( fMergeCost < fBestMergeCost ) + { + fBestMergeCost = fMergeCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + if ( fBestMergeCost < 0.0 && psBestGMNode != NULL && psBestGMNode->psNext != NULL ) + { + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->iGroupRMSEnvelopeCost = -1; + psBestGMNode->fGroupSNRPenalty = -1.0; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + } + } +} + +static void ComputeGreedyGroups3( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths, + const int32_t iMaxGroups ) +{ + + int32_t iDone = 0; + int32_t iNumGroups = psRMSEnvelopeGrouping->iMaxGroups; + while ( iDone == 0 ) + { + GMNode *psGMNode; + GMNode *psBestGMNode; + float fBestMergeCost; + + fBestMergeCost = 1e20f; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + psBestGMNode = NULL; + while ( psGMNode->psNext != NULL ) + { + float fMergeCost; + + fMergeCost = TryMegre2( iChannels, + iNumBands, + piBandwidths, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, + psGMNode, + psGMNode->psNext ); + + if ( fMergeCost < fBestMergeCost ) + { + fBestMergeCost = fMergeCost; + psBestGMNode = psGMNode; + } + + psGMNode = psGMNode->psNext; + } + if ( fBestMergeCost > 0.0 && iNumGroups <= iMaxGroups ) + { + iDone++; + } + else if ( psBestGMNode != NULL && psBestGMNode->psNext != NULL ) + { + psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; + psBestGMNode->iGroupRMSEnvelopeCost = -1; + psBestGMNode->fGroupSNRPenalty = -1.0; + psBestGMNode->psNext = psBestGMNode->psNext->psNext; + iNumGroups--; + } + else + { + iDone++; // This only catches a problem + } + } +} + +static void ComputeRMSEnvelope( const int32_t iChannels, + const int32_t iNumBands, + const int32_t iNumGroups, + const int32_t *piGroupLengths, + float **ppfBandEnergy, + int32_t ***pppiRMSEnvelope ) +{ + int32_t n; + + for ( n = 0; n < iChannels; n++ ) + { + int32_t b; + int32_t iChanOffset; + + iChanOffset = n * iNumBands; + for ( b = 0; b < iNumBands; b++ ) + { + int32_t k; + int32_t iBlockOffset; + + iBlockOffset = 0; + for ( k = 0; k < iNumGroups; k++ ) + { + int32_t m; + float fGroupEnergy; + fGroupEnergy = 0.0; + for ( m = 0; m < piGroupLengths[k]; m++ ) + { + fGroupEnergy += ppfBandEnergy[iBlockOffset][b + iChanOffset]; + iBlockOffset++; + } + fGroupEnergy /= (float) piGroupLengths[k]; + + fGroupEnergy = log2f( fGroupEnergy ); + pppiRMSEnvelope[n][k][b] = ( fGroupEnergy > 0.0 ) ? (int32_t) ( fGroupEnergy + 0.5 ) : (int32_t) ( fGroupEnergy - 0.5 ); // Bug fix + pppiRMSEnvelope[n][k][b] = ( pppiRMSEnvelope[n][k][b] > ENV_MIN ) ? pppiRMSEnvelope[n][k][b] : ENV_MIN; + pppiRMSEnvelope[n][k][b] = ( pppiRMSEnvelope[n][k][b] < ENV_MAX ) ? pppiRMSEnvelope[n][k][b] : ENV_MAX; + } + } + } +} + +static void LimitRMSEnvelope( const int32_t iBandCount, + const int32_t iRMSDeltaMax, + const int32_t iRMSDeltaMin, + int32_t *piRMSEnvelope ) +{ + int32_t iBand; + int32_t iLastSCF; + + /* Increase low envelope values to ensure that the scale factors traces the large values correctly (checking for max deltas) */ + iLastSCF = piRMSEnvelope[iBandCount - 1]; + for ( iBand = iBandCount - 2; iBand > -1; iBand-- ) + { + int32_t iDelta; + + iDelta = iLastSCF - piRMSEnvelope[iBand]; + + if ( iDelta > iRMSDeltaMax ) + { +#ifdef DEBUG_VERBOSE + printf( "WARNING RMS envelope delta limited\n" ); +#endif + piRMSEnvelope[iBand] += ( iDelta - iRMSDeltaMax ); + } + + iLastSCF = piRMSEnvelope[iBand]; + } + + /* Increase low envelope values to ensure that the envelope traces the large values correctly (checking for min deltas)*/ + iLastSCF = piRMSEnvelope[0]; + for ( iBand = 1; iBand < iBandCount; iBand++ ) + { + int32_t iDelta; + + iDelta = piRMSEnvelope[iBand] - iLastSCF; + + if ( iDelta < iRMSDeltaMin ) + { +#ifdef DEBUG_VERBOSE + printf( "WARNING RMS envelope delta limited\n" ); +#endif + piRMSEnvelope[iBand] += ( iRMSDeltaMin - iDelta ); + } + + iLastSCF = piRMSEnvelope[iBand]; + } +} + +void ComputeEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths, // pass in absolute thresh + float ***pppfReal, + float ***pppfImag, +#ifndef USE_BIT_COUNT_MERGE_COST + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB, +#endif + int32_t *piNumGroups, + int32_t *piGroupLengths, + int32_t ***pppiRMSEnvelope ) +{ + int32_t n; + GMNode *psGMNode; + + /* Compute Band Energies */ + ComputeBandEnergy( iChannels, + psRMSEnvelopeGrouping->iNumBlocks, + iNumBands, + piBandwidths, + pppfReal, + pppfImag, + psRMSEnvelopeGrouping->ppfBandEnergy, + psRMSEnvelopeGrouping->ppfBandEnergydB, + psRMSEnvelopeGrouping->ppfWeight ); + + /* Init GMNodes */ +#ifdef FORCE_GROUPS_OF_2 + psRMSEnvelopeGrouping->psGMNodes[0].iGroupStart = 0; + psRMSEnvelopeGrouping->psGMNodes[0].iGroupLength = 2; + psRMSEnvelopeGrouping->psGMNodes[0].psNext = NULL; +#ifdef BUG_FIX_03_15_23_INIT_GROUPING + psRMSEnvelopeGrouping->psGMNodes[0].iGroupRMSEnvelopeCost = -1; + psRMSEnvelopeGrouping->psGMNodes[0].fGroupSNRPenalty = -1.0f; +#endif + for ( n = 1; n < psRMSEnvelopeGrouping->iMaxGroups; n++ ) + { + psRMSEnvelopeGrouping->psGMNodes[n - 1].psNext = &psRMSEnvelopeGrouping->psGMNodes[n]; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupStart = n * 2; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupLength = 2; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupRMSEnvelopeCost = -1; + psRMSEnvelopeGrouping->psGMNodes[n].fGroupSNRPenalty = -1.0; + psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; + } +#else + psRMSEnvelopeGrouping->psGMNodes[0].iGroupStart = 0; + psRMSEnvelopeGrouping->psGMNodes[0].iGroupLength = 1; + psRMSEnvelopeGrouping->psGMNodes[0].psNext = NULL; +#ifdef BUG_FIX_03_15_23_INIT_GROUPING + psRMSEnvelopeGrouping->psGMNodes[0].iGroupRMSEnvelopeCost = -1; + psRMSEnvelopeGrouping->psGMNodes[0].fGroupSNRPenalty = -1.0f; +#endif + for ( n = 1; n < psRMSEnvelopeGrouping->iMaxGroups; n++ ) + { + psRMSEnvelopeGrouping->psGMNodes[n - 1].psNext = &psRMSEnvelopeGrouping->psGMNodes[n]; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupStart = n; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupLength = 1; + psRMSEnvelopeGrouping->psGMNodes[n].iGroupRMSEnvelopeCost = -1; + psRMSEnvelopeGrouping->psGMNodes[n].fGroupSNRPenalty = -1.0; + psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; + } +#endif + /* Perform grouping via Greedy Merge */ +#ifndef USE_BIT_COUNT_MERGE_COST + ComputeGreedyGroups( psRMSEnvelopeGrouping, + iChannels, + iNumBands, + fMeanAllowedDiffdB, + fMaxAllowedDiffdB ); +#else + /*ComputeGreedyGroups2(psRMSEnvelopeGrouping, + iChannels, + iNumBands, + piBandwidths);*/ + // Allows control over max groups can call using 16 if want same as previous call + ComputeGreedyGroups3( psRMSEnvelopeGrouping, + iChannels, + iNumBands, + piBandwidths, + CQMF_BLOCKS_PER_FRAME ); +#endif + + /* Calc Groups from Merge Results */ + *piNumGroups = 0; + psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; + while ( psGMNode != NULL ) + { + piGroupLengths[*piNumGroups] = psGMNode->iGroupLength; + *piNumGroups += 1; + psGMNode = psGMNode->psNext; + } + + /* Compute RMS Envelope given group lengths */ + ComputeRMSEnvelope( iChannels, + iNumBands, + *piNumGroups, + piGroupLengths, + psRMSEnvelopeGrouping->ppfBandEnergy, + pppiRMSEnvelope ); + + /* Envelope Tenting */ + for ( n = 0; n < iChannels; n++ ) + { + int32_t k; + for ( k = 0; k < *piNumGroups; k++ ) + { + LimitRMSEnvelope( iNumBands, + ENV_DELTA_MAX, + ENV_DELTA_MIN, + pppiRMSEnvelope[n][k] ); + } + } +} diff --git a/lib_rend/ivas_RMSEnvGrouping.h b/lib_rend/ivas_RMSEnvGrouping.h new file mode 100644 index 0000000000..fff7e99965 --- /dev/null +++ b/lib_rend/ivas_RMSEnvGrouping.h @@ -0,0 +1,66 @@ +/****************************************************************************************************** + + (C) 2022 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_RMS_ENV_GROUPING_H_ +#define _IVAS_RMS_ENV_GROUPING_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#include "options.h" + typedef struct RMS_ENVELOPE_GROUPING RMSEnvelopeGrouping; + + RMSEnvelopeGrouping *CreateRMSEnvelopeGrouping( int32_t iNumBlocks ); + + void DeleteRMSEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping ); + + void ComputeEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, + const int32_t iChannels, + const int32_t iNumBands, + const int32_t *piBandwidths, + float ***pppfReal, + float ***pppfImag, +#ifndef USE_BIT_COUNT_MERGE_COST + const float fMeanAllowedDiffdB, + const float fMaxAllowedDiffdB, +#endif + int32_t *piNumGroups, + int32_t *piGroupLengths, + int32_t ***pppiRMSEnvelope ); + +#ifdef __cplusplus +} +#endif + +#endif /* _RMS_ENV_GROUPING_H_ */ diff --git a/lib_rend/ivas_Tables.c b/lib_rend/ivas_Tables.c new file mode 100644 index 0000000000..c28ff6d26f --- /dev/null +++ b/lib_rend/ivas_Tables.c @@ -0,0 +1,196 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_Tables.h" +#include "wmops.h" + +/* clang-format off */ +const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL+1][2] = { + {1.0f, 0.0f}, /* zero */ + {0.0f, 1.0f}, /* pi/2 */ + {-1.0f, 0.0f}, /* pi */ + {0.0f, -1.0f}, /* 3*pi/2 */ +}; + +/* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ +const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = { + {-1.00000000f, -0.00000000f}, + {-0.96592583f, -0.25881905f}, + {-0.86602540f, -0.50000000f}, + {-0.70710678f, -0.70710678f}, + {-0.50000000f, -0.86602540f}, + {-0.25881905f, -0.96592583f}, + {0.00000000f, -1.00000000f}, + {0.25881905f, -0.96592583f}, + {0.50000000f, -0.86602540f}, + {0.70710678f, -0.70710678f}, + {0.86602540f, -0.50000000f}, + {0.96592583f, -0.25881905f}, + {1.00000000f, 0.00000000f}, + {0.96592583f, 0.25881905f}, + {0.86602540f, 0.50000000f}, + {0.70710678f, 0.70710678f}, + {0.50000000f, 0.86602540f}, + {0.25881905f, 0.96592583f}, + {0.00000000f, 1.00000000f}, + {-0.25881905f, 0.96592583f}, + {-0.50000000f, 0.86602540f}, + {-0.70710678f, 0.70710678f}, + {-0.86602540f, 0.50000000f}, + {-0.96592583f, 0.25881905f}, + {-1.00000000f, 0.00000000f} +}; + +/* Move this to perceptual model ? */ +const int32_t c_aiBandwidths48[MAX_BANDS_48] = { + 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, +}; + + +const float c_afScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 0.353553390593f, + 0.420448207627f, + 0.500000000000f, + 0.594603557501f, + 0.707106781187f, + 0.840896415254f, + 1.000000000000f, + 1.189207115003f, + 1.414213562373f, + 1.681792830507f, + 2.000000000000f, + 2.378414230005f, + 2.828427124746f, + 3.363585661015f, + 4.0f, + 4.756828460011f, + 5.656854249492f, + 6.727171322030f, + 8.0f, + 9.513656920022f, + 11.31370849898f, + 13.45434264406f, + 16.00000000000f, + 19.02731384004f, + 22.62741699797f, + 26.90868528812f, + 32.000000000000000f, + 38.054627680087073f, + 45.254833995939038f, + 53.817370576237735f, + 64.000000000000000f, +}; + +const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 2.367513562373095f, + 2.046407115002721f, + 1.775900000000000f, + 1.536446415253715f, + 1.323056781186548f, + 1.132903557501360f, + 0.965800000000000f, + 0.821348207626857f, + 0.695103390593274f, + 0.587801778750680f, + 0.495800000000000f, + 0.418124103813429f, + 0.352176695296637f, + 0.296200889375340f, + 0.249400000000000f, + 0.209812051906714f, + 0.176538347648318f, + 0.148525444687670f, + 0.124900000000000f, + 0.105056025953357f, + 0.088388347648318f, + 0.074325444687670f, + 0.062500000000000f, + 0.052556025953357f, + 0.044194173824159f, + 0.037162722343835f, + 0.031250000000000f, + 0.026278012976679f, + 0.022097086912080f, + 0.018581361171918f, + 0.015625000000000f, +}; + +const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { + 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, + 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, + 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, + 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, + 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, + 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, + 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, + 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, + 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, + 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, + 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, + 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, + 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, + 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, + 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, + 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, + 4.29496730e+09f, +}; + +const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { + 0, 3, 3, 4, 5, 5, 6, 7, + 8, 9, 12, 13, 16, 17, 19, 23, + 26, 26, 27, 28, 31, 36, 38, 45, + 54, 64, 76, 90, 108, 128, 152, 180, +}; + +const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { + 0, 4, 4, 5, 6, 6, 7, 8, + 9, 10, 13, 14, 17, 18, 20, 24, + 27, 27, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { + 1, 16, 16, 25, 36, 36, 49, 64, + 81, 100, 169, 196, 289, 324, 400, 576, + 729, 729, 28, 29, 32, 37, 39, 46, + 55, 65, 77, 91, 109, 129, 153, 181, +}; +/* clang-format on */ diff --git a/lib_rend/ivas_Tables.h b/lib_rend/ivas_Tables.h new file mode 100644 index 0000000000..676ecd43d0 --- /dev/null +++ b/lib_rend/ivas_Tables.h @@ -0,0 +1,126 @@ +/****************************************************************************************************** + + (C) 2022 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_TABLES_H_ +#define _IVAS_TABLES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include +#ifndef M_PI + +#define M_PI 3.14159265358979323846264338327950288f + +#endif + +#define CQMF_BLOCKS_PER_FRAME ( 16 ) +#define CQMF_MAX_BLOCKS_PER_FRAME ( 16 ) +#define CQMF_BANDS ( 60 ) + +#define MAX_BANDS ( 23 ) +#define MAX_BANDS_48 ( 23 ) + + extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this + + +#define ENV_MIN ( -64 ) +#define ENV_MAX ( 64 ) + +#define ENV0_BITS ( 7 ) + +#define ENV_DELTA_MIN ( -32 ) +#define ENV_DELTA_MAX ( 31 ) + +#define ENV_RECONSTRUCT_TABLE_SIZE ( 129 ) + +#define ENV_RECONSTRUCT_TABLE_CENTER ( 64 ) + +#define MIN_ALLOC ( 0 ) +#define MAX_ALLOC ( 31 ) + +#define ALLOC_OFFSET_SCALE ( 8 ) + +#define ALLOC_OFFSET_BITS ( 8 ) + +#define MIN_ALLOC_OFFSET ( -128 ) +#define MAX_ALLOC_OFFSET ( 127 ) + + +#define ALLOC_TABLE_SIZE ( 32 ) + +#ifndef _PI_ +#define _PI_ ( 3.14159265358979f ) +#endif +#define PRED_MAX_VAL ( 12 ) +#define PRED_MIN_VAL ( -PRED_MAX_VAL ) +#define PRED_QUANT_FACTOR ( (float) PRED_MAX_VAL ) +#define PRED_BAND0_BITS ( 5 ) + +#define PHASE_MAX_VAL ( 12 ) +#define PHASE_MIN_VAL ( -PHASE_MAX_VAL ) +#define PHASE_QUANT_FACTOR ( (float) PHASE_MAX_VAL / _PI_ ) +#define PHASE_DIFF_DIM ( 2 ) +#define PHASE_BAND0_BITS ( 5 ) + +#define SIMPLE_PHASE_MAX_VAL ( 3 ) +#define SIMPLE_PHASE_MIN_VAL ( 0 ) +#define SIMPLE_PHASE_BITS ( 2 ) +#define SIMPLE_PHASE_QUANT_FACTOR ( 2.0f / _PI_ ) + +#define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) +#define TON_QUOTA_INC_THRESHOLD ( 4.0f ) + + extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; + extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; + extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; + + extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; + + extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; + + extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; + + extern const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; + +#ifdef __cplusplus +} +#endif + +#endif /* _TABLES_H_ */ diff --git a/lib_rend/ivas_binauralRenderer.c b/lib_rend/ivas_binauralRenderer.c index ff85e0c73b..ba7b293153 100644 --- a/lib_rend/ivas_binauralRenderer.c +++ b/lib_rend/ivas_binauralRenderer.c @@ -137,7 +137,12 @@ static ivas_error ivas_binRenderer_convModuleOpen( const int16_t renderer_type, const int16_t isLoudspeaker, const AUDIO_CONFIG input_config, - const RENDER_CONFIG_DATA *hRenderConfig ) + const RENDER_CONFIG_DATA *hRenderConfig +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t num_poses +#endif +) { int16_t bandIdx, chIdx; BINRENDERER_CONV_MODULE_HANDLE hBinRenConvModule; @@ -145,6 +150,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( int16_t pos_idx; #endif + /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ @@ -246,30 +252,17 @@ static ivas_error ivas_binRenderer_convModuleOpen( } } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - hBinRenConvModule->numPoses = MAX_HEAD_ROT_POSES + 1; -#else - hBinRenConvModule->numPoses = MAX_HEAD_ROT_POSES; -#endif - } - else - { - hBinRenConvModule->numPoses = 1; - } - - if ( ( hBinRenConvModule->filterStatesLeftReal = (float ****) count_malloc( hBinRenConvModule->numPoses * sizeof( float *** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftReal = (float ****) count_malloc( num_poses * sizeof( float *** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterStatesLeftImag = (float ****) count_malloc( hBinRenConvModule->numPoses * sizeof( float *** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftImag = (float ****) count_malloc( num_poses * sizeof( float *** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - for ( pos_idx = 0; pos_idx < hBinRenConvModule->numPoses; pos_idx++ ) + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { if ( ( hBinRenConvModule->filterStatesLeftReal[pos_idx] = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { @@ -422,7 +415,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( } #ifdef SPLIT_REND_WITH_HEAD_ROT - for ( pos_idx = 0; pos_idx < hBinRenConvModule->numPoses; pos_idx++ ) + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { @@ -581,14 +574,15 @@ static void ivas_binaural_obtain_DMX( ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, const IVAS_REND_AudioConfig inConfig, - const IVAS_SPLIT_REND_MODE splitRendMode, + const IVAS_REND_AudioConfig outConfig, RENDER_CONFIG_DATA *hRendCfg, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { BINAURAL_RENDERER_HANDLE hBinRenderer; int16_t convBand; ivas_error error; - AUDIO_CONFIG in_config; + AUDIO_CONFIG in_config, out_config; error = IVAS_ERR_OK; @@ -607,8 +601,6 @@ ivas_error ivas_rend_openCldfbRend( } hBinRenderer->rotInCldfb = 1; - hBinRenderer->splitRendMode = splitRendMode; - hBinRenderer->ivas_format = SBA_FORMAT; hBinRenderer->max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); @@ -616,6 +608,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->timeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; /* Corresponds to 5 msec sound to motion latency */ in_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); + out_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); if ( convBand > BINAURAL_CONVBANDS ) { @@ -628,8 +621,22 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); + if ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + hBinRenderer->numPoses = pMultiBinPoseData->num_poses + 1; +#else + hBinRenderer->numPoses = pMultiBinPoseData->num_poses; +#endif + } + else + { + hBinRenderer->numPoses = 1; + } + /* Allocate memories and buffers needed for convolutional module */ - if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config, hRendCfg ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config, hRendCfg, + hBinRenderer->numPoses ) ) != IVAS_ERR_OK ) { return error; } @@ -678,7 +685,18 @@ ivas_error ivas_binRenderer_open( } #ifdef SPLIT_REND_WITH_HEAD_ROT - hBinRenderer->splitRendMode = st_ivas->hDecoderConfig->Opt_splitRendMode; + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + hBinRenderer->numPoses = st_ivas->splitBinRend.splitrend.multiBinPoseData.num_poses + 1; +#else + hBinRenderer->numPoses = st_ivas->splitBinRend.splitrend.multiBinPoseData.num_poses; +#endif + } + else + { + hBinRenderer->numPoses = 1; + } #endif /* Declare some common variables needed for renderer */ @@ -718,7 +736,12 @@ ivas_error ivas_binRenderer_open( IVAS_OUTPUT_SETUP out_setup; /* Allocate memories and buffers needed for convolutional module in CICP19 */ - if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, AUDIO_CONFIG_7_1_4, st_ivas->hRenderConfig ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, AUDIO_CONFIG_7_1_4, st_ivas->hRenderConfig +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + hBinRenderer->numPoses +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -741,7 +764,12 @@ ivas_error ivas_binRenderer_open( else { /* Allocate memories and buffers needed for convolutional module */ - if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hRenderConfig ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, st_ivas->hRenderConfig +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + hBinRenderer->numPoses +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -816,6 +844,10 @@ ivas_error ivas_binRenderer_open( static void ivas_binRenderer_convModuleClose( BINAURAL_RENDERER_HANDLE *hBinRenderer /* i/o: fastconv binaural renderer handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + int16_t num_poses +#endif ) { int16_t bandIdx, chIdx; @@ -859,7 +891,7 @@ static void ivas_binRenderer_convModuleClose( hBinRenConvModule->filterTapsRightImag = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT - for ( posIdx = 0; posIdx < hBinRenConvModule->numPoses; posIdx++ ) + for ( posIdx = 0; posIdx < num_poses; posIdx++ ) { for ( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) { @@ -957,7 +989,12 @@ void ivas_binRenderer_close( if ( ( *hBinRenderer )->hBinRenConvModule != NULL ) { - ivas_binRenderer_convModuleClose( hBinRenderer ); + ivas_binRenderer_convModuleClose( hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + ( *hBinRenderer )->numPoses +#endif + ); } if ( ( *hBinRenderer )->hReverb != NULL ) @@ -1069,6 +1106,9 @@ void ivas_binaural_cldfb( /* Implement binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hHeadTrackData, +#ifdef SPLIT_REND_WITH_HEAD_ROT + &st_ivas->splitBinRend.splitrend.multiBinPoseData, +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG NULL, #endif @@ -1111,6 +1151,9 @@ void ivas_binaural_cldfb( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, #endif @@ -1133,18 +1176,7 @@ void ivas_binRenderer( wmops_sub_start( "fastconv_binaural_rendering" ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - num_poses = MAX_HEAD_ROT_POSES + 1; -#else - num_poses = MAX_HEAD_ROT_POSES; -#endif - } - else - { - num_poses = 1; - } + num_poses = hBinRenderer->numPoses; #endif /* Compute Convolution */ @@ -1215,50 +1247,36 @@ void ivas_binRenderer( #ifdef SPLIT_REND_WITH_HEAD_ROT /*TODO : move this to a separate function*/ - if ( hBinRenderer->splitRendMode == SPLIT_REND_PRE || hBinRenderer->splitRendMode == SPLIT_REND_COMB ) + if ( pMultiBinPoseData->num_poses > 1 ) { - int16_t yaw_idx, pitch_idx, roll_idx; IVAS_QUATERNION Quaternions_rel, Quaternions_abs, *Quaternions_ref; float Rmat_local[3][3]; + if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) { Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; - Quaternions_rel.w = -3.0f; /*euler*/ - Quaternions_abs.w = -3.0f; /*euler*/ - Quat2Euler( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ - // Quaternions_abs.x = Quaternions_ref->x; - // Quaternions_abs.y = Quaternions_ref->y; - // Quaternions_abs.z = Quaternions_ref->z; - for ( yaw_idx = 0; yaw_idx < MAX_YAW_ANGLES; yaw_idx++ ) + Quaternions_rel.w = -3.0f; /*euler*/ + Quaternions_abs.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + + for ( pos_idx = 1; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) { - for ( pitch_idx = 0; pitch_idx < MAX_PITCH_ANGLES; pitch_idx++ ) - { - for ( roll_idx = 0; roll_idx < MAX_ROLL_ANGLES; roll_idx++ ) - { - pos_idx = yaw_idx * MAX_PITCH_ANGLES * MAX_ROLL_ANGLES + pitch_idx * MAX_ROLL_ANGLES + roll_idx; - if ( pos_idx == 0 ) - { - continue; - } - - Quaternions_rel.x = split_rend_relative_yaw_angles[yaw_idx]; - Quaternions_rel.y = split_rend_relative_pitch_angles[pitch_idx]; - Quaternions_rel.z = split_rend_relative_roll_angles[roll_idx]; - Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; - Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; - Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; - - - QuatToRotMat( Quaternions_rel, Rmat_local ); - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, hBinRenderer + Quaternions_rel.x = pMultiBinPoseData->relative_head_poses[pos_idx][0] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + Quaternions_rel.y = pMultiBinPoseData->relative_head_poses[pos_idx][1] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + Quaternions_rel.z = pMultiBinPoseData->relative_head_poses[pos_idx][2] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; + Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; + Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; + + + QuatToRotMat( Quaternions_rel, Rmat_local ); + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, hBinRenderer #ifdef SPLIT_REND_WITH_HEAD_ROT - , - pos_idx + , + pos_idx #endif - ); - } - } + ); } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG @@ -1267,8 +1285,8 @@ void ivas_binRenderer( IVAS_QUATERNION *Quaternions_new1; IVAS_QUATERNION Quaternions_new; Quaternions_new1 = &hPostRendHeadTrackData->Quaternions[hPostRendHeadTrackData->num_quaternions++]; - Quaternions_new.w = -3.0f; /*euler*/ - Quat2Euler( *Quaternions_new1, &Quaternions_new.z, &Quaternions_new.y, &Quaternions_new.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quaternions_new.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_new1, &Quaternions_new.z, &Quaternions_new.y, &Quaternions_new.x ); /*order in Quat2Euler seems to be reversed ?*/ Quaternions_rel.x = Quaternions_new.x - Quaternions_abs.x; Quaternions_rel.y = Quaternions_new.y - Quaternions_abs.y; Quaternions_rel.z = Quaternions_new.z - Quaternions_abs.z; @@ -1278,10 +1296,10 @@ void ivas_binRenderer( QuatToRotMat( Quaternions_rel, Rmat_local ); rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES], Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES], RealBuffer, ImagBuffer, hBinRenderer + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[num_poses], Cldfb_ImagBuffer_Binaural[num_poses], RealBuffer, ImagBuffer, hBinRenderer #ifdef SPLIT_REND_WITH_HEAD_ROT , - MAX_HEAD_ROT_POSES + num_poses #endif ); } @@ -1342,10 +1360,12 @@ void ivas_binRenderer( void ivas_rend_CldfbMultiBinRendProcess( const BINAURAL_RENDERER_HANDLE hCldfbRend, const IVAS_REND_HeadRotData *pHeadRotData, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Real[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) + float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t low_res_pre_rend_rot ) { int16_t sf_idx, slot_idx, ch_idx, idx, pose_idx; HEAD_TRACK_DATA head_track; @@ -1374,7 +1394,14 @@ void ivas_rend_CldfbMultiBinRendProcess( } head_track.num_quaternions = 0; head_track.shd_rot_max_order = -1; - head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); + if ( low_res_pre_rend_rot ) + { + head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, 0 ); + } + else + { + head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); + } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG head_track_post.num_quaternions = 0; head_track_post.shd_rot_max_order = -1; @@ -1382,16 +1409,15 @@ void ivas_rend_CldfbMultiBinRendProcess( #endif ivas_binRenderer( hCldfbRend, &head_track, + pMultiBinPoseData, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG &head_track_post, #endif Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pose_idx = 0; pose_idx < MAX_HEAD_ROT_POSES + 1; pose_idx++ ) -#else - for ( pose_idx = 0; pose_idx < MAX_HEAD_ROT_POSES; pose_idx++ ) -#endif + + for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; diff --git a/lib_rend/ivas_cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_codec_bitstream.c new file mode 100644 index 0000000000..fae5403b9b --- /dev/null +++ b/lib_rend/ivas_cldfb_codec_bitstream.c @@ -0,0 +1,307 @@ +/****************************************************************************************************** + + (C) 2022 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 "ivas_cldfb_codec_bitstream.h" + +#include +#include +#include "options.h" +#include "prot.h" +#include "wmops.h" + +#define MAX_BUFFER 1024 + +static const uint32_t MASKS[] = { + 0x00000000, + 0x00000001, + 0x00000003, + 0x00000007, + 0x0000000f, + 0x0000001f, + 0x0000003f, + 0x0000007f, + 0x000000ff, + 0x000001ff, + 0x000003ff, + 0x000007ff, + 0x00000fff, + 0x00001fff, + 0x00003fff, + 0x00007fff, + 0x0000ffff, + 0x0001ffff, + 0x0003ffff, + 0x0007ffff, + 0x000fffff, + 0x001fffff, + 0x003fffff, + 0x007fffff, + 0x00ffffff, + 0x01ffffff, + 0x03ffffff, + 0x07ffffff, + 0x0fffffff, + 0x1fffffff, + 0x3fffffff, + 0x7fffffff, +}; + +Bitstream *CreateBitstream( const int32_t iDirection, + const int32_t iMaxBuffer ) + +{ + + int32_t n; + Bitstream *psBitstream; + + psBitstream = (Bitstream *) count_malloc( sizeof( Bitstream ) ); + + psBitstream->iDirection = iDirection; + psBitstream->iMaxBuffer = iMaxBuffer; + psBitstream->iIndex = 0; + psBitstream->iBufferEnd = 0; + psBitstream->iBufferStart = 0; + psBitstream->iError = BS_ERROR_NONE; + + if ( psBitstream->iMaxBuffer == -1 ) + { + psBitstream->iMaxBuffer = 4096; + } + + psBitstream->puchBuffer = (uint8_t *) count_malloc( sizeof( uint8_t ) * psBitstream->iMaxBuffer ); + + for ( n = 0; n < psBitstream->iMaxBuffer; n++ ) + { + psBitstream->puchBuffer[n] = 0; + } + + return psBitstream; +} + +void DeleteBitstream( Bitstream *psBitstream ) +{ + count_free( psBitstream->puchBuffer ); + count_free( psBitstream ); +} + +void BSFlushBuffer( Bitstream *psBitstream ) +{ + memset( psBitstream->puchBuffer, 0, psBitstream->iMaxBuffer ); + psBitstream->iIndex = 0; + psBitstream->iBufferEnd = 0; + psBitstream->iBufferStart = 0; + psBitstream->iError = BS_ERROR_NONE; +} + +int32_t BSPutBytes( Bitstream *psBitstream, + const uint8_t *puchBytes, + const int32_t iByteCount ) +{ + int32_t n; + for ( n = 0; n < iByteCount; n++ ) + { + psBitstream->puchBuffer[psBitstream->iBufferEnd] = puchBytes[n]; + psBitstream->iBufferEnd++; + } + if ( psBitstream->iDirection != BS_READ ) + { + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int32_t BSGetBytes( Bitstream *psBitstream, + uint8_t *puchBytes, + int32_t iByteCount ) +{ + int32_t n; + for ( n = 0; n < iByteCount; n++ ) + { + puchBytes[n] = psBitstream->puchBuffer[psBitstream->iBufferStart]; + psBitstream->puchBuffer[psBitstream->iBufferStart] = 0; + psBitstream->iBufferStart++; + } + if ( psBitstream->iDirection != BS_WRITE ) + { + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int32_t BSByteAlign( Bitstream *psBitstream ) +{ + if ( psBitstream->iDirection == BS_WRITE ) + { + if ( psBitstream->iIndex & 0x7 ) + { + int32_t iByte; + int32_t iRem; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - ( psBitstream->iIndex - ( iByte << 3 ) ); + psBitstream->puchBuffer[iByte] &= ( 0xff ^ MASKS[iRem] ); + psBitstream->iIndex += iRem; + } + } + else + { + if ( psBitstream->iIndex & 0x7 ) + { + int32_t iByte; + int32_t iRem; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - ( psBitstream->iIndex - ( iByte << 3 ) ); + psBitstream->iIndex += iRem; + } + } + + return psBitstream->iError; +} + +int32_t BSPutBits( Bitstream *psBitstream, + int32_t iValue, + int32_t iBitCount ) +{ + iValue &= MASKS[iBitCount]; + while ( iBitCount ) + { + int32_t iByte; + int32_t iRem; + int32_t iShift; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - ( psBitstream->iIndex - ( iByte << 3 ) ); // 8 - psBitstream->iIndex & 0x7; + + iShift = iBitCount - iRem; + if ( iShift <= 0 ) + { + iShift *= -1; + psBitstream->puchBuffer[iByte] += (uint8_t) ( iValue << iShift ); + psBitstream->iIndex += iBitCount; + iBitCount = 0; + } + else + { + psBitstream->puchBuffer[iByte] += (uint8_t) ( iValue >> iShift ); + iValue &= MASKS[iShift]; + psBitstream->iIndex += iRem; + iBitCount -= iRem; + } + } + + if ( psBitstream->iDirection != BS_WRITE ) + { + psBitstream->iError = BS_ERROR_FAIL; + } + + return psBitstream->iError; +} + +int32_t BSGetBits( Bitstream *psBitstream, + int32_t iBitCount ) +{ + int32_t iValue = 0; + + while ( iBitCount ) + { + uint8_t uchByte; + int32_t iByte; + int32_t iRem; + int32_t iShift; + + iByte = psBitstream->iIndex >> 3; + iRem = 8 - ( psBitstream->iIndex - ( iByte << 3 ) ); // 8 - psBitstream->iIndex & 0x7; + uchByte = psBitstream->puchBuffer[iByte]; + iShift = iBitCount - iRem; + + if ( iShift <= 0 ) + { + iShift *= -1; + iValue += (int32_t) ( ( uchByte >> iShift ) & MASKS[iBitCount] ); + psBitstream->iIndex += iBitCount; + iBitCount = 0; + } + else + { + uchByte &= MASKS[iRem]; + iValue += ( ( (int32_t) uchByte ) << iShift ); + psBitstream->iIndex += iRem; + iBitCount -= iRem; + } + } + + if ( psBitstream->iDirection != BS_READ ) + { + psBitstream->iError = BS_ERROR_FAIL; + } + + return iValue; +} + +int32_t BSForceBack( + ivas_split_rend_bits_t *pBits, + int32_t iValue, + int32_t iBitCount ) +{ + pBits->bits_read -= iBitCount; + return ( iValue >> iBitCount ); +} + +int32_t BSGetByteCount( Bitstream *psBitstream ) +{ + int32_t iBytes; + iBytes = psBitstream->iIndex >> 3; + if ( ( iBytes << 3 ) != psBitstream->iIndex ) + { + iBytes++; + } + + return iBytes; +} + +uint8_t *BSGetBuffer( Bitstream *psBitstream ) +{ + return psBitstream->puchBuffer; +} + +int32_t BSGetAvailableBytes( Bitstream *psBitstream ) +{ + return psBitstream->iBufferEnd; +} + +int32_t BSGetError( Bitstream *psBitstream ) +{ + return psBitstream->iError; +} diff --git a/lib_rend/ivas_cldfb_codec_bitstream.h b/lib_rend/ivas_cldfb_codec_bitstream.h new file mode 100644 index 0000000000..44e351cec5 --- /dev/null +++ b/lib_rend/ivas_cldfb_codec_bitstream.h @@ -0,0 +1,101 @@ +/****************************************************************************************************** + + (C) 2022 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_CLDFB_CODEC_BITSTREAM_H_ +#define _IVAS_CLDFB_CODEC_BITSTREAM_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "lib_rend.h" +#include "ivas_lib_rend_internal.h" + enum + { + BS_READ, + BS_WRITE + }; + enum + { + BS_ERROR_NONE, + BS_ERROR_FAIL + }; + + typedef struct BITSTREAM + { + int32_t iMaxBuffer; + int32_t iDirection; + int32_t iBufferEnd; + int32_t iBufferStart; + int32_t iIndex; + int32_t iError; + uint8_t *puchBuffer; + } Bitstream; + + Bitstream *CreateBitstream( const int32_t iDirection, const int32_t iMaxBuffer ); + + void DeleteBitstream( Bitstream *psBitstream ); + + void BSFlushBuffer( Bitstream *psBitstream ); + + int32_t BSPutBytes( Bitstream *psBitstream, const uint8_t *puchBytes, const int32_t iByteCount ); + + int32_t BSGetBytes( Bitstream *psBitstream, uint8_t *puchBytes, int32_t iByteCount ); + + int32_t BSByteAlign( Bitstream *psBitstream ); + + int32_t BSPutBits( Bitstream *psBitstream, int32_t iValue, int32_t iBitCount ); + + int32_t BSGetBits( Bitstream *psBitstream, int32_t iBitCount ); + + int32_t BSForceBack( + ivas_split_rend_bits_t *pBits, + int32_t iValue, + int32_t iBitCount ); + + uint8_t *BSGetBuffer( Bitstream *psBitstream ); + + int32_t BSGetByteCount( Bitstream *psBitstream ); + + int32_t BSGetAvailableBytes( Bitstream *psBitstream ); + int32_t BSGetError( Bitstream *psBitstream ); + +#ifdef __cplusplus +} +#endif + +#endif /* _BITSTREAM_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c deleted file mode 100644 index 370aa0dbd1..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.c +++ /dev/null @@ -1,912 +0,0 @@ -#include "CQMFDecoder.h" - -#include -#include -#include -#include -#include "Tables.h" -#include "wmops.h" -#include "PerceptualModel.h" -#include "RMSEnvDeltaHuff.h" -#include "CQMFHuff.h" -#include "NoiseGen.h" -#include "cldfb_codec_bitstream.h" - -typedef struct CQMF_DECODER{ - int iSampleRate; - int iChannels; - int iNumBlocks; - - int iNumBands; - const int *piBandwidths; - - int iMSMode; - int *piMSFlags; - - int iCommonGrouping; - int *piNumGroups; - int **ppiGroupLengths; - - int ***pppiRMSEnvelope; - int ***pppiSMR; - int ***pppiExcitation; - int ***pppiAlloc; - - int iAllocOffset; - - int ***pppiCQMFSignReal; - int ***pppiCQMFSignImag; - int ***pppiQCQMFReal; - int ***pppiQCQMFImag; - - Bitstream *psBSRead; - - NoiseGen *psNoiseGen; - - int iLastError; -}CQMFDecoder; - -CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, - const int iChannels) -{ - int n; - CQMFDecoder *psCQMFDecoder = NULL; - - assert(iSampleRate == 48000); //Fix - - psCQMFDecoder = (CQMFDecoder*)malloc(sizeof(CQMFDecoder)); - psCQMFDecoder->iSampleRate = iSampleRate; - psCQMFDecoder->iChannels = iChannels; - psCQMFDecoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; - psCQMFDecoder->iAllocOffset = 0; - - psCQMFDecoder->iNumBands = MAX_BANDS_48; //Fix - psCQMFDecoder->piBandwidths = c_aiBandwidths48; //Fix - - psCQMFDecoder->iMSMode = 0; - psCQMFDecoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFDecoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo - psCQMFDecoder->piNumGroups = (int*)malloc(psCQMFDecoder->iChannels * sizeof(int)); - psCQMFDecoder->ppiGroupLengths = (int**)malloc(psCQMFDecoder->iChannels * sizeof(int*)); - psCQMFDecoder->pppiRMSEnvelope = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiSMR = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiExcitation = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiAlloc = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - - psCQMFDecoder->pppiCQMFSignReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiCQMFSignImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiQCQMFReal = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - psCQMFDecoder->pppiQCQMFImag = (int***)malloc(psCQMFDecoder->iChannels * sizeof(int**)); - for(n = 0; n < iChannels ; n ++){ - int k; - psCQMFDecoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); - psCQMFDecoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - - psCQMFDecoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFDecoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - psCQMFDecoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFDecoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFDecoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFDecoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - } - } - - psCQMFDecoder->psBSRead = CreateBitstream(BS_READ,4096); - - psCQMFDecoder->psNoiseGen = NULL;//CreateNoiseGen(); // No noise fill for now - - psCQMFDecoder->iLastError = DECODER_ERROR_NONE; - - return psCQMFDecoder; -} - -void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder) -{ - if(psCQMFDecoder != NULL){ - - if(psCQMFDecoder->piMSFlags != NULL){ - free(psCQMFDecoder->piMSFlags); - } - - if(psCQMFDecoder->piNumGroups != NULL){ - free(psCQMFDecoder->piNumGroups); - } - - if(psCQMFDecoder->ppiGroupLengths != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - free(psCQMFDecoder->ppiGroupLengths[n]); - } - free(psCQMFDecoder->ppiGroupLengths); - } - - if(psCQMFDecoder->pppiRMSEnvelope != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiRMSEnvelope[n][k]); - } - free(psCQMFDecoder->pppiRMSEnvelope[n]); - } - free(psCQMFDecoder->pppiRMSEnvelope); - } - - if(psCQMFDecoder->pppiSMR != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiSMR[n][k]); - } - free(psCQMFDecoder->pppiSMR[n]); - } - free(psCQMFDecoder->pppiSMR); - } - - if(psCQMFDecoder->pppiExcitation != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiExcitation[n][k]); - } - free(psCQMFDecoder->pppiExcitation[n]); - } - free(psCQMFDecoder->pppiExcitation); - } - - if(psCQMFDecoder->pppiAlloc != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiAlloc[n][k]); - } - free(psCQMFDecoder->pppiAlloc[n]); - } - free(psCQMFDecoder->pppiAlloc); - } - - if(psCQMFDecoder->pppiCQMFSignReal != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiCQMFSignReal[n][k]); - } - free(psCQMFDecoder->pppiCQMFSignReal[n]); - } - free(psCQMFDecoder->pppiCQMFSignReal); - } - - if(psCQMFDecoder->pppiCQMFSignImag != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiCQMFSignImag[n][k]); - } - free(psCQMFDecoder->pppiCQMFSignImag[n]); - } - free(psCQMFDecoder->pppiCQMFSignImag); - } - - if(psCQMFDecoder->pppiQCQMFReal != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiQCQMFReal[n][k]); - } - free(psCQMFDecoder->pppiQCQMFReal[n]); - } - free(psCQMFDecoder->pppiQCQMFReal); - } - - if(psCQMFDecoder->pppiQCQMFImag != NULL){ - int n; - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFDecoder->pppiQCQMFImag[n][k]); - } - free(psCQMFDecoder->pppiQCQMFImag[n]); - } - free(psCQMFDecoder->pppiQCQMFImag); - } - - if(psCQMFDecoder->psBSRead != NULL){ - DeleteBitstream(psCQMFDecoder->psBSRead); - } - - if(psCQMFDecoder->psNoiseGen != NULL){ - DeleteNoiseGen(psCQMFDecoder->psNoiseGen); - } - - free(psCQMFDecoder); - } -} - -int CQMFDecoderGetError(CQMFDecoder *psCQMFDecoder) -{ - return psCQMFDecoder->iLastError; -} - -static void ApplyRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag); - -static void ReplaceSign(const int iNumBlocks, - const int iNumCQMFBands, - const int **ppiSignReal, - const int **ppiSignImag, - float **ppfReal, - float **ppfImag); - -static void InvQuantizeSpectrum(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag, - float **ppfReal, - float **ppfImag, - NoiseGen *psNoiseGen); //Nullable - -static void InvMSCoding(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - const int iMSMode, - const int *piMSFlags, - float ***pppfReal, - float ***pppfImag); - -/* Currently only the number of bands in frame */ -static int ReadHeaderInformation(int *piNumBands, - Bitstream *psBSRead); - -static int ReadMSInformation(const int iNumBands, - int *piMSMode, - int *piMSFlags, - Bitstream *psBSRead); - -static int ReadGroupInformation(const int iChannels, - int *piCommonGrouping, - int *piNumGroups, - int **ppiGroupLengths, - Bitstream *psBSRead); - -static int ReadHuff(const unsigned int (*pauiHuffDecTable)[HUFF_DEC_TABLE_SIZE], - int *piSymbol, - Bitstream *psBSRead); - -static int ReadRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - int ***pppiRMSEnvelope, - Bitstream *psBSRead); - -static int ReadAllocInformation(int *piAllocOffset, - Bitstream *psBSRead); - -static int ReadCQMFData( const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - int **ppiSignReal, - int **ppiSignImag, - int **ppiQReal, - int **ppiQImag, - Bitstream *psBSRead); - -static void ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc); - -int DecodeFrame(CQMFDecoder *psCQMFDecoder, - const int iNumBytes, - const unsigned char *puchData, - float ***pppfCQMFReal, - float ***pppfCQMFImag) -{ - int n; - int iBitsRead; - - iBitsRead = 0; - - BSFlushBuffer(psCQMFDecoder->psBSRead); - BSPutBytes(psCQMFDecoder->psBSRead,puchData,iNumBytes); - - iBitsRead += ReadHeaderInformation(&psCQMFDecoder->iNumBands, - psCQMFDecoder->psBSRead); - - if(psCQMFDecoder->iChannels == 2){ - iBitsRead += ReadMSInformation(psCQMFDecoder->iNumBands, - &psCQMFDecoder->iMSMode, - psCQMFDecoder->piMSFlags, - psCQMFDecoder->psBSRead); - } - - iBitsRead += ReadGroupInformation(psCQMFDecoder->iChannels, - &psCQMFDecoder->iCommonGrouping, - psCQMFDecoder->piNumGroups, - psCQMFDecoder->ppiGroupLengths, - psCQMFDecoder->psBSRead); - - iBitsRead += ReadRMSEnvelope(psCQMFDecoder->iChannels, - (const int*)psCQMFDecoder->piNumGroups, - psCQMFDecoder->iNumBands, - psCQMFDecoder->pppiRMSEnvelope, - psCQMFDecoder->psBSRead); - - iBitsRead += ReadAllocInformation(&psCQMFDecoder->iAllocOffset, - psCQMFDecoder->psBSRead); - - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ // This will be updated to support multiple sample rates - int k; - for(k = 0; k < psCQMFDecoder->piNumGroups[n]; k ++){ - PerceptualModel(psCQMFDecoder->iNumBands, - psCQMFDecoder->pppiRMSEnvelope[n][k], - psCQMFDecoder->pppiExcitation[n][k], - psCQMFDecoder->pppiSMR[n][k]); - - } - } - - ComputeAllocation(psCQMFDecoder->iChannels, - (const int*)psCQMFDecoder->piNumGroups, - psCQMFDecoder->iNumBands, - (const int***)psCQMFDecoder->pppiSMR, - psCQMFDecoder->iAllocOffset, - psCQMFDecoder->pppiAlloc); - - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - iBitsRead += ReadCQMFData(psCQMFDecoder->piNumGroups[n], - (const int*)psCQMFDecoder->ppiGroupLengths[n], - psCQMFDecoder->iNumBands, - psCQMFDecoder->piBandwidths, - (const int**)psCQMFDecoder->pppiAlloc[n], - psCQMFDecoder->pppiCQMFSignReal[n], - psCQMFDecoder->pppiCQMFSignImag[n], - psCQMFDecoder->pppiQCQMFReal[n], - psCQMFDecoder->pppiQCQMFImag[n], - psCQMFDecoder->psBSRead); - } - - for(n = 0; n < psCQMFDecoder->iChannels; n ++){ - InvQuantizeSpectrum(psCQMFDecoder->piNumGroups[n], - (const int*)psCQMFDecoder->ppiGroupLengths[n], - psCQMFDecoder->iNumBands, - psCQMFDecoder->piBandwidths, - (const int**)psCQMFDecoder->pppiAlloc[n], - (const int**)psCQMFDecoder->pppiQCQMFReal[n], - (const int**)psCQMFDecoder->pppiQCQMFImag[n], - pppfCQMFReal[n], - pppfCQMFImag[n], - psCQMFDecoder->psNoiseGen); - - ReplaceSign(psCQMFDecoder->iNumBlocks, - CQMF_BANDS, - (const int**)psCQMFDecoder->pppiCQMFSignReal[n], - (const int**)psCQMFDecoder->pppiCQMFSignImag[n], - pppfCQMFReal[n], - pppfCQMFImag[n]); - - - ApplyRMSEnvelope(psCQMFDecoder->iNumBands, - psCQMFDecoder->piBandwidths, - psCQMFDecoder->piNumGroups[n], - (const int*)psCQMFDecoder->ppiGroupLengths[n], - (const int **)psCQMFDecoder->pppiRMSEnvelope[n], - pppfCQMFReal[n], - pppfCQMFImag[n]); - } - - if(psCQMFDecoder->iChannels == 2 && psCQMFDecoder->iMSMode > 0){ - InvMSCoding(psCQMFDecoder->iNumBlocks, - psCQMFDecoder->iNumBands, - psCQMFDecoder->piBandwidths, - psCQMFDecoder->iMSMode, - (const int*)psCQMFDecoder->piMSFlags, - pppfCQMFReal, - pppfCQMFImag); - } - - //printf("Bits Read %d\n",iBitsRead); - - return psCQMFDecoder->iLastError; -} - -static void ApplyRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag) -{ - int n; - int iBlockOffset; - - iBlockOffset = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iRMSEnv; - float fGain; - - iRMSEnv = ppiRMSEnvelope[n][b]; - fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER + iRMSEnv]; - for(m = 0; m < piBandwidths[b]; m ++){ - ppfReal[iBlockOffset][iFBOffset] *= fGain; - ppfImag[iBlockOffset][iFBOffset] *= fGain; - iFBOffset ++; - } - } - iBlockOffset ++; - } - } -} - -static void ReplaceSign(const int iNumBlocks, - const int iNumCQMFBands, - const int **ppiSignReal, - const int **ppiSignImag, - float **ppfReal, - float **ppfImag) -{ - int n; - for(n = 0; n < iNumBlocks; n ++){ - int b; - for(b = 0; b < iNumCQMFBands; b ++){ - if(ppiSignReal[n][b] == 1){ - ppfReal[n][b] = -ppfReal[n][b]; - } - if(ppiSignImag[n][b] == 1){ - ppfImag[n][b] = -ppfImag[n][b]; - } - } - } -} - -static void InvQuantizeSpectrum(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag, - float **ppfReal, - float **ppfImag, - NoiseGen *psNoiseGen) // Pass in NULL to swicth off noise gen -{ - int n; - int iBlockOffest; - - iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - float fInvSCFGain; - - iAlloc = ppiAlloc[n][b]; - fInvSCFGain = c_afInvScaleFactor[iAlloc]; - - if(iAlloc > 0){ - for(m = 0; m < piBandwidths[b]; m ++){ - int iQuantValue; - - iQuantValue = ppiQReal[iBlockOffest][iFBOffset]; - ppfReal[iBlockOffest][iFBOffset] = (float)iQuantValue * fInvSCFGain; - - iQuantValue = ppiQImag[iBlockOffest][iFBOffset]; - ppfImag[iBlockOffest][iFBOffset] = (float)iQuantValue * fInvSCFGain; - - iFBOffset ++; - } - } - else if(psNoiseGen != NULL){ - for(m = 0; m < piBandwidths[b]; m ++){ - ppfReal[iBlockOffest][iFBOffset] = 0.7f * GetNoise(psNoiseGen); - ppfImag[iBlockOffest][iFBOffset] = 0.7f * GetNoise(psNoiseGen); - - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - - } - - iBlockOffest ++; - } - } -} - -static void InvMSCoding(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - const int iMSMode, - const int *piMSFlags, - float ***pppfReal, - float ***pppfImag) -{ - if(iMSMode > 0){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - if(piMSFlags[b] == 1){ - int n; - for(n = 0; n < piBandwidths[b]; n ++){ - int k; - for(k = 0; k < iNumBlocks; k ++){ - float fLeftReal; - float fLeftImag; - float fRightReal; - float fRightImag; - - fLeftReal = (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); - fLeftImag = (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); - fRightReal = (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); - fRightImag = (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); - - pppfReal[0][k][iFBOffset] = fLeftReal; - pppfReal[1][k][iFBOffset] = fRightReal; - pppfImag[0][k][iFBOffset] = fLeftImag; - pppfImag[1][k][iFBOffset] = fRightImag; - } - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - } - } -} - -/* Currently only the number of bands in frame */ -static int ReadHeaderInformation(int *piNumBands, - Bitstream *psBSRead) -{ - int iBitsRead; - - iBitsRead = 0; - *piNumBands = BSGetBits(psBSRead, 5); - iBitsRead += 5; - - return iBitsRead; -} - -static int ReadMSInformation(const int iNumBands, - int *piMSMode, - int *piMSFlags, - Bitstream *psBSRead) -{ - int iBitsRead; - - iBitsRead = 0; - *piMSMode = BSGetBits(psBSRead,2); - iBitsRead += 2; - - if(*piMSMode == 0){ - int n; - for(n = 0; n > 16); - } - - if(iVal){ - BSForceBack(psBSRead,iIndex,iVal); - iBitsRead -= iVal; - } - - *piSymbol = iSymbol; - - return iBitsRead; -} - -static int ReadRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - int ***pppiRMSEnvelope, - Bitstream *psBSRead) -{ - int n; - int iBitsRead; - - iBitsRead = 0; - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < piNumGroups[n]; k ++){ - int b; - int iLastRMSVal; - - iLastRMSVal = BSGetBits(psBSRead,ENV0_BITS); - iBitsRead += ENV0_BITS; - - iLastRMSVal += ENV_MIN; - pppiRMSEnvelope[n][k][0] = iLastRMSVal; - for(b = 1; b < iNumBands; b ++){ - int iDelta; - - iBitsRead += ReadHuff(c_aaiRMSEnvHuffDec,&iDelta,psBSRead); - - iDelta += ENV_DELTA_MIN; - iLastRMSVal += iDelta; - pppiRMSEnvelope[n][k][b] = iLastRMSVal; - } - } - } - - return iBitsRead; -} - -static int ReadAllocInformation(int *piAllocOffset, - Bitstream *psBSRead) -{ - int iBitsRead; - - iBitsRead = 0; - - *piAllocOffset = BSGetBits(psBSRead,ALLOC_OFFSET_BITS); - *piAllocOffset += MIN_ALLOC_OFFSET; - iBitsRead += ALLOC_OFFSET_BITS; - - return iBitsRead; -} - -static int ReadCQMFData(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - int **ppiSignReal, - int **ppiSignImag, - int **ppiQReal, - int **ppiQImag, - Bitstream *psBSRead) -{ - int n; - int iBitsRead; - int iBlockOffest; - - iBitsRead = 0; - iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iHuffDim; - int iHuffMod; - - iAlloc = ppiAlloc[n][b]; - - iHuffDim = c_aiHuffmanDim[iAlloc]; - iHuffMod = c_aiHuffmanMod[iAlloc]; - - - if(iAlloc > 0){ - const unsigned int (*pauiHuffmanTable)[HUFF_DEC_TABLE_SIZE] = NULL; //const? - - pauiHuffmanTable = GetHuffDecTable(iAlloc); - for(m = 0; m < piBandwidths[b]; m ++){ - int iQuantValue1 = 0; - int iQuantValue2 = 0; - - if(iHuffDim == 2){ - int iSymbol; - - iBitsRead += ReadHuff(pauiHuffmanTable,&iSymbol,psBSRead); - iQuantValue1 = iSymbol / iHuffMod; - iQuantValue2 = iSymbol % iHuffMod; - } - else{ - iBitsRead += ReadHuff(pauiHuffmanTable,&iQuantValue1,psBSRead); - iBitsRead += ReadHuff(pauiHuffmanTable,&iQuantValue2,psBSRead); - } - - ppiQReal[iBlockOffest][iFBOffset] = iQuantValue1; - ppiQImag[iBlockOffest][iFBOffset] = iQuantValue2; - - if(iQuantValue1 > 0){ - ppiSignReal[iBlockOffest][iFBOffset] = BSGetBits(psBSRead,1); - iBitsRead += 1; - } - if(iQuantValue2 > 0){ - ppiSignImag[iBlockOffest][iFBOffset] = BSGetBits(psBSRead,1); - iBitsRead += 1; - } - - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - - } - - iBlockOffest ++; - } - } - - return iBitsRead; -} - -static void ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc) -{ - int n; - - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < piNumGroups[n]; k ++){ - int b; - for(b = 0; b < iNumBands; b ++){ - int iAlloc; - iAlloc = ((pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE) >> 5); - iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; - iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; - pppiAlloc[n][k][b] = iAlloc; - } - } - } -} diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h b/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h deleted file mode 100644 index e865343cd9..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFDecoder.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _CQMF_DECODER_H_ -#define _CQMF_DECODER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define DECODER_ERROR_NONE (0) -#define DECODER_ERROR_FS_NOT_SUPPORTED (-1) -#define DECODER_ERROR_CHAN_NOT_SUPPORTED (-2) -#define DECODER_ERROR_UNKNOWN (-100) - -typedef struct CQMF_DECODER CQMFDecoder; - -CQMFDecoder* CreateCQMFDecoder(const int iSampleRate, - const int iChannels); - -void DeleteCQMFDecoder(CQMFDecoder *psCQMFDecoder); - -int CQMFDecoderGetError(CQMFDecoder *psCQMFDecoder); - -int DecodeFrame(CQMFDecoder *psCQMFDecoder, - const int iNumBytes, - const unsigned char *puchData, - float ***pppfCQMFReal, - float ***pppfCQMFImag); - -#ifdef __cplusplus -} -#endif - -#endif /* _CQMF_DECODER_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c deleted file mode 100644 index 6795f9327c..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.c +++ /dev/null @@ -1,1226 +0,0 @@ -#include "CQMFEncoder.h" - -#include -#include -#include -#include -#include "Tables.h" -#include "wmops.h" -#include "RMSEnvGrouping.h" -#include "PerceptualModel.h" -#include "RMSEnvDeltaHuff.h" -#include "CQMFHuff.h" -#include "cldfb_codec_bitstream.h" - -typedef struct CQMF_ENCODER{ - int iSampleRate; - int iChannels; - int iNumBlocks; - - int iTargetBitRate; - int iTargetBitsPerFrame; - - int iNumBands; - const int *piBandwidths; - - int iMSMode; - int *piMSFlags; - - RMSEnvelopeGrouping *psRMSEnvelopeGrouping; - - int iCommonGrouping; - int *piNumGroups; - int **ppiGroupLengths; - - int ***pppiRMSEnvelope; - int ***pppiSMR; - int ***pppiExcitation; - int ***pppiAlloc; - - int iAllocOffset; - - int ***pppiCQMFSignReal; - int ***pppiCQMFSignImag; - int ***pppiQCQMFReal; - int ***pppiQCQMFImag; - - Bitstream *psBSWrite; - - int iLastError; -}CQMFEncoder; - -CQMFEncoder* CreateCQMFEncoder(const int iSampleRate, - const int iChannels, - const int iTargetBitRate) -{ - int n; - CQMFEncoder *psCQMFEncoder = NULL; - - assert(iSampleRate == 48000); //Fix - - psCQMFEncoder = (CQMFEncoder*)malloc(sizeof(CQMFEncoder)); - psCQMFEncoder->iSampleRate = iSampleRate; - psCQMFEncoder->iChannels = iChannels; - psCQMFEncoder->iNumBlocks = CQMF_BLOCKS_PER_FRAME; - psCQMFEncoder->iAllocOffset = 0; - - psCQMFEncoder->iTargetBitRate = iTargetBitRate; - psCQMFEncoder->iTargetBitsPerFrame = iTargetBitRate * CQMF_BLOCKS_PER_FRAME * CQMF_BANDS / iSampleRate; - - psCQMFEncoder->iNumBands = MAX_BANDS_48 - 1; //Fix - psCQMFEncoder->piBandwidths = c_aiBandwidths48; //Fix - - psCQMFEncoder->iMSMode = 0; - psCQMFEncoder->piMSFlags = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFEncoder->psRMSEnvelopeGrouping = CreateRMSEnvelopeGrouping(psCQMFEncoder->iNumBlocks); - - psCQMFEncoder->iCommonGrouping = 1; // Common grouping always on only impacts stereo - psCQMFEncoder->piNumGroups = (int*)malloc(psCQMFEncoder->iChannels * sizeof(int)); - psCQMFEncoder->ppiGroupLengths = (int**)malloc(psCQMFEncoder->iChannels * sizeof(int*)); - psCQMFEncoder->pppiRMSEnvelope = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiSMR = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiExcitation = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiAlloc = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - - psCQMFEncoder->pppiCQMFSignReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiCQMFSignImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiQCQMFReal = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - psCQMFEncoder->pppiQCQMFImag = (int***)malloc(psCQMFEncoder->iChannels * sizeof(int**)); - for(n = 0; n < iChannels ; n ++){ - int k; - psCQMFEncoder->ppiGroupLengths[n] = (int*)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int)); - psCQMFEncoder->pppiRMSEnvelope[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiSMR[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiExcitation[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiAlloc[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - - psCQMFEncoder->pppiCQMFSignReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiCQMFSignImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiQCQMFReal[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - psCQMFEncoder->pppiQCQMFImag[n] = (int**)malloc(CQMF_BLOCKS_PER_FRAME * sizeof(int*)); - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - psCQMFEncoder->pppiRMSEnvelope[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiSMR[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiExcitation[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - psCQMFEncoder->pppiAlloc[n][k] = (int*)malloc(MAX_BANDS * sizeof(int)); - - psCQMFEncoder->pppiCQMFSignReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiCQMFSignImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiQCQMFReal[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - psCQMFEncoder->pppiQCQMFImag[n][k] = (int*)malloc(CQMF_BANDS * sizeof(int)); - } - } - - psCQMFEncoder->psBSWrite = CreateBitstream(BS_WRITE,4096); - - psCQMFEncoder->iLastError = ENCODER_ERROR_NONE; - - return psCQMFEncoder; -} - -void DeleteCQMFEncoder(CQMFEncoder *psCQMFEncoder) -{ - if(psCQMFEncoder != NULL){ - - if(psCQMFEncoder->piMSFlags != NULL){ - free(psCQMFEncoder->piMSFlags); - } - - if(psCQMFEncoder->piNumGroups != NULL){ - free(psCQMFEncoder->piNumGroups); - } - - if(psCQMFEncoder->psRMSEnvelopeGrouping != NULL){ - DeleteRMSEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping); - } - - if(psCQMFEncoder->ppiGroupLengths != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - free(psCQMFEncoder->ppiGroupLengths[n]); - } - free(psCQMFEncoder->ppiGroupLengths); - } - - if(psCQMFEncoder->pppiRMSEnvelope != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiRMSEnvelope[n][k]); - } - free(psCQMFEncoder->pppiRMSEnvelope[n]); - } - free(psCQMFEncoder->pppiRMSEnvelope); - } - - if(psCQMFEncoder->pppiSMR != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiSMR[n][k]); - } - free(psCQMFEncoder->pppiSMR[n]); - } - free(psCQMFEncoder->pppiSMR); - } - - if(psCQMFEncoder->pppiExcitation != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiExcitation[n][k]); - } - free(psCQMFEncoder->pppiExcitation[n]); - } - free(psCQMFEncoder->pppiExcitation); - } - - if(psCQMFEncoder->pppiAlloc != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiAlloc[n][k]); - } - free(psCQMFEncoder->pppiAlloc[n]); - } - free(psCQMFEncoder->pppiAlloc); - } - - if(psCQMFEncoder->pppiCQMFSignReal != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiCQMFSignReal[n][k]); - } - free(psCQMFEncoder->pppiCQMFSignReal[n]); - } - free(psCQMFEncoder->pppiCQMFSignReal); - } - - if(psCQMFEncoder->pppiCQMFSignImag != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiCQMFSignImag[n][k]); - } - free(psCQMFEncoder->pppiCQMFSignImag[n]); - } - free(psCQMFEncoder->pppiCQMFSignImag); - } - - if(psCQMFEncoder->pppiQCQMFReal != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiQCQMFReal[n][k]); - } - free(psCQMFEncoder->pppiQCQMFReal[n]); - } - free(psCQMFEncoder->pppiQCQMFReal); - } - - if(psCQMFEncoder->pppiQCQMFImag != NULL){ - int n; - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - int k; - for(k = 0; k < CQMF_BLOCKS_PER_FRAME; k ++){ - free(psCQMFEncoder->pppiQCQMFImag[n][k]); - } - free(psCQMFEncoder->pppiQCQMFImag[n]); - } - free(psCQMFEncoder->pppiQCQMFImag); - } - - DeleteBitstream(psCQMFEncoder->psBSWrite); - - free(psCQMFEncoder); - } -} - -int CQMFEncoderGetError(CQMFEncoder *psCQMFEncoder) -{ - return psCQMFEncoder->iLastError; -} - -static void MSModeCalculation(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - float ***pppfReal, - float ***pppfImag, - int *piMSMode, - int *piMSFlags); - -static void RemoveRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag); - -static void RemoveSign(const int iNumBlocks, - const int iNumCQMFBands, - float **ppfReal, - float **ppfImag, - int **ppiSignReal, - int **ppiSignImag); - -static int CountCQMFBits(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag); - -/* Currently only the number of bands in frame */ -static int WriteHeaderInformation(const int iNumBands, - Bitstream *psBSWrite); - -static int WriteMSInformation(const int iNumBands, - const int iMSMode, - const int *piMSFlags, - Bitstream *psBSWrite); - -static int WriteGroupInformation(const int iChannels, - const int iCommonGrouping, - const int *piNumGroups, - const int **ppiGroupLengths, - Bitstream *psBSWrite); - -static int WriteRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiRMSEnvelope, - Bitstream *psBSWrite); - -static int WriteAllocInformation(const int iAllocOffset, - Bitstream *psBSWrite); - -static int WriteCQMFData(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiSignReal, - const int **ppiSignImag, - const int **ppiQReal, - const int **ppiQImag, - Bitstream *psBSWrite); - -static int ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAvailableBits, - int *piAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag); - -static int ComputeAllocationByPass(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag); - - - -int EncodeFrame(CQMFEncoder *psCQMFEncoder, - float ***pppfCQMFReal, - float ***pppfCQMFImag, - int *piNumiBytes, - unsigned char *puchData) -{ - int n; - int iAvailableBits; - int iBitsWritten; - int iCQMFBits; - - iAvailableBits = psCQMFEncoder->iTargetBitsPerFrame; // HCBR for now - iBitsWritten = 0; - - - /* Do MS calc here */ - if(psCQMFEncoder->iChannels == 2){ - MSModeCalculation(psCQMFEncoder->iNumBlocks, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - pppfCQMFReal, - pppfCQMFImag, - &psCQMFEncoder->iMSMode, - psCQMFEncoder->piMSFlags); - - if(psCQMFEncoder->iMSMode > 0){ - psCQMFEncoder->iCommonGrouping = 1; // Make sure common grouping is enabled when MS is in use - } - } - - - /* Compute Grouping and RMS Envelopes */ - if(psCQMFEncoder->iChannels == 2 && psCQMFEncoder->iCommonGrouping == 1){ - ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, - psCQMFEncoder->iChannels, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)pppfCQMFReal, - (const float***)pppfCQMFImag, - 8.0, - 20.0, // Use these to trade off RMS Env bits and quantizer loading - &psCQMFEncoder->piNumGroups[0], - psCQMFEncoder->ppiGroupLengths[0], - psCQMFEncoder->pppiRMSEnvelope); - - psCQMFEncoder->piNumGroups[1] = psCQMFEncoder->piNumGroups[0]; - for(n = 0; n < psCQMFEncoder->piNumGroups[0]; n ++){ - psCQMFEncoder->ppiGroupLengths[1][n] = psCQMFEncoder->ppiGroupLengths[0][n]; - } - } - else{ - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - ComputeEnvelopeGrouping(psCQMFEncoder->psRMSEnvelopeGrouping, - psCQMFEncoder->iChannels, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)&pppfCQMFReal[n], - (const float***)&pppfCQMFImag[n], - 8.0, - 20.0, // Use these to trade off RMS Env bits and quantizer loading - &psCQMFEncoder->piNumGroups[n], - psCQMFEncoder->ppiGroupLengths[n], - &psCQMFEncoder->pppiRMSEnvelope[n]); - } - } - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - RemoveSign(psCQMFEncoder->iNumBlocks, - CQMF_BANDS, - pppfCQMFReal[n], - pppfCQMFImag[n], - psCQMFEncoder->pppiCQMFSignReal[n], - psCQMFEncoder->pppiCQMFSignImag[n]); - - RemoveRMSEnvelope(psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - psCQMFEncoder->piNumGroups[n], - (const int*)psCQMFEncoder->ppiGroupLengths[n], - (const int **)psCQMFEncoder->pppiRMSEnvelope[n], - pppfCQMFReal[n], - pppfCQMFImag[n]); - } - - BSFlushBuffer(psCQMFEncoder->psBSWrite); - iBitsWritten += WriteHeaderInformation(psCQMFEncoder->iNumBands, - psCQMFEncoder->psBSWrite); - - if(psCQMFEncoder->iChannels == 2){ - iBitsWritten += WriteMSInformation(psCQMFEncoder->iNumBands, - psCQMFEncoder->iMSMode, - (const int*)psCQMFEncoder->piMSFlags, - psCQMFEncoder->psBSWrite); - } - - iBitsWritten += WriteGroupInformation(psCQMFEncoder->iChannels, - psCQMFEncoder->iCommonGrouping, - (const int*)psCQMFEncoder->piNumGroups, - (const int**)psCQMFEncoder->ppiGroupLengths, - psCQMFEncoder->psBSWrite); - - iBitsWritten += WriteRMSEnvelope(psCQMFEncoder->iChannels, - (const int*)psCQMFEncoder->piNumGroups, - psCQMFEncoder->iNumBands, - (const int***)psCQMFEncoder->pppiRMSEnvelope, - psCQMFEncoder->psBSWrite); - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ // This will be updated to support multiple sample rates - int k; - for(k = 0; k < psCQMFEncoder->piNumGroups[n]; k ++){ - PerceptualModel(psCQMFEncoder->iNumBands, - psCQMFEncoder->pppiRMSEnvelope[n][k], - psCQMFEncoder->pppiExcitation[n][k], - psCQMFEncoder->pppiSMR[n][k]); - - } - } - - iAvailableBits -= iBitsWritten; - iCQMFBits = ComputeAllocation(psCQMFEncoder->iChannels, - (const int*)psCQMFEncoder->piNumGroups, - (const int**)psCQMFEncoder->ppiGroupLengths, - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const float***)pppfCQMFReal, - (const float***)pppfCQMFImag, - (const int***)psCQMFEncoder->pppiSMR, - iAvailableBits, - &psCQMFEncoder->iAllocOffset, - psCQMFEncoder->pppiAlloc, - psCQMFEncoder->pppiQCQMFReal, - psCQMFEncoder->pppiQCQMFImag); - - iBitsWritten += WriteAllocInformation(psCQMFEncoder->iAllocOffset,psCQMFEncoder->psBSWrite); - - for(n = 0; n < psCQMFEncoder->iChannels; n ++){ - iBitsWritten += WriteCQMFData(psCQMFEncoder->piNumGroups[n], - (const int*)psCQMFEncoder->ppiGroupLengths[n], - psCQMFEncoder->iNumBands, - psCQMFEncoder->piBandwidths, - (const int**)psCQMFEncoder->pppiAlloc[n], - (const int**)psCQMFEncoder->pppiCQMFSignReal[n], - (const int**)psCQMFEncoder->pppiCQMFSignImag[n], - (const int**)psCQMFEncoder->pppiQCQMFReal[n], - (const int**)psCQMFEncoder->pppiQCQMFImag[n], - psCQMFEncoder->psBSWrite); - } - - BSByteAlign(psCQMFEncoder->psBSWrite); - *piNumiBytes = BSGetByteCount(psCQMFEncoder->psBSWrite); - BSGetBytes(psCQMFEncoder->psBSWrite,puchData,*piNumiBytes); - - //printf("Bits Written %d\n",iBitsWritten); - - return psCQMFEncoder->iLastError; -} - -static void MSModeCalculation(const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - float ***pppfReal, - float ***pppfImag, - int *piMSMode, - int *piMSFlags) -{ - int b; - int iFBOffset; - int iNumMSBands; - - *piMSMode = 0; - iFBOffset = 0; - iNumMSBands = 0; - for(b = 0; b < iNumBands; b ++){ - int n; - float fLeftEnergy; - float fRightEnergy; - float fMidEnergy; - float fSideEnergy; - float fLRRatio; - float fMSRatio; - - fLeftEnergy = 0.0; - fRightEnergy = 0.0; - fMidEnergy = 0.0; - fSideEnergy = 0.0; - - for(n = 0; n < piBandwidths[b]; n ++){ - int k; - for(k = 0; k < iNumBlocks; k ++){ - float fMidReal; - float fMidImag; - float fSideReal; - float fSideImag; - - fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); - fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); - fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); - fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); - - fLeftEnergy += (pppfReal[0][k][iFBOffset] * pppfReal[0][k][iFBOffset] + pppfImag[0][k][iFBOffset] * pppfImag[0][k][iFBOffset]); - fRightEnergy += (pppfReal[1][k][iFBOffset] * pppfReal[1][k][iFBOffset] + pppfImag[1][k][iFBOffset] * pppfImag[1][k][iFBOffset]); - fMidEnergy += (fMidReal * fMidReal + fMidImag * fMidImag); - fSideEnergy += (fSideReal * fSideReal + fSideImag * fSideImag); - } - - iFBOffset ++; - } - - fLeftEnergy = log10f(fLeftEnergy + 1e-12f); - fRightEnergy = log10f(fRightEnergy + 1e-12f); - fMidEnergy = log10f(fMidEnergy + 1e-12f); - fSideEnergy = log10f(fSideEnergy + 1e-12f); - - if(fLeftEnergy > fRightEnergy){ - fLRRatio = fLeftEnergy - fRightEnergy; - } - else{ - fLRRatio = fRightEnergy - fLeftEnergy; - } - - if(fMidEnergy > fSideEnergy){ - fMSRatio = fMidEnergy - fSideEnergy; - } - else{ - fMSRatio = fSideEnergy - fMidEnergy; - } - - if(fMSRatio > fLRRatio){ - iNumMSBands ++; - piMSFlags[b] = 1; - } - else{ - piMSFlags[b] = 0; - } - } - - if(iNumMSBands == iNumBands){ - *piMSMode = 1; - } - else if(iNumMSBands > 0){ - *piMSMode = 2; - } - else{ - *piMSMode = 0; - } - - if(*piMSMode > 0){ - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - if(piMSFlags[b] == 1){ - int n; - for(n = 0; n < piBandwidths[b]; n ++){ - int k; - for(k = 0; k < iNumBlocks; k ++){ - float fMidReal; - float fMidImag; - float fSideReal; - float fSideImag; - - fMidReal = 0.5f * (pppfReal[0][k][iFBOffset] + pppfReal[1][k][iFBOffset]); - fMidImag = 0.5f * (pppfImag[0][k][iFBOffset] + pppfImag[1][k][iFBOffset]); - fSideReal = 0.5f * (pppfReal[0][k][iFBOffset] - pppfReal[1][k][iFBOffset]); - fSideImag = 0.5f * (pppfImag[0][k][iFBOffset] - pppfImag[1][k][iFBOffset]); - - pppfReal[0][k][iFBOffset] = fMidReal; - pppfReal[1][k][iFBOffset] = fSideReal; - pppfImag[0][k][iFBOffset] = fMidImag; - pppfImag[1][k][iFBOffset] = fSideImag; - } - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - } - } -} - -static void RemoveRMSEnvelope(const int iNumBands, - const int *piBandwidths, - const int iNumGroups, - const int *piGroupLengths, - const int **ppiRMSEnvelope, - float **ppfReal, - float **ppfImag) -{ - int n; - int iBlockOffset; - - iBlockOffset = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iRMSEnv; - float fGain; - - iRMSEnv = ppiRMSEnvelope[n][b]; - fGain = c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_CENTER - iRMSEnv]; - for(m = 0; m < piBandwidths[b]; m ++){ - ppfReal[iBlockOffset][iFBOffset] *= fGain; - ppfImag[iBlockOffset][iFBOffset] *= fGain; - iFBOffset ++; - } - } - iBlockOffset ++; - } - } -} - -static void RemoveSign(const int iNumBlocks, - const int iNumCQMFBands, - float **ppfReal, - float **ppfImag, - int **ppiSignReal, - int **ppiSignImag) -{ - int n; - for(n = 0; n < iNumBlocks; n ++){ - int b; - for(b = 0; b < iNumCQMFBands; b ++){ - if(ppfReal[n][b] > 0.0){ - ppiSignReal[n][b] = 0; - } - else{ - ppfReal[n][b] = -ppfReal[n][b]; - ppiSignReal[n][b] = 1; - } - if(ppfImag[n][b] > 0.0){ - ppiSignImag[n][b] = 0; - } - else{ - ppfImag[n][b] = -ppfImag[n][b]; - ppiSignImag[n][b] = 1; - } - } - } -} - -/* Rename */ -static void QuantizeSpectrum(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const float **ppfReal, - const float **ppfImag, - int **ppiQReal, - int **ppiQImag) -{ - int n; - int iBlockOffest; - - iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iMaxQuantVal; - float fSCFGain; - - iAlloc = ppiAlloc[n][b]; - fSCFGain = c_afScaleFactor[iAlloc]; - iMaxQuantVal = c_aiQuantMaxValues[iAlloc]; - for(m = 0; m < piBandwidths[b]; m ++){ - int iQuantValue; - - iQuantValue = (int)(fSCFGain * ppfReal[iBlockOffest][iFBOffset] + 0.5); -#ifdef _DEBUG_VERBOSE - if(iQuantValue > iMaxQuantVal){ - printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); - iQuantValue = iMaxQuantVal; - } -#else - iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; -#endif - ppiQReal[iBlockOffest][iFBOffset] = iQuantValue; - - iQuantValue = (int)(fSCFGain * ppfImag[iBlockOffest][iFBOffset] + 0.5); -#ifdef _DEBUG_VERBOSE - if(iQuantValue > iMaxQuantVal){ - printf("Value out of range %d\t%d\t%d\n",iAlloc,iQuantValue,iMaxQuantVal); - iQuantValue = iMaxQuantVal; - } -#else - iQuantValue = (iQuantValue < iMaxQuantVal) ? iQuantValue : iMaxQuantVal; -#endif - ppiQImag[iBlockOffest][iFBOffset] = iQuantValue; - - iFBOffset ++; - } - - } - - iBlockOffest ++; - } - } -} - -static int CountCQMFBits(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiQReal, - const int **ppiQImag) -{ - int n; - int iBits; - int iBlockOffest; - - iBits = 0; - iBlockOffest = 0; - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iHuffDim; - int iHuffMod; - - iAlloc = ppiAlloc[n][b]; - - iHuffDim = c_aiHuffmanDim[iAlloc]; - iHuffMod = c_aiHuffmanMod[iAlloc]; - - - if(iAlloc > 0){ - const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? - - pauiHuffmanTable = GetHuffEncTable(iAlloc); - for(m = 0; m < piBandwidths[b]; m ++){ - int iQuantValue1; - int iQuantValue2; - - iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; - iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; - - iBits += (iQuantValue1 > 0) ? 1 : 0; //Sign bit for vals > 0 - iBits += (iQuantValue2 > 0) ? 1 : 0; //Sign bit for vals > 0 - if(iHuffDim == 2){ - iQuantValue1 *= iHuffMod; - iQuantValue1 += iQuantValue2; - iBits += pauiHuffmanTable[iQuantValue1][0]; - } - else{ - iBits += pauiHuffmanTable[iQuantValue1][0]; - iBits += pauiHuffmanTable[iQuantValue2][0]; - } - - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - - } - - iBlockOffest ++; - } - } - - return iBits; -} - -/* Currently only the number of bands in frame */ -static int WriteHeaderInformation(const int iNumBands, - Bitstream *psBSWrite) -{ - int iBitsWritten; - - iBitsWritten = 0; - BSPutBits(psBSWrite,iNumBands,5); - iBitsWritten += 5; - - return iBitsWritten; -} - -static int WriteMSInformation(const int iNumBands, - const int iMSMode, - const int *piMSFlags, - Bitstream *psBSWrite) -{ - int iBitsWritten; - - iBitsWritten = 0; - - BSPutBits(psBSWrite,iMSMode,2); - iBitsWritten += 2; - if(iMSMode == 2){ - int n; - for(n = 0; n < iNumBands; n ++){ - BSPutBits(psBSWrite,piMSFlags[n],1); - iBitsWritten += 1; - } - } - - return iBitsWritten; -} - -static int WriteGroupInformation(const int iChannels, - const int iCommonGrouping, - const int *piNumGroups, - const int **ppiGroupLengths, - Bitstream *psBSWrite) -{ - int iBitsWritten; - - iBitsWritten = 0; - if(iChannels == 2 && iCommonGrouping == 1){ - int k; - - BSPutBits(psBSWrite,iCommonGrouping,1); - iBitsWritten += 1; - - BSPutBits(psBSWrite,(piNumGroups[0] - 1),4); - iBitsWritten += 4; - - for(k = 0; k < piNumGroups[0]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[0][k] - 1),4); - iBitsWritten += 4; - } - } - else if(iChannels == 2){ - int n; - - BSPutBits(psBSWrite,iCommonGrouping,1); - iBitsWritten += 1; - - for(n = 0; n < iChannels; n ++){ - int k; - - BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); - iBitsWritten += 4; - - for(k = 0; k < piNumGroups[n]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); - iBitsWritten += 4; - } - } - } - else{ - int n; - - for(n = 0; n < iChannels; n ++){ - int k; - - BSPutBits(psBSWrite,(piNumGroups[n] - 1),4); - iBitsWritten += 4; - - for(k = 0; k < piNumGroups[n]; k ++){ - BSPutBits(psBSWrite,(ppiGroupLengths[n][k] - 1),4); - iBitsWritten += 4; - } - } - } - - return iBitsWritten; -} - -static int WriteRMSEnvelope(const int iChannels, - const int *piNumGroups, - const int iNumBands, - const int ***pppiRMSEnvelope, - Bitstream *psBSWrite) -{ - int n; - int iBitsWritten; - - iBitsWritten = 0; - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < piNumGroups[n]; k ++){ - int b; - int iLastRMSVal; - - iLastRMSVal = pppiRMSEnvelope[n][k][0]; - iLastRMSVal = (iLastRMSVal > ENV_MIN) ? iLastRMSVal : ENV_MIN; - iLastRMSVal = (iLastRMSVal < ENV_MAX) ? iLastRMSVal : ENV_MAX; - BSPutBits(psBSWrite,(iLastRMSVal - ENV_MIN),ENV0_BITS); - iBitsWritten += ENV0_BITS; - - for(b = 1; b < iNumBands; b ++){ - int iDelta; - - iDelta = pppiRMSEnvelope[n][k][b] - iLastRMSVal; - iDelta = (iDelta > ENV_DELTA_MIN) ? iDelta : ENV_DELTA_MIN; - iDelta = (iDelta < ENV_DELTA_MAX) ? iDelta : ENV_DELTA_MAX; - iDelta -= ENV_DELTA_MIN; - - BSPutBits(psBSWrite,c_aaiRMSEnvHuffEnc[iDelta][1],c_aaiRMSEnvHuffEnc[iDelta][0]); - iBitsWritten += c_aaiRMSEnvHuffEnc[iDelta][0]; - - iLastRMSVal = pppiRMSEnvelope[n][k][b]; - } - } - } - - return iBitsWritten; -} - -static int WriteAllocInformation(const int iAllocOffset, - Bitstream *psBSWrite) -{ - int iBitsWritten; - - iBitsWritten = 0; - - if(iAllocOffset < MIN_ALLOC_OFFSET || iAllocOffset > MAX_ALLOC_OFFSET){ - printf("Serious error\n"); - } - - BSPutBits(psBSWrite,(iAllocOffset - MIN_ALLOC_OFFSET),ALLOC_OFFSET_BITS); - iBitsWritten += ALLOC_OFFSET_BITS; - - return iBitsWritten; -} - -static int WriteCQMFData(const int iNumGroups, - const int *piGroupLengths, - const int iNumBands, - const int *piBandwidths, - const int **ppiAlloc, - const int **ppiSignReal, - const int **ppiSignImag, - const int **ppiQReal, - const int **ppiQImag, - Bitstream *psBSWrite) -{ - int n; - int iBitsWritten; - int iBlockOffest; - - iBitsWritten = 0; - iBlockOffest = 0; - - - for(n = 0; n < iNumGroups; n ++){ - int k; - for(k = 0; k < piGroupLengths[n]; k ++){ - int b; - int iFBOffset; - - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - int iAlloc; - int iHuffDim; - int iHuffMod; - - iAlloc = ppiAlloc[n][b]; - - iHuffDim = c_aiHuffmanDim[iAlloc]; - iHuffMod = c_aiHuffmanMod[iAlloc]; - - - if(iAlloc > 0){ - const unsigned int (*pauiHuffmanTable)[2] = NULL; //const? - - pauiHuffmanTable = GetHuffEncTable(iAlloc); - for(m = 0; m < piBandwidths[b]; m ++){ - int iQuantValue1; - int iQuantValue2; - - iQuantValue1 = ppiQReal[iBlockOffest][iFBOffset]; - iQuantValue2 = ppiQImag[iBlockOffest][iFBOffset]; - - - if(iHuffDim == 2){ - int iSymbol; - iSymbol = iQuantValue1; - iSymbol *= iHuffMod; - iSymbol += iQuantValue2; - BSPutBits(psBSWrite, pauiHuffmanTable[iSymbol][1], pauiHuffmanTable[iSymbol][0]); - iBitsWritten += pauiHuffmanTable[iSymbol][0]; - } - else{ - BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue1][1], pauiHuffmanTable[iQuantValue1][0]); - iBitsWritten += pauiHuffmanTable[iQuantValue1][0]; - BSPutBits(psBSWrite, pauiHuffmanTable[iQuantValue2][1], pauiHuffmanTable[iQuantValue2][0]); - iBitsWritten += pauiHuffmanTable[iQuantValue2][0]; - } - - if(iQuantValue1 > 0){ - BSPutBits(psBSWrite,ppiSignReal[iBlockOffest][iFBOffset],1); - iBitsWritten += 1; - } - if(iQuantValue2 > 0){ - BSPutBits(psBSWrite,ppiSignImag[iBlockOffest][iFBOffset],1); - iBitsWritten += 1; - } - - iFBOffset ++; - } - } - else{ - iFBOffset += piBandwidths[b]; - } - - } - - iBlockOffest ++; - } - } - - return iBitsWritten; -} - -static int ComputeAllocation(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAvailableBits, - int *piAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag) -{ - int iBitsUsed; - int iDone; - int iDelta; - - iBitsUsed = ALLOC_OFFSET_BITS; // Bits used for Alloc Offset - - iDone = 0; - iDelta = -MIN_ALLOC_OFFSET; - *piAllocOffset = 0; - while(iDone == 0){ - int n; - int iLimitAllocOffset; - iBitsUsed = ALLOC_OFFSET_BITS; - - iLimitAllocOffset = *piAllocOffset; - iLimitAllocOffset = (iLimitAllocOffset > MIN_ALLOC_OFFSET) ? iLimitAllocOffset : MIN_ALLOC_OFFSET; - iLimitAllocOffset = (iLimitAllocOffset < MAX_ALLOC_OFFSET) ? iLimitAllocOffset : MAX_ALLOC_OFFSET; - - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < piNumGroups[n]; k ++){ - int b; - for(b = 0; b < iNumBands; b ++){ - int iAlloc; - iAlloc = ((pppiSMR[n][k][b] + iLimitAllocOffset * ALLOC_OFFSET_SCALE) >> 5); - iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; - iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; - pppiAlloc[n][k][b] = iAlloc; - } - } - - QuantizeSpectrum(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const float**)pppfReal[n], - (const float**)pppfImag[n], - pppiQReal[n], - pppiQImag[n]); - - iBitsUsed += CountCQMFBits(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const int**)pppiQReal[n], - (const int**)pppiQImag[n]); - } - - if(*piAllocOffset <= MIN_ALLOC_OFFSET && iBitsUsed > iAvailableBits){ -#ifdef DEBUG_VERBOSE - printf("Frame can not be coded with the number of bits available\n"); -#endif - //iLastError = ENC_ERROR_STREAM_FAILURE; - return -1; - } - else if(*piAllocOffset >= MAX_ALLOC_OFFSET && iBitsUsed < iAvailableBits){ - *piAllocOffset = MAX_ALLOC_OFFSET; - iDone ++; - } - else{ - if(iDelta == 0 && iBitsUsed > iAvailableBits){ - iDelta = 1; - } - else if(iDelta == 0 && iBitsUsed < iAvailableBits){ - iDone ++; - } - else if(iBitsUsed == iAvailableBits){ - iDone ++; - } - - if(iBitsUsed > iAvailableBits){ - *piAllocOffset -= iDelta; - iDelta >>= 1; - } - else if(iBitsUsed < iAvailableBits){ - *piAllocOffset += iDelta; - iDelta >>= 1; - } - } - - } - - //printf("%d\t%d\t%d\t%d\n",*piAllocOffset,iAvailableBits,iBitsUsed,iAvailableBits - iBitsUsed); - - return iBitsUsed; -} - -static int ComputeAllocationByPass(const int iChannels, - const int *piNumGroups, - const int **ppiGroupLengths, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const int ***pppiSMR, - const int iAllocOffset, - int ***pppiAlloc, - int ***pppiQReal, - int ***pppiQImag) -{ - int n; - int iBitsUsed; - - iBitsUsed = ALLOC_OFFSET_BITS; - - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < piNumGroups[n]; k ++){ - int b; - for(b = 0; b < iNumBands; b ++){ - int iAlloc; - iAlloc = ((pppiSMR[n][k][b] + iAllocOffset * ALLOC_OFFSET_SCALE) >> 5); - iAlloc = (iAlloc > MIN_ALLOC) ? iAlloc : MIN_ALLOC; - iAlloc = (iAlloc < MAX_ALLOC) ? iAlloc : MAX_ALLOC; - pppiAlloc[n][k][b] = iAlloc; - } - } - - QuantizeSpectrum(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const float**)pppfReal[n], - (const float**)pppfImag[n], - pppiQReal[n], - pppiQImag[n]); - - iBitsUsed += CountCQMFBits(piNumGroups[n], - (const int*)ppiGroupLengths[n], - iNumBands, - piBandwidths, - (const int**)pppiAlloc[n], - (const int**)pppiQReal[n], - (const int**)pppiQImag[n]); - } - - return iBitsUsed; -} diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h b/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h deleted file mode 100644 index d509827beb..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFEncoder.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _CQMF_ENCODER_H_ -#define _CQMF_ENCODER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define ENCODER_ERROR_NONE (0) -#define ENCODER_ERROR_FS_NOT_SUPPORTED (-1) -#define ENCODER_ERROR_CHAN_NOT_SUPPORTED (-2) -#define ENCODER_ERROR_UNKNOWN (-100) - -typedef struct CQMF_ENCODER CQMFEncoder; - -CQMFEncoder* CreateCQMFEncoder(const int iSampleRate, - const int iChannels, - const int iTargetBitRate); - -void DeleteCQMFEncoder(CQMFEncoder *psCQMFEncoder); - -int CQMFEncoderGetError(CQMFEncoder *psCQMFEncoder); - -int EncodeFrame(CQMFEncoder *psCQMFEncoder, - float ***pppfCQMFReal, - float ***pppfCQMFImag, - int *piNumiBytes, - unsigned char *puchData); - -#ifdef __cplusplus -} -#endif - -#endif /* _CQMF_ENCODER_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c deleted file mode 100644 index ad7e387c72..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.c +++ /dev/null @@ -1,1457 +0,0 @@ -#include "CQMFHuff.h" -#include "wmops.h" - -const unsigned int c_aaiCQMFHuffEnc1[16][2] = -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0001}, - {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0009, 0x0003}, {0x000a, 0x0001}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, -}; - -const unsigned int c_aaiCQMFHuffDec1[4][16] = -{ - {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, -}; - -const unsigned int c_aaiCQMFHuffEnc2[25][2] = -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, - {0x000c, 0x0002}, {0x000c, 0x0003}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, - {0x000b, 0x0004}, {0x000c, 0x0007}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, - {0x000b, 0x000b}, - -}; - -const unsigned int c_aaiCQMFHuffDec2[4][16] = -{ - {0x0001ffff, 0x00000006, 0x00010005, 0x00010005, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, - {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x00000003, 0x00000004, 0x00000008, 0x00000009, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000011, 0x00010010, 0x00010010, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, }, -}; - -const unsigned int c_aaiCQMFHuffEnc3[36][2] = -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0006}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, - {0x0007, 0x0001}, {0x000b, 0x0007}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0008}, - {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x000a}, {0x000b, 0x0009}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, - {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000d, 0x0010}, - {0x000d, 0x0011}, {0x000d, 0x0012}, {0x000d, 0x0013}, {0x000c, 0x000b}, - -}; - -const unsigned int c_aaiCQMFHuffDec3[14][16] = -{ - {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x0001000f, 0x0001000f, 0x00010014, 0x00010014, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x00000013, 0x00000023, 0x00010003, 0x00010003, 0x00010009, 0x00010009, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, -}; - -const unsigned int c_aaiCQMFHuffEnc4[49][2] = -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0004}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x0003, 0x0001}, - {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0005}, {0x000f, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, - {0x0008, 0x0001}, {0x000d, 0x000a}, {0x000f, 0x0006}, {0x000f, 0x0007}, {0x000f, 0x0008}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0006}, - {0x000c, 0x0007}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000e, 0x000c}, {0x000d, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, - {0x000f, 0x000e}, {0x000f, 0x000f}, {0x000f, 0x0010}, {0x000f, 0x0011}, {0x000f, 0x0012}, {0x000f, 0x0013}, {0x000f, 0x0014}, {0x000f, 0x0015}, - {0x000f, 0x0016}, {0x000f, 0x0017}, {0x000e, 0x000d}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000e, 0x0010}, {0x000e, 0x0011}, {0x000e, 0x0012}, - {0x000e, 0x0013}, - -}; - -const unsigned int c_aaiCQMFHuffDec4[9][16] = -{ - {0x0001ffff, 0x00000008, 0x00010007, 0x00010007, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000010, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0007ffff, 0x0006ffff, 0x0008ffff, 0x0004ffff, 0x0005ffff, 0x0003ffff, 0x00000017, 0x00000018, 0x00010003, 0x00010003, 0x0001000a, 0x0001000a, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x00010014, 0x00010014, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, - {0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, - {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, -}; - -const unsigned int c_aaiCQMFHuffEnc5[64][2] = -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x000c}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, - {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, {0x000a, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, - {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x000c, 0x0003}, {0x000f, 0x000d}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, - {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0004}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, - {0x000e, 0x0007}, {0x000d, 0x0005}, {0x0010, 0x0015}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, - {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, - {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, - {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0010, 0x0016}, {0x0010, 0x0017}, -}; - -const unsigned int c_aaiCQMFHuffDec5[27][16] = -{ - {0x0001ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, - {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x00000013, 0x00010003, 0x00010003, 0x00010018, 0x00010018, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, - {0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000022, 0x0000003e, 0x0000003f, 0x00010004, 0x00010004, 0x00010014, 0x00010014, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x0008ffff, 0x0007ffff, 0x0009ffff, 0x000dffff, 0x0006ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, -}; - -const unsigned int c_aaiCQMFHuffEnc6[81][2] = -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, - {0x0012, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x000e, 0x0006}, {0x0012, 0x0004}, {0x0012, 0x0005}, - {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000c, 0x0003}, {0x000f, 0x0008}, {0x0012, 0x0008}, - {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0005}, {0x000e, 0x0007}, {0x0011, 0x001c}, - {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0009}, {0x0010, 0x000f}, - {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0011, 0x001d}, {0x0012, 0x0016}, - {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, - {0x0012, 0x001f}, {0x0012, 0x0020}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, - {0x0012, 0x0027}, {0x0012, 0x0028}, {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, - {0x0012, 0x002f}, {0x0012, 0x0030}, {0x0012, 0x0031}, {0x0012, 0x0032}, {0x0012, 0x0033}, {0x0012, 0x0034}, {0x0012, 0x0035}, {0x0012, 0x0036}, - {0x0012, 0x0037}, - -}; - -const unsigned int c_aaiCQMFHuffDec6[21][16] = -{ - {0x0001ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000014, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x00000015, 0x00010003, 0x00010003, 0x0001001b, 0x0001001b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x00010016, 0x00010016, 0x00010026, 0x00010026, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x0008ffff, 0x0009ffff, 0x0007ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0006ffff, 0x00000027, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, - {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, }, - {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, - {0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, - {0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020044, 0x00020044, 0x00020044, 0x00020044, }, - {0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, - {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, }, - {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020050, 0x00020050, 0x00020050, 0x00020050, }, -}; - -const unsigned int c_aaiCQMFHuffEnc7[81][2] = -{ - {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x000a, 0x0002}, {0x000d, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, - {0x0012, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0006}, {0x000f, 0x0009}, {0x0012, 0x0004}, - {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0006}, {0x0011, 0x0018}, - {0x0011, 0x0019}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x000a, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000e, 0x0007}, {0x000f, 0x000a}, - {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x000d, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x000b}, - {0x0011, 0x001a}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0010, 0x000e}, {0x0012, 0x0011}, {0x0010, 0x000f}, - {0x0010, 0x0010}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0010, 0x0011}, {0x0012, 0x0017}, - {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, - {0x0012, 0x0020}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, - {0x0012, 0x0028}, {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, {0x0012, 0x002f}, - {0x0011, 0x001b}, - -}; - -const unsigned int c_aaiCQMFHuffDec7[23][16] = -{ - {0x0001ffff, 0x0002ffff, 0x0001000a, 0x0001000a, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, - {0x0004ffff, 0x0003ffff, 0x00010014, 0x00010014, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0008ffff, 0x0007ffff, 0x0006ffff, 0x0005ffff, 0x00010015, 0x00010015, 0x0001001d, 0x0001001d, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00000030, 0x00000036, 0x0001000e, 0x0001000e, 0x0001001f, 0x0001001f, 0x00010027, 0x00010027, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x000effff, 0x000dffff, 0x000bffff, 0x000cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0009ffff, 0x000affff, 0x0000002d, 0x0000002f, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, - {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, - {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, }, - {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, - {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020037, 0x00020037, 0x00020037, 0x00020037, }, - {0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, }, - {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, - {0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, }, - {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020047, 0x00020047, 0x00020047, 0x00020047, }, - {0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, - {0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, -}; - -const unsigned int c_aaiCQMFHuffEnc8[121][2] = -{ - {0x0002, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000d, 0x0003}, {0x0010, 0x0008}, {0x0014, 0x0000}, {0x0014, 0x0001}, - {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0004}, - {0x0010, 0x0009}, {0x0012, 0x0016}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0005, 0x0002}, {0x0005, 0x0003}, - {0x0007, 0x0001}, {0x000b, 0x0002}, {0x000e, 0x0004}, {0x0010, 0x000a}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, - {0x0014, 0x000d}, {0x000a, 0x0003}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0005}, {0x0010, 0x000b}, {0x0012, 0x0017}, {0x0014, 0x000e}, - {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0005}, {0x000f, 0x0006}, - {0x0011, 0x000d}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0011, 0x000e}, - {0x000f, 0x0007}, {0x0011, 0x000f}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, - {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0013, 0x002a}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0013, 0x002b}, {0x0014, 0x0021}, {0x0014, 0x0022}, - {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, - {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, - {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, - {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, - {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, - {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, - {0x0014, 0x0053}, - -}; - -const unsigned int c_aaiCQMFHuffDec8[17][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, - {0x0004ffff, 0x0003ffff, 0x00010018, 0x00010018, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x0008ffff, 0x0006ffff, 0x0005ffff, 0x0007ffff, 0x00010019, 0x00010019, 0x00010023, 0x00010023, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x000bffff, 0x0009ffff, 0x000affff, 0x00000005, 0x00000010, 0x0000001b, 0x00000025, 0x0001002f, 0x0001002f, 0x00010038, 0x00010038, }, - {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00010042, 0x00010042, 0x00010045, 0x00010045, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, - {0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000027, 0x00000028, }, - {0x00000029, 0x0000002a, 0x0000002b, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000043, }, - {0x00000044, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000051, 0x00000052, 0x00000053, 0x00000054, }, - {0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, }, - {0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000006c, 0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, }, -}; - -const unsigned int c_aaiCQMFHuffEnc9[196][2] = -{ - {0x0003, 0x0002}, {0x0002, 0x0002}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x000b, 0x0003}, {0x000f, 0x000e}, {0x0010, 0x0016}, {0x0013, 0x0000}, - {0x0012, 0x004a}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0003, 0x0003}, {0x0002, 0x0003}, - {0x0004, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0004}, {0x000e, 0x0009}, {0x0011, 0x0028}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, - {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0005, 0x0001}, {0x0004, 0x0003}, {0x0007, 0x0003}, {0x0009, 0x0002}, - {0x000c, 0x0004}, {0x000e, 0x000a}, {0x0010, 0x0017}, {0x0012, 0x004b}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, - {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0005}, {0x000e, 0x000b}, {0x000f, 0x000f}, - {0x0011, 0x0029}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, - {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0005}, {0x000e, 0x000c}, {0x000f, 0x0010}, {0x0011, 0x002a}, {0x0012, 0x004c}, {0x0013, 0x001a}, - {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x000e, 0x000d}, {0x000d, 0x0007}, - {0x000f, 0x0011}, {0x0010, 0x0018}, {0x0012, 0x004d}, {0x0013, 0x0021}, {0x0012, 0x004e}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, - {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0010, 0x0019}, {0x0010, 0x001a}, {0x0010, 0x001b}, {0x0012, 0x004f}, - {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, - {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0011, 0x002b}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, - {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, - {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, - {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, - {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, - {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, - {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, - {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, - {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, - {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, - {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, - {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, - {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, - -}; - -const unsigned int c_aaiCQMFHuffDec9[30][16] = -{ - {0x0001ffff, 0x00000002, 0x00000010, 0x0000001d, 0x00010000, 0x00010000, 0x0001000e, 0x0001000e, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0003ffff, 0x0002ffff, 0x00000003, 0x00000011, 0x0000002a, 0x0000002b, 0x0001001e, 0x0001001e, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x000bffff, 0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000020, 0x0000003a, 0x00010004, 0x00010004, 0x00010012, 0x00010012, 0x0001002d, 0x0001002d, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, - {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x0001003c, 0x0001003c, 0x00010048, 0x00010048, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, - {0x001cffff, 0x001dffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000006, 0x00000022, 0x00000049, 0x00000054, 0x00000055, 0x00000056, 0x00010005, 0x00010005, 0x0001002f, 0x0001002f, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, }, - {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020057, 0x00020057, 0x00020057, 0x00020057, }, - {0x000fffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, }, - {0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, - {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, - {0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, - {0x00010007, 0x00010007, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, - {0x00010045, 0x00010045, 0x0001004b, 0x0001004b, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, - {0x00010053, 0x00010053, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, }, - {0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, }, - {0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, }, - {0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, }, - {0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, }, - {0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, }, - {0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, }, - {0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, }, - {0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, }, - {0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, }, - {0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, }, - {0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, }, - {0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, -}; - -const unsigned int c_aaiCQMFHuffEnc10[196][2] = -{ - {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0004, 0x0002}, {0x0006, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x000f, 0x000e}, {0x000f, 0x000f}, - {0x0012, 0x003f}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0003, 0x0005}, {0x0002, 0x0003}, - {0x0004, 0x0003}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000c, 0x0006}, {0x000e, 0x000b}, {0x000f, 0x0010}, {0x0013, 0x0005}, {0x0013, 0x0006}, - {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0007, 0x0002}, - {0x000a, 0x0004}, {0x000c, 0x0007}, {0x000e, 0x000c}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0003}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0008}, - {0x000f, 0x0011}, {0x0011, 0x0028}, {0x0013, 0x0010}, {0x0012, 0x0040}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, - {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0009}, {0x000f, 0x0012}, {0x0010, 0x0016}, {0x0013, 0x0015}, - {0x0011, 0x0029}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x000c, 0x0008}, {0x000b, 0x0007}, - {0x000c, 0x0009}, {0x000e, 0x000d}, {0x000f, 0x0013}, {0x0010, 0x0017}, {0x0011, 0x002a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0012, 0x0041}, - {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x000f, 0x0014}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000f, 0x0015}, - {0x0012, 0x0042}, {0x0010, 0x0018}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, - {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0010, 0x0019}, {0x0010, 0x001a}, {0x0011, 0x002b}, {0x0010, 0x001b}, {0x0012, 0x0043}, - {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, - {0x0012, 0x0044}, {0x0012, 0x0045}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0012, 0x0046}, {0x0013, 0x0035}, {0x0013, 0x0036}, - {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, - {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, - {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, - {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, - {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, - {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, - {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, - {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, - {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0012, 0x0047}, - {0x0012, 0x0048}, {0x0012, 0x0049}, {0x0012, 0x004a}, {0x0012, 0x004b}, - -}; - -const unsigned int c_aaiCQMFHuffDec10[34][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000002, 0x00000010, 0x0000001c, 0x0000001d, 0x00010000, 0x00010000, 0x00010001, 0x00010001, 0x0001000e, 0x0001000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0006ffff, 0x0004ffff, 0x0003ffff, 0x0005ffff, 0x0001001f, 0x0001001f, 0x0001002c, 0x0001002c, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x000fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x0007ffff, 0x00000005, 0x00000013, 0x00000021, 0x00000046, 0x00000048, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, - {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x00010015, 0x00010015, 0x00010030, 0x00010030, 0x0001003d, 0x0001003d, 0x0001004a, 0x0001004a, 0x00010054, 0x00010054, 0x00010057, 0x00010057, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, - {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x000effff, 0x0011ffff, 0x0012ffff, 0x000dffff, 0x000bffff, 0x000cffff, 0x0000003e, 0x0000004b, 0x00000059, 0x00000063, 0x00000064, 0x00000066, 0x00010006, 0x00010006, 0x00010007, 0x00010007, }, - {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020067, 0x00020067, 0x00020067, 0x00020067, }, - {0x0014ffff, 0x0013ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0010ffff, }, - {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, }, - {0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, }, - {0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, - {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, }, - {0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, - {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, - {0x00010053, 0x00010053, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, }, - {0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, }, - {0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, }, - {0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, }, - {0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, }, - {0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, }, - {0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, - {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, - {0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, }, - {0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, }, - {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, -}; - -const unsigned int c_aaiCQMFHuffEnc11[256][2] = -{ - {0x0004, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0004}, {0x0006, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0004}, {0x000e, 0x000c}, {0x0010, 0x001e}, - {0x0013, 0x0000}, {0x0012, 0x005b}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, - {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0003}, {0x0008, 0x0004}, {0x000a, 0x0004}, {0x000d, 0x0009}, {0x000f, 0x0011}, - {0x0013, 0x0007}, {0x0012, 0x005c}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0004, 0x0005}, {0x0003, 0x0007}, {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0005}, {0x000e, 0x000d}, {0x000f, 0x0012}, - {0x0012, 0x005d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, - {0x0006, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0005}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000d, 0x000a}, {0x000f, 0x0013}, {0x0011, 0x0035}, - {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, - {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0005}, {0x000a, 0x0006}, {0x000c, 0x0006}, {0x000e, 0x000e}, {0x000f, 0x0014}, {0x0011, 0x0036}, - {0x0012, 0x005e}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, - {0x000b, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000e, 0x000f}, {0x000f, 0x0015}, {0x0011, 0x0037}, {0x0012, 0x005f}, - {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, - {0x000e, 0x0010}, {0x000d, 0x000b}, {0x000e, 0x0011}, {0x000f, 0x0016}, {0x0010, 0x001f}, {0x0012, 0x0060}, {0x0011, 0x0038}, {0x0012, 0x0061}, - {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, - {0x0010, 0x0020}, {0x000f, 0x0017}, {0x0010, 0x0021}, {0x0011, 0x0039}, {0x0011, 0x003a}, {0x0012, 0x0062}, {0x0013, 0x0034}, {0x0013, 0x0035}, - {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, - {0x0012, 0x0063}, {0x0011, 0x003b}, {0x0012, 0x0064}, {0x0012, 0x0065}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, - {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, - {0x0013, 0x004a}, {0x0012, 0x0066}, {0x0013, 0x004b}, {0x0012, 0x0067}, {0x0012, 0x0068}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, - {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, - {0x0013, 0x0057}, {0x0012, 0x0069}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, - {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, - {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, - {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, - {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, - {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, - {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, - {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, - {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, - {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, - {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, - {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, -}; - -const unsigned int c_aaiCQMFHuffDec11[43][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000000, 0x00000002, 0x00000020, 0x00010001, 0x00010001, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010021, 0x00010021, }, - {0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000004, 0x00000014, 0x00000033, 0x00000040, 0x00000041, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, - {0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020051, 0x00020051, 0x00020051, 0x00020051, }, - {0x0014ffff, 0x000bffff, 0x000affff, 0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000044, 0x00000053, 0x00010005, 0x00010005, 0x00010025, 0x00010025, 0x00010050, 0x00010050, 0x00010052, 0x00010052, }, - {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, - {0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, - {0x00000070, 0x00000072, 0x00010017, 0x00010017, 0x00010027, 0x00010027, 0x00010036, 0x00010036, 0x00010046, 0x00010046, 0x00010055, 0x00010055, 0x00010063, 0x00010063, 0x00010071, 0x00010071, }, - {0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0011ffff, 0x0010ffff, 0x0012ffff, 0x0013ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000007, 0x00000064, }, - {0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, - {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, - {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, - {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020057, 0x00020057, 0x00020057, 0x00020057, }, - {0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, - {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, - {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020093, 0x00020093, 0x00020093, 0x00020093, }, - {0x0018ffff, 0x0017ffff, 0x0019ffff, 0x0015ffff, 0x0016ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, - {0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, }, - {0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, }, - {0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, }, - {0x00010008, 0x00010008, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010018, 0x00010018, }, - {0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, - {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, - {0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, }, - {0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010084, 0x00010084, 0x00010085, 0x00010085, }, - {0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, }, - {0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010092, 0x00010092, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, - {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, - {0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, }, - {0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, }, - {0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, }, - {0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, }, - {0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, }, - {0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, }, - {0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, }, - {0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, }, - {0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, }, - {0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, }, - {0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, }, -}; - -const unsigned int c_aaiCQMFHuffEnc12[400][2] = -{ - {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0005, 0x0002}, {0x0007, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0009}, {0x000f, 0x0011}, - {0x0012, 0x0053}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, - {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0004, 0x0007}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0003}, - {0x0007, 0x0004}, {0x0009, 0x0004}, {0x000c, 0x0008}, {0x000e, 0x000c}, {0x0010, 0x001b}, {0x0011, 0x002e}, {0x0013, 0x009d}, {0x0014, 0x0009}, - {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, - {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0004}, {0x0008, 0x0004}, {0x000a, 0x0005}, {0x000d, 0x000a}, {0x000f, 0x0012}, - {0x0011, 0x002f}, {0x0013, 0x009e}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, - {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0007, 0x0005}, - {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000e, 0x000d}, {0x000f, 0x0013}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0014, 0x001c}, {0x0014, 0x001d}, - {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, - {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0006}, {0x000d, 0x000b}, {0x000e, 0x000e}, {0x0010, 0x001c}, - {0x0012, 0x0054}, {0x0013, 0x009f}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, - {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x000a, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0007}, {0x000b, 0x0007}, - {0x000d, 0x000c}, {0x000e, 0x000f}, {0x000f, 0x0014}, {0x0011, 0x0032}, {0x0013, 0x00a0}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, - {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, - {0x000d, 0x000d}, {0x000c, 0x0009}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000e, 0x0010}, {0x0010, 0x001d}, {0x0010, 0x001e}, {0x0013, 0x00a1}, - {0x0013, 0x00a2}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, - {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x000f, 0x0015}, {0x000e, 0x0011}, {0x000f, 0x0016}, {0x000f, 0x0017}, - {0x0010, 0x001f}, {0x0011, 0x0033}, {0x0012, 0x0055}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, - {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, - {0x0011, 0x0034}, {0x0010, 0x0020}, {0x0010, 0x0021}, {0x0011, 0x0035}, {0x0012, 0x0056}, {0x0013, 0x00a3}, {0x0014, 0x0053}, {0x0014, 0x0054}, - {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, - {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0012, 0x0057}, {0x0012, 0x0058}, {0x0014, 0x0061}, {0x0014, 0x0062}, - {0x0012, 0x0059}, {0x0014, 0x0063}, {0x0012, 0x005a}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, - {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, - {0x0014, 0x0071}, {0x0012, 0x005b}, {0x0014, 0x0072}, {0x0013, 0x00a4}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, - {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, - {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, - {0x0014, 0x0087}, {0x0013, 0x00a5}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, - {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, - {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, - {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, - {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, - {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, - {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, - {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, - {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, - {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, - {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, - {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, - {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, - {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, - {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, - {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, - {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, - {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, - {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, - {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, - {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, - {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, -}; - -const unsigned int c_aaiCQMFHuffDec12[44][16] = -{ - {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000001, 0x00000002, 0x00000014, 0x00000028, 0x0000002a, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010029, 0x00010029, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0000002c, 0x00000052, 0x00010004, 0x00010004, 0x00010018, 0x00010018, 0x0001003f, 0x0001003f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, - {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, - {0x0018ffff, 0x000fffff, 0x000effff, 0x000dffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000001a, 0x00000079, 0x00010041, 0x00010041, 0x00010054, 0x00010054, 0x00010067, 0x00010067, }, - {0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, - {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, - {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, - {0x000000a1, 0x000000a2, 0x00010007, 0x00010007, 0x0001002f, 0x0001002f, 0x00010043, 0x00010043, 0x0001006a, 0x0001006a, 0x0001008c, 0x0001008c, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, }, - {0x0029ffff, 0x002affff, 0x002bffff, 0x0017ffff, 0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000001c, 0x00000057, 0x0000007d, 0x0000007e, 0x00000090, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, - {0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, - {0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, - {0x0001006c, 0x0001006c, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x000100a5, 0x000100a5, 0x000100cb, 0x000100cb, 0x000100e1, 0x000100e1, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, }, - {0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001001e, 0x0001001e, 0x00010031, 0x00010031, 0x00010059, 0x00010059, }, - {0x001affff, 0x001bffff, 0x0019ffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, }, - {0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, }, - {0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, }, - {0x00000026, 0x00000027, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x0000003a, 0x0000003b, 0x00000046, 0x00000047, 0x00000048, 0x00000049, }, - {0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, }, - {0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, }, - {0x0000009d, 0x0000009e, 0x0000009f, 0x000000a6, 0x000000a7, 0x000000a8, 0x000000a9, 0x000000aa, 0x000000ab, 0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, }, - {0x000000b3, 0x000000b6, 0x000000b7, 0x000000b9, 0x000000bb, 0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, 0x000000c6, }, - {0x000000c7, 0x000000c8, 0x000000ca, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, }, - {0x000000d9, 0x000000da, 0x000000db, 0x000000dc, 0x000000dd, 0x000000de, 0x000000df, 0x000000e0, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, }, - {0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, }, - {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, - {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, - {0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, }, - {0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, 0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, }, - {0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, }, - {0x0000014a, 0x0000014b, 0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, }, - {0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, 0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, }, - {0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, }, - {0x0000017a, 0x0000017b, 0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, }, -}; - -const unsigned int c_aaiCQMFHuffEnc13[625][2] = -{ - {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0005}, {0x0008, 0x0006}, {0x000a, 0x0008}, {0x000c, 0x000c}, - {0x000e, 0x0019}, {0x0010, 0x0049}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, - {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, - {0x000b, 0x0009}, {0x000d, 0x0011}, {0x000f, 0x002a}, {0x0010, 0x004a}, {0x0011, 0x0084}, {0x0012, 0x0100}, {0x0013, 0x000f}, {0x0013, 0x0010}, - {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, - {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0005, 0x0008}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x0009}, {0x0006, 0x0007}, {0x0008, 0x0007}, - {0x0009, 0x0008}, {0x000b, 0x000a}, {0x000d, 0x0012}, {0x000f, 0x002b}, {0x0012, 0x0101}, {0x0012, 0x0102}, {0x0013, 0x001b}, {0x0013, 0x001c}, - {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, - {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0005, 0x000a}, {0x0004, 0x000d}, {0x0005, 0x000b}, {0x0006, 0x0008}, {0x0007, 0x0007}, - {0x0009, 0x0009}, {0x000a, 0x0009}, {0x000c, 0x000d}, {0x000d, 0x0013}, {0x0010, 0x004b}, {0x0010, 0x004c}, {0x0013, 0x0028}, {0x0013, 0x0029}, - {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, - {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0008}, - {0x0008, 0x0008}, {0x000a, 0x000a}, {0x000b, 0x000b}, {0x000d, 0x0014}, {0x000e, 0x001a}, {0x0011, 0x0085}, {0x0010, 0x004d}, {0x0013, 0x0036}, - {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, - {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0008, 0x0009}, {0x0007, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000c}, {0x000c, 0x000e}, {0x000e, 0x001b}, {0x000f, 0x002c}, {0x0011, 0x0086}, {0x0013, 0x0044}, - {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, - {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x000a, 0x000c}, {0x0009, 0x000a}, - {0x0009, 0x000b}, {0x000a, 0x000d}, {0x000b, 0x000d}, {0x000c, 0x000f}, {0x000e, 0x001c}, {0x000e, 0x001d}, {0x0011, 0x0087}, {0x0011, 0x0088}, - {0x0012, 0x0103}, {0x0012, 0x0104}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, - {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x000c, 0x0010}, - {0x000b, 0x000e}, {0x000b, 0x000f}, {0x000c, 0x0011}, {0x000d, 0x0015}, {0x000e, 0x001e}, {0x000f, 0x002d}, {0x0011, 0x0089}, {0x0011, 0x008a}, - {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, - {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, - {0x000e, 0x001f}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000e, 0x0020}, {0x000e, 0x0021}, {0x000f, 0x002e}, {0x0010, 0x004e}, {0x0013, 0x0070}, - {0x0012, 0x0105}, {0x0012, 0x0106}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, - {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, - {0x0013, 0x007f}, {0x0010, 0x004f}, {0x000f, 0x002f}, {0x000f, 0x0030}, {0x000f, 0x0031}, {0x0010, 0x0050}, {0x0011, 0x008b}, {0x0011, 0x008c}, - {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, - {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, - {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0012, 0x0107}, {0x0010, 0x0051}, {0x0010, 0x0052}, {0x0010, 0x0053}, {0x0011, 0x008d}, {0x0011, 0x008e}, - {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, - {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, - {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0011, 0x008f}, {0x0011, 0x0090}, {0x0013, 0x00a5}, {0x0011, 0x0091}, {0x0013, 0x00a6}, - {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, - {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, - {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, - {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, - {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, - {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, - {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, - {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, - {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, - {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, - {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, - {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, - {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, - {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, - {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, - {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, - {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, - {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, - {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, - {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, - {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, - {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, - {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, - {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, - {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, - {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, - {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, - {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, - {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, - {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, - {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, - {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, - {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, - {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, - {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, - {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, - {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, - {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, - {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, - {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, - {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, - {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, {0x0013, 0x01f3}, {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, - {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, {0x0013, 0x01fb}, {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, - {0x0013, 0x01ff}, - -}; - -const unsigned int c_aaiCQMFHuffDec13[98][16] = -{ - {0x0006ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000001, 0x00000019, 0x0000001b, 0x0000001c, 0x00000033, 0x00000034, 0x0000004c, 0x0001001a, 0x0001001a, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, - {0x00010067, 0x00010067, 0x0001007e, 0x0001007e, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, - {0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, - {0x000cffff, 0x000bffff, 0x000affff, 0x0008ffff, 0x0007ffff, 0x0009ffff, 0x00000005, 0x00000037, 0x00000068, 0x0000007d, 0x0000007f, 0x00000080, 0x0001001e, 0x0001001e, 0x0001004f, 0x0001004f, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, - {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020099, 0x00020099, 0x00020099, 0x00020099, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, - {0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, - {0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, - {0x000000af, 0x000000b2, 0x00010020, 0x00010020, 0x00010039, 0x00010039, 0x0001006a, 0x0001006a, 0x00010082, 0x00010082, 0x0001009a, 0x0001009a, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, }, - {0x001effff, 0x002fffff, 0x0040ffff, 0x0051ffff, 0x0014ffff, 0x0013ffff, 0x0011ffff, 0x0012ffff, 0x000effff, 0x000dffff, 0x000fffff, 0x0010ffff, 0x00000007, 0x00000052, 0x00000083, 0x0000009b, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, - {0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, - {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, }, - {0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300c9, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, }, - {0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, - {0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, }, - {0x000000e5, 0x000000fb, 0x000000fc, 0x000000fd, 0x00010022, 0x00010022, 0x0001003b, 0x0001003b, 0x00010085, 0x00010085, 0x000100b5, 0x000100b5, 0x000100cd, 0x000100cd, 0x000100e2, 0x000100e2, }, - {0x001cffff, 0x001dffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x00000009, 0x00000023, 0x00000054, 0x00000055, 0x0000006e, 0x000000ce, 0x000000e1, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, - {0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, }, - {0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, 0x000300b6, }, - {0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300b7, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, 0x000300e6, }, - {0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300e7, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, 0x000300fe, }, - {0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x000300ff, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, }, - {0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, }, - {0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200fa, 0x000200fa, 0x000200fa, 0x000200fa, }, - {0x0021ffff, 0x0023ffff, 0x0022ffff, 0x0025ffff, 0x0024ffff, 0x0026ffff, 0x0029ffff, 0x001fffff, 0x0020ffff, 0x0027ffff, 0x0028ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, }, - {0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, }, - {0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, - {0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, }, - {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, - {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010026, 0x00010026, }, - {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, - {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, - {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, - {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, - {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, }, - {0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, }, - {0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, }, - {0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, - {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, }, - {0x000100cf, 0x000100cf, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, }, - {0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, }, - {0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, }, - {0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, - {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, }, - {0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, }, - {0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, }, - {0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010115, 0x00010115, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, - {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, - {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, - {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, }, - {0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, - {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, - {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, }, - {0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, }, - {0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, }, - {0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, }, - {0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, }, - {0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, }, - {0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, }, - {0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, }, - {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, - {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, - {0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, }, - {0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, }, - {0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, }, - {0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, }, - {0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, }, - {0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, }, - {0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, }, - {0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, }, - {0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, }, - {0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, }, - {0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, }, - {0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, }, - {0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, }, - {0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, }, - {0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, }, - {0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, }, - {0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, }, - {0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, }, - {0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, }, - {0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, }, - {0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, }, - {0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, }, - {0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, }, - {0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, }, - {0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, 0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, }, - {0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, }, - {0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, 0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, }, - {0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, }, - {0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, 0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, }, - {0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, }, -}; - -const unsigned int c_aaiCQMFHuffEnc14[625][2] = -{ - {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0006, 0x0007}, {0x0007, 0x0007}, {0x0009, 0x0009}, {0x000a, 0x000a}, - {0x000c, 0x000e}, {0x000e, 0x0019}, {0x000f, 0x0029}, {0x0010, 0x0046}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, - {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, - {0x0013, 0x000c}, {0x0005, 0x000b}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x000c}, {0x0006, 0x0008}, {0x0008, 0x0008}, - {0x0009, 0x000a}, {0x000b, 0x000c}, {0x000c, 0x000f}, {0x000e, 0x001a}, {0x0010, 0x0047}, {0x0010, 0x0048}, {0x0012, 0x00f1}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, - {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0005, 0x000d}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x000e}, {0x0006, 0x0009}, {0x0007, 0x0008}, - {0x0008, 0x0009}, {0x000a, 0x000b}, {0x000b, 0x000d}, {0x000d, 0x0013}, {0x000e, 0x001b}, {0x0010, 0x0049}, {0x0013, 0x0018}, {0x0013, 0x0019}, - {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, - {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0005, 0x000f}, {0x0004, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x000a}, - {0x0007, 0x0009}, {0x0009, 0x000b}, {0x000a, 0x000c}, {0x000c, 0x0010}, {0x000d, 0x0014}, {0x000f, 0x002a}, {0x0012, 0x00f2}, {0x0013, 0x0025}, - {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, - {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0006, 0x000b}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0006, 0x000c}, - {0x0007, 0x000a}, {0x0008, 0x000a}, {0x000a, 0x000d}, {0x000b, 0x000e}, {0x000c, 0x0011}, {0x000e, 0x001c}, {0x000f, 0x002b}, {0x0011, 0x0081}, - {0x0013, 0x0032}, {0x0012, 0x00f3}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, - {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0007, 0x000b}, {0x0006, 0x000d}, {0x0007, 0x000c}, - {0x0007, 0x000d}, {0x0008, 0x000b}, {0x0009, 0x000c}, {0x000b, 0x000f}, {0x000c, 0x0012}, {0x000d, 0x0015}, {0x000e, 0x001d}, {0x0010, 0x004a}, - {0x0011, 0x0082}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, - {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0009, 0x000d}, {0x0008, 0x000c}, - {0x0008, 0x000d}, {0x0009, 0x000e}, {0x000a, 0x000e}, {0x000b, 0x0010}, {0x000c, 0x0013}, {0x000d, 0x0016}, {0x000e, 0x001e}, {0x000f, 0x002c}, - {0x0010, 0x004b}, {0x0012, 0x00f4}, {0x0012, 0x00f5}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, - {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x000a, 0x000f}, - {0x0009, 0x000f}, {0x000a, 0x0010}, {0x000a, 0x0011}, {0x000b, 0x0011}, {0x000c, 0x0014}, {0x000d, 0x0017}, {0x000e, 0x001f}, {0x000f, 0x002d}, - {0x0010, 0x004c}, {0x0011, 0x0083}, {0x0011, 0x0084}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, - {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, - {0x000c, 0x0015}, {0x000b, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0016}, {0x000c, 0x0017}, {0x000d, 0x0018}, {0x000e, 0x0020}, {0x000f, 0x002e}, - {0x0011, 0x0085}, {0x0010, 0x004d}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, - {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, - {0x0013, 0x0072}, {0x000e, 0x0021}, {0x000d, 0x0019}, {0x000d, 0x001a}, {0x000d, 0x001b}, {0x000e, 0x0022}, {0x000f, 0x002f}, {0x0010, 0x004e}, - {0x0011, 0x0086}, {0x0011, 0x0087}, {0x0013, 0x0073}, {0x0012, 0x00f6}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, - {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, - {0x0013, 0x0080}, {0x0013, 0x0081}, {0x000f, 0x0030}, {0x000e, 0x0023}, {0x000e, 0x0024}, {0x000e, 0x0025}, {0x0010, 0x004f}, {0x0012, 0x00f7}, - {0x0011, 0x0088}, {0x0012, 0x00f8}, {0x0012, 0x00f9}, {0x0012, 0x00fa}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, - {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, - {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0012, 0x00fb}, {0x0010, 0x0050}, {0x0010, 0x0051}, {0x000f, 0x0031}, {0x0012, 0x00fc}, - {0x0012, 0x00fd}, {0x0012, 0x00fe}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, - {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, - {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0011, 0x0089}, {0x0011, 0x008a}, - {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0011, 0x008b}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, - {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, - {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0012, 0x00ff}, {0x0013, 0x00ba}, - {0x0012, 0x0100}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, - {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, - {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, - {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, - {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, - {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, - {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, - {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, - {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, - {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, - {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, - {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, - {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, - {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, - {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, - {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, - {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, - {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, - {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, - {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, - {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, - {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, - {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, - {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, - {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, - {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, - {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, - {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, - {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, - {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, - {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, - {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, - {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, - {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, - {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, - {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, - {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, - {0x0012, 0x0101}, - -}; - -const unsigned int c_aaiCQMFHuffDec14[103][16] = -{ - {0x000affff, 0x0009ffff, 0x0008ffff, 0x0002ffff, 0x0003ffff, 0x0001ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x00000033, 0x00000034, 0x0000004c, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, - {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, }, - {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, - {0x00010037, 0x00010037, 0x00010050, 0x00010050, 0x00010068, 0x00010068, 0x0001007d, 0x0001007d, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00020004, 0x00020004, 0x00020004, 0x00020004, }, - {0x0012ffff, 0x0011ffff, 0x000fffff, 0x0010ffff, 0x000cffff, 0x000bffff, 0x000dffff, 0x000effff, 0x0000001f, 0x00000038, 0x00000069, 0x00000081, 0x00000097, 0x00000098, 0x00010005, 0x00010005, }, - {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, - {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, - {0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, }, - {0x0001009b, 0x0001009b, 0x000100b3, 0x000100b3, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x000200af, 0x000200af, 0x000200af, 0x000200af, }, - {0x00000053, 0x0000006c, 0x00000084, 0x0000009c, 0x000000b4, 0x000000c8, 0x000000cb, 0x000000cc, 0x00010021, 0x00010021, 0x0001003a, 0x0001003a, 0x0001006b, 0x0001006b, 0x00010083, 0x00010083, }, - {0x0028ffff, 0x0039ffff, 0x004affff, 0x0023ffff, 0x001cffff, 0x001bffff, 0x0019ffff, 0x0018ffff, 0x001affff, 0x0015ffff, 0x0013ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x00000008, 0x00000022, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, }, - {0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, }, - {0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, }, - {0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e3, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, 0x000300e4, }, - {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, }, - {0x000100fa, 0x000100fa, 0x00010116, 0x00010116, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, - {0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200fb, 0x000200fb, 0x000200fb, 0x000200fb, }, - {0x00000114, 0x00000115, 0x0001000a, 0x0001000a, 0x00010055, 0x00010055, 0x0001006e, 0x0001006e, 0x0001009f, 0x0001009f, 0x000100b7, 0x000100b7, 0x000100cf, 0x000100cf, 0x000100e6, 0x000100e6, }, - {0x001fffff, 0x001dffff, 0x001effff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000000b, 0x00000024, 0x00000025, 0x0000003d, 0x00000087, 0x000000a0, 0x000000b8, 0x000000d1, 0x000000e7, 0x000000fe, }, - {0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, }, - {0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, }, - {0x00020148, 0x00020148, 0x00020148, 0x00020148, 0x00020270, 0x00020270, 0x00020270, 0x00020270, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, }, - {0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e8, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, 0x000300e9, }, - {0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, 0x0003012e, }, - {0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, 0x00030132, }, - {0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, }, - {0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, - {0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200ff, 0x000200ff, 0x000200ff, 0x000200ff, }, - {0x00020101, 0x00020101, 0x00020101, 0x00020101, 0x00020102, 0x00020102, 0x00020102, 0x00020102, 0x00020103, 0x00020103, 0x00020103, 0x00020103, 0x00020113, 0x00020113, 0x00020113, 0x00020113, }, - {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x00020146, 0x00020146, 0x00020146, 0x00020146, }, - {0x0031ffff, 0x002dffff, 0x002bffff, 0x002cffff, 0x002effff, 0x002fffff, 0x0032ffff, 0x0037ffff, 0x0029ffff, 0x002affff, 0x0030ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0038ffff, }, - {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, - {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, }, - {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, - {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, - {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, - {0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, }, - {0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100bb, 0x000100bb, }, - {0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, - {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010070, 0x00010070, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, }, - {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, - {0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, - {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, }, - {0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100ea, 0x000100ea, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, - {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, - {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, }, - {0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, }, - {0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, }, - {0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, }, - {0x00010112, 0x00010112, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, - {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, - {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010133, 0x00010133, }, - {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, - {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, - {0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010147, 0x00010147, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, }, - {0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, }, - {0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, }, - {0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, }, - {0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, }, - {0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, }, - {0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, }, - {0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, }, - {0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, }, - {0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, }, - {0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, }, - {0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, }, - {0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, }, - {0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, }, - {0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, }, - {0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, }, - {0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, }, - {0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, }, - {0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, }, - {0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, }, - {0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, }, - {0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, }, - {0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, }, - {0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, }, - {0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, }, - {0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, }, - {0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, }, - {0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, }, - {0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, }, - {0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, }, - {0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, }, - {0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, }, - {0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, 0x00010245, 0x00010245, }, - {0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, }, - {0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, 0x00010255, 0x00010255, }, - {0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, }, - {0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, 0x00010265, 0x00010265, }, - {0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, }, -}; - -const unsigned int c_aaiCQMFHuffEnc15[28][2] = -{ - {0x0003, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, - {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000f, 0x0003}, - {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, - {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, - -}; - -const unsigned int c_aaiCQMFHuffDec15[10][16] = -{ - {0x0001ffff, 0x00000005, 0x00010000, 0x00010000, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, - {0x0002ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0003ffff, 0x0000000d, 0x0001000c, 0x0001000c, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0001000f, 0x0001000f, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, -}; - -const unsigned int c_aaiCQMFHuffEnc16[32][2] = -{ - {0x0003, 0x0001}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0001}, {0x0005, 0x0001}, - {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, - {0x0010, 0x0007}, {0x0011, 0x0001}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, - {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, -}; - -const unsigned int c_aaiCQMFHuffDec16[11][16] = -{ - {0x0001ffff, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0002ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, -}; - -const unsigned int c_aaiCQMFHuffEnc17[41][2] = -{ - {0x0004, 0x0001}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0002}, - {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, - {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x0010, 0x0003}, {0x0011, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, - {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, - {0x0013, 0x0013}, - -}; - -const unsigned int c_aaiCQMFHuffDec17[7][16] = -{ - {0x0001ffff, 0x00000000, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, }, - {0x0002ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003ffff, 0x00000010, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x00000013, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, }, - {0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, }, -}; - -const unsigned int c_aaiCQMFHuffEnc18[40][2] = -{ - {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, - {0x0004, 0x0005}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, - {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0011, 0x0003}, {0x0012, 0x0004}, - {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0012, 0x0005}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, - {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0013, 0x0007}, -}; - -const unsigned int c_aaiCQMFHuffDec18[7][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00000000, 0x00000006, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, }, - {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0004ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x0006ffff, 0x0005ffff, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x00000018, 0x00000019, 0x0000001a, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00010027, 0x00010027, }, -}; - -const unsigned int c_aaiCQMFHuffEnc19[47][2] = -{ - {0x0004, 0x0002}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, - {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0007, 0x0002}, - {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000e, 0x0002}, {0x000e, 0x0003}, - {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0011, 0x0009}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0001}, {0x0012, 0x0002}, - {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, - {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, - -}; - -const unsigned int c_aaiCQMFHuffDec19[10][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003ffff, 0x00000011, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x0004ffff, 0x00000015, 0x00010014, 0x00010014, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0005ffff, 0x00000018, 0x00000019, 0x0000001a, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, - {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, -}; - -const unsigned int c_aaiCQMFHuffEnc20[58][2] = -{ - {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, - {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0002}, - {0x0007, 0x0003}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, - {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0003}, {0x000f, 0x0005}, {0x0011, 0x0007}, - {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0011, 0x0008}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, - {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0011, 0x0009}, - {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, - {0x0011, 0x0012}, {0x0011, 0x0013}, - -}; - -const unsigned int c_aaiCQMFHuffDec20[17][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000002, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00010001, 0x00010001, 0x00010003, 0x00010003, 0x00010004, 0x00010004, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0004ffff, 0x0003ffff, 0x00000011, 0x00000012, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x0006ffff, 0x0005ffff, 0x00000019, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x000fffff, 0x0010ffff, 0x000effff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x0001001e, 0x0001001e, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, -}; - -const unsigned int c_aaiCQMFHuffEnc21[70][2] = -{ - {0x0005, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, - {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, - {0x0005, 0x0007}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, - {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, - {0x000c, 0x0003}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0004}, {0x000f, 0x0007}, {0x000e, 0x0005}, {0x0011, 0x0004}, - {0x0010, 0x000d}, {0x0011, 0x0005}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, - {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, - {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, - {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, - -}; - -const unsigned int c_aaiCQMFHuffDec21[23][16] = -{ - {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x0006ffff, 0x0005ffff, 0x00000018, 0x00000019, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000020, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, - {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, - {0x0016ffff, 0x0015ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x00000028, 0x00010025, 0x00010025, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, - {0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, }, - {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, }, -}; - -const unsigned int c_aaiCQMFHuffEnc22[81][2] = -{ - {0x0005, 0x0004}, {0x0004, 0x0006}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0004, 0x0007}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0005, 0x0007}, - {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0003}, - {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, - {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, - {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0005}, {0x000e, 0x0005}, - {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x0010, 0x0011}, {0x0010, 0x0012}, {0x0011, 0x0000}, {0x0011, 0x0001}, - {0x0011, 0x0002}, {0x0010, 0x0013}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, - {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, - {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, - {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, - {0x0011, 0x0021}, - -}; - -const unsigned int c_aaiCQMFHuffDec22[30][16] = -{ - {0x0005ffff, 0x0006ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x0004ffff, 0x00000001, 0x00000004, 0x0000000a, 0x0000000c, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x0001000b, 0x0001000b, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000017, 0x00000018, 0x00000019, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x000cffff, 0x000bffff, 0x000affff, 0x00000023, 0x00000024, 0x00000025, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x001dffff, 0x0000002c, 0x0000002d, 0x00000031, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, }, - {0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, - {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, - {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, - {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, - {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, - {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, - {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, -}; - -const unsigned int c_aaiCQMFHuffEnc23[93][2] = -{ - {0x0005, 0x0004}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, - {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, - {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, - {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, - {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000b, 0x0003}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0004}, - {0x000c, 0x0005}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x0010, 0x0014}, {0x000f, 0x000b}, - {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x000f, 0x000f}, {0x0011, 0x0002}, {0x0011, 0x0003}, - {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, - {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, - {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, - {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, - {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0010, 0x0015}, - -}; - -const unsigned int c_aaiCQMFHuffDec23[35][16] = -{ - {0x0006ffff, 0x0007ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x000affff, 0x0008ffff, 0x0009ffff, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x000effff, 0x000dffff, 0x000bffff, 0x000cffff, 0x00000027, 0x00000028, 0x00010023, 0x00010023, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000002e, 0x0000005c, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010035, 0x00010035, }, - {0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, }, - {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, - {0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, - {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, - {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, - {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, - {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, - {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, - {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, }, - {0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, -}; - -const unsigned int c_aaiCQMFHuffEnc24[121][2] = -{ - {0x0006, 0x0005}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, - {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, - {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, - {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0004}, {0x0007, 0x0005}, - {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, - {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, - {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000d, 0x0004}, - {0x000c, 0x0007}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, - {0x0010, 0x000f}, {0x000f, 0x000c}, {0x0011, 0x0016}, {0x0010, 0x0010}, {0x000f, 0x000d}, {0x0010, 0x0011}, {0x0012, 0x0000}, {0x0011, 0x0017}, - {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, - {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, - {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, - {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, - {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, - {0x0012, 0x0029}, {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, - {0x0011, 0x001d}, - -}; - -const unsigned int c_aaiCQMFHuffDec24[37][16] = -{ - {0x000dffff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000001, 0x00000002, 0x00000003, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x0011ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, }, - {0x0015ffff, 0x0014ffff, 0x0012ffff, 0x0013ffff, 0x00000034, 0x00000035, 0x00000036, 0x00000038, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x00000043, 0x00000045, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010044, 0x00010044, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, }, - {0x0024ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x00000040, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, }, - {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, }, - {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, - {0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, }, - {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, - {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, - {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, - {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, - {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, - {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, }, - {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, - {0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, }, - {0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, -}; - -const unsigned int c_aaiCQMFHuffEnc25[136][2] = -{ - {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, - {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, - {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0007}, {0x0006, 0x0008}, - {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, - {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, - {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, - {0x0008, 0x0009}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0004}, {0x000a, 0x0005}, - {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0005}, - {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, - {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000f, 0x0010}, {0x000e, 0x000b}, {0x000f, 0x0011}, {0x0010, 0x001b}, {0x0010, 0x001c}, {0x0010, 0x001d}, - {0x0010, 0x001e}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0011, 0x0006}, - {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0010, 0x001f}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0011, 0x000d}, - {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, - {0x0011, 0x0016}, {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, - {0x0011, 0x001e}, {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, {0x0011, 0x0024}, {0x0011, 0x0025}, - {0x0011, 0x0026}, {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0011, 0x002a}, {0x0011, 0x002b}, {0x0011, 0x002c}, {0x0011, 0x002d}, - {0x0011, 0x002e}, {0x0011, 0x002f}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0011, 0x0034}, {0x0011, 0x0035}, -}; - -const unsigned int c_aaiCQMFHuffDec25[54][16] = -{ - {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, - {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, - {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, }, - {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x001affff, 0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x0001004a, 0x0001004a, 0x0001004c, 0x0001004c, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, - {0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x0000005a, }, - {0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, }, - {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, - {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, - {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, - {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, - {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, - {0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, - {0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, }, - {0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, - {0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, - {0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030064, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, - {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, - {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, - {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, - {0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, - {0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, }, - {0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, }, - {0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, - {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, }, - {0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, }, - {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, }, - {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, - {0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, }, - {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, }, - {0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, - {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, }, - {0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030084, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, }, - {0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030086, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, }, -}; - -const unsigned int c_aaiCQMFHuffEnc26[164][2] = -{ - {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, - {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, - {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0005, 0x001f}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, - {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, - {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, - {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, - {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0005}, {0x000a, 0x0006}, - {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, - {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, - {0x000d, 0x0008}, {0x000e, 0x0006}, {0x000d, 0x0009}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0008}, {0x000f, 0x0009}, - {0x000f, 0x000a}, {0x0011, 0x0014}, {0x0010, 0x000b}, {0x000f, 0x000b}, {0x0010, 0x000c}, {0x0012, 0x001b}, {0x0010, 0x000d}, {0x0010, 0x000e}, - {0x0011, 0x0015}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0010, 0x000f}, {0x0012, 0x001e}, {0x0013, 0x0000}, {0x0012, 0x001f}, {0x0013, 0x0001}, - {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0012, 0x0020}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, - {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, - {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, - {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, - {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, - {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, - {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, - {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, - -}; - -const unsigned int c_aaiCQMFHuffDec26[38][16] = -{ - {0x000fffff, 0x0010ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, }, - {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, - {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, - {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, - {0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, - {0x001affff, 0x0019ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, }, - {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, - {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, - {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x0001005b, 0x0001005b, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, - {0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x001dffff, 0x001cffff, 0x001effff, 0x001fffff, 0x001bffff, 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005f, 0x00000063, }, - {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, - {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, - {0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, }, - {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, }, - {0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, }, - {0x00010065, 0x00010065, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, }, - {0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, }, - {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, }, - {0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, }, - {0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, }, - {0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, }, -}; - -extern const unsigned int (*GetHuffEncTable(const int iAlloc))[2]; - -extern const unsigned int (*GetHuffDecTable(const int iAlloc))[16]; - diff --git a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h b/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h deleted file mode 100644 index b8103689fe..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/CQMFHuff.h +++ /dev/null @@ -1,305 +0,0 @@ -#ifndef _CQMF_HUFF_H_ -#define _CQMF_HUFF_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef HUFF_READ_SIZE -#define HUFF_READ_SIZE (4) -#endif - -#ifndef HUFF_DEC_TABLE_SIZE -#define HUFF_DEC_TABLE_SIZE (16) -#endif - -#include // For NULL - -extern const unsigned int c_aaiCQMFHuffEnc1[16][2]; - -extern const unsigned int c_aaiCQMFHuffDec1[4][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc2[25][2]; - -extern const unsigned int c_aaiCQMFHuffDec2[4][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc3[36][2]; - -extern const unsigned int c_aaiCQMFHuffDec3[14][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc4[49][2]; - -extern const unsigned int c_aaiCQMFHuffDec4[9][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc5[64][2]; - -extern const unsigned int c_aaiCQMFHuffDec5[27][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc6[81][2]; - -extern const unsigned int c_aaiCQMFHuffDec6[21][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc7[81][2]; - -extern const unsigned int c_aaiCQMFHuffDec7[23][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc8[121][2]; - -extern const unsigned int c_aaiCQMFHuffDec8[17][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc9[196][2]; - -extern const unsigned int c_aaiCQMFHuffDec9[30][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc10[196][2]; - -extern const unsigned int c_aaiCQMFHuffDec10[34][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc11[256][2]; - -extern const unsigned int c_aaiCQMFHuffDec11[43][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc12[400][2]; - -extern const unsigned int c_aaiCQMFHuffDec12[44][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc13[625][2]; - -extern const unsigned int c_aaiCQMFHuffDec13[98][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc14[625][2]; - -extern const unsigned int c_aaiCQMFHuffDec14[103][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc15[28][2]; - -extern const unsigned int c_aaiCQMFHuffDec15[10][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc16[32][2]; - -extern const unsigned int c_aaiCQMFHuffDec16[11][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc17[41][2]; - -extern const unsigned int c_aaiCQMFHuffDec17[7][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc18[40][2]; - -extern const unsigned int c_aaiCQMFHuffDec18[7][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc19[47][2]; - -extern const unsigned int c_aaiCQMFHuffDec19[10][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc20[58][2]; - -extern const unsigned int c_aaiCQMFHuffDec20[17][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc21[70][2]; - -extern const unsigned int c_aaiCQMFHuffDec21[23][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc22[81][2]; - -extern const unsigned int c_aaiCQMFHuffDec22[30][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc23[93][2]; - -extern const unsigned int c_aaiCQMFHuffDec23[35][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc24[121][2]; - -extern const unsigned int c_aaiCQMFHuffDec24[37][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc25[136][2]; - -extern const unsigned int c_aaiCQMFHuffDec25[54][HUFF_DEC_TABLE_SIZE]; - -extern const unsigned int c_aaiCQMFHuffEnc26[164][2]; - -extern const unsigned int c_aaiCQMFHuffDec26[38][HUFF_DEC_TABLE_SIZE]; - -inline const unsigned int (*GetHuffEncTable(const int iAlloc))[2] -{ - const unsigned int (*pauiHuffmanTable)[2] = NULL; - - switch(iAlloc){ - case 1: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc1; - break; - case 2: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc2; - break; - case 3: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc3; - break; - case 4: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc4; - break; - case 5: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc5; - break; - case 6: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc6; - break; - case 7: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc7; - break; - case 8: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc8; - break; - case 9: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc9; - break; - case 10: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc10; - break; - case 11: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc11; - break; - case 12: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc12; - break; - case 13: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc13; - break; - case 14: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc14; - break; - case 15: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc15; - break; - case 16: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc16; - break; - case 17: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc17; - break; - case 18: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc18; - break; - case 19: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc19; - break; - case 20: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc20; - break; - case 21: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc21; - break; - case 22: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc22; - break; - case 23: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc23; - break; - case 24: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc24; - break; - case 25: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc25; - break; - case 26: - pauiHuffmanTable = (unsigned int (*)[2])c_aaiCQMFHuffEnc26; - break; - - } - - return pauiHuffmanTable; -} - -inline const unsigned int (*GetHuffDecTable(const int iAlloc))[16] -{ - const unsigned int (*pauiHuffmanTable)[16] = NULL; - - switch(iAlloc){ - case 1: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec1; - break; - case 2: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec2; - break; - case 3: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec3; - break; - case 4: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec4; - break; - case 5: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec5; - break; - case 6: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec6; - break; - case 7: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec7; - break; - case 8: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec8; - break; - case 9: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec9; - break; - case 10: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec10; - break; - case 11: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec11; - break; - case 12: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec12; - break; - case 13: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec13; - break; - case 14: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec14; - break; - case 15: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec15; - break; - case 16: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec16; - break; - case 17: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec17; - break; - case 18: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec18; - break; - case 19: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec19; - break; - case 20: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec20; - break; - case 21: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec21; - break; - case 22: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec22; - break; - case 23: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec23; - break; - case 24: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec24; - break; - case 25: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec25; - break; - case 26: - pauiHuffmanTable = (unsigned int (*)[16])c_aaiCQMFHuffDec26; - break; - - } - - return pauiHuffmanTable; -} - -#ifdef __cplusplus -} -#endif - -#endif /* _CQMF_HUFF_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c deleted file mode 100644 index e2f7ea62b1..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "NoiseGen.h" -#include -#include -#include -#include "wmops.h" - -NoiseGen* CreateNoiseGen() -{ - int n; - - NoiseGen *psNoiseGen = NULL; - - psNoiseGen = (NoiseGen*)malloc(sizeof(NoiseGen)); - psNoiseGen->iNoiseBufferLength = 2048; - psNoiseGen->iNoiseBufferMask = 2047; - psNoiseGen->iNoiseBufferIndex = 0; - - psNoiseGen->pfNoiseBuffer = (float*)malloc(psNoiseGen->iNoiseBufferLength * sizeof(float)); - - /* Generate Laplacian distributed noise */ - for(n = 0; n < psNoiseGen->iNoiseBufferLength; n ++){ - float fNoise = 0.0; - float fScale = 0.707f; - fNoise = (float)((rand() & (RAND_MAX - 1)) - (RAND_MAX >> 1)) / (float)RAND_MAX; - - if(fNoise < 0.0){ - fNoise = fScale * logf(1.0f + 1.9999999f * fNoise); - } - else{ - fNoise = -fScale * logf(1.0f - 1.9999999f * fNoise); - } - - psNoiseGen->pfNoiseBuffer[n] = fNoise; - } - - return psNoiseGen; -} - -void DeleteNoiseGen(NoiseGen *psNoiseGen) -{ - free(psNoiseGen->pfNoiseBuffer); - free(psNoiseGen); -} - -extern float GetNoise(NoiseGen *psNoiseGen); - - diff --git a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h b/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h deleted file mode 100644 index 1a4ccb924c..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/NoiseGen.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _NOISE_GEN_H_ -#define _NOISE_GEN_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct NOISE_GEN{ - int iNoiseBufferLength; - int iNoiseBufferMask; - int iNoiseBufferIndex; - float *pfNoiseBuffer; -}NoiseGen; - -NoiseGen* CreateNoiseGen(); - -void DeleteNoiseGen(NoiseGen *psNoiseGen); - -inline float GetNoise(NoiseGen *psNoiseGen) -{ - float fNoiseSample; - - fNoiseSample = psNoiseGen->pfNoiseBuffer[psNoiseGen->iNoiseBufferIndex]; - psNoiseGen->iNoiseBufferIndex ++; - psNoiseGen->iNoiseBufferIndex &= psNoiseGen->iNoiseBufferMask; - - return fNoiseSample; -} - -#ifdef __cplusplus -} -#endif - -#endif /* _NOISE_GEN_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h b/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h deleted file mode 100644 index e9d62c8106..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/PerceptualModel.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _PERCEPTUAL_MODEL_H_ -#define _PERCEPTUAL_MODEL_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -void PerceptualModel(const int iMaxQuantBands, - const int *piRMSEnvelope, - int *piExcitation, - int *piSMR); - -#ifdef __cplusplus -} -#endif - -#endif /* _PERCEPTUAL_MODEL_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h b/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h deleted file mode 100644 index e7e1059384..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/RMSEnvDeltaHuff.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _RMS_ENV_DELTA_HUFF_H_ -#define _RMS_ENV_DELTA_HUFF_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef HUFF_READ_SIZE -#define HUFF_READ_SIZE (4) -#endif - -#ifndef HUFF_DEC_TABLE_SIZE -#define HUFF_DEC_TABLE_SIZE (16) -#endif - -extern const unsigned int c_aaiRMSEnvHuffEnc[64][2]; - -extern const unsigned int c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; - -#ifdef __cplusplus -} -#endif - -#endif /* _RMS_ENV_DELTA_HUFF_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c deleted file mode 100644 index f51051d52d..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.c +++ /dev/null @@ -1,378 +0,0 @@ -#include "RMSEnvGrouping.h" - -/* Double check cost function calculation */ - -#include -#include -#include -#include -#include "wmops.h" -#include "Tables.h" - -typedef struct GMNODE{ - int iGroupStart; - int iGroupLength; - float *pfMergedEnergydB; - struct GMNODE *psNext; -}GMNode; - -typedef struct RMS_ENVELOPE_GROUPING -{ - int iNumBlocks; - int iMaxGroups; - float **ppfBandEnergy; - float **ppfBandEnergydB; - float **ppfWeight; - GMNode *psGMNodes; -}RMSEnvelopeGrouping; - -RMSEnvelopeGrouping* CreateRMSEnvelopeGrouping(int iNumBlocks) -{ - int n; - assert((iNumBlocks & 0x1) == 0); // remove this - - RMSEnvelopeGrouping *psRMSEnvelopeGrouping; - - psRMSEnvelopeGrouping = (RMSEnvelopeGrouping*)malloc(sizeof(RMSEnvelopeGrouping)); - psRMSEnvelopeGrouping->iNumBlocks = iNumBlocks; - psRMSEnvelopeGrouping->iMaxGroups = iNumBlocks >> 1; // Change this - - psRMSEnvelopeGrouping->ppfBandEnergy = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); - psRMSEnvelopeGrouping->ppfBandEnergydB = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); - psRMSEnvelopeGrouping->ppfWeight = (float**)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(float*)); - for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - psRMSEnvelopeGrouping->ppfBandEnergy[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); /* 2 for stereo joint group calc */ - psRMSEnvelopeGrouping->ppfBandEnergydB[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); - psRMSEnvelopeGrouping->ppfWeight[n] = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); - } - - psRMSEnvelopeGrouping->psGMNodes = (GMNode*)malloc(psRMSEnvelopeGrouping->iNumBlocks * sizeof(GMNode)); - for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB = (float*)malloc(MAX_BANDS * 2 * sizeof(float)); - } - - return psRMSEnvelopeGrouping; -} - -void DeleteRMSEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping) -{ - int n; - - for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - free(psRMSEnvelopeGrouping->ppfBandEnergy[n]); - free(psRMSEnvelopeGrouping->ppfBandEnergydB[n]); - free(psRMSEnvelopeGrouping->ppfWeight[n]); - } - free(psRMSEnvelopeGrouping->ppfBandEnergy); - free(psRMSEnvelopeGrouping->ppfBandEnergydB); - free(psRMSEnvelopeGrouping->ppfWeight); - - for(n = 0; n < psRMSEnvelopeGrouping->iNumBlocks; n ++){ - free(psRMSEnvelopeGrouping->psGMNodes[n].pfMergedEnergydB); - } - free(psRMSEnvelopeGrouping->psGMNodes); - - free(psRMSEnvelopeGrouping); -} - - -void ComputeBandEnergy(const int iChannels, - const int iNumBlocks, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - float **ppfBandEnergy, - float **ppfBandEnergydB, - float **ppfWeight) -{ - int n; - - for(n = 0; n < iChannels; n ++){ - int k; - int iChanOffset; - - iChanOffset = n * iNumBands; - for(k = 0; k < iNumBlocks; k ++){ - int b; - int iFBOffset; - iFBOffset = 0; - for(b = 0; b < iNumBands; b ++){ - int m; - float fEnergy = 1e-12f; - //float fWeight; - - for(m = 0; m < piBandwidths[b]; m ++){ - fEnergy += (pppfReal[n][k][iFBOffset] * pppfReal[n][k][iFBOffset] + pppfImag[n][k][iFBOffset] * pppfImag[n][k][iFBOffset]); - iFBOffset ++; - } - fEnergy /= (float)(2 * piBandwidths[b]); - ppfBandEnergy[k][iChanOffset + b] = fEnergy; - ppfBandEnergydB[k][iChanOffset + b] = 10.0f * log10f(fEnergy); - - ppfWeight[k][iChanOffset + b] = 1.0; - } - } - } -} - -/* THis is temporary cost function */ -float TryMerge(const int iNumBands, - const int iStartBlock, - const int iGroupLength, - const float fMaxAllowedDiffdB, - const float **ppfBandEnergy, - const float **ppfBandEnergydB, - float *pfMegredEnergydB) -{ - int b; - int n; - float fMeanCost; - float fMaxCost; - float fInvGroupSize = 1.0f / (float)iGroupLength; - float fInvNumBands = 1.0f / (float)iNumBands; - - for(b = 0; b < iNumBands; b ++){ - float fGroupEnergy; - - - fGroupEnergy = 0.0; - for(n = iStartBlock; n < (iStartBlock + iGroupLength); n ++){ - fGroupEnergy += ppfBandEnergy[n][b]; - } - fGroupEnergy *= fInvGroupSize; - fGroupEnergy = 10.0f * log10f(fGroupEnergy); //Note epsolon was added when computing BandEnergy; - - pfMegredEnergydB[b] = fGroupEnergy; - } - - fMeanCost = 0.0; - fMaxCost = 0.0; - for(n = iStartBlock; n < (iStartBlock + iGroupLength); n ++){ - float fMeanAbsDiff; - float fMaxAbsDiff; - - fMeanAbsDiff = 0.0; - fMaxAbsDiff = 0.0; - for(b = 0; b < iNumBands; b ++){ - float fAbsDiff; - - fAbsDiff = fabsf(ppfBandEnergydB[n][b] - pfMegredEnergydB[b]); - fMeanAbsDiff += fAbsDiff; - fMaxAbsDiff = (fMaxAbsDiff > fAbsDiff) ? fMaxAbsDiff : fAbsDiff; - } - fMeanAbsDiff *= fInvNumBands; - - fMeanCost = (fMeanCost > fMeanAbsDiff) ? fMeanCost : fMeanAbsDiff; - fMaxCost = (fMaxCost > fMaxAbsDiff) ? fMaxCost : fMaxAbsDiff; - } - - //printf("%f\t%f\n",fMeanCost,fMaxCost); - - if(fMaxCost > fMaxAllowedDiffdB){ - fMeanCost = 1e12f; //Some large value - } - - return fMeanCost; -} - -void ComputeGreedyGroups(RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int iChannels, - const int iNumBands, - const float fMeanAllowedDiffdB, - const float fMaxAllowedDiffdB) -{ - float fBestMeanCost; - - fBestMeanCost = 0.0; - while(fBestMeanCost < fMeanAllowedDiffdB){ - GMNode *psGMNode; - GMNode *psBestGMNode; - - fBestMeanCost = fMeanAllowedDiffdB; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - psBestGMNode = NULL; - while(psGMNode->psNext != NULL){ - float fMeanCost; - int iGroupLength; - - iGroupLength = psGMNode->iGroupLength + psGMNode->psNext->iGroupLength; - - fMeanCost = TryMerge(iNumBands * iChannels, - psGMNode->iGroupStart, - psGMNode->iGroupLength, - fMaxAllowedDiffdB, - (const float**)psRMSEnvelopeGrouping->ppfBandEnergy, - (const float**)psRMSEnvelopeGrouping->ppfBandEnergydB, - psGMNode->pfMergedEnergydB); - - - if(fMeanCost < fBestMeanCost){ - fBestMeanCost = fMeanCost; - psBestGMNode = psGMNode; - } - - psGMNode = psGMNode->psNext; - } - - if(fBestMeanCost < fMeanAllowedDiffdB && psBestGMNode != NULL && psBestGMNode->psNext != NULL){ - psBestGMNode->iGroupLength += psBestGMNode->psNext->iGroupLength; - psBestGMNode->psNext = psBestGMNode->psNext->psNext; - } - } -} - - -void ComputeRMSEnvelope(const int iChannels, - const int iNumBands, - const int iNumGroups, - const int *piGroupLengths, - const float **ppfBandEnergy, - int ***pppiRMSEnvelope) -{ - int n; - - for(n = 0; n < iChannels; n ++){ - int b; - int iChanOffset; - - iChanOffset = n * iNumBands; - for(b = 0; b < iNumBands; b ++){ - int k; - int iBlockOffset; - - iBlockOffset = 0; - for(k = 0; k < iNumGroups; k ++){ - int m; - float fGroupEnergy; - fGroupEnergy = 0.0; - for(m = 0; m < piGroupLengths[k]; m ++){ - fGroupEnergy += ppfBandEnergy[iBlockOffset][b + iChanOffset]; - iBlockOffset ++; - } - fGroupEnergy /= (float)piGroupLengths[k]; - - pppiRMSEnvelope[n][k][b] = (int)(log2f(fGroupEnergy) + 0.5); - pppiRMSEnvelope[n][k][b] = (pppiRMSEnvelope[n][k][b] > ENV_MIN) ? pppiRMSEnvelope[n][k][b] : ENV_MIN; - pppiRMSEnvelope[n][k][b] = (pppiRMSEnvelope[n][k][b] < ENV_MAX) ? pppiRMSEnvelope[n][k][b] : ENV_MAX; - } - } - } -} - -void LimitRMSEnvelope(const int iBandCount, - const int iRMSDeltaMax, - const int iRMSDeltaMin, - int *piRMSEnvelope) -{ - int iBand; - int iLastSCF; - - /* Increase low envelope values to ensure that the scale factors traces the large values correctly (checking for max deltas) */ - iLastSCF = piRMSEnvelope[iBandCount - 1]; - for(iBand = iBandCount - 2; iBand > -1; iBand --) - { - int iDelta; - - iDelta = iLastSCF - piRMSEnvelope[iBand]; - - if(iDelta > iRMSDeltaMax){ -#ifdef DEBUG_VERBOSE - printf("WARNING ScaleFactor Delta limited\n"); -#endif - piRMSEnvelope[iBand] += (iDelta - iRMSDeltaMax); - } - - iLastSCF = piRMSEnvelope[iBand]; - } - - /* Increase low envelope values to ensure that the envelope traces the large values correctly (checking for min deltas)*/ - iLastSCF = piRMSEnvelope[0]; - for(iBand = 1; iBand < iBandCount; iBand ++){ - int iDelta; - - iDelta = piRMSEnvelope[iBand] - iLastSCF; - - if(iDelta < iRMSDeltaMin){ -#ifdef DEBUG_VERBOSE - printf("WARNING ScaleFactor Delta limited\n"); -#endif - piRMSEnvelope[iBand] += (iRMSDeltaMin - iDelta); - } - - iLastSCF = piRMSEnvelope[iBand]; - } -} - -void ComputeEnvelopeGrouping( RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int iChannels, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const float fMeanAllowedDiffdB, - const float fMaxAllowedDiffdB, - int *piNumGroups, - int *piGroupLengths, - int ***pppiRMSEnvelope) -{ - int n; - GMNode *psGMNode; - - /* Compute Band Energies */ - ComputeBandEnergy(iChannels, - psRMSEnvelopeGrouping->iNumBlocks, - iNumBands, - piBandwidths, - pppfReal, - pppfImag, - psRMSEnvelopeGrouping->ppfBandEnergy, - psRMSEnvelopeGrouping->ppfBandEnergydB, - psRMSEnvelopeGrouping->ppfWeight); - - /* Init GMNodes */ - psRMSEnvelopeGrouping->psGMNodes[0].iGroupStart = 0; - psRMSEnvelopeGrouping->psGMNodes[0].iGroupLength = 2; - psRMSEnvelopeGrouping->psGMNodes[0].psNext = NULL; - for(n = 1; n < psRMSEnvelopeGrouping->iMaxGroups; n ++){ - psRMSEnvelopeGrouping->psGMNodes[n - 1].psNext = &psRMSEnvelopeGrouping->psGMNodes[n]; - psRMSEnvelopeGrouping->psGMNodes[n].iGroupStart = n * 2; // change this - psRMSEnvelopeGrouping->psGMNodes[n].iGroupLength = 2; // change this - psRMSEnvelopeGrouping->psGMNodes[n].psNext = NULL; - } - - /* Perform grouping via Greedy Merge */ - ComputeGreedyGroups(psRMSEnvelopeGrouping, - iChannels, - iNumBands, - fMeanAllowedDiffdB, - fMaxAllowedDiffdB); - - /* Calc Groups from Merge Results */ - *piNumGroups = 0; - psGMNode = &psRMSEnvelopeGrouping->psGMNodes[0]; - while(psGMNode != NULL){ - piGroupLengths[*piNumGroups] = psGMNode->iGroupLength; - *piNumGroups += 1; - psGMNode = psGMNode->psNext; - } - - /* Compute RMS Envelope given group lengths */ - ComputeRMSEnvelope(iChannels, - iNumBands, - *piNumGroups, - piGroupLengths, - (const float**)psRMSEnvelopeGrouping->ppfBandEnergy, - pppiRMSEnvelope); - - /* Envelope Tenting */ - for(n = 0; n < iChannels; n ++){ - int k; - for(k = 0; k < *piNumGroups; k ++){ - LimitRMSEnvelope(iNumBands, - ENV_DELTA_MAX, - ENV_DELTA_MIN, - pppiRMSEnvelope[n][k]); - } - } -} diff --git a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h b/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h deleted file mode 100644 index fa7506935f..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/RMSEnvGrouping.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _RMS_ENV_GROUPING_H_ -#define _RMS_ENV_GROUPING_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct RMS_ENVELOPE_GROUPING RMSEnvelopeGrouping; - -RMSEnvelopeGrouping* CreateRMSEnvelopeGrouping(int iNumBlocks); - -void DeleteRMSEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping); - -void ComputeEnvelopeGrouping(RMSEnvelopeGrouping *psRMSEnvelopeGrouping, - const int iChannels, - const int iNumBands, - const int *piBandwidths, - const float ***pppfReal, - const float ***pppfImag, - const float fMeanAllowedDiffdB, - const float fMaxAllowedDiffdB, - int *piNumGroups, - int *piGroupLengths, - int ***pppiRMSEnvelope); - -#ifdef __cplusplus -} -#endif - -#endif /* _RMS_ENV_GROUPING_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/Tables.c b/lib_rend/ivas_cldfb_trans_codec/Tables.c deleted file mode 100644 index 735c8d21f2..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/Tables.c +++ /dev/null @@ -1,116 +0,0 @@ -#include "Tables.h" -#include "wmops.h" - -/* Move this to perceptual model ? */ -const int c_aiBandwidths48[MAX_BANDS_48] = { - 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, -}; - - -const float c_afScaleFactor[ALLOC_TABLE_SIZE] = { - 0.0f, - 0.353553390593f, - 0.420448207627f, - 0.500000000000f, - 0.594603557501f, - 0.707106781187f, - 0.840896415254f, - 1.000000000000f, - 1.189207115003f, - 1.414213562373f, - 1.681792830507f, - 2.000000000000f, - 2.378414230005f, - 2.828427124746f, - 3.363585661015f, - 4.0f, - 4.756828460011f, - 5.656854249492f, - 6.727171322030f, - 8.0f, - 9.513656920022f, - 11.31370849898f, - 13.45434264406f, - 16.00000000000f, - 19.02731384004f, - 22.62741699797f, - 26.90868528812f, //~40dB SNR -}; - -const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { - 0.0f, - 2.367513562373095f, - 2.046407115002721f, - 1.775900000000000f, - 1.536446415253715f, - 1.323056781186548f, - 1.132903557501360f, - 0.965800000000000f, - 0.821348207626857f, - 0.695103390593274f, - 0.587801778750680f, - 0.495800000000000f, - 0.418124103813429f, - 0.352176695296637f, - 0.296200889375340f, - 0.249400000000000f, - 0.209812051906714f, - 0.176538347648318f, - 0.148525444687670f, - 0.124900000000000f, - 0.105056025953357f, - 0.088388347648318f, - 0.074325444687670f, - 0.062500000000000f, - 0.052556025953357f, - 0.044194173824159f, - 0.037162722343835f, -}; - -const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { - 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, - 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, - 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, - 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, - 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, - 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, - 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, - 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, - 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, - 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, - 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, - 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, - 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, - 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, - 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, - 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, - 4.29496730e+09f, -}; - -const int c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { - 0, 3, 4, 5, 6, 7, 8, 8, - 10, 13, 13, 15, 19, 24, 24, 27, - 31, 40, 39, 46, 57, 69, 80, 92, - 120, 135, 163, -}; - -const int c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, -}; - -const int c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { - 0, 4, 5, 6, 7, 8, 9, 9, - 11, 14, 14, 16, 20, 25, 25, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, -}; - -const int c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { - 1, 16, 25, 36, 49, 64, 81, 81, - 121, 196, 196, 256, 400, 625, 625, 28, - 32, 41, 40, 47, 58, 70, 81, 93, - 121, 136, 164, -}; diff --git a/lib_rend/ivas_cldfb_trans_codec/Tables.h b/lib_rend/ivas_cldfb_trans_codec/Tables.h deleted file mode 100644 index 960ee0d231..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/Tables.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _TABLES_H_ -#define _TABLES_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define DEBUG_VERBOSE - -#define CQMF_BLOCKS_PER_FRAME (16) -#define CQMF_MAX_BLOCKS_PER_FRAME (16) -#define CQMF_BANDS (60) - -#define MAX_BANDS (23) -#define MAX_BANDS_48 (23) - -extern const int c_aiBandwidths48[MAX_BANDS_48]; // move this - - -#define ENV_MIN (-64) -#define ENV_MAX (64) - -#define ENV0_BITS (7) - -#define ENV_DELTA_MIN (-32) -#define ENV_DELTA_MAX (31) - -#define ENV_RECONSTRUCT_TABLE_SIZE (129) - -#define ENV_RECONSTRUCT_TABLE_CENTER (64) - -#define MIN_ALLOC (0) -#define MAX_ALLOC (26) - -#define ALLOC_OFFSET_SCALE (8) - -#define ALLOC_OFFSET_BITS (8) - -#define MIN_ALLOC_OFFSET (-128) -#define MAX_ALLOC_OFFSET (127) - - - -#define ALLOC_TABLE_SIZE (27) - -extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; - -extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; - -extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; - -extern const int c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; - -extern const int c_aiHuffmanDim[ALLOC_TABLE_SIZE]; - -extern const int c_aiHuffmanMod[ALLOC_TABLE_SIZE]; - -extern const int c_aiHuffmanSize[ALLOC_TABLE_SIZE]; - -#ifdef __cplusplus -} -#endif - -#endif /* _TABLES_H_ */ diff --git a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c deleted file mode 100644 index 4317e0ec12..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.c +++ /dev/null @@ -1,226 +0,0 @@ -#include "cldfb_codec_bitstream.h" - -#include -#include -#include "wmops.h" - -#define MAX_BUFFER 1024 - -static const unsigned int MASKS[] = -{ - 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, - 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, - 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, - 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -}; - -Bitstream* CreateBitstream(const int iDirection, - const int iMaxBuffer) - -{ - - int n; - Bitstream *psBitstream; - - psBitstream = (Bitstream*)malloc(sizeof(Bitstream)); - - psBitstream->iDirection =iDirection; - psBitstream->iMaxBuffer = iMaxBuffer; - psBitstream->iIndex = 0; - psBitstream->iBufferEnd = 0; - psBitstream->iBufferStart = 0; - psBitstream->iError = BS_ERROR_NONE; - - if(psBitstream->iMaxBuffer == -1){ - psBitstream->iMaxBuffer = MAX_BUFFER; - } - - psBitstream->puchBuffer = (unsigned char*)malloc(sizeof(unsigned char) * psBitstream->iMaxBuffer); - - for(n = 0; n < psBitstream->iMaxBuffer; n ++){ - psBitstream->puchBuffer[n] = 0; - } - - return psBitstream; -} - -void DeleteBitstream(Bitstream *psBitstream) -{ - free(psBitstream->puchBuffer); - free(psBitstream); -} - -void BSFlushBuffer(Bitstream *psBitstream) -{ - memset(psBitstream->puchBuffer,0,psBitstream->iMaxBuffer); - psBitstream->iIndex = 0; - psBitstream->iBufferEnd = 0; - psBitstream->iBufferStart = 0; - psBitstream->iError = BS_ERROR_NONE; -} - -int BSPutBytes(Bitstream *psBitstream, - const unsigned char *puchBytes, - const int iByteCount) -{ - int n; - for(n = 0; n < iByteCount; n ++){ - psBitstream->puchBuffer[psBitstream->iBufferEnd] = puchBytes[n]; - psBitstream->iBufferEnd ++; - } - if(psBitstream->iDirection != BS_READ){ - psBitstream->iError = BS_ERROR_FAIL; - } - - return psBitstream->iError; -} - -int BSGetBytes(Bitstream *psBitstream, - unsigned char *puchBytes, - int iByteCount) -{ - int n; - for(n = 0; n < iByteCount; n++){ - puchBytes[n] = psBitstream->puchBuffer[psBitstream->iBufferStart]; - psBitstream->puchBuffer[psBitstream->iBufferStart] = 0; - psBitstream->iBufferStart ++; - } - if(psBitstream->iDirection != BS_WRITE){ - psBitstream->iError = BS_ERROR_FAIL; - } - - return psBitstream->iError; -} - -int BSByteAlign(Bitstream *psBitstream) -{ - if(psBitstream->iDirection == BS_WRITE){ - if(psBitstream->iIndex & 0x7){ - int iByte; - int iRem; - - iByte = psBitstream->iIndex >> 3; - iRem = 8 - (psBitstream->iIndex - (iByte<<3)); - psBitstream->puchBuffer[iByte] &= (0xff ^ MASKS[iRem]); - psBitstream->iIndex += iRem; - } - } - else{ - if(psBitstream->iIndex & 0x7){ - int iByte; - int iRem; - - iByte = psBitstream->iIndex >> 3; - iRem = 8 - (psBitstream->iIndex - (iByte<<3)); - psBitstream->iIndex += iRem; - } - } - - return psBitstream->iError; -} - -int BSPutBits(Bitstream *psBitstream, - int iValue, - int iBitCount) -{ - iValue &= MASKS[iBitCount]; - while(iBitCount){ - int iByte; - int iRem; - int iShift; - - iByte = psBitstream->iIndex >> 3; - iRem = 8 - (psBitstream->iIndex - (iByte<<3)); //8 - psBitstream->iIndex & 0x7; - - iShift = iBitCount-iRem; - if(iShift <= 0){ - iShift *= -1; - psBitstream->puchBuffer[iByte] += (unsigned char) (iValue<iIndex += iBitCount; - iBitCount = 0; - } - else{ - psBitstream->puchBuffer[iByte] += (unsigned char) (iValue>>iShift); - iValue &= MASKS[iShift]; - psBitstream->iIndex += iRem; - iBitCount -= iRem; - } - } - - if(psBitstream->iDirection != BS_WRITE){ - psBitstream->iError = BS_ERROR_FAIL; - } - - return psBitstream->iError; -} - -int BSGetBits(Bitstream *psBitstream, - int iBitCount) -{ - int iValue = 0; - - while(iBitCount){ - unsigned char uchByte; - int iByte; - int iRem; - int iShift; - - iByte = psBitstream->iIndex >> 3; - iRem = 8 - (psBitstream->iIndex - (iByte << 3)); //8 - psBitstream->iIndex & 0x7; - uchByte = psBitstream->puchBuffer[iByte]; - iShift = iBitCount - iRem; - - if(iShift <= 0){ - iShift *= -1; - iValue += (int)((uchByte >> iShift) & MASKS[iBitCount]); - psBitstream->iIndex += iBitCount; - iBitCount = 0; - } - else{ - uchByte &= MASKS[iRem]; - iValue += (((int)uchByte)<iIndex += iRem; - iBitCount -= iRem; - } - } - - if(psBitstream->iDirection != BS_READ){ - psBitstream->iError = BS_ERROR_FAIL; - } - - return iValue; -} - -int BSForceBack(Bitstream *psBitstream, - int iValue, - int iBitCount) -{ - psBitstream->iIndex -= iBitCount; - return (iValue>>iBitCount); -} - -int BSGetByteCount(Bitstream *psBitstream) -{ - int iBytes; - iBytes = psBitstream->iIndex>>3; - if((iBytes << 3) != psBitstream->iIndex){ - iBytes ++; - } - - return iBytes; -} - -unsigned char* BSGetBuffer(Bitstream *psBitstream) -{ - return psBitstream->puchBuffer; -} - -int BSGetAvailableBytes(Bitstream *psBitstream) -{ - return psBitstream->iBufferEnd; -} - -int BSGetError(Bitstream *psBitstream) -{ - return psBitstream->iError; -} diff --git a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h b/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h deleted file mode 100644 index a3e936e59b..0000000000 --- a/lib_rend/ivas_cldfb_trans_codec/cldfb_codec_bitstream.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _BITSTREAM_H_ -#define _BITSTREAM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum{BS_READ,BS_WRITE}; -enum{BS_ERROR_NONE,BS_ERROR_FAIL}; - -typedef struct BITSTREAM{ - int iMaxBuffer; - int iDirection; - int iBufferEnd; - int iBufferStart; - int iIndex; - int iError; - unsigned char *puchBuffer; -}Bitstream; - - -Bitstream* CreateBitstream(const int iDirection, - const int iMaxBuffer); - -void DeleteBitstream(Bitstream *psBitstream); - -void BSFlushBuffer(Bitstream *psBitstream); - -int BSPutBytes(Bitstream *psBitstream, - const unsigned char *puchBytes, - const int iByteCount); - -int BSGetBytes(Bitstream *psBitstream, - unsigned char *puchBytes, - int iByteCount); - -int BSByteAlign(Bitstream *psBitstream); - -int BSPutBits(Bitstream *psBitstream, - int iValue, - int iBitCount); - -int BSGetBits(Bitstream *psBitstream, - int iBitCount); - -int BSForceBack(Bitstream *psBitstream, - int iValue, - int iBitCount); - -unsigned char* BSGetBuffer(Bitstream *psBitstream); - -int BSGetByteCount(Bitstream *psBitstream); - -int BSGetAvailableBytes(Bitstream *psBitstream); - -int BSGetError(Bitstream *psBitstream); - -#ifdef __cplusplus -} -#endif - -#endif /* _BITSTREAM_H_ */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index f63d729dc7..0351af3320 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -168,7 +168,11 @@ ivas_error ivas_crend_init_from_rom( intern_config = st_ivas->intern_config; - if ( intern_config == AUDIO_CONFIG_BINAURAL || intern_config == AUDIO_CONFIG_BINAURAL_ROOM ) + if ( intern_config == AUDIO_CONFIG_BINAURAL || intern_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || intern_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { return IVAS_ERR_INTERNAL_FATAL; } @@ -1121,8 +1125,35 @@ ivas_error ivas_crend_process( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*------------------------------------------------------------------------- + * ivas_rend_openMultiBinCrend() + * + * Allocate and initialize crend renderer handle + *------------------------------------------------------------------------*/ +ivas_error ivas_rend_openMultiBinCrend( + CREND_WRAPPER *pCrend, + const IVAS_REND_AudioConfig inConfig, + const IVAS_REND_AudioConfig outConfig, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int32_t output_Fs ) +{ + int16_t pos_idx; + ivas_error error; + error = IVAS_ERR_OK; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, output_Fs, pos_idx ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + return error; +} +#endif /*------------------------------------------------------------------------- * ivas_rend_openCrend() * @@ -1134,7 +1165,12 @@ ivas_error ivas_rend_openCrend( const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, RENDER_CONFIG_DATA *hRendCfg, - const int32_t output_Fs ) + const int32_t output_Fs +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +) { /* TODO tmu : Based on ivas_crend_open() - could be harmonized / refactored */ int16_t i, subframe_length; @@ -1142,6 +1178,11 @@ ivas_error ivas_rend_openCrend( HRTFS_HANDLE hHrtf; CREND_HANDLE hCrend; ivas_error error; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hCrend = pCrend->hCrend[pos_idx]; +#else + hCrend = pCrend->hCrend; +#endif error = IVAS_ERR_OK; subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; @@ -1160,7 +1201,6 @@ ivas_error ivas_rend_openCrend( } hCrend->lfe_delay_line = NULL; - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { hCrend->freq_buffer_re[i] = NULL; @@ -1174,6 +1214,7 @@ ivas_error ivas_rend_openCrend( 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; @@ -1262,7 +1303,11 @@ ivas_error ivas_rend_openCrend( hCrend->hTrack = NULL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( hRendCfg != NULL ) && ( hRendCfg->roomAcoustics.late_reverb_on ) && ( pos_idx == 0 ) ) +#else if ( ( hRendCfg != NULL ) && ( hRendCfg->roomAcoustics.late_reverb_on ) ) +#endif { if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), getIvasAudioConfigFromRendAudioConfig( inConfig ), @@ -1281,7 +1326,12 @@ ivas_error ivas_rend_openCrend( pCrend->binaural_latency_ns = (int32_t) ( pCrend->hHrtfCrend->latency_s * 1000000000.f ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + pCrend->hCrend[pos_idx] = hCrend; +#else pCrend->hCrend = hCrend; +#endif + return IVAS_ERR_OK; } @@ -1313,7 +1363,11 @@ ivas_error ivas_rend_initCrend( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported input config in Crend" ); } - if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) + if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif + ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Encountered unsupported output type in Crend" ); } @@ -1679,71 +1733,87 @@ ivas_error ivas_rend_initCrend( *------------------------------------------------------------------------*/ ivas_error ivas_rend_closeCrend( - CREND_WRAPPER *pCrend ) + CREND_WRAPPER *pCrend +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + int16_t pos_idx +#endif +) { int16_t i; + CREND_HANDLE hCrend; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hCrend = pCrend->hCrend[pos_idx]; +#else + hCrend = pCrend->hCrend; +#endif if ( pCrend->hHrtfCrend != NULL ) { ivas_hrtf_close( &pCrend->hHrtfCrend ); } - if ( pCrend->hCrend != NULL ) + if ( hCrend != NULL ) { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { - if ( pCrend->hCrend->freq_buffer_re[i] != NULL ) + if ( hCrend->freq_buffer_re[i] != NULL ) { - count_free( pCrend->hCrend->freq_buffer_re[i] ); - pCrend->hCrend->freq_buffer_re[i] = NULL; + count_free( hCrend->freq_buffer_re[i] ); + hCrend->freq_buffer_re[i] = NULL; } - if ( pCrend->hCrend->freq_buffer_im[i] != NULL ) + if ( hCrend->freq_buffer_im[i] != NULL ) { - count_free( pCrend->hCrend->freq_buffer_im[i] ); - pCrend->hCrend->freq_buffer_im[i] = NULL; + count_free( hCrend->freq_buffer_im[i] ); + hCrend->freq_buffer_im[i] = NULL; } } for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { - if ( pCrend->hCrend->prev_out_buffer[i] != NULL ) + if ( hCrend->prev_out_buffer[i] != NULL ) { - count_free( pCrend->hCrend->prev_out_buffer[i] ); - pCrend->hCrend->prev_out_buffer[i] = NULL; + count_free( hCrend->prev_out_buffer[i] ); + hCrend->prev_out_buffer[i] = NULL; } } - if ( pCrend->hCrend->lfe_delay_line != NULL ) + if ( hCrend->lfe_delay_line != NULL ) { - count_free( pCrend->hCrend->lfe_delay_line ); - pCrend->hCrend->lfe_delay_line = NULL; + count_free( hCrend->lfe_delay_line ); + hCrend->lfe_delay_line = NULL; } - if ( pCrend->hCrend->freq_buffer_re_diffuse != NULL ) + if ( hCrend->freq_buffer_re_diffuse != NULL ) { - count_free( pCrend->hCrend->freq_buffer_re_diffuse ); - pCrend->hCrend->freq_buffer_re_diffuse = NULL; + count_free( hCrend->freq_buffer_re_diffuse ); + hCrend->freq_buffer_re_diffuse = NULL; } - if ( pCrend->hCrend->freq_buffer_im_diffuse != NULL ) + if ( hCrend->freq_buffer_im_diffuse != NULL ) { - count_free( pCrend->hCrend->freq_buffer_im_diffuse ); - pCrend->hCrend->freq_buffer_im_diffuse = NULL; + count_free( hCrend->freq_buffer_im_diffuse ); + hCrend->freq_buffer_im_diffuse = NULL; } - if ( pCrend->hCrend->hTrack != NULL ) + if ( hCrend->hTrack != NULL ) { - count_free( pCrend->hCrend->hTrack ); - pCrend->hCrend->hTrack = NULL; + count_free( hCrend->hTrack ); + hCrend->hTrack = NULL; } - ivas_reverb_close( &pCrend->hCrend->hReverb ); + ivas_reverb_close( &hCrend->hReverb ); - count_free( pCrend->hCrend ); - pCrend->hCrend = NULL; + count_free( hCrend ); + hCrend = NULL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + pCrend->hCrend[pos_idx] = hCrend; +#else + pCrend->hCrend = hCrend; +#endif + return IVAS_ERR_OK; } @@ -1758,7 +1828,12 @@ ivas_error ivas_rend_crendProcess( const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, float output[][L_FRAME48k], /* i/o: input/output audio channels */ - const int32_t output_Fs ) + const int32_t output_Fs +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +) { int16_t i, subframe_idx, output_frame; int16_t nchan_out; @@ -1766,6 +1841,12 @@ ivas_error ivas_rend_crendProcess( AUDIO_CONFIG in_config; IVAS_REND_AudioConfigType inConfigType; ivas_error error; + CREND_HANDLE hCrend; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hCrend = pCrend->hCrend[pos_idx]; +#else + hCrend = pCrend->hCrend; +#endif wmops_sub_start( "ivas_rend_crendProcess" ); @@ -1778,14 +1859,19 @@ ivas_error ivas_rend_crendProcess( { if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { - if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, output, pcm_tmp, output_Fs, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, output, pcm_tmp, output_Fs, subframe_idx +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + pos_idx +#endif + ) ) != IVAS_ERR_OK ) { return error; } - if ( pCrend->hCrend->hReverb != NULL ) + if ( hCrend->hReverb != NULL ) { - if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, in_config, 1, output, pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( hCrend->hReverb, in_config, 1, output, pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) { return error; } @@ -1821,7 +1907,12 @@ ivas_error ivas_rend_crendConvolver( float pcm_in[][L_FRAME48k], float pcm_out[][L_FRAME48k], const int32_t output_Fs, - const int16_t i_ts ) + const int16_t i_ts +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +) { int16_t i, j, k, m; int16_t subframe_length, idx_in; @@ -1833,6 +1924,12 @@ ivas_error ivas_rend_crendConvolver( float *pFreq_filt_re, *pFreq_filt_im; float pOut[L_FRAME48k * 2]; float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k]; + CREND_HANDLE hCrend; +#ifdef SPLIT_REND_WITH_HEAD_ROT + hCrend = pCrend->hCrend[pos_idx]; +#else + hCrend = pCrend->hCrend; +#endif getAudioConfigNumChannels( inConfig, &nchan_in ); getAudioConfigNumChannels( outConfig, &nchan_out ); @@ -1852,13 +1949,13 @@ ivas_error ivas_rend_crendConvolver( } } - offset = pCrend->hCrend->delay_line_rw_index * subframe_length; /* subframe_length * ( pCrend->hHrtfCrend->max_num_iterations - 1 ); */ - offset_diffuse = pCrend->hCrend->diffuse_delay_line_rw_index * subframe_length; /* subframe_length *( pCrend->hHrtfCrend->num_iterations_diffuse[0] - 1 ); */ + offset = hCrend->delay_line_rw_index * subframe_length; /* subframe_length * ( pCrend->hHrtfCrend->max_num_iterations - 1 ); */ + offset_diffuse = hCrend->diffuse_delay_line_rw_index * subframe_length; /* subframe_length *( pCrend->hHrtfCrend->num_iterations_diffuse[0] - 1 ); */ if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { - set_zero( &pCrend->hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); - set_zero( &pCrend->hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); + set_zero( &hCrend->freq_buffer_re_diffuse[offset_diffuse], subframe_length ); + set_zero( &hCrend->freq_buffer_im_diffuse[offset_diffuse], subframe_length ); } i = 0; @@ -1869,10 +1966,10 @@ ivas_error ivas_rend_crendConvolver( { if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { - pFreq_buf_re = &pCrend->hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &pCrend->hCrend->freq_buffer_im_diffuse[offset_diffuse]; - pFreq_filt_re = &pCrend->hCrend->freq_buffer_re[i][offset]; - pFreq_filt_im = &pCrend->hCrend->freq_buffer_im[i][offset]; + pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; + pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; + pFreq_filt_re = &hCrend->freq_buffer_re[i][offset]; + pFreq_filt_im = &hCrend->freq_buffer_im[i][offset]; for ( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ ) { @@ -1881,8 +1978,8 @@ ivas_error ivas_rend_crendConvolver( } } - pFreq_buf_re = &pCrend->hCrend->freq_buffer_re[i][offset]; - pFreq_buf_im = &pCrend->hCrend->freq_buffer_im[i][offset]; + pFreq_buf_re = &hCrend->freq_buffer_re[i][offset]; + pFreq_buf_im = &hCrend->freq_buffer_im[i][offset]; ivas_mdft( pIn, pFreq_buf_re, pFreq_buf_im, subframe_length, subframe_length ); i++; @@ -1902,11 +1999,11 @@ ivas_error ivas_rend_crendConvolver( offset = 0; for ( m = 0; m < pCrend->hHrtfCrend->num_iterations[i][j]; m++ ) { - offset_in = ( pCrend->hCrend->delay_line_rw_index + pCrend->hHrtfCrend->max_num_iterations - pCrend->hHrtfCrend->num_iterations[i][j] + m + 1 ); + offset_in = ( hCrend->delay_line_rw_index + pCrend->hHrtfCrend->max_num_iterations - pCrend->hHrtfCrend->num_iterations[i][j] + m + 1 ); offset_in = offset_in % ( pCrend->hHrtfCrend->max_num_iterations ); offset_in = offset_in * subframe_length; - pFreq_buf_re = &pCrend->hCrend->freq_buffer_re[i][offset_in]; - pFreq_buf_im = &pCrend->hCrend->freq_buffer_im[i][offset_in]; + pFreq_buf_re = &hCrend->freq_buffer_re[i][offset_in]; + pFreq_buf_im = &hCrend->freq_buffer_im[i][offset_in]; pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_re[i][j][offset]; pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_im[i][j][offset]; @@ -1924,11 +2021,11 @@ ivas_error ivas_rend_crendConvolver( offset = 0; for ( m = 0; m < pCrend->hHrtfCrend->num_iterations_diffuse[j]; m++ ) { - offset_diffuse = ( pCrend->hCrend->diffuse_delay_line_rw_index + m + 1 ); + offset_diffuse = ( hCrend->diffuse_delay_line_rw_index + m + 1 ); offset_diffuse = offset_diffuse % pCrend->hHrtfCrend->num_iterations_diffuse[0]; offset_diffuse = offset_diffuse * subframe_length; - pFreq_buf_re = &pCrend->hCrend->freq_buffer_re_diffuse[offset_diffuse]; - pFreq_buf_im = &pCrend->hCrend->freq_buffer_im_diffuse[offset_diffuse]; + pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[offset_diffuse]; + pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[offset_diffuse]; pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re[j][offset]; pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_im[j][offset]; @@ -1945,17 +2042,17 @@ ivas_error ivas_rend_crendConvolver( pFreq_buf_re = &pcm_out[j][i_ts * subframe_length]; for ( k = 0; k < subframe_length; k++ ) { - pFreq_buf_re[k] = pOut[k] + pCrend->hCrend->prev_out_buffer[j][k]; - pCrend->hCrend->prev_out_buffer[j][k] = pOut[k + subframe_length]; + pFreq_buf_re[k] = pOut[k] + hCrend->prev_out_buffer[j][k]; + hCrend->prev_out_buffer[j][k] = pOut[k + subframe_length]; } } - pCrend->hCrend->delay_line_rw_index++; - pCrend->hCrend->delay_line_rw_index = pCrend->hCrend->delay_line_rw_index % ( pCrend->hHrtfCrend->max_num_iterations ); + hCrend->delay_line_rw_index++; + hCrend->delay_line_rw_index = hCrend->delay_line_rw_index % ( pCrend->hHrtfCrend->max_num_iterations ); if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 ) { - pCrend->hCrend->diffuse_delay_line_rw_index++; - pCrend->hCrend->diffuse_delay_line_rw_index = pCrend->hCrend->diffuse_delay_line_rw_index % ( pCrend->hHrtfCrend->num_iterations_diffuse[0] ); + hCrend->diffuse_delay_line_rw_index++; + hCrend->diffuse_delay_line_rw_index = hCrend->diffuse_delay_line_rw_index % ( pCrend->hHrtfCrend->num_iterations_diffuse[0] ); } return IVAS_ERR_OK; diff --git a/lib_rend/ivas_lib_rend_internal.h b/lib_rend/ivas_lib_rend_internal.h index f985b662a0..d155b849b9 100644 --- a/lib_rend/ivas_lib_rend_internal.h +++ b/lib_rend/ivas_lib_rend_internal.h @@ -41,10 +41,10 @@ typedef struct { int8_t headRotEnabled; IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; + float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_QUATERNION headPositionsPostRend[RENDERER_HEAD_POSITIONS_PER_FRAME]; + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; #endif - float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; } IVAS_REND_HeadRotData; typedef struct @@ -57,7 +57,11 @@ typedef struct typedef struct { int32_t binaural_latency_ns; +#ifdef SPLIT_REND_WITH_HEAD_ROT + CREND_HANDLE hCrend[MAX_HEAD_ROT_POSES]; +#else CREND_HANDLE hCrend; +#endif HRTFS_HANDLE hHrtfCrend; } CREND_WRAPPER; @@ -79,21 +83,37 @@ ivas_error getAudioConfigNumChannels( AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( IVAS_REND_AudioConfig config ); +#ifdef SPLIT_REND_WITH_HEAD_ROT +ivas_error ivas_rend_openMultiBinCrend( + CREND_WRAPPER *pCrend, + const IVAS_REND_AudioConfig inConfig, + const IVAS_REND_AudioConfig outConfig, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int32_t output_Fs ); +#endif + ivas_error ivas_rend_openCrend( CREND_WRAPPER *pCrend, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, RENDER_CONFIG_DATA *hRendCfg, - const int32_t output_Fs ); + const int32_t output_Fs +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +); #ifdef SPLIT_REND_WITH_HEAD_ROT void ivas_rend_CldfbMultiBinRendProcess( const BINAURAL_RENDERER_HANDLE hCldfbRend, const IVAS_REND_HeadRotData *pHeadRotData, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_Out_Real[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ); + float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t low_res_pre_rend_rot ); ivas_error ivas_rend_openCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], @@ -102,14 +122,25 @@ ivas_error ivas_rend_openCldfb( ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, const IVAS_REND_AudioConfig inConfig, - const IVAS_SPLIT_REND_MODE splitRendMode, + const IVAS_REND_AudioConfig outConfig, RENDER_CONFIG_DATA *hRendCfg, +#ifdef SPLIT_REND_WITH_HEAD_ROT + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, +#endif const int32_t output_Fs ); +void ivas_mat_mult_2by2_complex( float in_re1[2][2], + float in_im1[2][2], + float in_re2[2][2], + float in_im2[2][2], + float out_re2[2][2], + float out_im2[2][2] ); void ivas_split_rend_bitstream_init( ivas_split_rend_bits_t *pBits, const int32_t buf_len_bytes, uint8_t *pbuf ); void ivas_split_rend_huffman_dec_init_min_max_len( ivas_split_rend_huffman_cfg_t *p_huff_cfg ); void ivas_split_rend_init_huff_cfg( BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ); -void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); +void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); +void set_pose_types( IVAS_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1], MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); int16_t wrap_a( int16_t val, int16_t min_val, int16_t max_val ); void ivas_SplitRenderer_getdiagdiff( int16_t in_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], @@ -123,8 +154,19 @@ IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( const IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME], int16_t subframe_idx ); -void ivas_rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS] ); void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); +int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate ); +int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, const int16_t pcm_out ); +void ivas_split_rend_get_quant_params( + const int16_t num_md_bands, + int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t *num_quant_strats, + int16_t *num_complex_bands ); #endif ivas_error ivas_rend_initCrend( @@ -135,14 +177,24 @@ ivas_error ivas_rend_initCrend( const int32_t output_Fs ); ivas_error ivas_rend_closeCrend( - CREND_WRAPPER *pCrend ); + CREND_WRAPPER *pCrend +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + int16_t pos_idx +#endif +); ivas_error ivas_rend_crendProcess( const CREND_WRAPPER *pCrend, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, float output[][L_FRAME48k], /* i/o: input/output audio channels */ - const int32_t output_Fs ); + const int32_t output_Fs +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +); ivas_error ivas_rend_crendConvolver( const CREND_WRAPPER *pCrend, @@ -151,7 +203,12 @@ ivas_error ivas_rend_crendConvolver( float pcm_in[][L_FRAME48k], float pcm_out[][L_FRAME48k], const int32_t output_Fs, - const int16_t i_ts ); + const int16_t i_ts +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + const int16_t pos_idx +#endif +); ivas_error ivas_rend_TDObjRenderFrame( const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index fae2144afe..7d1f95e4cb 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -95,6 +95,9 @@ int16_t audioCfg2channels( break; case AUDIO_CONFIG_BINAURAL: case AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef SPLIT_REND_WITH_HEAD_ROT + case AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: +#endif nchan_out = 2; break; case AUDIO_CONFIG_ISM1: @@ -221,6 +224,9 @@ void ivas_output_init( break; case AUDIO_CONFIG_BINAURAL: case AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef SPLIT_REND_WITH_HEAD_ROT + case AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: +#endif case AUDIO_CONFIG_ISM1: case AUDIO_CONFIG_ISM2: case AUDIO_CONFIG_ISM3: @@ -282,7 +288,11 @@ void ivas_renderer_select( st_ivas->hHeadTrackData->shd_rot_max_order = -1; } - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -333,7 +343,11 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; - if ( output_config == AUDIO_CONFIG_BINAURAL ) + if ( output_config == AUDIO_CONFIG_BINAURAL +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -346,7 +360,11 @@ void ivas_renderer_select( { *internal_config = AUDIO_CONFIG_HOA3; - if ( output_config == AUDIO_CONFIG_BINAURAL ) + if ( output_config == AUDIO_CONFIG_BINAURAL +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { *renderer_type = RENDERER_BINAURAL_FASTCONV; } @@ -629,13 +647,19 @@ void ivas_renderer_select( } #ifdef SPLIT_REND_WITH_HEAD_ROT -void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ) +void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ) { hSplitRendBits->bits_written = 0; hSplitRendBits->bits_read = 0; hSplitBinRend->hSplitRendBits = hSplitRendBits; hSplitBinRend->hMultiBinCldfbData = (IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) dynamic_malloc( sizeof( IVAS_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ); + + ivas_renderSplitGetMultiBinPoseData( + hSplitBinConfig, + &hSplitBinRend->splitrend.multiBinPoseData, + hHeadTrackData->sr_pose_pred_axis ); + return; } #endif \ No newline at end of file diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 7e8caec092..f71c5207b6 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -101,7 +101,7 @@ ivas_error ivas_render_config_init_from_rom( return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Unexpected null pointer while attempting to fill renderer configuration from ROM" ); } -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) ( *hRenderConfig )->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE; #endif ( *hRenderConfig )->roomAcoustics.override = false; @@ -118,5 +118,12 @@ 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 SPLIT_REND_WITH_HEAD_ROT + ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; + ( *hRenderConfig )->split_rend_config.dof = 3; + ( *hRenderConfig )->split_rend_config.hq_mode = 0; + ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; +#endif + return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index ac4216ef77..ae08a9b4bd 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -649,6 +649,397 @@ const uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[16][BINAURAL_CHANNE const uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz = 0; const float CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz[16]={0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f}; const uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; + +#ifdef USE_DOLBY_HRTFS_WITH_LIB_REND_HOA3 +const float CRendBin_HOA3_HRIR_coeff_re_48kHz[16][BINAURAL_CHANNELS][480]={ + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.913511f, 0.297764f, -0.448662f, -0.794739f, -0.584308f, -0.066286f, 0.383335f, 0.523490f, 0.329142f, -0.049270f, -0.372446f, -0.439760f, -0.218387f, 0.131463f, 0.375250f, 0.366057f, 0.122749f, -0.199654f, -0.398818f, -0.338040f, -0.044156f, 0.289955f, 0.435397f, 0.292959f, -0.046275f, -0.370822f, -0.470921f, -0.255332f, 0.168596f, 0.524347f, 0.546137f, 0.190399f, -0.315265f, -0.631577f, -0.536748f, -0.071010f, 0.473325f, 0.724680f, 0.491926f, -0.077029f, -0.592750f, -0.709061f, -0.358645f, 0.221486f, 0.653227f, 0.654448f, 0.221714f, -0.358070f, + -0.697005f, -0.571979f, -0.072724f, 0.465706f, 0.688399f, 0.454808f, -0.069878f, -0.531901f, -0.632201f, -0.318528f, 0.196256f, 0.577642f, 0.578020f, 0.195732f, -0.315931f, -0.614947f, -0.504762f, -0.064240f, 0.413279f, 0.615223f, 0.410469f, -0.063698f, -0.489012f, -0.582556f, -0.291711f, 0.177074f, 0.509396f, 0.495935f, 0.163135f, -0.255558f, -0.483220f, -0.385116f, -0.047484f, 0.297139f, 0.430397f, 0.281064f, -0.042923f, -0.329134f, -0.394422f, -0.200007f, 0.123610f, 0.361593f, 0.357624f, 0.119310f, -0.188992f, -0.361951f, -0.292521f, -0.036559f, 0.232740f, 0.340851f, 0.223547f, -0.033904f, -0.257091f, -0.302468f, -0.150325f, 0.091447f, 0.263901f, 0.258505f, 0.085476f, -0.133310f, -0.250324f, -0.197278f, -0.023974f, 0.151501f, 0.223518f, 0.151424f, -0.024096f, -0.195202f, -0.243701f, -0.126585f, 0.078808f, 0.227034f, 0.218009f, 0.070086f, -0.106416f, -0.197846f, -0.157896f, -0.019854f, 0.132839f, 0.208150f, 0.149364f, -0.025039f, -0.212775f, -0.279217f, -0.153368f, 0.101549f, 0.313749f, 0.323895f, 0.111574f, -0.180715f, -0.351256f, -0.286277f, -0.035901f, 0.228684f, 0.334751f, 0.219900f, + -0.033586f, -0.258858f, -0.313198f, -0.162184f, 0.103962f, 0.319367f, 0.335040f, 0.119049f, -0.200630f, -0.406665f, -0.345432f, -0.045133f, 0.297852f, 0.452257f, 0.307675f, -0.048678f, -0.383458f, -0.469653f, -0.242363f, 0.151899f, 0.450820f, 0.452553f, 0.153364f, -0.247292f, -0.481211f, -0.394484f, -0.049986f, 0.320428f, 0.473864f, 0.314398f, -0.048591f, -0.374856f, -0.451318f, -0.230086f, 0.143343f, 0.425377f, 0.429356f, 0.146896f, -0.239536f, -0.471241f, -0.389483f, -0.049519f, 0.316500f, 0.463005f, 0.301169f, -0.045151f, -0.334495f, -0.382053f, -0.182555f, 0.105589f, 0.287834f, 0.265314f, 0.082622f, -0.121622f, -0.215847f, -0.160070f, -0.018038f, 0.105124f, 0.140415f, 0.085958f, -0.012310f, -0.094173f, -0.112729f, -0.057423f, 0.036152f, 0.106033f, 0.105674f, 0.035805f, -0.057042f, -0.111752f, -0.092326f, -0.011591f, 0.076887f, 0.114459f, 0.076487f, -0.011585f, -0.091335f, -0.110111f, -0.055908f, 0.035073f, 0.102854f, 0.102954f, 0.035102f, -0.056172f, -0.110235f, -0.090967f, -0.011393f, 0.075561f, 0.112715f, 0.075676f, -0.011529f, -0.091380f, -0.110514f, -0.056150f, 0.035172f, 0.102964f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.913511f, 0.297764f, -0.448662f, -0.794739f, -0.584308f, -0.066286f, 0.383335f, 0.523490f, 0.329142f, -0.049270f, -0.372446f, -0.439760f, -0.218387f, 0.131463f, 0.375250f, 0.366057f, 0.122749f, -0.199654f, -0.398818f, -0.338040f, -0.044156f, 0.289955f, 0.435397f, 0.292959f, -0.046275f, -0.370822f, -0.470921f, -0.255332f, 0.168596f, 0.524347f, 0.546137f, 0.190399f, -0.315265f, -0.631577f, -0.536748f, -0.071010f, 0.473325f, 0.724680f, 0.491926f, -0.077029f, -0.592750f, -0.709061f, -0.358645f, 0.221486f, 0.653227f, 0.654448f, 0.221714f, -0.358070f, + -0.697005f, -0.571979f, -0.072724f, 0.465706f, 0.688399f, 0.454808f, -0.069878f, -0.531901f, -0.632201f, -0.318528f, 0.196256f, 0.577642f, 0.578020f, 0.195732f, -0.315931f, -0.614947f, -0.504762f, -0.064240f, 0.413279f, 0.615223f, 0.410469f, -0.063698f, -0.489012f, -0.582556f, -0.291711f, 0.177074f, 0.509396f, 0.495935f, 0.163135f, -0.255558f, -0.483220f, -0.385116f, -0.047484f, 0.297139f, 0.430397f, 0.281064f, -0.042923f, -0.329134f, -0.394422f, -0.200007f, 0.123610f, 0.361593f, 0.357624f, 0.119310f, -0.188992f, -0.361951f, -0.292521f, -0.036559f, 0.232740f, 0.340851f, 0.223547f, -0.033904f, -0.257091f, -0.302468f, -0.150325f, 0.091447f, 0.263901f, 0.258505f, 0.085476f, -0.133310f, -0.250324f, -0.197278f, -0.023974f, 0.151501f, 0.223518f, 0.151424f, -0.024096f, -0.195202f, -0.243701f, -0.126585f, 0.078808f, 0.227034f, 0.218009f, 0.070086f, -0.106416f, -0.197846f, -0.157896f, -0.019854f, 0.132839f, 0.208150f, 0.149364f, -0.025039f, -0.212775f, -0.279217f, -0.153368f, 0.101549f, 0.313749f, 0.323895f, 0.111574f, -0.180715f, -0.351256f, -0.286277f, -0.035901f, 0.228684f, 0.334751f, 0.219900f, + -0.033586f, -0.258858f, -0.313198f, -0.162184f, 0.103962f, 0.319367f, 0.335040f, 0.119049f, -0.200630f, -0.406665f, -0.345432f, -0.045133f, 0.297852f, 0.452257f, 0.307675f, -0.048678f, -0.383458f, -0.469653f, -0.242363f, 0.151899f, 0.450820f, 0.452553f, 0.153364f, -0.247292f, -0.481211f, -0.394484f, -0.049986f, 0.320428f, 0.473864f, 0.314398f, -0.048591f, -0.374856f, -0.451318f, -0.230086f, 0.143343f, 0.425377f, 0.429356f, 0.146896f, -0.239536f, -0.471241f, -0.389483f, -0.049519f, 0.316500f, 0.463005f, 0.301169f, -0.045151f, -0.334495f, -0.382053f, -0.182555f, 0.105589f, 0.287834f, 0.265314f, 0.082622f, -0.121622f, -0.215847f, -0.160070f, -0.018038f, 0.105124f, 0.140415f, 0.085958f, -0.012310f, -0.094173f, -0.112729f, -0.057423f, 0.036152f, 0.106033f, 0.105674f, 0.035805f, -0.057042f, -0.111752f, -0.092326f, -0.011591f, 0.076887f, 0.114459f, 0.076487f, -0.011585f, -0.091335f, -0.110111f, -0.055908f, 0.035073f, 0.102854f, 0.102954f, 0.035102f, -0.056172f, -0.110235f, -0.090967f, -0.011393f, 0.075561f, 0.112715f, 0.075676f, -0.011529f, -0.091380f, -0.110514f, -0.056150f, 0.035172f, 0.102964f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.078507f, 0.345720f, 0.419014f, -0.090001f, -0.886763f, -1.112419f, -0.325594f, 0.822011f, 1.242202f, 0.620411f, -0.375701f, -0.958800f, -0.880887f, -0.320707f, 0.396742f, 0.867127f, 0.763383f, 0.133532f, -0.583480f, -0.912185f, -0.661302f, 0.016105f, 0.714207f, 0.974336f, 0.593807f, -0.186547f, -0.845249f, -0.953982f, -0.445024f, 0.358573f, 0.927923f, 0.870609f, 0.232731f, -0.519358f, -0.861148f, -0.599683f, 0.021863f, 0.538672f, 0.607073f, 0.229387f, -0.287399f, -0.575341f, -0.447050f, 0.001938f, 0.449531f, 0.554146f, 0.224325f, -0.281168f, + -0.564275f, -0.418027f, 0.036622f, 0.472044f, 0.578372f, 0.262453f, -0.267590f, -0.630790f, -0.563116f, -0.115202f, 0.410465f, 0.678620f, 0.516618f, 0.015341f, -0.505177f, -0.696887f, -0.433783f, 0.103311f, 0.565666f, 0.662825f, 0.335157f, -0.202959f, -0.596654f, -0.599760f, -0.238688f, 0.240150f, 0.550467f, 0.523064f, 0.188581f, -0.236223f, -0.487678f, -0.435603f, -0.143322f, 0.213448f, 0.444709f, 0.412420f, 0.110317f, -0.287293f, -0.516175f, -0.413270f, -0.035404f, 0.381937f, 0.570908f, 0.396330f, -0.044649f, -0.471027f, -0.602814f, -0.345663f, 0.148526f, 0.563279f, 0.606029f, 0.221870f, -0.332846f, -0.668739f, -0.558611f, -0.082992f, 0.459154f, 0.737843f, 0.559205f, -0.007264f, -0.608363f, -0.804526f, -0.415856f, 0.282748f, 0.750248f, 0.624001f, 0.022441f, -0.567542f, -0.700840f, -0.312376f, 0.272850f, 0.612965f, 0.475340f, -0.005432f, -0.442372f, -0.507417f, -0.189350f, 0.228122f, 0.429891f, 0.310743f, 0.000527f, -0.281747f, -0.381629f, -0.270808f, -0.023022f, 0.239144f, 0.388562f, 0.339103f, 0.101304f, -0.200864f, -0.398655f, -0.382230f, -0.151725f, 0.186980f, 0.446425f, 0.436823f, + 0.117420f, -0.315067f, -0.547592f, -0.399950f, 0.034065f, 0.459939f, 0.581115f, 0.293973f, -0.221988f, -0.603141f, -0.563489f, -0.119548f, 0.419367f, 0.678692f, 0.476034f, -0.059565f, -0.568595f, -0.700166f, -0.359537f, 0.221331f, 0.649202f, 0.641339f, 0.209017f, -0.357720f, -0.684164f, -0.558187f, -0.067778f, 0.461505f, 0.680823f, 0.443499f, -0.096523f, -0.579844f, -0.679605f, -0.322890f, 0.260250f, 0.687010f, 0.667356f, 0.197681f, -0.419959f, -0.769604f, -0.610433f, -0.049359f, 0.534803f, 0.753130f, 0.469899f, -0.105833f, -0.570847f, -0.623745f, -0.274389f, 0.200009f, 0.483611f, 0.428788f, 0.116727f, -0.221116f, -0.363828f, -0.251467f, -0.007878f, 0.183976f, 0.222880f, 0.122812f, -0.036656f, -0.160383f, -0.175959f, -0.075276f, 0.073669f, 0.172365f, 0.158052f, 0.040219f, -0.105590f, -0.182109f, -0.136463f, -0.000640f, 0.132975f, 0.177770f, 0.106182f, -0.035698f, -0.154112f, -0.168449f, -0.070286f, 0.071884f, 0.164807f, 0.149949f, 0.035346f, -0.105920f, -0.177740f, -0.130173f, 0.002044f, 0.129739f, 0.172320f, 0.102166f, -0.039082f, -0.157302f, -0.168874f, -0.069152f, 0.068659f, 0.160064f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.078507f, -0.345720f, -0.419014f, 0.090001f, 0.886763f, 1.112419f, 0.325594f, -0.822011f, -1.242202f, -0.620411f, 0.375701f, 0.958800f, 0.880887f, 0.320707f, -0.396742f, -0.867127f, -0.763383f, -0.133532f, 0.583480f, 0.912185f, 0.661302f, -0.016105f, -0.714207f, -0.974336f, -0.593807f, 0.186547f, 0.845249f, 0.953982f, 0.445024f, -0.358573f, -0.927923f, -0.870609f, -0.232731f, 0.519358f, 0.861148f, 0.599683f, -0.021863f, -0.538672f, -0.607073f, -0.229387f, 0.287399f, 0.575341f, 0.447050f, -0.001938f, -0.449531f, -0.554146f, -0.224325f, 0.281168f, + 0.564275f, 0.418027f, -0.036622f, -0.472044f, -0.578372f, -0.262453f, 0.267590f, 0.630790f, 0.563116f, 0.115202f, -0.410465f, -0.678620f, -0.516618f, -0.015341f, 0.505177f, 0.696887f, 0.433783f, -0.103311f, -0.565666f, -0.662825f, -0.335157f, 0.202959f, 0.596654f, 0.599760f, 0.238688f, -0.240150f, -0.550467f, -0.523064f, -0.188581f, 0.236223f, 0.487678f, 0.435603f, 0.143322f, -0.213448f, -0.444709f, -0.412420f, -0.110317f, 0.287293f, 0.516175f, 0.413270f, 0.035404f, -0.381937f, -0.570908f, -0.396330f, 0.044649f, 0.471027f, 0.602814f, 0.345663f, -0.148526f, -0.563279f, -0.606029f, -0.221870f, 0.332846f, 0.668739f, 0.558611f, 0.082992f, -0.459154f, -0.737843f, -0.559205f, 0.007264f, 0.608363f, 0.804526f, 0.415856f, -0.282748f, -0.750248f, -0.624001f, -0.022441f, 0.567542f, 0.700840f, 0.312376f, -0.272850f, -0.612965f, -0.475340f, 0.005432f, 0.442372f, 0.507417f, 0.189350f, -0.228122f, -0.429891f, -0.310743f, -0.000527f, 0.281747f, 0.381629f, 0.270808f, 0.023022f, -0.239144f, -0.388562f, -0.339103f, -0.101304f, 0.200864f, 0.398655f, 0.382230f, 0.151725f, -0.186980f, -0.446425f, -0.436823f, + -0.117420f, 0.315067f, 0.547592f, 0.399950f, -0.034065f, -0.459939f, -0.581115f, -0.293973f, 0.221988f, 0.603141f, 0.563489f, 0.119548f, -0.419367f, -0.678692f, -0.476034f, 0.059565f, 0.568595f, 0.700166f, 0.359537f, -0.221331f, -0.649202f, -0.641339f, -0.209017f, 0.357720f, 0.684164f, 0.558187f, 0.067778f, -0.461505f, -0.680823f, -0.443499f, 0.096523f, 0.579844f, 0.679605f, 0.322890f, -0.260250f, -0.687010f, -0.667356f, -0.197681f, 0.419959f, 0.769604f, 0.610433f, 0.049359f, -0.534803f, -0.753130f, -0.469899f, 0.105833f, 0.570847f, 0.623745f, 0.274389f, -0.200009f, -0.483611f, -0.428788f, -0.116727f, 0.221116f, 0.363828f, 0.251467f, 0.007878f, -0.183976f, -0.222880f, -0.122812f, 0.036656f, 0.160383f, 0.175959f, 0.075276f, -0.073669f, -0.172365f, -0.158052f, -0.040219f, 0.105590f, 0.182109f, 0.136463f, 0.000640f, -0.132975f, -0.177770f, -0.106182f, 0.035698f, 0.154112f, 0.168449f, 0.070286f, -0.071884f, -0.164807f, -0.149949f, -0.035346f, 0.105920f, 0.177740f, 0.130173f, -0.002044f, -0.129739f, -0.172320f, -0.102166f, 0.039082f, 0.157302f, 0.168874f, 0.069152f, -0.068659f, -0.160064f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.056307f, 0.017289f, -0.053811f, -0.084185f, -0.008613f, 0.092002f, 0.062033f, -0.099580f, -0.214305f, -0.155629f, 0.021739f, 0.206138f, 0.334890f, 0.334066f, 0.118602f, -0.245240f, -0.496706f, -0.418817f, -0.067469f, 0.298129f, 0.449549f, 0.319613f, 0.004971f, -0.284816f, -0.356471f, -0.193076f, 0.042675f, 0.186601f, 0.200892f, 0.126378f, 0.007231f, -0.102915f, -0.147677f, -0.125239f, -0.078000f, -0.010747f, 0.101856f, 0.212645f, 0.203751f, 0.034280f, -0.182624f, -0.287202f, -0.209052f, 0.010500f, 0.257761f, 0.384764f, 0.283593f, -0.015468f, + -0.333452f, -0.458472f, -0.289704f, 0.090437f, 0.447438f, 0.530318f, 0.254630f, -0.210776f, -0.551038f, -0.526344f, -0.136623f, 0.367043f, 0.628934f, 0.435243f, -0.094771f, -0.563169f, -0.599356f, -0.164855f, 0.412008f, 0.690156f, 0.447470f, -0.147777f, -0.645398f, -0.645396f, -0.123062f, 0.523026f, 0.772804f, 0.407638f, -0.297887f, -0.786113f, -0.664916f, -0.025973f, 0.633136f, 0.813435f, 0.401399f, -0.271290f, -0.709653f, -0.625527f, -0.117336f, 0.436247f, 0.656506f, 0.414931f, -0.100258f, -0.524759f, -0.565763f, -0.199279f, 0.311551f, 0.600325f, 0.464962f, 0.018217f, -0.405694f, -0.513509f, -0.262505f, 0.142648f, 0.424981f, 0.419716f, 0.154101f, -0.188441f, -0.385157f, -0.316166f, -0.043001f, 0.242142f, 0.354602f, 0.229791f, -0.052508f, -0.316498f, -0.386687f, -0.204250f, 0.115510f, 0.358371f, 0.369270f, 0.152433f, -0.152826f, -0.363564f, -0.346718f, -0.099628f, 0.218683f, 0.373221f, 0.234852f, -0.096557f, -0.362611f, -0.358813f, -0.094719f, 0.232165f, 0.400346f, 0.313370f, 0.037006f, -0.259275f, -0.398381f, -0.291816f, 0.000873f, 0.298687f, 0.414037f, 0.276027f, -0.028056f, -0.310213f, + -0.393575f, -0.221574f, 0.096431f, 0.349475f, 0.369718f, 0.147825f, -0.168488f, -0.376867f, -0.344875f, -0.090806f, 0.219243f, 0.372901f, 0.262680f, -0.027768f, -0.285267f, -0.331017f, -0.147856f, 0.125124f, 0.303138f, 0.274325f, 0.058929f, -0.203615f, -0.333339f, -0.228658f, 0.049331f, 0.309499f, 0.369146f, 0.183971f, -0.129645f, -0.376515f, -0.401416f, -0.181189f, 0.156776f, 0.408835f, 0.420846f, 0.182202f, -0.167209f, -0.415554f, -0.405188f, -0.139177f, 0.211525f, 0.420888f, 0.359762f, 0.076181f, -0.241102f, -0.385764f, -0.271635f, 0.007857f, 0.253310f, 0.309091f, 0.162282f, -0.071694f, -0.235856f, -0.228506f, -0.067485f, 0.122230f, 0.205738f, 0.140781f, -0.007607f, -0.133583f, -0.161259f, -0.080043f, 0.052690f, 0.146336f, 0.139675f, 0.041588f, -0.082472f, -0.154196f, -0.125716f, -0.012280f, 0.109378f, 0.155270f, 0.098016f, -0.021211f, -0.127542f, -0.152845f, -0.074559f, 0.056635f, 0.145534f, 0.132074f, 0.034821f, -0.081026f, -0.148681f, -0.122026f, -0.007801f, 0.114342f, 0.151241f, 0.085606f, -0.025537f, -0.120195f, -0.151097f, -0.079986f, 0.063410f, 0.152713f, 0.099450f, -0.007121f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.056307f, 0.017289f, -0.053811f, -0.084185f, -0.008613f, 0.092002f, 0.062033f, -0.099580f, -0.214305f, -0.155629f, 0.021739f, 0.206138f, 0.334890f, 0.334066f, 0.118602f, -0.245240f, -0.496706f, -0.418817f, -0.067469f, 0.298129f, 0.449549f, 0.319613f, 0.004971f, -0.284816f, -0.356471f, -0.193076f, 0.042675f, 0.186601f, 0.200892f, 0.126378f, 0.007231f, -0.102915f, -0.147677f, -0.125239f, -0.078000f, -0.010747f, 0.101856f, 0.212645f, 0.203751f, 0.034280f, -0.182624f, -0.287202f, -0.209052f, 0.010500f, 0.257761f, 0.384764f, 0.283593f, -0.015468f, + -0.333452f, -0.458472f, -0.289704f, 0.090437f, 0.447438f, 0.530318f, 0.254630f, -0.210776f, -0.551038f, -0.526344f, -0.136623f, 0.367043f, 0.628934f, 0.435243f, -0.094771f, -0.563169f, -0.599356f, -0.164855f, 0.412008f, 0.690156f, 0.447470f, -0.147777f, -0.645398f, -0.645396f, -0.123062f, 0.523026f, 0.772804f, 0.407638f, -0.297887f, -0.786113f, -0.664916f, -0.025973f, 0.633136f, 0.813435f, 0.401399f, -0.271290f, -0.709653f, -0.625527f, -0.117336f, 0.436247f, 0.656506f, 0.414931f, -0.100258f, -0.524759f, -0.565763f, -0.199279f, 0.311551f, 0.600325f, 0.464962f, 0.018217f, -0.405694f, -0.513509f, -0.262505f, 0.142648f, 0.424981f, 0.419716f, 0.154101f, -0.188441f, -0.385157f, -0.316166f, -0.043001f, 0.242142f, 0.354602f, 0.229791f, -0.052508f, -0.316498f, -0.386687f, -0.204250f, 0.115510f, 0.358371f, 0.369270f, 0.152433f, -0.152826f, -0.363564f, -0.346718f, -0.099628f, 0.218683f, 0.373221f, 0.234852f, -0.096557f, -0.362611f, -0.358813f, -0.094719f, 0.232165f, 0.400346f, 0.313370f, 0.037006f, -0.259275f, -0.398381f, -0.291816f, 0.000873f, 0.298687f, 0.414037f, 0.276027f, -0.028056f, -0.310213f, + -0.393575f, -0.221574f, 0.096431f, 0.349475f, 0.369718f, 0.147825f, -0.168488f, -0.376867f, -0.344875f, -0.090806f, 0.219243f, 0.372901f, 0.262680f, -0.027768f, -0.285267f, -0.331017f, -0.147856f, 0.125124f, 0.303138f, 0.274325f, 0.058929f, -0.203615f, -0.333339f, -0.228658f, 0.049331f, 0.309499f, 0.369146f, 0.183971f, -0.129645f, -0.376515f, -0.401416f, -0.181189f, 0.156776f, 0.408835f, 0.420846f, 0.182202f, -0.167209f, -0.415554f, -0.405188f, -0.139177f, 0.211525f, 0.420888f, 0.359762f, 0.076181f, -0.241102f, -0.385764f, -0.271635f, 0.007857f, 0.253310f, 0.309091f, 0.162282f, -0.071694f, -0.235856f, -0.228506f, -0.067485f, 0.122230f, 0.205738f, 0.140781f, -0.007607f, -0.133583f, -0.161259f, -0.080043f, 0.052690f, 0.146336f, 0.139675f, 0.041588f, -0.082472f, -0.154196f, -0.125716f, -0.012280f, 0.109378f, 0.155270f, 0.098016f, -0.021211f, -0.127542f, -0.152845f, -0.074559f, 0.056635f, 0.145534f, 0.132074f, 0.034821f, -0.081026f, -0.148681f, -0.122026f, -0.007801f, 0.114342f, 0.151241f, 0.085606f, -0.025537f, -0.120195f, -0.151097f, -0.079986f, 0.063410f, 0.152713f, 0.099450f, -0.007121f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001257f, -0.010350f, -0.038127f, -0.020262f, 0.101537f, 0.231728f, 0.187449f, -0.048267f, -0.267921f, -0.280658f, -0.105940f, 0.108246f, 0.245205f, 0.245493f, 0.087874f, -0.160317f, -0.331689f, -0.287068f, -0.053261f, 0.198700f, 0.300661f, 0.205837f, -0.000868f, -0.179542f, -0.234477f, -0.160497f, -0.010459f, 0.152475f, 0.257183f, 0.223892f, 0.023982f, -0.249718f, -0.410542f, -0.309998f, 0.034923f, 0.422275f, 0.578727f, 0.351839f, -0.148528f, -0.596291f, -0.679309f, -0.330698f, 0.227772f, 0.644195f, 0.662235f, 0.273844f, -0.276815f, -0.644565f, + -0.605496f, -0.198898f, 0.310888f, 0.610724f, 0.526039f, 0.118137f, -0.351556f, -0.582341f, -0.435475f, -0.029220f, 0.356876f, 0.488443f, 0.322304f, -0.001429f, -0.276700f, -0.358345f, -0.230588f, 0.002926f, 0.192389f, 0.234171f, 0.127758f, -0.035102f, -0.139776f, -0.129340f, -0.037364f, 0.051713f, 0.076924f, 0.043600f, 0.004193f, 0.002369f, 0.029736f, 0.034107f, -0.019871f, -0.095210f, -0.107265f, -0.020138f, 0.097616f, 0.137086f, 0.060832f, -0.068516f, -0.157212f, -0.149396f, -0.042409f, 0.115326f, 0.226538f, 0.191254f, -0.001461f, -0.229766f, -0.318442f, -0.183876f, 0.089573f, 0.308853f, 0.315079f, 0.100840f, -0.183333f, -0.341558f, -0.277353f, -0.047925f, 0.206128f, 0.359174f, 0.332410f, 0.099042f, -0.256903f, -0.500277f, -0.384293f, 0.079566f, 0.535639f, 0.570851f, 0.116601f, -0.470852f, -0.731014f, -0.471950f, 0.128375f, 0.677066f, 0.800113f, 0.366226f, -0.367983f, -0.859137f, -0.685369f, 0.043750f, 0.726042f, 0.794194f, 0.225646f, -0.469894f, -0.732371f, -0.408721f, 0.188301f, 0.578924f, 0.487928f, 0.028220f, -0.414147f, -0.499999f, -0.198138f, 0.228352f, 0.460795f, 0.353587f, + 0.000305f, -0.347575f, -0.443945f, -0.220174f, 0.155163f, 0.406336f, 0.365800f, 0.080413f, -0.250538f, -0.411045f, -0.292465f, 0.030280f, 0.329826f, 0.389364f, 0.175045f, -0.149197f, -0.363855f, -0.341250f, -0.100000f, 0.215339f, 0.405586f, 0.336160f, 0.040934f, -0.289118f, -0.438244f, -0.310112f, 0.017972f, 0.345676f, 0.466021f, 0.292635f, -0.073629f, -0.397911f, -0.465924f, -0.232882f, 0.146076f, 0.424699f, 0.428977f, 0.162813f, -0.200832f, -0.428287f, -0.372716f, -0.075313f, 0.257473f, 0.400316f, 0.270810f, -0.022305f, -0.272450f, -0.323881f, -0.167166f, 0.071622f, 0.229241f, 0.218174f, 0.073328f, -0.091825f, -0.171761f, -0.132295f, -0.019156f, 0.083345f, 0.113355f, 0.067401f, -0.012515f, -0.076177f, -0.089938f, -0.046570f, 0.028220f, 0.084743f, 0.083601f, 0.026813f, -0.046361f, -0.089183f, -0.074551f, -0.010206f, 0.061913f, 0.091969f, 0.060416f, -0.009085f, -0.071965f, -0.091638f, -0.055653f, 0.016526f, 0.079074f, 0.089150f, 0.040235f, -0.034127f, -0.086136f, -0.082884f, -0.025007f, 0.050277f, 0.091643f, 0.071803f, 0.006030f, -0.063257f, -0.092957f, -0.060736f, 0.016159f, 0.081453f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001257f, -0.010350f, -0.038127f, -0.020262f, 0.101537f, 0.231728f, 0.187449f, -0.048267f, -0.267921f, -0.280658f, -0.105940f, 0.108246f, 0.245205f, 0.245493f, 0.087874f, -0.160317f, -0.331689f, -0.287068f, -0.053261f, 0.198700f, 0.300661f, 0.205837f, -0.000868f, -0.179542f, -0.234477f, -0.160497f, -0.010459f, 0.152475f, 0.257183f, 0.223892f, 0.023982f, -0.249718f, -0.410542f, -0.309998f, 0.034923f, 0.422275f, 0.578727f, 0.351839f, -0.148528f, -0.596291f, -0.679309f, -0.330698f, 0.227772f, 0.644195f, 0.662235f, 0.273844f, -0.276815f, -0.644565f, + -0.605496f, -0.198898f, 0.310888f, 0.610724f, 0.526039f, 0.118137f, -0.351556f, -0.582341f, -0.435475f, -0.029220f, 0.356876f, 0.488443f, 0.322304f, -0.001429f, -0.276700f, -0.358345f, -0.230588f, 0.002926f, 0.192389f, 0.234171f, 0.127758f, -0.035102f, -0.139776f, -0.129340f, -0.037364f, 0.051713f, 0.076924f, 0.043600f, 0.004193f, 0.002369f, 0.029736f, 0.034107f, -0.019871f, -0.095210f, -0.107265f, -0.020138f, 0.097616f, 0.137086f, 0.060832f, -0.068516f, -0.157212f, -0.149396f, -0.042409f, 0.115326f, 0.226538f, 0.191254f, -0.001461f, -0.229766f, -0.318442f, -0.183876f, 0.089573f, 0.308853f, 0.315079f, 0.100840f, -0.183333f, -0.341558f, -0.277353f, -0.047925f, 0.206128f, 0.359174f, 0.332410f, 0.099042f, -0.256903f, -0.500277f, -0.384293f, 0.079566f, 0.535639f, 0.570851f, 0.116601f, -0.470852f, -0.731014f, -0.471950f, 0.128375f, 0.677066f, 0.800113f, 0.366226f, -0.367983f, -0.859137f, -0.685369f, 0.043750f, 0.726042f, 0.794194f, 0.225646f, -0.469894f, -0.732371f, -0.408721f, 0.188301f, 0.578924f, 0.487928f, 0.028220f, -0.414147f, -0.499999f, -0.198138f, 0.228352f, 0.460795f, 0.353587f, + 0.000305f, -0.347575f, -0.443945f, -0.220174f, 0.155163f, 0.406336f, 0.365800f, 0.080413f, -0.250538f, -0.411045f, -0.292465f, 0.030280f, 0.329826f, 0.389364f, 0.175045f, -0.149197f, -0.363855f, -0.341250f, -0.100000f, 0.215339f, 0.405586f, 0.336160f, 0.040934f, -0.289118f, -0.438244f, -0.310112f, 0.017972f, 0.345676f, 0.466021f, 0.292635f, -0.073629f, -0.397911f, -0.465924f, -0.232882f, 0.146076f, 0.424699f, 0.428977f, 0.162813f, -0.200832f, -0.428287f, -0.372716f, -0.075313f, 0.257473f, 0.400316f, 0.270810f, -0.022305f, -0.272450f, -0.323881f, -0.167166f, 0.071622f, 0.229241f, 0.218174f, 0.073328f, -0.091825f, -0.171761f, -0.132295f, -0.019156f, 0.083345f, 0.113355f, 0.067401f, -0.012515f, -0.076177f, -0.089938f, -0.046570f, 0.028220f, 0.084743f, 0.083601f, 0.026813f, -0.046361f, -0.089183f, -0.074551f, -0.010206f, 0.061913f, 0.091969f, 0.060416f, -0.009085f, -0.071965f, -0.091638f, -0.055653f, 0.016526f, 0.079074f, 0.089150f, 0.040235f, -0.034127f, -0.086136f, -0.082884f, -0.025007f, 0.050277f, 0.091643f, 0.071803f, 0.006030f, -0.063257f, -0.092957f, -0.060736f, 0.016159f, 0.081453f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.001001f, 0.008051f, -0.008894f, -0.059845f, -0.064833f, 0.067480f, 0.260624f, 0.282055f, 0.030622f, -0.289773f, -0.393012f, -0.215424f, 0.091978f, 0.349428f, 0.414274f, 0.202742f, -0.190698f, -0.479609f, -0.435928f, -0.116713f, 0.227845f, 0.395888f, 0.329501f, 0.083535f, -0.202329f, -0.362505f, -0.313180f, -0.091955f, 0.192348f, 0.392777f, 0.357073f, 0.051868f, -0.337931f, -0.528754f, -0.382114f, 0.000154f, 0.378441f, 0.521532f, 0.327372f, -0.090990f, -0.452110f, -0.512906f, -0.247750f, 0.164487f, 0.475569f, 0.497658f, 0.207830f, -0.209952f, + -0.475852f, -0.423848f, -0.110318f, 0.256492f, 0.457322f, 0.377940f, 0.076008f, -0.250647f, -0.405985f, -0.323890f, -0.071141f, 0.219063f, 0.396551f, 0.353665f, 0.108123f, -0.188027f, -0.356965f, -0.313876f, -0.100766f, 0.147658f, 0.279680f, 0.230608f, 0.070327f, -0.076613f, -0.145200f, -0.141438f, -0.084294f, 0.006600f, 0.089606f, 0.121031f, 0.089203f, 0.008555f, -0.088739f, -0.139597f, -0.082851f, 0.058698f, 0.171068f, 0.158046f, 0.030501f, -0.121105f, -0.201430f, -0.156471f, -0.006449f, 0.146377f, 0.189759f, 0.104012f, -0.031827f, -0.130292f, -0.154818f, -0.103683f, 0.005623f, 0.123392f, 0.180189f, 0.133102f, -0.006621f, -0.176150f, -0.272956f, -0.199324f, 0.045705f, 0.313150f, 0.391470f, 0.187409f, -0.172914f, -0.428776f, -0.385552f, -0.065542f, 0.306202f, 0.466166f, 0.303144f, -0.063414f, -0.370900f, -0.400805f, -0.133949f, 0.232104f, 0.419294f, 0.275344f, -0.094929f, -0.393982f, -0.372024f, -0.046540f, 0.313599f, 0.429476f, 0.235888f, -0.107437f, -0.364874f, -0.373121f, -0.124677f, 0.215898f, 0.403336f, 0.295474f, -0.026340f, -0.326097f, -0.392969f, -0.173120f, 0.197682f, 0.454837f, + 0.377995f, -0.003641f, -0.393177f, -0.476595f, -0.201074f, 0.203259f, 0.437709f, 0.352071f, 0.023386f, -0.303300f, -0.384148f, -0.170314f, 0.146929f, 0.311591f, 0.224057f, -0.014367f, -0.228551f, -0.295861f, -0.185965f, 0.039972f, 0.246601f, 0.294511f, 0.144588f, -0.102280f, -0.281071f, -0.281572f, -0.107973f, 0.139059f, 0.314581f, 0.297943f, 0.076018f, -0.215622f, -0.369508f, -0.267601f, 0.020713f, 0.297068f, 0.381580f, 0.223305f, -0.078408f, -0.331365f, -0.367357f, -0.162443f, 0.138004f, 0.327883f, 0.292464f, 0.077163f, -0.163428f, -0.277651f, -0.210571f, -0.026571f, 0.146260f, 0.204799f, 0.129837f, -0.013835f, -0.125722f, -0.137928f, -0.060312f, 0.036888f, 0.087544f, 0.074450f, 0.020217f, -0.040746f, -0.074894f, -0.060138f, -0.004458f, 0.053807f, 0.075366f, 0.047980f, -0.010478f, -0.063748f, -0.075518f, -0.035369f, 0.028186f, 0.070246f, 0.066049f, 0.022093f, -0.036398f, -0.076800f, -0.071445f, -0.019410f, 0.045541f, 0.079838f, 0.062510f, 0.004823f, -0.058154f, -0.084338f, -0.053017f, 0.013779f, 0.068493f, 0.078241f, 0.040740f, -0.024762f, -0.080037f, -0.078694f, -0.012665f, 0.057449f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.001001f, -0.008051f, 0.008894f, 0.059845f, 0.064833f, -0.067480f, -0.260624f, -0.282055f, -0.030622f, 0.289773f, 0.393012f, 0.215424f, -0.091978f, -0.349428f, -0.414274f, -0.202742f, 0.190698f, 0.479609f, 0.435928f, 0.116713f, -0.227845f, -0.395888f, -0.329501f, -0.083535f, 0.202329f, 0.362505f, 0.313180f, 0.091955f, -0.192348f, -0.392777f, -0.357073f, -0.051868f, 0.337931f, 0.528754f, 0.382114f, -0.000154f, -0.378441f, -0.521532f, -0.327372f, 0.090990f, 0.452110f, 0.512906f, 0.247750f, -0.164487f, -0.475569f, -0.497658f, -0.207830f, 0.209952f, + 0.475852f, 0.423848f, 0.110318f, -0.256492f, -0.457322f, -0.377940f, -0.076008f, 0.250647f, 0.405985f, 0.323890f, 0.071141f, -0.219063f, -0.396551f, -0.353665f, -0.108123f, 0.188027f, 0.356965f, 0.313876f, 0.100766f, -0.147658f, -0.279680f, -0.230608f, -0.070327f, 0.076613f, 0.145200f, 0.141438f, 0.084294f, -0.006600f, -0.089606f, -0.121031f, -0.089203f, -0.008555f, 0.088739f, 0.139597f, 0.082851f, -0.058698f, -0.171068f, -0.158046f, -0.030501f, 0.121105f, 0.201430f, 0.156471f, 0.006449f, -0.146377f, -0.189759f, -0.104012f, 0.031827f, 0.130292f, 0.154818f, 0.103683f, -0.005623f, -0.123392f, -0.180189f, -0.133102f, 0.006621f, 0.176150f, 0.272956f, 0.199324f, -0.045705f, -0.313150f, -0.391470f, -0.187409f, 0.172914f, 0.428776f, 0.385552f, 0.065542f, -0.306202f, -0.466166f, -0.303144f, 0.063414f, 0.370900f, 0.400805f, 0.133949f, -0.232104f, -0.419294f, -0.275344f, 0.094929f, 0.393982f, 0.372024f, 0.046540f, -0.313599f, -0.429476f, -0.235888f, 0.107437f, 0.364874f, 0.373121f, 0.124677f, -0.215898f, -0.403336f, -0.295474f, 0.026340f, 0.326097f, 0.392969f, 0.173120f, -0.197682f, -0.454837f, + -0.377995f, 0.003641f, 0.393177f, 0.476595f, 0.201074f, -0.203259f, -0.437709f, -0.352071f, -0.023386f, 0.303300f, 0.384148f, 0.170314f, -0.146929f, -0.311591f, -0.224057f, 0.014367f, 0.228551f, 0.295861f, 0.185965f, -0.039972f, -0.246601f, -0.294511f, -0.144588f, 0.102280f, 0.281071f, 0.281572f, 0.107973f, -0.139059f, -0.314581f, -0.297943f, -0.076018f, 0.215622f, 0.369508f, 0.267601f, -0.020713f, -0.297068f, -0.381580f, -0.223305f, 0.078408f, 0.331365f, 0.367357f, 0.162443f, -0.138004f, -0.327883f, -0.292464f, -0.077163f, 0.163428f, 0.277651f, 0.210571f, 0.026571f, -0.146260f, -0.204799f, -0.129837f, 0.013835f, 0.125722f, 0.137928f, 0.060312f, -0.036888f, -0.087544f, -0.074450f, -0.020217f, 0.040746f, 0.074894f, 0.060138f, 0.004458f, -0.053807f, -0.075366f, -0.047980f, 0.010478f, 0.063748f, 0.075518f, 0.035369f, -0.028186f, -0.070246f, -0.066049f, -0.022093f, 0.036398f, 0.076800f, 0.071445f, 0.019410f, -0.045541f, -0.079838f, -0.062510f, -0.004823f, 0.058154f, 0.084338f, 0.053017f, -0.013779f, -0.068493f, -0.078241f, -0.040740f, 0.024762f, 0.080037f, 0.078694f, 0.012665f, -0.057449f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.022291f, -0.014662f, -0.012124f, -0.015360f, -0.005069f, 0.023626f, 0.033685f, -0.013080f, -0.095957f, -0.151902f, -0.133705f, -0.011171f, 0.231125f, 0.502826f, 0.564668f, 0.233582f, -0.343747f, -0.749143f, -0.676401f, -0.192825f, 0.365754f, 0.659239f, 0.531925f, 0.095807f, -0.330097f, -0.466435f, -0.302669f, -0.039758f, 0.153288f, 0.238308f, 0.221616f, 0.110339f, -0.044708f, -0.168432f, -0.228245f, -0.214866f, -0.096627f, 0.114945f, 0.289399f, 0.273163f, 0.061065f, -0.191693f, -0.312882f, -0.225856f, 0.027185f, 0.297079f, 0.394209f, 0.228330f, + -0.098776f, -0.363857f, -0.387898f, -0.150826f, 0.198491f, 0.425258f, 0.361797f, 0.041663f, -0.310638f, -0.442134f, -0.252932f, 0.129701f, 0.424975f, 0.395130f, 0.049698f, -0.331639f, -0.425838f, -0.150534f, 0.263011f, 0.463918f, 0.267118f, -0.185714f, -0.513928f, -0.404449f, 0.090847f, 0.559528f, 0.578392f, 0.095438f, -0.513054f, -0.749042f, -0.392834f, 0.309074f, 0.808347f, 0.678262f, -0.014865f, -0.729952f, -0.890830f, -0.369988f, 0.420038f, 0.882423f, 0.696241f, 0.018201f, -0.663044f, -0.869517f, -0.453777f, 0.292949f, 0.832756f, 0.769409f, 0.151109f, -0.562146f, -0.850605f, -0.524463f, 0.151903f, 0.680056f, 0.706150f, 0.265856f, -0.282664f, -0.564178f, -0.460617f, -0.130960f, 0.184829f, 0.343935f, 0.318571f, 0.139239f, -0.111205f, -0.290795f, -0.278292f, -0.085937f, 0.143946f, 0.263584f, 0.216822f, 0.036327f, -0.184660f, -0.306622f, -0.212043f, 0.070925f, 0.336622f, 0.357187f, 0.094159f, -0.253239f, -0.413839f, -0.264576f, 0.083872f, 0.385098f, 0.438501f, 0.215236f, -0.139292f, -0.403663f, -0.415487f, -0.171458f, 0.171937f, 0.404501f, 0.395496f, 0.160742f, -0.154930f, -0.353111f, + -0.300285f, -0.038023f, 0.228710f, 0.298488f, 0.142858f, -0.094819f, -0.243022f, -0.222931f, -0.068139f, 0.114546f, 0.206705f, 0.152791f, 0.000743f, -0.137680f, -0.172234f, -0.089080f, 0.052423f, 0.161104f, 0.168631f, 0.068489f, -0.084943f, -0.206674f, -0.216894f, -0.083951f, 0.133818f, 0.300346f, 0.291634f, 0.091635f, -0.191559f, -0.389955f, -0.370116f, -0.119249f, 0.224709f, 0.448158f, 0.406834f, 0.123402f, -0.232091f, -0.445109f, -0.380664f, -0.074600f, 0.275172f, 0.440619f, 0.323673f, 0.013555f, -0.284836f, -0.382612f, -0.225333f, 0.067476f, 0.288395f, 0.299500f, 0.121110f, -0.111417f, -0.249793f, -0.214134f, -0.037569f, 0.148586f, 0.211717f, 0.124528f, -0.029762f, -0.143411f, -0.154809f, -0.064326f, 0.069792f, 0.156587f, 0.135111f, 0.023866f, -0.099482f, -0.157585f, -0.114707f, 0.005319f, 0.124141f, 0.158408f, 0.086146f, -0.040055f, -0.138817f, -0.148378f, -0.057697f, 0.075496f, 0.154132f, 0.122573f, 0.012219f, -0.099851f, -0.149713f, -0.105780f, 0.014483f, 0.129920f, 0.150647f, 0.067713f, -0.048867f, -0.131137f, -0.141624f, -0.057766f, 0.083886f, 0.160201f, 0.089919f, -0.028866f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.022291f, 0.014662f, 0.012124f, 0.015360f, 0.005069f, -0.023626f, -0.033685f, 0.013080f, 0.095957f, 0.151902f, 0.133705f, 0.011171f, -0.231125f, -0.502826f, -0.564668f, -0.233582f, 0.343747f, 0.749143f, 0.676401f, 0.192825f, -0.365754f, -0.659239f, -0.531925f, -0.095807f, 0.330097f, 0.466435f, 0.302669f, 0.039758f, -0.153288f, -0.238308f, -0.221616f, -0.110339f, 0.044708f, 0.168432f, 0.228245f, 0.214866f, 0.096627f, -0.114945f, -0.289399f, -0.273163f, -0.061065f, 0.191693f, 0.312882f, 0.225856f, -0.027185f, -0.297079f, -0.394209f, -0.228330f, + 0.098776f, 0.363857f, 0.387898f, 0.150826f, -0.198491f, -0.425258f, -0.361797f, -0.041663f, 0.310638f, 0.442134f, 0.252932f, -0.129701f, -0.424975f, -0.395130f, -0.049698f, 0.331639f, 0.425838f, 0.150534f, -0.263011f, -0.463918f, -0.267118f, 0.185714f, 0.513928f, 0.404449f, -0.090847f, -0.559528f, -0.578392f, -0.095438f, 0.513054f, 0.749042f, 0.392834f, -0.309074f, -0.808347f, -0.678262f, 0.014865f, 0.729952f, 0.890830f, 0.369988f, -0.420038f, -0.882423f, -0.696241f, -0.018201f, 0.663044f, 0.869517f, 0.453777f, -0.292949f, -0.832756f, -0.769409f, -0.151109f, 0.562146f, 0.850605f, 0.524463f, -0.151903f, -0.680056f, -0.706150f, -0.265856f, 0.282664f, 0.564178f, 0.460617f, 0.130960f, -0.184829f, -0.343935f, -0.318571f, -0.139239f, 0.111205f, 0.290795f, 0.278292f, 0.085937f, -0.143946f, -0.263584f, -0.216822f, -0.036327f, 0.184660f, 0.306622f, 0.212043f, -0.070925f, -0.336622f, -0.357187f, -0.094159f, 0.253239f, 0.413839f, 0.264576f, -0.083872f, -0.385098f, -0.438501f, -0.215236f, 0.139292f, 0.403663f, 0.415487f, 0.171458f, -0.171937f, -0.404501f, -0.395496f, -0.160742f, 0.154930f, 0.353111f, + 0.300285f, 0.038023f, -0.228710f, -0.298488f, -0.142858f, 0.094819f, 0.243022f, 0.222931f, 0.068139f, -0.114546f, -0.206705f, -0.152791f, -0.000743f, 0.137680f, 0.172234f, 0.089080f, -0.052423f, -0.161104f, -0.168631f, -0.068489f, 0.084943f, 0.206674f, 0.216894f, 0.083951f, -0.133818f, -0.300346f, -0.291634f, -0.091635f, 0.191559f, 0.389955f, 0.370116f, 0.119249f, -0.224709f, -0.448158f, -0.406834f, -0.123402f, 0.232091f, 0.445109f, 0.380664f, 0.074600f, -0.275172f, -0.440619f, -0.323673f, -0.013555f, 0.284836f, 0.382612f, 0.225333f, -0.067476f, -0.288395f, -0.299500f, -0.121110f, 0.111417f, 0.249793f, 0.214134f, 0.037569f, -0.148586f, -0.211717f, -0.124528f, 0.029762f, 0.143411f, 0.154809f, 0.064326f, -0.069792f, -0.156587f, -0.135111f, -0.023866f, 0.099482f, 0.157585f, 0.114707f, -0.005319f, -0.124141f, -0.158408f, -0.086146f, 0.040055f, 0.138817f, 0.148378f, 0.057697f, -0.075496f, -0.154132f, -0.122573f, -0.012219f, 0.099851f, 0.149713f, 0.105780f, -0.014483f, -0.129920f, -0.150647f, -0.067713f, 0.048867f, 0.131137f, 0.141624f, 0.057766f, -0.083886f, -0.160201f, -0.089919f, 0.028866f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.003189f, 0.015780f, 0.012464f, -0.038201f, -0.075010f, -0.002926f, 0.129707f, 0.108899f, -0.164363f, -0.452126f, -0.410504f, -0.020615f, 0.370118f, 0.443553f, 0.212402f, -0.081670f, -0.232452f, -0.189932f, -0.029436f, 0.123835f, 0.177304f, 0.120463f, -0.001459f, -0.134803f, -0.216302f, -0.176732f, -0.010552f, 0.178278f, 0.256196f, 0.182059f, 0.024206f, -0.114848f, -0.158810f, -0.086016f, 0.044617f, 0.117327f, 0.065336f, -0.051259f, -0.111817f, -0.069611f, 0.015086f, 0.060298f, 0.037804f, -0.024585f, -0.067462f, -0.030851f, 0.086290f, 0.188844f, + 0.157463f, -0.018729f, -0.210321f, -0.263084f, -0.127756f, 0.111674f, 0.293457f, 0.271555f, 0.029254f, -0.266813f, -0.378473f, -0.210471f, 0.098370f, 0.309045f, 0.283898f, 0.063567f, -0.192165f, -0.309300f, -0.202449f, 0.057091f, 0.273940f, 0.275297f, 0.061398f, -0.182852f, -0.243317f, -0.072401f, 0.159342f, 0.223913f, 0.060123f, -0.171415f, -0.254703f, -0.118681f, 0.121199f, 0.276710f, 0.226181f, -0.010740f, -0.281226f, -0.385722f, -0.214159f, 0.147315f, 0.439995f, 0.417371f, 0.068911f, -0.334814f, -0.461447f, -0.208150f, 0.216193f, 0.473006f, 0.354739f, -0.063006f, -0.458119f, -0.493553f, -0.111396f, 0.386841f, 0.597174f, 0.355887f, -0.161558f, -0.596105f, -0.627040f, -0.182517f, 0.431560f, 0.699339f, 0.365851f, -0.267592f, -0.635509f, -0.474320f, -0.001010f, 0.401498f, 0.513114f, 0.323527f, -0.042288f, -0.368471f, -0.445665f, -0.229898f, 0.116970f, 0.367255f, 0.381124f, 0.152681f, -0.197679f, -0.450463f, -0.399927f, -0.031331f, 0.414227f, 0.600534f, 0.362021f, -0.156018f, -0.595235f, -0.639849f, -0.244309f, 0.327624f, 0.684841f, 0.585134f, 0.102556f, -0.434906f, -0.677892f, -0.481934f, + 0.014129f, 0.483575f, 0.618251f, 0.332509f, -0.171597f, -0.545927f, -0.547069f, -0.196533f, 0.258392f, 0.520496f, 0.426566f, 0.045920f, -0.360202f, -0.512877f, -0.312111f, 0.096838f, 0.433615f, 0.474500f, 0.194973f, -0.217117f, -0.487000f, -0.439250f, -0.109879f, 0.291113f, 0.515963f, 0.418802f, 0.043930f, -0.378561f, -0.565107f, -0.379160f, 0.061224f, 0.467198f, 0.578218f, 0.323802f, -0.139196f, -0.519383f, -0.569388f, -0.250943f, 0.231338f, 0.562130f, 0.524023f, 0.142931f, -0.325086f, -0.565414f, -0.425176f, -0.018815f, 0.365354f, 0.478495f, 0.275858f, -0.076817f, -0.336773f, -0.351325f, -0.145266f, 0.119622f, 0.268574f, 0.226547f, 0.049526f, -0.131174f, -0.202972f, -0.137985f, 0.006528f, 0.136051f, 0.173006f, 0.095314f, -0.048136f, -0.161874f, -0.168192f, -0.064261f, 0.078743f, 0.167861f, 0.146301f, 0.026552f, -0.113644f, -0.179167f, -0.125580f, 0.008523f, 0.132950f, 0.168499f, 0.093707f, -0.043550f, -0.153280f, -0.161822f, -0.064163f, 0.073638f, 0.161611f, 0.143109f, 0.029082f, -0.106025f, -0.171234f, -0.123276f, 0.003867f, 0.126660f, 0.166547f, 0.095192f, -0.043964f, -0.154618f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.003189f, 0.015780f, 0.012464f, -0.038201f, -0.075010f, -0.002926f, 0.129707f, 0.108899f, -0.164363f, -0.452126f, -0.410504f, -0.020615f, 0.370118f, 0.443553f, 0.212402f, -0.081670f, -0.232452f, -0.189932f, -0.029436f, 0.123835f, 0.177304f, 0.120463f, -0.001459f, -0.134803f, -0.216302f, -0.176732f, -0.010552f, 0.178278f, 0.256196f, 0.182059f, 0.024206f, -0.114848f, -0.158810f, -0.086016f, 0.044617f, 0.117327f, 0.065336f, -0.051259f, -0.111817f, -0.069611f, 0.015086f, 0.060298f, 0.037804f, -0.024585f, -0.067462f, -0.030851f, 0.086290f, 0.188844f, + 0.157463f, -0.018729f, -0.210321f, -0.263084f, -0.127756f, 0.111674f, 0.293457f, 0.271555f, 0.029254f, -0.266813f, -0.378473f, -0.210471f, 0.098370f, 0.309045f, 0.283898f, 0.063567f, -0.192165f, -0.309300f, -0.202449f, 0.057091f, 0.273940f, 0.275297f, 0.061398f, -0.182852f, -0.243317f, -0.072401f, 0.159342f, 0.223913f, 0.060123f, -0.171415f, -0.254703f, -0.118681f, 0.121199f, 0.276710f, 0.226181f, -0.010740f, -0.281226f, -0.385722f, -0.214159f, 0.147315f, 0.439995f, 0.417371f, 0.068911f, -0.334814f, -0.461447f, -0.208150f, 0.216193f, 0.473006f, 0.354739f, -0.063006f, -0.458119f, -0.493553f, -0.111396f, 0.386841f, 0.597174f, 0.355887f, -0.161558f, -0.596105f, -0.627040f, -0.182517f, 0.431560f, 0.699339f, 0.365851f, -0.267592f, -0.635509f, -0.474320f, -0.001010f, 0.401498f, 0.513114f, 0.323527f, -0.042288f, -0.368471f, -0.445665f, -0.229898f, 0.116970f, 0.367255f, 0.381124f, 0.152681f, -0.197679f, -0.450463f, -0.399927f, -0.031331f, 0.414227f, 0.600534f, 0.362021f, -0.156018f, -0.595235f, -0.639849f, -0.244309f, 0.327624f, 0.684841f, 0.585134f, 0.102556f, -0.434906f, -0.677892f, -0.481934f, + 0.014129f, 0.483575f, 0.618251f, 0.332509f, -0.171597f, -0.545927f, -0.547069f, -0.196533f, 0.258392f, 0.520496f, 0.426566f, 0.045920f, -0.360202f, -0.512877f, -0.312111f, 0.096838f, 0.433615f, 0.474500f, 0.194973f, -0.217117f, -0.487000f, -0.439250f, -0.109879f, 0.291113f, 0.515963f, 0.418802f, 0.043930f, -0.378561f, -0.565107f, -0.379160f, 0.061224f, 0.467198f, 0.578218f, 0.323802f, -0.139196f, -0.519383f, -0.569388f, -0.250943f, 0.231338f, 0.562130f, 0.524023f, 0.142931f, -0.325086f, -0.565414f, -0.425176f, -0.018815f, 0.365354f, 0.478495f, 0.275858f, -0.076817f, -0.336773f, -0.351325f, -0.145266f, 0.119622f, 0.268574f, 0.226547f, 0.049526f, -0.131174f, -0.202972f, -0.137985f, 0.006528f, 0.136051f, 0.173006f, 0.095314f, -0.048136f, -0.161874f, -0.168192f, -0.064261f, 0.078743f, 0.167861f, 0.146301f, 0.026552f, -0.113644f, -0.179167f, -0.125580f, 0.008523f, 0.132950f, 0.168499f, 0.093707f, -0.043550f, -0.153280f, -0.161822f, -0.064163f, 0.073638f, 0.161611f, 0.143109f, 0.029082f, -0.106025f, -0.171234f, -0.123276f, 0.003867f, 0.126660f, 0.166547f, 0.095192f, -0.043964f, -0.154618f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.009671f, -0.002398f, -0.005043f, -0.003774f, 0.012776f, 0.002295f, -0.052423f, -0.065725f, 0.028299f, 0.132646f, 0.109211f, -0.009662f, -0.086761f, -0.103559f, -0.139737f, -0.167821f, -0.071437f, 0.123885f, 0.228103f, 0.139344f, -0.029194f, -0.120403f, -0.107875f, -0.056103f, -0.011937f, 0.013977f, 0.027233f, 0.044472f, 0.065560f, 0.053630f, -0.010283f, -0.075516f, -0.084061f, -0.056008f, -0.043553f, -0.030501f, 0.035733f, 0.126023f, 0.136807f, 0.030712f, -0.101832f, -0.145269f, -0.073203f, 0.054061f, 0.154550f, 0.164992f, 0.065424f, -0.091776f, + -0.194612f, -0.153573f, 0.015104f, 0.192166f, 0.243030f, 0.115748f, -0.116416f, -0.291664f, -0.265199f, -0.027362f, 0.261857f, 0.377611f, 0.207991f, -0.142729f, -0.417288f, -0.391740f, -0.050925f, 0.375568f, 0.561838f, 0.333534f, -0.171270f, -0.579031f, -0.562315f, -0.109099f, 0.447616f, 0.681253f, 0.408710f, -0.166382f, -0.621353f, -0.639872f, -0.226609f, 0.325619f, 0.650493f, 0.547609f, 0.104153f, -0.377131f, -0.593510f, -0.434729f, -0.021908f, 0.386996f, 0.541133f, 0.344148f, -0.064620f, -0.403377f, -0.477284f, -0.308512f, -0.037754f, 0.223879f, 0.394623f, 0.371307f, 0.109676f, -0.255920f, -0.473827f, -0.383905f, -0.038949f, 0.347410f, 0.527531f, 0.359616f, -0.067687f, -0.451672f, -0.505895f, -0.208652f, 0.198366f, 0.436236f, 0.382164f, 0.100069f, -0.222133f, -0.374287f, -0.260464f, 0.021819f, 0.267359f, 0.335470f, 0.221492f, 0.001008f, -0.221321f, -0.320202f, -0.208740f, 0.056437f, 0.278109f, 0.284988f, 0.090755f, -0.132344f, -0.220290f, -0.141429f, 0.013876f, 0.124627f, 0.123990f, 0.030580f, -0.081502f, -0.143001f, -0.124777f, -0.030058f, 0.113354f, 0.235666f, 0.234131f, 0.055028f, + -0.217240f, -0.385574f, -0.293713f, 0.027439f, 0.362499f, 0.466663f, 0.246857f, -0.165989f, -0.498472f, -0.513915f, -0.178914f, 0.292521f, 0.569395f, 0.443178f, -0.002730f, -0.448465f, -0.582368f, -0.325902f, 0.133510f, 0.490160f, 0.519593f, 0.213836f, -0.215575f, -0.478827f, -0.408408f, -0.069122f, 0.301102f, 0.458148f, 0.306616f, -0.043388f, -0.352280f, -0.420947f, -0.226899f, 0.086213f, 0.330969f, 0.381882f, 0.213300f, -0.090525f, -0.353437f, -0.400344f, -0.188824f, 0.144741f, 0.380148f, 0.367610f, 0.123881f, -0.184101f, -0.352883f, -0.282348f, -0.040707f, 0.196311f, 0.276897f, 0.170490f, -0.028061f, -0.175950f, -0.184290f, -0.071754f, 0.067066f, 0.140138f, 0.112762f, 0.013476f, -0.089673f, -0.128730f, -0.079902f, 0.020090f, 0.103658f, 0.118975f, 0.057220f, -0.043976f, -0.118359f, -0.113520f, -0.032739f, 0.067326f, 0.121423f, 0.097100f, 0.008767f, -0.088602f, -0.128638f, -0.081807f, 0.019023f, 0.105985f, 0.125014f, 0.063692f, -0.042402f, -0.122759f, -0.118566f, -0.034177f, 0.068234f, 0.124292f, 0.104012f, 0.014836f, -0.092555f, -0.137765f, -0.081403f, 0.022488f, 0.089067f, 0.102950f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.009671f, -0.002398f, -0.005043f, -0.003774f, 0.012776f, 0.002295f, -0.052423f, -0.065725f, 0.028299f, 0.132646f, 0.109211f, -0.009662f, -0.086761f, -0.103559f, -0.139737f, -0.167821f, -0.071437f, 0.123885f, 0.228103f, 0.139344f, -0.029194f, -0.120403f, -0.107875f, -0.056103f, -0.011937f, 0.013977f, 0.027233f, 0.044472f, 0.065560f, 0.053630f, -0.010283f, -0.075516f, -0.084061f, -0.056008f, -0.043553f, -0.030501f, 0.035733f, 0.126023f, 0.136807f, 0.030712f, -0.101832f, -0.145269f, -0.073203f, 0.054061f, 0.154550f, 0.164992f, 0.065424f, -0.091776f, + -0.194612f, -0.153573f, 0.015104f, 0.192166f, 0.243030f, 0.115748f, -0.116416f, -0.291664f, -0.265199f, -0.027362f, 0.261857f, 0.377611f, 0.207991f, -0.142729f, -0.417288f, -0.391740f, -0.050925f, 0.375568f, 0.561838f, 0.333534f, -0.171270f, -0.579031f, -0.562315f, -0.109099f, 0.447616f, 0.681253f, 0.408710f, -0.166382f, -0.621353f, -0.639872f, -0.226609f, 0.325619f, 0.650493f, 0.547609f, 0.104153f, -0.377131f, -0.593510f, -0.434729f, -0.021908f, 0.386996f, 0.541133f, 0.344148f, -0.064620f, -0.403377f, -0.477284f, -0.308512f, -0.037754f, 0.223879f, 0.394623f, 0.371307f, 0.109676f, -0.255920f, -0.473827f, -0.383905f, -0.038949f, 0.347410f, 0.527531f, 0.359616f, -0.067687f, -0.451672f, -0.505895f, -0.208652f, 0.198366f, 0.436236f, 0.382164f, 0.100069f, -0.222133f, -0.374287f, -0.260464f, 0.021819f, 0.267359f, 0.335470f, 0.221492f, 0.001008f, -0.221321f, -0.320202f, -0.208740f, 0.056437f, 0.278109f, 0.284988f, 0.090755f, -0.132344f, -0.220290f, -0.141429f, 0.013876f, 0.124627f, 0.123990f, 0.030580f, -0.081502f, -0.143001f, -0.124777f, -0.030058f, 0.113354f, 0.235666f, 0.234131f, 0.055028f, + -0.217240f, -0.385574f, -0.293713f, 0.027439f, 0.362499f, 0.466663f, 0.246857f, -0.165989f, -0.498472f, -0.513915f, -0.178914f, 0.292521f, 0.569395f, 0.443178f, -0.002730f, -0.448465f, -0.582368f, -0.325902f, 0.133510f, 0.490160f, 0.519593f, 0.213836f, -0.215575f, -0.478827f, -0.408408f, -0.069122f, 0.301102f, 0.458148f, 0.306616f, -0.043388f, -0.352280f, -0.420947f, -0.226899f, 0.086213f, 0.330969f, 0.381882f, 0.213300f, -0.090525f, -0.353437f, -0.400344f, -0.188824f, 0.144741f, 0.380148f, 0.367610f, 0.123881f, -0.184101f, -0.352883f, -0.282348f, -0.040707f, 0.196311f, 0.276897f, 0.170490f, -0.028061f, -0.175950f, -0.184290f, -0.071754f, 0.067066f, 0.140138f, 0.112762f, 0.013476f, -0.089673f, -0.128730f, -0.079902f, 0.020090f, 0.103658f, 0.118975f, 0.057220f, -0.043976f, -0.118359f, -0.113520f, -0.032739f, 0.067326f, 0.121423f, 0.097100f, 0.008767f, -0.088602f, -0.128638f, -0.081807f, 0.019023f, 0.105985f, 0.125014f, 0.063692f, -0.042402f, -0.122759f, -0.118566f, -0.034177f, 0.068234f, 0.124292f, 0.104012f, 0.014836f, -0.092555f, -0.137765f, -0.081403f, 0.022488f, 0.089067f, 0.102950f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.028389f, -0.005278f, -0.054637f, -0.169399f, -0.157904f, 0.125765f, 0.492043f, 0.508943f, -0.008427f, -0.675150f, -0.853474f, -0.316569f, 0.501173f, 0.941674f, 0.720447f, 0.073423f, -0.540885f, -0.770187f, -0.507163f, 0.092717f, 0.667105f, 0.830015f, 0.433738f, -0.290332f, -0.862726f, -0.892713f, -0.368575f, 0.342113f, 0.784566f, 0.735024f, 0.291077f, -0.253708f, -0.587951f, -0.538791f, -0.179797f, 0.213728f, 0.389433f, 0.311209f, 0.114487f, -0.072046f, -0.197297f, -0.236324f, -0.170713f, -0.024583f, 0.137226f, 0.247963f, 0.252819f, 0.123370f, + -0.094107f, -0.273335f, -0.299087f, -0.156398f, 0.078198f, 0.291799f, 0.368753f, 0.238778f, -0.048808f, -0.322948f, -0.407630f, -0.249085f, 0.058800f, 0.337573f, 0.418201f, 0.239838f, -0.094125f, -0.370050f, -0.409480f, -0.191186f, 0.139321f, 0.367386f, 0.349877f, 0.112808f, -0.169146f, -0.304971f, -0.224896f, -0.014286f, 0.167661f, 0.208427f, 0.111270f, -0.030879f, -0.121587f, -0.124061f, -0.059062f, 0.029164f, 0.097757f, 0.119895f, 0.091860f, 0.023127f, -0.073705f, -0.168657f, -0.204509f, -0.134685f, 0.023137f, 0.186667f, 0.259881f, 0.183611f, -0.026361f, -0.256797f, -0.342188f, -0.190867f, 0.118668f, 0.382882f, 0.417720f, 0.175644f, -0.221842f, -0.531322f, -0.520084f, -0.146695f, 0.352573f, 0.600974f, 0.382227f, -0.142702f, -0.532281f, -0.443798f, 0.039325f, 0.476537f, 0.488134f, 0.091741f, -0.361404f, -0.514066f, -0.257965f, 0.219758f, 0.552995f, 0.444987f, -0.054093f, -0.518598f, -0.512679f, -0.029513f, 0.485749f, 0.571942f, 0.177831f, -0.332935f, -0.535851f, -0.297529f, 0.148195f, 0.419516f, 0.311322f, -0.041599f, -0.304305f, -0.252564f, 0.039945f, 0.297644f, 0.300605f, 0.059205f, + -0.220168f, -0.316611f, -0.168704f, 0.088496f, 0.247525f, 0.206120f, 0.037520f, -0.103974f, -0.130526f, -0.070457f, -0.000977f, 0.031312f, 0.025791f, 0.002623f, -0.015916f, -0.015573f, -0.001424f, 0.006688f, 0.001678f, 0.003529f, 0.030354f, 0.060939f, 0.049027f, -0.016883f, -0.085346f, -0.090220f, -0.021341f, 0.065913f, 0.107379f, 0.084075f, 0.024352f, -0.030536f, -0.058835f, -0.065944f, -0.064713f, -0.050445f, -0.006497f, 0.060373f, 0.106995f, 0.091751f, 0.017698f, -0.070548f, -0.120302f, -0.097098f, -0.004966f, 0.099881f, 0.137823f, 0.076031f, -0.035606f, -0.111130f, -0.102507f, -0.026230f, 0.059299f, 0.093310f, 0.055057f, -0.016119f, -0.056914f, -0.043417f, -0.004882f, 0.021932f, 0.026956f, 0.015759f, -0.005454f, -0.024768f, -0.026780f, -0.009809f, 0.011675f, 0.023789f, 0.021849f, 0.006652f, -0.014452f, -0.026465f, -0.018854f, 0.002603f, 0.021685f, 0.025328f, 0.010368f, -0.014367f, -0.031027f, -0.026433f, -0.004358f, 0.019936f, 0.032748f, 0.026369f, 0.001950f, -0.024923f, -0.033169f, -0.017718f, 0.007495f, 0.027748f, 0.034364f, 0.019431f, -0.012784f, -0.034390f, -0.022781f, 0.002350f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.028389f, -0.005278f, -0.054637f, -0.169399f, -0.157904f, 0.125765f, 0.492043f, 0.508943f, -0.008427f, -0.675150f, -0.853474f, -0.316569f, 0.501173f, 0.941674f, 0.720447f, 0.073423f, -0.540885f, -0.770187f, -0.507163f, 0.092717f, 0.667105f, 0.830015f, 0.433738f, -0.290332f, -0.862726f, -0.892713f, -0.368575f, 0.342113f, 0.784566f, 0.735024f, 0.291077f, -0.253708f, -0.587951f, -0.538791f, -0.179797f, 0.213728f, 0.389433f, 0.311209f, 0.114487f, -0.072046f, -0.197297f, -0.236324f, -0.170713f, -0.024583f, 0.137226f, 0.247963f, 0.252819f, 0.123370f, + -0.094107f, -0.273335f, -0.299087f, -0.156398f, 0.078198f, 0.291799f, 0.368753f, 0.238778f, -0.048808f, -0.322948f, -0.407630f, -0.249085f, 0.058800f, 0.337573f, 0.418201f, 0.239838f, -0.094125f, -0.370050f, -0.409480f, -0.191186f, 0.139321f, 0.367386f, 0.349877f, 0.112808f, -0.169146f, -0.304971f, -0.224896f, -0.014286f, 0.167661f, 0.208427f, 0.111270f, -0.030879f, -0.121587f, -0.124061f, -0.059062f, 0.029164f, 0.097757f, 0.119895f, 0.091860f, 0.023127f, -0.073705f, -0.168657f, -0.204509f, -0.134685f, 0.023137f, 0.186667f, 0.259881f, 0.183611f, -0.026361f, -0.256797f, -0.342188f, -0.190867f, 0.118668f, 0.382882f, 0.417720f, 0.175644f, -0.221842f, -0.531322f, -0.520084f, -0.146695f, 0.352573f, 0.600974f, 0.382227f, -0.142702f, -0.532281f, -0.443798f, 0.039325f, 0.476537f, 0.488134f, 0.091741f, -0.361404f, -0.514066f, -0.257965f, 0.219758f, 0.552995f, 0.444987f, -0.054093f, -0.518598f, -0.512679f, -0.029513f, 0.485749f, 0.571942f, 0.177831f, -0.332935f, -0.535851f, -0.297529f, 0.148195f, 0.419516f, 0.311322f, -0.041599f, -0.304305f, -0.252564f, 0.039945f, 0.297644f, 0.300605f, 0.059205f, + -0.220168f, -0.316611f, -0.168704f, 0.088496f, 0.247525f, 0.206120f, 0.037520f, -0.103974f, -0.130526f, -0.070457f, -0.000977f, 0.031312f, 0.025791f, 0.002623f, -0.015916f, -0.015573f, -0.001424f, 0.006688f, 0.001678f, 0.003529f, 0.030354f, 0.060939f, 0.049027f, -0.016883f, -0.085346f, -0.090220f, -0.021341f, 0.065913f, 0.107379f, 0.084075f, 0.024352f, -0.030536f, -0.058835f, -0.065944f, -0.064713f, -0.050445f, -0.006497f, 0.060373f, 0.106995f, 0.091751f, 0.017698f, -0.070548f, -0.120302f, -0.097098f, -0.004966f, 0.099881f, 0.137823f, 0.076031f, -0.035606f, -0.111130f, -0.102507f, -0.026230f, 0.059299f, 0.093310f, 0.055057f, -0.016119f, -0.056914f, -0.043417f, -0.004882f, 0.021932f, 0.026956f, 0.015759f, -0.005454f, -0.024768f, -0.026780f, -0.009809f, 0.011675f, 0.023789f, 0.021849f, 0.006652f, -0.014452f, -0.026465f, -0.018854f, 0.002603f, 0.021685f, 0.025328f, 0.010368f, -0.014367f, -0.031027f, -0.026433f, -0.004358f, 0.019936f, 0.032748f, 0.026369f, 0.001950f, -0.024923f, -0.033169f, -0.017718f, 0.007495f, 0.027748f, 0.034364f, 0.019431f, -0.012784f, -0.034390f, -0.022781f, 0.002350f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.014512f, -0.016429f, -0.034557f, -0.041369f, -0.011506f, 0.011233f, -0.001682f, 0.020521f, 0.114955f, 0.151730f, -0.000411f, -0.239545f, -0.329315f, -0.188255f, 0.057294f, 0.247912f, 0.285779f, 0.131972f, -0.134882f, -0.300966f, -0.198131f, 0.102896f, 0.353787f, 0.357409f, 0.104705f, -0.241536f, -0.450142f, -0.382109f, -0.107998f, 0.164637f, 0.284453f, 0.237340f, 0.082952f, -0.088468f, -0.161984f, -0.079488f, 0.074373f, 0.151869f, 0.106220f, 0.008959f, -0.068660f, -0.107952f, -0.098278f, -0.030286f, 0.062196f, 0.115330f, 0.096918f, 0.024364f, + -0.062598f, -0.118401f, -0.105635f, -0.027284f, 0.065178f, 0.113179f, 0.092096f, 0.015221f, -0.076199f, -0.125822f, -0.095722f, -0.001227f, 0.096789f, 0.136832f, 0.096202f, 0.003389f, -0.080494f, -0.107751f, -0.079055f, -0.026005f, 0.027831f, 0.067568f, 0.069670f, 0.024810f, -0.030010f, -0.043251f, -0.011822f, 0.021250f, 0.026793f, 0.012819f, -0.005506f, -0.021626f, -0.024631f, -0.005569f, 0.019541f, 0.021544f, -0.002011f, -0.021801f, -0.017050f, -0.002437f, -0.006760f, -0.035220f, -0.059542f, -0.043288f, 0.021198f, 0.096044f, 0.121579f, 0.067529f, -0.034057f, -0.110908f, -0.111511f, -0.046586f, 0.027860f, 0.062770f, 0.048662f, 0.006705f, -0.036054f, -0.059507f, -0.052318f, -0.014186f, 0.040268f, 0.080701f, 0.071134f, -0.000909f, -0.093787f, -0.127975f, -0.062266f, 0.045961f, 0.085172f, 0.009536f, -0.100685f, -0.115131f, 0.012257f, 0.188930f, 0.258913f, 0.137516f, -0.104488f, -0.278572f, -0.226963f, 0.027318f, 0.275194f, 0.296640f, 0.062780f, -0.235745f, -0.357727f, -0.207734f, 0.101382f, 0.337736f, 0.318714f, 0.057884f, -0.230749f, -0.314764f, -0.153394f, 0.090726f, 0.233204f, 0.210926f, + 0.065868f, -0.115416f, -0.220274f, -0.163482f, 0.013109f, 0.150715f, 0.138342f, 0.025835f, -0.063481f, -0.077109f, -0.044946f, -0.003320f, 0.029509f, 0.035000f, 0.008694f, -0.021467f, -0.027438f, -0.015248f, -0.002032f, 0.015826f, 0.042475f, 0.053086f, 0.019082f, -0.044226f, -0.080752f, -0.048149f, 0.037747f, 0.110629f, 0.106264f, 0.018906f, -0.087976f, -0.132783f, -0.084551f, 0.014592f, 0.089376f, 0.092076f, 0.032992f, -0.036804f, -0.068869f, -0.049589f, -0.001053f, 0.040434f, 0.048997f, 0.024613f, -0.009241f, -0.026758f, -0.021550f, -0.006760f, 0.002714f, 0.003226f, 0.001042f, 0.003587f, 0.010448f, 0.012400f, 0.004412f, -0.003334f, 0.000949f, 0.008792f, 0.000811f, -0.021391f, -0.032702f, -0.018298f, 0.008520f, 0.026675f, 0.027695f, 0.012546f, -0.012599f, -0.032061f, -0.029080f, -0.005011f, 0.020727f, 0.031063f, 0.022444f, 0.000380f, -0.023163f, -0.031978f, -0.018604f, 0.006009f, 0.023546f, 0.024911f, 0.011571f, -0.009700f, -0.026389f, -0.024980f, -0.005203f, 0.016979f, 0.025820f, 0.018578f, 0.000957f, -0.018776f, -0.028298f, -0.017328f, 0.007337f, 0.023219f, 0.017507f, 0.003770f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.014512f, 0.016429f, 0.034557f, 0.041369f, 0.011506f, -0.011233f, 0.001682f, -0.020521f, -0.114955f, -0.151730f, 0.000411f, 0.239545f, 0.329315f, 0.188255f, -0.057294f, -0.247912f, -0.285779f, -0.131972f, 0.134882f, 0.300966f, 0.198131f, -0.102896f, -0.353787f, -0.357409f, -0.104705f, 0.241536f, 0.450142f, 0.382109f, 0.107998f, -0.164637f, -0.284453f, -0.237340f, -0.082952f, 0.088468f, 0.161984f, 0.079488f, -0.074373f, -0.151869f, -0.106220f, -0.008959f, 0.068660f, 0.107952f, 0.098278f, 0.030286f, -0.062196f, -0.115330f, -0.096918f, -0.024364f, + 0.062598f, 0.118401f, 0.105635f, 0.027284f, -0.065178f, -0.113179f, -0.092096f, -0.015221f, 0.076199f, 0.125822f, 0.095722f, 0.001227f, -0.096789f, -0.136832f, -0.096202f, -0.003389f, 0.080494f, 0.107751f, 0.079055f, 0.026005f, -0.027831f, -0.067568f, -0.069670f, -0.024810f, 0.030010f, 0.043251f, 0.011822f, -0.021250f, -0.026793f, -0.012819f, 0.005506f, 0.021626f, 0.024631f, 0.005569f, -0.019541f, -0.021544f, 0.002011f, 0.021801f, 0.017050f, 0.002437f, 0.006760f, 0.035220f, 0.059542f, 0.043288f, -0.021198f, -0.096044f, -0.121579f, -0.067529f, 0.034057f, 0.110908f, 0.111511f, 0.046586f, -0.027860f, -0.062770f, -0.048662f, -0.006705f, 0.036054f, 0.059507f, 0.052318f, 0.014186f, -0.040268f, -0.080701f, -0.071134f, 0.000909f, 0.093787f, 0.127975f, 0.062266f, -0.045961f, -0.085172f, -0.009536f, 0.100685f, 0.115131f, -0.012257f, -0.188930f, -0.258913f, -0.137516f, 0.104488f, 0.278572f, 0.226963f, -0.027318f, -0.275194f, -0.296640f, -0.062780f, 0.235745f, 0.357727f, 0.207734f, -0.101382f, -0.337736f, -0.318714f, -0.057884f, 0.230749f, 0.314764f, 0.153394f, -0.090726f, -0.233204f, -0.210926f, + -0.065868f, 0.115416f, 0.220274f, 0.163482f, -0.013109f, -0.150715f, -0.138342f, -0.025835f, 0.063481f, 0.077109f, 0.044946f, 0.003320f, -0.029509f, -0.035000f, -0.008694f, 0.021467f, 0.027438f, 0.015248f, 0.002032f, -0.015826f, -0.042475f, -0.053086f, -0.019082f, 0.044226f, 0.080752f, 0.048149f, -0.037747f, -0.110629f, -0.106264f, -0.018906f, 0.087976f, 0.132783f, 0.084551f, -0.014592f, -0.089376f, -0.092076f, -0.032992f, 0.036804f, 0.068869f, 0.049589f, 0.001053f, -0.040434f, -0.048997f, -0.024613f, 0.009241f, 0.026758f, 0.021550f, 0.006760f, -0.002714f, -0.003226f, -0.001042f, -0.003587f, -0.010448f, -0.012400f, -0.004412f, 0.003334f, -0.000949f, -0.008792f, -0.000811f, 0.021391f, 0.032702f, 0.018298f, -0.008520f, -0.026675f, -0.027695f, -0.012546f, 0.012599f, 0.032061f, 0.029080f, 0.005011f, -0.020727f, -0.031063f, -0.022444f, -0.000380f, 0.023163f, 0.031978f, 0.018604f, -0.006009f, -0.023546f, -0.024911f, -0.011571f, 0.009700f, 0.026389f, 0.024980f, 0.005203f, -0.016979f, -0.025820f, -0.018578f, -0.000957f, 0.018776f, 0.028298f, 0.017328f, -0.007337f, -0.023219f, -0.017507f, -0.003770f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.039501f, -0.014112f, 0.001447f, -0.004068f, -0.002193f, 0.017003f, 0.016961f, -0.019323f, -0.036823f, 0.021491f, 0.117651f, 0.152439f, 0.080915f, -0.057964f, -0.197903f, -0.267563f, -0.196424f, 0.006805f, 0.198191f, 0.218189f, 0.071960f, -0.084962f, -0.134768f, -0.095081f, -0.038550f, -0.000622f, 0.019901f, 0.031601f, 0.039778f, 0.036120f, 0.005867f, -0.036701f, -0.050091f, -0.024227f, 0.002850f, 0.007342f, 0.008506f, 0.013304f, -0.007849f, -0.058824f, -0.088248f, -0.057546f, 0.008154f, 0.063020f, 0.087248f, 0.071046f, 0.006013f, -0.078526f, + -0.115136f, -0.066163f, 0.033001f, 0.112445f, 0.123994f, 0.056966f, -0.062296f, -0.168672f, -0.186057f, -0.087154f, 0.072786f, 0.188814f, 0.179448f, 0.045191f, -0.125509f, -0.210510f, -0.140347f, 0.041516f, 0.198222f, 0.201089f, 0.041516f, -0.151201f, -0.219459f, -0.115877f, 0.065868f, 0.185618f, 0.167548f, 0.036145f, -0.115485f, -0.184435f, -0.123726f, 0.019027f, 0.136484f, 0.150895f, 0.067063f, -0.056561f, -0.158565f, -0.186490f, -0.104501f, 0.059578f, 0.192628f, 0.183234f, 0.041682f, -0.112351f, -0.186900f, -0.184294f, -0.122920f, 0.015298f, 0.199251f, 0.287141f, 0.153272f, -0.137288f, -0.353586f, -0.306684f, -0.011627f, 0.324107f, 0.445307f, 0.241526f, -0.139115f, -0.396338f, -0.349188f, -0.086461f, 0.163750f, 0.253809f, 0.180660f, 0.020406f, -0.123393f, -0.158575f, -0.073683f, 0.044711f, 0.106214f, 0.102983f, 0.072845f, 0.022835f, -0.057935f, -0.136913f, -0.146360f, -0.057455f, 0.079377f, 0.171897f, 0.157908f, 0.050169f, -0.077326f, -0.147247f, -0.129855f, -0.050052f, 0.038481f, 0.084909f, 0.066918f, 0.001823f, -0.064539f, -0.081818f, -0.022719f, 0.085073f, 0.151892f, 0.091934f, + -0.075335f, -0.215637f, -0.203705f, -0.046330f, 0.131739f, 0.203050f, 0.127188f, -0.038046f, -0.180410f, -0.204110f, -0.093600f, 0.076439f, 0.192839f, 0.175971f, 0.031978f, -0.141483f, -0.217916f, -0.142897f, 0.020988f, 0.153950f, 0.174858f, 0.084624f, -0.048874f, -0.132889f, -0.108840f, 0.000034f, 0.105166f, 0.127191f, 0.053918f, -0.061650f, -0.141006f, -0.129950f, -0.037851f, 0.070020f, 0.129452f, 0.119294f, 0.049896f, -0.054182f, -0.143336f, -0.153402f, -0.063283f, 0.071070f, 0.159936f, 0.148673f, 0.046307f, -0.084099f, -0.157546f, -0.123720f, -0.012279f, 0.090418f, 0.116318f, 0.062861f, -0.020579f, -0.074279f, -0.067225f, -0.017196f, 0.028481f, 0.039062f, 0.020496f, -0.006691f, -0.027778f, -0.031293f, -0.012037f, 0.016213f, 0.029948f, 0.021218f, 0.000256f, -0.021030f, -0.032573f, -0.023971f, 0.002489f, 0.025708f, 0.027527f, 0.011059f, -0.010583f, -0.027981f, -0.031554f, -0.013988f, 0.015027f, 0.032866f, 0.027570f, 0.005362f, -0.020976f, -0.036955f, -0.029120f, -0.000144f, 0.027148f, 0.033176f, 0.018428f, -0.007250f, -0.032389f, -0.038803f, -0.015968f, 0.016179f, 0.027465f, 0.020341f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.039501f, 0.014112f, -0.001447f, 0.004068f, 0.002193f, -0.017003f, -0.016961f, 0.019323f, 0.036823f, -0.021491f, -0.117651f, -0.152439f, -0.080915f, 0.057964f, 0.197903f, 0.267563f, 0.196424f, -0.006805f, -0.198191f, -0.218189f, -0.071960f, 0.084962f, 0.134768f, 0.095081f, 0.038550f, 0.000622f, -0.019901f, -0.031601f, -0.039778f, -0.036120f, -0.005867f, 0.036701f, 0.050091f, 0.024227f, -0.002850f, -0.007342f, -0.008506f, -0.013304f, 0.007849f, 0.058824f, 0.088248f, 0.057546f, -0.008154f, -0.063020f, -0.087248f, -0.071046f, -0.006013f, 0.078526f, + 0.115136f, 0.066163f, -0.033001f, -0.112445f, -0.123994f, -0.056966f, 0.062296f, 0.168672f, 0.186057f, 0.087154f, -0.072786f, -0.188814f, -0.179448f, -0.045191f, 0.125509f, 0.210510f, 0.140347f, -0.041516f, -0.198222f, -0.201089f, -0.041516f, 0.151201f, 0.219459f, 0.115877f, -0.065868f, -0.185618f, -0.167548f, -0.036145f, 0.115485f, 0.184435f, 0.123726f, -0.019027f, -0.136484f, -0.150895f, -0.067063f, 0.056561f, 0.158565f, 0.186490f, 0.104501f, -0.059578f, -0.192628f, -0.183234f, -0.041682f, 0.112351f, 0.186900f, 0.184294f, 0.122920f, -0.015298f, -0.199251f, -0.287141f, -0.153272f, 0.137288f, 0.353586f, 0.306684f, 0.011627f, -0.324107f, -0.445307f, -0.241526f, 0.139115f, 0.396338f, 0.349188f, 0.086461f, -0.163750f, -0.253809f, -0.180660f, -0.020406f, 0.123393f, 0.158575f, 0.073683f, -0.044711f, -0.106214f, -0.102983f, -0.072845f, -0.022835f, 0.057935f, 0.136913f, 0.146360f, 0.057455f, -0.079377f, -0.171897f, -0.157908f, -0.050169f, 0.077326f, 0.147247f, 0.129855f, 0.050052f, -0.038481f, -0.084909f, -0.066918f, -0.001823f, 0.064539f, 0.081818f, 0.022719f, -0.085073f, -0.151892f, -0.091934f, + 0.075335f, 0.215637f, 0.203705f, 0.046330f, -0.131739f, -0.203050f, -0.127188f, 0.038046f, 0.180410f, 0.204110f, 0.093600f, -0.076439f, -0.192839f, -0.175971f, -0.031978f, 0.141483f, 0.217916f, 0.142897f, -0.020988f, -0.153950f, -0.174858f, -0.084624f, 0.048874f, 0.132889f, 0.108840f, -0.000034f, -0.105166f, -0.127191f, -0.053918f, 0.061650f, 0.141006f, 0.129950f, 0.037851f, -0.070020f, -0.129452f, -0.119294f, -0.049896f, 0.054182f, 0.143336f, 0.153402f, 0.063283f, -0.071070f, -0.159936f, -0.148673f, -0.046307f, 0.084099f, 0.157546f, 0.123720f, 0.012279f, -0.090418f, -0.116318f, -0.062861f, 0.020579f, 0.074279f, 0.067225f, 0.017196f, -0.028481f, -0.039062f, -0.020496f, 0.006691f, 0.027778f, 0.031293f, 0.012037f, -0.016213f, -0.029948f, -0.021218f, -0.000256f, 0.021030f, 0.032573f, 0.023971f, -0.002489f, -0.025708f, -0.027527f, -0.011059f, 0.010583f, 0.027981f, 0.031554f, 0.013988f, -0.015027f, -0.032866f, -0.027570f, -0.005362f, 0.020976f, 0.036955f, 0.029120f, 0.000144f, -0.027148f, -0.033176f, -0.018428f, 0.007250f, 0.032389f, 0.038803f, 0.015968f, -0.016179f, -0.027465f, -0.020341f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.008028f, -0.030862f, 0.009676f, 0.085727f, 0.067804f, -0.036549f, -0.065052f, 0.024173f, 0.057366f, -0.086619f, -0.276767f, -0.304011f, -0.135711f, 0.094524f, 0.250640f, 0.264991f, 0.134484f, -0.063179f, -0.197592f, -0.192615f, -0.080410f, 0.061129f, 0.166518f, 0.174103f, 0.050098f, -0.135892f, -0.228483f, -0.136281f, 0.066498f, 0.216945f, 0.213088f, 0.075011f, -0.096953f, -0.193579f, -0.157912f, -0.018712f, 0.129326f, 0.191689f, 0.135575f, 0.004377f, -0.117880f, -0.165161f, -0.126401f, -0.031928f, 0.082130f, 0.179910f, 0.210960f, 0.130206f, + -0.046955f, -0.225684f, -0.288155f, -0.178546f, 0.052377f, 0.269483f, 0.330193f, 0.178996f, -0.101201f, -0.330484f, -0.351136f, -0.142531f, 0.156960f, 0.344793f, 0.297740f, 0.054499f, -0.218874f, -0.343145f, -0.239732f, 0.018281f, 0.250677f, 0.296501f, 0.135737f, -0.099830f, -0.237905f, -0.197605f, -0.036459f, 0.109878f, 0.141045f, 0.066798f, -0.024553f, -0.065247f, -0.054502f, -0.015417f, 0.037788f, 0.068681f, 0.021734f, -0.087606f, -0.138661f, -0.039928f, 0.127028f, 0.179171f, 0.050024f, -0.128351f, -0.174820f, -0.045040f, 0.140211f, 0.210276f, 0.081798f, -0.167710f, -0.335089f, -0.243401f, 0.083371f, 0.396693f, 0.422168f, 0.114520f, -0.291912f, -0.493282f, -0.364994f, -0.020577f, 0.307036f, 0.412269f, 0.227227f, -0.114617f, -0.344070f, -0.278235f, 0.002836f, 0.246027f, 0.281126f, 0.139970f, -0.041808f, -0.151538f, -0.137708f, -0.020886f, 0.103939f, 0.138466f, 0.078132f, -0.000601f, -0.044502f, -0.061313f, -0.059599f, -0.019148f, 0.059109f, 0.121678f, 0.108125f, 0.011409f, -0.111949f, -0.178258f, -0.131807f, 0.011996f, 0.169925f, 0.240250f, 0.160701f, -0.045311f, -0.250229f, -0.286542f, + -0.097101f, 0.176472f, 0.308886f, 0.205740f, -0.027821f, -0.215339f, -0.251699f, -0.134775f, 0.059793f, 0.206504f, 0.196671f, 0.032547f, -0.157208f, -0.222642f, -0.116422f, 0.077432f, 0.215840f, 0.201364f, 0.048775f, -0.130251f, -0.213974f, -0.156757f, -0.006668f, 0.140419f, 0.199403f, 0.137146f, -0.009715f, -0.151536f, -0.199631f, -0.124755f, 0.024925f, 0.157980f, 0.197323f, 0.123194f, -0.019172f, -0.146052f, -0.181487f, -0.102240f, 0.043681f, 0.162951f, 0.177073f, 0.076212f, -0.072710f, -0.169936f, -0.150541f, -0.031056f, 0.101747f, 0.156659f, 0.105170f, -0.006275f, -0.099771f, -0.119755f, -0.061949f, 0.028726f, 0.088684f, 0.081352f, 0.022618f, -0.038960f, -0.064358f, -0.046128f, -0.001808f, 0.040523f, 0.055097f, 0.032754f, -0.011323f, -0.047621f, -0.052791f, -0.023796f, 0.020890f, 0.051770f, 0.047433f, 0.010778f, -0.032767f, -0.054259f, -0.040478f, -0.000817f, 0.038929f, 0.052589f, 0.031619f, -0.008902f, -0.042108f, -0.047606f, -0.022448f, 0.017823f, 0.047050f, 0.044986f, 0.012971f, -0.026626f, -0.047751f, -0.037995f, -0.003843f, 0.033852f, 0.050276f, 0.032277f, -0.009018f, -0.042975f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.008028f, 0.030862f, -0.009676f, -0.085727f, -0.067804f, 0.036549f, 0.065052f, -0.024173f, -0.057366f, 0.086619f, 0.276767f, 0.304011f, 0.135711f, -0.094524f, -0.250640f, -0.264991f, -0.134484f, 0.063179f, 0.197592f, 0.192615f, 0.080410f, -0.061129f, -0.166518f, -0.174103f, -0.050098f, 0.135892f, 0.228483f, 0.136281f, -0.066498f, -0.216945f, -0.213088f, -0.075011f, 0.096953f, 0.193579f, 0.157912f, 0.018712f, -0.129326f, -0.191689f, -0.135575f, -0.004377f, 0.117880f, 0.165161f, 0.126401f, 0.031928f, -0.082130f, -0.179910f, -0.210960f, -0.130206f, + 0.046955f, 0.225684f, 0.288155f, 0.178546f, -0.052377f, -0.269483f, -0.330193f, -0.178996f, 0.101201f, 0.330484f, 0.351136f, 0.142531f, -0.156960f, -0.344793f, -0.297740f, -0.054499f, 0.218874f, 0.343145f, 0.239732f, -0.018281f, -0.250677f, -0.296501f, -0.135737f, 0.099830f, 0.237905f, 0.197605f, 0.036459f, -0.109878f, -0.141045f, -0.066798f, 0.024553f, 0.065247f, 0.054502f, 0.015417f, -0.037788f, -0.068681f, -0.021734f, 0.087606f, 0.138661f, 0.039928f, -0.127028f, -0.179171f, -0.050024f, 0.128351f, 0.174820f, 0.045040f, -0.140211f, -0.210276f, -0.081798f, 0.167710f, 0.335089f, 0.243401f, -0.083371f, -0.396693f, -0.422168f, -0.114520f, 0.291912f, 0.493282f, 0.364994f, 0.020577f, -0.307036f, -0.412269f, -0.227227f, 0.114617f, 0.344070f, 0.278235f, -0.002836f, -0.246027f, -0.281126f, -0.139970f, 0.041808f, 0.151538f, 0.137708f, 0.020886f, -0.103939f, -0.138466f, -0.078132f, 0.000601f, 0.044502f, 0.061313f, 0.059599f, 0.019148f, -0.059109f, -0.121678f, -0.108125f, -0.011409f, 0.111949f, 0.178258f, 0.131807f, -0.011996f, -0.169925f, -0.240250f, -0.160701f, 0.045311f, 0.250229f, 0.286542f, + 0.097101f, -0.176472f, -0.308886f, -0.205740f, 0.027821f, 0.215339f, 0.251699f, 0.134775f, -0.059793f, -0.206504f, -0.196671f, -0.032547f, 0.157208f, 0.222642f, 0.116422f, -0.077432f, -0.215840f, -0.201364f, -0.048775f, 0.130251f, 0.213974f, 0.156757f, 0.006668f, -0.140419f, -0.199403f, -0.137146f, 0.009715f, 0.151536f, 0.199631f, 0.124755f, -0.024925f, -0.157980f, -0.197323f, -0.123194f, 0.019172f, 0.146052f, 0.181487f, 0.102240f, -0.043681f, -0.162951f, -0.177073f, -0.076212f, 0.072710f, 0.169936f, 0.150541f, 0.031056f, -0.101747f, -0.156659f, -0.105170f, 0.006275f, 0.099771f, 0.119755f, 0.061949f, -0.028726f, -0.088684f, -0.081352f, -0.022618f, 0.038960f, 0.064358f, 0.046128f, 0.001808f, -0.040523f, -0.055097f, -0.032754f, 0.011323f, 0.047621f, 0.052791f, 0.023796f, -0.020890f, -0.051770f, -0.047433f, -0.010778f, 0.032767f, 0.054259f, 0.040478f, 0.000817f, -0.038929f, -0.052589f, -0.031619f, 0.008902f, 0.042108f, 0.047606f, 0.022448f, -0.017823f, -0.047050f, -0.044986f, -0.012971f, 0.026626f, 0.047751f, 0.037995f, 0.003843f, -0.033852f, -0.050276f, -0.032277f, 0.009018f, 0.042975f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.021683f, 0.054940f, 0.082635f, 0.058825f, -0.010914f, -0.057174f, -0.032626f, 0.010089f, -0.014535f, -0.091370f, -0.113146f, -0.033086f, 0.065717f, 0.084827f, 0.031624f, -0.016134f, -0.016922f, 0.012844f, 0.049403f, 0.080502f, 0.085212f, 0.038538f, -0.055079f, -0.149205f, -0.182095f, -0.120155f, 0.011525f, 0.139266f, 0.192799f, 0.151271f, 0.041674f, -0.085172f, -0.165918f, -0.148310f, -0.042381f, 0.069406f, 0.108606f, 0.074496f, 0.016402f, -0.036597f, -0.076304f, -0.077498f, -0.022023f, 0.049474f, 0.069347f, 0.028950f, -0.015032f, -0.020709f, + -0.001272f, 0.015228f, 0.018319f, 0.001956f, -0.034453f, -0.061733f, -0.041166f, 0.016566f, 0.051205f, 0.027793f, -0.022026f, -0.047771f, -0.035099f, 0.000993f, 0.038979f, 0.045437f, -0.011300f, -0.104559f, -0.137665f, -0.039097f, 0.136194f, 0.238802f, 0.165681f, -0.043820f, -0.240751f, -0.278703f, -0.119215f, 0.130516f, 0.284675f, 0.223457f, -0.002635f, -0.213283f, -0.248434f, -0.091713f, 0.125377f, 0.227818f, 0.134514f, -0.071631f, -0.210450f, -0.162154f, 0.030756f, 0.209743f, 0.234553f, 0.083994f, -0.134806f, -0.259955f, -0.192614f, 0.018153f, 0.206423f, 0.225228f, 0.067808f, -0.131372f, -0.209868f, -0.111043f, 0.068780f, 0.167506f, 0.107736f, -0.036527f, -0.121143f, -0.067943f, 0.070883f, 0.154040f, 0.066224f, -0.155722f, -0.307983f, -0.198877f, 0.125923f, 0.390847f, 0.358489f, 0.053036f, -0.292363f, -0.444287f, -0.309274f, 0.032588f, 0.358022f, 0.429018f, 0.188971f, -0.167310f, -0.360823f, -0.264807f, 0.020949f, 0.275594f, 0.312499f, 0.096657f, -0.222027f, -0.405371f, -0.308466f, 0.007916f, 0.328137f, 0.432777f, 0.239282f, -0.133912f, -0.427765f, -0.426709f, -0.134561f, 0.228496f, + 0.408846f, 0.306423f, 0.020734f, -0.241910f, -0.315888f, -0.182754f, 0.037638f, 0.196803f, 0.216999f, 0.105679f, -0.071229f, -0.207442f, -0.201636f, -0.043702f, 0.152359f, 0.236945f, 0.149666f, -0.044532f, -0.214527f, -0.246695f, -0.112995f, 0.101451f, 0.249590f, 0.231984f, 0.065546f, -0.144776f, -0.278601f, -0.254879f, -0.070771f, 0.177518f, 0.336176f, 0.296735f, 0.075890f, -0.196068f, -0.356830f, -0.305258f, -0.065265f, 0.216496f, 0.358725f, 0.269230f, 0.008260f, -0.254334f, -0.350027f, -0.219676f, 0.044907f, 0.262219f, 0.292149f, 0.133224f, -0.092006f, -0.234847f, -0.215241f, -0.061114f, 0.115598f, 0.195040f, 0.133980f, -0.008953f, -0.128279f, -0.150709f, -0.074105f, 0.043715f, 0.124656f, 0.118470f, 0.034003f, -0.070298f, -0.127627f, -0.102482f, -0.009763f, 0.090830f, 0.130463f, 0.081835f, -0.019824f, -0.106564f, -0.124745f, -0.062615f, 0.042922f, 0.121320f, 0.115451f, 0.030731f, -0.070082f, -0.121739f, -0.097242f, -0.011124f, 0.086490f, 0.127804f, 0.078358f, -0.023953f, -0.103506f, -0.114839f, -0.059055f, 0.036969f, 0.119235f, 0.118976f, 0.025621f, -0.074930f, -0.096547f, -0.065130f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.021683f, 0.054940f, 0.082635f, 0.058825f, -0.010914f, -0.057174f, -0.032626f, 0.010089f, -0.014535f, -0.091370f, -0.113146f, -0.033086f, 0.065717f, 0.084827f, 0.031624f, -0.016134f, -0.016922f, 0.012844f, 0.049403f, 0.080502f, 0.085212f, 0.038538f, -0.055079f, -0.149205f, -0.182095f, -0.120155f, 0.011525f, 0.139266f, 0.192799f, 0.151271f, 0.041674f, -0.085172f, -0.165918f, -0.148310f, -0.042381f, 0.069406f, 0.108606f, 0.074496f, 0.016402f, -0.036597f, -0.076304f, -0.077498f, -0.022023f, 0.049474f, 0.069347f, 0.028950f, -0.015032f, -0.020709f, + -0.001272f, 0.015228f, 0.018319f, 0.001956f, -0.034453f, -0.061733f, -0.041166f, 0.016566f, 0.051205f, 0.027793f, -0.022026f, -0.047771f, -0.035099f, 0.000993f, 0.038979f, 0.045437f, -0.011300f, -0.104559f, -0.137665f, -0.039097f, 0.136194f, 0.238802f, 0.165681f, -0.043820f, -0.240751f, -0.278703f, -0.119215f, 0.130516f, 0.284675f, 0.223457f, -0.002635f, -0.213283f, -0.248434f, -0.091713f, 0.125377f, 0.227818f, 0.134514f, -0.071631f, -0.210450f, -0.162154f, 0.030756f, 0.209743f, 0.234553f, 0.083994f, -0.134806f, -0.259955f, -0.192614f, 0.018153f, 0.206423f, 0.225228f, 0.067808f, -0.131372f, -0.209868f, -0.111043f, 0.068780f, 0.167506f, 0.107736f, -0.036527f, -0.121143f, -0.067943f, 0.070883f, 0.154040f, 0.066224f, -0.155722f, -0.307983f, -0.198877f, 0.125923f, 0.390847f, 0.358489f, 0.053036f, -0.292363f, -0.444287f, -0.309274f, 0.032588f, 0.358022f, 0.429018f, 0.188971f, -0.167310f, -0.360823f, -0.264807f, 0.020949f, 0.275594f, 0.312499f, 0.096657f, -0.222027f, -0.405371f, -0.308466f, 0.007916f, 0.328137f, 0.432777f, 0.239282f, -0.133912f, -0.427765f, -0.426709f, -0.134561f, 0.228496f, + 0.408846f, 0.306423f, 0.020734f, -0.241910f, -0.315888f, -0.182754f, 0.037638f, 0.196803f, 0.216999f, 0.105679f, -0.071229f, -0.207442f, -0.201636f, -0.043702f, 0.152359f, 0.236945f, 0.149666f, -0.044532f, -0.214527f, -0.246695f, -0.112995f, 0.101451f, 0.249590f, 0.231984f, 0.065546f, -0.144776f, -0.278601f, -0.254879f, -0.070771f, 0.177518f, 0.336176f, 0.296735f, 0.075890f, -0.196068f, -0.356830f, -0.305258f, -0.065265f, 0.216496f, 0.358725f, 0.269230f, 0.008260f, -0.254334f, -0.350027f, -0.219676f, 0.044907f, 0.262219f, 0.292149f, 0.133224f, -0.092006f, -0.234847f, -0.215241f, -0.061114f, 0.115598f, 0.195040f, 0.133980f, -0.008953f, -0.128279f, -0.150709f, -0.074105f, 0.043715f, 0.124656f, 0.118470f, 0.034003f, -0.070298f, -0.127627f, -0.102482f, -0.009763f, 0.090830f, 0.130463f, 0.081835f, -0.019824f, -0.106564f, -0.124745f, -0.062615f, 0.042922f, 0.121320f, 0.115451f, 0.030731f, -0.070082f, -0.121739f, -0.097242f, -0.011124f, 0.086490f, 0.127804f, 0.078358f, -0.023953f, -0.103506f, -0.114839f, -0.059055f, 0.036969f, 0.119235f, 0.118976f, 0.025621f, -0.074930f, -0.096547f, -0.065130f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.007730f, 0.080171f, 0.096212f, 0.007453f, -0.088714f, -0.103934f, -0.054681f, 0.002742f, 0.030848f, 0.014234f, -0.015074f, 0.008277f, 0.076124f, 0.084684f, -0.006643f, -0.087253f, -0.055716f, 0.028293f, 0.051440f, 0.015024f, -0.006997f, 0.000005f, 0.001138f, -0.005280f, 0.001081f, 0.011824f, 0.010214f, 0.004305f, 0.001002f, -0.013290f, -0.037908f, -0.040559f, 0.001925f, 0.068256f, 0.107980f, 0.080616f, -0.011535f, -0.115216f, -0.161664f, -0.120497f, -0.015099f, 0.100268f, 0.160754f, 0.118872f, -0.004851f, -0.116017f, -0.131302f, -0.058630f, + 0.030118f, 0.078435f, 0.072718f, 0.028224f, -0.018292f, -0.029877f, -0.009849f, 0.001907f, -0.014831f, -0.036002f, -0.031315f, 0.001084f, 0.039750f, 0.056956f, 0.037594f, -0.000311f, -0.019439f, -0.010404f, 0.000519f, -0.001390f, -0.002178f, 0.003140f, 0.001182f, -0.003468f, 0.008642f, 0.024970f, 0.008761f, -0.035265f, -0.049325f, 0.007759f, 0.105746f, 0.161266f, 0.101696f, -0.065274f, -0.229396f, -0.257187f, -0.116632f, 0.094802f, 0.240451f, 0.230976f, 0.055049f, -0.196422f, -0.345277f, -0.256628f, 0.016416f, 0.266014f, 0.317287f, 0.159061f, -0.078991f, -0.230896f, -0.207273f, -0.058329f, 0.084873f, 0.143963f, 0.134948f, 0.090702f, 0.018696f, -0.063674f, -0.131507f, -0.180017f, -0.169874f, -0.003485f, 0.301468f, 0.472723f, 0.233945f, -0.287593f, -0.609607f, -0.417999f, 0.108829f, 0.537724f, 0.584882f, 0.248123f, -0.267570f, -0.641654f, -0.595451f, -0.122917f, 0.443556f, 0.677568f, 0.404806f, -0.160655f, -0.583438f, -0.539967f, -0.074916f, 0.431112f, 0.577305f, 0.268166f, -0.234307f, -0.542556f, -0.439331f, -0.021035f, 0.391348f, 0.500851f, 0.252348f, -0.150940f, -0.422825f, -0.397069f, + -0.116897f, 0.215040f, 0.378326f, 0.281929f, 0.016840f, -0.223517f, -0.285299f, -0.150921f, 0.064824f, 0.205529f, 0.186203f, 0.043905f, -0.108352f, -0.170014f, -0.110406f, 0.022238f, 0.130189f, 0.132527f, 0.032663f, -0.083919f, -0.128764f, -0.080520f, 0.017578f, 0.102451f, 0.126707f, 0.076735f, -0.023238f, -0.125560f, -0.179340f, -0.143762f, -0.011073f, 0.161503f, 0.263606f, 0.211305f, 0.023466f, -0.185632f, -0.284776f, -0.207866f, 0.002690f, 0.212376f, 0.279937f, 0.162514f, -0.052390f, -0.218160f, -0.233791f, -0.101898f, 0.082246f, 0.195628f, 0.171554f, 0.043387f, -0.090829f, -0.147029f, -0.105515f, -0.006855f, 0.082753f, 0.110922f, 0.067512f, -0.013413f, -0.078810f, -0.088794f, -0.038068f, 0.039653f, 0.090800f, 0.079988f, 0.016480f, -0.055921f, -0.091303f, -0.067670f, 0.001573f, 0.071708f, 0.093890f, 0.052725f, -0.021866f, -0.080145f, -0.086437f, -0.036745f, 0.038979f, 0.090792f, 0.082215f, 0.019655f, -0.053772f, -0.091807f, -0.071804f, -0.004177f, 0.069176f, 0.096481f, 0.056860f, -0.019434f, -0.079180f, -0.088307f, -0.043982f, 0.031667f, 0.092295f, 0.086506f, 0.010669f, -0.066537f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.007730f, 0.080171f, 0.096212f, 0.007453f, -0.088714f, -0.103934f, -0.054681f, 0.002742f, 0.030848f, 0.014234f, -0.015074f, 0.008277f, 0.076124f, 0.084684f, -0.006643f, -0.087253f, -0.055716f, 0.028293f, 0.051440f, 0.015024f, -0.006997f, 0.000005f, 0.001138f, -0.005280f, 0.001081f, 0.011824f, 0.010214f, 0.004305f, 0.001002f, -0.013290f, -0.037908f, -0.040559f, 0.001925f, 0.068256f, 0.107980f, 0.080616f, -0.011535f, -0.115216f, -0.161664f, -0.120497f, -0.015099f, 0.100268f, 0.160754f, 0.118872f, -0.004851f, -0.116017f, -0.131302f, -0.058630f, + 0.030118f, 0.078435f, 0.072718f, 0.028224f, -0.018292f, -0.029877f, -0.009849f, 0.001907f, -0.014831f, -0.036002f, -0.031315f, 0.001084f, 0.039750f, 0.056956f, 0.037594f, -0.000311f, -0.019439f, -0.010404f, 0.000519f, -0.001390f, -0.002178f, 0.003140f, 0.001182f, -0.003468f, 0.008642f, 0.024970f, 0.008761f, -0.035265f, -0.049325f, 0.007759f, 0.105746f, 0.161266f, 0.101696f, -0.065274f, -0.229396f, -0.257187f, -0.116632f, 0.094802f, 0.240451f, 0.230976f, 0.055049f, -0.196422f, -0.345277f, -0.256628f, 0.016416f, 0.266014f, 0.317287f, 0.159061f, -0.078991f, -0.230896f, -0.207273f, -0.058329f, 0.084873f, 0.143963f, 0.134948f, 0.090702f, 0.018696f, -0.063674f, -0.131507f, -0.180017f, -0.169874f, -0.003485f, 0.301468f, 0.472723f, 0.233945f, -0.287593f, -0.609607f, -0.417999f, 0.108829f, 0.537724f, 0.584882f, 0.248123f, -0.267570f, -0.641654f, -0.595451f, -0.122917f, 0.443556f, 0.677568f, 0.404806f, -0.160655f, -0.583438f, -0.539967f, -0.074916f, 0.431112f, 0.577305f, 0.268166f, -0.234307f, -0.542556f, -0.439331f, -0.021035f, 0.391348f, 0.500851f, 0.252348f, -0.150940f, -0.422825f, -0.397069f, + -0.116897f, 0.215040f, 0.378326f, 0.281929f, 0.016840f, -0.223517f, -0.285299f, -0.150921f, 0.064824f, 0.205529f, 0.186203f, 0.043905f, -0.108352f, -0.170014f, -0.110406f, 0.022238f, 0.130189f, 0.132527f, 0.032663f, -0.083919f, -0.128764f, -0.080520f, 0.017578f, 0.102451f, 0.126707f, 0.076735f, -0.023238f, -0.125560f, -0.179340f, -0.143762f, -0.011073f, 0.161503f, 0.263606f, 0.211305f, 0.023466f, -0.185632f, -0.284776f, -0.207866f, 0.002690f, 0.212376f, 0.279937f, 0.162514f, -0.052390f, -0.218160f, -0.233791f, -0.101898f, 0.082246f, 0.195628f, 0.171554f, 0.043387f, -0.090829f, -0.147029f, -0.105515f, -0.006855f, 0.082753f, 0.110922f, 0.067512f, -0.013413f, -0.078810f, -0.088794f, -0.038068f, 0.039653f, 0.090800f, 0.079988f, 0.016480f, -0.055921f, -0.091303f, -0.067670f, 0.001573f, 0.071708f, 0.093890f, 0.052725f, -0.021866f, -0.080145f, -0.086437f, -0.036745f, 0.038979f, 0.090792f, 0.082215f, 0.019655f, -0.053772f, -0.091807f, -0.071804f, -0.004177f, 0.069176f, 0.096481f, 0.056860f, -0.019434f, -0.079180f, -0.088307f, -0.043982f, 0.031667f, 0.092295f, 0.086506f, 0.010669f, -0.066537f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000327f, 0.001149f, -0.001510f, -0.008875f, -0.013050f, -0.005400f, 0.006851f, 0.005697f, -0.004945f, 0.013396f, 0.085505f, 0.158040f, 0.116276f, -0.095826f, -0.368269f, -0.475353f, -0.275082f, 0.133924f, 0.471111f, 0.499817f, 0.208594f, -0.193243f, -0.433758f, -0.369791f, -0.086437f, 0.181035f, 0.254309f, 0.148962f, 0.004731f, -0.076945f, -0.088131f, -0.056202f, -0.006669f, 0.027204f, 0.022895f, 0.000684f, -0.004473f, 0.005340f, 0.005248f, -0.004123f, -0.004397f, 0.001279f, -0.002808f, -0.011437f, -0.009031f, 0.000818f, 0.005239f, 0.005567f, + 0.007356f, 0.003631f, -0.012304f, -0.031082f, -0.036115f, -0.017571f, 0.021401f, 0.057430f, 0.054753f, 0.001687f, -0.067438f, -0.102302f, -0.078150f, -0.003504f, 0.083909f, 0.119950f, 0.056626f, -0.069752f, -0.145224f, -0.085262f, 0.075195f, 0.205974f, 0.184298f, -0.005876f, -0.234742f, -0.301243f, -0.108422f, 0.217492f, 0.414957f, 0.308768f, -0.049415f, -0.417879f, -0.518794f, -0.228948f, 0.288208f, 0.651212f, 0.551072f, 0.028210f, -0.539480f, -0.733233f, -0.410640f, 0.197876f, 0.660132f, 0.652053f, 0.188796f, -0.392887f, -0.683422f, -0.489760f, 0.034198f, 0.499410f, 0.570852f, 0.227312f, -0.236280f, -0.475140f, -0.367411f, -0.047930f, 0.256088f, 0.380255f, 0.276559f, 0.013879f, -0.247742f, -0.337521f, -0.190860f, 0.087123f, 0.285518f, 0.252854f, 0.030399f, -0.182966f, -0.214837f, -0.064549f, 0.131073f, 0.236061f, 0.195218f, 0.026904f, -0.190215f, -0.324567f, -0.259257f, -0.006849f, 0.256257f, 0.316266f, 0.112512f, -0.196917f, -0.367722f, -0.271179f, 0.020084f, 0.306344f, 0.398206f, 0.228598f, -0.096095f, -0.350105f, -0.354227f, -0.122532f, 0.165257f, 0.324178f, 0.274840f, 0.046578f, + -0.239456f, -0.396293f, -0.283542f, 0.049290f, 0.369058f, 0.444192f, 0.222903f, -0.144721f, -0.413398f, -0.395543f, -0.096478f, 0.265150f, 0.416012f, 0.252095f, -0.084706f, -0.339563f, -0.343637f, -0.116710f, 0.170605f, 0.325909f, 0.265454f, 0.055553f, -0.156549f, -0.250492f, -0.195198f, -0.044902f, 0.107435f, 0.187442f, 0.171465f, 0.077636f, -0.054117f, -0.164682f, -0.186936f, -0.092831f, 0.066541f, 0.187819f, 0.191041f, 0.073321f, -0.092553f, -0.200977f, -0.178052f, -0.036462f, 0.126972f, 0.200887f, 0.139288f, -0.011540f, -0.149039f, -0.183038f, -0.096673f, 0.042475f, 0.136055f, 0.129793f, 0.044094f, -0.054773f, -0.104572f, -0.082108f, -0.011804f, 0.054461f, 0.075419f, 0.046094f, -0.008119f, -0.053533f, -0.064440f, -0.033454f, 0.021056f, 0.062458f, 0.061831f, 0.020243f, -0.033654f, -0.064888f, -0.053746f, -0.007058f, 0.045056f, 0.067772f, 0.045297f, -0.007897f, -0.056502f, -0.067208f, -0.031054f, 0.028539f, 0.070332f, 0.064933f, 0.016397f, -0.041962f, -0.071918f, -0.054754f, -0.001494f, 0.053749f, 0.074108f, 0.044716f, -0.014964f, -0.063856f, -0.069271f, -0.029502f, 0.028269f, 0.068611f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000327f, 0.001149f, -0.001510f, -0.008875f, -0.013050f, -0.005400f, 0.006851f, 0.005697f, -0.004945f, 0.013396f, 0.085505f, 0.158040f, 0.116276f, -0.095826f, -0.368269f, -0.475353f, -0.275082f, 0.133924f, 0.471111f, 0.499817f, 0.208594f, -0.193243f, -0.433758f, -0.369791f, -0.086437f, 0.181035f, 0.254309f, 0.148962f, 0.004731f, -0.076945f, -0.088131f, -0.056202f, -0.006669f, 0.027204f, 0.022895f, 0.000684f, -0.004473f, 0.005340f, 0.005248f, -0.004123f, -0.004397f, 0.001279f, -0.002808f, -0.011437f, -0.009031f, 0.000818f, 0.005239f, 0.005567f, + 0.007356f, 0.003631f, -0.012304f, -0.031082f, -0.036115f, -0.017571f, 0.021401f, 0.057430f, 0.054753f, 0.001687f, -0.067438f, -0.102302f, -0.078150f, -0.003504f, 0.083909f, 0.119950f, 0.056626f, -0.069752f, -0.145224f, -0.085262f, 0.075195f, 0.205974f, 0.184298f, -0.005876f, -0.234742f, -0.301243f, -0.108422f, 0.217492f, 0.414957f, 0.308768f, -0.049415f, -0.417879f, -0.518794f, -0.228948f, 0.288208f, 0.651212f, 0.551072f, 0.028210f, -0.539480f, -0.733233f, -0.410640f, 0.197876f, 0.660132f, 0.652053f, 0.188796f, -0.392887f, -0.683422f, -0.489760f, 0.034198f, 0.499410f, 0.570852f, 0.227312f, -0.236280f, -0.475140f, -0.367411f, -0.047930f, 0.256088f, 0.380255f, 0.276559f, 0.013879f, -0.247742f, -0.337521f, -0.190860f, 0.087123f, 0.285518f, 0.252854f, 0.030399f, -0.182966f, -0.214837f, -0.064549f, 0.131073f, 0.236061f, 0.195218f, 0.026904f, -0.190215f, -0.324567f, -0.259257f, -0.006849f, 0.256257f, 0.316266f, 0.112512f, -0.196917f, -0.367722f, -0.271179f, 0.020084f, 0.306344f, 0.398206f, 0.228598f, -0.096095f, -0.350105f, -0.354227f, -0.122532f, 0.165257f, 0.324178f, 0.274840f, 0.046578f, + -0.239456f, -0.396293f, -0.283542f, 0.049290f, 0.369058f, 0.444192f, 0.222903f, -0.144721f, -0.413398f, -0.395543f, -0.096478f, 0.265150f, 0.416012f, 0.252095f, -0.084706f, -0.339563f, -0.343637f, -0.116710f, 0.170605f, 0.325909f, 0.265454f, 0.055553f, -0.156549f, -0.250492f, -0.195198f, -0.044902f, 0.107435f, 0.187442f, 0.171465f, 0.077636f, -0.054117f, -0.164682f, -0.186936f, -0.092831f, 0.066541f, 0.187819f, 0.191041f, 0.073321f, -0.092553f, -0.200977f, -0.178052f, -0.036462f, 0.126972f, 0.200887f, 0.139288f, -0.011540f, -0.149039f, -0.183038f, -0.096673f, 0.042475f, 0.136055f, 0.129793f, 0.044094f, -0.054773f, -0.104572f, -0.082108f, -0.011804f, 0.054461f, 0.075419f, 0.046094f, -0.008119f, -0.053533f, -0.064440f, -0.033454f, 0.021056f, 0.062458f, 0.061831f, 0.020243f, -0.033654f, -0.064888f, -0.053746f, -0.007058f, 0.045056f, 0.067772f, 0.045297f, -0.007897f, -0.056502f, -0.067208f, -0.031054f, 0.028539f, 0.070332f, 0.064933f, 0.016397f, -0.041962f, -0.071918f, -0.054754f, -0.001494f, 0.053749f, 0.074108f, 0.044716f, -0.014964f, -0.063856f, -0.069271f, -0.029502f, 0.028269f, 0.068611f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.001650f, 0.002131f, 0.003699f, 0.018015f, 0.064242f, 0.107522f, 0.065963f, -0.078236f, -0.203752f, -0.155026f, 0.064936f, 0.260026f, 0.234380f, -0.002967f, -0.250633f, -0.311979f, -0.157413f, 0.085478f, 0.257232f, 0.272223f, 0.140708f, -0.061315f, -0.228038f, -0.264726f, -0.143246f, 0.065095f, 0.229598f, 0.252235f, 0.130190f, -0.055249f, -0.194660f, -0.209130f, -0.092916f, 0.077767f, 0.187969f, 0.161978f, 0.020904f, -0.129191f, -0.178216f, -0.099759f, 0.035834f, 0.134150f, 0.150589f, 0.093392f, -0.009029f, -0.111727f, -0.149504f, -0.079671f, + 0.062943f, 0.179178f, 0.183759f, 0.068962f, -0.093868f, -0.202376f, -0.189013f, -0.064375f, 0.095511f, 0.201131f, 0.192756f, 0.064788f, -0.117571f, -0.238342f, -0.209660f, -0.045638f, 0.148811f, 0.255428f, 0.212214f, 0.045870f, -0.139218f, -0.230328f, -0.190110f, -0.063400f, 0.086403f, 0.206773f, 0.236874f, 0.134580f, -0.053003f, -0.199533f, -0.207991f, -0.085018f, 0.084093f, 0.192625f, 0.163707f, 0.009347f, -0.156124f, -0.205377f, -0.106388f, 0.069188f, 0.211250f, 0.227524f, 0.096858f, -0.087808f, -0.179832f, -0.126268f, -0.013394f, 0.056779f, 0.072166f, 0.067684f, 0.052010f, 0.019026f, -0.023587f, -0.065843f, -0.090313f, -0.057207f, 0.042492f, 0.130492f, 0.116776f, 0.023056f, -0.049507f, -0.059530f, -0.042430f, -0.008607f, 0.064413f, 0.134721f, 0.101441f, -0.056342f, -0.220031f, -0.248484f, -0.115583f, 0.082044f, 0.217681f, 0.223750f, 0.119052f, -0.027425f, -0.148334f, -0.193692f, -0.131635f, 0.014790f, 0.139169f, 0.124891f, -0.023249f, -0.157548f, -0.132532f, 0.037638f, 0.186596f, 0.162099f, -0.020981f, -0.195876f, -0.206986f, -0.048555f, 0.149751f, 0.241249f, 0.160341f, -0.043053f, + -0.224330f, -0.237908f, -0.068032f, 0.142219f, 0.225595f, 0.141873f, -0.018455f, -0.139490f, -0.157916f, -0.079896f, 0.030819f, 0.099141f, 0.101601f, 0.069416f, 0.028122f, -0.024162f, -0.071551f, -0.069560f, -0.006459f, 0.066288f, 0.090654f, 0.058422f, -0.002056f, -0.058552f, -0.079821f, -0.046489f, 0.018498f, 0.056128f, 0.032249f, -0.020748f, -0.040541f, -0.006552f, 0.038588f, 0.039423f, -0.010205f, -0.062478f, -0.068389f, -0.023557f, 0.037460f, 0.074933f, 0.066418f, 0.015831f, -0.044252f, -0.070924f, -0.046419f, 0.007027f, 0.049879f, 0.056053f, 0.025677f, -0.016867f, -0.037888f, -0.022544f, 0.010005f, 0.028291f, 0.021051f, 0.000168f, -0.018491f, -0.024947f, -0.015302f, 0.004559f, 0.020326f, 0.021985f, 0.010917f, -0.005964f, -0.020179f, -0.021675f, -0.007047f, 0.012849f, 0.022995f, 0.018847f, 0.004745f, -0.012889f, -0.023429f, -0.016008f, 0.004955f, 0.020243f, 0.018933f, 0.008218f, -0.002898f, -0.012806f, -0.017203f, -0.008785f, 0.008116f, 0.018601f, 0.015784f, 0.005245f, -0.006941f, -0.016572f, -0.016100f, -0.002218f, 0.014465f, 0.019642f, 0.011677f, -0.000603f, -0.010363f, -0.015605f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.001650f, 0.002131f, 0.003699f, 0.018015f, 0.064242f, 0.107522f, 0.065963f, -0.078236f, -0.203752f, -0.155026f, 0.064936f, 0.260026f, 0.234380f, -0.002967f, -0.250633f, -0.311979f, -0.157413f, 0.085478f, 0.257232f, 0.272223f, 0.140708f, -0.061315f, -0.228038f, -0.264726f, -0.143246f, 0.065095f, 0.229598f, 0.252235f, 0.130190f, -0.055249f, -0.194660f, -0.209130f, -0.092916f, 0.077767f, 0.187969f, 0.161978f, 0.020904f, -0.129191f, -0.178216f, -0.099759f, 0.035834f, 0.134150f, 0.150589f, 0.093392f, -0.009029f, -0.111727f, -0.149504f, -0.079671f, + 0.062943f, 0.179178f, 0.183759f, 0.068962f, -0.093868f, -0.202376f, -0.189013f, -0.064375f, 0.095511f, 0.201131f, 0.192756f, 0.064788f, -0.117571f, -0.238342f, -0.209660f, -0.045638f, 0.148811f, 0.255428f, 0.212214f, 0.045870f, -0.139218f, -0.230328f, -0.190110f, -0.063400f, 0.086403f, 0.206773f, 0.236874f, 0.134580f, -0.053003f, -0.199533f, -0.207991f, -0.085018f, 0.084093f, 0.192625f, 0.163707f, 0.009347f, -0.156124f, -0.205377f, -0.106388f, 0.069188f, 0.211250f, 0.227524f, 0.096858f, -0.087808f, -0.179832f, -0.126268f, -0.013394f, 0.056779f, 0.072166f, 0.067684f, 0.052010f, 0.019026f, -0.023587f, -0.065843f, -0.090313f, -0.057207f, 0.042492f, 0.130492f, 0.116776f, 0.023056f, -0.049507f, -0.059530f, -0.042430f, -0.008607f, 0.064413f, 0.134721f, 0.101441f, -0.056342f, -0.220031f, -0.248484f, -0.115583f, 0.082044f, 0.217681f, 0.223750f, 0.119052f, -0.027425f, -0.148334f, -0.193692f, -0.131635f, 0.014790f, 0.139169f, 0.124891f, -0.023249f, -0.157548f, -0.132532f, 0.037638f, 0.186596f, 0.162099f, -0.020981f, -0.195876f, -0.206986f, -0.048555f, 0.149751f, 0.241249f, 0.160341f, -0.043053f, + -0.224330f, -0.237908f, -0.068032f, 0.142219f, 0.225595f, 0.141873f, -0.018455f, -0.139490f, -0.157916f, -0.079896f, 0.030819f, 0.099141f, 0.101601f, 0.069416f, 0.028122f, -0.024162f, -0.071551f, -0.069560f, -0.006459f, 0.066288f, 0.090654f, 0.058422f, -0.002056f, -0.058552f, -0.079821f, -0.046489f, 0.018498f, 0.056128f, 0.032249f, -0.020748f, -0.040541f, -0.006552f, 0.038588f, 0.039423f, -0.010205f, -0.062478f, -0.068389f, -0.023557f, 0.037460f, 0.074933f, 0.066418f, 0.015831f, -0.044252f, -0.070924f, -0.046419f, 0.007027f, 0.049879f, 0.056053f, 0.025677f, -0.016867f, -0.037888f, -0.022544f, 0.010005f, 0.028291f, 0.021051f, 0.000168f, -0.018491f, -0.024947f, -0.015302f, 0.004559f, 0.020326f, 0.021985f, 0.010917f, -0.005964f, -0.020179f, -0.021675f, -0.007047f, 0.012849f, 0.022995f, 0.018847f, 0.004745f, -0.012889f, -0.023429f, -0.016008f, 0.004955f, 0.020243f, 0.018933f, 0.008218f, -0.002898f, -0.012806f, -0.017203f, -0.008785f, 0.008116f, 0.018601f, 0.015784f, 0.005245f, -0.006941f, -0.016572f, -0.016100f, -0.002218f, 0.014465f, 0.019642f, 0.011677f, -0.000603f, -0.010363f, -0.015605f}, + }, +}; +const float CRendBin_HOA3_HRIR_coeff_im_48kHz[16][BINAURAL_CHANNELS][480]={ + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.406686f, -0.916311f, -0.776905f, -0.168581f, 0.425205f, 0.636435f, 0.425070f, -0.000162f, -0.365426f, -0.470135f, -0.270582f, 0.093760f, 0.379216f, 0.403051f, 0.166769f, -0.162981f, -0.377242f, -0.346050f, -0.084656f, 0.246068f, 0.424945f, 0.321416f, -0.000157f, -0.325238f, -0.441746f, -0.269420f, 0.100379f, 0.443247f, 0.517168f, 0.233068f, -0.243256f, -0.585745f, -0.546118f, -0.134042f, 0.390550f, 0.681408f, 0.524900f, -0.000279f, -0.546398f, -0.733229f, -0.430530f, 0.151091f, 0.622351f, 0.679724f, 0.290383f, -0.291535f, -0.682257f, -0.620194f, + -0.147926f, 0.416165f, 0.697774f, 0.516441f, -0.000268f, -0.505144f, -0.665457f, -0.386360f, 0.134719f, 0.552799f, 0.602178f, 0.256765f, -0.257473f, -0.602188f, -0.547277f, -0.130520f, 0.367287f, 0.616744f, 0.458260f, -0.000240f, -0.455862f, -0.606886f, -0.355227f, 0.124145f, 0.506306f, 0.543219f, 0.226411f, -0.220888f, -0.501728f, -0.442805f, -0.102577f, 0.280284f, 0.456710f, 0.329376f, -0.000167f, -0.312029f, -0.409981f, -0.239168f, 0.084076f, 0.347324f, 0.378898f, 0.160675f, -0.159243f, -0.366667f, -0.327615f, -0.076851f, 0.212953f, 0.352359f, 0.257910f, -0.000132f, -0.248100f, -0.324493f, -0.186869f, 0.064492f, 0.261192f, 0.280044f, 0.117225f, -0.115066f, -0.262397f, -0.231261f, -0.053171f, 0.143696f, 0.232159f, 0.167757f, -0.000086f, -0.167936f, -0.231537f, -0.141943f, 0.051975f, 0.220035f, 0.241196f, 0.100828f, -0.097017f, -0.214966f, -0.184722f, -0.042039f, 0.115059f, 0.192813f, 0.147047f, -0.000081f, -0.165647f, -0.240473f, -0.154700f, 0.059539f, 0.266465f, 0.311091f, 0.139394f, -0.144211f, -0.342827f, -0.313294f, -0.074584f, 0.208411f, 0.346070f, 0.253408f, -0.000131f, -0.244047f, + -0.321480f, -0.188153f, 0.066776f, 0.281749f, 0.318506f, 0.141893f, -0.149179f, -0.365865f, -0.347757f, -0.086339f, 0.251426f, 0.434248f, 0.330165f, -0.000178f, -0.341610f, -0.464530f, -0.278605f, 0.100096f, 0.420751f, 0.465842f, 0.200356f, -0.201556f, -0.471621f, -0.428504f, -0.102153f, 0.287094f, 0.480599f, 0.355219f, -0.000187f, -0.349083f, -0.463702f, -0.272361f, 0.096191f, 0.399467f, 0.439546f, 0.189040f, -0.191217f, -0.451686f, -0.415081f, -0.100038f, 0.283457f, 0.476139f, 0.350859f, -0.000183f, -0.334379f, -0.431096f, -0.243062f, 0.081439f, 0.317065f, 0.323507f, 0.127868f, -0.118102f, -0.253601f, -0.211037f, -0.045859f, 0.116639f, 0.175463f, 0.116291f, -0.000054f, -0.095171f, -0.119829f, -0.068604f, 0.024081f, 0.100131f, 0.110093f, 0.047012f, -0.046950f, -0.109319f, -0.099283f, -0.023776f, 0.067379f, 0.113890f, 0.084956f, -0.000044f, -0.084644f, -0.112954f, -0.066543f, 0.023524f, 0.097504f, 0.106778f, 0.045599f, -0.045737f, -0.107150f, -0.097777f, -0.023452f, 0.066392f, 0.111994f, 0.083487f, -0.000040f, -0.083740f, -0.112411f, -0.066569f, 0.023616f, 0.097929f, 0.107112f, 0.045681f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.406686f, -0.916311f, -0.776905f, -0.168581f, 0.425205f, 0.636435f, 0.425070f, -0.000162f, -0.365426f, -0.470135f, -0.270582f, 0.093760f, 0.379216f, 0.403051f, 0.166769f, -0.162981f, -0.377242f, -0.346050f, -0.084656f, 0.246068f, 0.424945f, 0.321416f, -0.000157f, -0.325238f, -0.441746f, -0.269420f, 0.100379f, 0.443247f, 0.517168f, 0.233068f, -0.243256f, -0.585745f, -0.546118f, -0.134042f, 0.390550f, 0.681408f, 0.524900f, -0.000279f, -0.546398f, -0.733229f, -0.430530f, 0.151091f, 0.622351f, 0.679724f, 0.290383f, -0.291535f, -0.682257f, -0.620194f, + -0.147926f, 0.416165f, 0.697774f, 0.516441f, -0.000268f, -0.505144f, -0.665457f, -0.386360f, 0.134719f, 0.552799f, 0.602178f, 0.256765f, -0.257473f, -0.602188f, -0.547277f, -0.130520f, 0.367287f, 0.616744f, 0.458260f, -0.000240f, -0.455862f, -0.606886f, -0.355227f, 0.124145f, 0.506306f, 0.543219f, 0.226411f, -0.220888f, -0.501728f, -0.442805f, -0.102577f, 0.280284f, 0.456710f, 0.329376f, -0.000167f, -0.312029f, -0.409981f, -0.239168f, 0.084076f, 0.347324f, 0.378898f, 0.160675f, -0.159243f, -0.366667f, -0.327615f, -0.076851f, 0.212953f, 0.352359f, 0.257910f, -0.000132f, -0.248100f, -0.324493f, -0.186869f, 0.064492f, 0.261192f, 0.280044f, 0.117225f, -0.115066f, -0.262397f, -0.231261f, -0.053171f, 0.143696f, 0.232159f, 0.167757f, -0.000086f, -0.167936f, -0.231537f, -0.141943f, 0.051975f, 0.220035f, 0.241196f, 0.100828f, -0.097017f, -0.214966f, -0.184722f, -0.042039f, 0.115059f, 0.192813f, 0.147047f, -0.000081f, -0.165647f, -0.240473f, -0.154700f, 0.059539f, 0.266465f, 0.311091f, 0.139394f, -0.144211f, -0.342827f, -0.313294f, -0.074584f, 0.208411f, 0.346070f, 0.253408f, -0.000131f, -0.244047f, + -0.321480f, -0.188153f, 0.066776f, 0.281749f, 0.318506f, 0.141893f, -0.149179f, -0.365865f, -0.347757f, -0.086339f, 0.251426f, 0.434248f, 0.330165f, -0.000178f, -0.341610f, -0.464530f, -0.278605f, 0.100096f, 0.420751f, 0.465842f, 0.200356f, -0.201556f, -0.471621f, -0.428504f, -0.102153f, 0.287094f, 0.480599f, 0.355219f, -0.000187f, -0.349083f, -0.463702f, -0.272361f, 0.096191f, 0.399467f, 0.439546f, 0.189040f, -0.191217f, -0.451686f, -0.415081f, -0.100038f, 0.283457f, 0.476139f, 0.350859f, -0.000183f, -0.334379f, -0.431096f, -0.243062f, 0.081439f, 0.317065f, 0.323507f, 0.127868f, -0.118102f, -0.253601f, -0.211037f, -0.045859f, 0.116639f, 0.175463f, 0.116291f, -0.000054f, -0.095171f, -0.119829f, -0.068604f, 0.024081f, 0.100131f, 0.110093f, 0.047012f, -0.046950f, -0.109319f, -0.099283f, -0.023776f, 0.067379f, 0.113890f, 0.084956f, -0.000044f, -0.084644f, -0.112954f, -0.066543f, 0.023524f, 0.097504f, 0.106778f, 0.045599f, -0.045737f, -0.107150f, -0.097777f, -0.023452f, 0.066392f, 0.111994f, 0.083487f, -0.000040f, -0.083740f, -0.112411f, -0.066569f, 0.023616f, 0.097929f, 0.107112f, 0.045681f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.087780f, 0.034783f, -0.413938f, -0.823797f, -0.543983f, 0.436677f, 1.233757f, 0.989475f, -0.095621f, -1.001639f, -1.035433f, -0.372840f, 0.409507f, 0.878895f, 0.826752f, 0.264744f, -0.476218f, -0.887350f, -0.687253f, -0.031724f, 0.653354f, 0.948834f, 0.650812f, -0.085492f, -0.784919f, -0.969321f, -0.514591f, 0.275871f, 0.892013f, 0.931647f, 0.355812f, -0.450648f, -0.926747f, -0.756894f, -0.104999f, 0.539320f, 0.740062f, 0.411148f, -0.160397f, -0.551542f, -0.509523f, -0.098904f, 0.377794f, 0.583713f, 0.362555f, -0.131700f, -0.518203f, -0.490341f, + -0.077566f, 0.394207f, 0.578087f, 0.346371f, -0.145178f, -0.554205f, -0.575106f, -0.175832f, 0.363020f, 0.668174f, 0.543344f, 0.072578f, -0.450557f, -0.690324f, -0.478483f, 0.051578f, 0.546468f, 0.685102f, 0.388291f, -0.149357f, -0.584151f, -0.635485f, -0.278158f, 0.238710f, 0.581877f, 0.561078f, 0.216561f, -0.234327f, -0.521286f, -0.478965f, -0.156980f, 0.226995f, 0.452148f, 0.413337f, 0.136988f, -0.233100f, -0.475182f, -0.414639f, -0.069623f, 0.340507f, 0.547074f, 0.409271f, 0.000863f, -0.425779f, -0.590205f, -0.373678f, 0.092797f, 0.512876f, 0.609849f, 0.299398f, -0.232658f, -0.622576f, -0.584180f, -0.137468f, 0.409303f, 0.698841f, 0.553336f, 0.050380f, -0.520212f, -0.787395f, -0.527778f, 0.121555f, 0.696400f, 0.748332f, 0.229190f, -0.448491f, -0.752721f, -0.469500f, 0.148243f, 0.616505f, 0.603205f, 0.153653f, -0.371906f, -0.577748f, -0.331909f, 0.140844f, 0.459451f, 0.405660f, 0.071022f, -0.270205f, -0.395488f, -0.264035f, 0.011192f, 0.267940f, 0.382377f, 0.305412f, 0.069121f, -0.215691f, -0.395409f, -0.361042f, -0.125550f, 0.185657f, 0.409144f, 0.412590f, 0.157751f, -0.233794f, + -0.502975f, -0.432108f, -0.044154f, 0.392922f, 0.569333f, 0.354416f, -0.119076f, -0.532390f, -0.583459f, -0.212406f, 0.328244f, 0.651192f, 0.523222f, 0.028391f, -0.498465f, -0.697298f, -0.423657f, 0.144019f, 0.619250f, 0.678265f, 0.285071f, -0.292456f, -0.670202f, -0.601845f, -0.137501f, 0.412573f, 0.685667f, 0.504744f, -0.009511f, -0.517472f, -0.679384f, -0.381427f, 0.182167f, 0.636590f, 0.676125f, 0.264131f, -0.339109f, -0.735155f, -0.648158f, -0.124121f, 0.487742f, 0.775706f, 0.550902f, -0.027674f, -0.565173f, -0.703385f, -0.372587f, 0.167766f, 0.539407f, 0.525244f, 0.189417f, -0.213885f, -0.425831f, -0.339339f, -0.053499f, 0.211988f, 0.289647f, 0.174299f, -0.017813f, -0.161265f, -0.187359f, -0.094331f, 0.056744f, 0.168407f, 0.167975f, 0.058205f, -0.088054f, -0.176546f, -0.148412f, -0.020000f, 0.122365f, 0.182101f, 0.121609f, -0.016618f, -0.142616f, -0.174255f, -0.089096f, 0.055731f, 0.161268f, 0.158577f, 0.052789f, -0.087269f, -0.171671f, -0.142248f, -0.015778f, 0.121150f, 0.175885f, 0.115837f, -0.018037f, -0.141389f, -0.172452f, -0.085388f, 0.060831f, 0.163879f, 0.160983f, 0.065107f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.087780f, -0.034783f, 0.413938f, 0.823797f, 0.543983f, -0.436677f, -1.233757f, -0.989475f, 0.095621f, 1.001639f, 1.035433f, 0.372840f, -0.409507f, -0.878895f, -0.826752f, -0.264744f, 0.476218f, 0.887350f, 0.687253f, 0.031724f, -0.653354f, -0.948834f, -0.650812f, 0.085492f, 0.784919f, 0.969321f, 0.514591f, -0.275871f, -0.892013f, -0.931647f, -0.355812f, 0.450648f, 0.926747f, 0.756894f, 0.104999f, -0.539320f, -0.740062f, -0.411148f, 0.160397f, 0.551542f, 0.509523f, 0.098904f, -0.377794f, -0.583713f, -0.362555f, 0.131700f, 0.518203f, 0.490341f, + 0.077566f, -0.394207f, -0.578087f, -0.346371f, 0.145178f, 0.554205f, 0.575106f, 0.175832f, -0.363020f, -0.668174f, -0.543344f, -0.072578f, 0.450557f, 0.690324f, 0.478483f, -0.051578f, -0.546468f, -0.685102f, -0.388291f, 0.149357f, 0.584151f, 0.635485f, 0.278158f, -0.238710f, -0.581877f, -0.561078f, -0.216561f, 0.234327f, 0.521286f, 0.478965f, 0.156980f, -0.226995f, -0.452148f, -0.413337f, -0.136988f, 0.233100f, 0.475182f, 0.414639f, 0.069623f, -0.340507f, -0.547074f, -0.409271f, -0.000863f, 0.425779f, 0.590205f, 0.373678f, -0.092797f, -0.512876f, -0.609849f, -0.299398f, 0.232658f, 0.622576f, 0.584180f, 0.137468f, -0.409303f, -0.698841f, -0.553336f, -0.050380f, 0.520212f, 0.787395f, 0.527778f, -0.121555f, -0.696400f, -0.748332f, -0.229190f, 0.448491f, 0.752721f, 0.469500f, -0.148243f, -0.616505f, -0.603205f, -0.153653f, 0.371906f, 0.577748f, 0.331909f, -0.140844f, -0.459451f, -0.405660f, -0.071022f, 0.270205f, 0.395488f, 0.264035f, -0.011192f, -0.267940f, -0.382377f, -0.305412f, -0.069121f, 0.215691f, 0.395409f, 0.361042f, 0.125550f, -0.185657f, -0.409144f, -0.412590f, -0.157751f, 0.233794f, + 0.502975f, 0.432108f, 0.044154f, -0.392922f, -0.569333f, -0.354416f, 0.119076f, 0.532390f, 0.583459f, 0.212406f, -0.328244f, -0.651192f, -0.523222f, -0.028391f, 0.498465f, 0.697298f, 0.423657f, -0.144019f, -0.619250f, -0.678265f, -0.285071f, 0.292456f, 0.670202f, 0.601845f, 0.137501f, -0.412573f, -0.685667f, -0.504744f, 0.009511f, 0.517472f, 0.679384f, 0.381427f, -0.182167f, -0.636590f, -0.676125f, -0.264131f, 0.339109f, 0.735155f, 0.648158f, 0.124121f, -0.487742f, -0.775706f, -0.550902f, 0.027674f, 0.565173f, 0.703385f, 0.372587f, -0.167766f, -0.539407f, -0.525244f, -0.189417f, 0.213885f, 0.425831f, 0.339339f, 0.053499f, -0.211988f, -0.289647f, -0.174299f, 0.017813f, 0.161265f, 0.187359f, 0.094331f, -0.056744f, -0.168407f, -0.167975f, -0.058205f, 0.088054f, 0.176546f, 0.148412f, 0.020000f, -0.122365f, -0.182101f, -0.121609f, 0.016618f, 0.142616f, 0.174255f, 0.089096f, -0.055731f, -0.161268f, -0.158577f, -0.052789f, 0.087269f, 0.171671f, 0.142248f, 0.015778f, -0.121150f, -0.175885f, -0.115837f, 0.018037f, 0.141389f, 0.172452f, 0.085388f, -0.060831f, -0.163879f, -0.160983f, -0.065107f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.025517f, -0.067699f, -0.059711f, 0.021262f, 0.087860f, 0.027591f, -0.108326f, -0.137330f, 0.007956f, 0.194048f, 0.272375f, 0.216915f, 0.050596f, -0.203942f, -0.429350f, -0.421127f, -0.112012f, 0.291505f, 0.491149f, 0.368016f, 0.035459f, -0.288843f, -0.411418f, -0.264177f, 0.032590f, 0.254119f, 0.272205f, 0.141151f, -0.016718f, -0.129969f, -0.169624f, -0.123453f, -0.025280f, 0.060613f, 0.114644f, 0.156595f, 0.158123f, 0.053616f, -0.132617f, -0.257157f, -0.202331f, 0.002510f, 0.223918f, 0.330390f, 0.248375f, -0.004124f, -0.293050f, -0.426163f, + -0.291690f, 0.047258f, 0.385296f, 0.497701f, 0.283097f, -0.145134f, -0.504786f, -0.537128f, -0.202683f, 0.283697f, 0.594348f, 0.501410f, 0.043377f, -0.463815f, -0.632693f, -0.313684f, 0.259594f, 0.644500f, 0.539145f, 0.014675f, -0.537431f, -0.691059f, -0.307837f, 0.334438f, 0.732386f, 0.551981f, -0.085284f, -0.679373f, -0.747874f, -0.221375f, 0.492107f, 0.834003f, 0.544109f, -0.142170f, -0.700227f, -0.732942f, -0.252410f, 0.368068f, 0.691006f, 0.519214f, 0.004620f, -0.482067f, -0.610463f, -0.305588f, 0.210626f, 0.572832f, 0.525182f, 0.105943f, -0.376945f, -0.576442f, -0.368132f, 0.070519f, 0.418647f, 0.455651f, 0.191607f, -0.177875f, -0.414579f, -0.379206f, -0.109506f, 0.206170f, 0.357593f, 0.256331f, -0.017179f, -0.282726f, -0.372674f, -0.223340f, 0.080586f, 0.342315f, 0.381996f, 0.172626f, -0.142659f, -0.363251f, -0.361012f, -0.140006f, 0.169257f, 0.367374f, 0.305339f, 0.012512f, -0.294289f, -0.372321f, -0.156651f, 0.185362f, 0.397383f, 0.335855f, 0.057718f, -0.247914f, -0.394386f, -0.299028f, -0.018637f, 0.279543f, 0.409662f, 0.285932f, -0.015472f, -0.305948f, -0.406582f, -0.255890f, + 0.053658f, 0.325683f, 0.380723f, 0.180789f, -0.139538f, -0.368206f, -0.359929f, -0.123417f, 0.190257f, 0.378439f, 0.313592f, 0.037523f, -0.255435f, -0.356977f, -0.202607f, 0.085024f, 0.299090f, 0.301084f, 0.102785f, -0.159110f, -0.312767f, -0.251894f, -0.007044f, 0.258857f, 0.354691f, 0.203351f, -0.097225f, -0.347096f, -0.382971f, -0.177645f, 0.148663f, 0.398915f, 0.416738f, 0.185500f, -0.158876f, -0.410573f, -0.415867f, -0.166067f, 0.188105f, 0.422600f, 0.387102f, 0.108936f, -0.227910f, -0.407819f, -0.321736f, -0.035784f, 0.252429f, 0.352172f, 0.215080f, -0.043477f, -0.244196f, -0.267093f, -0.114638f, 0.099755f, 0.226546f, 0.185711f, 0.024464f, -0.130888f, -0.179162f, -0.105058f, 0.031653f, 0.140214f, 0.150736f, 0.059181f, -0.069202f, -0.148885f, -0.131041f, -0.027488f, 0.097056f, 0.159295f, 0.114640f, -0.004873f, -0.116593f, -0.149973f, -0.085672f, 0.038646f, 0.142412f, 0.149980f, 0.055433f, -0.069223f, -0.140044f, -0.119708f, -0.021353f, 0.100455f, 0.162696f, 0.112885f, -0.010139f, -0.111545f, -0.132803f, -0.073548f, 0.042236f, 0.155380f, 0.169574f, 0.057460f, -0.059909f, -0.047863f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.025517f, -0.067699f, -0.059711f, 0.021262f, 0.087860f, 0.027591f, -0.108326f, -0.137330f, 0.007956f, 0.194048f, 0.272375f, 0.216915f, 0.050596f, -0.203942f, -0.429350f, -0.421127f, -0.112012f, 0.291505f, 0.491149f, 0.368016f, 0.035459f, -0.288843f, -0.411418f, -0.264177f, 0.032590f, 0.254119f, 0.272205f, 0.141151f, -0.016718f, -0.129969f, -0.169624f, -0.123453f, -0.025280f, 0.060613f, 0.114644f, 0.156595f, 0.158123f, 0.053616f, -0.132617f, -0.257157f, -0.202331f, 0.002510f, 0.223918f, 0.330390f, 0.248375f, -0.004124f, -0.293050f, -0.426163f, + -0.291690f, 0.047258f, 0.385296f, 0.497701f, 0.283097f, -0.145134f, -0.504786f, -0.537128f, -0.202683f, 0.283697f, 0.594348f, 0.501410f, 0.043377f, -0.463815f, -0.632693f, -0.313684f, 0.259594f, 0.644500f, 0.539145f, 0.014675f, -0.537431f, -0.691059f, -0.307837f, 0.334438f, 0.732386f, 0.551981f, -0.085284f, -0.679373f, -0.747874f, -0.221375f, 0.492107f, 0.834003f, 0.544109f, -0.142170f, -0.700227f, -0.732942f, -0.252410f, 0.368068f, 0.691006f, 0.519214f, 0.004620f, -0.482067f, -0.610463f, -0.305588f, 0.210626f, 0.572832f, 0.525182f, 0.105943f, -0.376945f, -0.576442f, -0.368132f, 0.070519f, 0.418647f, 0.455651f, 0.191607f, -0.177875f, -0.414579f, -0.379206f, -0.109506f, 0.206170f, 0.357593f, 0.256331f, -0.017179f, -0.282726f, -0.372674f, -0.223340f, 0.080586f, 0.342315f, 0.381996f, 0.172626f, -0.142659f, -0.363251f, -0.361012f, -0.140006f, 0.169257f, 0.367374f, 0.305339f, 0.012512f, -0.294289f, -0.372321f, -0.156651f, 0.185362f, 0.397383f, 0.335855f, 0.057718f, -0.247914f, -0.394386f, -0.299028f, -0.018637f, 0.279543f, 0.409662f, 0.285932f, -0.015472f, -0.305948f, -0.406582f, -0.255890f, + 0.053658f, 0.325683f, 0.380723f, 0.180789f, -0.139538f, -0.368206f, -0.359929f, -0.123417f, 0.190257f, 0.378439f, 0.313592f, 0.037523f, -0.255435f, -0.356977f, -0.202607f, 0.085024f, 0.299090f, 0.301084f, 0.102785f, -0.159110f, -0.312767f, -0.251894f, -0.007044f, 0.258857f, 0.354691f, 0.203351f, -0.097225f, -0.347096f, -0.382971f, -0.177645f, 0.148663f, 0.398915f, 0.416738f, 0.185500f, -0.158876f, -0.410573f, -0.415867f, -0.166067f, 0.188105f, 0.422600f, 0.387102f, 0.108936f, -0.227910f, -0.407819f, -0.321736f, -0.035784f, 0.252429f, 0.352172f, 0.215080f, -0.043477f, -0.244196f, -0.267093f, -0.114638f, 0.099755f, 0.226546f, 0.185711f, 0.024464f, -0.130888f, -0.179162f, -0.105058f, 0.031653f, 0.140214f, 0.150736f, 0.059181f, -0.069202f, -0.148885f, -0.131041f, -0.027488f, 0.097056f, 0.159295f, 0.114640f, -0.004873f, -0.116593f, -0.149973f, -0.085672f, 0.038646f, 0.142412f, 0.149980f, 0.055433f, -0.069223f, -0.140044f, -0.119708f, -0.021353f, 0.100455f, 0.162696f, 0.112885f, -0.010139f, -0.111545f, -0.132803f, -0.073548f, 0.042236f, 0.155380f, 0.169574f, 0.057460f, -0.059909f, -0.047863f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.002042f, -0.006491f, 0.018221f, 0.092898f, 0.127745f, 0.004944f, -0.214720f, -0.308788f, -0.162474f, 0.092986f, 0.251560f, 0.234412f, 0.083566f, -0.125155f, -0.287854f, -0.283387f, -0.080378f, 0.190266f, 0.331773f, 0.251119f, 0.021695f, -0.193673f, -0.264877f, -0.171801f, 0.004549f, 0.158511f, 0.224994f, 0.180326f, 0.026145f, -0.184598f, -0.327040f, -0.271230f, -0.002284f, 0.330335f, 0.495187f, 0.338006f, -0.087956f, -0.519361f, -0.646496f, -0.348137f, 0.197506f, 0.634013f, 0.678719f, 0.305470f, -0.251442f, -0.647353f, -0.638588f, -0.236921f, + 0.297457f, 0.629639f, 0.565555f, 0.160782f, -0.327654f, -0.598011f, -0.485372f, -0.070825f, 0.366988f, 0.546173f, 0.377458f, 0.004954f, -0.322284f, -0.422858f, -0.275356f, 0.000175f, 0.231296f, 0.295098f, 0.181142f, -0.015521f, -0.163076f, -0.178732f, -0.077093f, 0.050988f, 0.113344f, 0.084894f, 0.013667f, -0.033031f, -0.028412f, -0.002410f, -0.005173f, -0.048725f, -0.083229f, -0.046604f, 0.053409f, 0.126674f, 0.092061f, -0.029391f, -0.134050f, -0.138879f, -0.044209f, 0.088821f, 0.183007f, 0.170971f, 0.031138f, -0.166987f, -0.279645f, -0.197623f, 0.044871f, 0.278749f, 0.328486f, 0.149138f, -0.137275f, -0.329254f, -0.292843f, -0.058911f, 0.208882f, 0.345092f, 0.287084f, 0.073299f, -0.205124f, -0.412796f, -0.386387f, -0.060468f, 0.380508f, 0.568573f, 0.282760f, -0.284209f, -0.660275f, -0.521323f, 0.032309f, 0.592909f, 0.771411f, 0.437093f, -0.219405f, -0.769081f, -0.788554f, -0.202492f, 0.564137f, 0.882809f, 0.479902f, -0.293536f, -0.782195f, -0.616147f, 0.007175f, 0.556066f, 0.622891f, 0.209705f, -0.323401f, -0.558312f, -0.339903f, 0.123130f, 0.455170f, 0.423068f, 0.085888f, -0.295424f, + -0.456307f, -0.291706f, 0.079549f, 0.388307f, 0.411052f, 0.143068f, -0.211238f, -0.408239f, -0.328078f, -0.029436f, 0.290498f, 0.409966f, 0.239139f, -0.097049f, -0.353140f, -0.358326f, -0.127053f, 0.182945f, 0.380494f, 0.340097f, 0.074494f, -0.253578f, -0.425937f, -0.322690f, -0.008094f, 0.318068f, 0.451161f, 0.303215f, -0.042894f, -0.373736f, -0.473120f, -0.268560f, 0.110137f, 0.414847f, 0.448693f, 0.196000f, -0.175555f, -0.429028f, -0.406398f, -0.125281f, 0.228779f, 0.419947f, 0.324761f, 0.020887f, -0.274691f, -0.368011f, -0.218720f, 0.050806f, 0.254606f, 0.271265f, 0.116064f, -0.086465f, -0.201197f, -0.172146f, -0.042872f, 0.089079f, 0.141235f, 0.095566f, -0.000442f, -0.078029f, -0.095621f, -0.053399f, 0.019395f, 0.079568f, 0.088155f, 0.037208f, -0.038715f, -0.087559f, -0.078549f, -0.019164f, 0.053077f, 0.091282f, 0.068080f, -0.001467f, -0.069128f, -0.091243f, -0.057087f, 0.011523f, 0.074465f, 0.091834f, 0.049379f, -0.025895f, -0.083191f, -0.085646f, -0.033098f, 0.041158f, 0.089334f, 0.078023f, 0.014096f, -0.058479f, -0.092419f, -0.067902f, 0.000366f, 0.070053f, 0.090574f, 0.041310f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.002042f, -0.006491f, 0.018221f, 0.092898f, 0.127745f, 0.004944f, -0.214720f, -0.308788f, -0.162474f, 0.092986f, 0.251560f, 0.234412f, 0.083566f, -0.125155f, -0.287854f, -0.283387f, -0.080378f, 0.190266f, 0.331773f, 0.251119f, 0.021695f, -0.193673f, -0.264877f, -0.171801f, 0.004549f, 0.158511f, 0.224994f, 0.180326f, 0.026145f, -0.184598f, -0.327040f, -0.271230f, -0.002284f, 0.330335f, 0.495187f, 0.338006f, -0.087956f, -0.519361f, -0.646496f, -0.348137f, 0.197506f, 0.634013f, 0.678719f, 0.305470f, -0.251442f, -0.647353f, -0.638588f, -0.236921f, + 0.297457f, 0.629639f, 0.565555f, 0.160782f, -0.327654f, -0.598011f, -0.485372f, -0.070825f, 0.366988f, 0.546173f, 0.377458f, 0.004954f, -0.322284f, -0.422858f, -0.275356f, 0.000175f, 0.231296f, 0.295098f, 0.181142f, -0.015521f, -0.163076f, -0.178732f, -0.077093f, 0.050988f, 0.113344f, 0.084894f, 0.013667f, -0.033031f, -0.028412f, -0.002410f, -0.005173f, -0.048725f, -0.083229f, -0.046604f, 0.053409f, 0.126674f, 0.092061f, -0.029391f, -0.134050f, -0.138879f, -0.044209f, 0.088821f, 0.183007f, 0.170971f, 0.031138f, -0.166987f, -0.279645f, -0.197623f, 0.044871f, 0.278749f, 0.328486f, 0.149138f, -0.137275f, -0.329254f, -0.292843f, -0.058911f, 0.208882f, 0.345092f, 0.287084f, 0.073299f, -0.205124f, -0.412796f, -0.386387f, -0.060468f, 0.380508f, 0.568573f, 0.282760f, -0.284209f, -0.660275f, -0.521323f, 0.032309f, 0.592909f, 0.771411f, 0.437093f, -0.219405f, -0.769081f, -0.788554f, -0.202492f, 0.564137f, 0.882809f, 0.479902f, -0.293536f, -0.782195f, -0.616147f, 0.007175f, 0.556066f, 0.622891f, 0.209705f, -0.323401f, -0.558312f, -0.339903f, 0.123130f, 0.455170f, 0.423068f, 0.085888f, -0.295424f, + -0.456307f, -0.291706f, 0.079549f, 0.388307f, 0.411052f, 0.143068f, -0.211238f, -0.408239f, -0.328078f, -0.029436f, 0.290498f, 0.409966f, 0.239139f, -0.097049f, -0.353140f, -0.358326f, -0.127053f, 0.182945f, 0.380494f, 0.340097f, 0.074494f, -0.253578f, -0.425937f, -0.322690f, -0.008094f, 0.318068f, 0.451161f, 0.303215f, -0.042894f, -0.373736f, -0.473120f, -0.268560f, 0.110137f, 0.414847f, 0.448693f, 0.196000f, -0.175555f, -0.429028f, -0.406398f, -0.125281f, 0.228779f, 0.419947f, 0.324761f, 0.020887f, -0.274691f, -0.368011f, -0.218720f, 0.050806f, 0.254606f, 0.271265f, 0.116064f, -0.086465f, -0.201197f, -0.172146f, -0.042872f, 0.089079f, 0.141235f, 0.095566f, -0.000442f, -0.078029f, -0.095621f, -0.053399f, 0.019395f, 0.079568f, 0.088155f, 0.037208f, -0.038715f, -0.087559f, -0.078549f, -0.019164f, 0.053077f, 0.091282f, 0.068080f, -0.001467f, -0.069128f, -0.091243f, -0.057087f, 0.011523f, 0.074465f, 0.091834f, 0.049379f, -0.025895f, -0.083191f, -0.085646f, -0.033098f, 0.041158f, 0.089334f, 0.078023f, 0.014096f, -0.058479f, -0.092419f, -0.067902f, 0.000366f, 0.070053f, 0.090574f, 0.041310f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.003854f, -0.002454f, -0.022086f, -0.000377f, 0.099186f, 0.181826f, 0.082117f, -0.191030f, -0.382764f, -0.275736f, 0.046776f, 0.319743f, 0.373084f, 0.196545f, -0.129348f, -0.426531f, -0.463165f, -0.170663f, 0.234211f, 0.450413f, 0.367178f, 0.088909f, -0.209233f, -0.373904f, -0.319643f, -0.083985f, 0.189536f, 0.354198f, 0.324794f, 0.088057f, -0.253456f, -0.473396f, -0.380271f, -0.013515f, 0.375516f, 0.533160f, 0.366842f, -0.026016f, -0.405414f, -0.516172f, -0.275535f, 0.149100f, 0.475596f, 0.509776f, 0.240014f, -0.174033f, -0.475619f, -0.463786f, + -0.150085f, 0.245628f, 0.469369f, 0.399923f, 0.094880f, -0.255347f, -0.435018f, -0.343453f, -0.059914f, 0.236384f, 0.392555f, 0.338117f, 0.096408f, -0.205750f, -0.388085f, -0.341328f, -0.107118f, 0.165637f, 0.321632f, 0.280715f, 0.085199f, -0.122724f, -0.214422f, -0.174680f, -0.073073f, 0.029600f, 0.105485f, 0.129493f, 0.087307f, 0.002712f, -0.079435f, -0.121863f, -0.094123f, 0.009993f, 0.128396f, 0.155813f, 0.052664f, -0.102755f, -0.192455f, -0.158217f, -0.023036f, 0.132331f, 0.204180f, 0.135704f, -0.021108f, -0.146438f, -0.165069f, -0.091885f, 0.018978f, 0.119173f, 0.163471f, 0.118366f, -0.003758f, -0.140068f, -0.212421f, -0.162368f, 0.016139f, 0.238529f, 0.344363f, 0.213777f, -0.100655f, -0.379000f, -0.401132f, -0.130592f, 0.246999f, 0.460475f, 0.354353f, 0.002978f, -0.344171f, -0.442839f, -0.227748f, 0.142544f, 0.397859f, 0.348292f, 0.026927f, -0.320921f, -0.414965f, -0.169154f, 0.220157f, 0.432886f, 0.302939f, -0.050896f, -0.353421f, -0.401488f, -0.182011f, 0.153726f, 0.383482f, 0.342808f, 0.051482f, -0.278221f, -0.402450f, -0.235217f, 0.103739f, 0.381982f, 0.393633f, 0.098035f, + -0.306973f, -0.499282f, -0.308403f, 0.114133f, 0.430858f, 0.413902f, 0.102947f, -0.264072f, -0.428247f, -0.279189f, 0.060416f, 0.318844f, 0.301773f, 0.054540f, -0.206693f, -0.298903f, -0.190084f, 0.031604f, 0.234225f, 0.298053f, 0.173879f, -0.067638f, -0.265789f, -0.285611f, -0.118197f, 0.124190f, 0.293458f, 0.288596f, 0.101340f, -0.167947f, -0.345069f, -0.292162f, -0.028544f, 0.263952f, 0.378992f, 0.241019f, -0.054335f, -0.317360f, -0.381380f, -0.201627f, 0.106898f, 0.336272f, 0.333980f, 0.115250f, -0.158787f, -0.307674f, -0.252085f, -0.050007f, 0.156659f, 0.240812f, 0.168034f, 0.004842f, -0.136796f, -0.172650f, -0.094885f, 0.028554f, 0.107929f, 0.100761f, 0.033262f, -0.038872f, -0.075897f, -0.064669f, -0.013631f, 0.046785f, 0.075843f, 0.053090f, -0.004645f, -0.058977f, -0.076249f, -0.044427f, 0.017911f, 0.067960f, 0.069799f, 0.024580f, -0.034779f, -0.072813f, -0.069371f, -0.023984f, 0.039281f, 0.079038f, 0.066652f, 0.010641f, -0.052110f, -0.082806f, -0.060994f, 0.002104f, 0.063874f, 0.079954f, 0.041730f, -0.022081f, -0.073967f, -0.084637f, -0.040362f, 0.034910f, 0.076712f, 0.039734f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.003854f, 0.002454f, 0.022086f, 0.000377f, -0.099186f, -0.181826f, -0.082117f, 0.191030f, 0.382764f, 0.275736f, -0.046776f, -0.319743f, -0.373084f, -0.196545f, 0.129348f, 0.426531f, 0.463165f, 0.170663f, -0.234211f, -0.450413f, -0.367178f, -0.088909f, 0.209233f, 0.373904f, 0.319643f, 0.083985f, -0.189536f, -0.354198f, -0.324794f, -0.088057f, 0.253456f, 0.473396f, 0.380271f, 0.013515f, -0.375516f, -0.533160f, -0.366842f, 0.026016f, 0.405414f, 0.516172f, 0.275535f, -0.149100f, -0.475596f, -0.509776f, -0.240014f, 0.174033f, 0.475619f, 0.463786f, + 0.150085f, -0.245628f, -0.469369f, -0.399923f, -0.094880f, 0.255347f, 0.435018f, 0.343453f, 0.059914f, -0.236384f, -0.392555f, -0.338117f, -0.096408f, 0.205750f, 0.388085f, 0.341328f, 0.107118f, -0.165637f, -0.321632f, -0.280715f, -0.085199f, 0.122724f, 0.214422f, 0.174680f, 0.073073f, -0.029600f, -0.105485f, -0.129493f, -0.087307f, -0.002712f, 0.079435f, 0.121863f, 0.094123f, -0.009993f, -0.128396f, -0.155813f, -0.052664f, 0.102755f, 0.192455f, 0.158217f, 0.023036f, -0.132331f, -0.204180f, -0.135704f, 0.021108f, 0.146438f, 0.165069f, 0.091885f, -0.018978f, -0.119173f, -0.163471f, -0.118366f, 0.003758f, 0.140068f, 0.212421f, 0.162368f, -0.016139f, -0.238529f, -0.344363f, -0.213777f, 0.100655f, 0.379000f, 0.401132f, 0.130592f, -0.246999f, -0.460475f, -0.354353f, -0.002978f, 0.344171f, 0.442839f, 0.227748f, -0.142544f, -0.397859f, -0.348292f, -0.026927f, 0.320921f, 0.414965f, 0.169154f, -0.220157f, -0.432886f, -0.302939f, 0.050896f, 0.353421f, 0.401488f, 0.182011f, -0.153726f, -0.383482f, -0.342808f, -0.051482f, 0.278221f, 0.402450f, 0.235217f, -0.103739f, -0.381982f, -0.393633f, -0.098035f, + 0.306973f, 0.499282f, 0.308403f, -0.114133f, -0.430858f, -0.413902f, -0.102947f, 0.264072f, 0.428247f, 0.279189f, -0.060416f, -0.318844f, -0.301773f, -0.054540f, 0.206693f, 0.298903f, 0.190084f, -0.031604f, -0.234225f, -0.298053f, -0.173879f, 0.067638f, 0.265789f, 0.285611f, 0.118197f, -0.124190f, -0.293458f, -0.288596f, -0.101340f, 0.167947f, 0.345069f, 0.292162f, 0.028544f, -0.263952f, -0.378992f, -0.241019f, 0.054335f, 0.317360f, 0.381380f, 0.201627f, -0.106898f, -0.336272f, -0.333980f, -0.115250f, 0.158787f, 0.307674f, 0.252085f, 0.050007f, -0.156659f, -0.240812f, -0.168034f, -0.004842f, 0.136796f, 0.172650f, 0.094885f, -0.028554f, -0.107929f, -0.100761f, -0.033262f, 0.038872f, 0.075897f, 0.064669f, 0.013631f, -0.046785f, -0.075843f, -0.053090f, 0.004645f, 0.058977f, 0.076249f, 0.044427f, -0.017911f, -0.067960f, -0.069799f, -0.024580f, 0.034779f, 0.072813f, 0.069371f, 0.023984f, -0.039281f, -0.079038f, -0.066652f, -0.010641f, 0.052110f, 0.082806f, 0.060994f, -0.002104f, -0.063874f, -0.079954f, -0.041730f, 0.022081f, 0.073967f, 0.084637f, 0.040362f, -0.034910f, -0.076712f, -0.039734f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.005709f, 0.010879f, 0.009029f, 0.014497f, 0.028118f, 0.021796f, -0.021635f, -0.064568f, -0.047591f, 0.042919f, 0.174684f, 0.301101f, 0.332552f, 0.139058f, -0.285986f, -0.680942f, -0.690074f, -0.235770f, 0.371505f, 0.717305f, 0.607821f, 0.149400f, -0.355819f, -0.587628f, -0.424676f, -0.044500f, 0.253404f, 0.325305f, 0.232083f, 0.075946f, -0.087783f, -0.205289f, -0.223487f, -0.148160f, -0.024157f, 0.123773f, 0.256550f, 0.273946f, 0.108835f, -0.147011f, -0.299983f, -0.237365f, -0.007863f, 0.241826f, 0.354261f, 0.236794f, -0.059506f, -0.339076f, + -0.399689f, -0.193065f, 0.144588f, 0.392061f, 0.380405f, 0.103797f, -0.255794f, -0.442426f, -0.316587f, 0.036976f, 0.368425f, 0.433591f, 0.169769f, -0.232483f, -0.450807f, -0.296888f, 0.104189f, 0.411974f, 0.362406f, -0.011734f, -0.403521f, -0.469538f, -0.117832f, 0.377352f, 0.577477f, 0.269446f, -0.316408f, -0.688907f, -0.515612f, 0.096039f, 0.674967f, 0.745717f, 0.210455f, -0.535597f, -0.890832f, -0.545716f, 0.238937f, 0.845389f, 0.812579f, 0.187246f, -0.553728f, -0.880919f, -0.576103f, 0.139507f, 0.760209f, 0.839593f, 0.313174f, -0.438439f, -0.863970f, -0.657743f, 0.012880f, 0.647436f, 0.797104f, 0.389259f, -0.246367f, -0.651229f, -0.585642f, -0.173294f, 0.255041f, 0.445532f, 0.365919f, 0.132196f, -0.123863f, -0.296386f, -0.300366f, -0.121130f, 0.131319f, 0.283905f, 0.243382f, 0.058090f, -0.149195f, -0.264318f, -0.213203f, 0.002935f, 0.259571f, 0.354185f, 0.176462f, -0.158878f, -0.385738f, -0.314241f, 0.006883f, 0.335851f, 0.433027f, 0.234293f, -0.120865f, -0.399749f, -0.428525f, -0.192458f, 0.159989f, 0.409771f, 0.407355f, 0.165311f, -0.162093f, -0.380703f, -0.363178f, -0.121368f, + 0.182185f, 0.329147f, 0.217130f, -0.048149f, -0.252168f, -0.259387f, -0.096887f, 0.107149f, 0.223963f, 0.189895f, 0.036484f, -0.126658f, -0.188116f, -0.115829f, 0.029570f, 0.148143f, 0.165768f, 0.073698f, -0.070049f, -0.178073f, -0.184208f, -0.074274f, 0.104605f, 0.251155f, 0.256659f, 0.088232f, -0.165369f, -0.345102f, -0.327842f, -0.103404f, 0.212314f, 0.430302f, 0.401416f, 0.127795f, -0.226722f, -0.445483f, -0.395788f, -0.104505f, 0.252892f, 0.449886f, 0.358255f, 0.043671f, -0.282581f, -0.414055f, -0.278763f, 0.024871f, 0.291543f, 0.345936f, 0.169233f, -0.096153f, -0.268652f, -0.253507f, -0.080338f, 0.130126f, 0.236498f, 0.171425f, -0.002885f, -0.150201f, -0.177162f, -0.087915f, 0.048552f, 0.147533f, 0.146069f, 0.043356f, -0.088375f, -0.157521f, -0.122364f, -0.009444f, 0.111084f, 0.161539f, 0.104040f, -0.023391f, -0.131482f, -0.150006f, -0.070957f, 0.056616f, 0.151137f, 0.143361f, 0.035919f, -0.089690f, -0.145884f, -0.105556f, 0.001895f, 0.116345f, 0.162221f, 0.096910f, -0.032915f, -0.126565f, -0.128302f, -0.052313f, 0.064005f, 0.162674f, 0.158987f, 0.035724f, -0.081075f, -0.056659f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.005709f, -0.010879f, -0.009029f, -0.014497f, -0.028118f, -0.021796f, 0.021635f, 0.064568f, 0.047591f, -0.042919f, -0.174684f, -0.301101f, -0.332552f, -0.139058f, 0.285986f, 0.680942f, 0.690074f, 0.235770f, -0.371505f, -0.717305f, -0.607821f, -0.149400f, 0.355819f, 0.587628f, 0.424676f, 0.044500f, -0.253404f, -0.325305f, -0.232083f, -0.075946f, 0.087783f, 0.205289f, 0.223487f, 0.148160f, 0.024157f, -0.123773f, -0.256550f, -0.273946f, -0.108835f, 0.147011f, 0.299983f, 0.237365f, 0.007863f, -0.241826f, -0.354261f, -0.236794f, 0.059506f, 0.339076f, + 0.399689f, 0.193065f, -0.144588f, -0.392061f, -0.380405f, -0.103797f, 0.255794f, 0.442426f, 0.316587f, -0.036976f, -0.368425f, -0.433591f, -0.169769f, 0.232483f, 0.450807f, 0.296888f, -0.104189f, -0.411974f, -0.362406f, 0.011734f, 0.403521f, 0.469538f, 0.117832f, -0.377352f, -0.577477f, -0.269446f, 0.316408f, 0.688907f, 0.515612f, -0.096039f, -0.674967f, -0.745717f, -0.210455f, 0.535597f, 0.890832f, 0.545716f, -0.238937f, -0.845389f, -0.812579f, -0.187246f, 0.553728f, 0.880919f, 0.576103f, -0.139507f, -0.760209f, -0.839593f, -0.313174f, 0.438439f, 0.863970f, 0.657743f, -0.012880f, -0.647436f, -0.797104f, -0.389259f, 0.246367f, 0.651229f, 0.585642f, 0.173294f, -0.255041f, -0.445532f, -0.365919f, -0.132196f, 0.123863f, 0.296386f, 0.300366f, 0.121130f, -0.131319f, -0.283905f, -0.243382f, -0.058090f, 0.149195f, 0.264318f, 0.213203f, -0.002935f, -0.259571f, -0.354185f, -0.176462f, 0.158878f, 0.385738f, 0.314241f, -0.006883f, -0.335851f, -0.433027f, -0.234293f, 0.120865f, 0.399749f, 0.428525f, 0.192458f, -0.159989f, -0.409771f, -0.407355f, -0.165311f, 0.162093f, 0.380703f, 0.363178f, 0.121368f, + -0.182185f, -0.329147f, -0.217130f, 0.048149f, 0.252168f, 0.259387f, 0.096887f, -0.107149f, -0.223963f, -0.189895f, -0.036484f, 0.126658f, 0.188116f, 0.115829f, -0.029570f, -0.148143f, -0.165768f, -0.073698f, 0.070049f, 0.178073f, 0.184208f, 0.074274f, -0.104605f, -0.251155f, -0.256659f, -0.088232f, 0.165369f, 0.345102f, 0.327842f, 0.103404f, -0.212314f, -0.430302f, -0.401416f, -0.127795f, 0.226722f, 0.445483f, 0.395788f, 0.104505f, -0.252892f, -0.449886f, -0.358255f, -0.043671f, 0.282581f, 0.414055f, 0.278763f, -0.024871f, -0.291543f, -0.345936f, -0.169233f, 0.096153f, 0.268652f, 0.253507f, 0.080338f, -0.130126f, -0.236498f, -0.171425f, 0.002885f, 0.150201f, 0.177162f, 0.087915f, -0.048552f, -0.147533f, -0.146069f, -0.043356f, 0.088375f, 0.157521f, 0.122364f, 0.009444f, -0.111084f, -0.161539f, -0.104040f, 0.023391f, 0.131482f, 0.150006f, 0.070957f, -0.056616f, -0.151137f, -0.143361f, -0.035919f, 0.089690f, 0.145884f, 0.105556f, -0.001895f, -0.116345f, -0.162221f, -0.096910f, 0.032915f, 0.126565f, 0.128302f, 0.052313f, -0.064005f, -0.162674f, -0.158987f, -0.035724f, 0.081075f, 0.056659f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.005845f, -0.001257f, -0.036555f, -0.049375f, 0.012643f, 0.084800f, 0.014576f, -0.201375f, -0.309168f, -0.082748f, 0.334661f, 0.545796f, 0.354345f, -0.038791f, -0.300028f, -0.287849f, -0.093049f, 0.112040f, 0.200093f, 0.142178f, 0.003299f, -0.122003f, -0.175417f, -0.135820f, -0.003944f, 0.166483f, 0.261557f, 0.198589f, 0.018859f, -0.149552f, -0.207760f, -0.142108f, -0.005759f, 0.109328f, 0.116794f, 0.013500f, -0.096914f, -0.104851f, -0.013951f, 0.074895f, 0.084523f, 0.027800f, -0.032006f, -0.040871f, 0.017488f, 0.101840f, 0.120955f, 0.014148f, + -0.158385f, -0.246682f, -0.155788f, 0.059675f, 0.245553f, 0.265402f, 0.086381f, -0.186771f, -0.352934f, -0.260570f, 0.038516f, 0.309970f, 0.344531f, 0.135379f, -0.145372f, -0.301340f, -0.237657f, -0.002527f, 0.240431f, 0.310849f, 0.148668f, -0.120962f, -0.277864f, -0.193202f, 0.050179f, 0.224037f, 0.165720f, -0.062061f, -0.232704f, -0.181790f, 0.040655f, 0.236048f, 0.242342f, 0.053073f, -0.196484f, -0.325298f, -0.221162f, 0.074902f, 0.368753f, 0.429341f, 0.171261f, -0.237137f, -0.474123f, -0.334471f, 0.074117f, 0.416297f, 0.416646f, 0.075954f, -0.342246f, -0.505075f, -0.257877f, 0.225430f, 0.548927f, 0.430570f, -0.043506f, -0.507387f, -0.621160f, -0.293115f, 0.274454f, 0.674222f, 0.555679f, -0.029666f, -0.584642f, -0.618175f, -0.138687f, 0.397899f, 0.581786f, 0.367892f, -0.031230f, -0.372027f, -0.477009f, -0.286288f, 0.078980f, 0.371019f, 0.404261f, 0.182245f, -0.145350f, -0.387651f, -0.388422f, -0.109154f, 0.295097f, 0.532622f, 0.391740f, -0.064104f, -0.519012f, -0.636727f, -0.312736f, 0.243096f, 0.648954f, 0.618999f, 0.168320f, -0.396378f, -0.695769f, -0.540792f, -0.048107f, 0.454729f, + 0.646139f, 0.409300f, -0.094082f, -0.523602f, -0.590342f, -0.261818f, 0.223079f, 0.537186f, 0.488163f, 0.125785f, -0.304240f, -0.515916f, -0.368819f, 0.031193f, 0.404420f, 0.497162f, 0.253520f, -0.157908f, -0.461345f, -0.454869f, -0.144638f, 0.261989f, 0.502270f, 0.427614f, 0.082603f, -0.326118f, -0.539975f, -0.404333f, 0.009538f, 0.431059f, 0.576897f, 0.350480f, -0.101522f, -0.493350f, -0.576793f, -0.292774f, 0.182960f, 0.543464f, 0.551483f, 0.200051f, -0.280472f, -0.572702f, -0.483936f, -0.080849f, 0.355408f, 0.532037f, 0.351623f, -0.035457f, -0.357765f, -0.416472f, -0.206505f, 0.104013f, 0.305039f, 0.286136f, 0.092471f, -0.128024f, -0.233683f, -0.176617f, -0.017342f, 0.131343f, 0.181010f, 0.111839f, -0.027622f, -0.149189f, -0.173037f, -0.080999f, 0.064994f, 0.165938f, 0.156643f, 0.045654f, -0.095241f, -0.174626f, -0.137927f, -0.008169f, 0.126073f, 0.174867f, 0.109309f, -0.025298f, -0.142291f, -0.165887f, -0.079334f, 0.060101f, 0.158946f, 0.152835f, 0.047409f, -0.088822f, -0.167055f, -0.134115f, -0.011199f, 0.118513f, 0.169509f, 0.110655f, -0.020076f, -0.138964f, -0.163920f, -0.072282f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.005845f, -0.001257f, -0.036555f, -0.049375f, 0.012643f, 0.084800f, 0.014576f, -0.201375f, -0.309168f, -0.082748f, 0.334661f, 0.545796f, 0.354345f, -0.038791f, -0.300028f, -0.287849f, -0.093049f, 0.112040f, 0.200093f, 0.142178f, 0.003299f, -0.122003f, -0.175417f, -0.135820f, -0.003944f, 0.166483f, 0.261557f, 0.198589f, 0.018859f, -0.149552f, -0.207760f, -0.142108f, -0.005759f, 0.109328f, 0.116794f, 0.013500f, -0.096914f, -0.104851f, -0.013951f, 0.074895f, 0.084523f, 0.027800f, -0.032006f, -0.040871f, 0.017488f, 0.101840f, 0.120955f, 0.014148f, + -0.158385f, -0.246682f, -0.155788f, 0.059675f, 0.245553f, 0.265402f, 0.086381f, -0.186771f, -0.352934f, -0.260570f, 0.038516f, 0.309970f, 0.344531f, 0.135379f, -0.145372f, -0.301340f, -0.237657f, -0.002527f, 0.240431f, 0.310849f, 0.148668f, -0.120962f, -0.277864f, -0.193202f, 0.050179f, 0.224037f, 0.165720f, -0.062061f, -0.232704f, -0.181790f, 0.040655f, 0.236048f, 0.242342f, 0.053073f, -0.196484f, -0.325298f, -0.221162f, 0.074902f, 0.368753f, 0.429341f, 0.171261f, -0.237137f, -0.474123f, -0.334471f, 0.074117f, 0.416297f, 0.416646f, 0.075954f, -0.342246f, -0.505075f, -0.257877f, 0.225430f, 0.548927f, 0.430570f, -0.043506f, -0.507387f, -0.621160f, -0.293115f, 0.274454f, 0.674222f, 0.555679f, -0.029666f, -0.584642f, -0.618175f, -0.138687f, 0.397899f, 0.581786f, 0.367892f, -0.031230f, -0.372027f, -0.477009f, -0.286288f, 0.078980f, 0.371019f, 0.404261f, 0.182245f, -0.145350f, -0.387651f, -0.388422f, -0.109154f, 0.295097f, 0.532622f, 0.391740f, -0.064104f, -0.519012f, -0.636727f, -0.312736f, 0.243096f, 0.648954f, 0.618999f, 0.168320f, -0.396378f, -0.695769f, -0.540792f, -0.048107f, 0.454729f, + 0.646139f, 0.409300f, -0.094082f, -0.523602f, -0.590342f, -0.261818f, 0.223079f, 0.537186f, 0.488163f, 0.125785f, -0.304240f, -0.515916f, -0.368819f, 0.031193f, 0.404420f, 0.497162f, 0.253520f, -0.157908f, -0.461345f, -0.454869f, -0.144638f, 0.261989f, 0.502270f, 0.427614f, 0.082603f, -0.326118f, -0.539975f, -0.404333f, 0.009538f, 0.431059f, 0.576897f, 0.350480f, -0.101522f, -0.493350f, -0.576793f, -0.292774f, 0.182960f, 0.543464f, 0.551483f, 0.200051f, -0.280472f, -0.572702f, -0.483936f, -0.080849f, 0.355408f, 0.532037f, 0.351623f, -0.035457f, -0.357765f, -0.416472f, -0.206505f, 0.104013f, 0.305039f, 0.286136f, 0.092471f, -0.128024f, -0.233683f, -0.176617f, -0.017342f, 0.131343f, 0.181010f, 0.111839f, -0.027622f, -0.149189f, -0.173037f, -0.080999f, 0.064994f, 0.165938f, 0.156643f, 0.045654f, -0.095241f, -0.174626f, -0.137927f, -0.008169f, 0.126073f, 0.174867f, 0.109309f, -0.025298f, -0.142291f, -0.165887f, -0.079334f, 0.060101f, 0.158946f, 0.152835f, 0.047409f, -0.088822f, -0.167055f, -0.134115f, -0.011199f, 0.118513f, 0.169509f, 0.110655f, -0.020076f, -0.138964f, -0.163920f, -0.072282f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.004280f, 0.003712f, -0.000039f, 0.007448f, 0.000653f, -0.031279f, -0.024642f, 0.055582f, 0.109437f, 0.032321f, -0.103567f, -0.146975f, -0.093445f, -0.048562f, -0.015448f, 0.087763f, 0.216210f, 0.206603f, 0.027490f, -0.148188f, -0.169053f, -0.071020f, 0.025224f, 0.066179f, 0.067437f, 0.053319f, 0.040568f, 0.029866f, -0.001616f, -0.057601f, -0.088400f, -0.052951f, 0.011022f, 0.042657f, 0.052949f, 0.086948f, 0.116828f, 0.066078f, -0.058373f, -0.143466f, -0.102838f, 0.025959f, 0.135820f, 0.153005f, 0.071056f, -0.064506f, -0.171225f, -0.165734f, + -0.032676f, 0.140434f, 0.220862f, 0.136917f, -0.062895f, -0.240358f, -0.258909f, -0.081365f, 0.184629f, 0.342546f, 0.251300f, -0.047466f, -0.338949f, -0.391328f, -0.138151f, 0.255548f, 0.497284f, 0.378423f, -0.050929f, -0.487087f, -0.586548f, -0.241610f, 0.309050f, 0.646425f, 0.497923f, -0.037272f, -0.557984f, -0.675954f, -0.312598f, 0.261439f, 0.646352f, 0.594422f, 0.157761f, -0.364834f, -0.633467f, -0.493221f, -0.062175f, 0.374220f, 0.555326f, 0.384568f, -0.027118f, -0.415207f, -0.526856f, -0.313353f, 0.043874f, 0.318965f, 0.414278f, 0.337070f, 0.108750f, -0.204161f, -0.428274f, -0.383596f, -0.068893f, 0.310896f, 0.505334f, 0.384226f, 0.006028f, -0.395733f, -0.534072f, -0.290586f, 0.155093f, 0.468776f, 0.447520f, 0.150126f, -0.203402f, -0.395532f, -0.319112f, -0.033725f, 0.258685f, 0.358371f, 0.223848f, -0.025754f, -0.238817f, -0.319681f, -0.229141f, 0.003595f, 0.245464f, 0.317421f, 0.154378f, -0.112324f, -0.270668f, -0.219759f, -0.035182f, 0.127147f, 0.162269f, 0.073355f, -0.055743f, -0.130966f, -0.110699f, -0.018101f, 0.093874f, 0.173322f, 0.170298f, 0.049660f, -0.155769f, -0.316476f, + -0.283316f, -0.029708f, 0.287462f, 0.431514f, 0.273175f, -0.099654f, -0.436829f, -0.498588f, -0.222307f, 0.224426f, 0.541249f, 0.494937f, 0.098214f, -0.375575f, -0.584817f, -0.380483f, 0.084802f, 0.484989f, 0.559578f, 0.275608f, -0.170620f, -0.485390f, -0.466713f, -0.139996f, 0.262266f, 0.468942f, 0.354388f, 0.008534f, -0.333036f, -0.444719f, -0.261879f, 0.078293f, 0.347718f, 0.393204f, 0.212816f, -0.081399f, -0.330971f, -0.391065f, -0.208294f, 0.117230f, 0.375204f, 0.392412f, 0.159715f, -0.165843f, -0.371777f, -0.330474f, -0.082200f, 0.196114f, 0.320243f, 0.227104f, 0.004077f, -0.188284f, -0.230333f, -0.116915f, 0.052873f, 0.158213f, 0.142989f, 0.038424f, -0.077048f, -0.130993f, -0.093653f, 0.006515f, 0.099905f, 0.124565f, 0.068241f, -0.030164f, -0.108737f, -0.116444f, -0.044911f, 0.058931f, 0.123251f, 0.106074f, 0.022102f, -0.074385f, -0.122885f, -0.089317f, 0.007617f, 0.102044f, 0.129390f, 0.074122f, -0.026652f, -0.110563f, -0.122003f, -0.047945f, 0.061875f, 0.128966f, 0.111521f, 0.027995f, -0.070661f, -0.126499f, -0.094637f, 0.013317f, 0.114585f, 0.132227f, 0.079481f, 0.022065f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.004280f, 0.003712f, -0.000039f, 0.007448f, 0.000653f, -0.031279f, -0.024642f, 0.055582f, 0.109437f, 0.032321f, -0.103567f, -0.146975f, -0.093445f, -0.048562f, -0.015448f, 0.087763f, 0.216210f, 0.206603f, 0.027490f, -0.148188f, -0.169053f, -0.071020f, 0.025224f, 0.066179f, 0.067437f, 0.053319f, 0.040568f, 0.029866f, -0.001616f, -0.057601f, -0.088400f, -0.052951f, 0.011022f, 0.042657f, 0.052949f, 0.086948f, 0.116828f, 0.066078f, -0.058373f, -0.143466f, -0.102838f, 0.025959f, 0.135820f, 0.153005f, 0.071056f, -0.064506f, -0.171225f, -0.165734f, + -0.032676f, 0.140434f, 0.220862f, 0.136917f, -0.062895f, -0.240358f, -0.258909f, -0.081365f, 0.184629f, 0.342546f, 0.251300f, -0.047466f, -0.338949f, -0.391328f, -0.138151f, 0.255548f, 0.497284f, 0.378423f, -0.050929f, -0.487087f, -0.586548f, -0.241610f, 0.309050f, 0.646425f, 0.497923f, -0.037272f, -0.557984f, -0.675954f, -0.312598f, 0.261439f, 0.646352f, 0.594422f, 0.157761f, -0.364834f, -0.633467f, -0.493221f, -0.062175f, 0.374220f, 0.555326f, 0.384568f, -0.027118f, -0.415207f, -0.526856f, -0.313353f, 0.043874f, 0.318965f, 0.414278f, 0.337070f, 0.108750f, -0.204161f, -0.428274f, -0.383596f, -0.068893f, 0.310896f, 0.505334f, 0.384226f, 0.006028f, -0.395733f, -0.534072f, -0.290586f, 0.155093f, 0.468776f, 0.447520f, 0.150126f, -0.203402f, -0.395532f, -0.319112f, -0.033725f, 0.258685f, 0.358371f, 0.223848f, -0.025754f, -0.238817f, -0.319681f, -0.229141f, 0.003595f, 0.245464f, 0.317421f, 0.154378f, -0.112324f, -0.270668f, -0.219759f, -0.035182f, 0.127147f, 0.162269f, 0.073355f, -0.055743f, -0.130966f, -0.110699f, -0.018101f, 0.093874f, 0.173322f, 0.170298f, 0.049660f, -0.155769f, -0.316476f, + -0.283316f, -0.029708f, 0.287462f, 0.431514f, 0.273175f, -0.099654f, -0.436829f, -0.498588f, -0.222307f, 0.224426f, 0.541249f, 0.494937f, 0.098214f, -0.375575f, -0.584817f, -0.380483f, 0.084802f, 0.484989f, 0.559578f, 0.275608f, -0.170620f, -0.485390f, -0.466713f, -0.139996f, 0.262266f, 0.468942f, 0.354388f, 0.008534f, -0.333036f, -0.444719f, -0.261879f, 0.078293f, 0.347718f, 0.393204f, 0.212816f, -0.081399f, -0.330971f, -0.391065f, -0.208294f, 0.117230f, 0.375204f, 0.392412f, 0.159715f, -0.165843f, -0.371777f, -0.330474f, -0.082200f, 0.196114f, 0.320243f, 0.227104f, 0.004077f, -0.188284f, -0.230333f, -0.116915f, 0.052873f, 0.158213f, 0.142989f, 0.038424f, -0.077048f, -0.130993f, -0.093653f, 0.006515f, 0.099905f, 0.124565f, 0.068241f, -0.030164f, -0.108737f, -0.116444f, -0.044911f, 0.058931f, 0.123251f, 0.106074f, 0.022102f, -0.074385f, -0.122885f, -0.089317f, 0.007617f, 0.102044f, 0.129390f, 0.074122f, -0.026652f, -0.110563f, -0.122003f, -0.047945f, 0.061875f, 0.128966f, 0.111521f, 0.027995f, -0.070661f, -0.126499f, -0.094637f, 0.013317f, 0.114585f, 0.132227f, 0.079481f, 0.022065f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.011054f, -0.007070f, -0.051753f, 0.014589f, 0.233520f, 0.380519f, 0.162453f, -0.369840f, -0.731647f, -0.472019f, 0.285481f, 0.897293f, 0.831291f, 0.163924f, -0.562235f, -0.855441f, -0.597748f, -0.003812f, 0.564531f, 0.767912f, 0.457001f, -0.202713f, -0.788397f, -0.889359f, -0.409800f, 0.339658f, 0.859637f, 0.830526f, 0.324490f, -0.300816f, -0.679798f, -0.639208f, -0.247785f, 0.233655f, 0.500997f, 0.420723f, 0.122352f, -0.153025f, -0.272366f, -0.250329f, -0.141199f, 0.015379f, 0.164609f, 0.239381f, 0.206161f, 0.076145f, -0.107656f, -0.262495f, + -0.286346f, -0.142136f, 0.091062f, 0.278557f, 0.322804f, 0.195488f, -0.058660f, -0.312279f, -0.402994f, -0.254102f, 0.050633f, 0.325479f, 0.407512f, 0.245268f, -0.073559f, -0.357746f, -0.422720f, -0.221149f, 0.116620f, 0.372269f, 0.385425f, 0.155511f, -0.158653f, -0.346339f, -0.294224f, -0.062915f, 0.171720f, 0.255869f, 0.160346f, -0.019314f, -0.150339f, -0.162008f, -0.077793f, 0.030104f, 0.100992f, 0.109248f, 0.060535f, -0.017894f, -0.093919f, -0.144493f, -0.149009f, -0.084490f, 0.045428f, 0.181380f, 0.236772f, 0.163461f, -0.013805f, -0.207243f, -0.297200f, -0.195954f, 0.065527f, 0.320373f, 0.378654f, 0.177633f, -0.170608f, -0.452556f, -0.473952f, -0.178205f, 0.280137f, 0.590859f, 0.500293f, 0.040555f, -0.444062f, -0.552824f, -0.183483f, 0.343567f, 0.558098f, 0.278567f, -0.226937f, -0.515700f, -0.368201f, 0.074361f, 0.466951f, 0.507020f, 0.136923f, -0.371910f, -0.581171f, -0.272678f, 0.295031f, 0.599293f, 0.361782f, -0.188773f, -0.560123f, -0.455399f, -0.000212f, 0.409015f, 0.450195f, 0.128342f, -0.250838f, -0.358929f, -0.131950f, 0.194025f, 0.318906f, 0.146404f, -0.157945f, -0.334355f, + -0.247434f, 0.019837f, 0.249120f, 0.269314f, 0.090931f, -0.120606f, -0.203825f, -0.134661f, -0.011592f, 0.062951f, 0.064076f, 0.027257f, -0.007058f, -0.019104f, -0.008269f, 0.010538f, 0.017648f, 0.010506f, 0.008106f, 0.021396f, 0.028143f, -0.002454f, -0.059516f, -0.086719f, -0.042890f, 0.044637f, 0.102853f, 0.085631f, 0.012221f, -0.061110f, -0.092578f, -0.079083f, -0.044526f, -0.011128f, 0.019864f, 0.056626f, 0.087271f, 0.078526f, 0.015838f, -0.067588f, -0.115635f, -0.095662f, -0.016369f, 0.079679f, 0.130979f, 0.092596f, -0.016440f, -0.114220f, -0.126340f, -0.051412f, 0.047829f, 0.101843f, 0.079272f, 0.002521f, -0.066235f, -0.074167f, -0.026831f, 0.023270f, 0.037402f, 0.020887f, -0.003360f, -0.022079f, -0.027762f, -0.014908f, 0.008863f, 0.024752f, 0.022300f, 0.006488f, -0.012643f, -0.025499f, -0.022858f, -0.003943f, 0.017599f, 0.024935f, 0.013225f, -0.009036f, -0.027074f, -0.027334f, -0.007581f, 0.018233f, 0.031604f, 0.025079f, 0.003459f, -0.021928f, -0.035180f, -0.024458f, 0.003203f, 0.025918f, 0.029636f, 0.015872f, -0.009234f, -0.034584f, -0.039129f, -0.014118f, 0.013692f, 0.011282f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.011054f, -0.007070f, -0.051753f, 0.014589f, 0.233520f, 0.380519f, 0.162453f, -0.369840f, -0.731647f, -0.472019f, 0.285481f, 0.897293f, 0.831291f, 0.163924f, -0.562235f, -0.855441f, -0.597748f, -0.003812f, 0.564531f, 0.767912f, 0.457001f, -0.202713f, -0.788397f, -0.889359f, -0.409800f, 0.339658f, 0.859637f, 0.830526f, 0.324490f, -0.300816f, -0.679798f, -0.639208f, -0.247785f, 0.233655f, 0.500997f, 0.420723f, 0.122352f, -0.153025f, -0.272366f, -0.250329f, -0.141199f, 0.015379f, 0.164609f, 0.239381f, 0.206161f, 0.076145f, -0.107656f, -0.262495f, + -0.286346f, -0.142136f, 0.091062f, 0.278557f, 0.322804f, 0.195488f, -0.058660f, -0.312279f, -0.402994f, -0.254102f, 0.050633f, 0.325479f, 0.407512f, 0.245268f, -0.073559f, -0.357746f, -0.422720f, -0.221149f, 0.116620f, 0.372269f, 0.385425f, 0.155511f, -0.158653f, -0.346339f, -0.294224f, -0.062915f, 0.171720f, 0.255869f, 0.160346f, -0.019314f, -0.150339f, -0.162008f, -0.077793f, 0.030104f, 0.100992f, 0.109248f, 0.060535f, -0.017894f, -0.093919f, -0.144493f, -0.149009f, -0.084490f, 0.045428f, 0.181380f, 0.236772f, 0.163461f, -0.013805f, -0.207243f, -0.297200f, -0.195954f, 0.065527f, 0.320373f, 0.378654f, 0.177633f, -0.170608f, -0.452556f, -0.473952f, -0.178205f, 0.280137f, 0.590859f, 0.500293f, 0.040555f, -0.444062f, -0.552824f, -0.183483f, 0.343567f, 0.558098f, 0.278567f, -0.226937f, -0.515700f, -0.368201f, 0.074361f, 0.466951f, 0.507020f, 0.136923f, -0.371910f, -0.581171f, -0.272678f, 0.295031f, 0.599293f, 0.361782f, -0.188773f, -0.560123f, -0.455399f, -0.000212f, 0.409015f, 0.450195f, 0.128342f, -0.250838f, -0.358929f, -0.131950f, 0.194025f, 0.318906f, 0.146404f, -0.157945f, -0.334355f, + -0.247434f, 0.019837f, 0.249120f, 0.269314f, 0.090931f, -0.120606f, -0.203825f, -0.134661f, -0.011592f, 0.062951f, 0.064076f, 0.027257f, -0.007058f, -0.019104f, -0.008269f, 0.010538f, 0.017648f, 0.010506f, 0.008106f, 0.021396f, 0.028143f, -0.002454f, -0.059516f, -0.086719f, -0.042890f, 0.044637f, 0.102853f, 0.085631f, 0.012221f, -0.061110f, -0.092578f, -0.079083f, -0.044526f, -0.011128f, 0.019864f, 0.056626f, 0.087271f, 0.078526f, 0.015838f, -0.067588f, -0.115635f, -0.095662f, -0.016369f, 0.079679f, 0.130979f, 0.092596f, -0.016440f, -0.114220f, -0.126340f, -0.051412f, 0.047829f, 0.101843f, 0.079272f, 0.002521f, -0.066235f, -0.074167f, -0.026831f, 0.023270f, 0.037402f, 0.020887f, -0.003360f, -0.022079f, -0.027762f, -0.014908f, 0.008863f, 0.024752f, 0.022300f, 0.006488f, -0.012643f, -0.025499f, -0.022858f, -0.003943f, 0.017599f, 0.024935f, 0.013225f, -0.009036f, -0.027074f, -0.027334f, -0.007581f, 0.018233f, 0.031604f, 0.025079f, 0.003459f, -0.021928f, -0.035180f, -0.024458f, 0.003203f, 0.025918f, 0.029636f, 0.015872f, -0.009234f, -0.034584f, -0.039129f, -0.014118f, 0.013692f, 0.011282f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.000066f, -0.006446f, -0.004400f, 0.025295f, 0.045628f, 0.027396f, 0.023307f, 0.060622f, 0.039319f, -0.111806f, -0.254961f, -0.192022f, 0.057167f, 0.278509f, 0.317016f, 0.176999f, -0.056693f, -0.252718f, -0.254557f, -0.023929f, 0.256919f, 0.335698f, 0.135558f, -0.194256f, -0.420609f, -0.384673f, -0.101767f, 0.234569f, 0.398843f, 0.322361f, 0.111765f, -0.090608f, -0.194757f, -0.156835f, -0.004372f, 0.135922f, 0.139189f, 0.021353f, -0.093162f, -0.125628f, -0.091576f, -0.024886f, 0.055679f, 0.112411f, 0.100460f, 0.023672f, -0.064900f, -0.114261f, + -0.101236f, -0.029409f, 0.064122f, 0.119308f, 0.099450f, 0.021164f, -0.066218f, -0.114090f, -0.092493f, -0.007394f, 0.090545f, 0.135655f, 0.097412f, 0.000910f, -0.093425f, -0.128529f, -0.088704f, -0.010281f, 0.054542f, 0.082224f, 0.075537f, 0.037293f, -0.021080f, -0.060221f, -0.045531f, 0.003377f, 0.032644f, 0.021011f, -0.006179f, -0.022795f, -0.025339f, -0.014951f, 0.006887f, 0.023010f, 0.012867f, -0.015081f, -0.028698f, -0.014963f, 0.003423f, 0.000888f, -0.016649f, -0.018468f, 0.015625f, 0.069377f, 0.097152f, 0.061345f, -0.028382f, -0.112663f, -0.128016f, -0.062631f, 0.032351f, 0.088685f, 0.077692f, 0.023486f, -0.029762f, -0.053372f, -0.042327f, -0.006150f, 0.037911f, 0.067859f, 0.062751f, 0.013915f, -0.059782f, -0.107345f, -0.077487f, 0.022672f, 0.110306f, 0.099575f, 0.000702f, -0.076162f, -0.033883f, 0.102383f, 0.200474f, 0.145186f, -0.050151f, -0.241788f, -0.265120f, -0.076360f, 0.187150f, 0.301979f, 0.154267f, -0.141852f, -0.335214f, -0.260093f, 0.025295f, 0.298897f, 0.352753f, 0.143439f, -0.172578f, -0.347706f, -0.245457f, 0.033580f, 0.250090f, 0.254389f, 0.089711f, -0.105239f, + -0.219033f, -0.194857f, -0.040020f, 0.141073f, 0.199748f, 0.093566f, -0.059561f, -0.120585f, -0.074908f, -0.001730f, 0.041947f, 0.050779f, 0.031022f, -0.005519f, -0.028797f, -0.018690f, 0.007358f, 0.023235f, 0.029285f, 0.032943f, 0.020207f, -0.020590f, -0.062100f, -0.057199f, 0.004912f, 0.078006f, 0.096812f, 0.034806f, -0.067797f, -0.131307f, -0.102333f, -0.001387f, 0.094374f, 0.116817f, 0.059003f, -0.027568f, -0.079302f, -0.067802f, -0.012913f, 0.041007f, 0.059382f, 0.036624f, -0.005633f, -0.035765f, -0.035699f, -0.013491f, 0.008176f, 0.014984f, 0.010012f, 0.004243f, 0.004227f, 0.007169f, 0.004931f, -0.004483f, -0.010982f, -0.006140f, 0.000460f, -0.006494f, -0.020769f, -0.018990f, 0.004816f, 0.028633f, 0.031314f, 0.014318f, -0.008942f, -0.026857f, -0.028843f, -0.009686f, 0.018714f, 0.033849f, 0.025355f, 0.002213f, -0.020413f, -0.030633f, -0.021410f, 0.003204f, 0.025602f, 0.029328f, 0.014478f, -0.006722f, -0.022440f, -0.024250f, -0.008745f, 0.015146f, 0.028928f, 0.022382f, 0.002881f, -0.015620f, -0.024037f, -0.017533f, 0.003324f, 0.025495f, 0.029810f, 0.013010f, -0.005080f, -0.005426f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000066f, 0.006446f, 0.004400f, -0.025295f, -0.045628f, -0.027396f, -0.023307f, -0.060622f, -0.039319f, 0.111806f, 0.254961f, 0.192022f, -0.057167f, -0.278509f, -0.317016f, -0.176999f, 0.056693f, 0.252718f, 0.254557f, 0.023929f, -0.256919f, -0.335698f, -0.135558f, 0.194256f, 0.420609f, 0.384673f, 0.101767f, -0.234569f, -0.398843f, -0.322361f, -0.111765f, 0.090608f, 0.194757f, 0.156835f, 0.004372f, -0.135922f, -0.139189f, -0.021353f, 0.093162f, 0.125628f, 0.091576f, 0.024886f, -0.055679f, -0.112411f, -0.100460f, -0.023672f, 0.064900f, 0.114261f, + 0.101236f, 0.029409f, -0.064122f, -0.119308f, -0.099450f, -0.021164f, 0.066218f, 0.114090f, 0.092493f, 0.007394f, -0.090545f, -0.135655f, -0.097412f, -0.000910f, 0.093425f, 0.128529f, 0.088704f, 0.010281f, -0.054542f, -0.082224f, -0.075537f, -0.037293f, 0.021080f, 0.060221f, 0.045531f, -0.003377f, -0.032644f, -0.021011f, 0.006179f, 0.022795f, 0.025339f, 0.014951f, -0.006887f, -0.023010f, -0.012867f, 0.015081f, 0.028698f, 0.014963f, -0.003423f, -0.000888f, 0.016649f, 0.018468f, -0.015625f, -0.069377f, -0.097152f, -0.061345f, 0.028382f, 0.112663f, 0.128016f, 0.062631f, -0.032351f, -0.088685f, -0.077692f, -0.023486f, 0.029762f, 0.053372f, 0.042327f, 0.006150f, -0.037911f, -0.067859f, -0.062751f, -0.013915f, 0.059782f, 0.107345f, 0.077487f, -0.022672f, -0.110306f, -0.099575f, -0.000702f, 0.076162f, 0.033883f, -0.102383f, -0.200474f, -0.145186f, 0.050151f, 0.241788f, 0.265120f, 0.076360f, -0.187150f, -0.301979f, -0.154267f, 0.141852f, 0.335214f, 0.260093f, -0.025295f, -0.298897f, -0.352753f, -0.143439f, 0.172578f, 0.347706f, 0.245457f, -0.033580f, -0.250090f, -0.254389f, -0.089711f, 0.105239f, + 0.219033f, 0.194857f, 0.040020f, -0.141073f, -0.199748f, -0.093566f, 0.059561f, 0.120585f, 0.074908f, 0.001730f, -0.041947f, -0.050779f, -0.031022f, 0.005519f, 0.028797f, 0.018690f, -0.007358f, -0.023235f, -0.029285f, -0.032943f, -0.020207f, 0.020590f, 0.062100f, 0.057199f, -0.004912f, -0.078006f, -0.096812f, -0.034806f, 0.067797f, 0.131307f, 0.102333f, 0.001387f, -0.094374f, -0.116817f, -0.059003f, 0.027568f, 0.079302f, 0.067802f, 0.012913f, -0.041007f, -0.059382f, -0.036624f, 0.005633f, 0.035765f, 0.035699f, 0.013491f, -0.008176f, -0.014984f, -0.010012f, -0.004243f, -0.004227f, -0.007169f, -0.004931f, 0.004483f, 0.010982f, 0.006140f, -0.000460f, 0.006494f, 0.020769f, 0.018990f, -0.004816f, -0.028633f, -0.031314f, -0.014318f, 0.008942f, 0.026857f, 0.028843f, 0.009686f, -0.018714f, -0.033849f, -0.025355f, -0.002213f, 0.020413f, 0.030633f, 0.021410f, -0.003204f, -0.025602f, -0.029328f, -0.014478f, 0.006722f, 0.022440f, 0.024250f, 0.008745f, -0.015146f, -0.028928f, -0.022382f, -0.002881f, 0.015620f, 0.024037f, 0.017533f, -0.003324f, -0.025495f, -0.029810f, -0.013010f, 0.005080f, 0.005426f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.015929f, 0.029234f, 0.016763f, 0.009672f, 0.019371f, 0.015823f, -0.011489f, -0.016215f, 0.034107f, 0.084410f, 0.050543f, -0.066458f, -0.180755f, -0.216641f, -0.149273f, 0.011211f, 0.196415f, 0.272361f, 0.156942f, -0.057285f, -0.183501f, -0.145504f, -0.030607f, 0.050032f, 0.070702f, 0.060642f, 0.043305f, 0.025909f, 0.005034f, -0.025033f, -0.049462f, -0.038843f, 0.002459f, 0.029906f, 0.022211f, 0.006533f, 0.000245f, -0.016499f, -0.043976f, -0.038985f, 0.017319f, 0.079179f, 0.095554f, 0.064698f, 0.008506f, -0.056291f, -0.098164f, -0.074085f, + 0.014099f, 0.100620f, 0.117763f, 0.055103f, -0.047962f, -0.135439f, -0.153178f, -0.073713f, 0.069561f, 0.187037f, 0.194092f, 0.077510f, -0.089924f, -0.195295f, -0.161175f, -0.004442f, 0.165011f, 0.216741f, 0.101364f, -0.097592f, -0.220143f, -0.164550f, 0.020137f, 0.180059f, 0.195075f, 0.069319f, -0.095513f, -0.186739f, -0.148793f, -0.011058f, 0.128043f, 0.168222f, 0.086730f, -0.048460f, -0.146158f, -0.158456f, -0.084490f, 0.048132f, 0.174315f, 0.200098f, 0.082528f, -0.098374f, -0.200692f, -0.165052f, -0.051900f, 0.066260f, 0.172868f, 0.238355f, 0.176796f, -0.040045f, -0.271349f, -0.306316f, -0.081786f, 0.242261f, 0.415943f, 0.292026f, -0.060213f, -0.383798f, -0.424293f, -0.158167f, 0.182304f, 0.340012f, 0.255424f, 0.050051f, -0.128676f, -0.193086f, -0.123330f, 0.021458f, 0.127605f, 0.125671f, 0.051253f, -0.022281f, -0.072538f, -0.110355f, -0.115876f, -0.052418f, 0.065262f, 0.159814f, 0.157155f, 0.052063f, -0.086913f, -0.169788f, -0.150465f, -0.053534f, 0.054041f, 0.112166f, 0.097926f, 0.030226f, -0.043825f, -0.076322f, -0.045673f, 0.031129f, 0.099703f, 0.090733f, -0.020480f, -0.160249f, + -0.198293f, -0.077586f, 0.113320f, 0.221111f, 0.168033f, 0.003310f, -0.153638f, -0.199156f, -0.105615f, 0.062865f, 0.192074f, 0.195452f, 0.070221f, -0.102177f, -0.204113f, -0.159134f, 0.003555f, 0.163527f, 0.207756f, 0.118671f, -0.029514f, -0.137242f, -0.140175f, -0.043126f, 0.078844f, 0.131507f, 0.077593f, -0.036429f, -0.125364f, -0.128127f, -0.042646f, 0.073719f, 0.142170f, 0.122797f, 0.039033f, -0.057859f, -0.126496f, -0.134374f, -0.061883f, 0.062732f, 0.158887f, 0.156294f, 0.056158f, -0.075754f, -0.158459f, -0.140410f, -0.031730f, 0.092197f, 0.143301f, 0.094062f, -0.006247f, -0.082657f, -0.090834f, -0.037952f, 0.028813f, 0.059100f, 0.040472f, 0.001575f, -0.025219f, -0.029603f, -0.014679f, 0.011686f, 0.031974f, 0.028588f, 0.004869f, -0.018732f, -0.028072f, -0.021183f, -0.000227f, 0.024684f, 0.033917f, 0.018296f, -0.007839f, -0.024662f, -0.025630f, -0.012063f, 0.012191f, 0.033131f, 0.032631f, 0.009753f, -0.017507f, -0.032117f, -0.027244f, -0.003607f, 0.026002f, 0.038769f, 0.024221f, -0.003907f, -0.026080f, -0.032505f, -0.018105f, 0.013733f, 0.039397f, 0.035358f, 0.012457f, 0.000254f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.015929f, -0.029234f, -0.016763f, -0.009672f, -0.019371f, -0.015823f, 0.011489f, 0.016215f, -0.034107f, -0.084410f, -0.050543f, 0.066458f, 0.180755f, 0.216641f, 0.149273f, -0.011211f, -0.196415f, -0.272361f, -0.156942f, 0.057285f, 0.183501f, 0.145504f, 0.030607f, -0.050032f, -0.070702f, -0.060642f, -0.043305f, -0.025909f, -0.005034f, 0.025033f, 0.049462f, 0.038843f, -0.002459f, -0.029906f, -0.022211f, -0.006533f, -0.000245f, 0.016499f, 0.043976f, 0.038985f, -0.017319f, -0.079179f, -0.095554f, -0.064698f, -0.008506f, 0.056291f, 0.098164f, 0.074085f, + -0.014099f, -0.100620f, -0.117763f, -0.055103f, 0.047962f, 0.135439f, 0.153178f, 0.073713f, -0.069561f, -0.187037f, -0.194092f, -0.077510f, 0.089924f, 0.195295f, 0.161175f, 0.004442f, -0.165011f, -0.216741f, -0.101364f, 0.097592f, 0.220143f, 0.164550f, -0.020137f, -0.180059f, -0.195075f, -0.069319f, 0.095513f, 0.186739f, 0.148793f, 0.011058f, -0.128043f, -0.168222f, -0.086730f, 0.048460f, 0.146158f, 0.158456f, 0.084490f, -0.048132f, -0.174315f, -0.200098f, -0.082528f, 0.098374f, 0.200692f, 0.165052f, 0.051900f, -0.066260f, -0.172868f, -0.238355f, -0.176796f, 0.040045f, 0.271349f, 0.306316f, 0.081786f, -0.242261f, -0.415943f, -0.292026f, 0.060213f, 0.383798f, 0.424293f, 0.158167f, -0.182304f, -0.340012f, -0.255424f, -0.050051f, 0.128676f, 0.193086f, 0.123330f, -0.021458f, -0.127605f, -0.125671f, -0.051253f, 0.022281f, 0.072538f, 0.110355f, 0.115876f, 0.052418f, -0.065262f, -0.159814f, -0.157155f, -0.052063f, 0.086913f, 0.169788f, 0.150465f, 0.053534f, -0.054041f, -0.112166f, -0.097926f, -0.030226f, 0.043825f, 0.076322f, 0.045673f, -0.031129f, -0.099703f, -0.090733f, 0.020480f, 0.160249f, + 0.198293f, 0.077586f, -0.113320f, -0.221111f, -0.168033f, -0.003310f, 0.153638f, 0.199156f, 0.105615f, -0.062865f, -0.192074f, -0.195452f, -0.070221f, 0.102177f, 0.204113f, 0.159134f, -0.003555f, -0.163527f, -0.207756f, -0.118671f, 0.029514f, 0.137242f, 0.140175f, 0.043126f, -0.078844f, -0.131507f, -0.077593f, 0.036429f, 0.125364f, 0.128127f, 0.042646f, -0.073719f, -0.142170f, -0.122797f, -0.039033f, 0.057859f, 0.126496f, 0.134374f, 0.061883f, -0.062732f, -0.158887f, -0.156294f, -0.056158f, 0.075754f, 0.158459f, 0.140410f, 0.031730f, -0.092197f, -0.143301f, -0.094062f, 0.006247f, 0.082657f, 0.090834f, 0.037952f, -0.028813f, -0.059100f, -0.040472f, -0.001575f, 0.025219f, 0.029603f, 0.014679f, -0.011686f, -0.031974f, -0.028588f, -0.004869f, 0.018732f, 0.028072f, 0.021183f, 0.000227f, -0.024684f, -0.033917f, -0.018296f, 0.007839f, 0.024662f, 0.025630f, 0.012063f, -0.012191f, -0.033131f, -0.032631f, -0.009753f, 0.017507f, 0.032117f, 0.027244f, 0.003607f, -0.026002f, -0.038769f, -0.024221f, 0.003907f, 0.026080f, 0.032505f, 0.018105f, -0.013733f, -0.039397f, -0.035358f, -0.012457f, -0.000254f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.008155f, 0.014846f, 0.058753f, 0.017794f, -0.084333f, -0.098226f, -0.008610f, 0.014440f, -0.104677f, -0.200204f, -0.099132f, 0.138016f, 0.310898f, 0.307805f, 0.157331f, -0.050636f, -0.207633f, -0.221553f, -0.092256f, 0.077414f, 0.180593f, 0.179997f, 0.084137f, -0.070051f, -0.188530f, -0.160319f, 0.017504f, 0.202446f, 0.239595f, 0.107707f, -0.083073f, -0.200471f, -0.178500f, -0.041448f, 0.118139f, 0.196726f, 0.147611f, 0.009422f, -0.126068f, -0.177307f, -0.122857f, -0.006478f, 0.104342f, 0.164920f, 0.159215f, 0.080624f, -0.059865f, -0.203826f, + -0.257724f, -0.162978f, 0.044134f, 0.244520f, 0.309322f, 0.182542f, -0.073427f, -0.302159f, -0.348234f, -0.167873f, 0.128452f, 0.343665f, 0.331028f, 0.100414f, -0.189147f, -0.344243f, -0.268073f, -0.017261f, 0.239438f, 0.329783f, 0.195439f, -0.061232f, -0.252306f, -0.250446f, -0.080402f, 0.116388f, 0.199780f, 0.133405f, -0.001476f, -0.089278f, -0.083984f, -0.026769f, 0.026675f, 0.055474f, 0.047047f, -0.013213f, -0.086560f, -0.077400f, 0.045480f, 0.163909f, 0.129214f, -0.043758f, -0.175933f, -0.127868f, 0.049601f, 0.180439f, 0.137651f, -0.052675f, -0.234778f, -0.236480f, -0.010892f, 0.289848f, 0.406696f, 0.199317f, -0.197493f, -0.469040f, -0.397807f, -0.046354f, 0.322545f, 0.468248f, 0.318816f, -0.016454f, -0.310017f, -0.346651f, -0.098294f, 0.221806f, 0.346664f, 0.208015f, -0.035716f, -0.193229f, -0.193558f, -0.075689f, 0.072428f, 0.150923f, 0.107610f, -0.006695f, -0.087971f, -0.092255f, -0.056253f, -0.015739f, 0.032245f, 0.079781f, 0.083034f, 0.014615f, -0.089696f, -0.154426f, -0.123634f, -0.002731f, 0.138293f, 0.205577f, 0.144256f, -0.023592f, -0.204895f, -0.274530f, -0.152777f, 0.101900f, + 0.295208f, 0.258308f, 0.020261f, -0.218863f, -0.284976f, -0.163152f, 0.041509f, 0.202170f, 0.226051f, 0.094405f, -0.104341f, -0.218536f, -0.156668f, 0.030494f, 0.195911f, 0.216775f, 0.081593f, -0.109457f, -0.220309f, -0.178121f, -0.021465f, 0.139141f, 0.204869f, 0.144590f, -0.000310f, -0.143372f, -0.198182f, -0.129450f, 0.020845f, 0.158913f, 0.200904f, 0.124769f, -0.021000f, -0.150172f, -0.188658f, -0.114798f, 0.027787f, 0.152279f, 0.179398f, 0.089884f, -0.058928f, -0.169173f, -0.167794f, -0.056364f, 0.088343f, 0.166696f, 0.128392f, 0.008387f, -0.104990f, -0.139226f, -0.083218f, 0.017082f, 0.094263f, 0.101195f, 0.040770f, -0.037436f, -0.077783f, -0.061206f, -0.010263f, 0.037948f, 0.056549f, 0.037758f, -0.005507f, -0.045018f, -0.054580f, -0.028455f, 0.015674f, 0.049328f, 0.050522f, 0.017695f, -0.027351f, -0.053643f, -0.043687f, -0.005142f, 0.036341f, 0.054174f, 0.036930f, -0.003847f, -0.040664f, -0.049542f, -0.026191f, 0.013462f, 0.044536f, 0.047143f, 0.018626f, -0.022384f, -0.047736f, -0.040751f, -0.007424f, 0.030301f, 0.049175f, 0.036865f, -0.000315f, -0.037910f, -0.048008f, -0.021595f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.008155f, -0.014846f, -0.058753f, -0.017794f, 0.084333f, 0.098226f, 0.008610f, -0.014440f, 0.104677f, 0.200204f, 0.099132f, -0.138016f, -0.310898f, -0.307805f, -0.157331f, 0.050636f, 0.207633f, 0.221553f, 0.092256f, -0.077414f, -0.180593f, -0.179997f, -0.084137f, 0.070051f, 0.188530f, 0.160319f, -0.017504f, -0.202446f, -0.239595f, -0.107707f, 0.083073f, 0.200471f, 0.178500f, 0.041448f, -0.118139f, -0.196726f, -0.147611f, -0.009422f, 0.126068f, 0.177307f, 0.122857f, 0.006478f, -0.104342f, -0.164920f, -0.159215f, -0.080624f, 0.059865f, 0.203826f, + 0.257724f, 0.162978f, -0.044134f, -0.244520f, -0.309322f, -0.182542f, 0.073427f, 0.302159f, 0.348234f, 0.167873f, -0.128452f, -0.343665f, -0.331028f, -0.100414f, 0.189147f, 0.344243f, 0.268073f, 0.017261f, -0.239438f, -0.329783f, -0.195439f, 0.061232f, 0.252306f, 0.250446f, 0.080402f, -0.116388f, -0.199780f, -0.133405f, 0.001476f, 0.089278f, 0.083984f, 0.026769f, -0.026675f, -0.055474f, -0.047047f, 0.013213f, 0.086560f, 0.077400f, -0.045480f, -0.163909f, -0.129214f, 0.043758f, 0.175933f, 0.127868f, -0.049601f, -0.180439f, -0.137651f, 0.052675f, 0.234778f, 0.236480f, 0.010892f, -0.289848f, -0.406696f, -0.199317f, 0.197493f, 0.469040f, 0.397807f, 0.046354f, -0.322545f, -0.468248f, -0.318816f, 0.016454f, 0.310017f, 0.346651f, 0.098294f, -0.221806f, -0.346664f, -0.208015f, 0.035716f, 0.193229f, 0.193558f, 0.075689f, -0.072428f, -0.150923f, -0.107610f, 0.006695f, 0.087971f, 0.092255f, 0.056253f, 0.015739f, -0.032245f, -0.079781f, -0.083034f, -0.014615f, 0.089696f, 0.154426f, 0.123634f, 0.002731f, -0.138293f, -0.205577f, -0.144256f, 0.023592f, 0.204895f, 0.274530f, 0.152777f, -0.101900f, + -0.295208f, -0.258308f, -0.020261f, 0.218863f, 0.284976f, 0.163152f, -0.041509f, -0.202170f, -0.226051f, -0.094405f, 0.104341f, 0.218536f, 0.156668f, -0.030494f, -0.195911f, -0.216775f, -0.081593f, 0.109457f, 0.220309f, 0.178121f, 0.021465f, -0.139141f, -0.204869f, -0.144590f, 0.000310f, 0.143372f, 0.198182f, 0.129450f, -0.020845f, -0.158913f, -0.200904f, -0.124769f, 0.021000f, 0.150172f, 0.188658f, 0.114798f, -0.027787f, -0.152279f, -0.179398f, -0.089884f, 0.058928f, 0.169173f, 0.167794f, 0.056364f, -0.088343f, -0.166696f, -0.128392f, -0.008387f, 0.104990f, 0.139226f, 0.083218f, -0.017082f, -0.094263f, -0.101195f, -0.040770f, 0.037436f, 0.077783f, 0.061206f, 0.010263f, -0.037948f, -0.056549f, -0.037758f, 0.005507f, 0.045018f, 0.054580f, 0.028455f, -0.015674f, -0.049328f, -0.050522f, -0.017695f, 0.027351f, 0.053643f, 0.043687f, 0.005142f, -0.036341f, -0.054174f, -0.036930f, 0.003847f, 0.040664f, 0.049542f, 0.026191f, -0.013462f, -0.044536f, -0.047143f, -0.018626f, 0.022384f, 0.047736f, 0.040751f, 0.007424f, -0.030301f, -0.049175f, -0.036865f, 0.000315f, 0.037910f, 0.048008f, 0.021595f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.012810f, 0.017121f, -0.023611f, -0.082779f, -0.097690f, -0.047262f, 0.003538f, -0.014083f, -0.064057f, -0.047354f, 0.048792f, 0.120644f, 0.089100f, 0.001721f, -0.043962f, -0.022900f, 0.017583f, 0.037386f, 0.030687f, -0.002922f, -0.063400f, -0.126153f, -0.144334f, -0.086185f, 0.032835f, 0.150889f, 0.195961f, 0.137894f, 0.011539f, -0.113968f, -0.181198f, -0.161076f, -0.058453f, 0.071727f, 0.142268f, 0.108887f, 0.016631f, -0.056570f, -0.081227f, -0.070812f, -0.030359f, 0.034923f, 0.081499f, 0.061830f, -0.004604f, -0.047571f, -0.035610f, -0.003534f, + 0.009115f, -0.000319f, -0.020183f, -0.041016f, -0.041611f, -0.003773f, 0.046603f, 0.054526f, 0.007769f, -0.042029f, -0.045486f, -0.009557f, 0.027952f, 0.041716f, 0.020226f, -0.034935f, -0.082451f, -0.052855f, 0.067431f, 0.182815f, 0.167146f, 0.000542f, -0.196812f, -0.268389f, -0.149445f, 0.085226f, 0.270625f, 0.265537f, 0.065877f, -0.177799f, -0.277049f, -0.161586f, 0.068272f, 0.229927f, 0.201780f, 0.013838f, -0.174864f, -0.203990f, -0.050350f, 0.150974f, 0.228536f, 0.119486f, -0.091186f, -0.245501f, -0.226405f, -0.041472f, 0.173638f, 0.252608f, 0.134739f, -0.081479f, -0.221452f, -0.178708f, 0.001454f, 0.162331f, 0.170094f, 0.032187f, -0.113890f, -0.136053f, -0.028907f, 0.093083f, 0.102565f, -0.030299f, -0.193574f, -0.205108f, 0.008998f, 0.290020f, 0.365118f, 0.129023f, -0.234351f, -0.434369f, -0.331419f, -0.008847f, 0.322445f, 0.447517f, 0.268626f, -0.099026f, -0.380143f, -0.363636f, -0.086151f, 0.218452f, 0.324767f, 0.169512f, -0.128360f, -0.348997f, -0.317778f, -0.041811f, 0.284101f, 0.425294f, 0.278163f, -0.066005f, -0.380018f, -0.441335f, -0.192691f, 0.193578f, 0.437660f, 0.374721f, + 0.073156f, -0.242365f, -0.365871f, -0.241897f, 0.016610f, 0.223753f, 0.259028f, 0.134684f, -0.050067f, -0.188486f, -0.205413f, -0.082246f, 0.109284f, 0.229395f, 0.179624f, -0.005002f, -0.187280f, -0.240503f, -0.130300f, 0.073329f, 0.236329f, 0.243713f, 0.086673f, -0.127247f, -0.259240f, -0.233003f, -0.063739f, 0.159671f, 0.308964f, 0.280537f, 0.073767f, -0.191300f, -0.350944f, -0.305382f, -0.077143f, 0.201310f, 0.358878f, 0.291196f, 0.037878f, -0.237347f, -0.357198f, -0.247564f, 0.017429f, 0.263077f, 0.328331f, 0.178240f, -0.072736f, -0.251639f, -0.252638f, -0.095911f, 0.103704f, 0.215867f, 0.175373f, 0.023225f, -0.125971f, -0.172388f, -0.099721f, 0.028833f, 0.125421f, 0.132450f, 0.051941f, -0.058847f, -0.126257f, -0.109294f, -0.022168f, 0.079059f, 0.129283f, 0.093201f, -0.006765f, -0.101922f, -0.128550f, -0.072571f, 0.028351f, 0.111315f, 0.121172f, 0.046684f, -0.061735f, -0.126442f, -0.106310f, -0.021901f, 0.072214f, 0.120632f, 0.088840f, -0.009190f, -0.104607f, -0.127005f, -0.067985f, 0.024784f, 0.097959f, 0.111625f, 0.044173f, -0.070680f, -0.140051f, -0.106843f, -0.028244f, 0.003835f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.012810f, 0.017121f, -0.023611f, -0.082779f, -0.097690f, -0.047262f, 0.003538f, -0.014083f, -0.064057f, -0.047354f, 0.048792f, 0.120644f, 0.089100f, 0.001721f, -0.043962f, -0.022900f, 0.017583f, 0.037386f, 0.030687f, -0.002922f, -0.063400f, -0.126153f, -0.144334f, -0.086185f, 0.032835f, 0.150889f, 0.195961f, 0.137894f, 0.011539f, -0.113968f, -0.181198f, -0.161076f, -0.058453f, 0.071727f, 0.142268f, 0.108887f, 0.016631f, -0.056570f, -0.081227f, -0.070812f, -0.030359f, 0.034923f, 0.081499f, 0.061830f, -0.004604f, -0.047571f, -0.035610f, -0.003534f, + 0.009115f, -0.000319f, -0.020183f, -0.041016f, -0.041611f, -0.003773f, 0.046603f, 0.054526f, 0.007769f, -0.042029f, -0.045486f, -0.009557f, 0.027952f, 0.041716f, 0.020226f, -0.034935f, -0.082451f, -0.052855f, 0.067431f, 0.182815f, 0.167146f, 0.000542f, -0.196812f, -0.268389f, -0.149445f, 0.085226f, 0.270625f, 0.265537f, 0.065877f, -0.177799f, -0.277049f, -0.161586f, 0.068272f, 0.229927f, 0.201780f, 0.013838f, -0.174864f, -0.203990f, -0.050350f, 0.150974f, 0.228536f, 0.119486f, -0.091186f, -0.245501f, -0.226405f, -0.041472f, 0.173638f, 0.252608f, 0.134739f, -0.081479f, -0.221452f, -0.178708f, 0.001454f, 0.162331f, 0.170094f, 0.032187f, -0.113890f, -0.136053f, -0.028907f, 0.093083f, 0.102565f, -0.030299f, -0.193574f, -0.205108f, 0.008998f, 0.290020f, 0.365118f, 0.129023f, -0.234351f, -0.434369f, -0.331419f, -0.008847f, 0.322445f, 0.447517f, 0.268626f, -0.099026f, -0.380143f, -0.363636f, -0.086151f, 0.218452f, 0.324767f, 0.169512f, -0.128360f, -0.348997f, -0.317778f, -0.041811f, 0.284101f, 0.425294f, 0.278163f, -0.066005f, -0.380018f, -0.441335f, -0.192691f, 0.193578f, 0.437660f, 0.374721f, + 0.073156f, -0.242365f, -0.365871f, -0.241897f, 0.016610f, 0.223753f, 0.259028f, 0.134684f, -0.050067f, -0.188486f, -0.205413f, -0.082246f, 0.109284f, 0.229395f, 0.179624f, -0.005002f, -0.187280f, -0.240503f, -0.130300f, 0.073329f, 0.236329f, 0.243713f, 0.086673f, -0.127247f, -0.259240f, -0.233003f, -0.063739f, 0.159671f, 0.308964f, 0.280537f, 0.073767f, -0.191300f, -0.350944f, -0.305382f, -0.077143f, 0.201310f, 0.358878f, 0.291196f, 0.037878f, -0.237347f, -0.357198f, -0.247564f, 0.017429f, 0.263077f, 0.328331f, 0.178240f, -0.072736f, -0.251639f, -0.252638f, -0.095911f, 0.103704f, 0.215867f, 0.175373f, 0.023225f, -0.125971f, -0.172388f, -0.099721f, 0.028833f, 0.125421f, 0.132450f, 0.051941f, -0.058847f, -0.126257f, -0.109294f, -0.022168f, 0.079059f, 0.129283f, 0.093201f, -0.006765f, -0.101922f, -0.128550f, -0.072571f, 0.028351f, 0.111315f, 0.121172f, 0.046684f, -0.061735f, -0.126442f, -0.106310f, -0.021901f, 0.072214f, 0.120632f, 0.088840f, -0.009190f, -0.104607f, -0.127005f, -0.067985f, 0.024784f, 0.097959f, 0.111625f, 0.044173f, -0.070680f, -0.140051f, -0.106843f, -0.028244f, 0.003835f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.029791f, 0.024110f, -0.069304f, -0.130401f, -0.085262f, 0.006216f, 0.061602f, 0.061826f, 0.026628f, -0.004606f, 0.011353f, 0.052948f, 0.034573f, -0.055731f, -0.103650f, -0.035730f, 0.057306f, 0.059600f, -0.001972f, -0.030433f, -0.013414f, -0.002591f, -0.007411f, -0.002977f, 0.005818f, 0.000442f, -0.010228f, -0.013244f, -0.017363f, -0.023452f, -0.008716f, 0.033524f, 0.069024f, 0.055839f, -0.013104f, -0.100332f, -0.144914f, -0.105970f, -0.000370f, 0.108920f, 0.160986f, 0.126541f, 0.016373f, -0.107671f, -0.155852f, -0.090466f, 0.027694f, 0.103208f, + 0.098438f, 0.041483f, -0.022387f, -0.056657f, -0.044930f, -0.009068f, 0.007643f, -0.005925f, -0.017102f, 0.000388f, 0.033678f, 0.052923f, 0.040762f, 0.002035f, -0.035302f, -0.040325f, -0.016264f, 0.002588f, 0.000851f, -0.002960f, 0.001441f, 0.001402f, -0.003146f, 0.003277f, 0.011551f, -0.004707f, -0.033186f, -0.024937f, 0.033432f, 0.087446f, 0.067114f, -0.043920f, -0.181385f, -0.232496f, -0.127400f, 0.078283f, 0.237096f, 0.238411f, 0.085260f, -0.132160f, -0.284340f, -0.251887f, -0.021421f, 0.253375f, 0.359173f, 0.218792f, -0.048761f, -0.249223f, -0.260654f, -0.099663f, 0.101050f, 0.198522f, 0.159174f, 0.058430f, -0.031748f, -0.097275f, -0.132936f, -0.122891f, -0.072162f, 0.016981f, 0.166135f, 0.314974f, 0.263987f, -0.091368f, -0.493974f, -0.515637f, -0.067111f, 0.458150f, 0.608909f, 0.301278f, -0.206671f, -0.583004f, -0.596864f, -0.210518f, 0.349032f, 0.683896f, 0.527981f, -0.010869f, -0.525143f, -0.628249f, -0.250030f, 0.308015f, 0.604156f, 0.412175f, -0.096447f, -0.509530f, -0.516905f, -0.136172f, 0.330713f, 0.537549f, 0.347513f, -0.078045f, -0.419811f, -0.448500f, -0.174447f, 0.193565f, + 0.408604f, 0.344319f, 0.066223f, -0.223687f, -0.334280f, -0.214764f, 0.027577f, 0.217668f, 0.235731f, 0.092407f, -0.092216f, -0.187384f, -0.143646f, -0.008730f, 0.119555f, 0.154758f, 0.074853f, -0.056258f, -0.134173f, -0.103117f, 0.001304f, 0.096629f, 0.123197f, 0.072209f, -0.023827f, -0.111784f, -0.143975f, -0.099795f, 0.009761f, 0.142703f, 0.226341f, 0.188521f, 0.023708f, -0.176065f, -0.279523f, -0.213944f, -0.014716f, 0.197635f, 0.287516f, 0.191524f, -0.027916f, -0.220273f, -0.259018f, -0.130380f, 0.070024f, 0.210319f, 0.206432f, 0.073049f, -0.089660f, -0.172086f, -0.134166f, -0.020411f, 0.087567f, 0.127411f, 0.085585f, -0.002683f, -0.078455f, -0.096583f, -0.050914f, 0.026485f, 0.085166f, 0.085645f, 0.027073f, -0.049349f, -0.091109f, -0.072469f, -0.007296f, 0.063448f, 0.094260f, 0.062457f, -0.011791f, -0.076761f, -0.088888f, -0.042905f, 0.030553f, 0.085880f, 0.086676f, 0.029792f, -0.046997f, -0.091054f, -0.074773f, -0.010929f, 0.060994f, 0.096279f, 0.068699f, -0.006224f, -0.075203f, -0.089687f, -0.044579f, 0.027610f, 0.085692f, 0.095106f, 0.041487f, -0.043449f, -0.087234f, -0.044234f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.029791f, 0.024110f, -0.069304f, -0.130401f, -0.085262f, 0.006216f, 0.061602f, 0.061826f, 0.026628f, -0.004606f, 0.011353f, 0.052948f, 0.034573f, -0.055731f, -0.103650f, -0.035730f, 0.057306f, 0.059600f, -0.001972f, -0.030433f, -0.013414f, -0.002591f, -0.007411f, -0.002977f, 0.005818f, 0.000442f, -0.010228f, -0.013244f, -0.017363f, -0.023452f, -0.008716f, 0.033524f, 0.069024f, 0.055839f, -0.013104f, -0.100332f, -0.144914f, -0.105970f, -0.000370f, 0.108920f, 0.160986f, 0.126541f, 0.016373f, -0.107671f, -0.155852f, -0.090466f, 0.027694f, 0.103208f, + 0.098438f, 0.041483f, -0.022387f, -0.056657f, -0.044930f, -0.009068f, 0.007643f, -0.005925f, -0.017102f, 0.000388f, 0.033678f, 0.052923f, 0.040762f, 0.002035f, -0.035302f, -0.040325f, -0.016264f, 0.002588f, 0.000851f, -0.002960f, 0.001441f, 0.001402f, -0.003146f, 0.003277f, 0.011551f, -0.004707f, -0.033186f, -0.024937f, 0.033432f, 0.087446f, 0.067114f, -0.043920f, -0.181385f, -0.232496f, -0.127400f, 0.078283f, 0.237096f, 0.238411f, 0.085260f, -0.132160f, -0.284340f, -0.251887f, -0.021421f, 0.253375f, 0.359173f, 0.218792f, -0.048761f, -0.249223f, -0.260654f, -0.099663f, 0.101050f, 0.198522f, 0.159174f, 0.058430f, -0.031748f, -0.097275f, -0.132936f, -0.122891f, -0.072162f, 0.016981f, 0.166135f, 0.314974f, 0.263987f, -0.091368f, -0.493974f, -0.515637f, -0.067111f, 0.458150f, 0.608909f, 0.301278f, -0.206671f, -0.583004f, -0.596864f, -0.210518f, 0.349032f, 0.683896f, 0.527981f, -0.010869f, -0.525143f, -0.628249f, -0.250030f, 0.308015f, 0.604156f, 0.412175f, -0.096447f, -0.509530f, -0.516905f, -0.136172f, 0.330713f, 0.537549f, 0.347513f, -0.078045f, -0.419811f, -0.448500f, -0.174447f, 0.193565f, + 0.408604f, 0.344319f, 0.066223f, -0.223687f, -0.334280f, -0.214764f, 0.027577f, 0.217668f, 0.235731f, 0.092407f, -0.092216f, -0.187384f, -0.143646f, -0.008730f, 0.119555f, 0.154758f, 0.074853f, -0.056258f, -0.134173f, -0.103117f, 0.001304f, 0.096629f, 0.123197f, 0.072209f, -0.023827f, -0.111784f, -0.143975f, -0.099795f, 0.009761f, 0.142703f, 0.226341f, 0.188521f, 0.023708f, -0.176065f, -0.279523f, -0.213944f, -0.014716f, 0.197635f, 0.287516f, 0.191524f, -0.027916f, -0.220273f, -0.259018f, -0.130380f, 0.070024f, 0.210319f, 0.206432f, 0.073049f, -0.089660f, -0.172086f, -0.134166f, -0.020411f, 0.087567f, 0.127411f, 0.085585f, -0.002683f, -0.078455f, -0.096583f, -0.050914f, 0.026485f, 0.085166f, 0.085645f, 0.027073f, -0.049349f, -0.091109f, -0.072469f, -0.007296f, 0.063448f, 0.094260f, 0.062457f, -0.011791f, -0.076761f, -0.088888f, -0.042905f, 0.030553f, 0.085880f, 0.086676f, 0.029792f, -0.046997f, -0.091054f, -0.074773f, -0.010929f, 0.060994f, 0.096279f, 0.068699f, -0.006224f, -0.075203f, -0.089687f, -0.044579f, 0.027610f, 0.085692f, 0.095106f, 0.041487f, -0.043449f, -0.087234f, -0.044234f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.000227f, -0.002434f, -0.006371f, -0.005852f, 0.003422f, 0.013194f, 0.010306f, 0.000609f, 0.009746f, 0.041053f, 0.041909f, -0.053172f, -0.224031f, -0.328861f, -0.212799f, 0.119077f, 0.453213f, 0.528605f, 0.265581f, -0.160498f, -0.459728f, -0.442806f, -0.145618f, 0.205982f, 0.366896f, 0.263152f, 0.033124f, -0.128153f, -0.146884f, -0.080417f, -0.004630f, 0.046244f, 0.058165f, 0.031565f, -0.001707f, -0.007509f, 0.005418f, 0.006823f, -0.003169f, -0.003630f, 0.003603f, 0.001845f, -0.004494f, 0.000070f, 0.010543f, 0.011916f, 0.006050f, 0.002164f, + -0.002925f, -0.013410f, -0.019079f, -0.007795f, 0.018241f, 0.044303f, 0.049434f, 0.017318f, -0.040180f, -0.078747f, -0.061217f, 0.005109f, 0.079596f, 0.117901f, 0.086965f, -0.010244f, -0.106381f, -0.107315f, 0.007940f, 0.145315f, 0.176265f, 0.053685f, -0.143549f, -0.256951f, -0.162535f, 0.104473f, 0.336910f, 0.320135f, 0.033931f, -0.317857f, -0.468252f, -0.279924f, 0.153382f, 0.536750f, 0.556697f, 0.141477f, -0.428879f, -0.720055f, -0.496892f, 0.087157f, 0.612777f, 0.706055f, 0.304070f, -0.303380f, -0.685050f, -0.579946f, -0.077082f, 0.458582f, 0.648014f, 0.369868f, -0.147642f, -0.506783f, -0.464135f, -0.107346f, 0.268733f, 0.423470f, 0.309063f, 0.031997f, -0.240519f, -0.354770f, -0.241661f, 0.028462f, 0.271225f, 0.310837f, 0.120162f, -0.143877f, -0.265328f, -0.158945f, 0.061584f, 0.206310f, 0.178584f, 0.018483f, -0.169786f, -0.282924f, -0.243263f, -0.041576f, 0.213320f, 0.334703f, 0.207300f, -0.087317f, -0.316168f, -0.290611f, -0.028146f, 0.271263f, 0.392790f, 0.255340f, -0.052602f, -0.331312f, -0.388780f, -0.180198f, 0.140850f, 0.342677f, 0.304005f, 0.078584f, -0.186507f, -0.340994f, + -0.278789f, -0.004723f, 0.314381f, 0.440181f, 0.262605f, -0.098861f, -0.394319f, -0.426068f, -0.170914f, 0.201793f, 0.427423f, 0.336748f, 0.002592f, -0.313868f, -0.381218f, -0.172282f, 0.143607f, 0.344160f, 0.307339f, 0.080090f, -0.171614f, -0.289435f, -0.224392f, -0.043742f, 0.134709f, 0.217269f, 0.178119f, 0.057729f, -0.076133f, -0.166550f, -0.176536f, -0.092477f, 0.053325f, 0.176577f, 0.192057f, 0.083697f, -0.079927f, -0.194856f, -0.187501f, -0.059074f, 0.109164f, 0.203789f, 0.160020f, 0.010581f, -0.140886f, -0.194673f, -0.119629f, 0.029076f, 0.148102f, 0.160130f, 0.069250f, -0.050698f, -0.119204f, -0.102947f, -0.025635f, 0.056163f, 0.090550f, 0.062735f, 0.000519f, -0.051928f, -0.065469f, -0.037089f, 0.014860f, 0.058879f, 0.065414f, 0.028340f, -0.027221f, -0.063228f, -0.056563f, -0.012689f, 0.039984f, 0.067450f, 0.051074f, 0.000941f, -0.049696f, -0.066689f, -0.037833f, 0.018657f, 0.064810f, 0.067842f, 0.024304f, -0.035973f, -0.071598f, -0.059345f, -0.008405f, 0.047905f, 0.073449f, 0.051018f, -0.005755f, -0.059063f, -0.072066f, -0.035915f, 0.023891f, 0.067410f, 0.068347f, 0.028263f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, -0.000227f, -0.002434f, -0.006371f, -0.005852f, 0.003422f, 0.013194f, 0.010306f, 0.000609f, 0.009746f, 0.041053f, 0.041909f, -0.053172f, -0.224031f, -0.328861f, -0.212799f, 0.119077f, 0.453213f, 0.528605f, 0.265581f, -0.160498f, -0.459728f, -0.442806f, -0.145618f, 0.205982f, 0.366896f, 0.263152f, 0.033124f, -0.128153f, -0.146884f, -0.080417f, -0.004630f, 0.046244f, 0.058165f, 0.031565f, -0.001707f, -0.007509f, 0.005418f, 0.006823f, -0.003169f, -0.003630f, 0.003603f, 0.001845f, -0.004494f, 0.000070f, 0.010543f, 0.011916f, 0.006050f, 0.002164f, + -0.002925f, -0.013410f, -0.019079f, -0.007795f, 0.018241f, 0.044303f, 0.049434f, 0.017318f, -0.040180f, -0.078747f, -0.061217f, 0.005109f, 0.079596f, 0.117901f, 0.086965f, -0.010244f, -0.106381f, -0.107315f, 0.007940f, 0.145315f, 0.176265f, 0.053685f, -0.143549f, -0.256951f, -0.162535f, 0.104473f, 0.336910f, 0.320135f, 0.033931f, -0.317857f, -0.468252f, -0.279924f, 0.153382f, 0.536750f, 0.556697f, 0.141477f, -0.428879f, -0.720055f, -0.496892f, 0.087157f, 0.612777f, 0.706055f, 0.304070f, -0.303380f, -0.685050f, -0.579946f, -0.077082f, 0.458582f, 0.648014f, 0.369868f, -0.147642f, -0.506783f, -0.464135f, -0.107346f, 0.268733f, 0.423470f, 0.309063f, 0.031997f, -0.240519f, -0.354770f, -0.241661f, 0.028462f, 0.271225f, 0.310837f, 0.120162f, -0.143877f, -0.265328f, -0.158945f, 0.061584f, 0.206310f, 0.178584f, 0.018483f, -0.169786f, -0.282924f, -0.243263f, -0.041576f, 0.213320f, 0.334703f, 0.207300f, -0.087317f, -0.316168f, -0.290611f, -0.028146f, 0.271263f, 0.392790f, 0.255340f, -0.052602f, -0.331312f, -0.388780f, -0.180198f, 0.140850f, 0.342677f, 0.304005f, 0.078584f, -0.186507f, -0.340994f, + -0.278789f, -0.004723f, 0.314381f, 0.440181f, 0.262605f, -0.098861f, -0.394319f, -0.426068f, -0.170914f, 0.201793f, 0.427423f, 0.336748f, 0.002592f, -0.313868f, -0.381218f, -0.172282f, 0.143607f, 0.344160f, 0.307339f, 0.080090f, -0.171614f, -0.289435f, -0.224392f, -0.043742f, 0.134709f, 0.217269f, 0.178119f, 0.057729f, -0.076133f, -0.166550f, -0.176536f, -0.092477f, 0.053325f, 0.176577f, 0.192057f, 0.083697f, -0.079927f, -0.194856f, -0.187501f, -0.059074f, 0.109164f, 0.203789f, 0.160020f, 0.010581f, -0.140886f, -0.194673f, -0.119629f, 0.029076f, 0.148102f, 0.160130f, 0.069250f, -0.050698f, -0.119204f, -0.102947f, -0.025635f, 0.056163f, 0.090550f, 0.062735f, 0.000519f, -0.051928f, -0.065469f, -0.037089f, 0.014860f, 0.058879f, 0.065414f, 0.028340f, -0.027221f, -0.063228f, -0.056563f, -0.012689f, 0.039984f, 0.067450f, 0.051074f, 0.000941f, -0.049696f, -0.066689f, -0.037833f, 0.018657f, 0.064810f, 0.067842f, 0.024304f, -0.035973f, -0.071598f, -0.059345f, -0.008405f, 0.047905f, 0.073449f, 0.051018f, -0.005755f, -0.059063f, -0.072066f, -0.035915f, 0.023891f, 0.067410f, 0.068347f, 0.028263f}, + }, + { + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.004115f, 0.009125f, 0.016225f, 0.033251f, 0.032426f, -0.031315f, -0.135128f, -0.164430f, -0.035388f, 0.167415f, 0.241609f, 0.084256f, -0.178409f, -0.310135f, -0.195933f, 0.064715f, 0.270673f, 0.291458f, 0.139852f, -0.075828f, -0.236252f, -0.263883f, -0.144853f, 0.059920f, 0.232089f, 0.264093f, 0.137743f, -0.062168f, -0.212453f, -0.231117f, -0.116280f, 0.059578f, 0.188187f, 0.188054f, 0.060964f, -0.102867f, -0.185488f, -0.128906f, 0.018750f, 0.144211f, 0.165501f, 0.089016f, -0.022643f, -0.112075f, -0.143092f, -0.092715f, 0.026352f, 0.142528f, + 0.166254f, 0.069143f, -0.087278f, -0.199059f, -0.192088f, -0.068502f, 0.095159f, 0.199275f, 0.185727f, 0.064675f, -0.099912f, -0.216128f, -0.203868f, -0.055079f, 0.140102f, 0.253126f, 0.212770f, 0.046625f, -0.145216f, -0.247596f, -0.200099f, -0.042475f, 0.121540f, 0.212253f, 0.207307f, 0.109139f, -0.056930f, -0.207888f, -0.237119f, -0.117290f, 0.065210f, 0.189049f, 0.183194f, 0.053937f, -0.115760f, -0.201508f, -0.131778f, 0.041281f, 0.189758f, 0.216623f, 0.106307f, -0.077753f, -0.213419f, -0.197205f, -0.051520f, 0.087320f, 0.120292f, 0.074726f, 0.023119f, -0.013465f, -0.045734f, -0.067816f, -0.068360f, -0.043142f, 0.016108f, 0.093680f, 0.120623f, 0.046712f, -0.067964f, -0.113625f, -0.071811f, -0.013098f, 0.025193f, 0.058275f, 0.062933f, -0.017179f, -0.153835f, -0.217254f, -0.119105f, 0.080427f, 0.233969f, 0.240559f, 0.110649f, -0.064180f, -0.186196f, -0.208446f, -0.136353f, -0.003219f, 0.128801f, 0.170680f, 0.074816f, -0.084557f, -0.152582f, -0.052058f, 0.120682f, 0.186491f, 0.068121f, -0.127402f, -0.213231f, -0.105805f, 0.099899f, 0.229804f, 0.185222f, 0.003810f, -0.185939f, -0.247274f, + -0.123553f, 0.100102f, 0.244984f, 0.197279f, 0.013797f, -0.149376f, -0.186311f, -0.101192f, 0.032385f, 0.128180f, 0.134745f, 0.069418f, -0.005307f, -0.051196f, -0.073898f, -0.074111f, -0.032267f, 0.040004f, 0.083997f, 0.059136f, -0.009774f, -0.069214f, -0.088217f, -0.061459f, -0.000879f, 0.055853f, 0.061914f, 0.012299f, -0.040249f, -0.041040f, 0.004255f, 0.038152f, 0.018698f, -0.033734f, -0.060953f, -0.031187f, 0.030588f, 0.073644f, 0.068387f, 0.020885f, -0.039193f, -0.074147f, -0.058976f, -0.003866f, 0.049731f, 0.064487f, 0.035818f, -0.011839f, -0.045313f, -0.042448f, -0.008624f, 0.024491f, 0.028481f, 0.005966f, -0.018425f, -0.026810f, -0.017873f, 0.001234f, 0.019172f, 0.023707f, 0.011971f, -0.006311f, -0.019466f, -0.021463f, -0.010479f, 0.008834f, 0.022854f, 0.020190f, 0.004268f, -0.012667f, -0.021982f, -0.018893f, -0.002121f, 0.017933f, 0.023398f, 0.010147f, -0.007076f, -0.015539f, -0.015889f, -0.010177f, 0.002857f, 0.016435f, 0.017618f, 0.005044f, -0.009322f, -0.016548f, -0.015687f, -0.006253f, 0.009272f, 0.019301f, 0.013731f, -0.002209f, -0.014788f, -0.017617f, -0.013120f, -0.004808f}, + {0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, + 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.004115f, 0.009125f, 0.016225f, 0.033251f, 0.032426f, -0.031315f, -0.135128f, -0.164430f, -0.035388f, 0.167415f, 0.241609f, 0.084256f, -0.178409f, -0.310135f, -0.195933f, 0.064715f, 0.270673f, 0.291458f, 0.139852f, -0.075828f, -0.236252f, -0.263883f, -0.144853f, 0.059920f, 0.232089f, 0.264093f, 0.137743f, -0.062168f, -0.212453f, -0.231117f, -0.116280f, 0.059578f, 0.188187f, 0.188054f, 0.060964f, -0.102867f, -0.185488f, -0.128906f, 0.018750f, 0.144211f, 0.165501f, 0.089016f, -0.022643f, -0.112075f, -0.143092f, -0.092715f, 0.026352f, 0.142528f, + 0.166254f, 0.069143f, -0.087278f, -0.199059f, -0.192088f, -0.068502f, 0.095159f, 0.199275f, 0.185727f, 0.064675f, -0.099912f, -0.216128f, -0.203868f, -0.055079f, 0.140102f, 0.253126f, 0.212770f, 0.046625f, -0.145216f, -0.247596f, -0.200099f, -0.042475f, 0.121540f, 0.212253f, 0.207307f, 0.109139f, -0.056930f, -0.207888f, -0.237119f, -0.117290f, 0.065210f, 0.189049f, 0.183194f, 0.053937f, -0.115760f, -0.201508f, -0.131778f, 0.041281f, 0.189758f, 0.216623f, 0.106307f, -0.077753f, -0.213419f, -0.197205f, -0.051520f, 0.087320f, 0.120292f, 0.074726f, 0.023119f, -0.013465f, -0.045734f, -0.067816f, -0.068360f, -0.043142f, 0.016108f, 0.093680f, 0.120623f, 0.046712f, -0.067964f, -0.113625f, -0.071811f, -0.013098f, 0.025193f, 0.058275f, 0.062933f, -0.017179f, -0.153835f, -0.217254f, -0.119105f, 0.080427f, 0.233969f, 0.240559f, 0.110649f, -0.064180f, -0.186196f, -0.208446f, -0.136353f, -0.003219f, 0.128801f, 0.170680f, 0.074816f, -0.084557f, -0.152582f, -0.052058f, 0.120682f, 0.186491f, 0.068121f, -0.127402f, -0.213231f, -0.105805f, 0.099899f, 0.229804f, 0.185222f, 0.003810f, -0.185939f, -0.247274f, + -0.123553f, 0.100102f, 0.244984f, 0.197279f, 0.013797f, -0.149376f, -0.186311f, -0.101192f, 0.032385f, 0.128180f, 0.134745f, 0.069418f, -0.005307f, -0.051196f, -0.073898f, -0.074111f, -0.032267f, 0.040004f, 0.083997f, 0.059136f, -0.009774f, -0.069214f, -0.088217f, -0.061459f, -0.000879f, 0.055853f, 0.061914f, 0.012299f, -0.040249f, -0.041040f, 0.004255f, 0.038152f, 0.018698f, -0.033734f, -0.060953f, -0.031187f, 0.030588f, 0.073644f, 0.068387f, 0.020885f, -0.039193f, -0.074147f, -0.058976f, -0.003866f, 0.049731f, 0.064487f, 0.035818f, -0.011839f, -0.045313f, -0.042448f, -0.008624f, 0.024491f, 0.028481f, 0.005966f, -0.018425f, -0.026810f, -0.017873f, 0.001234f, 0.019172f, 0.023707f, 0.011971f, -0.006311f, -0.019466f, -0.021463f, -0.010479f, 0.008834f, 0.022854f, 0.020190f, 0.004268f, -0.012667f, -0.021982f, -0.018893f, -0.002121f, 0.017933f, 0.023398f, 0.010147f, -0.007076f, -0.015539f, -0.015889f, -0.010177f, 0.002857f, 0.016435f, 0.017618f, 0.005044f, -0.009322f, -0.016548f, -0.015687f, -0.006253f, 0.009272f, 0.019301f, 0.013731f, -0.002209f, -0.014788f, -0.017617f, -0.013120f, -0.004808f}, + }, +}; +#else const float CRendBin_HOA3_HRIR_coeff_re_48kHz[16][BINAURAL_CHANNELS][480]={ { {-0.007743f, -0.007558f, -0.007195f, -0.006666f, -0.005988f, -0.005184f, -0.004281f, -0.003308f, -0.002297f, -0.001282f, -0.000295f, 0.000632f, 0.001470f, 0.002193f, 0.002779f, 0.003212f, 0.003480f, 0.003577f, 0.003506f, 0.003272f, 0.002887f, 0.002371f, 0.001744f, 0.001033f, 0.000266f, -0.000524f, -0.001308f, -0.002054f, -0.002731f, -0.003314f, -0.003778f, -0.004105f, -0.004278f, -0.004290f, -0.004136f, -0.003818f, -0.003346f, -0.002730f, -0.001990f, -0.001147f, -0.000226f, 0.000744f, 0.001734f, 0.002716f, 0.003658f, 0.004535f, 0.005321f, 0.005993f, 0.006535f, 0.006932f, 0.007177f, 0.007266f, 0.007200f, 0.006986f, 0.006636f, 0.006164f, 0.005590f, 0.004934f, 0.004220f, 0.003472f, 0.002715f, 0.001972f, 0.001265f, 0.000614f, 0.000036f, -0.000456f, -0.000852f, -0.001146f, -0.001339f, -0.001431f, -0.001430f, -0.001345f, -0.001189f, -0.000977f, -0.000725f, -0.000450f, -0.000171f, 0.000097f, 0.000338f, 0.000538f, 0.000686f, 0.000774f, 0.000798f, 0.000755f, 0.000647f, 0.000478f, 0.000258f, -0.000005f, -0.000297f, -0.000604f, -0.000913f, -0.001206f, -0.001471f, -0.001692f, -0.001859f, -0.001960f, @@ -1037,6 +1428,7 @@ const float CRendBin_HOA3_HRIR_coeff_im_48kHz[16][BINAURAL_CHANNELS][480]={ -0.025960f, 0.182839f, 0.278925f, 0.086432f, -0.206817f, -0.257206f, -0.181695f, 0.010354f, 0.202964f, 0.229244f, 0.098833f, -0.087026f, -0.181307f, -0.141921f, -0.048110f, 0.075799f, 0.114635f, 0.060613f, -0.007091f, -0.085373f, -0.082937f, -0.027346f, 0.088356f, 0.139427f, 0.092503f, -0.030368f, -0.103502f, -0.107065f, -0.020528f, 0.052644f, 0.128449f, 0.060539f, -0.024419f, -0.053943f, -0.053067f, 0.104894f, 0.110330f, -0.030292f, -0.137751f, -0.137278f, 0.001888f, 0.123472f, 0.133148f, -0.007019f, -0.129875f, -0.123791f, 0.026745f, 0.121553f, 0.087812f, -0.059539f, -0.115914f, -0.041189f, 0.084327f, 0.080379f, -0.023472f, -0.085842f, -0.004187f, 0.058332f, 0.012800f, -0.041715f, -0.000345f, 0.009540f, 0.000671f, -0.007229f, 0.003356f, -0.001562f, 0.003583f, -0.001390f, 0.004748f, -0.004077f, 0.001544f, -0.004733f, -0.001209f, -0.004578f, 0.003593f, -0.002046f, 0.008076f, -0.006694f, 0.003824f, -0.000642f, 0.003010f, -0.005633f, 0.003952f, -0.007572f, 0.002614f, -0.004205f, 0.006070f, -0.002496f, 0.004053f, -0.001677f, 0.001551f, -0.006302f, 0.004819f, -0.002902f, 0.002256f, -0.003500f} } }; +#endif const float *CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; const float *CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz[BINAURAL_CHANNELS]={NULL,NULL}; diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index aaf7fa7113..2ff892071b 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -138,4 +138,8 @@ extern const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp19[]; /* Mapping table of input config : output config with corresponding matrix */ extern const LS_CONVERSION_MAPPING ls_conversion_mapping[]; +#ifdef SPLIT_REND_WITH_HEAD_ROT +extern const int32_t split_rend_brate_tbl[]; +#endif + #endif /* IVAS_ROM_REND_H */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 1a7cd8b830..970146de56 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -76,6 +76,9 @@ ivas_error ivas_headTrack_open( set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 ); ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + ( *hHeadTrackData )->sr_pose_pred_axis = DEFAULT_AXIS; +#endif return IVAS_ERR_OK; } @@ -150,6 +153,46 @@ void QuatToRotMat( return; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT +/*------------------------------------------------------------------------- + * Quat2EulerDegree() + * + * Quaternion handling: calculate corresponding Euler angles in degrees + *------------------------------------------------------------------------*/ +void Quat2EulerDegree( + const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ +) +{ + if ( quat.w != -3.0 ) + { + *yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) ); + *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) ); + *roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) ); + *yaw *= _180_OVER_PI; + *pitch *= _180_OVER_PI; + *roll *= _180_OVER_PI; + } + else + { + /* Euler angles in R_X(roll)*R_Y(pitch)*R_Z(yaw) convention + * + * yaw: rotate scene counter-clockwise in the horizontal plane + * pitch: rotate scene in the median plane, increase elevation with positive values + * roll: rotate scene from the right ear to the top + */ + *yaw = quat.z; + *pitch = quat.y; + *roll = quat.x; + } + + return; +} +#endif + /*------------------------------------------------------------------------- * Quat2Euler() * diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index f89564fffc..f8e62daaa2 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -1,65 +1,72 @@ /****************************************************************************************************** - (C) 2022 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. + (C) 2022 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. + 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 -#include "options.h" -#include -#include "ivas_prot.h" -#include "prot.h" #include "cnst.h" #include "ivas_cnst.h" -#include "ivas_rom_rend.h" +#include "ivas_lib_rend_internal.h" +#include "ivas_prot.h" +#include "ivas_rom_binauralRenderer.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" -#include "ivas_rom_binauralRenderer.h" +#include "ivas_rom_rend.h" #include "lib_rend.h" -#include "ivas_lib_rend_internal.h" +#include "options.h" +#include "prot.h" +#include +#include +#include #ifdef DEBUGGING #include "debug.h" #endif #include "wmops.h" - #ifdef SPLIT_REND_WITH_HEAD_ROT -ivas_error ivas_splitBinLCLDDecOpen( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, - int32_t iSampleRate, - int32_t iChannels ) +ivas_error +ivas_splitBinLCLDDecOpen( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec, + int32_t iSampleRate, + int32_t iChannels ) { ivas_error error; BIN_HR_SPLIT_LCLD_DEC_HANDLE splitBinLCLDDec; error = IVAS_ERR_OK; - if ( ( splitBinLCLDDec = (BIN_HR_SPLIT_LCLD_DEC_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_LCLD_DEC ) ) ) == NULL ) + if ( ( splitBinLCLDDec = (BIN_HR_SPLIT_LCLD_DEC_HANDLE) count_malloc( + sizeof( BIN_HR_SPLIT_LCLD_DEC ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD decoder Module \n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, + "Can not allocate memory for LCLD decoder Module \n" ) ); } splitBinLCLDDec->pLcld_dec = NULL; // place holder for CLDFB decoder handle @@ -67,12 +74,16 @@ ivas_error ivas_splitBinLCLDDecOpen( splitBinLCLDDec->iChannels = iChannels; splitBinLCLDDec->psCQMFDecoder = CreateCQMFDecoder( iSampleRate, iChannels ); - splitBinLCLDDec->pppfDecCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); - splitBinLCLDDec->pppfDecCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDDec->pppfDecCQMFReal = + (float ***) count_malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDDec->pppfDecCQMFImag = + (float ***) count_malloc( iChannels * sizeof( float ** ) ); for ( int32_t n = 0; n < splitBinLCLDDec->iChannels; n++ ) { - splitBinLCLDDec->pppfDecCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); - splitBinLCLDDec->pppfDecCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDDec->pppfDecCQMFReal[n] = + (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDDec->pppfDecCQMFImag[n] = + (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); } #ifdef CLDFB_DEBUG @@ -80,7 +91,8 @@ ivas_error ivas_splitBinLCLDDecOpen( char cldfbFilename[50] = "cldfb_out.bin"; if ( ( splitBinLCLDDec->cldfbOut = fopen( cldfbFilename, "wb" ) ) == NULL ) { - fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", cldfbFilename ); + fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", + cldfbFilename ); exit( -1 ); } int num_bands = CLDFB_NO_CHANNELS_MAX; @@ -92,8 +104,7 @@ ivas_error ivas_splitBinLCLDDecOpen( return error; } -void ivas_splitBinLCLDDecClose( - BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ) +void ivas_splitBinLCLDDecClose( BIN_HR_SPLIT_LCLD_DEC_HANDLE *hSplitBinLCLDDec ) { if ( ( *hSplitBinLCLDDec ) != NULL ) { @@ -104,11 +115,11 @@ void ivas_splitBinLCLDDecClose( for ( int32_t n = 0; n < ( *hSplitBinLCLDDec )->iChannels; n++ ) { - free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal[n] ); - free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag[n] ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal[n] ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag[n] ); } - free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal ); - free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFReal ); + count_free( ( *hSplitBinLCLDDec )->pppfDecCQMFImag ); #ifdef CLDFB_DEBUG if ( ( *hSplitBinLCLDDec )->cldfbOut != NULL ) @@ -134,45 +145,26 @@ void ivas_splitBinLCLDDecProcess( assert( Cldfb_Out_Imag != NULL ); assert( pBits != NULL ); - int32_t iBytesWritten; - unsigned char auchData[4096]; - unsigned char *bval; - - iBytesWritten = ivas_split_rend_bitstream_read_int32( pBits, 8 * sizeof( uint16_t ) ); #ifdef CLDFB_DEBUG printf( "Bytes read = %d\n", iBytesWritten ); #endif - bval = auchData; - for ( int32_t bytesCount = 0; bytesCount < iBytesWritten; bytesCount++ ) - { - *bval = (uint8_t) ivas_split_rend_bitstream_read_int32( pBits, 8 ); - bval++; - } - // A conversion is needed for the 3d pointer interface here ........ :( + // Initialized with zeros....... :( for ( int32_t n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) { for ( int32_t k = 0; k < CLDFB_NO_COL_MAX; k++ ) { hSplitBinLCLDDec->pppfDecCQMFReal[n][k] = Cldfb_Out_Real[n][k]; hSplitBinLCLDDec->pppfDecCQMFImag[n][k] = Cldfb_Out_Imag[n][k]; + set_f( hSplitBinLCLDDec->pppfDecCQMFReal[n][k], 0, CLDFB_NO_CHANNELS_MAX ); + set_f( hSplitBinLCLDDec->pppfDecCQMFImag[n][k], 0, CLDFB_NO_CHANNELS_MAX ); } } - // Initialized with zeros....... :( - for ( int k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - for ( int b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) - { - for ( int n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) - { - hSplitBinLCLDDec->pppfDecCQMFReal[n][k][b] = 0.0; - hSplitBinLCLDDec->pppfDecCQMFImag[n][k][b] = 0.0; - } - } - } - - DecodeFrame( hSplitBinLCLDDec->psCQMFDecoder, iBytesWritten, auchData, hSplitBinLCLDDec->pppfDecCQMFReal, hSplitBinLCLDDec->pppfDecCQMFImag ); + DecodeFrame( hSplitBinLCLDDec->psCQMFDecoder, + pBits, + hSplitBinLCLDDec->pppfDecCQMFReal, + hSplitBinLCLDDec->pppfDecCQMFImag ); #ifdef CLDFB_DEBUG printf( "Frame Decoded = %d\n", ++hSplitBinLCLDDec->numFrame ); @@ -183,10 +175,12 @@ void ivas_splitBinLCLDDecProcess( { for ( int n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) { - writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFReal[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFReal[n][k][b], + sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); if ( writeByte != 1 ) exit( -1 ); - writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFImag[n][k][b], sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); + writeByte = fwrite( &hSplitBinLCLDDec->pppfDecCQMFImag[n][k][b], + sizeof( float ), 1, hSplitBinLCLDDec->cldfbOut ); if ( writeByte != 1 ) exit( -1 ); } diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index 97da222528..09df0d11ea 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -1,79 +1,92 @@ /****************************************************************************************************** - (C) 2022 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. + (C) 2022 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. + 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 -#include "options.h" -#include -#include "ivas_prot.h" -#include "prot.h" #include "cnst.h" #include "ivas_cnst.h" -#include "ivas_rom_rend.h" +#include "ivas_lib_rend_internal.h" +#include "ivas_prot.h" +#include "ivas_rom_binauralRenderer.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" -#include "ivas_rom_binauralRenderer.h" +#include "ivas_rom_rend.h" #include "lib_rend.h" -#include "ivas_lib_rend_internal.h" +#include "options.h" +#include "prot.h" +#include +#include +#include #ifdef DEBUGGING #include "debug.h" #endif #include "wmops.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -ivas_error ivas_splitBinLCLDEncOpen( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, - int32_t iSampleRate, - int32_t iChannels, - int32_t iDataRate ) +ivas_error +ivas_splitBinLCLDEncOpen( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc, + int32_t iSampleRate, + int32_t iChannels, + int32_t iDataRate ) { ivas_error error; BIN_HR_SPLIT_LCLD_ENC_HANDLE splitBinLCLDEnc; error = IVAS_ERR_OK; - if ( ( splitBinLCLDEnc = (BIN_HR_SPLIT_LCLD_ENC_HANDLE) count_malloc( sizeof( BIN_HR_SPLIT_LCLD_ENC ) ) ) == NULL ) + if ( ( splitBinLCLDEnc = (BIN_HR_SPLIT_LCLD_ENC_HANDLE) count_malloc( + sizeof( BIN_HR_SPLIT_LCLD_ENC ) ) ) == NULL ) { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LCLD encoder Module \n" ) ); + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, + "Can not allocate memory for LCLD encoder Module \n" ) ); } splitBinLCLDEnc->pLcld_enc = NULL; // place holder for CLDFB encoder handle splitBinLCLDEnc->iChannels = iChannels; - splitBinLCLDEnc->psCQMFEncoder = CreateCQMFEncoder( iSampleRate, iChannels, iDataRate ); + splitBinLCLDEnc->psCQMFEncoder = + CreateCQMFEncoder( iSampleRate, iChannels, iDataRate, 1 ); - splitBinLCLDEnc->pppfCQMFReal = (float ***) malloc( iChannels * sizeof( float ** ) ); - splitBinLCLDEnc->pppfCQMFImag = (float ***) malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDEnc->pppfCQMFReal = + (float ***) count_malloc( iChannels * sizeof( float ** ) ); + splitBinLCLDEnc->pppfCQMFImag = + (float ***) count_malloc( iChannels * sizeof( float ** ) ); for ( int32_t n = 0; n < splitBinLCLDEnc->iChannels; n++ ) { - splitBinLCLDEnc->pppfCQMFReal[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); - splitBinLCLDEnc->pppfCQMFImag[n] = (float **) malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDEnc->pppfCQMFReal[n] = + (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); + splitBinLCLDEnc->pppfCQMFImag[n] = + (float **) count_malloc( CLDFB_NO_COL_MAX * sizeof( float * ) ); } #ifdef CLDFB_DEBUG @@ -81,7 +94,8 @@ ivas_error ivas_splitBinLCLDEncOpen( char cldfbFilename[50] = "cldfb_in_ref.qmf"; if ( ( splitBinLCLDEnc->cldfbIn = fopen( cldfbFilename, "rb" ) ) == NULL ) { - fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", cldfbFilename ); + fprintf( stderr, "Error: CLDFB bitstream file %s could not be opened\n\n", + cldfbFilename ); exit( -1 ); } int chan, band; @@ -93,8 +107,7 @@ ivas_error ivas_splitBinLCLDEncOpen( return error; } -void ivas_splitBinLCLDEncClose( - BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ) +void ivas_splitBinLCLDEncClose( BIN_HR_SPLIT_LCLD_ENC_HANDLE *hSplitBinLCLDEnc ) { if ( ( *hSplitBinLCLDEnc ) != NULL ) { @@ -102,11 +115,11 @@ void ivas_splitBinLCLDEncClose( for ( int32_t n = 0; n < ( *hSplitBinLCLDEnc )->iChannels; n++ ) { - free( ( *hSplitBinLCLDEnc )->pppfCQMFReal[n] ); - free( ( *hSplitBinLCLDEnc )->pppfCQMFImag[n] ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFReal[n] ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFImag[n] ); } - free( ( *hSplitBinLCLDEnc )->pppfCQMFReal ); - free( ( *hSplitBinLCLDEnc )->pppfCQMFImag ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFReal ); + count_free( ( *hSplitBinLCLDEnc )->pppfCQMFImag ); #ifdef CLDFB_DEBUG if ( ( *hSplitBinLCLDEnc )->cldfbIn != NULL ) @@ -125,6 +138,7 @@ void ivas_splitBinLCLDEncProcess( BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int32_t available_bits, ivas_split_rend_bits_t *pBits ) { assert( hSplitBinLCLDEnc != NULL ); @@ -132,13 +146,7 @@ void ivas_splitBinLCLDEncProcess( assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); - int32_t iBytesWritten; - uint16_t ushBytes; - unsigned char auchData[4096]; - unsigned char *bval; - int32_t code; - - iBytesWritten = 4096; + int32_t iBitsWritten; // A conversion is needed for the 3d pointer interface here ........ :( for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) @@ -164,10 +172,12 @@ void ivas_splitBinLCLDEncProcess( break; readByte = fread(&hSplitBinLCLDEnc->pppfCQMFImag[n][k][b], sizeof(float), 1, hSplitBinLCLDEnc->cldfbIn); #else - readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + readByte = fread( &Cldfb_In_Real[n][k][b], sizeof( float ), 1, + hSplitBinLCLDEnc->cldfbIn ); if ( readByte != 1 ) break; - readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, hSplitBinLCLDEnc->cldfbIn ); + readByte = fread( &Cldfb_In_Imag[n][k][b], sizeof( float ), 1, + hSplitBinLCLDEnc->cldfbIn ); #endif } } @@ -194,20 +204,13 @@ void ivas_splitBinLCLDEncProcess( } #endif - EncodeFrame( hSplitBinLCLDEnc->psCQMFEncoder, hSplitBinLCLDEnc->pppfCQMFReal, hSplitBinLCLDEnc->pppfCQMFImag, &iBytesWritten, auchData ); - - bval = auchData; - ushBytes = (uint16_t) iBytesWritten; - ivas_split_rend_bitstream_write_int32( pBits, (int32_t) ushBytes, 8 * sizeof( uint16_t ) ); - for ( int32_t bytesCount = 0; bytesCount < iBytesWritten; bytesCount++ ) - { - code = (int32_t) *bval; - ivas_split_rend_bitstream_write_int32( pBits, code, 8 ); - bval++; - } + EncodeFrame( hSplitBinLCLDEnc->psCQMFEncoder, hSplitBinLCLDEnc->pppfCQMFReal, + hSplitBinLCLDEnc->pppfCQMFImag, &iBitsWritten, available_bits, + pBits ); + assert( iBitsWritten <= available_bits ); #ifdef CLDFB_DEBUG - printf( "Bytes written = %d\n", iBytesWritten ); + printf( "Bits written = %d\n", iBitsWritten ); #endif return; diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 56782f4989..46d15b4030 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -54,7 +54,9 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error ivas_splitBinPostRendOpen( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, - const int32_t output_Fs ) + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int32_t output_Fs, + const int16_t is_cldfb_in ) { BIN_HR_SPLIT_POST_REND_HANDLE hBinRend; ivas_error error; @@ -69,6 +71,7 @@ ivas_error ivas_splitBinPostRendOpen( for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { hBinRend->cldfbSyn[ch] = NULL; + hBinRend->cldfbAna[ch] = NULL; } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES; i++ ) @@ -87,6 +90,13 @@ ivas_error ivas_splitBinPostRendOpen( { return error; } + if ( is_cldfb_in == 0 ) + { + if ( ( error = openCldfb( &( hBinRend->cldfbAna[ch] ), CLDFB_ANALYSIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + { + return error; + } + } } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG @@ -102,7 +112,8 @@ ivas_error ivas_splitBinPostRendOpen( } #endif hBinRend->cf_flag = 0; - set_fix_rotation_mat( hBinRend->fix_pos_rot_mat ); + set_fix_rotation_mat( hBinRend->fix_pos_rot_mat, pMultiBinPoseData ); + set_pose_types( hBinRend->pose_type, pMultiBinPoseData ); ivas_split_rend_init_huff_cfg( &hBinRend->huff_cfg ); *hBinHrSplitPostRend = hBinRend; @@ -121,6 +132,11 @@ void ivas_splitBinPostRendClose( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostR deleteCldfb( &( ( *hBinHrSplitPostRend )->cldfbSyn[ch] ) ); ( *hBinHrSplitPostRend )->cldfbSyn[ch] = NULL; } + if ( ( *hBinHrSplitPostRend )->cldfbAna[ch] != NULL ) + { + deleteCldfb( &( ( *hBinHrSplitPostRend )->cldfbAna[ch] ) ); + ( *hBinHrSplitPostRend )->cldfbAna[ch] = NULL; + } } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG for ( int16_t i = 0; i < MAX_HEAD_ROT_POSES; i++ ) @@ -240,61 +256,82 @@ static int16_t ivas_split_rend_huffman_decode( static void ivas_split_rend_unquant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, + IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) { int16_t ch1, ch2; + int16_t gd_idx_min; - ivas_deindex_real_index( - &hMd->pred_mat_re_idx[0][0], - IVAS_SPLIT_REND_PRED_QUANT_PNTS, - IVAS_SPLIT_REND_PRED_MIN_VAL, - IVAS_SPLIT_REND_PRED_MAX_VAL, - &hMd->pred_mat_re[0][0], - BINAURAL_CHANNELS * BINAURAL_CHANNELS ); - ivas_deindex_real_index( - &hMd->pred_mat_im_idx[0][0], - IVAS_SPLIT_REND_PRED_QUANT_PNTS, - IVAS_SPLIT_REND_PRED_MIN_VAL, - IVAS_SPLIT_REND_PRED_MAX_VAL, - &hMd->pred_mat_im[0][0], - BINAURAL_CHANNELS * BINAURAL_CHANNELS ); - ivas_deindex_real_index( - &hMd->gd_idx, - IVAS_SPLIT_REND_D_QUANT_PNTS, - IVAS_SPLIT_REND_D_MIN_VAL, - IVAS_SPLIT_REND_D_MAX_VAL, - &hMd->gd, - 1 ); - - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) - { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) - { - hMd->pred_mat_re[ch1][ch2] = hMd->pred_mat_re[ch1][ch2] + fix_pos_rot_mat[ch1][ch2]; - // hMd->pred_mat_re[ch1][ch2] = hQMd->pred_mat_re[ch1][ch2]; - } - } - if ( real_only ) + if ( pose_type == PRED_ONLY ) { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - hMd->pred_mat_im[ch1][ch2] = 0.0f; + hMd->pred_mat_re[ch1][ch2] = hMd->pred_mat_re_idx[ch1][ch2] * IVAS_SPLIT_REND_PRED_Q_STEP; + hMd->pred_mat_re[ch1][ch2] = hMd->pred_mat_re[ch1][ch2] + fix_pos_rot_mat[ch1][ch2]; + } + } + if ( real_only ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_im[ch1][ch2] = 0.0f; + } + } + } + else + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd->pred_mat_im[ch1][ch2] = hMd->pred_mat_im_idx[ch1][ch2] * IVAS_SPLIT_REND_PRED_Q_STEP; + } } } } + else if ( pose_type == COM_GAIN_ONLY ) + { + gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_D_1BYQ_STEP * IVAS_SPLIT_REND_D_MIN_VAL ); + hMd->gd_idx += gd_idx_min; + hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_D_Q_STEP; + } + else if ( pose_type == LR_GAIN_ONLY ) + { + gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * IVAS_SPLIT_REND_PITCH_G_MIN_VAL ); + hMd->gd_idx += gd_idx_min; + hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; + + hMd->gd2_idx += gd_idx_min; + hMd->gd2 = hMd->gd2_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; + } + else + { + hMd->gd = 0.0f; + } + return; } static void ivas_splitBinPostRendMdBase2Dec( ivas_split_rend_bits_t *pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, - const int16_t num_md_bands ) + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int16_t num_subframes, + const int16_t pred_real_bands_yaw, + const int16_t pred_imag_bands_yaw, + const int16_t d_bands_yaw, + const int16_t bands_pitch, + const int16_t pred_real_bands_roll, + const int16_t pred_imag_bands_roll ) { - int16_t sf_idx, real_only, pos_idx, b, ch1, ch2; - int16_t min_pred_idx, min_gd_idx, pred_code_len, gd_code_len; + int16_t sf_idx, pos_idx, b, ch1, ch2; + int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len; int16_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; @@ -302,38 +339,76 @@ static void ivas_splitBinPostRendMdBase2Dec( pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; + min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; pred_code_len = pHuff_cfg->pred_base2_code_len; gd_code_len = pHuff_cfg->gd_base2_code_len; + p_gd_code_len = pHuff_cfg->p_gd_base2_code_len; - - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - for ( b = 0; b < num_md_bands; b++ ) + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - if ( b < COMPLEX_MD_BAND_THRESH ) + if ( hBinHrSplitPostRend->pose_type[pos_idx] == ANY_YAW ) { - real_only = 0; + for ( b = 0; b < pred_real_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); + hMd->pred_mat_re_idx[ch1][ch2] = code + min_pred_idx; + } + } + } + for ( b = 0; b < pred_imag_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); + hMd->pred_mat_im_idx[ch1][ch2] = code + min_pred_idx; + } + } + } + for ( b = 0; b < d_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, gd_code_len ); + hMd->gd_idx = code + min_gd_idx; + } } - else + else if ( hBinHrSplitPostRend->pose_type[pos_idx] == PITCH_ONLY ) { - real_only = 1; + for ( b = 0; b < bands_pitch; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, p_gd_code_len ); + hMd->gd_idx = code + min_p_gd_idx; + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, p_gd_code_len ); + hMd->gd2_idx = code + min_p_gd_idx; + } } - - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + else { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_real_bands_roll; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); - hMd->pred_mat_re_idx[ch1][ch2] = code + min_pred_idx; + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, pred_code_len ); + hMd->pred_mat_re_idx[ch1][ch2] = code + min_pred_idx; + } } } - - if ( real_only == 0 ) + for ( b = 0; b < pred_imag_bands_roll; b++ ) { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) @@ -343,8 +418,6 @@ static void ivas_splitBinPostRendMdBase2Dec( } } } - code = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, gd_code_len ); - hMd->gd_idx = code + min_gd_idx; } } } @@ -355,10 +428,17 @@ static void ivas_splitBinPostRendMdBase2Dec( static void ivas_splitBinPostRendMdHuffDec( ivas_split_rend_bits_t *pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, - const int16_t num_md_bands ) + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int16_t num_subframes, + const int16_t pred_real_bands_yaw, + const int16_t pred_imag_bands_yaw, + const int16_t d_bands_yaw, + const int16_t bands_pitch, + const int16_t pred_real_bands_roll, + const int16_t pred_imag_bands_roll ) { int16_t pos_idx, b, sf_idx; - int16_t real_only, ch1, ch2; + int16_t ch1, ch2; int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; BIN_HR_SPLIT_REND_MD_HANDLE hMd; @@ -367,38 +447,76 @@ static void ivas_splitBinPostRendMdHuffDec( pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; - real_only = 0; - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - for ( b = 0; b < num_md_bands; b++ ) + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - if ( b < COMPLEX_MD_BAND_THRESH ) + if ( hBinHrSplitPostRend->pose_type[pos_idx] == ANY_YAW ) { - real_only = 0; + for ( b = 0; b < pred_real_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); + // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + } + } + ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_idx, max_pred_idx ); + } + for ( b = 0; b < pred_imag_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); + // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + } + } + ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_im_idx, -1, min_pred_idx, max_pred_idx ); + } + for ( b = 0; b < d_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + hMd->gd_idx = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->gd, pBits, pHuff_cfg->gd_idx_trav ); + // hMd->gd_idx = ivas_split_rend_huffman_decode( &pHuff_cfg->gd, pBits ); + } } - else + else if ( hBinHrSplitPostRend->pose_type[pos_idx] == PITCH_ONLY ) { - real_only = 1; - } + for ( b = 0; b < bands_pitch; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + hMd->gd_idx = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->p_gd, pBits, pHuff_cfg->p_gd_idx_trav ); + // hMd->gd_idx = ivas_split_rend_huffman_decode( &pHuff_cfg->gd, pBits ); - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + hMd->gd2_idx = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->p_gd, pBits, pHuff_cfg->p_gd_idx_trav ); + } + } + else { - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; - - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_real_bands_roll; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); - // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); + // sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode( &pHuff_cfg->pred, pBits ); + } } + ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_idx, max_pred_idx ); } - ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_re_idx, 1, min_pred_idx, max_pred_idx ); - - if ( real_only == 0 ) + for ( b = 0; b < pred_imag_bands_roll; b++ ) { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) @@ -409,8 +527,6 @@ static void ivas_splitBinPostRendMdHuffDec( } ivas_SplitRenderer_getdiagdiff( sym_adj_idx, hMd->pred_mat_im_idx, -1, min_pred_idx, max_pred_idx ); } - hMd->gd_idx = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->gd, pBits, pHuff_cfg->gd_idx_trav ); - // hMd->gd_idx = ivas_split_rend_huffman_decode( &pHuff_cfg->gd, pBits ); } } } @@ -421,214 +537,717 @@ static void ivas_splitBinPostRendMdHuffDec( void ivas_splitBinPostRendMdDec( ivas_split_rend_bits_t *pBits, BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, -#endif + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int16_t num_md_bands ) { - int16_t pos_idx, b, sf_idx; + int16_t pos_idx, b, sf_idx, num_subframes, ch1; + int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int16_t num_complex_bands, num_quant_strats; + int32_t quant_strat_bits, is_huff_coding, quant_strat; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG int16_t ch1, ch2; #endif - int16_t real_only, yaw_idx; BIN_HR_SPLIT_REND_MD_HANDLE hMd; - real_only = 0; + IVAS_SPLIT_REND_CONFIG_DATA split_rend_config; + IVAS_SPLIT_REND_ROT_AXIS rot_axis; -#ifdef SPLIT_REND_BASE2_CODING - ivas_splitBinPostRendMdBase2Dec( pBits, hBinHrSplitPostRend, num_md_bands ); -#else - ivas_splitBinPostRendMdHuffDec( pBits, hBinHrSplitPostRend, num_md_bands ); -#endif + hBinHrSplitPostRend->low_Res = 1; + //( int16_t ) ivas_split_rend_bitstream_read_int32( pBits, 1 ); + + split_rend_config.dof = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_DOF_BITS ); + split_rend_config.hq_mode = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_HQ_MODE_BITS ); + rot_axis = (IVAS_SPLIT_REND_ROT_AXIS) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_ROT_AXIS_BITS ); + + ivas_renderSplitGetMultiBinPoseData( + &split_rend_config, + pMultiBinPoseData, rot_axis ); - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + set_fix_rotation_mat( hBinHrSplitPostRend->fix_pos_rot_mat, pMultiBinPoseData ); + set_pose_types( hBinHrSplitPostRend->pose_type, pMultiBinPoseData ); + + num_subframes = ( hBinHrSplitPostRend->low_Res == 0 ) ? MAX_PARAM_SPATIAL_SUBFRAMES : 1; + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + int16_t angle; + + hBinHrSplitPostRend->QuaternionsPre[sf_idx].w = -3.0f; + + angle = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + angle -= 180; + hBinHrSplitPostRend->QuaternionsPre[sf_idx].x = (float) angle; + + angle = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + angle -= 180; + hBinHrSplitPostRend->QuaternionsPre[sf_idx].y = (float) angle; + + angle = (int16_t) ivas_split_rend_bitstream_read_int32( pBits, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + angle -= 180; + hBinHrSplitPostRend->QuaternionsPre[sf_idx].z = (float) angle; + } + + ivas_split_rend_get_quant_params( + MAX_SPLIT_REND_MD_BANDS, + pred_real_bands_yaw, + pred_imag_bands_yaw, + d_bands_yaw, + bands_pitch, + pred_real_bands_roll, + pred_imag_bands_roll, + &num_quant_strats, + &num_complex_bands ); + + quant_strat_bits = (int32_t) ceilf( log2f( num_quant_strats ) ); + is_huff_coding = ivas_split_rend_bitstream_read_int32( pBits, 1 ); + quant_strat = ivas_split_rend_bitstream_read_int32( pBits, quant_strat_bits ); + + if ( is_huff_coding == 0 ) + { + ivas_splitBinPostRendMdBase2Dec( + pBits, hBinHrSplitPostRend, + pMultiBinPoseData, + num_subframes, + pred_real_bands_yaw[quant_strat], + pred_imag_bands_yaw[quant_strat], + d_bands_yaw[quant_strat], + bands_pitch[quant_strat], + pred_real_bands_roll[quant_strat], + pred_imag_bands_roll[quant_strat] ); + } + else + { + ivas_splitBinPostRendMdHuffDec( + pBits, hBinHrSplitPostRend, + pMultiBinPoseData, + num_subframes, + pred_real_bands_yaw[quant_strat], + pred_imag_bands_yaw[quant_strat], + d_bands_yaw[quant_strat], + bands_pitch[quant_strat], + pred_real_bands_roll[quant_strat], + pred_imag_bands_roll[quant_strat] ); + } +#ifdef SPLIT_MD_CODING_DEBUG + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + int16_t val, ch2, val_ref; + char filename[200] = "split_md_debug_indices.bin"; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - yaw_idx = ( pos_idx / ( MAX_PITCH_ANGLES * MAX_ROLL_ANGLES ) ); - for ( b = 0; b < num_md_bands; b++ ) + if ( hBinHrSplitPostRend->pose_type[pos_idx] == ANY_YAW ) { - if ( b < COMPLEX_MD_BAND_THRESH ) - { - real_only = 0; - } - else - { - real_only = 1; - } - hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - /*verify that MD is decodd correctly*/ - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_real_bands_yaw[quant_strat]; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - int16_t val; - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; - if ( abs( hMd->pred_mat_re_idx[ch1][ch2] - val ) > 0 ) - { - assert( 0 ); - } - - if ( real_only == 0 ) + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; - if ( abs( hMd->pred_mat_im_idx[ch1][ch2] - val ) > 0 ) + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) { assert( 0 ); } } - - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; - if ( abs( hMd->gd_idx - val ) > 0 ) - { - assert( 0 ); - } } } -#endif - - ivas_split_rend_unquant_md( hMd, - real_only, hBinHrSplitPostRend->fix_pos_rot_mat[yaw_idx] ); - -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - /*verify that MD is decodd correctly*/ - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_imag_bands_yaw[quant_strat]; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - float val; - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch1][ch2] + - hBinHrSplitPostRend->fix_pos_rot_mat[yaw_idx][ch1][ch2]; - if ( fabs( hMd->pred_mat_re[ch1][ch2] - val ) > 1e-20 ) + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - assert( 0 ); + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } } - - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch1][ch2]; - if ( fabs( hMd->pred_mat_im[ch1][ch2] - val ) > 1e-20 ) + } + } + for ( b = 0; b < d_bands_yaw[quant_strat]; b++ ) + { + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].gd_idx; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } + } + } + else if ( hBinHrSplitPostRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch[quant_strat]; b++ ) + { + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].gd_idx; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].gd2_idx; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } + } + } + else + { + for ( b = 0; b < pred_real_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - assert( 0 ); + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } } - - val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd; - if ( fabs( hMd->gd - val ) > 1e-20 ) + } + } + for ( b = 0; b < pred_imag_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - assert( 0 ); + val = hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + dbgread( &val_ref, sizeof( int16_t ), 1, filename ); + if ( abs( val_ref - val ) > 0 ) + { + assert( 0 ); + } } } } -#endif } } } - return; -} - -#define REAL_IMAG_INTERPOLATION -static void wrap_around_angle( float *a ) -{ - if ( ( *a ) > 180.0f ) - { - ( *a ) = ( *a ) - 360; - } - else if ( ( *a ) < -180.0f ) - { - ( *a ) = ( *a ) + 360; - } - return; -} -static void wrap_around_ypr( IVAS_QUATERNION *Quaternions ) -{ - /*only if quat is actually yaw, pitch , roll angles*/ - if ( Quaternions->w == -3.0f ) - { - wrap_around_angle( &Quaternions->x ); - wrap_around_angle( &Quaternions->y ); - wrap_around_angle( &Quaternions->z ); - } - return; -} -static void get_interpolation_vars( - const IVAS_QUATERNION *Quaternions_ref, - const IVAS_QUATERNION *Quaternions_act, - int16_t interp_pose_idx[2], - float *interp_fact ) -{ - IVAS_QUATERNION quaternions_diff, quaternions_diffx[MAX_HEAD_ROT_POSES], quaternions_ref_euler, quaternions_act_euler; - int16_t yaw_idx, pitch_idx, roll_idx, pos_idx; - float min_diff, d1, n1; - int16_t idx1, idx2; - - idx1 = 0; - idx2 = 0; - quaternions_diff.x = 0.0f; - quaternions_diff.y = 0.0f; - quaternions_diff.z = 0.0f; - - for ( yaw_idx = 0; yaw_idx < MAX_YAW_ANGLES; yaw_idx++ ) +#endif + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - for ( pitch_idx = 0; pitch_idx < MAX_PITCH_ANGLES; pitch_idx++ ) + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - for ( roll_idx = 0; roll_idx < MAX_ROLL_ANGLES; roll_idx++ ) + if ( hBinHrSplitPostRend->pose_type[pos_idx] == ANY_YAW ) { - pos_idx = yaw_idx * MAX_PITCH_ANGLES * MAX_ROLL_ANGLES + pitch_idx * MAX_ROLL_ANGLES + roll_idx; - - quaternions_diff.x += split_rend_relative_yaw_angles[yaw_idx]; - quaternions_diff.y += split_rend_relative_pitch_angles[pitch_idx]; - quaternions_diff.z += split_rend_relative_roll_angles[roll_idx]; - quaternions_diffx[pos_idx].x = quaternions_diff.x; - quaternions_diffx[pos_idx].y = quaternions_diff.y; - quaternions_diffx[pos_idx].z = quaternions_diff.z; + for ( b = 0; b < pred_imag_bands_yaw[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + PRED_ONLY, + 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < pred_real_bands_yaw[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + PRED_ONLY, + 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + set_zero( hMd->pred_mat_re[ch1], BINAURAL_CHANNELS ); + set_zero( hMd->pred_mat_im[ch1], BINAURAL_CHANNELS ); + hMd->pred_mat_re[ch1][ch1] = 1.0f; + } + } + for ( b = 0; b < d_bands_yaw[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + COM_GAIN_ONLY, + 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + hMd->gd = 0.0f; + } + } + else if ( hBinHrSplitPostRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + LR_GAIN_ONLY, + 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + hMd->gd = 1.0f; + hMd->gd2 = 1.0f; + } + } + else + { + for ( b = 0; b < pred_imag_bands_roll[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + PRED_ONLY, + 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < pred_real_bands_roll[quant_strat]; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_unquant_md( hMd, + PRED_ONLY, + 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + set_zero( hMd->pred_mat_re[ch1], BINAURAL_CHANNELS ); + set_zero( hMd->pred_mat_im[ch1], BINAURAL_CHANNELS ); + hMd->pred_mat_re[ch1][ch1] = 1.0f; + } + } } } } - /*interpolation if actual pose is not same as one of assumed poses*/ +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + float val; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) + { + if ( hBinHrSplitPostRend->pose_type[pos_idx] == ANY_YAW ) + { + for ( b = 0; b < pred_real_bands_yaw[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + if ( fabsf( hMd->pred_mat_re_idx[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + } + for ( b = 0; b < pred_imag_bands_yaw[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + if ( fabsf( hMd->pred_mat_im_idx[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + } + for ( b = 0; b < d_bands_yaw[quant_strat]; b++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; + if ( fabsf( hMd->gd_idx - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + else if ( hBinHrSplitPostRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch[quant_strat]; b++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; + if ( fabsf( hMd->gd_idx - val ) > 1e-20 ) + { + assert( 0 ); + } + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd2_idx; + if ( fabsf( hMd->gd2_idx - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + else + { + for ( b = 0; b < pred_real_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + if ( fabsf( hMd->pred_mat_re_idx[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + } + for ( b = 0; b < pred_imag_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + if ( fabsf( hMd->pred_mat_im_idx[ch1][ch2] - val ) > 1e-20 ) + { + assert( 0 ); + } + } + } + } + } + } + } +#endif + + if ( hBinHrSplitPostRend->low_Res ) + { + int16_t sf_idx2, res_ratio, ch2; + BIN_HR_SPLIT_REND_MD_HANDLE hMd2; + res_ratio = MAX_PARAM_SPATIAL_SUBFRAMES / num_subframes; + + for ( sf_idx = num_subframes - 1; sf_idx >= 0; sf_idx-- ) + { + for ( sf_idx2 = res_ratio - 1; sf_idx2 >= 0; sf_idx2-- ) + { + hBinHrSplitPostRend->QuaternionsPre[( sf_idx * res_ratio ) + sf_idx2] = hBinHrSplitPostRend->QuaternionsPre[sf_idx]; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) + { + for ( b = 0; b < num_md_bands; b++ ) + { + hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; + hMd2 = &hBinHrSplitPostRend->rot_md[pos_idx][( sf_idx * res_ratio ) + sf_idx2][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + hMd2->pred_mat_re[ch1][ch2] = hMd->pred_mat_re[ch1][ch2]; + hMd2->pred_mat_im[ch1][ch2] = hMd->pred_mat_im[ch1][ch2]; + } + } + hMd2->gd = hMd->gd; + hMd2->gd2 = hMd->gd2; + } + } + } + } + } + + return; +} + +#define REAL_IMAG_INTERPOLATION +static void wrap_around_angle( float *a ) +{ + if ( ( *a ) > 180.0f ) + { + ( *a ) = ( *a ) - 360; + } + else if ( ( *a ) < -180.0f ) + { + ( *a ) = ( *a ) + 360; + } + return; +} +static void wrap_around_ypr( IVAS_QUATERNION *Quaternions ) +{ + /*only if quat is actually yaw, pitch , roll angles*/ + if ( Quaternions->w == -3.0f ) + { + wrap_around_angle( &Quaternions->x ); + wrap_around_angle( &Quaternions->y ); + wrap_around_angle( &Quaternions->z ); + } + return; +} + +static float get_interp_fact( float p[MAX_HEAD_ROT_POSES], float p_t, int16_t ind[2] ) +{ + float n, d, interp_fact; + if ( ind[0] != ind[1] ) + { + n = p[ind[0]] - p[ind[1]]; + d = p[ind[0]] - p_t; + interp_fact = d / n; +#ifdef SPLIT_SIN_SCALING_AND_EXTRAPOL_LIMIT + if ( interp_fact < 0.0f ) + { + d = max( -1.0f * MAX_EXTRAPOLATION_ANGLE, ( min( MAX_EXTRAPOLATION_ANGLE, d ) ) ); + n = sinf( n * ( EVS_PI / 180.0f ) ); + d = sinf( d * ( EVS_PI / 180.0f ) ); + interp_fact = d / n; + } +#endif + } + else + { + interp_fact = 0.0f; + } + + return interp_fact; +} + +static void get_nearest_pose_ind( float p[MAX_HEAD_ROT_POSES], float p_t, int16_t ind[2], int16_t num_poses ) +{ + float min_diff, diff; + int16_t pos_idx; + + ind[0] = 0; + ind[1] = 0; + min_diff = 360.0f; + /*find the closest pose from assumed poses*/ + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + diff = fabsf( p_t - p[pos_idx] ); + if ( diff < min_diff ) + { + ind[0] = pos_idx; + min_diff = (float) diff; + } + } + + min_diff = 360.0; + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + diff = fabsf( p_t - p[pos_idx] ); + if ( ( diff < min_diff ) && + ( fabs( p[pos_idx] - p[ind[0]] ) > EPSILON ) ) + { + ind[1] = pos_idx; + min_diff = (float) diff; + } + } + + return; +} + +static void get_interpolation_vars( + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_QUATERNION *Quaternions_ref, + const IVAS_QUATERNION *Quaternions_act, + int16_t interp_yaw_pose_idx[2], + int16_t interp_pitch_pose_idx[2], + int16_t interp_roll_pose_idx[2], + float *interp_yaw_fact, + float *interp_pitch_fact, + float *interp_roll_fact ) +{ + IVAS_QUATERNION quaternions_diff, quaternions_ref_euler, quaternions_act_euler; + float y[MAX_HEAD_ROT_POSES], p[MAX_HEAD_ROT_POSES], r[MAX_HEAD_ROT_POSES]; + int16_t pos_idx, num_poses; + + quaternions_diff.x = 0.0f; + quaternions_diff.y = 0.0f; + quaternions_diff.z = 0.0f; + + num_poses = pMultiBinPoseData->num_poses; + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + quaternions_diff.x = pMultiBinPoseData->relative_head_poses[pos_idx][0]; + quaternions_diff.y = pMultiBinPoseData->relative_head_poses[pos_idx][1]; + quaternions_diff.z = pMultiBinPoseData->relative_head_poses[pos_idx][2]; + y[pos_idx] = quaternions_diff.x; + p[pos_idx] = quaternions_diff.y; + r[pos_idx] = quaternions_diff.z; + } + + /*interpolation if actual pose is not same as one of assumed poses*/ /*get the deviation*/ - Quat2Euler( *Quaternions_ref, &quaternions_ref_euler.z, &quaternions_ref_euler.y, &quaternions_ref_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ - Quat2Euler( *Quaternions_act, &quaternions_act_euler.z, &quaternions_act_euler.y, &quaternions_act_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ - quaternions_diff.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_ref, &quaternions_ref_euler.z, &quaternions_ref_euler.y, &quaternions_ref_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quat2EulerDegree( *Quaternions_act, &quaternions_act_euler.z, &quaternions_act_euler.y, &quaternions_act_euler.x ); /*order in Quat2Euler seems to be reversed ?*/ + quaternions_diff.w = -3.0f; /*euler*/ quaternions_diff.x = quaternions_act_euler.x - quaternions_ref_euler.x; quaternions_diff.y = quaternions_act_euler.y - quaternions_ref_euler.y; quaternions_diff.z = quaternions_act_euler.z - quaternions_ref_euler.z; wrap_around_ypr( &quaternions_diff ); + + interp_yaw_pose_idx[0] = 0; + interp_yaw_pose_idx[1] = 0; if ( fabs( quaternions_diff.x ) > EPSILON ) { - min_diff = 360.0f; - /*find the closest pose from assumed poses*/ - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + get_nearest_pose_ind( y, quaternions_diff.x, interp_yaw_pose_idx, num_poses ); + } + *interp_yaw_fact = get_interp_fact( y, quaternions_diff.x, interp_yaw_pose_idx ); + + interp_pitch_pose_idx[0] = 0; + interp_pitch_pose_idx[1] = 0; + if ( fabs( quaternions_diff.y ) > EPSILON ) + { + get_nearest_pose_ind( p, quaternions_diff.y, interp_pitch_pose_idx, num_poses ); + } + *interp_pitch_fact = get_interp_fact( p, quaternions_diff.y, interp_pitch_pose_idx ); + + interp_roll_pose_idx[0] = 0; + interp_roll_pose_idx[1] = 0; + if ( fabs( quaternions_diff.z ) > EPSILON ) + { + get_nearest_pose_ind( r, quaternions_diff.z, interp_roll_pose_idx, num_poses ); + } + *interp_roll_fact = get_interp_fact( r, quaternions_diff.z, interp_roll_pose_idx ); + + return; +} + +static void interpolate_gain_matrix( + BIN_HR_SPLIT_REND_MD rot_md[][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], + int16_t sf_idx, + int16_t band_idx, + int16_t ind[2], + float interp_fact, + float gain[BINAURAL_CHANNELS] ) +{ + float gd1, gd2, gd3, gd4, diff; + + gd1 = 1.0f; + gd2 = 1.0f; + gd3 = 1.0f; + gd4 = 1.0f; + if ( ind[0] != 0 ) + { + gd1 = rot_md[ind[0] - 1][sf_idx][band_idx].gd; + gd3 = rot_md[ind[0] - 1][sf_idx][band_idx].gd2; + } + if ( ind[1] != 0 ) + { + gd2 = rot_md[ind[1] - 1][sf_idx][band_idx].gd; + gd4 = rot_md[ind[1] - 1][sf_idx][band_idx].gd2; + } +#if 0 + diff = gd1 / gd2; + pitch_gain_l = gd2 * powf( diff, 1.0f - interp_pitch_fact ); + pitch_gain_l = max( 0.0f, pitch_gain_l ); + + diff = gd3 / gd4; + pitch_gain_r = gd4 * powf( diff, 1.0f - interp_pitch_fact ); + pitch_gain_r = max( 0.0f, pitch_gain_r ); +#else + diff = gd1 - gd2; + gain[0] = gd1 - ( diff * interp_fact ); + gain[0] = max( 0.0f, gain[0] ); + + diff = gd3 - gd4; + gain[1] = gd3 - ( diff * interp_fact ); + gain[1] = max( 0.0f, gain[1] ); +#endif +} + +static void interpolate_pred_matrix( + BIN_HR_SPLIT_REND_MD rot_md[][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], + int16_t sf_idx, + int16_t band_idx, + int16_t ind[2], + float interp_fact, + float mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], + float mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ) +{ + int16_t ch_idx1, ch_idx2; + float diff; + BIN_HR_SPLIT_REND_MD *pRot_md; + float mix_mat_re1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_im1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_re2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_im2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; +#ifdef SPIT_ABS_SCALING_INTERP + float abs1, abs2; + float mix_mat_abs[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; +#endif + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + set_zero( mix_mat_re1[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_im1[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_re1[ch_idx1][ch_idx1] = 1.0f; + + set_zero( mix_mat_re2[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_im2[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_re2[ch_idx1][ch_idx1] = 1.0f; + } + + if ( ind[0] != 0 ) + { + pRot_md = &rot_md[ind[0] - 1][sf_idx][band_idx]; + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - if ( fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ) < min_diff ) + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) { - idx1 = pos_idx; - min_diff = (float) fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ); + mix_mat_re1[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; + mix_mat_im1[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; } } + } - min_diff = 360.0; - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + if ( ind[1] != 0 ) + { + pRot_md = &rot_md[ind[1] - 1][sf_idx][band_idx]; + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - if ( ( fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ) < min_diff ) && - ( pos_idx != idx1 ) ) + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) { - idx2 = pos_idx; - min_diff = (float) fabs( quaternions_diff.x - quaternions_diffx[pos_idx].x ); + mix_mat_re2[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; + mix_mat_im2[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; } } } - interp_pose_idx[0] = idx1; - interp_pose_idx[1] = idx2; - if ( idx1 != idx2 ) +#ifdef SPIT_ABS_SCALING_INTERP + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - n1 = quaternions_diffx[idx1].x - quaternions_diffx[idx2].x; - d1 = quaternions_diffx[idx1].x - quaternions_diff.x; - *interp_fact = d1 / n1; + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + IVAS_CALCULATE_ABS( mix_mat_re1[ch_idx1][ch_idx2], mix_mat_im1[ch_idx1][ch_idx2], abs1 ); + IVAS_CALCULATE_ABS( mix_mat_re2[ch_idx1][ch_idx2], mix_mat_im2[ch_idx1][ch_idx2], abs2 ); + diff = abs1 - abs2; + mix_mat_abs[ch_idx1][ch_idx2] = abs1 - ( diff * interp_fact ); + mix_mat_abs[ch_idx1][ch_idx2] = fabsf( mix_mat_abs[ch_idx1][ch_idx2] ); + } } - else +#endif + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + diff = mix_mat_re1[ch_idx1][ch_idx2] - mix_mat_re2[ch_idx1][ch_idx2]; + mat_re[ch_idx1][ch_idx2] = mix_mat_re1[ch_idx1][ch_idx2] - ( diff * interp_fact ); + + diff = mix_mat_im1[ch_idx1][ch_idx2] - mix_mat_im2[ch_idx1][ch_idx2]; + mat_im[ch_idx1][ch_idx2] = mix_mat_im1[ch_idx1][ch_idx2] - ( diff * interp_fact ); + } + } + +#ifdef SPIT_ABS_SCALING_INTERP + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - *interp_fact = 0.0f; + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + IVAS_CALCULATE_ABS( mat_re[ch_idx1][ch_idx2], mat_im[ch_idx1][ch_idx2], abs1 ); + if ( abs1 > 1e-10 ) + { + abs1 = mix_mat_abs[ch_idx1][ch_idx2] / abs1; + mat_re[ch_idx1][ch_idx2] = mat_re[ch_idx1][ch_idx2] * abs1; + mat_im[ch_idx1][ch_idx2] = mat_im[ch_idx1][ch_idx2] * abs1; + } + } } +#endif return; } @@ -640,82 +1259,44 @@ static void interpolate_rend_md( float *gd_int, int16_t sf_idx, int16_t band_idx, - int16_t interp_pose_idx[2], - float interp_fact ) + int16_t interp_yaw_pose_idx[2], + int16_t interp_pitch_pose_idx[2], + int16_t interp_roll_pose_idx[2], + float interp_yaw_fact, + float interp_pitch_fact, + float interp_roll_fact ) { - int16_t ch_idx1, ch_idx2, idx1, idx2; - float mix_mat_abs1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mix_mat_ph1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mix_mat_abs2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mix_mat_ph2[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mix_mat_abs[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float mix_mat_ph[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; - float gd1, gd2, diff; - BIN_HR_SPLIT_REND_MD *pRot_md; - - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) - { - set_zero( mix_mat_abs1[ch_idx1], BINAURAL_CHANNELS ); - set_zero( mix_mat_ph1[ch_idx1], BINAURAL_CHANNELS ); - mix_mat_abs1[ch_idx1][ch_idx1] = 1.0f; + int16_t ch_idx1, idx1, idx2; +#ifndef SPLIT_REND_REAL_ONLY_ROLL + float mix_mat_re1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_im1[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_re3[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + float mix_mat_im3[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; + int16_t ch_idx2; +#endif + float gd1, gd2, gd3, gd4, diff, pitch_gain_r, pitch_gain_l; - set_zero( mix_mat_abs2[ch_idx1], BINAURAL_CHANNELS ); - set_zero( mix_mat_ph2[ch_idx1], BINAURAL_CHANNELS ); - mix_mat_abs2[ch_idx1][ch_idx1] = 1.0f; - } gd1 = 0.0f; gd2 = 0.0f; - idx1 = interp_pose_idx[0]; - idx2 = interp_pose_idx[1]; + idx1 = interp_yaw_pose_idx[0]; + idx2 = interp_yaw_pose_idx[1]; if ( ( idx1 != 0 ) || ( idx2 != 0 ) ) { + interpolate_pred_matrix( rot_md, sf_idx, band_idx, interp_yaw_pose_idx, interp_yaw_fact, mix_mat_re, mix_mat_im ); + if ( idx1 != 0 ) { - pRot_md = &rot_md[idx1 - 1][sf_idx][band_idx]; - - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) - { - for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) - { - mix_mat_abs1[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; - mix_mat_ph1[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; - } - } gd1 = rot_md[idx1 - 1][sf_idx][band_idx].gd; } if ( idx2 != 0 ) { - pRot_md = &rot_md[idx2 - 1][sf_idx][band_idx]; - - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) - { - for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) - { - mix_mat_abs2[ch_idx1][ch_idx2] = pRot_md->pred_mat_re[ch_idx1][ch_idx2]; - mix_mat_ph2[ch_idx1][ch_idx2] = pRot_md->pred_mat_im[ch_idx1][ch_idx2]; - } - } gd2 = rot_md[idx2 - 1][sf_idx][band_idx].gd; } - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) - { - for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) - { - diff = mix_mat_abs1[ch_idx1][ch_idx2] - mix_mat_abs2[ch_idx1][ch_idx2]; - mix_mat_abs[ch_idx1][ch_idx2] = mix_mat_abs1[ch_idx1][ch_idx2] - ( diff * interp_fact ); - - diff = mix_mat_ph1[ch_idx1][ch_idx2] - mix_mat_ph2[ch_idx1][ch_idx2]; - mix_mat_ph[ch_idx1][ch_idx2] = mix_mat_ph1[ch_idx1][ch_idx2] - ( diff * interp_fact ); - - mix_mat_re[ch_idx1][ch_idx2] = mix_mat_abs[ch_idx1][ch_idx2]; - mix_mat_im[ch_idx1][ch_idx2] = mix_mat_ph[ch_idx1][ch_idx2]; - } - } diff = gd1 - gd2; - *gd_int = gd1 - ( diff * interp_fact ); + *gd_int = gd1 - ( diff * interp_yaw_fact ); } else { @@ -729,27 +1310,148 @@ static void interpolate_rend_md( *gd_int = 0.0f; } + idx1 = interp_pitch_pose_idx[0]; + idx2 = interp_pitch_pose_idx[1]; + if ( ( idx1 != 0 ) || ( idx2 != 0 ) ) + { + gd1 = 1.0f; + gd2 = 1.0f; + + gd3 = 1.0f; + gd4 = 1.0f; + + if ( idx1 != 0 ) + { + gd1 = rot_md[idx1 - 1][sf_idx][band_idx].gd; + gd3 = rot_md[idx1 - 1][sf_idx][band_idx].gd2; + } + if ( idx2 != 0 ) + { + gd2 = rot_md[idx2 - 1][sf_idx][band_idx].gd; + gd4 = rot_md[idx2 - 1][sf_idx][band_idx].gd2; + } +#if 0 + diff = gd1 / gd2; + pitch_gain_l = gd2 * powf( diff, 1.0f - interp_pitch_fact ); + pitch_gain_l = max( 0.0f, pitch_gain_l ); + + diff = gd3 / gd4; + pitch_gain_r = gd4 * powf( diff, 1.0f - interp_pitch_fact ); + pitch_gain_r = max( 0.0f, pitch_gain_r ); +#else + diff = gd1 - gd2; + pitch_gain_l = gd1 - ( diff * interp_pitch_fact ); + pitch_gain_l = max( 0.0f, pitch_gain_l ); + + diff = gd3 - gd4; + pitch_gain_r = gd3 - ( diff * interp_pitch_fact ); + pitch_gain_r = max( 0.0f, pitch_gain_r ); +#endif + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + mix_mat_re[ch_idx1][0] *= pitch_gain_l; + mix_mat_re[ch_idx1][1] *= pitch_gain_r; + mix_mat_im[ch_idx1][0] *= pitch_gain_l; + mix_mat_im[ch_idx1][1] *= pitch_gain_r; + } + } + else + { + pitch_gain_l = 1.0f; + pitch_gain_r = 1.0f; + } + + idx1 = interp_roll_pose_idx[0]; + idx2 = interp_roll_pose_idx[1]; +#ifdef SPLIT_REND_REAL_ONLY_ROLL + if ( ( idx1 != 0 ) || ( idx2 != 0 ) ) + { + gd1 = 1.0f; + gd2 = 1.0f; + + gd3 = 1.0f; + gd4 = 1.0f; + + if ( idx1 != 0 ) + { + gd1 = rot_md[idx1 - 1][sf_idx][band_idx].gd; + gd3 = rot_md[idx1 - 1][sf_idx][band_idx].gd2; + } + if ( idx2 != 0 ) + { + gd2 = rot_md[idx2 - 1][sf_idx][band_idx].gd; + gd4 = rot_md[idx2 - 1][sf_idx][band_idx].gd2; + } +#if 0 + diff = gd1 / gd2; + pitch_gain_l = gd2 * powf( diff, 1.0f - interp_roll_fact ); + pitch_gain_l = max( 0.0f, pitch_gain_l ); + + diff = gd3 / gd4; + pitch_gain_r = gd4 * powf( diff, 1.0f - interp_roll_fact ); + pitch_gain_r = max( 0.0f, pitch_gain_r ); +#else + diff = gd1 - gd2; + pitch_gain_l = gd1 - ( diff * interp_roll_fact ); + pitch_gain_l = max( 0.0f, pitch_gain_l ); + + diff = gd3 - gd4; + pitch_gain_r = gd3 - ( diff * interp_roll_fact ); + pitch_gain_r = max( 0.0f, pitch_gain_r ); +#endif + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + mix_mat_re[ch_idx1][0] *= pitch_gain_l; + mix_mat_re[ch_idx1][1] *= pitch_gain_r; + mix_mat_im[ch_idx1][0] *= pitch_gain_l; + mix_mat_im[ch_idx1][1] *= pitch_gain_r; + } + } +#else + if ( ( idx1 != 0 ) || ( idx2 != 0 ) ) + { + + + interpolate_pred_matrix( rot_md, sf_idx, band_idx, interp_roll_pose_idx, interp_roll_fact, mix_mat_re3, mix_mat_im3 ); + + ivas_mat_mult_2by2_complex( mix_mat_re, mix_mat_im, mix_mat_re3, mix_mat_im3, + mix_mat_re1, mix_mat_im1 ); + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + for ( ch_idx2 = 0; ch_idx2 < BINAURAL_CHANNELS; ch_idx2++ ) + { + mix_mat_re[ch_idx1][ch_idx2] = mix_mat_re1[ch_idx1][ch_idx2]; + mix_mat_im[ch_idx1][ch_idx2] = mix_mat_im1[ch_idx1][ch_idx2]; + } + } + } +#endif + return; } void ivas_SplitRenderer_PostRenderer( - BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ - float Cldfb_RealBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ - float Cldfb_ImagBuffer_Ref_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ - int16_t sf_idx, - const IVAS_QUATERNION *Quaternions_ref, - const IVAS_QUATERNION *Quaternions_act ) + BIN_HR_SPLIT_POST_REND_HANDLE hBinPostRenderer, /* i/o: binaural renderer handle */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + float Cldfb_RealBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o : Reference/out Binaural signals */ + const IVAS_QUATERNION Quaternions_act[MAX_PARAM_SPATIAL_SUBFRAMES] ) { int16_t pos_idx, b, brange[2], ch_idx1; - int16_t num_md_bands, slot_idx, b2; - float pred_out_re[BINAURAL_CHANNELS], pred_out_im[BINAURAL_CHANNELS], tmp_re, tmp_im, gd_int, gd_cf, gd_cf_abs; - int16_t interp_pose_idx[2]; - float interp_fact; + int16_t num_md_bands, slot_idx, b2, sf_idx, index_slot, num_subframes, num_slots, sf_idx_md; + float pred_out_re[BINAURAL_CHANNELS], pred_out_im[BINAURAL_CHANNELS], tmp_re, tmp_im, gd_int; +#ifndef SPLIT_REND_ZERO_OUT_YAW_D + float gd_cf, gd_cf_abs; +#endif + int16_t interp_yaw_pose_idx[2], interp_pitch_pose_idx[2], interp_roll_pose_idx[2]; + float interp_yaw_fact, interp_pitch_fact, interp_roll_fact; float mix_mat_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; float mix_mat_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - float Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; #endif float fade; float *pMix_mat_re_prev[BINAURAL_CHANNELS]; @@ -759,246 +1461,339 @@ void ivas_SplitRenderer_PostRenderer( wmops_sub_start( "ivas_SplitRenderer_PostRenderer" ); + + num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; + num_slots = MAX_PARAM_SPATIAL_SUBFRAMES; + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - pos_idx = MAX_HEAD_ROT_POSES - 1; + pos_idx = MAX_HEAD_ROT_POSES - 1; #else - pos_idx = 0; + pos_idx = 0; #endif - get_interpolation_vars( Quaternions_ref, Quaternions_act, interp_pose_idx, &interp_fact ); - for ( b = 0; b < num_md_bands; b++ ) - { - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + sf_idx_md = ( hBinPostRenderer->low_Res == 0 ) ? sf_idx : 0; + get_interpolation_vars( pMultiBinPoseData, + &hBinPostRenderer->QuaternionsPre[sf_idx_md], + &Quaternions_act[sf_idx], + interp_yaw_pose_idx, + interp_pitch_pose_idx, + interp_roll_pose_idx, + &interp_yaw_fact, + &interp_pitch_fact, + &interp_roll_fact ); + for ( b = 0; b < num_md_bands; b++ ) { - set_zero( mix_mat_re[ch_idx1], BINAURAL_CHANNELS ); - set_zero( mix_mat_im[ch_idx1], BINAURAL_CHANNELS ); - mix_mat_re[ch_idx1][ch_idx1] = 1.0f; - } - gd_int = 0.0f; + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + set_zero( mix_mat_re[ch_idx1], BINAURAL_CHANNELS ); + set_zero( mix_mat_im[ch_idx1], BINAURAL_CHANNELS ); + mix_mat_re[ch_idx1][ch_idx1] = 1.0f; + } + gd_int = 0.0f; + interpolate_rend_md( hBinPostRenderer->rot_md, mix_mat_re, mix_mat_im, &gd_int, sf_idx, b, interp_yaw_pose_idx, interp_pitch_pose_idx, interp_roll_pose_idx, interp_yaw_fact, interp_pitch_fact, interp_roll_fact ); - interpolate_rend_md( hBinPostRenderer->rot_md, mix_mat_re, mix_mat_im, &gd_int, sf_idx, b, interp_pose_idx, interp_fact ); - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) - { - /*update the prediction matrix with interpolated matrix*/ - hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] = mix_mat_re[ch_idx1][0]; - hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] = mix_mat_re[ch_idx1][1]; - hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] = mix_mat_im[ch_idx1][0]; - hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] = mix_mat_im[ch_idx1][1]; - hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd = gd_int; + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + /*update the prediction matrix with interpolated matrix*/ + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] = mix_mat_re[ch_idx1][0]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] = mix_mat_re[ch_idx1][1]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] = mix_mat_im[ch_idx1][0]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] = mix_mat_im[ch_idx1][1]; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd = gd_int; + } } - } + #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) -#else - pos_idx = 0; -#endif - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) { - fade = ( (float) slot_idx + 1.0f ) / MAX_PARAM_SPATIAL_SUBFRAMES; for ( b = 0; b < num_md_bands; b++ ) { - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + if ( hBinPostRenderer->pose_type[pos_idx] == PITCH_ONLY ) { - if ( hBinPostRenderer->cf_flag ) - { - pMix_mat_re_prev[ch_idx1] = hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1]; - pMix_mat_im_prev[ch_idx1] = hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1]; - mix_mat_re[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] ) + - ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][0]; - mix_mat_re[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] ) + - ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][1]; - - mix_mat_im[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] ) + - ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][0]; - mix_mat_im[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] ) + - ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][1]; - } - else + + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - mix_mat_re[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; - mix_mat_re[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; - mix_mat_im[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; - mix_mat_im[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + set_zero( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1], BINAURAL_CHANNELS ); + set_zero( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1], BINAURAL_CHANNELS ); + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][ch_idx1] = 1.0f; } + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[0][0] *= hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[1][1] *= hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd2; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd = 0.0f; } - - if ( hBinPostRenderer->cf_flag ) - { - gd_cf = fade * hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd + - ( 1 - fade ) * hBinPostRenderer->gd_mem[pos_idx][b]; - } - else + else if ( hBinPostRenderer->pose_type[pos_idx] == ANY_ROLL ) { - gd_cf = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; + hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd = 0.0f; } - gd_cf_abs = (float) fabs( gd_cf ); + } + } +#endif - brange[0] = pBand_grouping[b]; - brange[1] = pBand_grouping[b + 1]; - for ( b2 = brange[0]; b2 < brange[1]; b2++ ) +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) +#else + pos_idx = 0; +#endif + { + for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) + { + index_slot = sf_idx * num_slots + slot_idx; + fade = ( (float) slot_idx + 1.0f ) / MAX_PARAM_SPATIAL_SUBFRAMES; + fade = min( fade, 1.0f ); + for ( b = 0; b < num_md_bands; b++ ) { for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) { - // Apply prediction matrix - IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[0][slot_idx][b2], - Cldfb_ImagBuffer_Ref_Binaural[0][slot_idx][b2], - mix_mat_re[0][ch_idx1], - mix_mat_im[0][ch_idx1], - tmp_re, - tmp_im ); - pred_out_re[ch_idx1] = tmp_re; - pred_out_im[ch_idx1] = tmp_im; - - IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[1][slot_idx][b2], - Cldfb_ImagBuffer_Ref_Binaural[1][slot_idx][b2], - mix_mat_re[1][ch_idx1], - mix_mat_im[1][ch_idx1], - tmp_re, - tmp_im ); - pred_out_re[ch_idx1] += tmp_re; - pred_out_im[ch_idx1] += tmp_im; + if ( hBinPostRenderer->cf_flag ) + { + pMix_mat_re_prev[ch_idx1] = hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1]; + pMix_mat_im_prev[ch_idx1] = hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1]; + mix_mat_re[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0] ) + + ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][0]; + mix_mat_re[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1] ) + + ( 1.0f - fade ) * pMix_mat_re_prev[ch_idx1][1]; + + mix_mat_im[ch_idx1][0] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0] ) + + ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][0]; + mix_mat_im[ch_idx1][1] = fade * ( hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1] ) + + ( 1.0f - fade ) * pMix_mat_im_prev[ch_idx1][1]; + } + else + { + mix_mat_re[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; + mix_mat_re[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; + mix_mat_im[ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; + mix_mat_im[ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + } } - // Apply decorrelation - if ( 1 ) +#ifndef SPLIT_REND_ZERO_OUT_YAW_D + if ( hBinPostRenderer->cf_flag ) { - tmp_re = Cldfb_RealBuffer_Ref_Binaural[0][slot_idx][b2] + Cldfb_RealBuffer_Ref_Binaural[1][slot_idx][b2]; - tmp_im = Cldfb_ImagBuffer_Ref_Binaural[0][slot_idx][b2] + Cldfb_ImagBuffer_Ref_Binaural[1][slot_idx][b2]; - - pred_out_re[0] += ( gd_cf_abs * tmp_re ); - pred_out_im[0] += ( gd_cf_abs * tmp_im ); - pred_out_re[1] += ( gd_cf * tmp_re ); - pred_out_im[1] += ( gd_cf * tmp_im ); + gd_cf = fade * hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd + + ( 1 - fade ) * hBinPostRenderer->gd_mem[pos_idx][b]; + } + else + { + gd_cf = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; } - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + gd_cf_abs = (float) fabs( gd_cf ); +#endif + + brange[0] = pBand_grouping[b]; + brange[1] = pBand_grouping[b + 1]; + for ( b2 = brange[0]; b2 < brange[1]; b2++ ) { + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + // Apply prediction matrix + IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[0][index_slot][b2], + Cldfb_ImagBuffer_Ref_Binaural[0][index_slot][b2], + mix_mat_re[0][ch_idx1], + mix_mat_im[0][ch_idx1], + tmp_re, + tmp_im ); + pred_out_re[ch_idx1] = tmp_re; + pred_out_im[ch_idx1] = tmp_im; + + IVAS_CMULT_FLOAT( Cldfb_RealBuffer_Ref_Binaural[1][index_slot][b2], + Cldfb_ImagBuffer_Ref_Binaural[1][index_slot][b2], + mix_mat_re[1][ch_idx1], + mix_mat_im[1][ch_idx1], + tmp_re, + tmp_im ); + pred_out_re[ch_idx1] += tmp_re; + pred_out_im[ch_idx1] += tmp_im; + } + +#ifndef SPLIT_REND_ZERO_OUT_YAW_D + // Apply decorrelation + if ( 1 ) + { + tmp_re = Cldfb_RealBuffer_Ref_Binaural[0][index_slot][b2] + Cldfb_RealBuffer_Ref_Binaural[1][index_slot][b2]; + tmp_im = Cldfb_ImagBuffer_Ref_Binaural[0][index_slot][b2] + Cldfb_ImagBuffer_Ref_Binaural[1][index_slot][b2]; + + pred_out_re[0] += ( gd_cf_abs * tmp_re ); + pred_out_im[0] += ( gd_cf_abs * tmp_im ); + pred_out_re[1] += ( gd_cf * tmp_re ); + pred_out_im[1] += ( gd_cf * tmp_im ); + } +#endif + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - Cldfb_RealBuffer_Recons_Binaural[pos_idx][ch_idx1][slot_idx][b2] = pred_out_re[ch_idx1]; - Cldfb_ImagBuffer_Recons_Binaural[pos_idx][ch_idx1][slot_idx][b2] = pred_out_im[ch_idx1]; + Cldfb_RealBuffer_Recons_Binaural[pos_idx][ch_idx1][index_slot][b2] = pred_out_re[ch_idx1]; + Cldfb_ImagBuffer_Recons_Binaural[pos_idx][ch_idx1][index_slot][b2] = pred_out_im[ch_idx1]; #else - Cldfb_RealBuffer_Ref_Binaural[ch_idx1][slot_idx][b2] = pred_out_re[ch_idx1]; - Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][slot_idx][b2] = pred_out_im[ch_idx1]; + Cldfb_RealBuffer_Ref_Binaural[ch_idx1][index_slot][b2] = pred_out_re[ch_idx1]; + Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][index_slot][b2] = pred_out_im[ch_idx1]; #endif + } } } } } - } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) #else - pos_idx = 0; + pos_idx = 0; #endif - { - for ( b = 0; b < num_md_bands; b++ ) { - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + for ( b = 0; b < num_md_bands; b++ ) { - hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; - hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; - hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; - hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][0]; + hBinPostRenderer->mixer_mat_re[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_re[ch_idx1][1]; + hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][0] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][0]; + hBinPostRenderer->mixer_mat_im[pos_idx][b][ch_idx1][1] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].pred_mat_im[ch_idx1][1]; + } + hBinPostRenderer->gd_mem[pos_idx][b] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; } - hBinPostRenderer->gd_mem[pos_idx][b] = hBinPostRenderer->rot_md[pos_idx][sf_idx][b].gd; } - } - hBinPostRenderer->cf_flag = 1; + hBinPostRenderer->cf_flag = 1; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - { - int16_t num_cldfb_bands; - num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { - for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + int16_t num_cldfb_bands; + num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; + for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ ) { - mvr2r( Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][slot_idx], Cldfb_RealBuffer_Ref_Binaural[ch_idx1][slot_idx], num_cldfb_bands ); - mvr2r( Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][slot_idx], Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][slot_idx], num_cldfb_bands ); + index_slot = sf_idx * num_slots + slot_idx; + for ( ch_idx1 = 0; ch_idx1 < BINAURAL_CHANNELS; ch_idx1++ ) + { + mvr2r( Cldfb_RealBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][index_slot], Cldfb_RealBuffer_Ref_Binaural[ch_idx1][index_slot], num_cldfb_bands ); + mvr2r( Cldfb_ImagBuffer_Recons_Binaural[MAX_HEAD_ROT_POSES - 1][ch_idx1][index_slot], Cldfb_ImagBuffer_Ref_Binaural[ch_idx1][index_slot], num_cldfb_bands ); + } } - } - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) - { - char fname[200] = "recons_out_pos"; - char tag[2]; - tag[0] = (char) ( '0' + pos_idx ); - tag[1] = '\0'; - strcat( fname, tag ); - strcat( fname, ".wav" ); - ivas_log_cldfb2wav_data( - Cldfb_RealBuffer_Recons_Binaural[pos_idx], - Cldfb_ImagBuffer_Recons_Binaural[pos_idx], - hBinPostRenderer->cldfbSynReconsBinDec[pos_idx], - BINAURAL_CHANNELS, - num_cldfb_bands, - 48000, - fname ); + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + char fname[200] = "recons_out_pos"; + char tag[2]; + tag[0] = (char) ( '0' + pos_idx ); + tag[1] = '\0'; + strcat( fname, tag ); + strcat( fname, ".wav" ); + ivas_log_cldfb2wav_data( + Cldfb_RealBuffer_Recons_Binaural[pos_idx], + Cldfb_ImagBuffer_Recons_Binaural[pos_idx], + hBinPostRenderer->cldfbSynReconsBinDec[pos_idx], + BINAURAL_CHANNELS, + num_cldfb_bands, + 48000, + num_slots, + sf_idx * num_slots, + fname ); + } } - } #endif + } wmops_sub_end(); return; } -void ivas_rend_CldfbSplitPostRendProcess( +static void ivas_rend_CldfbSplitPostRendProcessTdIn( BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, - const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], - float Cldfb_RealBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float output[][L_FRAME48k] ) { - int16_t sf_idx, ch_idx, index_slot, slot_idx, num_cldfb_bands; - float Cldfb_RealBuffer_sfIn[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_sfIn[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - + int16_t ch_idx, slot_idx, num_cldfb_bands; + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; num_cldfb_bands = hBinHrSplitPostRend->cldfbSyn[0]->no_channels; - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) + /* Implement CLDFB analysis */ + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) { - index_slot = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; - for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) - { - mvr2r( &Cldfb_RealBuffer_Binaural[ch_idx][index_slot][0], &Cldfb_RealBuffer_sfIn[ch_idx][slot_idx][0], num_cldfb_bands ); - mvr2r( &Cldfb_ImagBuffer_Binaural[ch_idx][index_slot][0], &Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx][0], num_cldfb_bands ); - } + cldfbAnalysis_ts( &( output[ch_idx][num_cldfb_bands * slot_idx] ), + Cldfb_RealBuffer_Binaural[ch_idx][slot_idx], + Cldfb_ImagBuffer_Binaural[ch_idx][slot_idx], + num_cldfb_bands, + hBinHrSplitPostRend->cldfbAna[ch_idx] ); } + } -#ifndef SPLIT_REND_SKIP_POST_REND - ivas_SplitRenderer_PostRenderer( - hBinHrSplitPostRend, - Cldfb_RealBuffer_sfIn, - Cldfb_ImagBuffer_sfIn, - sf_idx, - &QuaternionsPre[sf_idx], - &QuaternionsPost[sf_idx] ); -#endif + ivas_SplitRenderer_PostRenderer( + hBinHrSplitPostRend, + pMultiBinPoseData, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + QuaternionsPost ); - /* Implement CLDFB synthesis */ - for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + /* Implement CLDFB synthesis */ + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + float *RealBuffer[CLDFB_NO_COL_MAX]; + float *ImagBuffer[CLDFB_NO_COL_MAX]; + + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) { - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch_idx][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch_idx][slot_idx]; + } - index_slot = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES; + cldfbSynthesis( RealBuffer, ImagBuffer, &( output[ch_idx][0] ), num_cldfb_bands * CLDFB_NO_COL_MAX, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); + } + return; +} - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - RealBuffer[slot_idx] = Cldfb_RealBuffer_sfIn[ch_idx][slot_idx]; - ImagBuffer[slot_idx] = Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx]; - } +void ivas_rend_CldfbSplitPostRendProcess( + BIN_HR_SPLIT_POST_REND_HANDLE hBinHrSplitPostRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], + float Cldfb_RealBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer_Binaural[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float output[][L_FRAME48k], + const int16_t is_cldfb_in ) +{ + int16_t ch_idx, slot_idx, num_cldfb_bands; + num_cldfb_bands = hBinHrSplitPostRend->cldfbSyn[0]->no_channels; + + if ( is_cldfb_in == 0 ) + { + ivas_rend_CldfbSplitPostRendProcessTdIn( hBinHrSplitPostRend, pMultiBinPoseData, QuaternionsPost, output ); + return; + } + + ivas_SplitRenderer_PostRenderer( + hBinHrSplitPostRend, + pMultiBinPoseData, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + QuaternionsPost ); + + /* Implement CLDFB synthesis */ + for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) + { + float *RealBuffer[CLDFB_NO_COL_MAX]; + float *ImagBuffer[CLDFB_NO_COL_MAX]; - cldfbSynthesis( RealBuffer, ImagBuffer, &( output[ch_idx][index_slot * num_cldfb_bands] ), num_cldfb_bands * MAX_PARAM_SPATIAL_SUBFRAMES, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + { + RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch_idx][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch_idx][slot_idx]; } + + cldfbSynthesis( RealBuffer, ImagBuffer, &( output[ch_idx][0] ), num_cldfb_bands * CLDFB_NO_COL_MAX, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); } return; } + +void ivas_init_split_post_rend_handles( SPLIT_POST_REND_WRAPPER *hSplitRendWrapper ) +{ + hSplitRendWrapper->hBinHrSplitPostRend = NULL; + hSplitRendWrapper->hSplitBinLCLDDec = NULL; + ivas_init_multi_bin_pose_data( &hSplitRendWrapper->multiBinPoseData ); + return; +} #endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index f5f34302f9..456779f505 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -56,33 +56,6 @@ #define MAX_BAND_SMOOTH ( 1 ) #define SMOOTH_NORM_FACTOR ( 5.0f ) -static void ivas_mat_mult_2by2_complex( float in_re1[2][2], - float in_im1[2][2], - float in_re2[2][2], - float in_im2[2][2], - float out_re2[2][2], - float out_im2[2][2] ) -{ - int16_t i, j; - float tmp_re, tmp_im; - - for ( i = 0; i < 2; i++ ) - { - for ( j = 0; j < 2; j++ ) - { - - IVAS_CMULT_FLOAT( in_re1[i][0], in_im1[i][0], - in_re2[0][j], in_im2[0][j], tmp_re, tmp_im ); - out_re2[i][j] = tmp_re; - out_im2[i][j] = tmp_im; - IVAS_CMULT_FLOAT( in_re1[i][1], in_im1[i][1], - in_re2[1][j], in_im2[1][j], tmp_re, tmp_im ); - out_re2[i][j] += tmp_re; - out_im2[i][j] += tmp_im; - } - } - return; -} static void ivas_calc_mat_det_2by2_complex( float in_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float in_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float *det_re, @@ -286,17 +259,18 @@ static void ComputePostPredCov( } static void ComputeBandedCrossCov( - float Cldfb_RealBuffer1[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer1[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_RealBuffer2[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer2[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_RealBuffer1[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer1[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_RealBuffer2[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer2[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float out_cov_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float out_cov_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS], - int16_t num_chs, + const int16_t num_chs, const int16_t *pBand_grouping, - int16_t num_subframes, - int16_t md_band_idx, - int16_t real_only ) + const int16_t num_slots, + const int16_t start_slot_idx, + const int16_t md_band_idx, + const int16_t real_only ) { int16_t sf, cldfb_band_idx, ch_idx1, ch_idx2; int16_t brange[2]; @@ -314,7 +288,7 @@ static void ComputeBandedCrossCov( { if ( real_only == 0 ) { - for ( sf = 0; sf < num_subframes; sf++ ) + for ( sf = start_slot_idx; sf < start_slot_idx + num_slots; sf++ ) { for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) { @@ -330,7 +304,7 @@ static void ComputeBandedCrossCov( } else { - for ( sf = 0; sf < num_subframes; sf++ ) + for ( sf = start_slot_idx; sf < start_slot_idx + num_slots; sf++ ) { for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) { @@ -350,15 +324,16 @@ static void ComputeBandedCrossCov( } static void ComputeBandedCov( - float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_RealBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float out_cov_re[][BINAURAL_CHANNELS], float out_cov_im[][BINAURAL_CHANNELS], - int16_t num_chs, + const int16_t num_chs, const int16_t *pBand_grouping, - int16_t num_subframes, - int16_t md_band_idx, - int16_t real_only ) + const int16_t num_slots, + const int16_t start_slot_idx, + const int16_t md_band_idx, + const int16_t real_only ) { int16_t sf, cldfb_band_idx, ch_idx1, ch_idx2; int16_t brange[2]; @@ -376,7 +351,7 @@ static void ComputeBandedCov( { if ( ( ch_idx2 != ch_idx1 ) && ( real_only == 0 ) ) { - for ( sf = 0; sf < num_subframes; sf++ ) + for ( sf = start_slot_idx; sf < start_slot_idx + num_slots; sf++ ) { for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) { @@ -392,7 +367,7 @@ static void ComputeBandedCov( } else { - for ( sf = 0; sf < num_subframes; sf++ ) + for ( sf = start_slot_idx; sf < start_slot_idx + num_slots; sf++ ) { for ( cldfb_band_idx = brange[0]; cldfb_band_idx < brange[1]; cldfb_band_idx++ ) { @@ -473,53 +448,73 @@ static void ivas_split_rend_huffman_encode( static void ivas_split_rend_quant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, + IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) { int16_t ch1, ch2; - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + int16_t gd_idx_min; + float sign, quant_val; + + if ( pose_type == PRED_ONLY ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + if ( real_only == 1 ) { - hMd->pred_mat_re[ch1][ch2] -= fix_pos_rot_mat[ch1][ch2]; - hMd->pred_mat_re[ch1][ch2] = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( hMd->pred_mat_re[ch1][ch2], IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + sign = ( hMd->pred_mat_re[ch1][ch2] >= 0.0f ) ? 1.0f : -1.0f; + IVAS_CALCULATE_ABS( hMd->pred_mat_re[ch1][ch2], hMd->pred_mat_im[ch1][ch2], hMd->pred_mat_re[ch1][ch2] ); + hMd->pred_mat_re[ch1][ch2] *= sign; + hMd->pred_mat_im[ch1][ch2] = 0.0f; + } + } } - } - if ( real_only == 0 ) - { for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { - hMd->pred_mat_im[ch1][ch2] = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( hMd->pred_mat_im[ch1][ch2], IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + quant_val = hMd->pred_mat_re[ch1][ch2] - fix_pos_rot_mat[ch1][ch2]; + quant_val = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( quant_val, IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + hMd->pred_mat_re_idx[ch1][ch2] = (int16_t) roundf( IVAS_SPLIT_REND_PRED_1BYQ_STEP * quant_val ); + // hMd->pred_mat_re[ch1][ch2] = hMd->pred_mat_re_idx[ch1][ch2] * IVAS_SPLIT_REND_PRED_Q_STEP; } } + if ( real_only == 0 ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + quant_val = min( IVAS_SPLIT_REND_PRED_MAX_VAL, max( hMd->pred_mat_im[ch1][ch2], IVAS_SPLIT_REND_PRED_MIN_VAL ) ); + hMd->pred_mat_im_idx[ch1][ch2] = (int16_t) roundf( IVAS_SPLIT_REND_PRED_1BYQ_STEP * quant_val ); + // hMd->pred_mat_im[ch1][ch2] = hMd->pred_mat_im_idx[ch1][ch2] * IVAS_SPLIT_REND_PRED_Q_STEP; + } + } + } + } + else if ( pose_type == COM_GAIN_ONLY ) + { + quant_val = min( IVAS_SPLIT_REND_D_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_D_MIN_VAL ) ); + gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_D_1BYQ_STEP * IVAS_SPLIT_REND_D_MIN_VAL ); + hMd->gd_idx = (int16_t) roundf( IVAS_SPLIT_REND_D_1BYQ_STEP * quant_val ); + hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_D_Q_STEP; + hMd->gd_idx = hMd->gd_idx - gd_idx_min; + } + else if ( pose_type == LR_GAIN_ONLY ) + { + quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); + gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * IVAS_SPLIT_REND_PITCH_G_MIN_VAL ); + hMd->gd_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); + // hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; + hMd->gd_idx = hMd->gd_idx - gd_idx_min; + + quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd2, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); + hMd->gd2_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); + // hMd->gd2 = hMd->gd2_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; + hMd->gd2_idx = hMd->gd2_idx - gd_idx_min; } - hMd->gd = min( IVAS_SPLIT_REND_D_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_D_MIN_VAL ) ); - - ivas_quantise_real_values( &hMd->pred_mat_re[0][0], - IVAS_SPLIT_REND_PRED_QUANT_PNTS, - IVAS_SPLIT_REND_PRED_MIN_VAL, - IVAS_SPLIT_REND_PRED_MAX_VAL, - &hMd->pred_mat_re_idx[0][0], - &hMd->pred_mat_re[0][0], - BINAURAL_CHANNELS * BINAURAL_CHANNELS ); - - ivas_quantise_real_values( &hMd->pred_mat_im[0][0], - IVAS_SPLIT_REND_PRED_QUANT_PNTS, - IVAS_SPLIT_REND_PRED_MIN_VAL, - IVAS_SPLIT_REND_PRED_MAX_VAL, - &hMd->pred_mat_im_idx[0][0], - &hMd->pred_mat_im[0][0], - BINAURAL_CHANNELS * BINAURAL_CHANNELS ); - - ivas_quantise_real_values( &hMd->gd, - IVAS_SPLIT_REND_D_QUANT_PNTS, - IVAS_SPLIT_REND_D_MIN_VAL, - IVAS_SPLIT_REND_D_MAX_VAL, - &hMd->gd_idx, - &hMd->gd, - 1 ); return; } @@ -532,7 +527,7 @@ static void ComputeCoeffs( float cov_io_im[][BINAURAL_CHANNELS], float cov_oo_re[][BINAURAL_CHANNELS], BIN_HR_SPLIT_REND_MD_HANDLE hMd, - float fix_pos_rot_mat[][BINAURAL_CHANNELS], + IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only ) { float postpred_cov_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -546,328 +541,794 @@ static void ComputeCoeffs( float aa, bb, cc, dd, sign; int16_t i, j; - -#if 1 - - cov_norm_fact = GetNormFact( - cov_ii_re, - cov_ii_im, - cov_io_re, - cov_io_im, - cov_oo_re ); - - // normalize the covariance - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + if ( pose_type == PITCH_ONLY ) { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) +#if 0 + float gd_tmp; + + gd_tmp = cov_ii_re[0][0] + cov_ii_re[1][1]; + if ( gd_tmp < EPSILON ) { - cov_ii_norm_re[i][j] = cov_ii_re[i][j] * cov_norm_fact; - cov_ii_norm_im[i][j] = cov_ii_im[i][j] * cov_norm_fact; - cov_io_norm_re[i][j] = cov_io_re[i][j] * cov_norm_fact; - cov_io_norm_im[i][j] = cov_io_im[i][j] * cov_norm_fact; - cov_oo_norm_re[i][j] = cov_oo_re[i][j] * cov_norm_fact; + hMd->gd = 1.0f; + } + else + { + gd_tmp = ( cov_oo_re[0][0] + cov_oo_re[1][1] ) / gd_tmp; + hMd->gd = sqrtf( gd_tmp ); } - } - - ComputePredMat( cov_ii_norm_re, - cov_ii_norm_im, - cov_io_norm_re, - cov_io_norm_im, - hMd->pred_mat_re, - hMd->pred_mat_im, - BINAURAL_CHANNELS, - real_only ); #else + float gd_tmp[BINAURAL_CHANNELS]; + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + gd_tmp[i] = cov_ii_re[i][i]; + if ( gd_tmp[i] < EPSILON ) + { + gd_tmp[i] = 1.0f; + } + else + { + gd_tmp[i] = ( cov_oo_re[i][i] ) / gd_tmp[i]; + gd_tmp[i] = sqrtf( gd_tmp[i] ); + } + } + hMd->gd = gd_tmp[0]; + hMd->gd2 = gd_tmp[1]; #endif + } + else + { + cov_norm_fact = GetNormFact( + cov_ii_re, + cov_ii_im, + cov_io_re, + cov_io_im, + cov_oo_re ); + + // normalize the covariance + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + cov_ii_norm_re[i][j] = cov_ii_re[i][j] * cov_norm_fact; + cov_ii_norm_im[i][j] = cov_ii_im[i][j] * cov_norm_fact; + cov_io_norm_re[i][j] = cov_io_re[i][j] * cov_norm_fact; + cov_io_norm_im[i][j] = cov_io_im[i][j] * cov_norm_fact; + cov_oo_norm_re[i][j] = cov_oo_re[i][j] * cov_norm_fact; + } + } - /*TODO : change this function to real only as thats what is needed*/ - ComputePostPredCov( cov_ii_norm_re, + ComputePredMat( cov_ii_norm_re, cov_ii_norm_im, + cov_io_norm_re, + cov_io_norm_im, hMd->pred_mat_re, hMd->pred_mat_im, - postpred_cov_re, - postpred_cov_im, - BINAURAL_CHANNELS ); + BINAURAL_CHANNELS, + real_only ); - // normalize everything to +-1 range - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + + /*TODO : change this function to real only as thats what is needed*/ + ComputePostPredCov( cov_ii_norm_re, + cov_ii_norm_im, + hMd->pred_mat_re, + hMd->pred_mat_im, + postpred_cov_re, + postpred_cov_im, + BINAURAL_CHANNELS ); + + // normalize everything to +-1 range + gd = 1.0f / ( PCM16_TO_FLT_FAC ); + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { - postpred_cov_re[i][j] *= 1.0f / ( PCM16_TO_FLT_FAC ); - cov_ii_norm_re[i][j] = cov_ii_norm_re[i][j] * 1.0f / ( PCM16_TO_FLT_FAC ); - cov_oo_norm_re[i][j] = cov_oo_norm_re[i][j] * 1.0f / ( PCM16_TO_FLT_FAC ); + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + postpred_cov_re[i][j] *= gd; + cov_ii_norm_re[i][j] = cov_ii_norm_re[i][j] * gd; + cov_oo_norm_re[i][j] = cov_oo_norm_re[i][j] * gd; + } } - } - sigma_d = cov_ii_norm_re[0][0] + cov_ii_norm_re[1][1] + cov_ii_norm_re[0][1] + cov_ii_norm_re[1][0] + EPSILON; +#ifdef SPLIT_REND_ZERO_OUT_YAW_D + if ( 1 ) +#else + if ( pose_type != ANY_YAW ) +#endif + { + gd2 = 0.0f; + sigma_d = 0.0f; + hMd->gd = 0.0f; + } + else + { + + sigma_d = cov_ii_norm_re[0][0] + cov_ii_norm_re[1][1] + cov_ii_norm_re[0][1] + cov_ii_norm_re[1][0] + EPSILON; - rho_hat = max( EPSILON, sqrtf( postpred_cov_re[0][0] * postpred_cov_re[1][1] ) ); - rho_hat = postpred_cov_re[0][1] / rho_hat; - rho = max( EPSILON, sqrtf( cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1] ) ); - rho = cov_oo_norm_re[0][1] / rho; - rho_hat = min( max( rho_hat, -0.9999f ), 0.9999f ); - rho = min( max( rho, -0.9999f ), 0.9999f ); + rho_hat = max( EPSILON, sqrtf( postpred_cov_re[0][0] * postpred_cov_re[1][1] ) ); + rho_hat = postpred_cov_re[0][1] / rho_hat; + rho = max( EPSILON, sqrtf( cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1] ) ); + rho = cov_oo_norm_re[0][1] / rho; + rho_hat = min( max( rho_hat, -0.9999f ), 0.9999f ); + rho = min( max( rho, -0.9999f ), 0.9999f ); - // Compute decorrelator gain : gd2 = 0; - gd = 0; - gd2 = 0; + // Compute decorrelator gain : gd2 = 0; + gd = 0; + gd2 = 0; - aa = ( sigma_d * sigma_d ) * ( ( rho_hat * rho_hat ) - 1 ) + EPSILON; - bb = -( rho_hat * rho_hat ) * sigma_d * ( cov_oo_norm_re[0][0] + cov_oo_norm_re[1][1] ); - cc = ( rho_hat * rho_hat ) * cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1]; - cc -= cov_oo_norm_re[0][1] * cov_oo_norm_re[0][1]; + aa = ( sigma_d * sigma_d ) * ( ( rho_hat * rho_hat ) - 1 ) + EPSILON; + bb = -( rho_hat * rho_hat ) * sigma_d * ( cov_oo_norm_re[0][0] + cov_oo_norm_re[1][1] ); + cc = ( rho_hat * rho_hat ) * cov_oo_norm_re[0][0] * cov_oo_norm_re[1][1]; + cc -= cov_oo_norm_re[0][1] * cov_oo_norm_re[0][1]; - sign = +1.0f; - if ( rho < ( rho_hat - 0.0001 ) ) - { - bb -= 2 * sigma_d * cov_oo_norm_re[0][1]; - sign = -1.0f; - } - else if ( rho > ( rho_hat + 0.0001 ) ) - { - bb += 2 * sigma_d * cov_oo_norm_re[0][1]; - } - dd = bb * bb - ( 4 * aa * cc ); - if ( dd >= 0 ) - { - float gd2_1, gd2_2; - gd2_1 = ( -bb + sqrtf( dd ) ) / ( 2 * aa ); - gd2_2 = ( -bb - sqrtf( dd ) ) / ( 2 * aa ); - if ( ( gd2_1 >= 0 ) && ( gd2_2 >= 0 ) ) + sign = +1.0f; + if ( rho < ( rho_hat - 0.0001 ) ) + { + bb -= 2 * sigma_d * cov_oo_norm_re[0][1]; + sign = -1.0f; + } + else if ( rho > ( rho_hat + 0.0001 ) ) + { + bb += 2 * sigma_d * cov_oo_norm_re[0][1]; + } + dd = bb * bb - ( 4 * aa * cc ); + if ( dd >= 0 ) + { + float gd2_1, gd2_2; + gd2_1 = ( -bb + sqrtf( dd ) ) / ( 2 * aa ); + gd2_2 = ( -bb - sqrtf( dd ) ) / ( 2 * aa ); + if ( ( gd2_1 >= 0 ) && ( gd2_2 >= 0 ) ) + { + gd2 = min( gd2_1, gd2_2 ); + } + else + { + gd2 = max( 0, max( gd2_1, gd2_2 ) ); + } + gd = sign * sqrtf( gd2 ); + } + + gd = min( IVAS_SPLIT_REND_D_MAX_VAL, max( gd, IVAS_SPLIT_REND_D_MIN_VAL ) ); + hMd->gd = SPLIT_REND_DECOR_ALPHA * gd + ( 1 - SPLIT_REND_DECOR_ALPHA ) * hMd->gd; + gd2 = min( gd2, cov_oo_norm_re[0][0] / sigma_d ); + gd2 = min( gd2, cov_oo_norm_re[1][1] / sigma_d ); + } + + if ( postpred_cov_re[0][0] > EPSILON ) + { + gl2 = ( cov_oo_norm_re[0][0] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[0][0] ); + gl2 = max( gl2, 1.0f ); + gl2 = sqrtf( gl2 ); + } + else + { + gl2 = 1.0f; + } + if ( postpred_cov_re[1][1] > EPSILON ) { - gd2 = min( gd2_1, gd2_2 ); + gr2 = ( cov_oo_norm_re[1][1] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[1][1] ); + gr2 = max( gr2, 1.0f ); + gr2 = sqrtf( gr2 ); } else { - gd2 = max( 0, max( gd2_1, gd2_2 ) ); + gr2 = 1.0f; + } + + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hMd->pred_mat_re[i][0] *= gl2; + hMd->pred_mat_re[i][1] *= gr2; + } + if ( real_only == 0 ) + { + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + hMd->pred_mat_im[i][0] *= gl2; + hMd->pred_mat_im[i][1] *= gr2; + } } - gd = sign * sqrtf( gd2 ); } + return; +} - gd = min( 1.0f, max( gd, 0.0f ) ); - hMd->gd = SPLIT_REND_DECOR_ALPHA * gd + ( 1 - SPLIT_REND_DECOR_ALPHA ) * hMd->gd; - gd2 = min( gd2, cov_oo_norm_re[0][0] / sigma_d ); - gd2 = min( gd2, cov_oo_norm_re[1][1] / sigma_d ); +static void get_base2_bits( + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int16_t num_subframes, + const int16_t num_quant_strats, + const int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + const int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + const int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + const int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + const int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + const int16_t pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS] ) +{ + int16_t pred_bits, d_gain_bits, pitch_gain_bits, pose_idx, q; + IVAS_SPLIT_REND_POSE_TYPE pose_type; + pred_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_PRED_QUANT_PNTS ) ); + d_gain_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_D_QUANT_PNTS ) ); + pitch_gain_bits = d_gain_bits; - if ( postpred_cov_re[0][0] > EPSILON ) - { - gl2 = ( cov_oo_norm_re[0][0] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[0][0] ); - gl2 = max( gl2, 1.0f ); - gl2 = sqrtf( gl2 ); - } - else + for ( q = 0; q < num_quant_strats; q++ ) { - gl2 = 1.0f; - } - if ( postpred_cov_re[1][1] > EPSILON ) - { - gr2 = ( cov_oo_norm_re[1][1] - ( gd2 * sigma_d ) ) / max( EPSILON, postpred_cov_re[1][1] ); - gr2 = max( gr2, 1.0f ); - gr2 = sqrtf( gr2 ); - } - else - { - gr2 = 1.0f; + base2bits[q] = 0; } - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + for ( q = 0; q < num_quant_strats; q++ ) { - hMd->pred_mat_re[i][0] *= gl2; - hMd->pred_mat_re[i][0] = min( 2.0f, max( hMd->pred_mat_re[i][0], -2.0f ) ); - - hMd->pred_mat_re[i][1] *= gr2; - hMd->pred_mat_re[i][1] = min( 2.0f, max( hMd->pred_mat_re[i][1], -2.0f ) ); - } - if ( real_only == 0 ) - { - for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + for ( pose_idx = 0; pose_idx < pMultiBinPoseData->num_poses - 1; pose_idx++ ) { - hMd->pred_mat_im[i][0] *= gl2; - hMd->pred_mat_im[i][0] = min( 2.0f, max( hMd->pred_mat_im[i][0], -2.0f ) ); - - hMd->pred_mat_im[i][1] *= gr2; - hMd->pred_mat_im[i][1] = min( 2.0f, max( hMd->pred_mat_im[i][1], -2.0f ) ); + pose_type = hBinHrSplitPreRend->pose_type[pose_idx]; + if ( pose_type == ANY_YAW ) + { + base2bits[q] += pred_bits * pred_real_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; + base2bits[q] += pred_bits * pred_imag_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; + base2bits[q] += d_gain_bits * d_bands_yaw[q] * num_subframes; + } + else if ( pose_type == PITCH_ONLY ) + { + base2bits[q] += pitch_gain_bits * bands_pitch[q] * num_subframes; + base2bits[q] += pitch_gain_bits * bands_pitch[q] * num_subframes; + } + else + { + base2bits[q] += pred_bits * pred_real_bands_roll[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; + base2bits[q] += pred_bits * pred_imag_bands_roll[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; + } } } - ivas_split_rend_quant_md( hMd, real_only, fix_pos_rot_mat ); return; } static void ivas_SplitRenderer_code_md_base2( - BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], - BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg, - ivas_split_rend_bits_t *pBits, - int16_t sf_idx, - int16_t num_md_bands ) + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int16_t num_subframes, + const int16_t pred_real_bands_yaw, + const int16_t pred_imag_bands_yaw, + const int16_t d_bands_yaw, + const int16_t bands_pitch, + const int16_t pred_real_bands_roll, + const int16_t pred_imag_bands_roll, + ivas_split_rend_bits_t *pBits ) { - int16_t real_only, pos_idx, b, ch1, ch2; - int16_t min_pred_idx, min_gd_idx, pred_code_len, gd_code_len; + int16_t pos_idx, b, ch1, ch2, sf_idx; + int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len, num_poses; int32_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; + pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; + min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; pred_code_len = pHuff_cfg->pred_base2_code_len; gd_code_len = pHuff_cfg->gd_base2_code_len; + p_gd_code_len = pHuff_cfg->p_gd_base2_code_len; + + num_poses = pMultiBinPoseData->num_poses; - for ( b = 0; b < num_md_bands; b++ ) + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - if ( b < COMPLEX_MD_BAND_THRESH ) - { - real_only = 0; - } - else + for ( pos_idx = 0; pos_idx < num_poses - 1; pos_idx++ ) { - real_only = 1; - } + if ( hBinHrSplitPreRend->pose_type[pos_idx] == ANY_YAW ) + { + for ( b = 0; b < pred_real_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_re_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } + } + } - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) - { - hMd = &rot_md[pos_idx][sf_idx][b]; - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_imag_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_im_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } + } + } + for ( b = 0; b < d_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + code = hMd->gd_idx - min_gd_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, gd_code_len ); + } + } + else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + for ( b = 0; b < bands_pitch; b++ ) { - code = hMd->pred_mat_re_idx[ch1][ch2] - min_pred_idx; - ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + code = hMd->gd_idx - min_p_gd_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, p_gd_code_len ); + + code = hMd->gd2_idx - min_p_gd_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, p_gd_code_len ); } } - if ( real_only == 0 ) + else { - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_real_bands_roll; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_re_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } + } + } + + for ( b = 0; b < pred_imag_bands_roll; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - code = hMd->pred_mat_im_idx[ch1][ch2] - min_pred_idx; - ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + code = hMd->pred_mat_im_idx[ch1][ch2] - min_pred_idx; + ivas_split_rend_bitstream_write_int32( pBits, code, pred_code_len ); + } } } } - code = hMd->gd_idx - min_gd_idx; - ivas_split_rend_bitstream_write_int32( pBits, code, gd_code_len ); } } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG { static int num_bits = 0; - static int cntr = 0, sh_cnt = 0; + static int cntr = 0; float fnum_bits; cntr++; - sh_cnt++; - if ( sh_cnt == MAX_PARAM_SPATIAL_SUBFRAMES ) + num_bits += pBits->bits_written; + // collect bits for every second + if ( cntr == 50 ) { - num_bits += pBits->bits_written; - // collect bits for every second - if ( cntr == 200 ) - { - cntr = 0; - fnum_bits = (float) num_bits / 1000.0f; - dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); - num_bits = 0; - } - sh_cnt = 0; + cntr = 0; + fnum_bits = (float) num_bits / 1000.0f; + dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); + num_bits = 0; } } #endif return; } -static void ivas_SplitRenderer_code_md( - BIN_HR_SPLIT_REND_MD rot_md[MAX_HEAD_ROT_POSES - 1][MAX_PARAM_SPATIAL_SUBFRAMES][MAX_SPLIT_REND_MD_BANDS], - BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg, - ivas_split_rend_bits_t *pBits, - int16_t sf_idx, - int16_t num_md_bands ) +static void ivas_SplitRenderer_code_md_huff( + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const int16_t num_subframes, + const int16_t pred_real_bands_yaw, + const int16_t pred_imag_bands_yaw, + const int16_t d_bands_yaw, + const int16_t bands_pitch, + const int16_t pred_real_bands_roll, + const int16_t pred_imag_bands_roll, + ivas_split_rend_bits_t *pBits ) { - int16_t real_only, pos_idx, b, ch1, ch2; + int16_t pos_idx, b, ch1, ch2, sf_idx, num_poses; int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; int32_t code, len; BIN_HR_SPLIT_REND_MD_HANDLE hMd; - + BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; + pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; - real_only = 0; - for ( b = 0; b < num_md_bands; b++ ) - { - if ( b < COMPLEX_MD_BAND_THRESH ) - { - real_only = 0; - } - else - { - real_only = 1; - } - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) - { - hMd = &rot_md[pos_idx][sf_idx][b]; + num_poses = pMultiBinPoseData->num_poses; - ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_idx, max_pred_idx ); - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + for ( pos_idx = 0; pos_idx < num_poses - 1; pos_idx++ ) + { + if ( hBinHrSplitPreRend->pose_type[pos_idx] == ANY_YAW ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + for ( b = 0; b < pred_real_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + } + for ( b = 0; b < pred_imag_bands_yaw; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + } + for ( b = 0; b < d_bands_yaw; b++ ) { - ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_huffman_encode( &pHuff_cfg->gd, hMd->gd_idx, &code, &len ); ivas_split_rend_bitstream_write_int32( pBits, code, len ); } } - if ( real_only == 0 ) + else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_huffman_encode( &pHuff_cfg->p_gd, hMd->gd_idx, &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + + ivas_split_rend_huffman_encode( &pHuff_cfg->p_gd, hMd->gd2_idx, &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + else { - ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_idx, max_pred_idx ); - for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + for ( b = 0; b < pred_real_bands_roll; b++ ) { - for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_re_idx, sym_adj_idx, -1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) { - ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); - ivas_split_rend_bitstream_write_int32( pBits, code, len ); + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } + } + } + for ( b = 0; b < pred_imag_bands_roll; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_SplitRenderer_getdiagdiff( hMd->pred_mat_im_idx, sym_adj_idx, 1, min_pred_idx, max_pred_idx ); + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); + ivas_split_rend_bitstream_write_int32( pBits, code, len ); + } } } } - ivas_split_rend_huffman_encode( &pHuff_cfg->gd, hMd->gd_idx, &code, &len ); - ivas_split_rend_bitstream_write_int32( pBits, code, len ); } } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG { static int num_bits = 0; - static int cntr = 0, sh_cnt = 0; + static int cntr = 0; float fnum_bits; cntr++; - sh_cnt++; + num_bits += pBits->bits_written; + // collect bits for every second + if ( cntr == 50 ) + { + cntr = 0; + fnum_bits = (float) num_bits / 1000.0f; + dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); + num_bits = 0; + } + } +#endif + return; +} + +static void ivas_SplitRenderer_quant_code( + const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + ivas_split_rend_bits_t *pBits, + const int16_t low_res_pre_rend_rot, + const int32_t target_md_bits ) +{ + int16_t num_complex_bands, q, num_subframes, sf_idx, pos_idx, b, num_quant_strats; + int32_t overhead_bits, quant_strat_bits, huff_bits, start_bit; + int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; + BIN_HR_SPLIT_REND_MD_HANDLE hMd; + + if ( low_res_pre_rend_rot ) + { + num_subframes = 1; + } + else + { + num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; + } + + overhead_bits = pBits->bits_written; + + // ivas_split_rend_bitstream_write_int32( pBits, low_res_pre_rend_rot, 1 ); + ivas_split_rend_bitstream_write_int32( pBits, pMultiBinPoseData->dof, IVAS_SPLIT_REND_DOF_BITS ); + ivas_split_rend_bitstream_write_int32( pBits, pMultiBinPoseData->hq_mode, IVAS_SPLIT_REND_HQ_MODE_BITS ); + ivas_split_rend_bitstream_write_int32( pBits, (int32_t) pMultiBinPoseData->rot_axis, IVAS_SPLIT_REND_ROT_AXIS_BITS ); + + /* code ref pose*/ + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + int16_t angle; + IVAS_QUATERNION head_pos_euler; + Quat2EulerDegree( headPositions[sf_idx], &head_pos_euler.z, &head_pos_euler.y, &head_pos_euler.x ); + angle = (int16_t) roundf( head_pos_euler.x ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + + angle = (int16_t) roundf( head_pos_euler.y ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + + angle = (int16_t) roundf( head_pos_euler.z ); + angle += 180; + ivas_split_rend_bitstream_write_int32( pBits, angle, IVAS_SPLIT_REND_HEAD_POSE_BITS ); + } - if ( sh_cnt == MAX_PARAM_SPATIAL_SUBFRAMES ) + ivas_split_rend_get_quant_params( + MAX_SPLIT_REND_MD_BANDS, + pred_real_bands_yaw, + pred_imag_bands_yaw, + d_bands_yaw, + bands_pitch, + pred_real_bands_roll, + pred_imag_bands_roll, + &num_quant_strats, + &num_complex_bands ); + quant_strat_bits = (int32_t) ceilf( log2f( num_quant_strats ) ); + + overhead_bits = pBits->bits_written - overhead_bits + quant_strat_bits + 1; // 1 for base2 vs huff + get_base2_bits( + hBinHrSplitPreRend, + pMultiBinPoseData, + num_subframes, + num_quant_strats, + pred_real_bands_yaw, + pred_imag_bands_yaw, + d_bands_yaw, + bands_pitch, + pred_real_bands_roll, + pred_imag_bands_roll, + base2bits ); + + for ( q = 0; q < num_quant_strats; q++ ) + { + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - num_bits += pBits->bits_written; - // collect bits for every second - if ( cntr == 200 ) + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - cntr = 0; - fnum_bits = (float) num_bits / 1000.0f; - dbgwrite_txt( &fnum_bits, 1, "split_rend_MD_bitrate.txt", "MD bitrate (kbps)" ); - num_bits = 0; + if ( hBinHrSplitPreRend->pose_type[pos_idx] == ANY_YAW ) + { + for ( b = 0; b < pred_imag_bands_yaw[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + PRED_ONLY, + 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < pred_real_bands_yaw[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + PRED_ONLY, + 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + for ( b = 0; b < d_bands_yaw[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + COM_GAIN_ONLY, + 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + } + else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + LR_GAIN_ONLY, + 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + } + else + { + for ( b = 0; b < pred_imag_bands_roll[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + PRED_ONLY, + 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + for ( ; b < pred_real_bands_roll[q]; b++ ) + { + hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; + ivas_split_rend_quant_md( hMd, + PRED_ONLY, + 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); + } + } + } + } + + /*get base2 bits and check if its within target. if yes then code with base2 to save complexity on post renderer*/ +#if 0 + if ( target_md_bits >= ( base2bits[q] + overhead_bits ) ) + { + ivas_split_rend_bitstream_write_int32( pBits, 0, 1 ); + ivas_split_rend_bitstream_write_int32( pBits, q, quant_strat_bits ); + ivas_SplitRenderer_code_md_base2( + hBinHrSplitPreRend, + pMultiBinPoseData, + num_subframes, + pred_real_bands_yaw[q], + pred_imag_bands_yaw[q], + d_bands_yaw[q], + bands_pitch[q], + pred_real_bands_roll[q], + pred_imag_bands_roll[q], + pBits ); + break; + } + else +#endif + { + start_bit = pBits->bits_written; + ivas_split_rend_bitstream_write_int32( pBits, 1, 1 ); + ivas_split_rend_bitstream_write_int32( pBits, q, quant_strat_bits ); + huff_bits = pBits->bits_written; + ivas_SplitRenderer_code_md_huff( + hBinHrSplitPreRend, + pMultiBinPoseData, + num_subframes, + pred_real_bands_yaw[q], + pred_imag_bands_yaw[q], + d_bands_yaw[q], + bands_pitch[q], + pred_real_bands_roll[q], + pred_imag_bands_roll[q], + pBits ); + huff_bits = pBits->bits_written - huff_bits; + if ( ( target_md_bits >= ( base2bits[q] + overhead_bits ) ) || ( target_md_bits >= ( huff_bits + overhead_bits ) ) || ( q == ( num_quant_strats - 1 ) ) ) + { + if ( huff_bits > base2bits[q] ) + { + pBits->bits_written = start_bit; + ivas_split_rend_bitstream_write_int32( pBits, 0, 1 ); + ivas_split_rend_bitstream_write_int32( pBits, q, quant_strat_bits ); + ivas_SplitRenderer_code_md_base2( + hBinHrSplitPreRend, + pMultiBinPoseData, + num_subframes, + pred_real_bands_yaw[q], + pred_imag_bands_yaw[q], + d_bands_yaw[q], + bands_pitch[q], + pred_real_bands_roll[q], + pred_imag_bands_roll[q], + pBits ); + } + break; + } + pBits->bits_written = start_bit; + } + } + +#ifdef SPLIT_MD_CODING_DEBUG + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) + { + int16_t val, quant_strat, ch1, ch2; + char filename[200] = "split_md_debug_indices.bin"; + quant_strat = q; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) + { + if ( hBinHrSplitPreRend->pose_type[pos_idx] == ANY_YAW ) + { + for ( b = 0; b < pred_real_bands_yaw[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + } + for ( b = 0; b < pred_imag_bands_yaw[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + } + for ( b = 0; b < d_bands_yaw[quant_strat]; b++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) + { + for ( b = 0; b < bands_pitch[quant_strat]; b++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd_idx; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].gd2_idx; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + else + { + for ( b = 0; b < pred_real_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_re_idx[ch1][ch2]; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + } + for ( b = 0; b < pred_imag_bands_roll[quant_strat]; b++ ) + { + for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) + { + for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) + { + val = hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b].pred_mat_im_idx[ch1][ch2]; + dbgwrite( &val, sizeof( int16_t ), 1, 1, filename ); + } + } + } } - sh_cnt = 0; } } #endif + return; } + void ivas_SplitRenderer_GetRotMd( - BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ - float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - ivas_split_rend_bits_t *pBits, - int16_t sf_idx ) + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ + int16_t low_res ) { float cov_ii_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; float cov_oo_re[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; @@ -877,110 +1338,112 @@ void ivas_SplitRenderer_GetRotMd( float cov_io_im[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t real_only = 0; - int16_t pos_idx, b; - int16_t yaw_idx; - int16_t num_md_bands; + int16_t pos_idx, b, sf_idx, start_slot_idx, num_slots, num_subframes; + int16_t num_md_bands, num_poses; const int16_t *pBand_grouping = SplitRend_band_grouping; num_md_bands = MAX_SPLIT_REND_MD_BANDS; wmops_sub_start( "ivas_SplitRenderer_GetRotMd" ); + num_poses = pMultiBinPoseData->num_poses; + + if ( low_res ) + { + num_slots = CLDFB_NO_COL_MAX; + num_subframes = 1; + } + else + { + num_slots = MAX_PARAM_SPATIAL_SUBFRAMES; + num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; + } /*compute reference signal covariance*/ - for ( b = 0; b < num_md_bands; b++ ) + for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { - if ( b < COMPLEX_MD_BAND_THRESH ) - { - real_only = 0; - } - else + start_slot_idx = sf_idx * num_slots; + for ( b = 0; b < num_md_bands; b++ ) { - real_only = 1; - } - ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[0], - Cldfb_ImagBuffer_Ref_Binaural[0], - cov_ii_re, cov_ii_im, - BINAURAL_CHANNELS, - pBand_grouping, - MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); - - /*compute rotated signal covariance*/ - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) - { - ComputeBandedCrossCov( Cldfb_RealBuffer_Ref_Binaural[0], - Cldfb_ImagBuffer_Ref_Binaural[0], - Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], - Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], - cov_io_re, cov_io_im, - BINAURAL_CHANNELS, - pBand_grouping, - MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); - - ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], - Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], - cov_oo_re, cov_oo_im, + if ( b < COMPLEX_MD_BAND_THRESH ) + { + real_only = 0; + } + else + { + real_only = 1; + } + ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + cov_ii_re, cov_ii_im, BINAURAL_CHANNELS, pBand_grouping, - MAX_PARAM_SPATIAL_SUBFRAMES, b, real_only ); - - yaw_idx = ( pos_idx / ( MAX_PITCH_ANGLES * MAX_ROLL_ANGLES ) ); - ComputeCoeffs( cov_ii_re, - cov_ii_im, - cov_io_re, - cov_io_im, - cov_oo_re, - &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b], - hBinHrSplitPreRend->fix_pos_rot_mat[yaw_idx], - real_only ); - } - } + num_slots, start_slot_idx, b, real_only ); -#ifdef SPLIT_REND_BASE2_CODING - ivas_SplitRenderer_code_md_base2( - hBinHrSplitPreRend->rot_md, - &hBinHrSplitPreRend->huff_cfg, - pBits, - sf_idx, - num_md_bands ); -#else - ivas_SplitRenderer_code_md( - hBinHrSplitPreRend->rot_md, - &hBinHrSplitPreRend->huff_cfg, - pBits, - sf_idx, - num_md_bands ); -#endif + /*compute rotated signal covariance*/ + for ( pos_idx = 0; pos_idx < num_poses - 1; pos_idx++ ) + { + ComputeBandedCrossCov( Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + cov_io_re, cov_io_im, + BINAURAL_CHANNELS, + pBand_grouping, + num_slots, start_slot_idx, b, real_only ); + + ComputeBandedCov( Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + cov_oo_re, cov_oo_im, + BINAURAL_CHANNELS, + pBand_grouping, + num_slots, start_slot_idx, b, real_only ); + + ComputeCoeffs( cov_ii_re, + cov_ii_im, + cov_io_re, + cov_io_im, + cov_oo_re, + &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b], + hBinHrSplitPreRend->pose_type[pos_idx], + real_only ); + } + } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - { - int16_t num_cldfb_bands; - num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) { - char fname[200] = "rotated_ref_pos"; - char tag[2]; - tag[0] = (char) ( '0' + pos_idx ); - tag[1] = '\0'; - strcat( fname, tag ); - strcat( fname, ".wav" ); + int16_t num_cldfb_bands; + num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; + for ( pos_idx = 0; pos_idx < num_poses - 1; pos_idx++ ) + { + char fname[200] = "rotated_cldfbref_pos"; + char tag[2]; + tag[0] = (char) ( '0' + pos_idx ); + tag[1] = '\0'; + strcat( fname, tag ); + strcat( fname, ".wav" ); + ivas_log_cldfb2wav_data( + Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], + Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], + hBinHrSplitPreRend->cldfbSynRotBinDec[pos_idx], + BINAURAL_CHANNELS, + num_cldfb_bands, + 48000, + num_slots, + start_slot_idx, + fname ); + } ivas_log_cldfb2wav_data( - Cldfb_RealBuffer_Ref_Binaural[pos_idx + 1], - Cldfb_ImagBuffer_Ref_Binaural[pos_idx + 1], - hBinHrSplitPreRend->cldfbSynRotBinDec[pos_idx], + Cldfb_RealBuffer_Ref_Binaural[0], + Cldfb_ImagBuffer_Ref_Binaural[0], + hBinHrSplitPreRend->cldfbSynRotBinDec[MAX_HEAD_ROT_POSES], BINAURAL_CHANNELS, num_cldfb_bands, 48000, - fname ); + num_slots, + start_slot_idx, + "rotated_cldfbref_RefPos.wav" ); } - ivas_log_cldfb2wav_data( - Cldfb_RealBuffer_Ref_Binaural[0], - Cldfb_ImagBuffer_Ref_Binaural[0], - hBinHrSplitPreRend->cldfbSynRotBinDec[MAX_HEAD_ROT_POSES], - BINAURAL_CHANNELS, - num_cldfb_bands, - 48000, - "rotated_ref_RefPos.wav" ); - } #endif + } wmops_sub_end(); @@ -989,54 +1452,36 @@ void ivas_SplitRenderer_GetRotMd( void ivas_rend_CldfbSplitPreRendProcess( const BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t max_bands, - ivas_split_rend_bits_t *pBits ) + ivas_split_rend_bits_t *pBits, + const int32_t target_md_bits, + const int16_t low_res_pre_rend_rot ) { - int16_t sf_idx, slot_idx, ch_idx, idx, pos_idx, num_poses; -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#else - float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif - -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - num_poses = MAX_HEAD_ROT_POSES + 1; -#else - num_poses = MAX_HEAD_ROT_POSES; -#endif - for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) - { - for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) - { - for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) - { - idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; - for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) - { - mvr2r( &Cldfb_In_BinReal[pos_idx][ch_idx][idx][0], &Cldfb_RealBuffer_Binaural[pos_idx][ch_idx][slot_idx][0], max_bands ); - mvr2r( &Cldfb_In_BinImag[pos_idx][ch_idx][idx][0], &Cldfb_ImagBuffer_Binaural[pos_idx][ch_idx][slot_idx][0], max_bands ); - } - } - } + ivas_SplitRenderer_GetRotMd( + hBinHrSplitPreRend, + pMultiBinPoseData, + Cldfb_In_BinReal, + Cldfb_In_BinImag, + low_res_pre_rend_rot ); - ivas_SplitRenderer_GetRotMd( - hBinHrSplitPreRend, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - pBits, - sf_idx ); - } + ivas_SplitRenderer_quant_code( + hBinHrSplitPreRend, + headPositions, + pMultiBinPoseData, + pBits, + low_res_pre_rend_rot, + target_md_bits ); return; } ivas_error ivas_splitBinPreRendOpen( - BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend + BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG , const int32_t output_Fs @@ -1077,7 +1522,7 @@ ivas_error ivas_splitBinPreRendOpen( } #endif - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES - 1; pos_idx++ ) + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) { @@ -1087,7 +1532,8 @@ ivas_error ivas_splitBinPreRendOpen( } } } - set_fix_rotation_mat( hBinRend->fix_pos_rot_mat ); + set_fix_rotation_mat( hBinRend->fix_pos_rot_mat, pMultiBinPoseData ); + set_pose_types( hBinRend->pose_type, pMultiBinPoseData ); ivas_split_rend_init_huff_cfg( &hBinRend->huff_cfg ); *hBinHrSplitPreRend = hBinRend; return error; @@ -1121,31 +1567,44 @@ void ivas_splitBinPreRendClose( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend void ivas_init_split_rend_handles( SPLIT_REND_WRAPPER *hSplitRendWrapper ) { - hSplitRendWrapper->hBinHrSplitPostRend = NULL; hSplitRendWrapper->hBinHrSplitPreRend = NULL; hSplitRendWrapper->hCldfbHandles = NULL; - hSplitRendWrapper->hSplitBinLCLDDec = NULL; hSplitRendWrapper->hSplitBinLCLDEnc = NULL; + + ivas_init_multi_bin_pose_data( &hSplitRendWrapper->multiBinPoseData ); return; } -ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, const int32_t OutSampleRate, const IVAS_SPLIT_REND_MODE splitRendMode, const int16_t is_cldfb_in ) +ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, + const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, + const int32_t OutSampleRate, + const int16_t is_cldfb_in, + const int16_t is_pcm_out ) { ivas_error error, ch, num_ch; error = IVAS_ERR_OK; + hSplitRendWrapper->hCldfbHandles = NULL; if ( is_cldfb_in == 0 ) { if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) count_malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB handles\n" ) ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + num_ch = ( 1 + MAX_HEAD_ROT_POSES ) * BINAURAL_CHANNELS; +#else num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; +#endif for ( ch = 0; ch < num_ch; ch++ ) { hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] = NULL; } - +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + num_ch = ( 1 + hSplitRendWrapper->multiBinPoseData.num_poses ) * BINAURAL_CHANNELS; +#else + num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; +#endif for ( ch = 0; ch < num_ch; ch++ ) { if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, OutSampleRate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) @@ -1155,61 +1614,25 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, cons } } - switch ( splitRendMode ) - { - case SPLIT_REND_PRE: - - error = ivas_splitBinPreRendOpen( &hSplitRendWrapper->hBinHrSplitPreRend -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - , - OutSampleRate -#endif - ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, 384000 ); - break; - case SPLIT_REND_POST: - error = ivas_splitBinPostRendOpen( &hSplitRendWrapper->hBinHrSplitPostRend, OutSampleRate ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec, OutSampleRate, 2 ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - break; - case SPLIT_REND_COMB: - error = ivas_splitBinPreRendOpen( &hSplitRendWrapper->hBinHrSplitPreRend + error = ivas_splitBinPreRendOpen( &hSplitRendWrapper->hBinHrSplitPreRend, + &hSplitRendWrapper->multiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - , - OutSampleRate + , + OutSampleRate #endif - ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, 384000 ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - error = ivas_splitBinPostRendOpen( &hSplitRendWrapper->hBinHrSplitPostRend, OutSampleRate ); - if ( error != IVAS_ERR_OK ) - { - return error; - } - error = ivas_splitBinLCLDDecOpen( &hSplitRendWrapper->hSplitBinLCLDDec, OutSampleRate, 2 ); - break; - default: - return IVAS_ERR_INVALID_OUTPUT_FORMAT; + ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + if ( is_pcm_out == 0 ) + { + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate ) ); + if ( error != IVAS_ERR_OK ) + { + return error; + } } - return error; } @@ -1223,102 +1646,192 @@ void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ) { ivas_splitBinLCLDEncClose( &hSplitBinRend->hSplitBinLCLDEnc ); } - if ( hSplitBinRend->hBinHrSplitPostRend != NULL ) - { - ivas_splitBinPostRendClose( &hSplitBinRend->hBinHrSplitPostRend ); - } - if ( hSplitBinRend->hSplitBinLCLDDec != NULL ) - { - ivas_splitBinLCLDDecClose( &hSplitBinRend->hSplitBinLCLDDec ); - } if ( hSplitBinRend->hCldfbHandles != NULL ) { + int16_t num_ch, ch; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + num_ch = ( 1 + MAX_HEAD_ROT_POSES ) * BINAURAL_CHANNELS; +#else + num_ch = MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; +#endif + for ( ch = 0; ch < num_ch; ch++ ) + { + if ( hSplitBinRend->hCldfbHandles->cldfbAna[ch] != NULL ) + { + deleteCldfb( &hSplitBinRend->hCldfbHandles->cldfbAna[ch] ); + hSplitBinRend->hCldfbHandles->cldfbAna[ch] = NULL; + } + } + count_free( hSplitBinRend->hCldfbHandles ); hSplitBinRend->hCldfbHandles = NULL; } return; } -ivas_error ivas_renderMultiBinToSplitBinaural( +static ivas_error ivas_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + const int32_t SplitRendBitRate, ivas_split_rend_bits_t *pBits, - float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES], - const IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES], const int16_t max_bands, - float out[][L_FRAME48k] ) + float in[][L_FRAME48k], + const int16_t low_res_pre_rend_rot, + const int16_t pcm_out ) { ivas_error error; + int32_t bit_len, available_bits, target_md_bits, actual_md_bits; + int16_t num_cldfb_bands, ch, slot_idx, pos_idx, num_poses; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + float Cldfb_In_BinReal[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_In_BinImag[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#else + float Cldfb_In_BinReal[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_In_BinImag[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#endif + error = IVAS_ERR_OK; - if ( hSplitBin->hCldfbHandles != NULL ) + assert( hSplitBin->hCldfbHandles != NULL ); + num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; + num_poses = hSplitBin->multiBinPoseData.num_poses; + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { - /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ - int16_t num_cldfb_bands, ch, slot_idx, pos_idx; + float *pPcm[BINAURAL_CHANNELS]; + + char fname[200] = "rotated_ref_pos"; + char tag[2]; + tag[0] = (char) ( '0' + pos_idx ); + tag[1] = '\0'; + strcat( fname, tag ); + strcat( fname, ".wav" ); + for ( int i = 0; i < BINAURAL_CHANNELS; i++ ) + { + pPcm[i] = in[pos_idx * BINAURAL_CHANNELS + i]; + } + dbgwrite_wav( pPcm, 960, + fname, 48000, BINAURAL_CHANNELS ); + } +#endif - assert( hSplitBin->hCldfbHandles != NULL ); - num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; - /* CLDFB Analysis*/ + + /* CLDFB Analysis*/ #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES + 1; pos_idx++ ) + for ( pos_idx = 0; pos_idx < num_poses + 1; pos_idx++ ) #else - for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) #endif + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) { - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) - { - cldfbAnalysis_ts( &( out[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), - Cldfb_In_BinReal[pos_idx][ch][slot_idx], - Cldfb_In_BinImag[pos_idx][ch][slot_idx], - max_bands, - hSplitBin->hCldfbHandles->cldfbAna[ch] ); - } + cldfbAnalysis_ts( &( in[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), + Cldfb_In_BinReal[pos_idx][ch][slot_idx], + Cldfb_In_BinImag[pos_idx][ch][slot_idx], + max_bands, + hSplitBin->hCldfbHandles->cldfbAna[pos_idx * BINAURAL_CHANNELS + ch] ); } } } + target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written; ivas_rend_CldfbSplitPreRendProcess( hSplitBin->hBinHrSplitPreRend, + headPositions, + &hSplitBin->multiBinPoseData, Cldfb_In_BinReal, Cldfb_In_BinImag, - max_bands, - pBits ); - - ivas_splitBinLCLDEncProcess( - hSplitBin->hSplitBinLCLDEnc, - Cldfb_In_BinReal[0], - Cldfb_In_BinImag[0], - pBits ); + pBits, + target_md_bits, + low_res_pre_rend_rot ); + if ( pcm_out == 0 ) + { + // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; + available_bits = SplitRendBitRate * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + ivas_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0], + available_bits, + pBits ); + } - /*CLFDB decoding and SPLIT post rendering MD based adjustments*/ + /*zero pad*/ + bit_len = SplitRendBitRate / FRAMES_PER_SEC; + while ( pBits->bits_written < bit_len ) { + ivas_split_rend_bitstream_write_int32( pBits, (int32_t) 0, 1 ); + } + return error; +} - ivas_splitBinPostRendMdDec( - pBits, - hSplitBin->hBinHrSplitPostRend, -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - hSplitBin->hBinHrSplitPreRend, -#endif - MAX_SPLIT_REND_MD_BANDS ); +ivas_error ivas_renderMultiBinToSplitBinaural( + SPLIT_REND_WRAPPER *hSplitBin, + const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], + const int32_t SplitRendBitRate, + ivas_split_rend_bits_t *pBits, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t max_bands, + float out[][L_FRAME48k], + const int16_t low_res_pre_rend_rot, + const int16_t pcm_out ) +{ + ivas_error error; + int32_t bit_len, target_md_bits, actual_md_bits, available_bits; + error = IVAS_ERR_OK; - ivas_splitBinLCLDDecProcess( - hSplitBin->hSplitBinLCLDDec, - pBits, - Cldfb_In_BinReal[0], - Cldfb_In_BinImag[0] ); + set_fix_rotation_mat( hSplitBin->hBinHrSplitPreRend->fix_pos_rot_mat, &hSplitBin->multiBinPoseData ); + set_pose_types( hSplitBin->hBinHrSplitPreRend->pose_type, &hSplitBin->multiBinPoseData ); - ivas_rend_CldfbSplitPostRendProcess( - hSplitBin->hBinHrSplitPostRend, - QuaternionsPre, - QuaternionsPost, + if ( hSplitBin->hCldfbHandles != NULL ) + { + /*TD input*/ + /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ + error = ivas_renderMultiTDBinToSplitBinaural( hSplitBin, headPositions, SplitRendBitRate, pBits, max_bands, out, + low_res_pre_rend_rot, pcm_out ); + return error; + } + target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written; + ivas_rend_CldfbSplitPreRendProcess( + hSplitBin->hBinHrSplitPreRend, + headPositions, + &hSplitBin->multiBinPoseData, + Cldfb_In_BinReal, + Cldfb_In_BinImag, + pBits, + target_md_bits, + low_res_pre_rend_rot ); + + if ( pcm_out == 0 ) + { + // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; + available_bits = SplitRendBitRate * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + ivas_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal[0], Cldfb_In_BinImag[0], - out ); + available_bits, + pBits ); } + /*zero pad*/ + /*TODO: do this inside the LCLD ENC codec */ + bit_len = SplitRendBitRate / FRAMES_PER_SEC; + + while ( pBits->bits_written < bit_len ) + { + ivas_split_rend_bitstream_write_int32( pBits, (int32_t) 0, 1 ); + } return error; } #endif \ No newline at end of file diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index 9d68e424fd..ca97872929 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -49,6 +49,34 @@ #include "wmops.h" #ifdef SPLIT_REND_WITH_HEAD_ROT + +void ivas_mat_mult_2by2_complex( float in_re1[2][2], + float in_im1[2][2], + float in_re2[2][2], + float in_im2[2][2], + float out_re2[2][2], + float out_im2[2][2] ) +{ + int16_t i, j; + float tmp_re, tmp_im; + + for ( i = 0; i < 2; i++ ) + { + for ( j = 0; j < 2; j++ ) + { + + IVAS_CMULT_FLOAT( in_re1[i][0], in_im1[i][0], + in_re2[0][j], in_im2[0][j], tmp_re, tmp_im ); + out_re2[i][j] = tmp_re; + out_im2[i][j] = tmp_im; + IVAS_CMULT_FLOAT( in_re1[i][1], in_im1[i][1], + in_re2[1][j], in_im2[1][j], tmp_re, tmp_im ); + out_re2[i][j] += tmp_re; + out_im2[i][j] += tmp_im; + } + } + return; +} void ivas_split_rend_bitstream_init( ivas_split_rend_bits_t *pBits, const int32_t buf_len_bytes, uint8_t *pbuf ) { pBits->bits_buf = pbuf; @@ -143,17 +171,30 @@ void ivas_split_rend_init_huff_cfg( BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg ) ivas_split_huff_get_idx_trav_list( pHuff_cfg->gd_idx_trav, &pHuff_cfg->gd ); pHuff_cfg->gd_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->gd.sym_len ) ); + pHuff_cfg->p_gd.codebook = &ivas_split_rend_huff_p_d_consts[0][0]; + pHuff_cfg->p_gd.sym_len = IVAS_SPLIT_REND_D_QUANT_PNTS; + ivas_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->p_gd ); + ivas_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_idx_trav, &pHuff_cfg->p_gd ); + pHuff_cfg->p_gd_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->p_gd.sym_len ) ); + + pHuff_cfg->p_gd_diff.codebook = &ivas_split_rend_huff_p_d_diff_consts[0][0]; + pHuff_cfg->p_gd_diff.sym_len = IVAS_SPLIT_REND_D_QUANT_PNTS; + ivas_split_rend_huffman_dec_init_min_max_len( &pHuff_cfg->p_gd_diff ); + ivas_split_huff_get_idx_trav_list( pHuff_cfg->p_gd_diff_idx_trav, &pHuff_cfg->p_gd_diff ); + pHuff_cfg->p_gd_diff_base2_code_len = (int16_t) ceilf( log2f( pHuff_cfg->p_gd_diff.sym_len ) ); + return; } -void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS] ) +void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_CHANNELS], MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) { float yaw_a, cos_yaw, sin_yaw; int16_t pos_idx; yaw_a = 0.0f; - for ( pos_idx = 0; pos_idx < MAX_YAW_ANGLES - 1; pos_idx++ ) + + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) { - yaw_a += split_rend_relative_yaw_angles[pos_idx + 1]; + yaw_a = pMultiBinPoseData->relative_head_poses[pos_idx + 1][0]; cos_yaw = cosf( EVS_PI * yaw_a / 180.0f ); sin_yaw = sinf( EVS_PI * yaw_a / 180.0f ); sin_yaw = 0.0f; @@ -165,6 +206,31 @@ void set_fix_rotation_mat( float fix_pos_rot_mat[][BINAURAL_CHANNELS][BINAURAL_C return; } +void set_pose_types( IVAS_SPLIT_REND_POSE_TYPE pose_type[MAX_HEAD_ROT_POSES - 1], MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) +{ + int16_t pos_idx; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses - 1; pos_idx++ ) + { + if ( fabs( pMultiBinPoseData->relative_head_poses[pos_idx + 1][0] ) > EPSILON ) + { + pose_type[pos_idx] = ANY_YAW; + } + else if ( fabs( pMultiBinPoseData->relative_head_poses[pos_idx + 1][2] ) > EPSILON ) + { +#ifdef SPLIT_REND_REAL_ONLY_ROLL + pose_type[pos_idx] = PITCH_ONLY; +#else + pose_type[pos_idx] = ANY_ROLL; +#endif + } + else + { + pose_type[pos_idx] = PITCH_ONLY; + } + } + return; +} + int16_t wrap_a( int16_t val, int16_t min_val, int16_t max_val ) { if ( val < min_val ) @@ -195,10 +261,10 @@ void ivas_SplitRenderer_getdiagdiff( return; } - int32_t ivas_split_rend_bitstream_read_int32( ivas_split_rend_bits_t *pBits, int32_t bits ) { - int32_t val, k; + int32_t val, k, bit_val; + #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG assert( ( pBits->bits_written - pBits->bits_read ) >= bits ); assert( bits <= 32 ); @@ -208,10 +274,15 @@ int32_t ivas_split_rend_bitstream_read_int32( ivas_split_rend_bits_t *pBits, int val = 0; for ( k = bits - 1; k >= 0; k-- ) { +#if 0 if ( pBits->bits_buf[pBits->bits_read >> 3] & ( 1 << ( pBits->bits_read & 7 ) ) ) { val |= 1 << k; } +#else + bit_val = ( pBits->bits_buf[pBits->bits_read >> 3] & ( 1 << ( pBits->bits_read & 7 ) ) ) != 0; + val |= bit_val << k; +#endif pBits->bits_read++; } return val; @@ -246,7 +317,6 @@ void ivas_split_rend_bitstream_write_int32( ivas_split_rend_bits_t *pBits, int32 return; } - IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( const IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME], int16_t subframe_idx ) @@ -260,41 +330,293 @@ IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG void ivas_log_cldfb2wav_data( - float Cldfb_In_Real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], - float Cldfb_In_Imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], HANDLE_CLDFB_FILTER_BANK *cldfbSyn, const int16_t num_chs, const int16_t num_freq_bands, const int32_t output_Fs, + const int16_t num_slots, + const int16_t start_slot_idx, const char *filename ) { - float *RealBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; - float *ImagBuffer[MAX_PARAM_SPATIAL_SUBFRAMES]; + float *RealBuffer[CLDFB_NO_COL_MAX]; + float *ImagBuffer[CLDFB_NO_COL_MAX]; float pcm_out[BINAURAL_CHANNELS][L_FRAME48k]; float *pPcm[BINAURAL_CHANNELS]; - float Cldfb_local_Real[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_local_Imag[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_local_Real[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_local_Imag[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; int16_t sf, ch; assert( num_chs <= BINAURAL_CHANNELS ); for ( ch = 0; ch < num_chs; ch++ ) { - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + for ( sf = start_slot_idx; sf < start_slot_idx + num_slots; sf++ ) { mvr2r( Cldfb_In_Real[ch][sf], Cldfb_local_Real[ch][sf], num_freq_bands ); mvr2r( Cldfb_In_Imag[ch][sf], Cldfb_local_Imag[ch][sf], num_freq_bands ); - RealBuffer[sf] = Cldfb_local_Real[ch][sf]; - ImagBuffer[sf] = Cldfb_local_Imag[ch][sf]; + RealBuffer[sf - start_slot_idx] = Cldfb_local_Real[ch][sf]; + ImagBuffer[sf - start_slot_idx] = Cldfb_local_Imag[ch][sf]; } cldfbSynthesis( RealBuffer, ImagBuffer, &( pcm_out[ch][0] ), - num_freq_bands * MAX_PARAM_SPATIAL_SUBFRAMES, + num_freq_bands * num_slots, cldfbSyn[ch] ); pPcm[ch] = pcm_out[ch]; } - dbgwrite_wav( pPcm, num_freq_bands * MAX_PARAM_SPATIAL_SUBFRAMES, + dbgwrite_wav( pPcm, num_freq_bands * num_slots, filename, output_Fs, num_chs ); } #endif + +int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, const int16_t pcm_out ) +{ + int32_t md_bitrate; + if ( pcm_out == 1 ) + { + md_bitrate = SplitRendBitRate; + } + else + { + switch ( SplitRendBitRate ) + { + case SPLIT_REND_768k: + { + md_bitrate = 256000; + break; + } + case SPLIT_REND_512k: + { + md_bitrate = 128000; + break; + } + case SPLIT_REND_384k: + { + md_bitrate = 128000; + break; + } + default: + { + return -1; + } + } + } + return md_bitrate; +} + +int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate ) +{ + switch ( SplitRendBitRate ) + { + case SPLIT_REND_768k: + { + return IVAS_384k; + } + case SPLIT_REND_512k: + { + return IVAS_384k; + } + case SPLIT_REND_384k: + { + return IVAS_256k; + } + default: + { + return -1; + } + } +} + +void ivas_split_rend_get_quant_params( + const int16_t num_md_bands, + int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], + int16_t *num_quant_strats, + int16_t *num_complex_bands ) +{ + int16_t q; + + *num_quant_strats = IVAS_SPLIT_REND_NUM_QUANT_STRATS; + *num_complex_bands = COMPLEX_MD_BAND_THRESH_LOW; + assert( *num_complex_bands <= num_md_bands ); + + + for ( q = 0; q < *num_quant_strats; q++ ) + { + pred_real_bands_yaw[q] = num_md_bands; + pred_real_bands_roll[q] = num_md_bands; + } + pred_imag_bands_yaw[0] = num_md_bands; + pred_imag_bands_roll[0] = num_md_bands; + for ( q = 1; q < *num_quant_strats; q++ ) + { + pred_imag_bands_yaw[q] = ( q == 1 ) ? num_md_bands : *num_complex_bands; + pred_imag_bands_roll[q] = *num_complex_bands; + } + +#ifdef SPLIT_REND_ZERO_OUT_YAW_D + d_bands_yaw[0] = 0; +#else + d_bands_yaw[0] = num_md_bands; +#endif + bands_pitch[0] = num_md_bands; + for ( q = 1; q < *num_quant_strats; q++ ) + { + d_bands_yaw[q] = 0; + bands_pitch[q] = num_md_bands; + } + + return; +} + +void ivas_renderSplitGetMultiBinPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, + const IVAS_SPLIT_REND_ROT_AXIS rot_axis ) +{ + int16_t pos_idx, num_yaw_poses, num_pitch_poses, num_roll_poses; + const float *relative_yaw_angles; + const float *relative_pitch_angles; + const float *relative_roll_angles; + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + } + + num_yaw_poses = 0; + num_pitch_poses = 0; + num_roll_poses = 0; + + if ( pSplit_rend_config->dof == 1 ) + { + relative_yaw_angles = split_rend_relative_yaw_pos_angles_hq; + relative_pitch_angles = split_rend_relative_pitch_pos_angles_hq; + relative_roll_angles = split_rend_relative_roll_pos_angles_hq; + switch ( rot_axis ) + { + case DEFAULT_AXIS: + case YAW: + { + num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; + break; + } + case PITCH: + { + num_pitch_poses = SPLIT_REND_MAX_PITCH_ONLY_POSES; + break; + } + case ROLL: + { + num_roll_poses = SPLIT_REND_MAX_ROLL_ONLY_POSES; + break; + } + default: + { + assert( 0 && "unsupported rotation axis value" ); + } + } + } + else if ( pSplit_rend_config->dof == 2 ) + { + relative_yaw_angles = split_rend_relative_yaw_pos_angles_hq; + relative_pitch_angles = split_rend_relative_pitch_pos_angles_hq; + relative_roll_angles = split_rend_relative_roll_pos_angles_hq; + switch ( rot_axis ) + { + case DEFAULT_AXIS: + case YAW: + case PITCH: + case YAW_PITCH: + { + num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; + num_pitch_poses = SPLIT_REND_MAX_PITCH_ONLY_POSES; + break; + } + case ROLL: + case YAW_ROLL: + { + num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; + num_roll_poses = SPLIT_REND_MAX_ROLL_ONLY_POSES; + break; + } + case PITCH_ROLL: + { + num_pitch_poses = SPLIT_REND_MAX_PITCH_ONLY_POSES; + num_roll_poses = SPLIT_REND_MAX_ROLL_ONLY_POSES; + break; + } + default: + { + assert( 0 && "unsupported rotation axis value" ); + } + } + } + else + { + if ( pSplit_rend_config->hq_mode == 1 ) + { + relative_yaw_angles = split_rend_relative_yaw_pos_angles_hq; + relative_pitch_angles = split_rend_relative_pitch_pos_angles_hq; + relative_roll_angles = split_rend_relative_roll_pos_angles_hq; + num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; + num_pitch_poses = SPLIT_REND_MAX_PITCH_ONLY_POSES; + num_roll_poses = SPLIT_REND_MAX_ROLL_ONLY_POSES; + } + else + { + relative_yaw_angles = split_rend_relative_yaw_pos_angles; + relative_pitch_angles = split_rend_relative_pitch_pos_angles; + relative_roll_angles = split_rend_relative_roll_pos_angles; + num_yaw_poses = SPLIT_REND_MAX_YAW_ONLY_POSES; + num_pitch_poses = 1; + num_roll_poses = 1; + } + } + pMultiBinPoseData->num_poses = num_yaw_poses + num_pitch_poses + num_roll_poses + 1; + assert( pMultiBinPoseData->num_poses <= MAX_HEAD_ROT_POSES ); + + + for ( pos_idx = 0; pos_idx < num_yaw_poses; pos_idx++ ) + { + pMultiBinPoseData->relative_head_poses[pos_idx + 1][0] = relative_yaw_angles[pos_idx]; + } + for ( pos_idx = 0; pos_idx < num_pitch_poses; pos_idx++ ) + { + pMultiBinPoseData->relative_head_poses[pos_idx + num_yaw_poses + 1][1] = relative_pitch_angles[pos_idx]; + } + for ( pos_idx = 0; pos_idx < num_roll_poses; pos_idx++ ) + { + pMultiBinPoseData->relative_head_poses[pos_idx + num_yaw_poses + num_pitch_poses + 1][2] = relative_roll_angles[pos_idx]; + } + pMultiBinPoseData->dof = pSplit_rend_config->dof; + pMultiBinPoseData->hq_mode = pSplit_rend_config->hq_mode; + pMultiBinPoseData->rot_axis = rot_axis; + + return; +} + +void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) +{ + int16_t pos_idx; + + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + pMultiBinPoseData->relative_head_poses[pos_idx][0] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][1] = 0.0f; + pMultiBinPoseData->relative_head_poses[pos_idx][2] = 0.0f; + } + pMultiBinPoseData->num_poses = 1; + pMultiBinPoseData->dof = 3; + pMultiBinPoseData->hq_mode = 0; + pMultiBinPoseData->rot_axis = DEFAULT_AXIS; + return; +} #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 098ecf562b..0e163ea100 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -48,6 +48,8 @@ #include #include +//#define ROTATE_CREND_IN_CLDFB_DOMAIN + /* 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 ) @@ -92,7 +94,7 @@ typedef struct const EFAP_WRAPPER *pEfapOutWrapper; const IVAS_REND_HeadRotData *pHeadRotData; #ifdef SPLIT_REND_WITH_HEAD_ROT - const IVAS_SPLIT_REND_MODE *pSplitRendMode; + const RENDER_CONFIG_HANDLE *hhRendererConfig; #endif /* TODO @Philips : would this be a better place to store the render config data? * bearing in mind we could have multiple inputs to the renderer, we might neeed to accomodate @@ -148,9 +150,21 @@ typedef struct CLDFB_REND_WRAPPER cldfbRendWrapper; SPLIT_REND_WRAPPER splitRendWrapper; #endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + rotation_gains rot_gains_prev[MAX_HEAD_ROT_POSES]; +#else rotation_gains rot_gains_prev; +#endif } input_sba; +#ifdef SPLIT_REND_WITH_HEAD_ROT +typedef struct +{ + input_base base; + SPLIT_POST_REND_WRAPPER splitPostRendWrapper; +} input_split_post_rend; +#endif + /* Due to API of some rendering methods, the renderer has to use the decoder struct. Only struct members relevant for rendering will be initialized, therefore typedef as "dummy" decoder struct */ typedef Decoder_Struct DecoderDummy; @@ -176,6 +190,9 @@ struct IVAS_REND input_mc inputsMc[RENDERER_MAX_MC_INPUTS]; input_sba inputsSba[RENDERER_MAX_SBA_INPUTS]; input_masa inputsMasa[RENDERER_MAX_MASA_INPUTS]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + input_split_post_rend inputsSplitPost[RENDERER_MAX_BIN_INPUTS]; +#endif /* TODO @Philips - inputConfig should not be stored here, but read from e.g. input_mc->input_base.inConfig, please remove this */ IVAS_REND_AudioConfig inputConfig; @@ -184,10 +201,6 @@ struct IVAS_REND IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; IVAS_REND_HeadRotData headRotData; -#ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_SPLIT_REND_MODE splitRendMode; -#endif - int8_t rendererConfigEnabled; RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ }; @@ -209,6 +222,32 @@ static float *getSmplPtr( return buffer.data + chnlIdx * buffer.config.numSamplesPerChannel + smplIdx; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static void convertBitsBufferToInternalBitsBuff( + const IVAS_REND_BitstreamBuffer outBits, + ivas_split_rend_bits_t *hBits ) +{ + hBits->bits_buf = outBits.bits; + hBits->bits_read = outBits.config.bitsRead; + hBits->bits_written = outBits.config.bitsWritten; + hBits->buf_len = outBits.config.bufLenInBytes; + + return; +} + +static void convertInternalBitsBuffToBitsBuffer( + IVAS_REND_BitstreamBuffer *hOutBits, + const ivas_split_rend_bits_t bits ) +{ + hOutBits->bits = bits.bits_buf; + hOutBits->config.bitsRead = bits.bits_read; + hOutBits->config.bitsWritten = bits.bits_written; + hOutBits->config.bufLenInBytes = bits.buf_len; + + return; +} +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT static void copyBufferToCLDFBarray( const IVAS_REND_AudioBuffer buffer, @@ -241,6 +280,38 @@ static void copyBufferToCLDFBarray( return; } + +static void accumulateCLDFBArrayToBuffer( + float re[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float im[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + IVAS_REND_AudioBuffer *buffer ) +{ + uint32_t smplIdx, slotIdx; + uint32_t numCldfbSamples, num_bands; + uint32_t chnlIdx; + float *writePtr; + + assert( ( buffer->config.is_cldfb == 1 ) && "for time domain input call copyBufferTo2dArray()" ); + writePtr = buffer->data; + numCldfbSamples = ( (uint32_t) buffer->config.numSamplesPerChannel ) >> 1; + num_bands = numCldfbSamples / CLDFB_NO_COL_MAX; + for ( chnlIdx = 0; chnlIdx < (uint32_t) buffer->config.numChannels; ++chnlIdx ) + { + for ( slotIdx = 0; slotIdx < CLDFB_NO_COL_MAX; ++slotIdx ) + { + for ( smplIdx = 0; smplIdx < num_bands; ++smplIdx ) + { + *writePtr++ += re[chnlIdx][slotIdx][smplIdx]; + } + for ( smplIdx = 0; smplIdx < num_bands; ++smplIdx ) + { + *writePtr++ += im[chnlIdx][slotIdx][smplIdx]; + } + } + } + + return; +} #endif static void copyBufferTo2dArray( @@ -372,6 +443,10 @@ static AUDIO_CONFIG rendAudioConfigToIvasAudioConfig( // VE2AT: similar is defin return AUDIO_CONFIG_BINAURAL; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: return AUDIO_CONFIG_BINAURAL_ROOM; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + return AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB; +#endif case IVAS_REND_AUDIO_CONFIG_MASA1: return AUDIO_CONFIG_MASA1; case IVAS_REND_AUDIO_CONFIG_MASA2: @@ -401,6 +476,10 @@ static ivas_error validateOutputAudioConfig( case IVAS_REND_AUDIO_CONFIG_HOA3: case IVAS_REND_AUDIO_CONFIG_BINAURAL: case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#endif return IVAS_ERR_OK; default: break; @@ -453,6 +532,10 @@ ivas_error getAudioConfigNumChannels( case IVAS_REND_AUDIO_CONFIG_STEREO: case IVAS_REND_AUDIO_CONFIG_BINAURAL: case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#endif case IVAS_REND_AUDIO_CONFIG_MASA2: *numChannels = 2; break; @@ -498,6 +581,10 @@ AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( return AUDIO_CONFIG_BINAURAL; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: return AUDIO_CONFIG_BINAURAL_ROOM; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + return AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB; +#endif case IVAS_REND_AUDIO_CONFIG_5_1: return AUDIO_CONFIG_5_1; case IVAS_REND_AUDIO_CONFIG_7_1: @@ -889,10 +976,7 @@ static void initHeadRotation( hIvasRend->headRotData.headPositions[i] = quaternionInit(); } #ifdef SPLIT_REND_WITH_HEAD_ROT - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) - { - hIvasRend->headRotData.headPositionsPostRend[i] = quaternionInit(); - } + hIvasRend->headRotData.sr_pose_pred_axis = DEFAULT_AXIS; #endif return; @@ -974,7 +1058,7 @@ static rendering_context getRendCtx( ctx.pEfapOutWrapper = &hIvasRend->efapOutWrapper; ctx.pHeadRotData = &hIvasRend->headRotData; #ifdef SPLIT_REND_WITH_HEAD_ROT - ctx.pSplitRendMode = &hIvasRend->splitRendMode; + ctx.hhRendererConfig = &hIvasRend->hRendererConfig; #endif return ctx; @@ -997,7 +1081,15 @@ static CREND_WRAPPER defaultCrendWrapper( { CREND_WRAPPER w; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t i; + for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + { + w.hCrend[i] = NULL; + } +#else w.hCrend = NULL; +#endif w.hHrtfCrend = NULL; w.binaural_latency_ns = 0; @@ -1038,7 +1130,12 @@ static ivas_error setRendInputActiveIsm( IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, - *rendCtx.pOutSampleRate ); + *rendCtx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); } if ( error != IVAS_ERR_OK ) { @@ -1058,10 +1155,17 @@ static void clearInputIsm( initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( inputIsm->crendWrapper.hCrend[0] != NULL ) + { + ivas_rend_closeCrend( &inputIsm->crendWrapper, 0 ); + } +#else if ( inputIsm->crendWrapper.hCrend != NULL ) { ivas_rend_closeCrend( &inputIsm->crendWrapper ); } +#endif if ( inputIsm->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); @@ -1571,10 +1675,17 @@ static ivas_error initMcBinauralRendering( ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); inputMc->tdRendWrapper.hHrtfTD = NULL; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( inputMc->crendWrapper.hCrend[0] != NULL ) + { + ivas_rend_closeCrend( &inputMc->crendWrapper, 0 ); + } +#else if ( inputMc->crendWrapper.hCrend != NULL ) { ivas_rend_closeCrend( &inputMc->crendWrapper ); } +#endif outSampleRate = *inputMc->base.ctx.pOutSampleRate; @@ -1612,7 +1723,12 @@ static ivas_error initMcBinauralRendering( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_REND_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, - outSampleRate ) ) != IVAS_ERR_OK ) + outSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -1729,10 +1845,17 @@ static void clearInputMc( { efap_free_data( &inputMc->efapInWrapper.hEfap ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( inputMc->crendWrapper.hCrend[0] != NULL ) + { + ivas_rend_closeCrend( &inputMc->crendWrapper, 0 ); + } +#else if ( inputMc->crendWrapper.hCrend != NULL ) { ivas_rend_closeCrend( &inputMc->crendWrapper ); } +#endif if ( inputMc->tdRendWrapper.hBinRendererTd != NULL ) { ivas_td_binaural_close( &inputMc->tdRendWrapper.hBinRendererTd ); @@ -1830,6 +1953,43 @@ static ivas_error initSbaPanGainsForSbaOut( return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error +updateSplitPostRendPanGains( + input_split_post_rend *inputSplitPostRend, + const IVAS_REND_AudioConfig outConfig, + RENDER_CONFIG_DATA *hRendCfg ) +{ + ivas_error error; + rendering_context rendCtx; + int16_t numOutChannels; + getAudioConfigNumChannels( outConfig, &numOutChannels ); + + rendCtx = inputSplitPostRend->base.ctx; + ivas_renderSplitGetMultiBinPoseData( + &hRendCfg->split_rend_config, + &inputSplitPostRend->splitPostRendWrapper.multiBinPoseData, + rendCtx.pHeadRotData->sr_pose_pred_axis ); + + error = ivas_splitBinPostRendOpen( &inputSplitPostRend->splitPostRendWrapper.hBinHrSplitPostRend, + &inputSplitPostRend->splitPostRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate, ( inputSplitPostRend->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + if ( inputSplitPostRend->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + error = ivas_splitBinLCLDDecOpen( &inputSplitPostRend->splitPostRendWrapper.hSplitBinLCLDDec, *rendCtx.pOutSampleRate, numOutChannels ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + + return IVAS_ERR_OK; +} +#endif static ivas_error updateSbaPanGains( input_sba *inputSba, @@ -1857,24 +2017,70 @@ updateSbaPanGains( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( *rendCtx.pSplitRendMode ) != SPLIT_REND_DISABLED ) + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + { + int16_t is_cldfb_in; + assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural mode is currently supported with HOA3 input and 48k sampling rate only" ); + is_cldfb_in = 1; + ivas_renderSplitGetMultiBinPoseData( + &rendCtx.hhRendererConfig[0]->split_rend_config, + &inputSba->splitRendWrapper.multiBinPoseData, + rendCtx.pHeadRotData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hRendCfg->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) + + { + error = ivas_rend_openMultiBinCrend( &inputSba->crendWrapper, inConfig, outConfig, + &inputSba->splitRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + is_cldfb_in = 0; + } + else +#endif + { + error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, hRendCfg, + &inputSba->splitRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + is_cldfb_in = 1; + } + error = ivas_split_renderer_open( &inputSba->splitRendWrapper, + &inputSba->base.ctx.hhRendererConfig[0]->split_rend_config, + *rendCtx.pOutSampleRate, is_cldfb_in, ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + break; + } +#endif + case IVAS_REND_AUDIO_CONFIG_BINAURAL: +#ifdef DEBUGGING + if ( hRendCfg->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) + { - if ( ( *rendCtx.pSplitRendMode ) != SPLIT_REND_POST ) + error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, hRendCfg, + &inputSba->splitRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate ); + if ( error != IVAS_ERR_OK ) { - error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, SPLIT_REND_PRE, hRendCfg, *rendCtx.pOutSampleRate ); - if ( error != IVAS_ERR_OK ) - { - return error; - } + return error; } - error = ivas_split_renderer_open( &inputSba->splitRendWrapper, *rendCtx.pOutSampleRate, *rendCtx.pSplitRendMode, 1 ); } else #endif { - error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, *rendCtx.pOutSampleRate ); + error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, *rendCtx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); } break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: @@ -1882,7 +2088,12 @@ updateSbaPanGains( { return error; } - error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, *rendCtx.pOutSampleRate ); + error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, *rendCtx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -1900,6 +2111,33 @@ updateSbaPanGains( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error setRendInputActiveSplitPostRend( + void *input, + const IVAS_REND_AudioConfig inConfig, + const IVAS_REND_InputId id, + RENDER_CONFIG_DATA *hRendCfg ) +{ + ivas_error error; + rendering_context rendCtx; + IVAS_REND_AudioConfig outConfig; + input_split_post_rend *inputSplitPostRend; + + inputSplitPostRend = (input_split_post_rend *) input; + rendCtx = inputSplitPostRend->base.ctx; + outConfig = *rendCtx.pOutConfig; + + initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx ); + + if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) + { + return error; + } + + return error; +} +#endif + static ivas_error setRendInputActiveSba( void *input, const IVAS_REND_AudioConfig inConfig, @@ -1910,6 +2148,9 @@ static ivas_error setRendInputActiveSba( rendering_context rendCtx; IVAS_REND_AudioConfig outConfig; input_sba *inputSba; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx; +#endif inputSba = (input_sba *) input; rendCtx = inputSba->base.ctx; @@ -1918,7 +2159,14 @@ static ivas_error setRendInputActiveSba( initRendInputBase( &inputSba->base, inConfig, id, rendCtx ); setZeroPanMatrix( inputSba->hoaDecMtx ); inputSba->crendWrapper = defaultCrendWrapper(); +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + initRotGains( inputSba->rot_gains_prev[pos_idx] ); + } +#else initRotGains( inputSba->rot_gains_prev ); +#endif if ( ( error = updateSbaPanGains( inputSba, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { @@ -1928,20 +2176,54 @@ static ivas_error setRendInputActiveSba( return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static void clearInputSplitRend( + input_split_post_rend *inputSplitRend ) +{ + // rendering_context rendCtx; + + // rendCtx = inputSplitRend->base.ctx; + + if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) + { + ivas_splitBinPostRendClose( &inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend ); + } + if ( inputSplitRend->splitPostRendWrapper.hSplitBinLCLDDec != NULL ) + { + ivas_splitBinLCLDDecClose( &inputSplitRend->splitPostRendWrapper.hSplitBinLCLDDec ); + } + + return; +} + +#endif static void clearInputSba( input_sba *inputSba ) { rendering_context rendCtx; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx; +#endif rendCtx = inputSba->base.ctx; initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); /* Free input's internal handles */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + if ( inputSba->crendWrapper.hCrend[pos_idx] != NULL ) + { + ivas_rend_closeCrend( &inputSba->crendWrapper, pos_idx ); + } + } +#else if ( inputSba->crendWrapper.hCrend != NULL ) { ivas_rend_closeCrend( &inputSba->crendWrapper ); } +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT if ( inputSba->cldfbRendWrapper.hCldfbRend != NULL ) { @@ -2119,7 +2401,11 @@ static ivas_error initMasaDummyDecForBinauralOut( input_masa *inputMasa, IVAS_RE decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), output_config ); - if ( output_config == AUDIO_CONFIG_BINAURAL ) + if ( output_config == AUDIO_CONFIG_BINAURAL +#ifdef SPLIT_REND_WITH_HEAD_ROT + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#endif + ) { decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -2378,17 +2664,15 @@ static void clearInputMasa( input_masa *inputMasa ) ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, - const IVAS_REND_AudioConfig outConfig -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - IVAS_SPLIT_REND_MODE splitRendMode -#endif -) + const IVAS_REND_AudioConfig outConfig ) { int16_t i; IVAS_REND_HANDLE hIvasRend; ivas_error error; int16_t numOutChannels; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx; +#endif /*-----------------------------------------------------------------* * Validate function arguments @@ -2423,9 +2707,6 @@ ivas_error IVAS_REND_Open( #ifdef DEBUGGING hIvasRend->numClipping = 0; #endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - hIvasRend->splitRendMode = splitRendMode; -#endif /* Initialize limiter */ if ( ( error = IVAS_REND_NumOutChannels( hIvasRend, &numOutChannels ) ) != IVAS_ERR_OK ) @@ -2444,20 +2725,42 @@ 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 SPLIT_REND_WITH_HEAD_ROT + /* why not use defaultCrendWrapper() ??*/ + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + hIvasRend->inputsIsm[i].crendWrapper.hCrend[pos_idx] = NULL; + } +#else hIvasRend->inputsIsm[i].crendWrapper.hCrend = NULL; +#endif hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + hIvasRend->inputsMc[i].crendWrapper.hCrend[pos_idx] = NULL; + } +#else hIvasRend->inputsMc[i].crendWrapper.hCrend = 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 SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < MAX_HEAD_ROT_POSES; pos_idx++ ) + { + hIvasRend->inputsSba[i].crendWrapper.hCrend[pos_idx] = NULL; + } +#else hIvasRend->inputsSba[i].crendWrapper.hCrend = NULL; +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; ivas_init_split_rend_handles( &hIvasRend->inputsSba[i].splitRendWrapper ); @@ -2472,6 +2775,16 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) + { + initRendInputBase( &hIvasRend->inputsSplitPost[i].base, + IVAS_REND_AUDIO_CONFIG_UNKNOWN, + 0, + getRendCtx( hIvasRend ) ); + ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper ); + } +#endif return IVAS_ERR_OK; } @@ -2699,6 +3012,15 @@ static ivas_error getInputById( } pInputBase = &hIvasRend->inputsMasa[inputIndex].base; break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: + if ( inputIndex > RENDERER_MAX_BIN_INPUTS ) + { + return IVAS_ERR_INVALID_INPUT_ID; + } + pInputBase = &hIvasRend->inputsSplitPost[inputIndex].base; + break; +#endif default: return IVAS_ERR_INVALID_INPUT_ID; } @@ -2764,6 +3086,15 @@ static ivas_error getConstInputById( } pInputBase = &hIvasRend->inputsMasa[inputIndex].base; break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: + if ( inputIndex > RENDERER_MAX_BIN_INPUTS ) + { + return IVAS_ERR_INVALID_INPUT_ID; + } + pInputBase = &hIvasRend->inputsSplitPost[inputIndex].base; + break; +#endif default: return IVAS_ERR_INVALID_INPUT_ID; } @@ -2868,6 +3199,14 @@ ivas_error IVAS_REND_AddInput( inputStructSize = sizeof( *hIvasRend->inputsMasa ); activateInput = setRendInputActiveMasa; break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: + maxNumInputsOfType = RENDERER_MAX_BIN_INPUTS; + inputsArray = hIvasRend->inputsSplitPost; + inputStructSize = sizeof( *hIvasRend->inputsSplitPost ); + activateInput = setRendInputActiveSplitPostRend; + break; +#endif default: return IVAS_ERR_INVALID_INPUT_FORMAT; } @@ -3065,6 +3404,11 @@ ivas_error IVAS_REND_RemoveInput( case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: clearInputMasa( (input_masa *) inputBase ); break; +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: + clearInputSplitRend( (input_split_post_rend *) inputBase ); + break; +#endif default: return IVAS_ERR_INVALID_INPUT_FORMAT; } @@ -3151,26 +3495,49 @@ ivas_error IVAS_REND_GetDelay( if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hIvasRend->inputsSba[i].splitRendWrapper.hBinHrSplitPostRend != NULL ) + if ( hIvasRend->inputsSba[i].splitRendWrapper.hBinHrSplitPreRend != NULL ) { - latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; - latency_ns += IVAS_FB_DEC_DELAY_NS; +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( hIvasRend->hRendererConfig->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) + { + latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; + } + else +#endif + { + latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; + } *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); } else if ( hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend != NULL ) { - latency_ns = 0; + latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; + latency_ns += IVAS_FB_DEC_DELAY_NS; *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); } + else #endif { latency_ns = hIvasRend->inputsSba[i].crendWrapper.binaural_latency_ns; +#ifdef ROTATE_CREND_IN_CLDFB_DOMAIN + latency_ns += IVAS_FB_DEC_DELAY_NS; +#endif *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); } } } - - for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ ) + { + if ( hIvasRend->inputsSplitPost[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + { + latency_ns = IVAS_FB_DEC_DELAY_NS; + *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); + } + } +#endif + + for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { if ( hIvasRend->inputsMasa[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { @@ -3347,6 +3714,24 @@ ivas_error IVAS_REND_InitConfig( IVAS_REND_HANDLE st, return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static int16_t is_SplitRend_BitRate( const int32_t splitRendBitRate ) +{ + int16_t j; + + j = 0; + while ( j < SIZE_SPLIT_REND_BRATE_TBL && splitRendBitRate != split_rend_brate_tbl[j] ) + { + j++; + } + if ( j >= SIZE_SPLIT_REND_BRATE_TBL ) + { + return 0; + } + return 1; +} +#endif + int16_t IVAS_REND_GetRenderConfig( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ @@ -3360,7 +3745,7 @@ int16_t IVAS_REND_GetRenderConfig( } hRCin = hIvasRend->hRendererConfig; -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) switch ( hRCin->renderer_type_override ) { case RENDER_TYPE_OVERRIDE_CREND: @@ -3385,6 +3770,13 @@ int16_t IVAS_REND_GetRenderConfig( 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 SPLIT_REND_WITH_HEAD_ROT + hRCout->split_rend_config.splitRendBitRate = SPLIT_REND_768k; + hRCout->split_rend_config.dof = 3; + hRCout->split_rend_config.hq_mode = 0; + hRCout->split_rend_config.codec_delay_ms = 0; +#endif + return IVAS_ERR_OK; } @@ -3402,7 +3794,7 @@ int16_t IVAS_REND_FeedRenderConfig( } hRenderConfig = hIvasRend->hRendererConfig; -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) hRenderConfig->renderer_type_override = RENDER_TYPE_OVERRIDE_NONE; if ( renderConfig.renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_FASTCONV ) { @@ -3423,16 +3815,22 @@ int16_t IVAS_REND_FeedRenderConfig( 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 SPLIT_REND_WITH_HEAD_ROT + hRenderConfig->split_rend_config.splitRendBitRate = renderConfig.split_rend_config.splitRendBitRate; + hRenderConfig->split_rend_config.dof = renderConfig.split_rend_config.dof; + hRenderConfig->split_rend_config.hq_mode = renderConfig.split_rend_config.hq_mode; + hRenderConfig->split_rend_config.codec_delay_ms = renderConfig.split_rend_config.codec_delay_ms; +#endif + return IVAS_ERR_OK; } - ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] #ifdef SPLIT_REND_WITH_HEAD_ROT , - const IVAS_SPLIT_REND_MODE splitRendMode + IVAS_SPLIT_REND_ROT_AXIS rot_axis #endif ) { @@ -3454,29 +3852,40 @@ ivas_error IVAS_REND_SetHeadRotation( if ( headRot == NULL ) { - hIvasRend->headRotData.headRotEnabled = 0; - } - else - { - hIvasRend->headRotData.headRotEnabled = 1; #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( splitRendMode == SPLIT_REND_POST ) + if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { + hIvasRend->headRotData.headRotEnabled = 1; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { - hIvasRend->headRotData.headPositionsPostRend[i] = headRot[i]; + hIvasRend->headRotData.headPositions[i].w = -3.0f; + hIvasRend->headRotData.headPositions[i].x = 0.0f; + hIvasRend->headRotData.headPositions[i].y = 0.0f; + hIvasRend->headRotData.headPositions[i].z = 0.0f; } } else + { + hIvasRend->headRotData.headRotEnabled = 0; + } +#else + hIvasRend->headRotData.headRotEnabled = 0; #endif + } + else + { + hIvasRend->headRotData.headRotEnabled = 1; + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) - { - hIvasRend->headRotData.headPositions[i] = headRot[i]; - } + hIvasRend->headRotData.headPositions[i] = headRot[i]; } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + hIvasRend->headRotData.sr_pose_pred_axis = rot_axis; +#endif + return IVAS_ERR_OK; } @@ -3678,6 +4087,92 @@ static ivas_error rotateFrameMc( return IVAS_ERR_OK; } +#ifdef ROTATE_CREND_IN_CLDFB_DOMAIN +static HANDLE_CLDFB_FILTER_BANK rotateFrameSbacldfb_cldfbAna[16]; +static HANDLE_CLDFB_FILTER_BANK rotateFrameSbacldfb_cldfbSyn[16]; +static ivas_error rotateFrameSbacldfb( + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ + rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ + IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ +) +{ + float tmpCrendBuffer[16][960]; + int16_t ch_idx, slot_idx, num_cldfb_bands, num_chs; + float Cldfb_RealBuffer_Binaural[16][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[16][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Rmat_local[3][3]; + + num_chs = outAudio.config.numChannels; + if ( frame == 0 ) + { + for ( int16_t ch = 0; ch < num_chs; ch++ ) + { + openCldfb( &( rotateFrameSbacldfb_cldfbAna[ch] ), CLDFB_ANALYSIS, 48000, CLDFB_PROTOTYPE_5_00MS ); + openCldfb( &( rotateFrameSbacldfb_cldfbSyn[ch] ), CLDFB_SYNTHESIS, 48000, CLDFB_PROTOTYPE_5_00MS ); + } + } + + num_cldfb_bands = CLDFB_NO_CHANNELS_MAX; + + copyBufferTo2dArray( inAudio, tmpCrendBuffer ); + + for ( int16_t sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + /* Implement CLDFB analysis */ + for ( ch_idx = 0; ch_idx < num_chs; ch_idx++ ) + { + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + int16_t idx = sf * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; + cldfbAnalysis_ts( &( tmpCrendBuffer[ch_idx][num_cldfb_bands * idx] ), + Cldfb_RealBuffer_Binaural[ch_idx][slot_idx], + Cldfb_ImagBuffer_Binaural[ch_idx][slot_idx], + num_cldfb_bands, + rotateFrameSbacldfb_cldfbAna[ch_idx] ); + } + } + + QuatToRotMat( headRotData->headPositions[sf], Rmat_local ); + rotateFrame_shd_cldfb( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Rmat_local, num_chs, 3 ); + + /* Implement CLDFB synthesis */ + for ( ch_idx = 0; ch_idx < num_chs; ch_idx++ ) + { + float *RealBuffer[CLDFB_NO_COL_MAX]; + float *ImagBuffer[CLDFB_NO_COL_MAX]; + int16_t idx = sf * num_cldfb_bands * MAX_PARAM_SPATIAL_SUBFRAMES; + + for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) + { + RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch_idx][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch_idx][slot_idx]; + } + + cldfbSynthesis( RealBuffer, ImagBuffer, &( tmpCrendBuffer[ch_idx][idx] ), num_cldfb_bands * MAX_PARAM_SPATIAL_SUBFRAMES, rotateFrameSbacldfb_cldfbSyn[ch_idx] ); + } + } + + + { + int16_t smplIdx, chnlIdx; + float *writePtr; + + writePtr = outAudio.data; + for ( chnlIdx = 0; chnlIdx < outAudio.config.numChannels; ++chnlIdx ) + { + for ( smplIdx = 0; smplIdx < outAudio.config.numSamplesPerChannel; ++smplIdx ) + { + *writePtr++ = tmpCrendBuffer[chnlIdx][smplIdx]; + } + } + } + + return IVAS_ERR_OK; +} +#endif + static ivas_error rotateFrameSba( IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ @@ -3738,7 +4233,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++ ) { @@ -3747,6 +4253,7 @@ static ivas_error rotateFrameSba( } m1 = m2; m2 += 2 * ( l + 1 ) + 1; +#endif } /*unoptimized code for reference (full matrix multiplication)*/ @@ -3897,7 +4404,12 @@ static ivas_error renderIsmToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); - ivas_rend_crendProcess( &ismInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, tmpCrendBuffer, *ismInput->base.ctx.pOutSampleRate ); + ivas_rend_crendProcess( &ismInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, tmpCrendBuffer, *ismInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); @@ -4170,7 +4682,12 @@ static ivas_error renderMcToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -4222,7 +4739,12 @@ static ivas_error renderMcToBinauralRoom( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, mcInput->base.inConfig, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -4289,7 +4811,12 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( &mcInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -4481,37 +5008,164 @@ static ivas_error renderSbaToSba( return IVAS_ERR_OK; } + #ifdef SPLIT_REND_WITH_HEAD_ROT -static ivas_error renderMultiBinToSplitBinaural( - SPLIT_REND_WRAPPER *hSplitBin, - ivas_split_rend_bits_t *pBits, - float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const IVAS_REND_HeadRotData *pHeadRotData, - const int16_t max_bands, - float out[][L_FRAME48k] ) +static ivas_error renderSplitBinauralWithPostRot( + input_split_post_rend *splitBinInput, + IVAS_REND_AudioBuffer outAudio, + IVAS_REND_BitstreamBuffer *hBits ) { + float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; ivas_error error; - IVAS_QUATERNION QuaternionsPre[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION QuaternionsPost[MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t sf_idx; + ivas_split_rend_bits_t bits; + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + const IVAS_REND_HeadRotData *pHeadRotData; + SPLIT_POST_REND_WRAPPER *hSplitBin; error = IVAS_ERR_OK; + pHeadRotData = splitBinInput->base.ctx.pHeadRotData; + hSplitBin = &splitBinInput->splitPostRendWrapper; + convertBitsBufferToInternalBitsBuff( *hBits, &bits ); + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) { - QuaternionsPre[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); - QuaternionsPost[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); + QuaternionsPost[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); } - ivas_renderMultiBinToSplitBinaural( hSplitBin, pBits, Cldfb_In_BinReal, Cldfb_In_BinImag, QuaternionsPre, QuaternionsPost, max_bands, out ); + ivas_splitBinPostRendMdDec( + &bits, + hSplitBin->hBinHrSplitPostRend, + &hSplitBin->multiBinPoseData, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + hSplitBin->hBinHrSplitPreRend, +#endif + MAX_SPLIT_REND_MD_BANDS ); + + if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_splitBinLCLDDecProcess( + hSplitBin->hSplitBinLCLDDec, + &bits, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural ); + } + else + { + copyBufferTo2dArray( splitBinInput->base.inputBuffer, tmpCrendBuffer ); + } + + ivas_rend_CldfbSplitPostRendProcess( + hSplitBin->hBinHrSplitPostRend, + &hSplitBin->multiBinPoseData, + QuaternionsPost, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + tmpCrendBuffer, + ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 ); + + convertInternalBitsBuffToBitsBuffer( hBits, bits ); + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); return error; } +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error renderSbaToMultiBinaural( + input_sba *sbaInput, + const IVAS_REND_AudioConfig outConfig, + float out[][L_FRAME48k] ) +{ + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + int16_t i, pos_idx; + IVAS_REND_HeadRotData HeadRotDataLocal; + + ivas_error error; + IVAS_REND_AudioBuffer tmpRotBuffer; + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + + wmops_sub_start( "renderSbaToMultiBinaural" ); + + HeadRotDataLocal = *sbaInput->base.ctx.pHeadRotData; + for ( i = 1; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + { + HeadRotDataLocal.headPositions[i] = HeadRotDataLocal.headPositions[0]; + } + + tmpRotBuffer = sbaInput->base.inputBuffer; + tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + + pMultiBinPoseData = &sbaInput->splitRendWrapper.multiBinPoseData; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + IVAS_QUATERNION Quaternions_orig[RENDERER_HEAD_POSITIONS_PER_FRAME], Quaternions_abs; + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + { + Quaternions_orig[i] = HeadRotDataLocal.headPositions[i]; + Quaternions_abs.w = -3.0f; + Quat2EulerDegree( HeadRotDataLocal.headPositions[i], &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + + Quaternions_abs.x += pMultiBinPoseData->relative_head_poses[pos_idx][0]; + Quaternions_abs.y += pMultiBinPoseData->relative_head_poses[pos_idx][1]; + Quaternions_abs.z += pMultiBinPoseData->relative_head_poses[pos_idx][2]; + HeadRotDataLocal.headPositions[i] = Quaternions_abs; + } + + + /* copy input for in-place rotation */ + mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, + tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); + + rotateFrameSba( sbaInput->base.inputBuffer, + sbaInput->base.inConfig, + &HeadRotDataLocal, + sbaInput->rot_gains_prev[pos_idx], + tmpRotBuffer ); + + copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); + + assert( sbaInput->crendWrapper.hCrend[0]->hReverb == NULL ); + /* call CREND */ + if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + pos_idx +#endif + ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + { + HeadRotDataLocal.headPositions[i] = Quaternions_orig[i]; + } + + /* move to output */ + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + mvr2r( tmpCrendBuffer[i], out[pos_idx * BINAURAL_CHANNELS + i], tmpRotBuffer.config.numSamplesPerChannel ); + } + } + count_free( tmpRotBuffer.data ); + + wmops_sub_end(); + + return IVAS_ERR_OK; +} +#endif static ivas_error renderSbaToSplitBinaural( input_sba *sbaInput, - IVAS_REND_AudioBuffer outAudio ) +#ifdef SPLIT_REND_WITH_HEAD_ROT + const IVAS_REND_AudioConfig outConfig, +#endif + IVAS_REND_AudioBuffer outAudio, + IVAS_REND_BitstreamBuffer *hBits ) { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; @@ -4525,37 +5179,65 @@ static ivas_error renderSbaToSplitBinaural( float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; #endif ivas_split_rend_bits_t bits; + int16_t low_res_pre_rend_rot, max_band; + + + low_res_pre_rend_rot = 1; //( *sbaInput->base.ctx.pSplitRendBitRate == SPLIT_REND_768k ) ? 0 : 1; wmops_sub_start( "renderSbaToSplitBinaural" ); error = IVAS_ERR_OK; - copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - ivas_rend_CldfbMultiBinRendProcess( - sbaInput->cldfbRendWrapper.hCldfbRend, - sbaInput->base.ctx.pHeadRotData, - Cldfb_RealBuffer, - Cldfb_ImagBuffer, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural ); + ivas_renderSplitGetMultiBinPoseData( + &sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config, + &sbaInput->splitRendWrapper.multiBinPoseData, + sbaInput->base.ctx.pHeadRotData->sr_pose_pred_axis ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) + { + renderSbaToMultiBinaural( + sbaInput, + outConfig, + tmpCrendBuffer ); + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * ( *sbaInput->base.ctx.pOutSampleRate ) ) / 48000 ); + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + } + } + else +#endif + { + copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + + ivas_rend_CldfbMultiBinRendProcess( + sbaInput->cldfbRendWrapper.hCldfbRend, + sbaInput->base.ctx.pHeadRotData, + &sbaInput->splitRendWrapper.multiBinPoseData, + Cldfb_RealBuffer, + Cldfb_ImagBuffer, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + low_res_pre_rend_rot ); + max_band = sbaInput->cldfbRendWrapper.hCldfbRend->max_band; + } /*SPLIT pre rendering MD and CLDFB coding*/ - ivas_split_rend_bitstream_init( &bits, - outAudio.config.numChannels * outAudio.config.numSamplesPerChannel * sizeof( float ), - (uint8_t *) outAudio.data ); - - renderMultiBinToSplitBinaural( &sbaInput->splitRendWrapper, - &bits, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - sbaInput->base.ctx.pHeadRotData, - sbaInput->cldfbRendWrapper.hCldfbRend->max_band, - tmpCrendBuffer ); - - // TEMP zero out - set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); - accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + convertBitsBufferToInternalBitsBuff( *hBits, &bits ); + + ivas_renderMultiBinToSplitBinaural( &sbaInput->splitRendWrapper, + sbaInput->base.ctx.pHeadRotData->headPositions, + sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.splitRendBitRate, + &bits, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + max_band, + tmpCrendBuffer, + low_res_pre_rend_rot, + ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + + convertInternalBitsBuffToBitsBuffer( hBits, bits ); wmops_sub_end(); @@ -4575,36 +5257,81 @@ static ivas_error renderSbaToBinaural( wmops_sub_start( "renderSbaToBinaural" ); - /* apply rotation */ - if ( sbaInput->base.ctx.pHeadRotData->headRotEnabled ) +#ifdef DEBUGGING + if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { - tmpRotBuffer = sbaInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); - /* copy input for in-place rotation */ - mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, - tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - rotateFrameSba( sbaInput->base.inputBuffer, - sbaInput->base.inConfig, - sbaInput->base.ctx.pHeadRotData, - sbaInput->rot_gains_prev, - tmpRotBuffer ); + copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); - count_free( tmpRotBuffer.data ); + ivas_rend_CldfbMultiBinRendProcess( + sbaInput->cldfbRendWrapper.hCldfbRend, + sbaInput->base.ctx.pHeadRotData, + &sbaInput->splitRendWrapper.multiBinPoseData, + Cldfb_RealBuffer, + Cldfb_ImagBuffer, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + 0 ); + + accumulateCLDFBArrayToBuffer( Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], &outAudio ); } else - { - copyBufferTo2dArray( sbaInput->base.inputBuffer, tmpCrendBuffer ); - } - /* call CREND */ - if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { - return error; - } + /* apply rotation */ + if ( sbaInput->base.ctx.pHeadRotData->headRotEnabled ) + { + tmpRotBuffer = sbaInput->base.inputBuffer; + tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + /* copy input for in-place rotation */ + mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, + tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); + +#ifdef ROTATE_CREND_IN_CLDFB_DOMAIN + rotateFrameSbacldfb( sbaInput->base.inputBuffer, + sbaInput->base.inConfig, + sbaInput->base.ctx.pHeadRotData, + sbaInput->rot_gains_prev[0], + tmpRotBuffer ); +#else + rotateFrameSba( sbaInput->base.inputBuffer, + sbaInput->base.inConfig, + sbaInput->base.ctx.pHeadRotData, +#ifdef SPLIT_REND_WITH_HEAD_ROT + sbaInput->rot_gains_prev[0], +#else + sbaInput->rot_gains_prev, +#endif + tmpRotBuffer ); +#endif - accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + + copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); + count_free( tmpRotBuffer.data ); + } + else + { + copyBufferTo2dArray( sbaInput->base.inputBuffer, tmpCrendBuffer ); + } + + /* call CREND */ + if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) + { + return error; + } + + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + } wmops_sub_end(); @@ -4640,7 +5367,13 @@ static ivas_error renderSbaToBinauralRoom( /* copy input for in-place rotation */ mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); - rotateFrameSba( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, sbaInput->rot_gains_prev, tmpRotBuffer ); + rotateFrameSba( sbaInput->base.inputBuffer, sbaInput->base.inConfig, sbaInput->base.ctx.pHeadRotData, +#ifdef SPLIT_REND_WITH_HEAD_ROT + sbaInput->rot_gains_prev[0], +#else + sbaInput->rot_gains_prev, +#endif + tmpRotBuffer ); } /* intermediate rendering to 7_1_4 */ @@ -4659,7 +5392,12 @@ static ivas_error renderSbaToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( &sbaInput->crendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, outConfig, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -4676,26 +5414,59 @@ static ivas_error renderSbaToBinauralRoom( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error renderInputSplitBin( + input_split_post_rend *splitBinInput, + const IVAS_REND_AudioConfig outConfig, + IVAS_REND_AudioBuffer outAudio, + IVAS_REND_BitstreamBuffer *hBits ) +{ + ivas_error error; + IVAS_REND_AudioBuffer inAudio; + + inAudio = splitBinInput->base.inputBuffer; + if ( splitBinInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) + { + /* Mismatch between the number of input samples vs number of requested output samples - currently not allowed */ + return IVAS_ERR_INVALID_BUFFER_SIZE; + } + + splitBinInput->base.numNewSamplesPerChannel = 0; + + /* Apply input gain to new audio */ + v_multc( inAudio.data, + splitBinInput->base.gain, + inAudio.data, + inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); + switch ( outConfig ) + { + case IVAS_REND_AUDIO_CONFIG_BINAURAL: + error = renderSplitBinauralWithPostRot( splitBinInput, outAudio, + hBits ); + break; + default: + return IVAS_ERR_INVALID_OUTPUT_FORMAT; + } + return error; +} +#endif static ivas_error renderInputSba( input_sba *sbaInput, const IVAS_REND_AudioConfig outConfig, - IVAS_REND_AudioBuffer outAudio ) + IVAS_REND_AudioBuffer outAudio +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_REND_BitstreamBuffer *hBits +#endif +) { ivas_error error; IVAS_REND_AudioBuffer inAudio; -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t cldfb2tdSampleFact; -#endif inAudio = sbaInput->base.inputBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT - cldfb2tdSampleFact = ( inAudio.config.is_cldfb ) ? 2 : 1; - if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel * cldfb2tdSampleFact ) -#else if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) -#endif { /* Mismatch between the number of input samples vs number of requested output samples - currently not allowed */ return IVAS_ERR_INVALID_BUFFER_SIZE; @@ -4719,18 +5490,19 @@ static ivas_error renderInputSba( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( *sbaInput->base.ctx.pSplitRendMode ) != SPLIT_REND_DISABLED ) - { - /*TODO : combine this with renderSbaToBinaural*/ - error = renderSbaToSplitBinaural( sbaInput, outAudio ); - } - else + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + error = renderSbaToSplitBinaural( sbaInput, +#ifdef SPLIT_REND_WITH_HEAD_ROT + outConfig, #endif - { - error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); - } + outAudio, + hBits ); + break; +#endif + case IVAS_REND_AUDIO_CONFIG_BINAURAL: + error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); @@ -4751,9 +5523,41 @@ static ivas_error renderInputSba( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_WITH_HEAD_ROT +static ivas_error renderActiveInputsSplitBin( + IVAS_REND_HANDLE hIvasRend, + IVAS_REND_AudioBuffer outAudio, + IVAS_REND_BitstreamBuffer *hBits ) +{ + int16_t i; + input_split_post_rend *pCurrentInput; + ivas_error error; + + for ( i = 0, pCurrentInput = hIvasRend->inputsSplitPost; i < RENDERER_MAX_BIN_INPUTS; ++i, ++pCurrentInput ) + { + if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + { + /* Skip inactive inputs */ + continue; + } + + if ( ( error = renderInputSplitBin( pCurrentInput, hIvasRend->outputConfig, outAudio, hBits ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + return IVAS_ERR_OK; +} +#endif static ivas_error renderActiveInputsSba( IVAS_REND_HANDLE hIvasRend, - IVAS_REND_AudioBuffer outAudio ) + IVAS_REND_AudioBuffer outAudio +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_REND_BitstreamBuffer *hBits +#endif +) { int16_t i; input_sba *pCurrentInput; @@ -4767,7 +5571,12 @@ static ivas_error renderActiveInputsSba( continue; } - if ( ( error = renderInputSba( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) + if ( ( error = renderInputSba( pCurrentInput, hIvasRend->outputConfig, outAudio +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + hBits +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -4900,7 +5709,8 @@ static ivas_error renderInputMasa( case IVAS_REND_AUDIO_CONFIG_BINAURAL: error = renderMasaToBinaural( masaInput, outAudio ); break; - /* ToDo */ + /* ToDo */ + // case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: // error = renderMasaToBinauralRoom( masaInput, outConfig, outAudio ); // break; @@ -4947,11 +5757,19 @@ static ivas_error renderActiveInputsMasa( } ivas_error IVAS_REND_GetSamples( - IVAS_REND_HANDLE hIvasRend, - IVAS_REND_AudioBuffer outAudio ) + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ +#endif +) { ivas_error error; int16_t numOutChannels; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t cldfb2tdSampleFact; +#endif /*-----------------------------------------------------------------* * Validate function arguments @@ -4961,7 +5779,15 @@ ivas_error IVAS_REND_GetSamples( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + cldfb2tdSampleFact = ( outAudio.config.is_cldfb ) ? 2 : 1; +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( outAudio.config.numSamplesPerChannel <= 0 || ( MAX_BUFFER_LENGTH_PER_CHANNEL < outAudio.config.numSamplesPerChannel && outAudio.config.is_cldfb == 0 ) || + ( ( MAX_BUFFER_LENGTH_PER_CHANNEL * cldfb2tdSampleFact ) < outAudio.config.numSamplesPerChannel && outAudio.config.is_cldfb == 1 ) ) +#else if ( outAudio.config.numSamplesPerChannel <= 0 || MAX_BUFFER_LENGTH_PER_CHANNEL < outAudio.config.numSamplesPerChannel ) +#endif { return IVAS_ERR_INVALID_BUFFER_SIZE; } @@ -4969,8 +5795,14 @@ ivas_error IVAS_REND_GetSamples( { return IVAS_ERR_WRONG_NUM_CHANNELS; } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && + ( outAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut ) +#else if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && outAudio.config.numSamplesPerChannel * 1000 != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut ) +#endif { /* Binaural rendering requires specific frame size */ return IVAS_ERR_INVALID_BUFFER_SIZE; @@ -4995,7 +5827,12 @@ ivas_error IVAS_REND_GetSamples( { return error; } - if ( ( error = renderActiveInputsSba( hIvasRend, outAudio ) ) != IVAS_ERR_OK ) + if ( ( error = renderActiveInputsSba( hIvasRend, outAudio +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + hBits +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -5003,11 +5840,30 @@ ivas_error IVAS_REND_GetSamples( { return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( error = renderActiveInputsSplitBin( hIvasRend, outAudio, hBits ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + + +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( outAudio.config.is_cldfb == 0 ) + { +#ifdef DEBUGGING + hIvasRend->numClipping += +#endif + limitRendererOutput( hIvasRend->hLimiter, outAudio.data, outAudio.config.numSamplesPerChannel, IVAS_LIMITER_THRESHOLD ); + } +#else #ifdef DEBUGGING hIvasRend->numClipping += #endif limitRendererOutput( hIvasRend->hLimiter, outAudio.data, outAudio.config.numSamplesPerChannel, IVAS_LIMITER_THRESHOLD ); +#endif + return IVAS_ERR_OK; } @@ -5050,6 +5906,12 @@ void IVAS_REND_Close( { clearInputMasa( &hIvasRend->inputsMasa[i] ); } +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) + { + clearInputSplitRend( &hIvasRend->inputsSplitPost[i] ); + } +#endif /* clear Config. Renderer */ ivas_render_config_close( &( hIvasRend->hRendererConfig ) ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 498545a9c2..065c3c0584 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -46,6 +46,9 @@ #define RENDERER_MAX_MC_INPUTS 1 #define RENDERER_MAX_SBA_INPUTS 1 #define RENDERER_MAX_MASA_INPUTS 1 +#ifdef SPLIT_REND_WITH_HEAD_ROT +#define RENDERER_MAX_BIN_INPUTS 1 +#endif #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 @@ -64,7 +67,6 @@ typedef struct float *data; } IVAS_REND_AudioBuffer; -#ifdef SPLIT_REND_WITH_HEAD_ROT typedef struct { int32_t bufLenInBytes; @@ -76,7 +78,6 @@ typedef struct IVAS_REND_BitstreamBufferConfig config; uint8_t *bits; } IVAS_REND_BitstreamBuffer; -#endif typedef struct { @@ -141,6 +142,10 @@ typedef enum IVAS_REND_AUDIO_CONFIG_BINAURAL = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 0, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 1, +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 2, + IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 3, +#endif IVAS_REND_AUDIO_CONFIG_MASA1 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 0, IVAS_REND_AUDIO_CONFIG_MASA2 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 1, @@ -167,10 +172,6 @@ ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ const IVAS_REND_AudioConfig outConfig /* i : output audio config */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - IVAS_SPLIT_REND_MODE splitRendMode /* i : split rendering mode */ -#endif ); /* Note: this will reset custom LFE routings set for any MC input */ @@ -275,13 +276,17 @@ ivas_error IVAS_REND_SetHeadRotation( const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : head positions for next rendering call */ #ifdef SPLIT_REND_WITH_HEAD_ROT , - const IVAS_SPLIT_REND_MODE splitRendMode + IVAS_SPLIT_REND_ROT_AXIS rot_axis #endif ); ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ +#endif ); /* Functions to be called after rendering */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 27eed3bf14..14a24c5fd1 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -175,7 +175,7 @@ static void strip_spaces_upper( while ( pStr[read_idx] ) { - if ( !isspace( pStr[read_idx] ) && !iscntrl( pStr[read_idx] ) ) + if ( !isspace( (int32_t) pStr[read_idx] ) && !iscntrl( (int32_t) pStr[read_idx] ) ) { pStr[write_idx++] = pStr[read_idx]; } @@ -290,7 +290,7 @@ static ivas_error RenderConfigReader_checkValues( return IVAS_ERR_WRONG_PARAMS; } -#ifdef DEBUGGING +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) /* Specific limits for Jot reverb */ if ( hRenderConfig->renderer_type_override == IVAS_RENDER_TYPE_OVERRIDE_CREND ) { @@ -499,7 +499,55 @@ ivas_error RenderConfigReader_read( fprintf( stderr, "Reverb config: number of bands changed but configuration vectors missing\n" ); } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( strcmp( chapter, "SPLITREND" ) == 0 && strlen( pParams ) != 0 ) + { + params_idx = 0; + pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); + while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) + { + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); + fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); + if ( strcmp( item, "CODECDELAY" ) == 0 ) + { + if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.codec_delay_ms ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + } + else if ( strcmp( item, "HQMODE" ) == 0 ) + { + if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.hq_mode ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + } + else if ( strcmp( item, "BITRATE" ) == 0 ) + { + if ( !sscanf( pValue, "%d", &hRenderConfig->split_rend_config.splitRendBitRate ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + } + else if ( strcmp( item, "DOF" ) == 0 ) + { + if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.dof ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + } + #ifdef DEBUGGING + else + { + fprintf( stderr, "Unsupported configuration property %s\n", item ); + } +#endif + } + free( pValue ); + } +#endif +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) { params_idx = 0; diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c new file mode 100644 index 0000000000..78ef342bbf --- /dev/null +++ b/lib_util/split_render_file_read_write.c @@ -0,0 +1,254 @@ +/****************************************************************************************************** + + (C) 2022 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 "split_render_file_read_write.h" +#include +#include +#include +#include +#include +#include "cmdl_tools.h" +#include "prot.h" +#include "ivas_cnst.h" + +/*------------------------------------------------------------------------------------------* + * PreProc Macros + *------------------------------------------------------------------------------------------*/ +#define SPLIT_RENDERER_FRAME_HEADER_LEN ( 12 ) + +/*------------------------------------------------------------------------------------------* + * Type definitions + *------------------------------------------------------------------------------------------*/ + +#ifdef SPLIT_REND_WITH_HEAD_ROT +struct SplitFileReadWrite +{ + FILE *file; + uint32_t delay_ns; +}; + + +/*-----------------------------------------------------------------------------------------* + * Function split_rend_reader_open() + * open in read mode + *-----------------------------------------------------------------------------------------*/ +ivas_error split_rend_reader_open( SplitFileReadWrite **hhSplitRendFileReadWrite, char *filename ) +{ + SplitFileReadWrite *hSplitRendFileReadWrite; + size_t header_len, h; + char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "MAIN_SPLITH"; + char header_read[SPLIT_RENDERER_FRAME_HEADER_LEN]; + + hSplitRendFileReadWrite = (SplitFileReadWrite *) count_malloc( sizeof( SplitFileReadWrite ) ); + hSplitRendFileReadWrite->file = fopen( filename, "rb" ); + if ( hSplitRendFileReadWrite->file == NULL ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", filename ); + exit( -1 ); + } + + header_len = strlen( header ); + + /*read frame header*/ + for ( h = 0; h < header_len; h++ ) + { + if ( fread( &header_read[h], sizeof( char ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + } + if ( strncmp( header_read, header, header_len ) ) + { + fprintf( stderr, "Error split rend bitstream main header mismatch\n" ); + return IVAS_ERR_FAILED_FILE_READ; + } + + fread( &hSplitRendFileReadWrite->delay_ns, sizeof( uint32_t ), 1, hSplitRendFileReadWrite->file ); + + *hhSplitRendFileReadWrite = hSplitRendFileReadWrite; + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function split_rend_writer_open() + * open in write mode + *-----------------------------------------------------------------------------------------*/ +ivas_error split_rend_writer_open( SplitFileReadWrite **hhSplitRendFileReadWrite, char *filename, int16_t delayNumSamples, int32_t delayTimeScale ) +{ + SplitFileReadWrite *hSplitRendFileReadWrite; + size_t header_len, h; + char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "MAIN_SPLITH"; + + hSplitRendFileReadWrite = (SplitFileReadWrite *) count_malloc( sizeof( SplitFileReadWrite ) ); + hSplitRendFileReadWrite->file = fopen( filename, "wb" ); + if ( hSplitRendFileReadWrite->file == NULL ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", filename ); + exit( -1 ); + } + + header_len = strlen( header ); + + /*read frame header*/ + for ( h = 0; h < header_len; h++ ) + { + if ( fwrite( &header[h], sizeof( char ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_END_OF_FILE; + } + } + hSplitRendFileReadWrite->delay_ns = (int32_t) ( (float) delayNumSamples * 1000000000.0f / (float) delayTimeScale ); + fwrite( &hSplitRendFileReadWrite->delay_ns, sizeof( int32_t ), 1, hSplitRendFileReadWrite->file ); + + *hhSplitRendFileReadWrite = hSplitRendFileReadWrite; + return IVAS_ERR_OK; +} + +ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileReadWrite ) +{ + if ( ( *hhSplitRendFileReadWrite ) != NULL ) + { + if ( ( *hhSplitRendFileReadWrite )->file != NULL ) + { + fclose( ( *hhSplitRendFileReadWrite )->file ); + ( *hhSplitRendFileReadWrite )->file = NULL; + } + count_free( *hhSplitRendFileReadWrite ); + *hhSplitRendFileReadWrite = NULL; + } + return IVAS_ERR_OK; +} + +ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ) +{ + char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "SPLIT_FRAME"; + size_t header_len, i, num_bytes; + + if ( hSplitRendFileReadWrite == NULL ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + + if ( hSplitRendFileReadWrite->file == NULL ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + + header_len = strlen( header ); + + /*write frame header*/ + for ( i = 0; i < header_len; i++ ) + { + if ( fwrite( &header[i], sizeof( char ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + } + + /*write num bytes*/ + if ( fwrite( bits_written, sizeof( int32_t ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + + num_bytes = ( *bits_written + 7 ) >> 3; + if ( fwrite( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != num_bytes ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + + *bits_read = 0; + *bits_written = 0; + + return IVAS_ERR_OK; +} + +ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ) +{ + char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "SPLIT_FRAME"; + char header_read[SPLIT_RENDERER_FRAME_HEADER_LEN]; + size_t header_len, i, num_bytes, bit_len; + + if ( hSplitRendFileReadWrite == NULL ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + + if ( hSplitRendFileReadWrite->file == NULL ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + + header_len = strlen( header ); + + /*write frame header*/ + for ( i = 0; i < header_len; i++ ) + { + if ( fread( &header_read[i], sizeof( char ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_END_OF_FILE; + } + } + if ( strncmp( header_read, header, header_len ) ) + { + fprintf( stderr, "Error bitstream frame header mismatch\n" ); + return IVAS_ERR_FAILED_FILE_READ; + } + + /*write num bytes*/ + if ( fread( &bit_len, sizeof( int32_t ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + num_bytes = ( bit_len + 7 ) >> 3; + + if ( fread( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != num_bytes ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + + *bits_read = 0; + *bits_written = bit_len; + + return IVAS_ERR_OK; +} + +ivas_error split_rend_read_pre_rend_delay_ns( SplitFileReadWrite *hSplitRendFileReadWrite, uint32_t *delay_ns ) +{ + if ( hSplitRendFileReadWrite == NULL ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + *delay_ns = hSplitRendFileReadWrite->delay_ns; + return IVAS_ERR_OK; +} +#endif diff --git a/lib_util/split_render_file_read_write.h b/lib_util/split_render_file_read_write.h new file mode 100644 index 0000000000..d98bc4b936 --- /dev/null +++ b/lib_util/split_render_file_read_write.h @@ -0,0 +1,61 @@ +/****************************************************************************************************** + + (C) 2022 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 SPLIT_RENDER_FILE_READ_WRITE_H +#define SPLIT_RENDER_FILE_READ_WRITE_H + +#include "common_api_types.h" +#include "ivas_error.h" + + +typedef struct SplitFileReadWrite SplitFileReadWrite; + +/* Allocates and initializes a a split renderer reader instance */ +ivas_error split_rend_reader_open( SplitFileReadWrite **hhSplitRendFileReadWrite, char *filename ); + + +/* Allocates and initializes a a split renderer writer instance */ +ivas_error split_rend_writer_open( SplitFileReadWrite **hhSplitRendFileReadWrite, char *filename, int16_t delayNumSamples, int32_t delayTimeScale ); + +/* Closes the split renderer reader/writer and deallocates memory */ +ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileReadWrite ); + +/*write split rend coded bitstream to file*/ +ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ); + +/*read split rend coded bits from file*/ +ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ); + +/*read split pre rend delay*/ +ivas_error split_rend_read_pre_rend_delay_ns( SplitFileReadWrite *hSplitRendFileReadWrite, uint32_t *delay_ns ); + +#endif -- GitLab From 1612045f4232d92e95eac99e8ca909c3623800a8 Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 24 Mar 2023 14:42:01 +1100 Subject: [PATCH 0061/1418] disable reverb in renderer config file as it is enabled by default if config file present --- .../renderer_configs/split_renderer_config_384_3dof.txt | 3 +++ .../renderer_configs/split_renderer_config_384_3dof_hq.txt | 3 +++ .../renderer_configs/split_renderer_config_512_2dof.txt | 3 +++ .../renderer_configs/split_renderer_config_768_1dof.txt | 3 +++ .../renderer_configs/split_renderer_config_fc_384_3dof.txt | 3 +++ .../renderer_configs/split_renderer_config_fc_384_3dof_hq.txt | 3 +++ .../renderer_configs/split_renderer_config_fc_512_2dof.txt | 3 +++ .../renderer_configs/split_renderer_config_fc_768_1dof.txt | 3 +++ 8 files changed, 24 insertions(+) diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt index a3f6373d69..84f70f6d8a 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt index 3103a24b50..520ba5b8ae 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_384_3dof_hq.txt @@ -5,3 +5,6 @@ HQMODE = 1; [GENERAL] RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt index ef74dca52d..1a718cab03 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt index f1d2ed8168..31d94203cc 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt index ef12d462c9..5fbf7f7276 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = FASTCONV; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt index 56b6e2494f..881f462661 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_384_3dof_hq.txt @@ -5,3 +5,6 @@ HQMODE = 1; [GENERAL] RENDERER = FASTCONV; + +[ROOMACOUSTICS] +REVERB = FALSE; \ No newline at end of file diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt index 6dfcbbf0f8..3178a67e32 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_512_2dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = FASTCONV; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt index 2c7a780f5c..bd448d16b3 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_fc_768_1dof.txt @@ -5,3 +5,6 @@ HQMODE = 0; [GENERAL] RENDERER = FASTCONV; + +[ROOMACOUSTICS] +REVERB = FALSE; -- GitLab From 76a671d8df432d6f0b8ed707e6109c412746f337 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 27 Mar 2023 19:58:20 +0200 Subject: [PATCH 0062/1418] simplify ivas_ism_metadata_enc() --- lib_com/ivas_prot.h | 4 -- lib_enc/ivas_ism_enc.c | 53 ++++++++++++--------- lib_enc/ivas_ism_metadata_enc.c | 84 ++++++++++----------------------- 3 files changed, 55 insertions(+), 86 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 6eb61455e3..020f685d86 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -839,13 +839,9 @@ ivas_error ivas_ism_metadata_enc( #else const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ #endif -#ifdef MASA_AND_OBJECTS - , - const int16_t n_ism /* i : number of objects */ #ifdef OMASA_BRATE ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ #endif -#endif ); ivas_error ivas_ism_metadata_dec( diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index f7e5c8e04b..4d0943b76f 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -89,7 +89,7 @@ ivas_error ivas_ism_enc( int16_t dtx_flag, sid_flag; ivas_error error; #ifdef MASA_AND_OBJECTS - int16_t n; + int16_t nchan_transport; #endif push_wmops( "ivas_ism_enc" ); @@ -102,13 +102,21 @@ ivas_error ivas_ism_enc( dtx_flag = 0; sid_flag = 0; +#ifdef MASA_AND_OBJECTS + nchan_transport = st_ivas->nchan_transport; + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + nchan_transport = st_ivas->hEncoderConfig->nchan_ism; + } +#endif + /*------------------------------------------------------------------* * Preprocesing *-----------------------------------------------------------------*/ /* in ISM format: st_ivas->nchan_transport = st_ivas->nSCE */ #ifdef MASA_AND_OBJECTS - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) #else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) #endif @@ -223,16 +231,16 @@ ivas_error ivas_ism_enc( #else st_ivas->hEncoderConfig->ivas_total_brate, #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 #ifdef MASA_AND_OBJECTS - , - st_ivas->nSCE + nchan_transport, +#else + st_ivas->nchan_transport, +#endif + 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 #ifdef OMASA_BRATE , -1 #endif -#endif - ) ) != IVAS_ERR_OK ) { return error; @@ -244,7 +252,13 @@ ivas_error ivas_ism_enc( #else st_ivas->hEncoderConfig->ivas_total_brate, #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 +#ifdef MASA_AND_OBJECTS + nchan_transport, +#else + st_ivas->nchan_transport, +#endif + + 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 #ifdef MASA_AND_OBJECTS , st_ivas->nSCE @@ -284,11 +298,11 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; // VE: change the interface of the following function and call it with 'st_ivas' only - if ( ( error = ivas_ism_metadata_enc( &ism_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, + if ( ( error = ivas_ism_metadata_enc( &ism_total_brate, 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 st_ivas->hEncoderConfig->ism_extended_metadata_flag, #endif - st_ivas->nSCE, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ) ) != IVAS_ERR_OK ) + st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -298,7 +312,7 @@ ivas_error ivas_ism_enc( st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - ism_total_brate; } #else - if ( ( error = ivas_ism_metadata_enc( ism_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, st_ivas->nSCE, + if ( ( error = ivas_ism_metadata_enc( ism_total_brate, 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 , st_ivas->hEncoderConfig->ism_extended_metadata_flag #endif @@ -313,7 +327,6 @@ ivas_error ivas_ism_enc( , st_ivas->hEncoderConfig->ism_extended_metadata_flag #endif - ) ) != IVAS_ERR_OK ) { return error; @@ -347,17 +360,9 @@ ivas_error ivas_ism_enc( /*------------------------------------------------------------------* * CoreCoders encoding *-----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n = st_ivas->nSCE; - } - else - { - n = st_ivas->nchan_transport; - } - for ( sce_id = 0; sce_id < n; sce_id++ ) +#ifdef MASA_AND_OBJECTS + for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) #else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) #endif @@ -416,7 +421,11 @@ ivas_error ivas_ism_enc( if ( dtx_flag ) { +#ifdef MASA_AND_OBJECTS + for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) +#else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) +#endif { if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) { diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index f4138e1b56..72c933c595 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -194,14 +194,10 @@ ivas_error ivas_ism_metadata_enc( #else const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ #endif -#ifdef MASA_AND_OBJECTS - , - const int16_t n_ism /* i : number of objects */ #ifdef OMASA_BRATE , const float lp_noise_CPE #endif -#endif ) { #ifdef TD5 @@ -226,9 +222,7 @@ ivas_error ivas_ism_metadata_enc( int16_t ism_imp[MAX_NUM_OBJECTS]; int16_t num_obj, nbands, nblocks; ivas_error error; -#ifdef MASA_AND_OBJECTS - int16_t n_ch; -#endif + error = IVAS_ERR_OK; push_wmops( "ism_meta_enc" ); @@ -244,7 +238,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS else if ( ism_mode == ISM_MASA_MODE_DISC ) { - num_obj = n_ism; + num_obj = nchan_transport; } #endif else @@ -275,22 +269,13 @@ ivas_error ivas_ism_metadata_enc( #endif #ifdef OMASA_BRATE - if ( ism_mode == ISM_MASA_MODE_DISC ) - { - n_ch = num_obj; - } - else - { - n_ch = nchan_transport; - } - if ( ism_mode == ISM_MASA_MODE_DISC ) { /*----------------------------------------------------------------* * Rate importance of particular ISM streams in combined format coding *----------------------------------------------------------------*/ - set_ism_importance_interformat( *ism_total_brate, n_ch, hIsmMeta, hSCE, lp_noise_CPE, ism_imp ); + set_ism_importance_interformat( *ism_total_brate, nchan_transport, hIsmMeta, hSCE, lp_noise_CPE, ism_imp ); } else #endif @@ -366,53 +351,40 @@ ivas_error ivas_ism_metadata_enc( #endif } } - } - /*----------------------------------------------------------------* - * Rate importance of particular ISM streams - *----------------------------------------------------------------*/ -#ifdef MASA_AND_OBJECTS - if ( ism_mode == ISM_MASA_MODE_DISC ) - { - n_ch = num_obj; - } - else - { - n_ch = nchan_transport; - } - - rate_ism_importance( n_ch, hIsmMeta, hSCE, ism_imp ); + /*----------------------------------------------------------------* + * Rate importance of particular ISM streams + *----------------------------------------------------------------*/ -#else - rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp ); -#endif + 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 */ + /* relax the importance decision in "stereo" coding for noisy audio */ #ifdef MASA_AND_OBJECTS - if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && num_obj == 2 ) + if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && num_obj == 2 ) #else - if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) + if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) #endif - { - float diff_F; - - if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) { - for ( ch = 0; ch < num_obj; ch++ ) - { - diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; + float diff_F; - if ( hIsmMeta[ch]->ism_metadata_flag == 0 && diff_F < 25.0f ) + if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag ) + { + for ( ch = 0; ch < num_obj; ch++ ) { - hIsmMeta[ch]->ism_metadata_flag = 1; - ism_imp[ch] = ISM_LOW_IMP; + diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise; + + if ( hIsmMeta[ch]->ism_metadata_flag == 0 && diff_F < 25.0f ) + { + hIsmMeta[ch]->ism_metadata_flag = 1; + ism_imp[ch] = ISM_LOW_IMP; + } } } } - } #endif + } /*----------------------------------------------------------------* * Write ISM common signaling @@ -433,7 +405,7 @@ ivas_error ivas_ism_metadata_enc( #endif #ifdef TD5 -/* write extended metadata presence flag */ + /* write extended metadata presence flag */ #ifdef OMASA_BRATE #ifdef FIX_TD5_IN_OMASA if ( ism_mode == ISM_MODE_DISC && *ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) @@ -449,11 +421,7 @@ ivas_error ivas_ism_metadata_enc( #endif /* write ISM metadata flag (one per object) */ -#ifdef MASA_AND_OBJECTS - for ( ch = 0; ch < n_ch; ch++ ) -#else for ( ch = 0; ch < nchan_transport; ch++ ) -#endif { #ifdef OMASA_BRATE if ( ism_mode == ISM_MASA_MODE_DISC ) @@ -481,11 +449,7 @@ ivas_error ivas_ism_metadata_enc( #endif { /* write VAD flag */ -#ifdef MASA_AND_OBJECTS - for ( ch = 0; ch < n_ch; ch++ ) -#else for ( ch = 0; ch < nchan_transport; ch++ ) -#endif { #ifdef OMASA_BRATE if ( ism_mode == ISM_MASA_MODE_DISC ) @@ -1039,7 +1003,7 @@ ivas_error ivas_ism_metadata_enc( } #ifdef MASA_AND_OBJECTS - for ( ch = 0; ch < n_ch; ch++ ) + for ( ch = 0; ch < nchan_transport; ch++ ) { #ifdef OMASA_BRATE hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; -- GitLab From 57f8d915239a52280a6b2ce400e19bb0667bfa79 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 27 Mar 2023 20:25:34 +0200 Subject: [PATCH 0063/1418] addition of OMASA_BRATE_SW - solves MSAN error in OMASA bitrate switching --- lib_enc/ivas_init_enc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 89820ff179..bd333e20ea 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -610,6 +610,13 @@ ivas_error ivas_init_encoder( return error; } +#ifdef OMASA_BRATE_SW + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + set_f( st_ivas->hQMetaData->masa_to_total_energy_ratio[i], 0, MASA_FREQUENCY_BANDS ); + } +#endif + if ( ( error = ivas_masa_enc_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; -- GitLab From cd76cbd5285f891b99bed2274453b287a25135aa Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 28 Mar 2023 10:11:43 +0300 Subject: [PATCH 0064/1418] Updates to OMASA coding and processing addressing quality issues at 48k and 128k 3-4 objects --- lib_com/bitstream.c | 4 + lib_com/ivas_cnst.h | 13 +- lib_com/ivas_ism_config.c | 22 +- lib_com/ivas_masa_com.c | 15 +- lib_com/ivas_omasa_com.c | 107 +++- lib_com/ivas_prot.h | 34 +- lib_com/ivas_rom_com.c | 40 +- lib_com/ivas_rom_com.h | 1 + lib_com/ivas_stat_com.h | 8 +- lib_com/options.h | 12 +- lib_dec/ivas_core_dec.c | 2 +- lib_dec/ivas_cpe_dec.c | 39 +- lib_dec/ivas_dec.c | 88 ++- lib_dec/ivas_dirac_dec.c | 4 + lib_dec/ivas_init_dec.c | 50 +- lib_dec/ivas_ism_metadata_dec.c | 64 +- lib_dec/ivas_ism_renderer.c | 8 + lib_dec/ivas_masa_dec.c | 406 +++++-------- lib_dec/ivas_mono_dmx_renderer.c | 4 + lib_dec/ivas_omasa_dec.c | 26 +- lib_dec/ivas_qmetadata_dec.c | 5 + lib_dec/ivas_sce_dec.c | 24 +- lib_dec/ivas_stat_dec.h | 6 +- lib_dec/ivas_stereo_switching_dec.c | 2 +- lib_dec/ivas_stereo_td_dec.c | 20 +- lib_enc/ivas_core_enc.c | 6 +- lib_enc/ivas_cpe_enc.c | 48 +- lib_enc/ivas_decision_matrix_enc.c | 5 +- lib_enc/ivas_enc.c | 90 +-- lib_enc/ivas_init_enc.c | 7 +- lib_enc/ivas_ism_enc.c | 19 +- lib_enc/ivas_ism_metadata_enc.c | 133 ++++- lib_enc/ivas_masa_enc.c | 598 ++++--------------- lib_enc/ivas_omasa_enc.c | 137 ++++- lib_enc/ivas_qmetadata_enc.c | 10 + lib_enc/ivas_sce_enc.c | 25 +- lib_enc/ivas_stat_enc.h | 4 +- lib_enc/ivas_stereo_classifier.c | 5 +- lib_enc/ivas_stereo_mdct_core_enc.c | 2 +- lib_enc/ivas_stereo_td_enc.c | 4 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 34 ++ lib_rend/ivas_objectRenderer.c | 12 + 42 files changed, 1056 insertions(+), 1087 deletions(-) mode change 100755 => 100644 lib_com/options.h diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 71d7016f12..6cd20c8831 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1984,7 +1984,11 @@ ivas_error preview_indices( { st_ivas->ism_mode = ivas_omasa_ism_mode_select( total_brate, st_ivas->nchan_ism ); +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { st_ivas->nchan_transport = 0; } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 33de8aa6f4..2474eee778 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -307,7 +307,7 @@ typedef enum #define ISM_METADATA_VAD_FLAG_BITS 1 #define ISM_METADATA_FLAG_BITS 2 -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS #define ISM_INACTIVE_IMP 0 /* == ISM_NO_META */ #endif #define ISM_NO_META 0 @@ -315,7 +315,7 @@ typedef enum #define ISM_MEDIUM_IMP 2 #define ISM_HIGH_IMP 3 -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM no meta / inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC ) #endif @@ -361,7 +361,12 @@ typedef enum #ifdef MASA_AND_OBJECTS , ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ +#ifdef OMASA_UPDATES + ISM_MASA_MODE_MASA_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using MASA parameters */ + ISM_MASA_MODE_PARAM_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using parametric object model */ +#else ISM_MASA_MODE_ONE_OBJ, /* MASA ISM mode when one object is encoded separarately */ +#endif ISM_MASA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ #endif } ISM_MODE; @@ -624,7 +629,11 @@ enum IND_STEREO_DFT_SIDEGAIN_FLAG, IND_STEREO_DFT_SIDEGAINS, + #ifdef OMASA_UPDATES + IND_STEREO_DFT_ITD_MODE = IND_STEREO_DFT_SIDEGAINS + 4 * STEREO_DFT_BAND_MAX + 120, + #else IND_STEREO_DFT_ITD_MODE = IND_STEREO_DFT_SIDEGAINS + 4 * STEREO_DFT_BAND_MAX + 72, + #endif IND_STEREO_DFT_ITD_HUFF, IND_STEREO_DFT_ITD_NEG, diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 06ccd94a31..8a0621509c 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -50,7 +50,7 @@ #define FRMS_PER_SECOND ( 1000000000 / FRAME_SIZE_NS ) -#ifndef OMASA_BRATE +#ifndef MASA_AND_OBJECTS #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISm inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRMS_PER_SECOND ) #endif @@ -65,7 +65,7 @@ * Convert bit-budget to bitrate *-------------------------------------------------------------------*/ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS void bitbudget_to_brate( #else static void bitbudget_to_brate( @@ -142,7 +142,7 @@ ivas_error ivas_ism_config( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* decision about bitrates per channel */ if ( combined_format_flag ) { @@ -185,17 +185,7 @@ ivas_error ivas_ism_config( /* count ISm common signaling bits */ if ( hIsmMeta != NULL ) { -#ifdef MASA_AND_OBJECTS - nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS; - if ( combined_format_flag == 0 ) - { - /* the bits for writing the number of objects are counted here for pure ISM modes */ - nb_bits_metadata[0] += num_obj; - } -#else nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj; -#endif - for ( ch = 0; ch < n_ISms; ch++ ) { if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) @@ -362,7 +352,7 @@ ivas_error ivas_ism_config( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS if ( combined_format_flag == 1 ) { if ( diff > 0 ) @@ -390,12 +380,13 @@ ivas_error ivas_ism_config( bitbudget_to_brate( bits_CoreCoder, total_brate, n_ISms ); } + #ifdef DEBUGGING if ( nb_bits_metadata != NULL ) { int32_t tmpL; tmpL = sum_l( total_brate, n_ISms ) + bits_side * FRMS_PER_SECOND; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS if ( ism_total_brate != tmpL ) #else if ( sum_l( element_brate, n_ISms ) != tmpL ) @@ -403,6 +394,7 @@ ivas_error ivas_ism_config( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISm bit-budget distribution. Exiting!\n" ); } + } #endif diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index c3082f53e1..d5aa835e8d 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -96,7 +96,11 @@ void ivas_masa_set_elements( if ( ivas_total_brate > MIN_BRATE_MDCT_STEREO ) { *element_mode = IVAS_CPE_MDCT; +#ifdef OMASA_UPDATES + if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) && ( ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) ) +#else if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_ONE_OBJ ) && ( ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) ) +#endif { *element_mode = IVAS_CPE_DFT; } @@ -115,7 +119,11 @@ void ivas_masa_set_elements( } hQMetaData->bits_frame_nominal = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ); #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { hQMetaData->bits_frame_nominal -= (int16_t) ( ism_total_brate / FRAMES_PER_SEC ); } @@ -494,12 +502,11 @@ void reconstruct_ism_ratios( } q_energy_ratio_ism[nchan_ism - 1] = 1.0f - sum; -#ifdef REDUCE_OMASA_META_BITS + if ( q_energy_ratio_ism[nchan_ism - 1] < 0 ) { q_energy_ratio_ism[nchan_ism - 1] = 0.0f; } -#endif return; } @@ -605,7 +612,11 @@ int32_t calculate_cpe_brate_MASA_ISM( k++; } +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { cpe_brate = ivas_total_brate - sep_object_brate[k - 2][0]; /* take data from the first column */ } diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index e248cc5a9d..175bf22195 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -35,16 +35,13 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#ifdef REDUCE_OMASA_META_BITS #include "ivas_rom_com.h" #include -#endif #ifdef DEBUGGING #include "debug.h" #endif #ifdef MASA_AND_OBJECTS -#ifdef OMASA_BRATE /*--------------------------------------------------------------- * Local constants *---------------------------------------------------------------*/ @@ -61,8 +58,7 @@ #define GAMMA_ISM_MEDIUM_IMP3 1.15f #define GAMMA_ISM_HIGH_IMP3 1.3f -#ifdef TUNING_DISC_3_4obj -#ifdef FIX_4OBJ_128 +#ifdef OMASA_UPDATES #define GAMMA_ISM_LOW_IMP4 0.8f #define GAMMA_ISM_MEDIUM_IMP4 1.0f #define GAMMA_ISM_HIGH_IMP4 1.2f @@ -71,8 +67,8 @@ #define GAMMA_ISM_MEDIUM_IMP4 0.8f #define GAMMA_ISM_HIGH_IMP4 1.0f #endif -#endif -#endif + + /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() @@ -108,7 +104,11 @@ ISM_MODE ivas_omasa_ism_mode_select( } else if ( ivas_total_brate >= IVAS_32k ) { +#ifdef OMASA_UPDATES + ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; +#else ism_mode = ISM_MASA_MODE_ONE_OBJ; +#endif } else { @@ -116,36 +116,49 @@ ISM_MODE ivas_omasa_ism_mode_select( } break; case 3: -#ifdef TUNING_DISC_3_4obj if ( ivas_total_brate >= IVAS_96k ) -#else - if ( ivas_total_brate >= IVAS_128k ) -#endif { ism_mode = ISM_MASA_MODE_DISC; } else if ( ivas_total_brate >= IVAS_64k ) { +#ifdef OMASA_UPDATES + ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; +#else ism_mode = ISM_MASA_MODE_ONE_OBJ; +#endif + } +#ifdef OMASA_UPDATES + else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_MASA_ONE_OBJ; } +#else else if ( ivas_total_brate >= IVAS_48k ) { ism_mode = ISM_MASA_MODE_PARAM; } +#endif else { ism_mode = ISM_MODE_NONE; } break; case 4: -#ifdef TUNING_DISC_3_4obj if ( ivas_total_brate >= IVAS_128k ) -#else - if ( ivas_total_brate >= IVAS_160k ) -#endif { ism_mode = ISM_MASA_MODE_DISC; } +#ifdef OMASA_UPDATES + else if ( ivas_total_brate >= IVAS_64k ) + { + ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; + } + else if ( ivas_total_brate >= IVAS_32k ) + { + ism_mode = ISM_MASA_MODE_MASA_ONE_OBJ; + } +#else else if ( ivas_total_brate >= IVAS_64k ) { ism_mode = ISM_MASA_MODE_ONE_OBJ; @@ -154,6 +167,7 @@ ISM_MODE ivas_omasa_ism_mode_select( { ism_mode = ISM_MASA_MODE_PARAM; } +#endif else { ism_mode = ISM_MODE_NONE; @@ -165,7 +179,7 @@ ISM_MODE ivas_omasa_ism_mode_select( } -#ifdef OMASA_BRATE + /*--------------------------------------------------------------- * ivas_interformat_brate() * @@ -178,7 +192,7 @@ int32_t ivas_interformat_brate( const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ -#ifdef FIX_4OBJ_128 +#ifdef OMASA_UPDATES , const int16_t limit_flag /* i : flag to limit the bitrate increase */ #endif @@ -195,17 +209,16 @@ int32_t ivas_interformat_brate( } else { -#ifdef TUNING_DISC_3_4obj - if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) ) ) /* this condition corresponds to the ivas_total_brate = 96000 and 3 objects */ + if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate <= 24000 ) + || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) /* for border case in DISC mode */ { -#ifdef FIX_4OBJ_128 - if ( limit_flag && ( nchan_ism == 4 && element_brate == 24000 ) ) +#ifdef OMASA_UPDATES + if ( (limit_flag == 1) && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) { return element_brate; } #endif - if ( ism_imp == ISM_LOW_IMP ) { nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP4 ); @@ -213,15 +226,26 @@ int32_t ivas_interformat_brate( else if ( ism_imp == ISM_MEDIUM_IMP ) { nBits = (int16_t) ( nBits * GAMMA_ISM_MEDIUM_IMP4 ); + if ( limit_flag == -1 ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP4 ); + } } else /* ISM_HIGH_IMP */ { nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP4 ); + if ( limit_flag == -1 ) + { + nBits = (int16_t) ( nBits * GAMMA_ISM_HIGH_IMP4 ); + } } } else -#endif +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || +#else if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || +#endif ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 24400 and 1 object */ ) { @@ -319,9 +343,8 @@ void ivas_combined_format_brate_sanity( return; } -#endif -#ifdef REDUCE_OMASA_META_BITS + /*--------------------------------------------------------------- * bits_index_ism_ratio() * @@ -414,7 +437,7 @@ void calculate_nbits_meta( priority[obj] = max_p; } } - bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - ( (int16_t) ( priority[obj] * 1000.0f ) ) * 0.001f ) * 7 ); + bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - ( (int16_t) ( priority[obj] * 1000.0f ) ) * 0.001f ) * 6 ); } return; @@ -463,5 +486,35 @@ void ivas_get_stereo_panning_gains( return; } + +int16_t calculate_brate_limit_flag(int16_t * ism_imp, int16_t num_obj) +{ + int16_t n; + int16_t brate_limit_flag; + int16_t nzeros; + + brate_limit_flag = 0; + nzeros = 0; + for ( n = 0; n < num_obj; n++ ) + { + brate_limit_flag += ism_imp[n]; + if ( ism_imp[n] == 0 ) + { + nzeros++; + } + } + if ( brate_limit_flag >= (int16_t) ( num_obj * 2.5f ) ) + { + brate_limit_flag = 1; + } + else + { + if ( nzeros / (float) num_obj >= 0.5f ) + { + brate_limit_flag = -1; /* there is no limitation, on the contrary */ + } + } + return brate_limit_flag; +} #endif -#endif + diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b20eb35e3b..750e5fc85c 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -765,7 +765,7 @@ ivas_error ivas_ism_config( #endif ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS void bitbudget_to_brate( const int16_t x[], /* i : bitbudgets */ int32_t y[], /* o : bitrates */ @@ -822,7 +822,7 @@ ivas_error ivas_ism_enc( ); ivas_error ivas_ism_metadata_enc( -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int32_t *ism_total_brate, /* i/o: ISms total bitrate */ #else const int32_t ism_total_brate, /* i : ISms total bitrate */ @@ -838,7 +838,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS , const int16_t n_ism /* i : number of objects */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ #endif #endif @@ -4471,12 +4471,9 @@ void ivas_masa_encode( const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ - OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ -#ifdef REDUCE_OMASA_META_BITS - , + OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ int16_t ism_imp /* i: importance of separated object */ #endif -#endif ); void ivas_masa_estimate_energy( @@ -4552,7 +4549,7 @@ int32_t calculate_cpe_brate_MASA_ISM( const int16_t nchan_ism /* i : number of objects */ ); -#ifdef OMASA_DIFFUSE_ISM_MERGE + void ivas_merge_masa_metadata( MASA_ENCODER_HANDLE hMasa, /* i/o: MASA enc handle. source for MASA metadata and combined metadata will be here */ OMASA_SPATIAL_META_HANDLE hOMasaMeta /* i : ISM-object metadata to be merged with the MASA metadata */ @@ -4561,9 +4558,7 @@ void ivas_merge_masa_metadata( void ivas_masa_combine_directions( MASA_ENCODER_HANDLE hMasa /* i/o: MASA encoder handle */ ); -#endif /* OMASA_DIFFUSE_ISM_MERGE */ -#ifdef REDUCE_OMASA_META_BITS /*!r : number of bits for ISM ratio index */ int16_t bits_index_ism_ratio( const int16_t nchan_ism /* i : number of objects */ @@ -4579,7 +4574,11 @@ void calculate_nbits_meta( const int16_t idx_sep_obj, const int16_t ism_imp ); -#endif + +int16_t calculate_brate_limit_flag( + int16_t * ism_imp, + int16_t num_obj +); void ivas_get_stereo_panning_gains( const float aziDeg, @@ -5027,18 +5026,12 @@ void ivas_omasa_enc_close( void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ - const int32_t input_Fs /* i : Input sample rate */ -#ifdef OMASA_DIFFUSE_ISM_MERGE - , + const int32_t input_Fs, /* i : Input sample rate */ ISM_MODE ismMode /* i : ISM mode */ -#endif ); void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ -#ifndef OMASA_DIFFUSE_ISM_MERGE - IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ -#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ @@ -5050,7 +5043,6 @@ void ivas_omasa_enc( int16_t* idx_separated_object /* o : Index of the separated object */ ); -#ifdef OMASA_BRATE void ivas_set_surplus_brate_enc( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ #ifdef DEBUG_MODE_INFO @@ -5079,7 +5071,7 @@ int32_t ivas_interformat_brate( const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ const int16_t ism_imp /* i : ISM importance flag */ -#ifdef FIX_4OBJ_128 +#ifdef OMASA_UPDATES , const int16_t limit_flag /* i : flag to limit the bitrate increase */ #endif ); @@ -5090,7 +5082,7 @@ void ivas_combined_format_brate_sanity( int32_t *core_brate, /* i/o: core bitrate */ int16_t *diff_nBits /* o : number of differential bits */ ); -#endif + ISM_MODE ivas_omasa_ism_mode_select( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 66db7666f2..2f4d9367f3 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2789,29 +2789,13 @@ const int32_t sep_object_brate[][MAX_NUM_OBJECTS] = {0, 0, 0, 0}, /* 13k2 */ {0, 0, 0, 0}, /* 16k4 */ {9600, 0, 0, 0}, /* 24k4 */ -#ifdef OMASA_BRATE - {11000, 0, 0, 0}, /* 32k */ -#else - {9600, 0, 0, 0}, /* 32k */ -#endif - {IVAS_13k2, 9600, 0, 0}, /* 48k */ -#ifdef OMASA_BRATE + {IVAS_13k2, 0, 0, 0}, /* 32k */ + {16000, 11000, 0, 0}, /* 48k */ {16000, 11700, 0, 0}, /* 64k */ -#else - {16000, IVAS_13k2, 0, 0}, /* 64k */ -#endif {20000, 16000, 0, 0}, /* 80k */ -#ifdef TUNING_DISC_3_4obj {IVAS_32k, 20000, 20000, 0}, /* 96k */ -#else - {IVAS_32k, 20000, 0, 0}, /* 96k */ -#endif -#ifdef TUNING_DISC_3_4obj - {IVAS_32k, IVAS_24k4, 20000, 24000}, /* 128k */ -#else - {IVAS_32k, IVAS_24k4, 20000, 16000}, /* 128k */ -#endif - {IVAS_48k, IVAS_32k, IVAS_24k4, 20000}, /* 160k */ + {IVAS_32k, IVAS_24k4, 24000, 24000}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 24000}, /* 160k */ {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ @@ -2847,6 +2831,22 @@ const float dct8[8*8] = 0.3536f, -0.4157f, 0.1913f, 0.0975f, -0.3536f, 0.4904f, -0.4619f, 0.2778f, 0.3536f, -0.4904f, 0.4619f, -0.4157f, 0.3536f, -0.2778f, 0.1913f, -0.0975f }; + +const float dct12[12*12]= +{ + 0.2887f, 0.4048f, 0.3943f, 0.3772f, 0.3536f, 0.3239f, 0.2887f, 0.2485f, 0.2041f, 0.1562f, 0.1057f, 0.0533f, + 0.2887f, 0.3772f, 0.2887f, 0.1562f, 0.0000f, -0.1562f, -0.2887f, -0.3772f, -0.4082f, -0.3772f, -0.2887f, -0.1562f, + 0.2887f, 0.3239f, 0.1057f, -0.1562f, -0.3536f, -0.4048f, -0.2887f, -0.0533f, 0.2041f, 0.3772f, 0.3943f, 0.2485f, + 0.2887f, 0.2485f, -0.1057f, -0.3772f, -0.3536f, -0.0533f, 0.2887f, 0.4048f, 0.2041f, -0.1562f, -0.3943f, -0.3239f, + 0.2887f, 0.1562f, -0.2887f, -0.3772f, -0.0000f, 0.3772f, 0.2887f, -0.1562f, -0.4082f, -0.1562f, 0.2887f, 0.3772f, + 0.2887f, 0.0533f, -0.3943f, -0.1562f, 0.3536f, 0.2485f, -0.2887f, -0.3239f, 0.2041f, 0.3772f, -0.1057f, -0.4048f, + 0.2887f, -0.0533f, -0.3943f, 0.1562f, 0.3536f, -0.2485f, -0.2887f, 0.3239f, 0.2041f, -0.3772f, -0.1057f, 0.4048f, + 0.2887f, -0.1562f, -0.2887f, 0.3772f, 0.0000f, -0.3772f, 0.2887f, 0.1562f, -0.4082f, 0.1562f, 0.2887f, -0.3772f, + 0.2887f, -0.2485f, -0.1057f, 0.3772f, -0.3536f, 0.0533f, 0.2887f, -0.4048f, 0.2041f, 0.1562f, -0.3943f, 0.3239f, + 0.2887f, -0.3239f, 0.1057f, 0.1562f, -0.3536f, 0.4048f, -0.2887f, 0.0533f, 0.2041f, -0.3772f, 0.3943f, -0.2485f, + 0.2887f, -0.3772f, 0.2887f, -0.1562f, -0.0000f, 0.1562f, -0.2887f, 0.3772f, -0.4082f, 0.3772f, -0.2887f, 0.1562f, + 0.2887f, -0.4048f, 0.3943f, -0.3772f, 0.3536f, -0.3239f, 0.2887f, -0.2485f, 0.2041f, -0.1562f, 0.1057f, -0.0533f +}; #endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index ce66e4e2a4..41101bd9b1 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -319,6 +319,7 @@ extern const int32_t sep_object_brate[][MAX_NUM_OBJECTS]; extern const float dct4[]; extern const float dct5[]; extern const float dct8[]; +extern const float dct12[]; #endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index c2cda437a2..c7664a9a41 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -58,9 +58,13 @@ typedef struct int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int16_t ism_imp; /* ISM importance flag */ int16_t ism_vad_flag; +#ifdef OMASA_UPDATES + float q_azimuth_old; + float q_elevation_old; +#endif #endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; @@ -420,7 +424,6 @@ typedef struct ivas_masa_common_spatial_meta_struct } MASA_COMMON_SPATIAL_META; #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE typedef struct ivas_omasa_meta_struct { uint8_t num_dirs; @@ -428,7 +431,6 @@ typedef struct ivas_omasa_meta_struct MASA_COMMON_SPATIAL_META common_meta; } OMASA_SPATIAL_META, *OMASA_SPATIAL_META_HANDLE; #endif -#endif typedef struct ivas_masa_metadata_frame_struct { diff --git a/lib_com/options.h b/lib_com/options.h old mode 100755 new mode 100644 index 4a4fefae31..62011c419e --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,18 +169,8 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS -#define OMASA_BRATE /* VA: combined format bit-budget distribution */ #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ - - - -#define TUNING_DISC_3_4obj /* Nokia: increase bitrate for objects in DISC mode at 128k 4obj and 96k 3 obj */ -#define REDUCE_OMASA_META_BITS /* Nokia: reduce metadata number of bits and fix directional metadata bit allocation */ -#define OMASA_DIFFUSE_ISM_MERGE /* Nokia: Diffuse-energy retaining merging of ISM and MASA */ - -#define FIX_4OBJ_128 /* VA: fix to 4 ISMs 24 kbps case: when all objects are HIGH_IMP, keep 24 kbps bitrate, otherwise increase the 24 kbps bitrate */ - - +#define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index e494cf4881..37034da4f8 100755 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -269,7 +269,7 @@ ivas_error ivas_core_dec( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index eab7b7c340..b093d58805 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -233,20 +233,11 @@ ivas_error ivas_cpe_dec( /* read DFT Stereo side info */ nb_bits = (int16_t) ( ( hCPE->element_brate ) / FRAMES_PER_SEC - 0.8f * sts[0]->bits_frame_nominal ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_BRATE cpe_brate = st_ivas->hCPE[0]->element_brate; -#else - cpe_brate = ivas_total_brate; -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifndef OMASA_BRATE - cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); -#endif sts[1]->bit_stream = sts[0]->bit_stream + cpe_brate / FRAMES_PER_SEC - 1 - nb_bits_metadata; -#ifdef OMASA_BRATE sts[1]->bit_stream += hCPE->brate_surplus / FRAMES_PER_SEC; -#endif } else #endif @@ -278,9 +269,13 @@ ivas_error ivas_cpe_dec( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { sts[0]->total_brate += hCPE->brate_surplus; } @@ -296,7 +291,7 @@ ivas_error ivas_cpe_dec( /* signal bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif if ( st_ivas->hQMetaData != NULL ) @@ -306,10 +301,14 @@ ivas_error ivas_cpe_dec( } else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; @@ -341,9 +340,13 @@ ivas_error ivas_cpe_dec( sts[n]->bits_frame_nominal = (int16_t) ( sts[n]->total_brate / FRAMES_PER_SEC ); sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_channels ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; @@ -674,7 +677,11 @@ ivas_error create_cpe_dec( } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { cpe_brate = element_brate; } @@ -699,7 +706,7 @@ ivas_error create_cpe_dec( set_f( hCPE->prev_synth[n], 0, NS2SA( output_Fs, IVAS_DEC_DELAY_NS - STEREO_DFT32MS_OVL_NS ) ); } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hCPE->brate_surplus = 0; #endif @@ -1108,7 +1115,11 @@ static void read_stereo_mode_and_bwidth( else { /* read stereo technology info */ +#ifdef OMASA_UPDATES + if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k) ) +#else if ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) +#endif { hCPE->element_mode = get_next_indice( sts[0], NBITS_ELEMENT_MODE ) + IVAS_CPE_DFT; } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 1389193a55..80b5d6edd2 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -399,33 +399,18 @@ ivas_error ivas_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifndef OMASA_BRATE - ism_total_brate = 0; -#endif st = st_ivas->hCPE[0]->hCoreCoder[0]; - -#ifndef OMASA_BRATE - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - st->bit_stream = &( st_ivas->bit_stream[( st_ivas->hSCE[0]->element_brate / FRAMES_PER_SEC )] ); - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - ism_total_brate += st_ivas->hSCE[n]->element_brate; - } - st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); - } -#endif - nb_bits_metadata[0] = 0; set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); /* Set the number of objects for the parametric rendering */ if ( st_ivas->hDirAC != NULL ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) +#endif { st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; } @@ -441,15 +426,17 @@ ivas_error ivas_dec( return error; } -#ifdef OMASA_BRATE /* Configuration of combined-format bit-budget distribution */ ivas_set_surplus_brate_dec( st_ivas, &ism_total_brate ); st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); -#endif /* Audio signal decoding */ +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) +#endif { if ( st_ivas->nSCE == 1 ) { @@ -479,11 +466,27 @@ ivas_error ivas_dec( return error; } +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + } + } + else + { + st_ivas->hMasaIsmData->azimuth_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); + st_ivas->hMasaIsmData->elevation_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); + } +#else for ( n = 0; n < st_ivas->nchan_ism; n++ ) { st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); } +#endif } if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) @@ -508,7 +511,42 @@ ivas_error ivas_dec( /* Rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) + { + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; + float gain = 0.7943f; /* Todo Nokia: Temporary gain for roughly matching the loudness of other processing paths. */ + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + v_multc( data_separated_objects[n], gain, data_separated_objects[n], output_frame ); + } + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + delay_signal( data_separated_objects[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); + } + + ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); + ivas_td_binaural_renderer_unwrap( st_ivas->hRenderConfig, st_ivas->ini_frame,st_ivas->hCrendWrapper, + st_ivas->transport_config,st_ivas->hDecoderConfig->output_Fs, st_ivas->hBinRendererTd, + st_ivas->nchan_ism, LFE_CHANNEL, st_ivas->ivas_format, + st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, + ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, data_separated_objects, output_frame ); + + for ( n = 0; n < BINAURAL_CHANNELS; n++ ) + { + v_add( output[n], data_separated_objects[n], output[n], output_frame ); + } + } + else + { + ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); + } +#else ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); +#endif } else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { @@ -516,10 +554,18 @@ ivas_error ivas_dec( } else if ( st_ivas->hDirAC ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { mvr2r( output[2], data_separated_objects[0], output_frame ); } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1cb8e9c1c1..f8e0f98d1b 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2021,7 +2021,11 @@ void ivas_dirac_dec( } } +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) +#endif { preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index f530e8ecce..15519bdee4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1040,7 +1040,11 @@ ivas_error ivas_init_decoder( { k++; } +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { /* one separated object */ st_ivas->nSCE = 1; @@ -1050,7 +1054,24 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifdef OMASA_BRATE +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + int32_t temp_brate[MAX_SCE]; + + if ( ( error = create_ism_metadata_dec( st_ivas, 1, temp_brate ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); + } + } +#else if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); @@ -1106,7 +1127,11 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hCPE[0]->hCoreCoder[n] ); } +#ifdef OMASA_UPDATES + if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1407,6 +1432,25 @@ ivas_error ivas_init_decoder( #endif } +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) + { + /* Use td renderer for the objects in DISC mode */ + error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, + st_ivas->transport_config, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); + if ( ( error ) != IVAS_ERR_OK ) + { + return error; + } + + /* Reserve memory for delay buffer */ + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC && ( st_ivas->renderer_type == RENDERER_TD_PANNING || @@ -2013,7 +2057,11 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbAnalyses += st_ivas->nchan_ism; } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { *numCldfbAnalyses = st_ivas->nchan_transport + 1; } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index e72d691768..4066304dab 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -127,7 +127,11 @@ ivas_error ivas_ism_metadata_dec( /* read number of objects */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode != ISM_MASA_MODE_DISC ) +#endif { #endif num_obj = 1; @@ -164,8 +168,12 @@ ivas_error ivas_ism_metadata_dec( /* Read ISm present flags (one per object) */ for ( ch = 0; ch < *nchan_transport; ch++ ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* ISM importance flag is already read in ivas_masa_decode() */ ism_imp[ch] = hIsmMeta[ch]->ism_imp; @@ -199,8 +207,12 @@ ivas_error ivas_ism_metadata_dec( { if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* VAD flag is already read in ivas_masa_decode() */ localVAD[ch] = hIsmMeta[ch]->ism_vad_flag; @@ -235,7 +247,11 @@ ivas_error ivas_ism_metadata_dec( { hIsmMetaData = hIsmMeta[ch]; #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -399,7 +415,11 @@ ivas_error ivas_ism_metadata_dec( /* save number of metadata bits read */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -489,8 +509,12 @@ ivas_error ivas_ism_metadata_dec( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { ism_metadata_flag_global = 1; } @@ -504,34 +528,33 @@ ivas_error ivas_ism_metadata_dec( { #ifdef MASA_AND_OBJECTS int16_t masa_ism_flag = 0; +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { masa_ism_flag = 1; - } -#endif -#ifdef OMASA_BRATE - if ( ism_mode == ISM_MASA_MODE_DISC ) - { for ( ch = 0; ch < *nchan_transport; ch++ ) { element_brate[ch] = hSCE[ch]->element_brate; } } + ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, masa_ism_flag ); +#else + ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ); #endif - ivas_ism_config( ism_total_brate, *nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata -#ifdef MASA_AND_OBJECTS - , - masa_ism_flag -#endif - ); - for ( ch = 0; ch < *nchan_transport; ch++ ) { hIsmMeta[ch]->last_ism_metadata_flag = hIsmMeta[ch]->ism_metadata_flag; #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -543,8 +566,12 @@ ivas_error ivas_ism_metadata_dec( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode != ISM_MASA_MODE_DISC ) +#endif #endif { hSCE[ch]->element_brate = element_brate[ch]; @@ -616,7 +643,7 @@ ivas_error create_ism_metadata_dec( st_ivas->hIsmMetaData[ch]->last_azimuth_idx = 0; st_ivas->hIsmMetaData[ch]->last_elevation_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS st_ivas->hIsmMetaData[ch]->ism_imp = -1; st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; #endif @@ -624,7 +651,8 @@ ivas_error create_ism_metadata_dec( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } - ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL + + ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL #ifdef MASA_AND_OBJECTS , 0 diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index ef890a7482..043b6f8600 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -283,7 +283,11 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { st_ivas->hMasaIsmData->delayBuffer_nchan = 1; } @@ -341,7 +345,11 @@ void ivas_masa_ism_separate_object_render( hRendererData = st_ivas->hIsmRendererData; lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { single_separated = 1; num_objects = 1; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index f45b1527ff..a0fa5cf0b4 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -74,24 +74,12 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS -static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos -#ifdef REDUCE_OMASA_META_BITS - , - const int16_t idx_separated_object, - const int16_t ism_imp -#endif -); +static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); -static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks -#ifdef REDUCE_OMASA_META_BITS - , - const int16_t idx_separated_object -#endif -); -#endif -#ifdef REDUCE_OMASA_META_BITS +static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object); + static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, const int16_t idx_sep_obj, int16_t *num_zeros ); #endif @@ -118,12 +106,8 @@ ivas_error ivas_masa_decode( ivas_error error; #ifdef MASA_AND_OBJECTS int16_t obj; -#ifdef OMASA_BRATE int16_t i, ch, ism_imp; -#ifdef REDUCE_OMASA_META_BITS ism_imp = 0; -#endif -#endif #endif error = IVAS_ERR_OK; @@ -132,7 +116,11 @@ ivas_error ivas_masa_decode( low_bitrate_mode = -1; /* This means that LBR mode is not used. */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( st_ivas->hOutSetup.separateChannelEnabled ) #endif @@ -184,7 +172,11 @@ ivas_error ivas_masa_decode( st->next_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { /* read index of separated object */ /* nchan_ism should be > 1*/ @@ -193,16 +185,28 @@ ivas_error ivas_masa_decode( st_ivas->hMasaIsmData->idx_separated_ism = 2 * byteBuffer + st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read )++; } -#ifdef REDUCE_OMASA_META_BITS else { st_ivas->hMasaIsmData->idx_separated_ism = -1; } -#endif -#ifdef OMASA_BRATE /* read ISM importance flag (one per object) */ +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + ism_imp = 0; + for ( i = 0; i < ISM_METADATA_FLAG_BITS; i++ ) + { + byteBuffer = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read )++; + ism_imp = ( ism_imp << 1 ) + byteBuffer; + } + st_ivas->hIsmMetaData[0]->ism_imp = ism_imp; + } + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { ism_imp = 0; for ( i = 0; i < ISM_METADATA_FLAG_BITS; i++ ) @@ -212,6 +216,17 @@ ivas_error ivas_masa_decode( ism_imp = ( ism_imp << 1 ) + byteBuffer; } st_ivas->hIsmMetaData[0]->ism_imp = ism_imp; + +#ifdef OMASA_UPDATES + /* reset */ + st_ivas->hIsmMetaData[0]->ism_vad_flag = 1; + if ( st_ivas->hIsmMetaData[0]->ism_imp == ISM_NO_META ) + { + /* read VAD flag */ + st_ivas->hIsmMetaData[0]->ism_vad_flag = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read ) += ISM_METADATA_VAD_FLAG_BITS; + } +#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -236,7 +251,6 @@ ivas_error ivas_masa_decode( } } } -#endif } #endif /* Placeholder for descriptive metadata content */ @@ -302,17 +316,21 @@ ivas_error ivas_masa_decode( #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos -#ifdef REDUCE_OMASA_META_BITS - , - st_ivas->hMasaIsmData->idx_separated_ism, ism_imp #endif - ); + { + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp ); } +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) { @@ -328,7 +346,11 @@ ivas_error ivas_masa_decode( *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos ); #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) +#endif { /* Modify spatial metadata based on the MASA-to-total energy ratios */ modify_masa_energy_ratios( hQMetaData ); @@ -435,9 +457,6 @@ ivas_error ivas_masa_decode( } if ( st_ivas->hDirAC != NULL ) { -#ifndef OMASA_BRATE - int16_t i; -#endif int16_t b; int16_t block; @@ -536,7 +555,11 @@ ivas_error ivas_masa_dec_open( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -615,6 +638,13 @@ ivas_error ivas_masa_ism_data_open( hMasaIsmData->objectsMoved = 0; hMasaIsmData->delayBuffer = NULL; st_ivas->hMasaIsmData = hMasaIsmData; +#ifdef OMASA_UPDATES + for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) + { + hMasaIsmData->q_elevation_old[ch] = 0.0f; + hMasaIsmData->q_azimuth_old[ch] = 0.0f; + } + #endif return IVAS_ERR_OK; } @@ -695,7 +725,11 @@ static ivas_error ivas_masa_dec_config( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -707,7 +741,18 @@ static ivas_error ivas_masa_dec_config( if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); +#ifdef OMASA_UPDATES + if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) + { + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); + } + else + { +#endif + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); +#ifdef OMASA_UPDATES + } +#endif } else { @@ -1376,7 +1421,11 @@ ivas_error ivas_masa_dec_reconfigure( } #ifdef MASA_AND_OBJECTS ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( n = 0; n < st_ivas->nSCE; n++ ) { @@ -1713,7 +1762,6 @@ static void decode_index_slice( } -#ifdef REDUCE_OMASA_META_BITS static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o: ISM read ratio indexes */ const int16_t nchan_ism, /* i: number of objects */ @@ -1747,7 +1795,7 @@ static void read_ism_ratio_index( b_signif = 0; no_levels_ratio_ism = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); - while ( b_signif < numCodingBands && masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR ) + while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) { /* distribute evenly the objects */ distribute_evenly_ism( ratio_ism_idx[b_signif], no_levels_ratio_ism, nchan_ism ); @@ -1985,170 +2033,7 @@ static void read_ism_ratio_index( } -#else -static void read_ism_ratio_index( - int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - int16_t no_ism, - int16_t numCodingBands, - int16_t sf, - int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - uint16_t *bit_stream, - int16_t *next_bit_pos, - float *masa_to_total_energy_ratio ) -{ - int16_t b, i; - int16_t index; - int16_t GR_order, differential_subframe; - int16_t buf; - int16_t no_levels_ratio_ism; - no_levels_ratio_ism = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); - if ( sf == 0 ) - { - switch ( no_ism ) - { - case 2: - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - index = 0; - for ( i = 0; i < 3; i++ ) - { - index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; - } - - decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); - } - else - { - /* distribute evenly the objects */ - distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); - } - } - break; - case 3: - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - /* read first 5 bits */ - index = 0; - for ( i = 0; i < 5; i++ ) - { - index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; - } - if ( index == 31 ) - { - index = 0; - for ( i = 0; i < 3; i++ ) - { - index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; - } - index += 31; - } - - decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); - } - else - { - /* distribute evenly the objects */ - distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); - } - } - break; - case 4: - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - /* read 7 bits */ - index = 0; - for ( i = 0; i < 7; i++ ) - { - index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; - } - - decode_index_slice( index, ratio_ism_idx[b], no_ism, no_levels_ratio_ism ); - } - else - { - /* distribute evenly the objects */ - distribute_evenly_ism( ratio_ism_idx[b], no_levels_ratio_ism, no_ism ); - } - } - break; - default: - assert( ( no_ism >= 2 && no_ism <= 4 ) && "Wrong number of objects for MASA_ISM." ); - break; - } - } - else - { - if ( numCodingBands > 1 ) - { - /* read prediction type */ - differential_subframe = bit_stream[( *next_bit_pos )--]; - } - else - { - differential_subframe = 1; - } - /* read GR order */ - GR_order = bit_stream[( *next_bit_pos )--]; - for ( b = 0; b < numCodingBands; b++ ) - { - for ( i = 0; i < no_ism - 1; i++ ) - { - buf = ivas_qmetadata_DecodeExtendedGR( bit_stream, next_bit_pos, 100, GR_order ); - if ( ( buf % 2 ) == 0 ) - { - ratio_ism_idx[b][i] = -( buf >> 1 ); - } - else - { - ratio_ism_idx[b][i] = ( ( buf + 1 ) >> 1 ); - } - } - } - if ( differential_subframe ) - { - /* differential to previous subframe */ - for ( b = 0; b < numCodingBands; b++ ) - { - ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; - for ( i = 0; i < no_ism - 1; i++ ) - { - ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx_prev_sf[b][i]; - ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; - } - } - } - else - { - /* difference to previous subband */ - ratio_ism_idx[0][no_ism - 1] = no_levels_ratio_ism; - /* first subband - differential to previous subframe */ - for ( i = 0; i < no_ism - 1; i++ ) - { - ratio_ism_idx[0][i] = ratio_ism_idx[0][i] + ratio_ism_idx_prev_sf[0][i]; - ratio_ism_idx[0][no_ism - 1] -= ratio_ism_idx[0][i]; - } - /* rest of subbands differential to previous subband */ - for ( b = 1; b < numCodingBands; b++ ) - { - ratio_ism_idx[b][no_ism - 1] = no_levels_ratio_ism; - for ( i = 0; i < no_ism - 1; i++ ) - { - ratio_ism_idx[b][i] = ratio_ism_idx[b][i] + ratio_ism_idx[b - 1][i]; - ratio_ism_idx[b][no_ism - 1] -= ratio_ism_idx[b][i]; - } - } - } - } - return; -} -#endif static void decode_ism_ratios( @@ -2158,32 +2043,22 @@ static void decode_ism_ratios( float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* o : ISM ratios */ const int16_t n_ism, /* i : number of objects */ const int16_t nbands, /* i : number of subbands */ - const int16_t numSf /* i : number of subframes */ -#ifdef REDUCE_OMASA_META_BITS - , + const int16_t numSf, /* i : number of subframes */ const int16_t idx_separated_object /* i: index of separated object */ -#endif ) { int16_t sf, band; int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; -#ifdef REDUCE_OMASA_META_BITS float tmp; int16_t num_zeros; num_zeros = 0; -#endif + /* hQMetaData->q_direction->cfg.nblocks; */ for ( sf = 0; sf < numSf; sf++ ) { /* read ism ratio indexes */ - read_ism_ratio_index( ratio_ism_idx, n_ism, nbands, sf, ratio_ism_idx_prev_sf, bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio[sf] -#ifdef REDUCE_OMASA_META_BITS - , - idx_separated_object, - &num_zeros -#endif - ); + read_ism_ratio_index( ratio_ism_idx, n_ism, nbands, sf, ratio_ism_idx_prev_sf, bit_stream, next_bit_pos, hQMetaData->masa_to_total_energy_ratio[sf], idx_separated_object, &num_zeros ); /* save previous subframe index values */ if ( sf < numSf - 1 ) @@ -2200,7 +2075,7 @@ static void decode_ism_ratios( { reconstruct_ism_ratios( ratio_ism_idx[band], n_ism, 1.0f / (float) ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ), ratio_ism[sf][band] ); } -#ifdef REDUCE_OMASA_META_BITS + if ( ( n_ism > 2 ) && ( idx_separated_object == n_ism - 1 ) ) { /* rotate */ @@ -2214,7 +2089,7 @@ static void decode_ism_ratios( } } } -#endif + if ( nbands == 1 ) { for ( band = 1; band < 5; band++ ) @@ -2245,26 +2120,22 @@ static int16_t ivas_decode_masaism_metadata( MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, - int16_t *next_bit_pos -#ifdef REDUCE_OMASA_META_BITS - , + int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp -#endif ) { int16_t sf, band, dir, nbands, nblocks, obj, i; float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t *band_mapping; int16_t b; -#ifndef REDUCE_OMASA_META_BITS - float priority[MAX_NUM_OBJECTS]; -#endif int16_t bits_ism[MAX_NUM_OBJECTS], index; uint16_t idx_el, idx_az; float azimuth, elevation; int16_t nb_bits_read; - +#ifdef OMASA_UPDATES + float delta_phi; +#endif nb_bits_read = *next_bit_pos; nbands = hQMetaData->q_direction->cfg.nbands; nblocks = hQMetaData->q_direction->cfg.nblocks; /* To do: what if other value than 4? */ @@ -2274,26 +2145,7 @@ static int16_t ivas_decode_masaism_metadata( if ( nchan_ism > 1 ) { /* read ISM ratios */ - decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism, nbands, nblocks -#ifdef REDUCE_OMASA_META_BITS - , - idx_separated_object -#endif - ); -#ifndef REDUCE_OMASA_META_BITS - /* calculate priority */ - set_f( priority, 0.0f, nchan_ism ); - for ( sf = 0; sf < nblocks; sf++ ) - { - for ( band = 0; band < nbands; band++ ) - { - for ( obj = 0; obj < nchan_ism; obj++ ) - { - priority[obj] = max( priority[obj], ( energy_ratio_ism[sf][band][obj] * hQMetaData->masa_to_total_energy_ratio[sf][band] ) ); - } - } - } -#endif + decode_ism_ratios( bit_stream, next_bit_pos, hQMetaData, energy_ratio_ism, nchan_ism, nbands, nblocks, idx_separated_object ); } else { @@ -2304,31 +2156,73 @@ static int16_t ivas_decode_masaism_metadata( energy_ratio_ism[sf][band][0] = 1.0f; } } -#ifndef REDUCE_OMASA_META_BITS - priority[0] = 1; -#endif } /* read ISM metadata */ -#ifdef REDUCE_OMASA_META_BITS calculate_nbits_meta( nchan_ism, energy_ratio_ism, hQMetaData->masa_to_total_energy_ratio, nblocks, nbands, bits_ism, idx_separated_object, ism_imp ); -#else - for ( obj = 0; obj < nchan_ism; obj++ ) - { - bits_ism[obj] = 11 - (int16_t) ( ( 1 - priority[obj] ) * 7 ); - } -#endif for ( obj = 0; obj < nchan_ism; obj++ ) { index = 0; +#ifdef OMASA_UPDATES + if ( bits_ism[obj] < 8 ) /* if low resolution, can look to the past */ + { + /* read if same as previous */ + if ( bit_stream[( *next_bit_pos )--] ) + { + azimuth = hMasaIsmData->q_azimuth_old[obj]; + elevation = hMasaIsmData->q_elevation_old[obj]; + } + else + { + for ( i = 0; i < bits_ism[obj]; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); + + if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 ) + { + delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ + if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) + { + azimuth -= delta_phi; + } + else + { + if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi ) + { + azimuth += delta_phi; + } + } + } + + hMasaIsmData->q_azimuth_old[obj] = azimuth; + hMasaIsmData->q_elevation_old[obj] = elevation; + } + } + else + { + for ( i = 0; i < bits_ism[obj]; i++ ) + { + index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; + } + deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); + hMasaIsmData->q_azimuth_old[obj] = azimuth; + hMasaIsmData->q_elevation_old[obj] = elevation; + } +#else for ( i = 0; i < bits_ism[obj]; i++ ) { index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; } deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); + + +#endif hMasaIsmData->azimuth_ism[obj] = (int16_t) rint( azimuth ); hMasaIsmData->elevation_ism[obj] = (int16_t) rint( elevation ); + } /* Modify ISM metadata based on the MASA-to-total energy ratios */ @@ -2396,6 +2290,12 @@ void ivas_masa_ism_set_edited_objects( hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism] = st_ivas->elevation_edited; } } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + /* Directions cannot be edited in this mode */ + } +#endif else { for ( dir = 0; dir < MAX_NUM_OBJECTS; dir++ ) @@ -2412,7 +2312,11 @@ void ivas_masa_ism_set_edited_objects( } } +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->editing_ism_enabled ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st_ivas->editing_ism_enabled ) +#endif { if ( st_ivas->hMasaIsmData->idx_separated_ism == st_ivas->index_of_edited_ism ) { diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index cea03fa185..a0ba899f0d 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -101,7 +101,11 @@ void ivas_mono_downmix_render_passive( { numInputChannels = st_ivas->nchan_transport; } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { numInputChannels = st_ivas->nchan_transport + 1; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 5ca00ff79e..35441360fe 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -40,7 +40,7 @@ #endif -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------------------* * ivas_set_surplus_brate_dec() * @@ -57,6 +57,11 @@ void ivas_set_surplus_brate_dec( *ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + *ism_total_brate = ivas_interformat_brate( st_ivas->ism_mode, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ); +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { *ism_total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp @@ -65,10 +70,15 @@ void ivas_set_surplus_brate_dec( 0 #endif ); +#endif st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; +#ifdef OMASA_UPDATES + /* set 'st->total_brate'; there are no meta-data in ISM_MASA_MODE_PARAM_ONE_OBJ mode */ +#else /* set 'st->total_brate'; there are no meta-data in ISM_MASA_MODE_ONE_OBJ mode */ +#endif st_ivas->hSCE[0]->hCoreCoder[0]->total_brate = *ism_total_brate; st_ivas->hSCE[0]->hCoreCoder[0]->low_rate_mode = 0; @@ -79,14 +89,16 @@ void ivas_set_surplus_brate_dec( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { -#ifdef FIX_4OBJ_128 - int16_t brate_limit_flag = 0; - +#ifdef OMASA_UPDATES + int16_t brate_limit_flag, ism_imp[MAX_NUM_OBJECTS]; + for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - brate_limit_flag += st_ivas->hIsmMetaData[n]->ism_imp; + ism_imp[n] = st_ivas->hIsmMetaData[n]->ism_imp; } - brate_limit_flag = brate_limit_flag >= 10 ? 1 : 0; + + brate_limit_flag = calculate_brate_limit_flag( ism_imp, st_ivas->nchan_ism ); + #endif ism_total_brate_ref = 0; @@ -106,7 +118,7 @@ void ivas_set_surplus_brate_dec( st_ivas->hSCE[n]->element_brate = element_brate[n]; *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp -#ifdef FIX_4OBJ_128 +#ifdef OMASA_UPDATES , brate_limit_flag #endif diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 944f185dd1..ab3131d3b3 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -3450,6 +3450,10 @@ void decode_masa_to_total( matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); mvr2r( dct_data_tmp, q_dct_data, nbands ); break; + case 12: + matrix_product( dct12, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; case 20: matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ @@ -3459,6 +3463,7 @@ void decode_masa_to_total( matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); break; default: + printf( "Incorrect number of coefficients for OMASA.\n" ); break; } diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 810c7cca66..2072f25460 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -158,11 +158,19 @@ ivas_error ivas_sce_dec( ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) { #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL ); } +#ifdef OMASA_UPDATES + else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) +#else else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif #else if ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) #endif @@ -193,19 +201,9 @@ ivas_error ivas_sce_dec( { st->total_brate = ivas_total_brate; } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT ) /* note: total_brate[] is set in ivas_ism_config() or ivas_set_surplus_brate_dec() */ #else -#ifdef MASA_AND_OBJECTS - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - /* one separated object */ - st->total_brate = hSCE->element_brate; - } - } -#endif else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ #endif { @@ -218,11 +216,15 @@ ivas_error ivas_sce_dec( /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) && +#else if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC #ifdef OMASA_BRATE || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ #endif ) && +#endif st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) #else if ( st_ivas->ivas_format == ISM_FORMAT && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 3f48468c42..4316c90677 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -933,7 +933,7 @@ typedef struct cpe_dec_data_structure float old_out_mdct[STEREO_MDCT2DFT_FADE_LEN_48k]; float old_outLB_mdct[2 * STEREO_MDCT2DFT_FADE_LEN_48k]; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ #endif @@ -1138,6 +1138,10 @@ typedef struct ivas_masa_ism_data_structure int16_t idx_separated_ism; int16_t azimuth_separated_ism; int16_t elevation_separated_ism; +#ifdef OMASA_UPDATES + float q_azimuth_old[MAX_NUM_OBJECTS]; + float q_elevation_old[MAX_NUM_OBJECTS]; +#endif float ismPreprocMatrix[2][2][CLDFB_NO_CHANNELS_MAX]; uint8_t objectsMoved; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 20d03915c2..20a7d58bc2 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -768,7 +768,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hCoreCoder[0]->bfi == 0 ) { st = hCPE->hCoreCoder[1]; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate + hCPE->brate_surplus, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + ( hCPE->brate_surplus / FRAMES_PER_SEC ) - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); #else hCPE->hStereoTD->tdm_LRTD_flag = get_indice_st( hCPE->hCoreCoder[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS - TDM_LR_CONTENT_BITS ), TDM_LR_CONTENT_BITS ); diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 9809b759f8..31b66044c6 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -94,7 +94,7 @@ void tdm_configure_dec( int16_t tdm_tmp_SM_LRTD_flag; int16_t mod_ct, core, bits_offset; int16_t idx_LRTD_pri_side, tdm_inst_ratio_idx; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int32_t element_brate_adapt; int16_t bstr_last_pos; #endif @@ -102,7 +102,7 @@ void tdm_configure_dec( hStereoTD = hCPE->hStereoTD; sts = hCPE->hCoreCoder; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS element_brate_adapt = hCPE->element_brate + hCPE->brate_surplus; bstr_last_pos = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata + (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif @@ -132,7 +132,7 @@ void tdm_configure_dec( /* Get few parameters needed to decode the bitrate allocated to each channel */ /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); #else sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING ); @@ -164,7 +164,7 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ /* Get the correlation ratio */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS *tdm_ratio_idx = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); #else *tdm_ratio_idx = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS ), TDM_RATIO_BITS ); @@ -174,7 +174,7 @@ void tdm_configure_dec( if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); #else hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); @@ -184,7 +184,7 @@ void tdm_configure_dec( else { /* Get the flag on the LPC reusage */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); #else hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS ), TDM_LP_REUSE_BITS ); @@ -244,7 +244,7 @@ void tdm_configure_dec( int16_t tmpS = 20; if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS tmpS = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); #else tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD ); @@ -257,7 +257,7 @@ void tdm_configure_dec( { if ( hStereoTD->tdm_LRTD_flag == 0 ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hCPE->hStereoTCA->refChanIndx = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS, STEREO_BITS_TCA_CHAN ); hCPE->hStereoTCA->indx_ica_NCShift = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN, STEREO_BITS_TCA_CORRSTATS ); hCPE->hStereoTCA->indx_ica_gD = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD ); @@ -285,7 +285,7 @@ void tdm_configure_dec( #endif /* set the BW of the secondary channel */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel > IVAS_16k4 / FRAMES_PER_SEC ) #else if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 ) @@ -304,7 +304,7 @@ void tdm_configure_dec( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 0f6d709fc2..579f74c6d6 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -102,7 +102,7 @@ ivas_error ivas_core_enc( float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int16_t diff_nBits; #endif ivas_error error; @@ -190,7 +190,7 @@ ivas_error ivas_core_enc( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ @@ -420,7 +420,7 @@ ivas_error ivas_core_enc( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Write potentially unused bits in combined format coding *-----------------------------------------------------------------*/ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index cf69b1e333..e3b8342896 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -166,7 +166,18 @@ ivas_error ivas_cpe_enc( if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL ) { - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && ivas_total_brate == IVAS_48k ) + { + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k ); + } + else + { +#endif + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); +#ifdef OMASA_UPDATES + } +#endif } if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) @@ -274,7 +285,7 @@ ivas_error ivas_cpe_enc( { #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) - { + { stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.70f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else @@ -308,10 +319,14 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode == IVAS_CPE_MDCT ) { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; @@ -336,9 +351,13 @@ ivas_error ivas_cpe_enc( sts[n]->bits_frame_channel = (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) / n_CoreChannels ); sts[n]->total_brate = hCPE->element_brate / n_CoreChannels; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; @@ -398,7 +417,7 @@ ivas_error ivas_cpe_enc( /* signal the bitrate for BW selection in the SCh */ sts[0]->bits_frame_channel = 0; sts[1]->bits_frame_channel = (int16_t) ( hCPE->element_brate / FRAMES_PER_SEC ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS sts[1]->bits_frame_channel += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); #endif if ( st_ivas->hQMetaData != NULL ) @@ -630,16 +649,7 @@ ivas_error ivas_cpe_enc( /* Write stereo bitstream */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_BRATE cpe_brate = st_ivas->hCPE[0]->element_brate; -#else - cpe_brate = ivas_total_brate; - - if ( ivas_format == MASA_ISM_FORMAT ) - { - cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, hEncoderConfig->nchan_ism ); - } -#endif /* DFT stereo side bits */ if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && cpe_brate < MASA_STEREO_MIN_BITRATE && sts[0]->core_brate != SID_2k40 && sts[0]->core_brate != FRAME_NO_DATA ) @@ -662,9 +672,7 @@ ivas_error ivas_cpe_enc( if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) { max_bits -= nb_bits_metadata; -#ifdef OMASA_BRATE max_bits += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC ); -#endif } stereo_dft_enc_res( hCPE->hStereoDft, old_inp_12k8[1] + L_INP_MEM - STEREO_DFT_OVL_8k, hCPE->hMetaData, &nb_bits, max_bits ); @@ -704,9 +712,13 @@ ivas_error ivas_cpe_enc( /* subtract metadata bitbudget */ sts[0]->total_brate -= ( nb_bits_metadata * FRAMES_PER_SEC ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { sts[0]->total_brate += hCPE->brate_surplus; } @@ -866,7 +878,7 @@ ivas_error create_cpe_enc( hCPE->hFrontVad[0] = NULL; hCPE->hFrontVad[1] = NULL; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hCPE->brate_surplus = 0; #endif diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 7b4685251f..afb4fc8ac7 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -404,8 +404,11 @@ void ivas_signaling_enc( /*-------------------------------------------------------------------------- * Write element mode info *--------------------------------------------------------------------------*/ - +#ifdef OMASA_UPDATES + if ( (st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ +#else if ( st->element_mode >= IVAS_CPE_DFT && element_brate < MIN_BRATE_MDCT_STEREO && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ +#endif { ind = st->element_mode - IVAS_CPE_DFT; push_indice( hBstr, IND_SMODE, ind, NBITS_ELEMENT_MODE ); diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index a3adbda9b6..de247c0a56 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -249,11 +249,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL -#ifdef REDUCE_OMASA_META_BITS - , - 0 -#endif + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ); } @@ -314,7 +310,6 @@ ivas_error ivas_enc( /* nb_bits_metadata[0] = 0; */ set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); -#ifdef OMASA_BRATE /* Configure MASA encoder based on frame parameters */ if ( ( error = ivas_masa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { @@ -325,12 +320,7 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs -#ifdef OMASA_DIFFUSE_ISM_MERGE - , - st_ivas->ism_mode -#endif - ); + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); } /* Estimate TF-tile energy for the input MASA stream */ @@ -340,22 +330,31 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Estimate MASA parameters for the objects */ -#ifdef OMASA_DIFFUSE_ISM_MERGE ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); -#else - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, data_separated_object, &idx_separated_object ); -#endif } /* Encode ISMs transport channels */ n = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { if ( ( error = ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) /* there are no metadata bits in SCE in this mode */ { return error; } } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { /* Analysis, decision about bitrates per channel & core coding */ @@ -369,7 +368,7 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa -#ifdef REDUCE_OMASA_META_BITS +#ifdef MASA_AND_OBJECTS , st_ivas->hIsmMetaData[0]->ism_imp #endif @@ -381,58 +380,7 @@ ivas_error ivas_enc( #else ivas_set_surplus_brate_enc( st_ivas ); #endif -#else - if ( st_ivas->hQMetaData != NULL ) - { - /* Configure MASA encoder based on frame parameters */ - ivas_masa_enc_config( st_ivas ); - idx_separated_object = 0; - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, -#ifdef OMASA_DIFFUSE_ISM_MERGE - , - st_ivas->ism_mode -#endif - ); - } - else - { - st_ivas->nSCE = hEncoderConfig->nchan_ism; - } - /* Estimate TF-tile energy for the input MASA stream */ - ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport ); - - /* put audio object data in SCE's */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - /* Estimate MASA parameters for the objects */ - ivas_omasa_enc( st_ivas->hOMasa, st_ivas->hQMetaData, st_ivas->hMasa, st_ivas->hIsmMetaData, data_f, input_frame, st_ivas->nchan_transport, hEncoderConfig->nchan_ism, st_ivas->ism_mode, - data_separated_object, &idx_separated_object ); - } - /* Encode MASA parameters and write MASA metadata bitstream */ - ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa ); - } - - /* Encode transport signals */ - n = 0; - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ); /* there are no metadata bits in SCE in this mode */ - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - /* Analysis, decision about bitrates per channel & core coding */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } - n = hEncoderConfig->nchan_ism; - } -#endif /* OMASA_BRATE */ /* Encode MASA transport channels */ if ( ( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) @@ -497,11 +445,7 @@ ivas_error ivas_enc( ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL -#ifdef REDUCE_OMASA_META_BITS - , - 0 -#endif + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ); diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 7987431f48..1b6e2bd596 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -630,8 +630,11 @@ ivas_error ivas_init_encoder( return error; } } - - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) +#ifdef OMASA_UPDATES + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM) ) +#else + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) +#endif { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 5505976d05..13f804aba2 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -265,7 +265,7 @@ ivas_error ivas_ism_enc( } #endif ivas_ism_metadata_enc( -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS &st_ivas->hEncoderConfig->ivas_total_brate, #else st_ivas->hEncoderConfig->ivas_total_brate, @@ -274,7 +274,7 @@ ivas_error ivas_ism_enc( #ifdef MASA_AND_OBJECTS , st_ivas->nSCE -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS , -1 #endif @@ -284,11 +284,13 @@ ivas_error ivas_ism_enc( else /* ISM_MODE_DISC */ { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_BRATE int32_t ism_total_brate_ref; -#endif int32_t ism_total_brate; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { ism_total_brate = 0; for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -301,7 +303,6 @@ ivas_error ivas_ism_enc( ism_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; } -#ifdef OMASA_BRATE ism_total_brate_ref = ism_total_brate; // VE: change the interface of the following function and call it with 'st_ivas' only @@ -311,9 +312,7 @@ ivas_error ivas_ism_enc( { st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - ism_total_brate; } -#else - ivas_ism_metadata_enc( ism_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, st_ivas->nSCE ); -#endif + #else 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 ); #endif @@ -348,7 +347,11 @@ ivas_error ivas_ism_enc( * CoreCoders encoding *-----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { n = st_ivas->nSCE; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 43c498bcd0..97b689b5dd 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -146,7 +146,7 @@ static void rate_ism_importance( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_enc( -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int32_t *ism_total_brate, /* i/o: ISms total bitrate */ #else const int32_t ism_total_brate, /* i : ISms total bitrate */ @@ -161,12 +161,9 @@ ivas_error ivas_ism_metadata_enc( const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Enc Handle */ #ifdef MASA_AND_OBJECTS , - const int16_t n_ism /* i : number of objects */ -#ifdef OMASA_BRATE - , + const int16_t n_ism, /* i : number of objects */ const float lp_noise_CPE #endif -#endif ) { int16_t i, ch, nb_bits_start = 0, diff; @@ -195,7 +192,11 @@ ivas_error ivas_ism_metadata_enc( num_obj = nchan_transport; } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + else if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { num_obj = n_ism; } @@ -205,7 +206,11 @@ ivas_error ivas_ism_metadata_enc( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: incorrect ISM mode" ); } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + 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 || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else 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 || ism_mode == ISM_MASA_MODE_DISC ) ) +#endif #else 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 ) #endif @@ -222,8 +227,12 @@ ivas_error ivas_ism_metadata_enc( set_s( flag_abs_azimuth, 0, num_obj ); set_s( flag_abs_elevation, 0, num_obj ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { n_ch = num_obj; } @@ -232,7 +241,11 @@ ivas_error ivas_ism_metadata_enc( n_ch = nchan_transport; } +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /*----------------------------------------------------------------* * Rate importance of particular ISm streams in combined format coding @@ -331,7 +344,11 @@ ivas_error ivas_ism_metadata_enc( /*Todo: Nokia check where we transmit the number of objects */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode != ISM_MASA_MODE_DISC ) +#endif { #endif /* write number of objects - unary coding */ @@ -351,8 +368,12 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_transport; ch++ ) #endif { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* ISM importance flag will be written in ivas_masa_encode() */ hIsmMeta[ch]->ism_imp = ism_imp[ch]; @@ -370,7 +391,11 @@ ivas_error ivas_ism_metadata_enc( ism_metadata_flag_global |= hIsmMeta[ch]->ism_metadata_flag; } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -382,8 +407,12 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_transport; ch++ ) #endif { -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* reset */ hIsmMeta[ch]->ism_vad_flag = 1; @@ -393,8 +422,12 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { /* this flag distinguishes between coding of inactive frame and active frame w/o. metadata */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* VAD flag will be written in ivas_masa_encode() */ hIsmMeta[ch]->ism_vad_flag = localVAD[ch]; @@ -426,7 +459,11 @@ ivas_error ivas_ism_metadata_enc( { hIsmMetaData = hIsmMeta[ch]; #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -442,7 +479,11 @@ ivas_error ivas_ism_metadata_enc( /* Azimuth quantization (quantize azimuth to the AZIMUTH_NBITS-bit index */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -552,7 +593,11 @@ ivas_error ivas_ism_metadata_enc( /* Elevation quantization (quantize azimuth to the ELEVATION_NBITS-bit index */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -685,7 +730,11 @@ ivas_error ivas_ism_metadata_enc( /* save number of metadata bits written */ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) +#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -816,22 +865,22 @@ ivas_error ivas_ism_metadata_enc( } } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------* * Take into account the combined format bit-budget distribution *----------------------------------------------------------------*/ +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + +#else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; -#ifdef FIX_4OBJ_128 - int16_t brate_limit_flag = 0; - - for ( ch = 0; ch < num_obj; ch++ ) - { - brate_limit_flag += ism_imp[ch]; - } - brate_limit_flag = brate_limit_flag >= 10 ? 1 : 0; +#ifdef OMASA_UPDATES + int16_t brate_limit_flag; + brate_limit_flag = calculate_brate_limit_flag( ism_imp, num_obj ); #endif bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); @@ -842,10 +891,14 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate = 0; for ( ch = 0; ch < num_obj; ch++ ) { +#ifdef OMASA_UPDATES + *ism_total_brate += ivas_interformat_brate( ism_mode, num_obj, hSCE[ch]->element_brate, ism_imp[ch],brate_limit_flag +#else *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, num_obj, hSCE[ch]->element_brate, ism_imp[ch] #ifdef FIX_4OBJ_128 , brate_limit_flag +#endif #endif ); } @@ -858,12 +911,23 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + ivas_ism_config( *ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, 1 ); // VE: this funtion should return an error + } + else + { + ivas_ism_config( *ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, 0 ); // VE: this funtion should return an error + } +#else #ifdef OMASA_BRATE ivas_ism_config( *ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, ism_mode == ISM_MASA_MODE_DISC ); // VE: this funtion should return an error #else ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, ( ism_mode == ISM_MASA_MODE_DISC ) ); #endif +#endif #else ivas_ism_config( ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata ); #endif @@ -876,7 +940,6 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS for ( ch = 0; ch < n_ch; ch++ ) { -#ifdef OMASA_BRATE hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; if ( ism_mode == ISM_MODE_DISC ) { @@ -887,7 +950,11 @@ ivas_error ivas_ism_metadata_enc( hSCE[ch]->element_brate = element_brate[ch]; } +#ifdef OMASA_UPDATES + else if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else else if ( ism_mode == ISM_MASA_MODE_DISC ) +#endif { if ( ism_imp[ch] == ISM_INACTIVE_IMP ) { @@ -896,19 +963,6 @@ ivas_error ivas_ism_metadata_enc( } hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) - { - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; - if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) - { - hSCE[ch]->hCoreCoder[0]->low_rate_mode = 1; - } - } - - hSCE[ch]->element_brate = element_brate[ch]; - hSCE[ch]->hCoreCoder[0]->total_brate = total_brate[ch]; -#endif /* write metadata only in active frames */ if ( hSCE[0]->hCoreCoder[0]->core_brate > SID_2k40 ) @@ -969,7 +1023,12 @@ ivas_error create_ism_metadata_enc( st_ivas->nCPE = 1; st_ivas->nSCE = 0; break; +#ifdef OMASA_UPDATES + case ISM_MASA_MODE_MASA_ONE_OBJ: + case ISM_MASA_MODE_PARAM_ONE_OBJ: +#else case ISM_MASA_MODE_ONE_OBJ: +#endif st_ivas->nCPE = 1; st_ivas->nSCE = 1; break; @@ -1034,9 +1093,13 @@ ivas_error create_ism_metadata_enc( st_ivas->hIsmMetaData[ch]->elevation_diff_cnt = ISM_FEC_MAX - 1; st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS st_ivas->hIsmMetaData[ch]->ism_imp = -1; st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; +#ifdef OMASA_UPDATES + st_ivas->hIsmMetaData[ch]->q_azimuth_old = 0.0f; + st_ivas->hIsmMetaData[ch]->q_elevation_old = 0.0f; +#endif #endif ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); @@ -1044,7 +1107,11 @@ ivas_error create_ism_metadata_enc( #ifdef MASA_AND_OBJECTS if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, 1, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ); } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index f31badf9b3..07c313f002 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -45,11 +45,6 @@ *-----------------------------------------------------------------------*/ static void combine_freqbands_and_subframes( MASA_ENCODER_HANDLE hMasa ); -#ifdef MASA_AND_OBJECTS -#ifndef OMASA_DIFFUSE_ISM_MERGE -static void combine_directions( MASA_ENCODER_HANDLE hMasa ); -#endif -#endif static void find_n_largest( const float *input, int16_t *largestIndices, const int16_t numElements, const int16_t numLargest ); @@ -62,45 +57,25 @@ static void compensate_energy_ratios( MASA_ENCODER_HANDLE hMasa ); static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate ); #ifdef MASA_AND_OBJECTS -#ifndef OMASA_DIFFUSE_ISM_MERGE -static void ivas_merge_masa_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); -#endif - -static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks -#ifdef REDUCE_OMASA_META_BITS - , - const int16_t idx_separated_object, - const int16_t ism_imp -#endif -); +static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks, + const int16_t idx_separated_object, const int16_t ism_imp ); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); -static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, const int16_t nchan_ism, const float masa_to_total_energy_ratio -#ifdef REDUCE_OMASA_META_BITS - , - const int16_t idx_sep_object -#endif -); +static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, const int16_t nchan_ism, const float masa_to_total_energy_ratio, const int16_t idx_sep_object ); static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); -static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio -#ifdef REDUCE_OMASA_META_BITS - , - const int16_t shift_one, - const int16_t idx_sep_obj -#endif -); +static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); static void transform_index_and_GR_encode( int16_t *diff_idx, int16_t len, int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); static void transform_difference_index( int16_t *diff_idx, int16_t *idx, int16_t len ); -#ifdef REDUCE_OMASA_META_BITS + static void independent_coding_ratio_ism_idx( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const float *masa_to_total_energy_ratio, int16_t nchan_ism, int16_t numCodingBands, int16_t bits_index, BSTR_ENC_HANDLE hMetaData ); static void remove_sep_obj( int16_t *diff_idx, int16_t no_ism, int16_t idx_sep_obj ); -#endif + #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif @@ -167,7 +142,11 @@ ivas_error ivas_masa_enc_open( } #ifdef MASA_AND_OBJECTS ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -205,7 +184,7 @@ ivas_error ivas_masa_enc_open( set_zero( hMasa->data.lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES ); hMasa->data.prevq_lfeToTotalEnergyRatio = 0.0f; hMasa->data.prevq_lfeIndex = 0; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS hMasa->data.lp_noise_CPE = -1; #endif @@ -274,11 +253,8 @@ void ivas_masa_encode( const int16_t nchan_ism, /* i : number of ISM channels */ ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ - OMASA_ENC_HANDLE hOMasa /* i : OMASA encoder handle */ -#ifdef REDUCE_OMASA_META_BITS - , - int16_t ism_imp /* i: importance of separated object */ -#endif + OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ + int16_t ism_imp /* i: importance of separated object */ #endif ) { @@ -339,16 +315,15 @@ void ivas_masa_encode( #endif { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE +#ifdef OMASA_UPDATES + if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) || ( ivas_format != MASA_ISM_FORMAT ) ) +#else if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) || ( ivas_format != MASA_ISM_FORMAT ) ) +#endif { /* Combine directions */ ivas_masa_combine_directions( hMasa ); } -#else - /* Combine directions */ - combine_directions( hMasa ); -#endif #else /* Combine directions */ combine_directions( hMasa ); @@ -384,19 +359,40 @@ void ivas_masa_encode( hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; /* write index of separated object if needed */ +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && hMasa->data.nchan_ism > 1 ) +#else if ( ism_mode == ISM_MASA_MODE_ONE_OBJ && hMasa->data.nchan_ism > 1 ) +#endif { push_next_indice( hMetaData, idx_separated_object, NO_BITS_MASA_ISM_NO_OBJ ); hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; } -#ifdef OMASA_BRATE /* write ISM importance flag (one per object) */ +#ifdef OMASA_UPDATES + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif + { + push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; + } +#ifdef OMASA_UPDATES + else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; + + if ( hIsmMetaData[0]->ism_metadata_flag == 0 ) + { + /* write VAD flag */ + push_next_indice( hMetaData, hIsmMetaData[0]->ism_vad_flag, ISM_METADATA_VAD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; + } } +#endif else if ( ism_mode == ISM_MASA_MODE_DISC ) { for ( i = 0; i < nchan_ism; i++ ) @@ -412,7 +408,6 @@ void ivas_masa_encode( } } } -#endif } else { @@ -444,25 +439,13 @@ void ivas_masa_encode( /* Move data from encoder to qmetadata */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) -#else - if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) -#endif #else if ( ivas_format == MASA_FORMAT ) #endif { move_metadata_to_qmetadata( hMasa, hQMetaData ); } -#ifdef MASA_AND_OBJECTS -#ifndef OMASA_DIFFUSE_ISM_MERGE - else if ( ivas_format == MASA_ISM_FORMAT ) - { - ivas_merge_masa_metadata( hMasa, hQMetaData ); - } -#endif -#endif if ( hMasa->config.max_metadata_bits < MINIMUM_BIT_BUDGET_NORMAL_META && !hMasa->config.joinedSubframes ) { @@ -479,19 +462,15 @@ void ivas_masa_encode( #ifdef MASA_AND_OBJECTS /* Encode MASA+ISM metadata */ +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { /* encode MASA/ISM energy ratios */ - ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes -#ifdef REDUCE_OMASA_META_BITS - , - idx_separated_object -#endif -#ifdef REDUCE_OMASA_META_BITS - , - ism_imp -#endif - ); + ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes, + idx_separated_object, ism_imp ); } else { @@ -502,7 +481,11 @@ void ivas_masa_encode( ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { /* Modify spatial metadata based on the MASA-to-total energy ratios */ modify_masa_energy_ratios( hQMetaData ); @@ -543,11 +526,7 @@ void ivas_masa_encode( { /* Combine directions */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE ivas_masa_combine_directions( hMasa ); -#else - combine_directions( hMasa ); -#endif #else combine_directions( hMasa ); #endif @@ -699,7 +678,11 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -738,7 +721,18 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); +#ifdef OMASA_UPDATES + if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) + { + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); + } + else + { +#endif + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); +#ifdef OMASA_UPDATES + } +#endif } else { @@ -837,8 +831,12 @@ ivas_error ivas_masa_enc_config( #endif } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) { @@ -1086,13 +1084,9 @@ static void combine_freqbands_and_subframes( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE void ivas_masa_combine_directions( #else static void combine_directions( -#endif -#else -static void combine_directions( #endif MASA_ENCODER_HANDLE hMasa ) { @@ -1210,9 +1204,7 @@ static void combine_directions( ambience2dir = 1.0f - ratioSum; hMeta->directional_meta[0].energy_ratio[j][i] = sumVecLen[j][i] / ( hMeta->directional_meta[0].energy_ratio[j][i] + hMeta->directional_meta[1].energy_ratio[j][i] + ambience2dir / 2.0f ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE hMeta->directional_meta[1].energy_ratio[j][i] = 0.0f; -#endif /* OMASA_DIFFUSE_ISM_MERGE */ #endif /* MASA_AND_OBJECTS */ if ( computeCoherence ) { @@ -1590,7 +1582,11 @@ static void reduce_metadata_further( /* Get energy for the input data in 4-subframe, 5-band format */ totalEnergySum = 0.0f; #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ +#else if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) /* Energy data is in 4-subframe, 24-band format */ +#endif #else if ( ivas_format == MASA_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ #endif @@ -1979,7 +1975,11 @@ void ivas_masa_enc_reconfigure( ivas_total_brate = st_ivas->hEncoderConfig->ivas_total_brate; #ifdef MASA_AND_OBJECTS ism_total_brate = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) +#endif { for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { @@ -2044,7 +2044,6 @@ void ivas_masa_enc_reconfigure( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_DIFFUSE_ISM_MERGE /*-------------------------------------------------------------------* * ivas_merge_masa_metadata() * @@ -2055,25 +2054,16 @@ void ivas_merge_masa_metadata( MASA_ENCODER_HANDLE hMasa, /* i/o: MASA enc handle. source for MASA metadata and combined metadata will be here */ OMASA_SPATIAL_META_HANDLE hOMasaMeta /* i : ISM-object metadata to be merged with the MASA metadata */ ) -#else -static void ivas_merge_masa_metadata( - MASA_ENCODER_HANDLE hMasa, - IVAS_QMETADATA_HANDLE hQMeta ) -#endif /* OMASA_DIFFUSE_ISM_MERGE */ - { int16_t sf, band; uint8_t numCodingBands; uint8_t numDirections; uint8_t numSf; MASA_METADATA_HANDLE hMeta; -#ifdef OMASA_DIFFUSE_ISM_MERGE float energyTimesRatioISM; float energyTimesRatioMASA[2]; float total_diff_nrg; -#else - float energyTimesRatio1, energyTimesRatio2; -#endif /* OMASA_DIFFUSE_ISM_MERGE */ + int16_t brange[2]; float eneBand; @@ -2085,15 +2075,11 @@ static void ivas_merge_masa_metadata( numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; hMeta = &( hMasa->masaMetadata ); -#ifndef OMASA_DIFFUSE_ISM_MERGE - assert( numDirections == 1 && "MASA metadata merging currently implemented only for 1-direction metadata" ); /* Currently only 1-direction metadata is fed to merging */ -#endif for ( sf = 0; sf < numSf; sf++ ) { for ( band = 0; band < numCodingBands; band++ ) { -#ifdef OMASA_DIFFUSE_ISM_MERGE int16_t merge_dest; float dir_sum; uint8_t band_n_dirs; @@ -2108,10 +2094,6 @@ static void ivas_merge_masa_metadata( { band_n_dirs = 2; } -#else - brange[0] = hMasa->data.band_mapping[band]; - brange[1] = hMasa->data.band_mapping[band + 1]; -#endif /* OMASA_DIFFUSE_ISM_MERGE */ /* Compute energies */ /* MASA energy is in the full 24 band resolution, whereas the ISM energy is already in the coding band resolution */ @@ -2123,7 +2105,6 @@ static void ivas_merge_masa_metadata( energyMerged[sf][band] = eneBand + hMasa->data.energy_ism[sf][band]; /* Compute weights */ -#ifdef OMASA_DIFFUSE_ISM_MERGE energyTimesRatioMASA[0] = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; if ( band_n_dirs == 2 ) { @@ -2182,26 +2163,6 @@ static void ivas_merge_masa_metadata( hMeta->directional_meta[1].energy_ratio[sf][band] *= direct_scaler; } } -#else /* OMASA_DIFFUSE_ISM_MERGE */ - energyTimesRatio1 = hMasa->data.energy_ism[sf][band] * hQMeta->q_direction[0].band_data[band].energy_ratio[sf]; - energyTimesRatio2 = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; - - /* Determine combined metadata based on the weights */ - if ( energyTimesRatio2 > energyTimesRatio1 ) - { - hQMeta->q_direction[0].band_data[band].azimuth[sf] = hMeta->directional_meta[0].azimuth[sf][band]; - hQMeta->q_direction[0].band_data[band].elevation[sf] = hMeta->directional_meta[0].elevation[sf][band]; - hQMeta->q_direction[0].band_data[band].energy_ratio[sf] = hMeta->directional_meta[0].energy_ratio[sf][band]; - if ( hQMeta->q_direction[0].coherence_band_data != NULL ) - { - hQMeta->q_direction[0].coherence_band_data[band].spread_coherence[sf] = (uint8_t) roundf( hMeta->directional_meta[0].spread_coherence[sf][band] * UINT8_MAX ); - } - if ( hQMeta->surcoh_band_data != NULL ) - { - hQMeta->surcoh_band_data[band].surround_coherence[sf] = (uint8_t) roundf( hMeta->common_meta.surround_coherence[sf][band] * UINT8_MAX ); - } - } -#endif /* OMASA_DIFFUSE_ISM_MERGE */ } } @@ -2221,17 +2182,13 @@ static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, const int16_t nchan_ism, - const float masa_to_total_energy_ratio -#ifdef REDUCE_OMASA_META_BITS - , + const float masa_to_total_energy_ratio, const int16_t idx_sep_object -#endif ) { int16_t i, j, best_i, best_i2; float dist, div, tmp, dist2, best_dist; int16_t part_idx_sum, max_sum_idx; -#ifdef REDUCE_OMASA_META_BITS float ratio_ism_loc[MAX_NUM_OBJECTS]; int16_t no_ism_loc; @@ -2350,85 +2307,7 @@ static void quantize_ratio_ism_vector( { idx[0] = (int16_t) ( ( ratio_ism[0] ) * ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ) + 0.5f ); } -#else - max_sum_idx = ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1; - if ( no_ism > 1 ) - { - - if ( masa_to_total_energy_ratio >= MASA2TOTAL_THR ) - { - distribute_evenly_ism( idx, max_sum_idx, no_ism ); - } - else - { - dist = 0.0f; - div = 1.0f / (float) ( max_sum_idx ); - - part_idx_sum = 0; - for ( i = 0; i < no_ism; i++ ) - { - idx[i] = (int16_t) ( ( ratio_ism[i] ) * ( max_sum_idx ) ); - part_idx_sum += idx[i]; - - tmp = ( ratio_ism[i] - ( idx[i] * div ) ); - dist += ( tmp * tmp ); - } - best_dist = dist; - best_i2 = -1; - while ( part_idx_sum < max_sum_idx ) - { - best_i = -1; - /* check which index to increase by 1 for a possible improvement */ - - for ( i = 0; i < no_ism; i++ ) - { - idx[i]++; - dist2 = 0.0f; - - - for ( j = 0; j < no_ism; j++ ) - { - tmp = ( ratio_ism[i] - ( idx[i] * div ) ); - dist2 += ( tmp * tmp ); - } - - if ( dist2 < best_dist ) - { - best_i2 = best_i; - best_i = i; - best_dist = dist2; - } - idx[i]--; - } - if ( best_i > -1 ) - { - idx[best_i]++; - part_idx_sum++; - } - else - { - if ( best_i2 > -1 ) - { - idx[best_i2]++; - part_idx_sum++; - } - else - { - idx[no_ism - 1] += max_sum_idx - part_idx_sum; - part_idx_sum = max_sum_idx; - } - } - } - assert( sum_s( idx, no_ism ) == max_sum_idx ); - } - } - else - { - idx[0] = (int16_t) ( ( ratio_ism[0] ) * ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ) + 0.5f ); - } - -#endif return; } @@ -2528,7 +2407,7 @@ static int16_t try_differential( b_signif = 0; - while ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR && b_signif < numCodingBands ) + while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) { b_signif++; } @@ -2590,7 +2469,7 @@ static void differential_coding_first_subframe( } } } -#ifdef REDUCE_OMASA_META_BITS + static void independent_coding_ratio_ism_idx( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* i: ISM ratios */ const float *masa_to_total_energy_ratio, /* i: MASA to total ratios */ @@ -2777,7 +2656,7 @@ static int16_t encode_ratio_ism_subframe( nbits0 = 0; nbits1 = 0; b_signif = 0; - while ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR && b_signif < numCodingBands ) + while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) { b_signif++; } @@ -2899,7 +2778,7 @@ static int16_t encode_ratio_ism_subframe( remove_sep_obj( diff_idx, nchan_ism, idx_sep_obj_local ); } - transform_index_and_GR_encode( diff_idx, nchan_ism - 1, GR_order, hMetaData ); + transform_index_and_GR_encode( diff_idx, nchan_ism - 1 - shift_one, GR_order, hMetaData ); } } } @@ -2914,221 +2793,7 @@ static int16_t encode_ratio_ism_subframe( } -#else -static int16_t encode_ratio_ism_subframe( - int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - int16_t no_ism, - int16_t numCodingBands, - int16_t sf, - int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], - BSTR_ENC_HANDLE hMetaData, - const float *masa_to_total_energy_ratio ) -{ - int16_t b, i, b_signif; - int16_t diff_idx[MAX_NUM_OBJECTS], index; - int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb, bits_pos0; - int16_t differential_subframe; - - nbits = 0; - nbits0 = 0; - nbits1 = 0; - - bits_pos0 = hMetaData->nb_bits_tot; - differential_subframe = 1; /* the differences are taken with respect to previous subframe */ - if ( sf == 0 ) /* first subframe */ - { - if ( no_ism == 2 ) - { - - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - index = index_slice_enum( ratio_ism_idx[b], no_ism ); - - push_next_indice( hMetaData, index, 3 ); - nbits += 3; - } - } - } - else if ( no_ism == 3 ) - { - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - index = index_slice_enum( ratio_ism_idx[b], no_ism ); - /* there are 36 indices and part of them use 5 bits; 31 is special code to - signal that there are indices larger than 31, represented on extra 3 bits */ - if ( index < 31 ) - { - push_next_indice( hMetaData, index, 5 ); - nbits += 5; - } - else - { - push_next_indice( hMetaData, 31, 5 ); - nbits += 5; - - push_next_indice( hMetaData, index - 31, 3 ); - nbits += 3; - } - } - } - } - else - { - if ( no_ism == 4 ) - { - for ( b = 0; b < numCodingBands; b++ ) - { - if ( masa_to_total_energy_ratio[b] < MASA2TOTAL_THR ) - { - index = index_slice_enum( ratio_ism_idx[b], no_ism ); - push_next_indice( hMetaData, index, 7 ); - nbits += 7; - } - } - } - } -#ifdef DEBUGGING - assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); -#endif - } - else - { - nbits0 = 0; - nbits1 = 0; - for ( b = 0; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); - transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); - /* GR encoding estimate length */ - for ( i = 0; i < no_ism - 1; i++ ) - { - nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); - nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); - } - } - if ( nbits0 < nbits1 ) - { - GR_order = 0; - nbits = nbits0; - } - else - { - GR_order = 1; - nbits = nbits1; - } - if ( numCodingBands > 1 ) - { - /* try the difference from subband to subband; first subband is compared to previous subframe first subband*/ - /* take difference with respect to previous subframe only for first subband */ - nbits0 = 0; - nbits1 = 0; - - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - /* transform difference index into positive */ - transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); - /* GR encoding */ - for ( i = 0; i < no_ism - 1; i++ ) - { - nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); - nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); - } - - - for ( b = 1; b < numCodingBands; b++ ) - { - - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); - /* transform difference index into positive */ - transform_difference_index( diff_idx, diff_idx, no_ism - 1 ); - /* GR encoding */ - - for ( i = 0; i < no_ism - 1; i++ ) - { - nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); - nbits1 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 1 ); - } - } - - if ( nbits0 < nbits1 ) - { - GR_order_sb = 0; - } - else - { - GR_order_sb = 1; - nbits0 = nbits1; - } - - if ( nbits0 < nbits ) - { - differential_subframe = 0; - nbits = nbits0; - GR_order = GR_order_sb; - } - - nbits++; /* for GR_order */ - nbits++; /* for the prediction type */ - - /* write prediction type */ - push_next_indice( hMetaData, differential_subframe, 1 ); - /* write GR order */ - push_next_indice( hMetaData, GR_order, 1 ); - /* write data */ - if ( differential_subframe ) - { - for ( b = 0; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - } - } - else - { - v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - - for ( b = 1; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subband */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx[b - 1], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - } - } - } - else - { - /* only differential wrt previous subframe is possible */ - /* write the differential to subframe case and no bit to signal the difference type */ - - /* write GR order */ - push_next_indice( hMetaData, GR_order, 1 ); - nbits++; /* for GR_order */ - /* write data */ - - for ( b = 0; b < numCodingBands; b++ ) - { - /* take difference with respect to previous subframe */ - v_sub_s( ratio_ism_idx[b], ratio_ism_idx_prev_sf[b], diff_idx, no_ism ); - transform_index_and_GR_encode( diff_idx, no_ism - 1, GR_order, hMetaData ); - } - } - -#ifdef DEBUGGING - assert( nbits == ( hMetaData->nb_bits_tot - bits_pos0 ) ); -#endif - } - - return nbits; -} -#endif static void ivas_encode_masaism_metadata( @@ -3138,12 +2803,9 @@ static void ivas_encode_masaism_metadata( ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ const int16_t low_bitrate_mode, /* i : is low bitrate more? 1/0 */ const int16_t omasa_nbands, - const int16_t omasa_nblocks -#ifdef REDUCE_OMASA_META_BITS - , + const int16_t omasa_nblocks, const int16_t idx_separated_object, const int16_t ism_imp -#endif ) { int16_t sf, band; @@ -3153,9 +2815,6 @@ static void ivas_encode_masaism_metadata( float eneBand; int16_t bin; int16_t obj; -#ifndef REDUCE_OMASA_META_BITS - float priority[MAX_NUM_OBJECTS]; -#endif int16_t bits_ism[MAX_NUM_OBJECTS]; uint16_t idx_sph; float theta_q, phi_q; @@ -3165,10 +2824,9 @@ static void ivas_encode_masaism_metadata( float step; int16_t inv_step; float energy_ism, energy_ism_ind[MAX_NUM_OBJECTS]; -#ifdef REDUCE_OMASA_META_BITS int16_t tmp, rotate; int16_t n_ism_tmp, i; -#endif + /* use the values from hQMetaData */ numCodingBands = (uint8_t) hQMetaData->q_direction->cfg.nbands; @@ -3295,10 +2953,10 @@ static void ivas_encode_masaism_metadata( { inv_step = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); step = 1.0f / inv_step; -#ifdef REDUCE_OMASA_META_BITS + rotate = 0; n_ism_tmp = 0; -#endif + for ( sf = 0; sf < numSf; sf++ ) { for ( band = 0; band < numCodingBands; band++ ) @@ -3308,8 +2966,7 @@ static void ivas_encode_masaism_metadata( assert( ( hMasa->data.energy_ratio_ism[sf][band][obj] >= 0 ) && ( hMasa->data.energy_ratio_ism[sf][band][obj] <= 1 ) ); ratio_ism[band][obj] = hMasa->data.energy_ratio_ism[sf][band][obj]; } - /* Quantize power ratios */ -#ifdef REDUCE_OMASA_META_BITS + /* Quantize ISM ratios */ quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band], idx_separated_object ); if ( n_ism_tmp == numCodingBands && ratio_ism_idx[band][idx_separated_object] != 0 && hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) { @@ -3328,15 +2985,12 @@ static void ivas_encode_masaism_metadata( } } } -#else - quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band] ); -#endif + /* reconstructed values */ reconstruct_ism_ratios( ratio_ism_idx[band], hMasa->data.nchan_ism, step, hMasa->data.q_energy_ratio_ism[sf][band] ); /* encode vector */ } -#ifdef REDUCE_OMASA_META_BITS if ( ( hMasa->data.nchan_ism > 2 ) && ( idx_separated_object == hMasa->data.nchan_ism - 1 ) ) { /* rotate components */ @@ -3376,10 +3030,8 @@ static void ivas_encode_masaism_metadata( } } } -#endif - /* encode data for current subframe */ -#ifdef REDUCE_OMASA_META_BITS + /* encode data for current subframe */ if ( sf > 0 && n_ism_tmp == numCodingBands ) { encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf], 1, idx_separated_object ); @@ -3388,9 +3040,7 @@ static void ivas_encode_masaism_metadata( { encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf], 0, idx_separated_object ); } -#else - encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf] ); -#endif + /* calculate quantized ISM ratios */ /* save previous subframe indexes */ @@ -3398,7 +3048,7 @@ static void ivas_encode_masaism_metadata( { mvs2s( ratio_ism_idx[band], ratio_ism_idx_prev_sf[band], hMasa->data.nchan_ism ); } -#ifdef REDUCE_OMASA_META_BITS + if ( rotate ) { for ( band = 0; band < numCodingBands; band++ ) @@ -3411,44 +3061,48 @@ static void ivas_encode_masaism_metadata( } } } -#endif - } -#ifndef REDUCE_OMASA_META_BITS - set_f( priority, 0.0f, hMasa->data.nchan_ism ); - for ( sf = 0; sf < numSf; sf++ ) - { - for ( band = 0; band < numCodingBands; band++ ) - { - for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) - { - priority[obj] = max( priority[obj], ( hMasa->data.q_energy_ratio_ism[sf][band][obj] * hQMetaData->masa_to_total_energy_ratio[sf][band] ) ); - } - } + } -#endif } -#ifndef REDUCE_OMASA_META_BITS - else - { - priority[0] = 1; - } -#endif -#ifdef REDUCE_OMASA_META_BITS + + calculate_nbits_meta( hMasa->data.nchan_ism, hMasa->data.q_energy_ratio_ism, hQMetaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); -#else - /* decide parameters for ISM metadata quantization */ - for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) - { - bits_ism[obj] = bits_direction_masa[0] - (int16_t) ( ( 1 - priority[obj] ) * 7 ); - } -#endif + /* quantize directions */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) - { + { +#ifdef OMASA_UPDATES + if ( bits_ism[obj] < 8 ) + { + /* check is same as previous */ + if ( ( fabs( hIsmMeta[obj]->elevation - hIsmMeta[obj]->q_elevation_old ) < 0.01f ) && ( fabs( hIsmMeta[obj]->azimuth - hIsmMeta[obj]->q_azimuth_old ) < 0.01f ) ) + { + push_next_indice( hMetaData, 1, 1 ); + /* the old stays the same */ + } + else + { + push_next_indice( hMetaData, 0, 1 ); + idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); + push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); + hIsmMeta[obj]->q_elevation_old = hIsmMeta[obj]->elevation; + hIsmMeta[obj]->q_azimuth_old = hIsmMeta[obj]->azimuth; + } + } + else + { + idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); + push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); + hIsmMeta[obj]->q_elevation_old = hIsmMeta[obj]->elevation; + hIsmMeta[obj]->q_azimuth_old = hIsmMeta[obj]->azimuth; + } + +#else idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); +#endif } return; diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index e9ccefe357..935ea5e342 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -51,11 +51,7 @@ *------------------------------------------------------------------------*/ static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], -#ifdef OMASA_DIFFUSE_ISM_MERGE - float diffuseness_m[MASA_FREQUENCY_BANDS], -#endif - const int16_t input_frame, - const int16_t nchan_inp ); + float diffuseness_m[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); @@ -131,13 +127,8 @@ ivas_error ivas_omasa_enc_open( for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { -#ifdef OMASA_DIFFUSE_ISM_MERGE hOMasa->direction_vector_m[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ); set_zero( hOMasa->direction_vector_m[i][j], MASA_FREQUENCY_BANDS ); -#else - hOMasa->direction_vector_m[i][j] = (float *) malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); - set_zero( hOMasa->direction_vector_m[i][j], MAXIMUM_OMASA_FREQ_BANDS ); -#endif } } @@ -145,13 +136,8 @@ ivas_error ivas_omasa_enc_open( { for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) { -#ifdef OMASA_DIFFUSE_ISM_MERGE hOMasa->buffer_intensity_real[i][j] = (float *) malloc( MASA_FREQUENCY_BANDS * sizeof( float ) ); set_zero( hOMasa->buffer_intensity_real[i][j], MASA_FREQUENCY_BANDS ); -#else - hOMasa->buffer_intensity_real[i][j] = (float *) malloc( MAXIMUM_OMASA_FREQ_BANDS * sizeof( float ) ); - set_zero( hOMasa->buffer_intensity_real[i][j], MAXIMUM_OMASA_FREQ_BANDS ); -#endif } } @@ -240,17 +226,18 @@ void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs /* i : Input sample rate */ -#ifdef OMASA_DIFFUSE_ISM_MERGE , ISM_MODE ismMode /* i : ISM mode */ -#endif ) { uint8_t i, maxBin; /* Determine the number of bands */ -#ifdef OMASA_DIFFUSE_ISM_MERGE +#ifdef OMASA_UPDATES + if ( ismMode == ISM_MODE_NONE || ismMode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( ismMode == ISM_MODE_NONE ) +#endif { /* use full resolution for the ISM+MASA merge and reduce later */ hOMasa->nbands = 24; @@ -259,9 +246,7 @@ void ivas_omasa_set_config( { hOMasa->nbands = hMasa->config.numCodingBands; } -#else - hOMasa->nbands = hMasa->config.numCodingBands; -#endif + hOMasa->nCodingBands = hMasa->config.numCodingBands; /* Determine the number of subframes */ @@ -310,9 +295,6 @@ void ivas_omasa_set_config( void ivas_omasa_enc( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ -#ifndef OMASA_DIFFUSE_ISM_MERGE - IVAS_QMETADATA_HANDLE hQMeta, /* i/o: Qmetadata handle */ -#endif MASA_ENCODER_HANDLE hMasa, /* i/o: MASA encoder handle */ ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handle */ float data_in_f[][L_FRAME48k], /* i/o: Input / transport audio signals */ @@ -327,6 +309,11 @@ void ivas_omasa_enc( int16_t i, j; float data_out_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; + +#ifdef OMASA_UPDATES + /* Determine separated object (when applicable) */ + if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else /* Analysis */ if ( ism_mode == ISM_MODE_NONE ) { @@ -455,6 +442,7 @@ void ivas_omasa_enc( ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); } else +#endif { float broadband_energy[MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS]; int16_t loudest_object; @@ -569,11 +557,90 @@ void ivas_omasa_enc( { set_zero( data_in_f[selected_object], input_frame ); } +#ifdef OMASA_UPDATES + } + + /* Analysis */ + if ( ism_mode == ISM_MODE_NONE || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + OMASA_SPATIAL_META OMasaMeta; /* working memory for the ISM-object MASA-parameters */ + OMASA_SPATIAL_META_HANDLE hOMasaMeta; + uint8_t n_bands_orig, n_subframes_orig; + uint8_t numCodingBands_orig, joinedSubframes_orig; + + hOMasaMeta = &OMasaMeta; + hOMasaMeta->num_dirs = 1; /* TODO: hard-coding for now */ + + /* merge MASA directions before adding ISM to the mixture */ + if ( hMasa->config.numberOfDirections == 2 ) + { + n_bands_orig = hMasa->config.numCodingBands; + hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; + + ivas_masa_combine_directions( hMasa ); + + hMasa->config.numCodingBands = (int8_t)n_bands_orig; + } + + /* force computation into high resolution */ + n_bands_orig = hOMasa->nbands; + n_subframes_orig = hOMasa->nSubframes; + + hOMasa->nbands = MASA_FREQUENCY_BANDS; + hOMasa->nSubframes = MAX_PARAM_SPATIAL_SUBFRAMES; + + /* Estimate MASA parameters from the objects */ + /* NB: only first direction is populated */ + /* NB2: in energy_ratios and surround_coherence only first sub-frame contains valid data */ + ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, hOMasaMeta->directional_meta[0].elevation, hOMasaMeta->directional_meta[0].azimuth, hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].spread_coherence, hOMasaMeta->common_meta.surround_coherence[0], + hOMasaMeta->common_meta.diffuse_to_total_ratio[0], input_frame, nchan_ism ); + + /* copy energy_ratios and surrCoh from first sub-frame to the remaining ones */ + for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + mvr2r( hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].energy_ratio[i], MASA_FREQUENCY_BANDS ); + mvr2r( hOMasaMeta->common_meta.surround_coherence[0], hOMasaMeta->common_meta.surround_coherence[i], MASA_FREQUENCY_BANDS ); + mvr2r( hOMasaMeta->common_meta.diffuse_to_total_ratio[0], hOMasaMeta->common_meta.diffuse_to_total_ratio[i], MASA_FREQUENCY_BANDS ); + } + + /* restore resolution parameters */ + hOMasa->nbands = n_bands_orig; + hOMasa->nSubframes = n_subframes_orig; + + /* perform MASA+ISM merge in full resolution */ + numCodingBands_orig = hMasa->config.numCodingBands; + joinedSubframes_orig = hMasa->config.joinedSubframes; + + hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; + hMasa->config.joinedSubframes = 0; + + ivas_merge_masa_metadata( hMasa, hOMasaMeta ); /* => merge result in hMasa->masaMetadata */ + + hMasa->config.numCodingBands = numCodingBands_orig; + hMasa->config.joinedSubframes = joinedSubframes_orig; + + } + else if ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + if ( ism_mode == ISM_MASA_MODE_PARAM ) + { + *idx_separated_object = -1; + } +#endif /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); } +#ifdef OMASA_UPDATES + /* Move the ISM metadata to the first entry for encoding in the MASA_ONE_OBJ mode */ + if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + hIsmMeta[0]->azimuth = hIsmMeta[*idx_separated_object]->azimuth; + hIsmMeta[0]->elevation = hIsmMeta[*idx_separated_object]->elevation; + } +#endif + /* Downmix */ ivas_omasa_dmx( data_in_f, data_out_f, input_frame, nchan_transport, nchan_ism, hIsmMeta, hOMasa->prev_object_dm_gains, hOMasa->interpolator ); @@ -584,7 +651,6 @@ void ivas_omasa_enc( } -#ifdef OMASA_BRATE /*-------------------------------------------------------------------------* * set_ism_importance_interformat() * @@ -665,6 +731,11 @@ void ivas_set_surplus_brate_enc( #endif ) { +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_PARAM_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ); +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp @@ -673,9 +744,14 @@ void ivas_set_surplus_brate_enc( 0 #endif ); +#endif /* note: ISM st->total_brate is iset in ivas_sce_enc() */ } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) +#else else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) +#endif { /* it is already set in ivas_ism_enc() */ } @@ -689,7 +765,12 @@ void ivas_set_surplus_brate_enc( { int16_t input_frame = (int16_t) ( st_ivas->hEncoderConfig->input_Fs / FRAMES_PER_SEC ); float tmpF = 0; +#ifdef OMAOMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) +#endif { tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); } @@ -711,7 +792,6 @@ void ivas_set_surplus_brate_enc( return; } -#endif /*--------------------------------------------------------------------------* @@ -729,9 +809,7 @@ static void ivas_omasa_param_est_enc( float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], -#ifdef OMASA_DIFFUSE_ISM_MERGE float diffuseness_m[MASA_FREQUENCY_BANDS], -#endif const int16_t input_frame, const int16_t nchan_ism ) { @@ -747,9 +825,6 @@ static void ivas_omasa_param_est_enc( float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float diffuseness_vector[MASA_FREQUENCY_BANDS]; -#ifndef OMASA_DIFFUSE_ISM_MERGE - float diffuseness_m[MASA_FREQUENCY_BANDS]; -#endif int16_t band_m_idx, block_m_idx; float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index b64eb4adbf..b6d2b86382 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -5263,6 +5263,10 @@ void encode_masa_to_total( n_streams = 1; len_stream = nbands; break; + case 12: + matrix_product( dct12, nbands, nbands, 0, data, 1, nbands, 1, dct_data ); + n_streams = 1; + len_stream = nbands; break; case 20: matrix_product( dct5, nbands, nbands, 0, data, nblocks, nbands, 1, dct_data_tmp ); @@ -5277,6 +5281,7 @@ void encode_masa_to_total( len_stream = nbands; break; default: + printf( "Incorrect number of coefficients for OMASA.\n" ); break; } @@ -5352,6 +5357,10 @@ void encode_masa_to_total( matrix_product( dct8, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); mvr2r( dct_data_tmp, q_dct_data, nbands ); break; + case 12: + matrix_product( dct12, nbands, nbands, 1, q_dct_data, nbands, 1, 0, dct_data_tmp ); + mvr2r( dct_data_tmp, q_dct_data, nbands ); + break; case 20: matrix_product( dct5, nbands, nbands, 1, q_dct_data, nbands, nblocks, 0, dct_data_tmp ); matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); /* reuse of variable*/ @@ -5361,6 +5370,7 @@ void encode_masa_to_total( matrix_product( dct_data_tmp, nbands, nblocks, 0, dct4, nblocks, nblocks, 0, q_dct_data ); break; default: + printf( "Incorrect number of coefficients for OMASA.\n" ); break; } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index dde49fb9cd..769e5fe970 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -144,7 +144,11 @@ ivas_error ivas_sce_enc( if ( st_ivas->hQMetaData != NULL && st_ivas->hSpar == NULL ) { #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_MASA_ONE_OBJ ) ) +#else if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_ONE_OBJ ) ) +#endif #else if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) #endif @@ -220,11 +224,19 @@ ivas_error ivas_sce_enc( reset_metadata_spatial( ivas_format, hSCE->hMetaData, hSCE->element_brate, &st->total_brate, st->core_brate, nb_bits_metadata, st_ivas->sba_mode ); -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------* * Combined format coding: get the ISM importance and the bit-rate *----------------------------------------------------------------*/ +#ifdef OMASA_UPDATES + if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); + + st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_PARAM_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ) - nb_bits_metadata * FRAMES_PER_SEC; + } +#else if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) { set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); @@ -237,6 +249,7 @@ ivas_error ivas_sce_enc( ) - nb_bits_metadata * FRAMES_PER_SEC; } +#endif #endif /*----------------------------------------------------------------* @@ -257,8 +270,12 @@ ivas_error ivas_sce_enc( { st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->core_brate, 0, 0, -1, -1 ); } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st->low_rate_mode ) +#else else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st->low_rate_mode ) +#endif { st->flag_ACELP16k = 0; } @@ -370,7 +387,11 @@ ivas_error create_sce_enc( copy_encoder_config( st_ivas, st, 1 ); #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { st->element_mode = IVAS_SCE; } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index c1df19f243..ad7cee3ce1 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -746,9 +746,7 @@ typedef struct ivas_masa_encoder_data_struct float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t nchan_ism; -#ifdef OMASA_BRATE float lp_noise_CPE; /* LP filterend total noise estimation */ -#endif #endif int16_t num_Cldfb_instances; @@ -948,7 +946,7 @@ typedef struct cpe_enc_data_structure float *input_mem[CPE_CHANNELS]; /* input channels buffers memory; needed to be up-to-date for TD->DFT stereo switching */ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS int32_t brate_surplus; /* bitrate surplus for bitrate adaptation in combined format coding */ #endif #ifdef DEBUGGING diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index d4d0b310b6..b2e3373404 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -118,8 +118,11 @@ int16_t select_stereo_mode( { stereo_switching_flag = 0; } - +#ifdef OMASA_UPDATES + if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO && !( hCPE->element_brate == IVAS_48k && ivas_total_brate == IVAS_32k ) ) /* the second condition for PARAM mode OMASA */ +#else if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO ) +#endif { hStereoClassif->prev_lrtd_mode = 0; hStereoClassif->lrtd_mode = 0; diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 5ccacf4807..e0d5db28a6 100644 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -445,7 +445,7 @@ void stereo_mdct_core_enc( sts[ch]->total_brate = ( sts[ch]->bits_frame_channel + sts[ch]->side_bits_frame_channel ) * FRAMES_PER_SEC; } stereo_bits += SMDCT_NBBITS_SPLIT_RATIO; -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate + hCPE->brate_surplus ); #else assert( ( sts[0]->total_brate + sts[1]->total_brate + ( stereo_bits + signal_bits + meta_bits ) * FRAMES_PER_SEC ) == hCPE->element_brate ); diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index c819c887c5..2105b351b3 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -419,7 +419,7 @@ void tdm_configure_enc( sts[1]->coder_type = GENERIC; } -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) { sts[1]->coder_type = INACTIVE; @@ -469,7 +469,7 @@ void tdm_configure_enc( * bitbudget distribution between channels (taking into account also metadata bitbudget) *----------------------------------------------------------------*/ -#ifdef OMASA_BRATE +#ifdef MASA_AND_OBJECTS tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 72ac9311c5..db6bf0293e 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -448,6 +448,12 @@ static void ivas_dirac_dec_binaural_internal( /* The input channel number at this processing function (not nchan_transport) */ numInChannels = BINAURAL_CHANNELS; #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) + { + numInChannels++; + } +#else if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) { if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -459,6 +465,7 @@ static void ivas_dirac_dec_binaural_internal( numInChannels++; } } +#endif #else if ( st_ivas->hOutSetup.separateChannelEnabled ) { @@ -583,7 +590,11 @@ static void ivas_dirac_dec_binaural_internal( } #ifdef MASA_AND_OBJECTS +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) +#else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) +#endif { preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_in, @@ -1174,14 +1185,20 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( #ifdef MASA_AND_OBJECTS separateCenterChannelRendering = 0; nchanSeparateChannels = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) +#else if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) +#endif { separateCenterChannelRendering = 1; nchanSeparateChannels = 1; +#ifndef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; } +#endif } #else separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; @@ -1325,11 +1342,27 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( #ifdef MASA_AND_OBJECTS uint8_t instantChange = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + gainFactor = 0.7943f * sqrtf( h->earlyPartEneCorrection[bin] ); /* Todo Nokia: Temporary gain for roughly matching the loudness of other processing paths. */ + } + else + { + gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); + } +#else gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); +#endif for ( chB = 0; chB < nchanSeparateChannels; chB++ ) { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifdef OMASA_UPDATES + aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism; + eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; + instantChange = 1; +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB]; @@ -1341,6 +1374,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; instantChange = 1; } +#endif } for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index b60967e7f7..5a2b0e3454 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -182,7 +182,15 @@ ivas_error ivas_td_binaural_open_unwrap( } *hBinRendererTd = pBinRendTd; + +#ifdef OMASA_UPDATES + if ( ivas_format != MASA_ISM_FORMAT ) + { + *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); + } +#else *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); +#endif return error; } @@ -440,7 +448,11 @@ void TDREND_Update_object_positions( c_indx++; } +#ifdef OMASA_UPDATES + if ( in_format == ISM_FORMAT || in_format == MASA_ISM_FORMAT ) +#else if ( in_format == ISM_FORMAT ) +#endif { /* Update the source positions */ -- GitLab From 69090cd6c7d06e7e6ed200797e1477fb2e653eda Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 28 Mar 2023 16:31:49 +0200 Subject: [PATCH 0065/1418] - simplifications in ivas_dec() - add error returns --- lib_dec/ivas_dec.c | 91 ++++++++++++++++++++++++++--------------- lib_dec/ivas_init_dec.c | 15 +++++-- lib_enc/ivas_ism_enc.c | 24 ++++++----- 3 files changed, 84 insertions(+), 46 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 871e454605..c53b8b68a9 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -451,7 +451,7 @@ ivas_error ivas_dec( } } - /* MASA decoding */ + /* MASA metadata decoding */ if ( ( error = ivas_masa_decode( st_ivas, st, &nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) { return error; @@ -462,7 +462,25 @@ ivas_error ivas_dec( st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); - /* Audio signal decoding */ +#ifdef OMASA_UPDATES + /* set ISM parameters */ + int16_t nchan_ism, nchan_transport_ism; + nchan_ism = st_ivas->nchan_ism; + nchan_transport_ism = st_ivas->nchan_ism; + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + nchan_ism = 1; + nchan_transport_ism = 1; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + nchan_ism = 0; + nchan_transport_ism = 1; + } +#endif + + /* decode ISM metadata */ +#ifndef OMASA_UPDATES #ifdef OMASA_UPDATES if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) #else @@ -471,10 +489,7 @@ ivas_error ivas_dec( { if ( st_ivas->nSCE == 1 ) { - if ( ( error = ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) - { - return error; - } + ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ); } else { @@ -484,24 +499,19 @@ ivas_error ivas_dec( } } else - { -#ifdef OMASA_UPDATES - int16_t nchan_ism = st_ivas->nchan_ism; - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) - { - nchan_ism = 1; - } +#else + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) #endif - - /* decode ISM format */ + { + /* decode ISM metadata */ #ifdef NCHAN_ISM_PARAMETER if ( ( error = ivas_ism_metadata_dec( ism_total_brate, #ifdef OMASA_UPDATES - nchan_ism, + nchan_ism, &nchan_transport_ism, #else - st_ivas->nchan_ism, + st_ivas->nchan_ism, &( st_ivas->nSCE ), #endif - &( st_ivas->nSCE ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, st_ivas->hISMDTX, NULL ) ) != IVAS_ERR_OK ) + st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, st_ivas->hISMDTX, NULL ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_ism_metadata_dec( ism_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, NULL, NULL ) ) != IVAS_ERR_OK ) #endif @@ -509,19 +519,7 @@ ivas_error ivas_dec( return error; } - for ( n = 0; n < st_ivas->nSCE - 1; n++ ) - { - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) - { - return error; - } - + // VE: move the following updates into ivas_ism_metadata_dec() #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -531,7 +529,7 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); } } - else + else /* ISM_MASA_MODE_MASA_ONE_OBJ */ { st_ivas->hMasaIsmData->azimuth_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); st_ivas->hMasaIsmData->elevation_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); @@ -543,8 +541,35 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); } #endif + +#ifndef OMASA_UPDATES + for ( n = 0; n < st_ivas->nSCE - 1; n++ ) + { + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif } +#ifdef OMASA_UPDATES + /* decode ISM channels */ + for ( n = 0; n < nchan_transport_ism; n++ ) + { + if ( ( error = ivas_sce_dec( st_ivas, n, &output[st_ivas->nchan_transport + n], output_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + + /* decode MASA channels */ if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) { return error; @@ -575,7 +600,7 @@ ivas_error ivas_dec( for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + mvr2r( output[2 + n], data_separated_objects[n], output_frame ); v_multc( data_separated_objects[n], gain, data_separated_objects[n], output_frame ); } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 329e62f932..e9300d6cf6 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1132,7 +1132,10 @@ ivas_error ivas_init_decoder( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - ivas_qmetadata_open( &( st_ivas->hQMetaData ) ); + if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) + { + return error; + } k = 0; ism_total_brate = 0; @@ -1150,7 +1153,10 @@ ivas_error ivas_init_decoder( st_ivas->nSCE = 1; ism_total_brate = sep_object_brate[k - 2][0]; - create_sce_dec( st_ivas, 0, ism_total_brate ); + if ( ( error = create_sce_dec( st_ivas, 0, ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; + } reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); @@ -1221,7 +1227,10 @@ ivas_error ivas_init_decoder( if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) { - ivas_dirac_dec_open( st_ivas ); + if ( ( error = ivas_dirac_dec_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } } if ( ( error = create_cpe_dec( st_ivas, 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 3abaa72637..acdf2b4a5b 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -98,7 +98,7 @@ ivas_error ivas_ism_enc( #endif ivas_error error; #ifdef MASA_AND_OBJECTS - int16_t i, nchan_transport; + int16_t i, nchan_transport_ism; #endif push_wmops( "ivas_ism_enc" ); @@ -132,18 +132,18 @@ ivas_error ivas_ism_enc( set_s( md_diff_flag, 1, nchan_ism ); #ifdef MASA_AND_OBJECTS - nchan_transport = st_ivas->nchan_transport; + nchan_transport_ism = st_ivas->nchan_transport; #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { - nchan_transport = 1; + nchan_transport_ism = 1; nchan_ism = 1; } else #endif if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - nchan_transport = st_ivas->hEncoderConfig->nchan_ism; + nchan_transport_ism = st_ivas->hEncoderConfig->nchan_ism; } #endif @@ -151,10 +151,10 @@ ivas_error ivas_ism_enc( * Preprocesing *-----------------------------------------------------------------*/ - /* in ISM format: st_ivas->nchan_transport = st_ivas->nSCE */ #ifdef MASA_AND_OBJECTS - for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) + for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) #else + /* in ISM format: st_ivas->nchan_transport = st_ivas->nSCE */ for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) #endif { @@ -303,7 +303,7 @@ ivas_error ivas_ism_enc( nchan_ism, #endif #ifdef MASA_AND_OBJECTS - nchan_transport, + nchan_transport_ism, #else st_ivas->nchan_transport, #endif @@ -352,7 +352,7 @@ ivas_error ivas_ism_enc( nchan_ism, #endif #ifdef MASA_AND_OBJECTS - nchan_transport, + nchan_transport_ism, #else st_ivas->nchan_transport, #endif @@ -411,7 +411,7 @@ ivas_error ivas_ism_enc( *-----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) + for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) #else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) #endif @@ -471,7 +471,7 @@ ivas_error ivas_ism_enc( if ( dtx_flag ) { #ifdef MASA_AND_OBJECTS - for ( sce_id = 0; sce_id < nchan_transport; sce_id++ ) + for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) #else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) #endif @@ -493,7 +493,11 @@ ivas_error ivas_ism_enc( int16_t id, n; n = 0; +#ifdef MASA_AND_OBJECTS + for ( sce_id = 0; sce_id < nchan_transport_ism; sce_id++ ) +#else for ( sce_id = 0; sce_id < st_ivas->nchan_transport; sce_id++ ) +#endif { if ( sce_id != st_ivas->hISMDTX->sce_id_dtx ) { -- GitLab From 60715ab59244564e9b8dbf28f4feaf645b170c19 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 28 Mar 2023 18:20:08 +0200 Subject: [PATCH 0066/1418] decoder BR switching updates --- lib_dec/ivas_init_dec.c | 15 +++++----- lib_dec/ivas_ism_dec.c | 14 +++++----- lib_dec/ivas_omasa_dec.c | 60 ++++++++++++++++++++++++++++++++++++++-- lib_enc/ivas_init_enc.c | 5 ++-- lib_enc/ivas_omasa_enc.c | 8 ++++-- 5 files changed, 80 insertions(+), 22 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e9300d6cf6..6b55ee6a0b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1160,6 +1160,12 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); +#ifdef OMASA_BRATE_SW + if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) + { + return error; + } +#else #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { @@ -1172,23 +1178,17 @@ ivas_error ivas_init_decoder( } else { -#ifdef OMASA_BRATE_SW - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } -#else if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } -#endif } #else if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } +#endif #endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -1535,6 +1535,7 @@ ivas_error ivas_init_decoder( } #ifdef OMASA_UPDATES + // VE: introduce a new renderer_type for this case if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) { /* Use td renderer for the objects in DISC mode */ diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index b6f33df845..1c908998a4 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -52,7 +52,7 @@ static ivas_error ivas_ism_bitrate_switching( 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 */ + const int16_t num_obj /* i : number of objects in the bitstream */ #endif ) { @@ -71,14 +71,14 @@ static ivas_error ivas_ism_bitrate_switching( , 0 #endif - ) ) != IVAS_ERR_OK ) + ) ) != 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 + 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 #ifdef MASA_AND_OBJECTS , 0 #endif -) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) #endif { return error; @@ -209,7 +209,7 @@ static ivas_error ivas_ism_bitrate_switching( ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } - if ( st_ivas->hHrtfTD != NULL ) + if ( st_ivas->hHrtfTD != NULL ) // VE: this looks suspicious { st_ivas->hHrtfTD = NULL; } @@ -261,7 +261,7 @@ ivas_error ivas_ism_dec_config( #endif #ifndef NCHAN_ISM_PARAMETER , - const int16_t num_obj /* i : number of objects in the bitstream */ + const int16_t num_obj /* i : number of objects in the bitstream */ #endif ) { @@ -334,11 +334,11 @@ ivas_error ivas_ism_dec_config( #endif { return error; + } } } } } - } else if ( !st_ivas->bfi && ivas_total_brate == IVAS_SID_5k2 ) { #ifdef DISCRETE_ISM_DTX_CNG diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index c3f1d35fdc..8ef1dbf26e 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -35,6 +35,9 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" +#ifdef OMASA_UPDATES +#include "ivas_prot_rend.h" +#endif #ifdef OMASA_BRATE_SW #include "ivas_rom_com.h" #endif @@ -147,7 +150,6 @@ ivas_error ivas_omasa_dec_config( ivas_error error; /* initializations */ - error = IVAS_ERR_OK; ism_total_brate = 0; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -229,13 +231,16 @@ ivas_error ivas_omasa_dec_config( } } - if ( ism_mode_old != st_ivas->ism_mode ) { /* ISM MD reconfig. */ n_MD = 0; +#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#endif { n_MD = 1; @@ -270,7 +275,11 @@ ivas_error ivas_omasa_dec_config( st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; /* objects renderer reconfig. */ +#ifdef OMASA_UPDATES + if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#else if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { if ( st_ivas->hIsmRendererData == NULL ) { @@ -279,7 +288,11 @@ ivas_error ivas_omasa_dec_config( return error; } } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#endif { for ( n = 1; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) { @@ -313,8 +326,13 @@ ivas_error ivas_omasa_dec_config( mvr2r( tmp, st_ivas->hMasaIsmData->delayBuffer[0], st_ivas->hMasaIsmData->delayBuffer_size ); } } +#ifdef OMASA_UPDATES + else if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) +#else else if ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) +#endif { + // VE: use ivas_masa_ism_data_close() instead? for ( n = 0; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) { free( st_ivas->hMasaIsmData->delayBuffer[n] ); @@ -325,9 +343,45 @@ ivas_error ivas_omasa_dec_config( free( st_ivas->hIsmRendererData ); st_ivas->hIsmRendererData = NULL; } + +#ifdef OMASA_UPDATES + // VE: introduce a new renderer_type for this case + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) + { + /* Use td renderer for the objects in DISC mode */ + error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, + st_ivas->transport_config, +#ifdef TD5 + st_ivas->hRenderConfig->directivity, +#endif + st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); + if ( ( error ) != IVAS_ERR_OK ) + { + return error; + } + + /* Reserve memory for delay buffer */ + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( st_ivas->hBinRendererTd != NULL ) + { + ivas_td_binaural_close( &st_ivas->hBinRendererTd ); + } + + if ( st_ivas->hHrtfTD != NULL ) // VE: this is copied from ivas_ism_bitrate_switching() but a review is needed + { + st_ivas->hHrtfTD = NULL; + } + } +#endif } - return error; + return IVAS_ERR_OK; } #endif diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 8b8c4bfd4f..1fd102c07c 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -633,10 +633,11 @@ ivas_error ivas_init_encoder( return error; } } + #ifdef OMASA_UPDATES - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM) ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) #else - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) #endif { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 4f9148e228..2ec461d5f9 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -232,11 +232,9 @@ ivas_error ivas_omasa_enc_config( ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; - error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; ivas_total_brate = hEncoderConfig->ivas_total_brate; - //ivas_masa_enc_reconfigure( st_ivas ); // VE: might not be needed @@ -311,7 +309,11 @@ ivas_error ivas_omasa_enc_config( st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; +#ifdef OMASA_UPDATES + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) +#else if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) +#endif { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } @@ -333,7 +335,7 @@ ivas_error ivas_omasa_enc_config( ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); } - return error; + return IVAS_ERR_OK; } #endif -- GitLab From fd62e881c4956ea826ae27751040ac8e6f6a597d Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 28 Mar 2023 19:55:46 +0200 Subject: [PATCH 0067/1418] fix decoder BR switching --- lib_dec/ivas_cpe_dec.c | 9 ++++----- lib_dec/ivas_omasa_dec.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 92b0668072..b52c2ea054 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -249,11 +249,9 @@ ivas_error ivas_cpe_dec( nb_bits -= SID_FORMAT_NBITS; sts[1]->bit_stream -= SID_FORMAT_NBITS; } -#ifdef MASA_AND_OBJECTS - if ( ( ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || - ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) ) ) && - ivas_total_brate > IVAS_SID_5k2 ) +#ifdef MASA_AND_OBJECTS + if ( ( ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE ) || ( st_ivas->ivas_format == MASA_ISM_FORMAT && cpe_brate < MASA_STEREO_MIN_BITRATE ) ) && ivas_total_brate > IVAS_SID_5k2 ) #else if ( st_ivas->ivas_format == MASA_FORMAT && ivas_total_brate < MASA_STEREO_MIN_BITRATE && ivas_total_brate > IVAS_SID_5k2 ) #endif @@ -373,6 +371,7 @@ ivas_error ivas_cpe_dec( /*----------------------------------------------------------------* * Core codec configuration *----------------------------------------------------------------*/ + for ( n = 0; n < n_channels; n++ ) { /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ @@ -1116,7 +1115,7 @@ static void read_stereo_mode_and_bwidth( { /* read stereo technology info */ #ifdef OMASA_UPDATES - if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k) ) + if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k ) ) #else if ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 8ef1dbf26e..52812b6fb3 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -187,6 +187,16 @@ ivas_error ivas_omasa_dec_config( return error; } + // VE!!!!!: verification needed, see comment "/* Todo: Nokia make for MASA_ISM*/" in ivas_masa_dec_reconfigure() + if ( cpe_brate < MASA_STEREO_MIN_BITRATE ) + { + st_ivas->hCPE[0]->nchan_out = 1; + } + else + { + st_ivas->hCPE[0]->nchan_out = 2; + } + /* OMASA reconfig. */ if ( st_ivas->hMasaIsmData == NULL && st_ivas->ivas_format == MASA_ISM_FORMAT ) { -- GitLab From ef8970d96e6ef7cc6974b530e37d2811e8e825a5 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 3 Apr 2023 09:12:08 +0200 Subject: [PATCH 0068/1418] white spaces --- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_omasa_enc.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 128c63b114..0b0d03cd09 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -289,7 +289,7 @@ ivas_error ivas_cpe_enc( { #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) - { + { stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.70f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 2ec461d5f9..ef87fd21e4 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -948,7 +948,6 @@ static void ivas_omasa_param_est_enc( float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float diffuseness_vector[MASA_FREQUENCY_BANDS]; - int16_t band_m_idx, block_m_idx; float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; float norm_tmp; @@ -958,7 +957,6 @@ static void ivas_omasa_param_est_enc( num_freq_bands = hOMasa->nbands; l_ts = input_frame / CLDFB_NO_COL_MAX; - /* Need to initialize renormalization_factors, and variables to be normalized */ set_zero( renormalization_factor_diff, hOMasa->nbands ); set_zero( diffuseness_m, hOMasa->nbands ); @@ -1282,7 +1280,6 @@ static void ivas_omasa_dmx( } } - return; } -- GitLab From a6786399666a636b12605fed878db379a9e7ee49 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 3 Apr 2023 10:47:56 +0200 Subject: [PATCH 0069/1418] fix memory deallocation in bitrate switching --- lib_dec/ivas_omasa_dec.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 6d9e3df5f4..2389512da3 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -158,7 +158,11 @@ ivas_error ivas_omasa_dec_config( st_ivas->ism_mode = ism_mode_old; ivas_format_old = st_ivas->ivas_format; +#ifdef OMASA_UPDATES + if ( ism_mode_old == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_DISC ) +#else if ( ism_mode_old == ISM_MASA_MODE_PARAM || ism_mode_old == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_DISC ) +#endif { st_ivas->ivas_format = MASA_ISM_FORMAT; } @@ -342,16 +346,7 @@ ivas_error ivas_omasa_dec_config( else if ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) #endif { - // VE: use ivas_masa_ism_data_close() instead? - for ( n = 0; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) - { - free( st_ivas->hMasaIsmData->delayBuffer[n] ); - } - free( st_ivas->hMasaIsmData->delayBuffer ); - st_ivas->hMasaIsmData->delayBuffer = NULL; - - free( st_ivas->hIsmRendererData ); - st_ivas->hIsmRendererData = NULL; + ivas_masa_ism_data_close( &( st_ivas->hMasaIsmData ) ); } #ifdef OMASA_UPDATES -- GitLab From e05ea4c7a9380d06ddd3d7dde4476368cb1f37fc Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 3 Apr 2023 11:28:37 +0200 Subject: [PATCH 0070/1418] remove obsolete callings of ivas_masa_ism_separate_object_renderer_open() --- lib_dec/ivas_init_dec.c | 12 --------- lib_dec/ivas_omasa_dec.c | 57 +++------------------------------------- 2 files changed, 3 insertions(+), 66 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 035cc5f430..88200f017d 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1238,18 +1238,6 @@ ivas_error ivas_init_decoder( { reset_indices_dec( st_ivas->hCPE[0]->hCoreCoder[n] ); } - -#ifdef OMASA_UPDATES - if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif - { - if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } } #endif else if ( st_ivas->ivas_format == MC_FORMAT ) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 2389512da3..52e1dc0ea1 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -143,7 +143,7 @@ ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { - int16_t k, n, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; + int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; int32_t ivas_total_brate, ism_total_brate, cpe_brate; IVAS_FORMAT ivas_format_old; ISM_MODE ism_mode_old; @@ -290,60 +290,9 @@ ivas_error ivas_omasa_dec_config( /* objects renderer reconfig. */ #ifdef OMASA_UPDATES - if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) + if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) #else - if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif - { - if ( st_ivas->hIsmRendererData == NULL ) - { - if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#ifdef OMASA_UPDATES - else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#endif - { - for ( n = 1; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) - { - free( st_ivas->hMasaIsmData->delayBuffer[n] ); - } - - st_ivas->hMasaIsmData->delayBuffer_nchan = 1; - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - float tmp[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; - - st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; - - mvr2r( st_ivas->hMasaIsmData->delayBuffer[0], tmp, st_ivas->hMasaIsmData->delayBuffer_size ); - free( st_ivas->hMasaIsmData->delayBuffer[0] ); - free( st_ivas->hMasaIsmData->delayBuffer ); - if ( ( st_ivas->hMasaIsmData->delayBuffer = (float **) malloc( st_ivas->hMasaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - - for ( n = 0; n < st_ivas->hMasaIsmData->delayBuffer_nchan; n++ ) - { - if ( ( st_ivas->hMasaIsmData->delayBuffer[n] = (float *) malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - set_zero( st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - mvr2r( tmp, st_ivas->hMasaIsmData->delayBuffer[0], st_ivas->hMasaIsmData->delayBuffer_size ); - } - } -#ifdef OMASA_UPDATES - else if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) -#else - else if ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) + if ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) #endif { ivas_masa_ism_data_close( &( st_ivas->hMasaIsmData ) ); -- GitLab From f9afcb5446fdb626ded2b6234aeb73293c0a2110 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 3 Apr 2023 11:48:15 +0200 Subject: [PATCH 0071/1418] fix memory deallocation in bitrate switching --- lib_dec/ivas_init_dec.c | 4 ++-- lib_dec/ivas_omasa_dec.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 88200f017d..60e024383f 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1517,7 +1517,7 @@ ivas_error ivas_init_decoder( // VE: introduce a new renderer_type for this case if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) { - /* Use td renderer for the objects in DISC mode */ + /* Allocate TD renderer for the objects in DISC mode */ error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); if ( ( error ) != IVAS_ERR_OK ) @@ -1525,7 +1525,7 @@ ivas_error ivas_init_decoder( return error; } - /* Reserve memory for delay buffer */ + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 52e1dc0ea1..b32a76b431 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -302,7 +302,7 @@ ivas_error ivas_omasa_dec_config( // VE: introduce a new renderer_type for this case if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { - /* Use td renderer for the objects in DISC mode */ + /* Allocate TD renderer for the objects in DISC mode */ if ( ( error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK ) @@ -310,7 +310,7 @@ ivas_error ivas_omasa_dec_config( return error; } - /* Reserve memory for delay buffer */ + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; @@ -318,6 +318,7 @@ ivas_error ivas_omasa_dec_config( } else { + /* TD renderer handle */ if ( st_ivas->hBinRendererTd != NULL ) { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); @@ -327,6 +328,13 @@ ivas_error ivas_omasa_dec_config( { st_ivas->hHrtfTD = NULL; } + + /* ISM renderer handle */ + if ( st_ivas->hIsmRendererData != NULL ) + { + free( st_ivas->hIsmRendererData ); + st_ivas->hIsmRendererData = NULL; + } } #endif } -- GitLab From 26a34518f96c44647368b9abb3e13b050823a6c0 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 3 Apr 2023 12:51:11 +0200 Subject: [PATCH 0072/1418] - use native instead of wrapper functions for TD renderer - re-activate FIX_350_MASA_DELAY_COMP and FIX_382_MASA_META_FRAMING_ASYNC - compilation fixes when MASA_AND_OBJECTS is disabled --- lib_com/options.h | 4 +-- lib_dec/ivas_dec.c | 4 +-- lib_dec/ivas_init_dec.c | 8 +----- lib_dec/ivas_ism_metadata_dec.c | 2 ++ lib_dec/ivas_objectRenderer_internal.c | 37 +++++++++++++++++++++----- lib_dec/ivas_omasa_dec.c | 4 +-- lib_enc/ivas_ism_enc.c | 6 ++++- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_masa_enc.c | 14 +++++----- 9 files changed, 52 insertions(+), 29 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7eb9eb4f35..6d0f913e0e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -144,12 +144,12 @@ #define FIX_103_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ /*#define SBA_HPF_TUNING_DEC*/ -//#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ +#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ #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 */ -//#define FIX_382_MASA_META_FRAMING_ASYNC /* Nokia: Issue 382: detect potential MASA metadata framing offset */ +#define FIX_382_MASA_META_FRAMING_ASYNC /* Nokia: Issue 382: detect potential MASA metadata framing offset */ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 4ceb3d5019..10147488c0 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -607,9 +607,7 @@ ivas_error ivas_dec( ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); - if ( ( error = ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_ism, LFE_CHANNEL, st_ivas->ivas_format, - 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, data_separated_objects, output_frame ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer( st_ivas, data_separated_objects, output_frame ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 60e024383f..e8fccfb9cf 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1518,9 +1518,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) { /* Allocate TD renderer for the objects in DISC mode */ - error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, - st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); - if ( ( error ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } @@ -1865,11 +1863,7 @@ void ivas_destroy_dec( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { -#ifdef OMASA_BRATE_SW int16_t i; -#else - int16_t i, n; -#endif /* CLDFB handles */ for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 4a0c8eb4f7..c28478b0ab 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -180,7 +180,9 @@ ivas_error ivas_ism_metadata_dec( #ifdef DISCRETE_ISM_DTX_CNG int16_t md_diff_flag[MAX_NUM_OBJECTS]; #endif +#ifdef MASA_AND_OBJECTS ivas_error error; +#endif push_wmops( "ism_meta_dec" ); diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index f1c1fc04f2..2b24b08398 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -53,8 +53,22 @@ ivas_error ivas_td_binaural_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { +#ifdef MASA_AND_OBJECTS + int16_t num_src; + + num_src = st_ivas->nchan_transport; + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + num_src = st_ivas->nchan_ism; + } + + return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, 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->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); +#endif } @@ -71,10 +85,21 @@ ivas_error ivas_td_binaural_renderer( const int16_t output_frame /* i : output frame length */ ) { - return ivas_td_binaural_renderer_unwrap( - st_ivas->hReverb, - st_ivas->transport_config, - st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, - 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 ); +#ifdef MASA_AND_OBJECTS + int16_t num_src; + + num_src = st_ivas->nchan_transport; + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + num_src = st_ivas->nchan_ism; + } + + return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, num_src, LFE_CHANNEL, st_ivas->ivas_format, + 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 + return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, + 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 ); +#endif } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index b32a76b431..1afaa4696b 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -303,9 +303,7 @@ ivas_error ivas_omasa_dec_config( if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { /* Allocate TD renderer for the objects in DISC mode */ - if ( ( error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, - st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, - &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 093b653a93..60dfcf7acc 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -355,7 +355,11 @@ ivas_error ivas_ism_enc( } #else - 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, st_ivas->hEncoderConfig->ism_extended_metadata_flag, ); + 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 ); #endif } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 1c84021747..3bf642b85b 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -312,7 +312,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS if ( ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) && nchan_ism == 2 ) #else - if ( ism_mode == ISM_MODE_DISC && num_obj == 2 ) + if ( ism_mode == ISM_MODE_DISC && nchan_ism == 2 ) #endif { float diff_F; diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 7c85b6188f..28989065a2 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -85,16 +85,16 @@ static void remove_sep_obj( int16_t *diff_idx, const int16_t nchan_ism, const in static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif -#ifdef FIX_382_MASA_META_FRAMING_ASYNC -static void average_masa_metadata( MASA_METADATA_FRAME *masaMetadata, float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] ); +#ifndef MASA_AND_OBJECTS +static void combine_directions( MASA_ENCODER_HANDLE hMasa ); +#endif -static void copy_masa_metadata_subframe( const MASA_METADATA_HANDLE hMetaFrom, const uint8_t sfFrom, MASA_METADATA_HANDLE hMetaTo, const uint8_t sfTo ); +#ifdef FIX_382_MASA_META_FRAMING_ASYNC +static void detect_framing_async( MASA_ENCODER_HANDLE hMasa ); -static void copy_masa_metadata( const MASA_METADATA_HANDLE hMetaFrom, MASA_METADATA_HANDLE hMetaTo ); +static void average_masa_metadata( MASA_METADATA_FRAME *hMeta, float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] ); static uint8_t are_masa_subframes_similar( const MASA_METADATA_HANDLE frame1, const uint8_t sf1_idx, const MASA_METADATA_HANDLE frame2, const uint8_t sf2_idx ); - -static void detect_framing_async( MASA_ENCODER_HANDLE hMasa ); #endif /*-----------------------------------------------------------------------* @@ -1644,10 +1644,12 @@ static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format +#ifdef MASA_AND_OBJECTS #ifndef OMASA_UPDATES , const ISM_MODE ism_mode #endif +#endif ) { int16_t sf; -- GitLab From a71af78ca3325f42b2da355adecc936e3044cae2 Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 4 Apr 2023 20:09:58 +1000 Subject: [PATCH 0073/1418] fix for 64 bit compiler in bitstream read from file function --- lib_util/split_render_file_read_write.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 78ef342bbf..23e60d58c9 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -198,6 +198,7 @@ ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileRea char header_read[SPLIT_RENDERER_FRAME_HEADER_LEN]; size_t header_len, i, num_bytes, bit_len; + bit_len = 0; if ( hSplitRendFileReadWrite == NULL ) { return IVAS_ERR_FAILED_FILE_READ; -- GitLab From 59cf37d1b8f4c462069bee5e876a48246c552904 Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Tue, 4 Apr 2023 11:17:26 -0400 Subject: [PATCH 0074/1418] first tuning version, vaclav find it takes off too much ambiance --- Workspace_msvc/decoder.vcxproj | 6 ++--- Workspace_msvc/encoder.vcxproj | 8 +++---- Workspace_msvc/lib_com.vcxproj | 8 +++---- Workspace_msvc/lib_debug.vcxproj | 8 +++---- Workspace_msvc/lib_dec.vcxproj | 8 +++---- Workspace_msvc/lib_enc.vcxproj | 8 +++---- Workspace_msvc/lib_rend.vcxproj | 8 +++---- Workspace_msvc/lib_util.vcxproj | 8 +++---- Workspace_msvc/renderer.vcxproj | 8 +++---- lib_com/ivas_prot.h | 13 +++++++++++ lib_com/ivas_stereo_td_bit_alloc.c | 24 +++++++++++++++----- lib_com/options.h | 7 +++--- lib_dec/ivas_cpe_dec.c | 6 ++++- lib_dec/ivas_stereo_td_dec.c | 10 ++++++++- lib_enc/ivas_cpe_enc.c | 22 ++++++++++++++----- lib_enc/ivas_omasa_enc.c | 2 +- lib_enc/ivas_stereo_classifier.c | 13 +++++++++++ lib_enc/ivas_stereo_td_analysis.c | 12 +++++++++- lib_enc/ivas_stereo_td_enc.c | 35 ++++++++++++++++++++++-------- 19 files changed, 152 insertions(+), 62 deletions(-) diff --git a/Workspace_msvc/decoder.vcxproj b/Workspace_msvc/decoder.vcxproj index e59992847c..f0016965e0 100644 --- a/Workspace_msvc/decoder.vcxproj +++ b/Workspace_msvc/decoder.vcxproj @@ -14,18 +14,18 @@ decoder {E3DCBC31-7FC9-D127-E000-529F8460D5FD} decoder - 10.0.17763.0 + 10.0 Application - v141 + v142 false MultiByte Application - v141 + v142 false MultiByte diff --git a/Workspace_msvc/encoder.vcxproj b/Workspace_msvc/encoder.vcxproj index bcfe92a4db..fc7e189560 100644 --- a/Workspace_msvc/encoder.vcxproj +++ b/Workspace_msvc/encoder.vcxproj @@ -18,24 +18,24 @@ encoder {B3FC9DFC-7268-8660-7C0D-B60BAF02C554} encoder - 10.0.17763.0 + 10.0 Application - v141 + v142 false MultiByte Application - v141 + v142 false MultiByte Application - v141 + v142 false MultiByte diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 78ed7bb39d..ed8012c4d3 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -17,24 +17,24 @@ {39EC200D-7795-4FF8-B214-B24EDA5526AE} common - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index 3b648fae04..6a5e102b0c 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -17,22 +17,22 @@ {54509728-928B-44D9-A118-A6F92F08B34F} debug - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 MultiByte StaticLibrary - v141 + v142 MultiByte StaticLibrary - v141 + v142 MultiByte true diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index dd2ed44443..facb2d3bc3 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -18,24 +18,24 @@ lib_dec {E822DDAF-0F5F-4CD0-A694-38AE69DE74D3} evs_dec - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index af7ca35b12..eede51cfde 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -18,24 +18,24 @@ lib_enc {824DA4CF-06F0-45C9-929A-8792F0E19C3E} evs_enc - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 865652649a..1cb397d10f 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -18,24 +18,24 @@ lib_rend {718DE063-A18B-BB72-9150-62B892E6FFA6} evs_dec - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte StaticLibrary - v141 + v142 false MultiByte diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 5b5e5f30cc..d1a1a8d818 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -17,22 +17,22 @@ {2FA8F384-0775-F3B7-F8C3-85209222FC70} utility - 10.0.17763.0 + 10.0 StaticLibrary - v141 + v142 MultiByte StaticLibrary - v141 + v142 MultiByte StaticLibrary - v141 + v142 MultiByte true diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj index 94ad9f774e..d90b4a6251 100644 --- a/Workspace_msvc/renderer.vcxproj +++ b/Workspace_msvc/renderer.vcxproj @@ -18,24 +18,24 @@ renderer {12B4C8A5-1E06-4E30-B443-D1F916F52B47} renderer - 10.0.17763.0 + 10.0 Application - v141 + v142 false MultiByte Application - v141 + v142 false MultiByte Application - v141 + v142 false MultiByte diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index bfae9aa4a6..56ec490530 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1766,6 +1766,9 @@ int16_t select_stereo_mode( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : IVAS total brate */ +#ifdef OMASA_TUNING + ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#endif ); void stereo_classifier_init( @@ -1851,6 +1854,10 @@ void tdm_configure_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#endif + ); void tdm_upmix_plain( @@ -1904,6 +1911,9 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#endif ); ivas_error signaling_enc_secondary( @@ -1927,6 +1937,9 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx /* i : instantaneous correlation ratio index */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : Flag that indicates presence of OMASA */ +#endif ); void td_stereo_param_updt( diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 8b93558b21..b6d3f214b3 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -88,6 +88,9 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx_ref /* i : instantaneous correlation ratio idx */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : Flag that indicates presence of OMASA */ +#endif ) { int16_t idx, four_subfr_fcb, two_subfr_fcb; @@ -136,7 +139,12 @@ void tdm_bit_alloc( *total_brate_sec = tdm_bit_allc_tbl[idx][coder_type]; /* secondary channel bitrate allocation based on the energy scaling ratio */ +#ifdef OMASA_TUNING + if ( (IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || + ( IsOmasa == 1 && coder_type > UNVOICED ) ) +#else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) +#endif { bit_rate_diff = (float) ( element_brate_wo_meta - 2 * *total_brate_sec ); @@ -404,11 +412,11 @@ void tdm_bit_alloc( } *total_brate_sec += ( fast_FCB_rates_2sfr[idx] - tmp_rate ); } - /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ - if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) - { - *total_brate_sec += 100; - } + ///* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ + //if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) + //{ + // *total_brate_sec += 100; + //} /* To prevent 13.2 kb/s for primary channel as some bitstream issues arrise with it */ if ( element_brate_wo_meta - *total_brate_sec == ACELP_13k20 ) @@ -416,7 +424,11 @@ void tdm_bit_alloc( *total_brate_sec += 100; } } - + /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ + if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) + { + *total_brate_sec += 100; + } *total_brate_pri = element_brate_wo_meta - *total_brate_sec; return; diff --git a/lib_com/options.h b/lib_com/options.h index d0718997f5..b4d5642711 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,12 +58,12 @@ #ifdef DEBUGGING -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +#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_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_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/" */ @@ -172,6 +172,7 @@ #define OMASA_BRATE_SW /* VA: support of bitrate switching in OMASA format */ #define FIX_TD5_IN_OMASA // do not transmit extended MD in OMASA +#define OMASA_TUNING #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index b52c2ea054..d699511690 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -413,7 +413,11 @@ ivas_error ivas_cpe_dec( { if ( !st_ivas->bfi ) { - tdm_configure_dec( hCPE, &tdm_ratio_idx, nb_bits_metadata ); + tdm_configure_dec( hCPE, &tdm_ratio_idx, nb_bits_metadata +#ifdef OMASA_TUNING + , (st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_24k4)) +#endif + ); sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC ); } diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 31b66044c6..7cfa3d92fd 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -87,6 +87,10 @@ void tdm_configure_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#endif + ) { STEREO_TD_DEC_DATA_HANDLE hStereoTD; @@ -308,7 +312,11 @@ void tdm_configure_dec( tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx +#ifdef OMASA_TUNING + ,IsOmasa +#endif + ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 128c63b114..53a30ce4d5 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -169,12 +169,20 @@ ivas_error ivas_cpe_enc( #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && ivas_total_brate == IVAS_48k ) { - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k ); + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k +#ifdef OMASA_TUNING + ,st_ivas->hOMasa!=NULL +#endif + ); } else { #endif - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate +#ifdef OMASA_TUNING + ,st_ivas->hOMasa!=NULL +#endif + ); #ifdef OMASA_UPDATES } #endif @@ -579,7 +587,11 @@ ivas_error ivas_cpe_enc( { tdm_ol_pitch_comparison( hCPE, pitch_fr, voicing_fr ); - tdm_configure_enc( hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); + tdm_configure_enc( hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata +#ifdef OMASA_TUNING + ,st_ivas->hOMasa != NULL +#endif + ); if ( hEncoderConfig->Opt_DTX_ON ) { @@ -784,7 +796,7 @@ ivas_error ivas_cpe_enc( dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_NCShift" ); dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_ica_gD" ); n = -1; - dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } else if ( hCPE->element_mode == IVAS_CPE_TD ) { @@ -801,7 +813,7 @@ ivas_error ivas_cpe_enc( else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { n = -2; - dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } { diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 2ec461d5f9..b853638840 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -892,7 +892,7 @@ void ivas_set_surplus_brate_enc( if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) + if (1)// st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) #endif { tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index b2e3373404..36f06ccadc 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -90,6 +90,9 @@ int16_t select_stereo_mode( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : IVAS total brate */ +#ifdef OMASA_TUNING + ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#endif ) { int16_t element_mode; @@ -209,6 +212,16 @@ int16_t select_stereo_mode( set_f( hStereoClassif->xtalk_fv, -1.0f, SSC_MAX_NFEA ); } } +#ifdef OMASA_TUNING + else if ( element_mode == IVAS_CPE_TD && isOmasa ) + { + if ( ( hStereoClassif->lrtd_mode == 1 || hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 ) && ( hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus + hCPE->brate_surplus < 15000 ) ) + { + hStereoClassif->lrtd_mode = 0; + hStereoClassif->prev_lrtd_mode = 0; + } + } +#endif #ifdef DEBUG_MODE_TD diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index d2d72c1534..70aaf2ebed 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -229,7 +229,17 @@ int16_t stereo_tdm_ener_analysis( hStereoTD->prev_fr_LRTD_TD_dec = 0; } } - + //if ( hCPE->hStereoTD != NULL ) + //{ + + // if ( /*hStereoClassif->lrtd_mode == 1*/ hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 && hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) + // { + // //hStereoClassif->xtalk_decision = 0; + // //hStereoClassif->lrtd_mode = 0; + // hCPE->hStereoTD->prev_fr_LRTD_TD_dec = 0; + // //hCPE->hStereoClassif->lrtd_mode = 0; + // } + //} side_can_change = 0; /* update LRTD->DFT stereo hangover counters */ diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 2105b351b3..2f34424f70 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -283,8 +283,8 @@ ivas_error stereo_set_tdm( dbgwrite( &tmp, 2, 1, 320, "res/inst_ratio_L" ); dbgwrite( &ftmp, 4, 1, 320, "res/ratio_L" ); dbgwrite( &tmp, 2, 1, 320, "res/tdm_low_rate_mode" ); - dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); - dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); + //dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); + //dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); } #endif hCPE->hCoreCoder[0]->tdm_LRTD_flag = 0; @@ -309,6 +309,9 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_TUNING + ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#endif ) { int16_t tdm_ratio_bit_alloc_idx, mod_ct; @@ -420,11 +423,21 @@ void tdm_configure_enc( } #ifdef MASA_AND_OBJECTS - if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) { - sts[1]->coder_type = INACTIVE; - hStereoTD->tdm_Pitch_reuse_flag = 0; + if ( sts[1]->coder_type == UNVOICED) + { + sts[1]->coder_type = GENERIC; + } hStereoTD->tdm_lp_reuse_flag = 1; +#ifdef OMASA_TUNING + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 6000 && hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 0 ) +#else + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 /*&& hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 0*/ ) +#endif + { + sts[1]->coder_type = INACTIVE; + } } if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 14700 ) @@ -473,7 +486,11 @@ void tdm_configure_enc( tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx +#ifdef OMASA_TUNING + ,IsOmasa +#endif + ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #endif @@ -539,9 +556,9 @@ void tdm_configure_enc( } #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" ); + dbgwrite( &hStereoTD->tdm_low_rate_mode, 2, 1, 320, "res/tdm_low_rate_mode_c" ); + dbgwrite( &hStereoTD->tdm_lp_reuse_flag, 2, 1, 320, "res/tdm_lp_reuse_flag_c" ); + dbgwrite( &mod_ct, 2, 1, 320, "res/mod_ct.enc" ); #endif /*----------------------------------------------------------------* * Updates -- GitLab From 7bba4f3ae73dd2f72eaf8f917d7182d4c5bfd6f4 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 5 Apr 2023 08:46:10 +0300 Subject: [PATCH 0075/1418] Makes ISM rendering to LS in OMASA closer to separate ISM rendering to LS. Also applies clang format. --- lib_com/ivas_ism_config.c | 3 +- lib_com/ivas_omasa_com.c | 14 ++- lib_com/ivas_prot.h | 8 ++ lib_com/ivas_stat_com.h | 2 +- lib_com/options.h | 2 +- lib_dec/ivas_core_dec.c | 2 +- lib_dec/ivas_cpe_dec.c | 3 +- lib_dec/ivas_dec.c | 4 +- lib_dec/ivas_dirac_dec.c | 9 +- lib_dec/ivas_dirac_output_synthesis_dec.c | 17 ++++ lib_dec/ivas_init_dec.c | 6 +- lib_dec/ivas_ism_metadata_dec.c | 4 +- lib_dec/ivas_ism_renderer.c | 28 +++--- lib_dec/ivas_masa_dec.c | 27 +++--- lib_dec/ivas_omasa_dec.c | 6 +- lib_dec/ivas_stat_dec.h | 5 ++ lib_dec/ivas_vbap.c | 92 ++++++++++++++++++++ lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_decision_matrix_enc.c | 2 +- lib_enc/ivas_enc.c | 2 +- lib_enc/ivas_init_enc.c | 6 +- lib_enc/ivas_ism_metadata_enc.c | 14 +-- lib_enc/ivas_masa_enc.c | 26 ++---- lib_enc/ivas_omasa_enc.c | 8 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 +- 25 files changed, 205 insertions(+), 89 deletions(-) mode change 100755 => 100644 lib_dec/ivas_core_dec.c diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index 8a0621509c..4f2ace5b2a 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -386,7 +386,7 @@ ivas_error ivas_ism_config( { int32_t tmpL; tmpL = sum_l( total_brate, n_ISms ) + bits_side * FRMS_PER_SECOND; -#ifdef MASA_AND_OBJECTS +#ifdef MASA_AND_OBJECTS if ( ism_total_brate != tmpL ) #else if ( sum_l( element_brate, n_ISms ) != tmpL ) @@ -394,7 +394,6 @@ ivas_error ivas_ism_config( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "\nError: Mismatch in ISm bit-budget distribution. Exiting!\n" ); } - } #endif diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 175bf22195..101afcbc87 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -69,11 +69,10 @@ #endif - /*--------------------------------------------------------------- * ivas_omasa_ism_mode_select() * - * selects the ISM mode base on IVAS total bit-rate and + * selects the ISM mode base on IVAS total bit-rate and * the number of objects in the combined ISM MASA format mode * ---------------------------------------------------------------*/ @@ -179,7 +178,6 @@ ISM_MODE ivas_omasa_ism_mode_select( } - /*--------------------------------------------------------------- * ivas_interformat_brate() * @@ -209,12 +207,11 @@ int32_t ivas_interformat_brate( } else { - if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate <= 24000 ) - || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) /* for border case in DISC mode */ + if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate <= 24000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) /* for border case in DISC mode */ { #ifdef OMASA_UPDATES - if ( (limit_flag == 1) && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) + if ( ( limit_flag == 1 ) && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) { return element_brate; } @@ -383,7 +380,7 @@ int16_t bits_index_ism_ratio( /*--------------------------------------------------------------- * calculate_nbits_meta() * - * + * * ---------------------------------------------------------------*/ void calculate_nbits_meta( @@ -487,7 +484,7 @@ void ivas_get_stereo_panning_gains( return; } -int16_t calculate_brate_limit_flag(int16_t * ism_imp, int16_t num_obj) +int16_t calculate_brate_limit_flag( int16_t *ism_imp, int16_t num_obj ) { int16_t n; int16_t brate_limit_flag; @@ -517,4 +514,3 @@ int16_t calculate_brate_limit_flag(int16_t * ism_imp, int16_t num_obj) return brate_limit_flag; } #endif - diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 750e5fc85c..7ad36a7cc2 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4744,6 +4744,10 @@ ivas_error vbap_init_data( const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ +#ifdef OMASA_UPDATES + , + const int16_t support_object_mode /* i : init VBAP also for object panning mode */ +#endif ); void vbap_free_data( @@ -4755,6 +4759,10 @@ void vbap_determine_gains( float *gains, /* o : gain vector for speaker nodes for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up) */ +#ifdef OMASA_UPDATES + , + const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ +#endif ); void v_sort_ind( diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index c7664a9a41..224d26bbea 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -58,7 +58,7 @@ typedef struct int16_t last_elevation_idx; /* last frame index of coded elevation */ int16_t elevation_diff_cnt; /* FEC counter of consecutive differentially elevation coded frames */ -#ifdef MASA_AND_OBJECTS +#ifdef MASA_AND_OBJECTS int16_t ism_imp; /* ISM importance flag */ int16_t ism_vad_flag; #ifdef OMASA_UPDATES diff --git a/lib_com/options.h b/lib_com/options.h index 62011c419e..442a0004d7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -143,7 +143,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #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_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 */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c old mode 100755 new mode 100644 index 37034da4f8..171ecbfafe --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -269,7 +269,7 @@ ivas_error ivas_core_dec( } } -#ifdef MASA_AND_OBJECTS +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------* * Sanity check in combined format coding *-----------------------------------------------------------------*/ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index b093d58805..1ba5c68f5a 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -176,7 +176,6 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS } #endif - } else { @@ -1116,7 +1115,7 @@ static void read_stereo_mode_and_bwidth( { /* read stereo technology info */ #ifdef OMASA_UPDATES - if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k) ) + if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k ) ) #else if ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) #endif diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 80b5d6edd2..8c5a9b4716 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -529,8 +529,8 @@ ivas_error ivas_dec( } ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); - ivas_td_binaural_renderer_unwrap( st_ivas->hRenderConfig, st_ivas->ini_frame,st_ivas->hCrendWrapper, - st_ivas->transport_config,st_ivas->hDecoderConfig->output_Fs, st_ivas->hBinRendererTd, + ivas_td_binaural_renderer_unwrap( st_ivas->hRenderConfig, st_ivas->ini_frame, st_ivas->hCrendWrapper, + st_ivas->transport_config, st_ivas->hDecoderConfig->output_Fs, st_ivas->hBinRendererTd, st_ivas->nchan_ism, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, data_separated_objects, output_frame ); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f8e0f98d1b..b3c097c3a4 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -579,10 +579,17 @@ ivas_error ivas_dirac_dec_config( { vbap_free_data( &( st_ivas->hVBAPdata ) ); } +#ifdef OMASA_UPDATES + if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE, st_ivas->ivas_format == MASA_ISM_FORMAT ? 1 : 0 ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE ) ) != IVAS_ERR_OK ) { return error; } +#endif } else if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) { @@ -2030,7 +2037,7 @@ void ivas_dirac_dec( preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, - (uint8_t)(hDirAC->num_freq_bands), + (uint8_t) ( hDirAC->num_freq_bands ), (uint8_t) subframe_idx, 1 ); } diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 4fcb4c089e..2ef79bfc45 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -1681,11 +1681,19 @@ void ivas_dirac_dec_compute_directional_responses( { if ( hMasaIsm->ism_is_edited[dir] ) { +#ifdef OMASA_UPDATES + vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], 1 ); +#else vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir] ); +#endif } else { +#ifdef OMASA_UPDATES + vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], 1 ); +#else vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir] ); +#endif } for ( l = 0; l < num_channels_dir; l++ ) @@ -2202,12 +2210,21 @@ static void spreadCoherencePanningVbap( return; } +#ifdef OMASA_UPDATES + vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation, 0 ); +#else vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation ); +#endif if ( spreadCoh > 0.f ) { +#ifdef OMASA_UPDATES + vbap_determine_gains( hVBAPdata, direct_response_left, azimuth + 30, elevation, 0 ); + vbap_determine_gains( hVBAPdata, direct_response_right, azimuth - 30, elevation, 0 ); +#else vbap_determine_gains( hVBAPdata, direct_response_left, azimuth + 30, elevation ); vbap_determine_gains( hVBAPdata, direct_response_right, azimuth - 30, elevation ); +#endif if ( spreadCoh < 0.5f ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 15519bdee4..16ed84c257 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1250,7 +1250,11 @@ ivas_error ivas_init_decoder( } else { +#ifdef OMASA_UPDATES + vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0, 0 ); +#else vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0 ); +#endif } } @@ -1437,7 +1441,7 @@ ivas_error ivas_init_decoder( { /* Use td renderer for the objects in DISC mode */ error = ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, st_ivas->nchan_ism, st_ivas->ivas_format, - st_ivas->transport_config, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); + st_ivas->transport_config, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); if ( ( error ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 4066304dab..4bb56b0b82 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -651,8 +651,8 @@ ivas_error create_ism_metadata_dec( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } - - ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL + + ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL #ifdef MASA_AND_OBJECTS , 0 diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 043b6f8600..feca51b696 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -252,10 +252,10 @@ void ivas_ism_get_stereo_gains( #ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------------* - * ivas_masa_ism_separate_object_renderer_open() - * - * Open structures, reserve memory, and init values. - *-------------------------------------------------------------------------*/ + * ivas_masa_ism_separate_object_renderer_open() + * + * Open structures, reserve memory, and init values. + *-------------------------------------------------------------------------*/ ivas_error ivas_masa_ism_separate_object_renderer_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ @@ -314,10 +314,10 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( /*-------------------------------------------------------------------------* -* ivas_masa_ism_separate_object_render() -* -* Rendering separated objects and mixing them to the parametrically rendered signals -*-------------------------------------------------------------------------*/ + * ivas_masa_ism_separate_object_render() + * + * Rendering separated objects and mixing them to the parametrically rendered signals + *-------------------------------------------------------------------------*/ void ivas_masa_ism_separate_object_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -327,7 +327,6 @@ void ivas_masa_ism_separate_object_render( ) { VBAP_HANDLE hVBAPdata; - AUDIO_CONFIG output_config; int16_t nchan_out_woLFE; ISM_RENDERER_HANDLE hRendererData; int16_t j, k, j2; @@ -340,13 +339,12 @@ void ivas_masa_ism_separate_object_render( uint8_t single_separated; hVBAPdata = st_ivas->hVBAPdata; - output_config = st_ivas->hDecoderConfig->output_config; nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; hRendererData = st_ivas->hIsmRendererData; lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; #ifdef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) #endif @@ -375,20 +373,26 @@ void ivas_masa_ism_separate_object_render( elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; } - if ( output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_5_1_4 ) + if ( st_ivas->hOutSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ elevation = 0; } +#ifndef OMASA_UPDATES else if ( output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_4 ) { /* For no negative elevations, it's better to map them to zero */ elevation = elevation < 0 ? 0 : elevation; } +#endif if ( hVBAPdata != NULL ) { +#ifdef OMASA_UPDATES + vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); +#else vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); +#endif } else { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a0fa5cf0b4..e7ae030555 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -74,11 +74,11 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS -static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp); +static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp ); static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); -static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object); +static void decode_ism_ratios( uint16_t *bit_stream, int16_t *next_bit_pos, IVAS_QMETADATA_HANDLE hQMetaData, float ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t nbands, const int16_t nblocks, const int16_t idx_separated_object ); static void read_ism_ratio_index( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], uint16_t *bit_stream, int16_t *next_bit_pos, float *masa_to_total_energy_ratio, const int16_t idx_sep_obj, int16_t *num_zeros ); #endif @@ -644,7 +644,7 @@ ivas_error ivas_masa_ism_data_open( hMasaIsmData->q_elevation_old[ch] = 0.0f; hMasaIsmData->q_azimuth_old[ch] = 0.0f; } - #endif +#endif return IVAS_ERR_OK; } @@ -1795,7 +1795,7 @@ static void read_ism_ratio_index( b_signif = 0; no_levels_ratio_ism = ( ( 1 << PARAM_ISM_POW_RATIO_NBITS ) - 1 ); - while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) + while ( ( b_signif < numCodingBands ) && ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR ) ) { /* distribute evenly the objects */ distribute_evenly_ism( ratio_ism_idx[b_signif], no_levels_ratio_ism, nchan_ism ); @@ -2033,9 +2033,6 @@ static void read_ism_ratio_index( } - - - static void decode_ism_ratios( uint16_t *bit_stream, /* i : bitstream */ int16_t *next_bit_pos, /* i/o: position in bitstream */ @@ -2044,7 +2041,7 @@ static void decode_ism_ratios( const int16_t n_ism, /* i : number of objects */ const int16_t nbands, /* i : number of subbands */ const int16_t numSf, /* i : number of subframes */ - const int16_t idx_separated_object /* i: index of separated object */ + const int16_t idx_separated_object /* i: index of separated object */ ) { int16_t sf, band; @@ -2122,8 +2119,7 @@ static int16_t ivas_decode_masaism_metadata( uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, - const int16_t ism_imp -) + const int16_t ism_imp ) { int16_t sf, band, dir, nbands, nblocks, obj, i; float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; @@ -2180,11 +2176,11 @@ static int16_t ivas_decode_masaism_metadata( index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; } deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); - + if ( azimuth * hMasaIsmData->q_azimuth_old[obj] > 0 ) { delta_phi = 180.0f / (float) ( no_phi_masa[bits_ism[obj] - 1][idx_el] ); /* 360/2*/ - if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) + if ( azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi ) { azimuth -= delta_phi; } @@ -2192,11 +2188,11 @@ static int16_t ivas_decode_masaism_metadata( { if ( hMasaIsmData->q_azimuth_old[obj] - azimuth > delta_phi ) { - azimuth += delta_phi; + azimuth += delta_phi; } } } - + hMasaIsmData->q_azimuth_old[obj] = azimuth; hMasaIsmData->q_elevation_old[obj] = elevation; } @@ -2222,7 +2218,6 @@ static int16_t ivas_decode_masaism_metadata( #endif hMasaIsmData->azimuth_ism[obj] = (int16_t) rint( azimuth ); hMasaIsmData->elevation_ism[obj] = (int16_t) rint( elevation ); - } /* Modify ISM metadata based on the MASA-to-total energy ratios */ @@ -2269,7 +2264,7 @@ static int16_t ivas_decode_masaism_metadata( /*-------------------------------------------------------------------* * ivas_masa_ism_set_edited_objects() * - * + * *-------------------------------------------------------------------*/ void ivas_masa_ism_set_edited_objects( diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 35441360fe..9233e4be99 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -91,14 +91,14 @@ void ivas_set_surplus_brate_dec( { #ifdef OMASA_UPDATES int16_t brate_limit_flag, ism_imp[MAX_NUM_OBJECTS]; - + for ( n = 0; n < st_ivas->nchan_ism; n++ ) { ism_imp[n] = st_ivas->hIsmMetaData[n]->ism_imp; } - + brate_limit_flag = calculate_brate_limit_flag( ism_imp, st_ivas->nchan_ism ); - + #endif ism_total_brate_ref = 0; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4316c90677..ff1f264e46 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1028,6 +1028,11 @@ typedef struct vbap_data_structure float *bottom_virtual_speaker_node_division_gains; float *top_virtual_speaker_node_division_gains; float *back_virtual_speaker_node_division_gains; +#ifdef OMASA_UPDATES + float *object_mode_bottom_virtual_speaker_node_division_gains; + float *object_mode_top_virtual_speaker_node_division_gains; + float *object_mode_back_virtual_speaker_node_division_gains; +#endif } VBAP_DATA, *VBAP_HANDLE; diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index 9c595ea1fe..d3ecedecfd 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -141,7 +141,11 @@ static enum VirtualSpeakerNodeType check_need_of_virtual_speaker_node( VBAP_HAND static int16_t determine_best_triplet_and_gains( VBAP_SEARCH_STRUCT *search_struct, const float panning_unit_vec[3], const int16_t azi_deg, float gains[3] ); +#ifdef OMASA_UPDATES +static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes, const int16_t use_object_mode ); +#else static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes ); +#endif static void reorder_triplets( VBAP_VS_TRIPLET *triplets, const int16_t *target_order, const int16_t num_triplets ); @@ -157,6 +161,10 @@ ivas_error vbap_init_data( const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ +#ifdef OMASA_UPDATES + , + const int16_t support_object_mode /* i : init VBAP also for object panning mode */ +#endif ) { /* Variables */ @@ -203,6 +211,11 @@ ivas_error vbap_init_data( vbap->bottom_virtual_speaker_node_division_gains = NULL; vbap->top_virtual_speaker_node_division_gains = NULL; vbap->back_virtual_speaker_node_division_gains = NULL; +#ifdef OMASA_UPDATES + vbap->object_mode_bottom_virtual_speaker_node_division_gains = NULL; + vbap->object_mode_top_virtual_speaker_node_division_gains = NULL; + vbap->object_mode_back_virtual_speaker_node_division_gains = NULL; +#endif vbap->num_speaker_nodes = num_speaker_nodes; vbap->num_speaker_nodes_internal = num_speaker_nodes; @@ -223,6 +236,14 @@ ivas_error vbap_init_data( vbap->bottom_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->bottom_virtual_speaker_node_division_gains != NULL; +#ifdef OMASA_UPDATES + if ( support_object_mode ) + { + vbap->object_mode_bottom_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); + set_zero( vbap->object_mode_bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); + is_success &= vbap->object_mode_bottom_virtual_speaker_node_division_gains != NULL; + } +#endif speaker_node_azi_deg_internal[vbap->bottom_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->bottom_virtual_speaker_node_index] = -90.0f; } @@ -232,6 +253,14 @@ ivas_error vbap_init_data( vbap->top_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->top_virtual_speaker_node_division_gains != NULL; +#ifdef OMASA_UPDATES + if ( support_object_mode ) + { + vbap->object_mode_top_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); + set_zero( vbap->object_mode_top_virtual_speaker_node_division_gains, num_speaker_nodes ); + is_success &= vbap->object_mode_top_virtual_speaker_node_division_gains != NULL; + } +#endif speaker_node_azi_deg_internal[vbap->top_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->top_virtual_speaker_node_index] = 90.0f; } @@ -241,6 +270,14 @@ ivas_error vbap_init_data( vbap->back_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->back_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->back_virtual_speaker_node_division_gains != NULL; +#ifdef OMASA_UPDATES + if ( support_object_mode ) + { + vbap->object_mode_back_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); + set_zero( vbap->object_mode_back_virtual_speaker_node_division_gains, num_speaker_nodes ); + is_success &= vbap->object_mode_back_virtual_speaker_node_division_gains != NULL; + } +#endif speaker_node_azi_deg_internal[vbap->back_virtual_speaker_node_index] = 180.0f; speaker_node_ele_deg_internal[vbap->back_virtual_speaker_node_index] = 0.0f; } @@ -319,11 +356,23 @@ ivas_error vbap_init_data( /* Determine how the virtual node gains should be distributed to real nodes, if necessary (checked within function). */ if ( is_success ) { +#ifdef OMASA_UPDATES + determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes, 0 ); + determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes, 0 ); + determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes, 0 ); + if ( support_object_mode ) + { + determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->object_mode_top_virtual_speaker_node_division_gains, connections, virtual_top_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); + determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->object_mode_bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); + determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->object_mode_back_virtual_speaker_node_division_gains, connections, virtual_back_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); + } +#else determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes ); determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes ); determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes ); +#endif } pop_wmops(); @@ -368,6 +417,20 @@ void vbap_free_data( { free( ( *hVBAPdata )->back_virtual_speaker_node_division_gains ); } +#ifdef OMASA_UPDATES + if ( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains != NULL ) + { + free( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains ); + } + if ( ( *hVBAPdata )->object_mode_top_virtual_speaker_node_division_gains != NULL ) + { + free( ( *hVBAPdata )->object_mode_top_virtual_speaker_node_division_gains ); + } + if ( ( *hVBAPdata )->object_mode_back_virtual_speaker_node_division_gains != NULL ) + { + free( ( *hVBAPdata )->object_mode_back_virtual_speaker_node_division_gains ); + } +#endif if ( ( *hVBAPdata )->search_struct[0].triplets != NULL ) { free( ( *hVBAPdata )->search_struct[0].triplets ); @@ -395,6 +458,10 @@ void vbap_determine_gains( float *gains, /* o : gain vector for loudspeakers for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left)*/ const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up)*/ +#ifdef OMASA_UPDATES + , + const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ +#endif ) { /* This function formulates gains for the given angle. The triplet-selection has been pre-formulated. */ @@ -428,9 +495,24 @@ void vbap_determine_gains( bottom_virtual_speaker_node_index = hVBAPdata->bottom_virtual_speaker_node_index; top_virtual_speaker_node_index = hVBAPdata->top_virtual_speaker_node_index; back_virtual_speaker_node_index = hVBAPdata->back_virtual_speaker_node_index; +#ifdef OMASA_UPDATES + if ( use_object_mode ) + { + bottom_virtual_speaker_node_division_gains = hVBAPdata->object_mode_bottom_virtual_speaker_node_division_gains; + top_virtual_speaker_node_division_gains = hVBAPdata->object_mode_top_virtual_speaker_node_division_gains; + back_virtual_speaker_node_division_gains = hVBAPdata->object_mode_back_virtual_speaker_node_division_gains; + } + else + { + bottom_virtual_speaker_node_division_gains = hVBAPdata->bottom_virtual_speaker_node_division_gains; + top_virtual_speaker_node_division_gains = hVBAPdata->top_virtual_speaker_node_division_gains; + back_virtual_speaker_node_division_gains = hVBAPdata->back_virtual_speaker_node_division_gains; + } +#else bottom_virtual_speaker_node_division_gains = hVBAPdata->bottom_virtual_speaker_node_division_gains; top_virtual_speaker_node_division_gains = hVBAPdata->top_virtual_speaker_node_division_gains; back_virtual_speaker_node_division_gains = hVBAPdata->back_virtual_speaker_node_division_gains; +#endif panning_wrap_angles( (float) azi_deg, (float) ele_deg, &azi_temp, &ele_temp ); azi_rad = azi_temp * PI_OVER_180; @@ -679,6 +761,10 @@ static void determine_virtual_speaker_node_division_gains( const enum VirtualSpeakerNodeType type, /* i : virtual speaker node typel */ const int16_t max_num_connections, /* i : max number of connections */ const int16_t num_speaker_nodes /* i : max number of speaker nodes */ +#ifdef OMASA_UPDATES + , + const int16_t use_object_mode /* i : use VBAP in object panning mode vs. spatial panning mode */ +#endif ) { /* When node type is VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, the gains of the virtual node @@ -721,6 +807,12 @@ static void determine_virtual_speaker_node_division_gains( for ( ch = 0; ch < num_speaker_nodes; ch++ ) { virtual_node_division_gains[ch] /= sum_val; +#ifdef OMASA_UPDATES + if ( use_object_mode ) + { + virtual_node_division_gains[ch] = powf( virtual_node_division_gains[ch], 0.8f ); + } +#endif } } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index e3b8342896..861e1015c4 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -285,7 +285,7 @@ ivas_error ivas_cpe_enc( { #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MODE_NONE ) - { + { stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, (int32_t) ( 0.70f * st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } else diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index afb4fc8ac7..fcc77edd52 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -405,7 +405,7 @@ void ivas_signaling_enc( * Write element mode info *--------------------------------------------------------------------------*/ #ifdef OMASA_UPDATES - if ( (st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ + if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ #else if ( st->element_mode >= IVAS_CPE_DFT && element_brate < MIN_BRATE_MDCT_STEREO && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ #endif diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index de247c0a56..e4448b0f56 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -320,7 +320,7 @@ ivas_error ivas_enc( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); + ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); } /* Estimate TF-tile energy for the input MASA stream */ diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 1b6e2bd596..ff43a42536 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -481,7 +481,7 @@ ivas_error ivas_init_encoder( if ( ( error = ivas_ism_dtx_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; - } + } } #endif } @@ -631,9 +631,9 @@ ivas_error ivas_init_encoder( } } #ifdef OMASA_UPDATES - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM) ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) #else - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) #endif { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 97b689b5dd..b03b25f6c9 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -257,8 +257,8 @@ ivas_error ivas_ism_metadata_enc( #endif { /*----------------------------------------------------------------* - * Set Metadata presence / importance flag - *----------------------------------------------------------------*/ + * Set Metadata presence / importance flag + *----------------------------------------------------------------*/ for ( ch = 0; ch < num_obj; ch++ ) { @@ -295,8 +295,8 @@ ivas_error ivas_ism_metadata_enc( } /*----------------------------------------------------------------* - * Rate importance of particular ISm streams - *----------------------------------------------------------------*/ + * Rate importance of particular ISm streams + *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC ) { @@ -880,7 +880,7 @@ ivas_error ivas_ism_metadata_enc( int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; #ifdef OMASA_UPDATES int16_t brate_limit_flag; - brate_limit_flag = calculate_brate_limit_flag( ism_imp, num_obj ); + brate_limit_flag = calculate_brate_limit_flag( ism_imp, num_obj ); #endif bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); @@ -892,7 +892,7 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < num_obj; ch++ ) { #ifdef OMASA_UPDATES - *ism_total_brate += ivas_interformat_brate( ism_mode, num_obj, hSCE[ch]->element_brate, ism_imp[ch],brate_limit_flag + *ism_total_brate += ivas_interformat_brate( ism_mode, num_obj, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag #else *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, num_obj, hSCE[ch]->element_brate, ism_imp[ch] #ifdef FIX_4OBJ_128 @@ -912,7 +912,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS #ifdef OMASA_UPDATES - if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { ivas_ism_config( *ism_total_brate, nchan_transport, num_obj, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, 1 ); // VE: this funtion should return an error } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 07c313f002..dec4b97b3c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -57,8 +57,7 @@ static void compensate_energy_ratios( MASA_ENCODER_HANDLE hMasa ); static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate ); #ifdef MASA_AND_OBJECTS -static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks, - const int16_t idx_separated_object, const int16_t ism_imp ); +static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks, const int16_t idx_separated_object, const int16_t ism_imp ); static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format, const ISM_MODE ism_mode ); @@ -66,7 +65,7 @@ static void quantize_ratio_ism_vector( float *ratio_ism, int16_t *idx, const int static int16_t index_slice_enum( const int16_t *ratio_ism_idx, int16_t no_ism ); -static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); +static int16_t encode_ratio_ism_subframe( int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); static void transform_index_and_GR_encode( int16_t *diff_idx, int16_t len, int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); @@ -2183,8 +2182,7 @@ static void quantize_ratio_ism_vector( int16_t *idx, const int16_t nchan_ism, const float masa_to_total_energy_ratio, - const int16_t idx_sep_object -) + const int16_t idx_sep_object ) { int16_t i, j, best_i, best_i2; float dist, div, tmp, dist2, best_dist; @@ -2407,7 +2405,7 @@ static int16_t try_differential( b_signif = 0; - while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) + while ( ( b_signif < numCodingBands ) && ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR ) ) { b_signif++; } @@ -2656,7 +2654,7 @@ static int16_t encode_ratio_ism_subframe( nbits0 = 0; nbits1 = 0; b_signif = 0; - while ( (b_signif < numCodingBands) && (masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR) ) + while ( ( b_signif < numCodingBands ) && ( masa_to_total_energy_ratio[b_signif] >= MASA2TOTAL_THR ) ) { b_signif++; } @@ -2793,9 +2791,6 @@ static int16_t encode_ratio_ism_subframe( } - - - static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: q_metadata handle */ @@ -2805,8 +2800,7 @@ static void ivas_encode_masaism_metadata( const int16_t omasa_nbands, const int16_t omasa_nblocks, const int16_t idx_separated_object, - const int16_t ism_imp -) + const int16_t ism_imp ) { int16_t sf, band; uint8_t numCodingBands; @@ -3061,18 +3055,16 @@ static void ivas_encode_masaism_metadata( } } } - } } - calculate_nbits_meta( hMasa->data.nchan_ism, hMasa->data.q_energy_ratio_ism, hQMetaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); /* quantize directions */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) - { + { #ifdef OMASA_UPDATES if ( bits_ism[obj] < 8 ) { @@ -3089,7 +3081,7 @@ static void ivas_encode_masaism_metadata( push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); hIsmMeta[obj]->q_elevation_old = hIsmMeta[obj]->elevation; hIsmMeta[obj]->q_azimuth_old = hIsmMeta[obj]->azimuth; - } + } } else { @@ -3098,7 +3090,7 @@ static void ivas_encode_masaism_metadata( hIsmMeta[obj]->q_elevation_old = hIsmMeta[obj]->elevation; hIsmMeta[obj]->q_azimuth_old = hIsmMeta[obj]->azimuth; } - + #else idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 935ea5e342..ee0eadc3e6 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -50,8 +50,7 @@ * Local function prototypes *------------------------------------------------------------------------*/ -static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], - float diffuseness_m[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); +static void ivas_omasa_param_est_enc( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, ISM_METADATA_HANDLE hIsmMeta[], float data_f[][L_FRAME48k], float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float energyRatio[MASA_FREQUENCY_BANDS], float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], float surroundingCoherence[MASA_FREQUENCY_BANDS], float diffuseness_m[MASA_FREQUENCY_BANDS], const int16_t input_frame, const int16_t nchan_inp ); static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCODER_HANDLE hMasa, float data_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_inp ); @@ -347,7 +346,7 @@ void ivas_omasa_enc( ivas_masa_combine_directions( hMasa ); - hMasa->config.numCodingBands = (int8_t)n_bands_orig; + hMasa->config.numCodingBands = (int8_t) n_bands_orig; } /* force computation into high resolution */ @@ -579,7 +578,7 @@ void ivas_omasa_enc( ivas_masa_combine_directions( hMasa ); - hMasa->config.numCodingBands = (int8_t)n_bands_orig; + hMasa->config.numCodingBands = (int8_t) n_bands_orig; } /* force computation into high resolution */ @@ -618,7 +617,6 @@ void ivas_omasa_enc( hMasa->config.numCodingBands = numCodingBands_orig; hMasa->config.joinedSubframes = joinedSubframes_orig; - } else if ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index db6bf0293e..6de5688492 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -2074,7 +2074,7 @@ static void hrtfShGetHrtf( /*-------------------------------------------------------------------* * preProcessStereoTransportsForMovedObjects() * - * + * *-------------------------------------------------------------------*/ void preProcessStereoTransportsForMovedObjects( -- GitLab From 902c4f33417abce037f57b9c5c6b791735ee8d8a Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 5 Apr 2023 16:56:42 +0200 Subject: [PATCH 0076/1418] fix crashes in native MASA decoder; changes are within OMASA_BRATE_SW --- lib_dec/ivas_dec.c | 4 ++++ lib_dec/ivas_init_dec.c | 23 ++++++++++++------- lib_dec/ivas_masa_dec.c | 8 +++++++ lib_dec/ivas_omasa_dec.c | 48 +++++++++------------------------------- lib_dec/ivas_stat_dec.h | 3 +++ 5 files changed, 40 insertions(+), 46 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 10147488c0..0b590f3ef9 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -900,6 +900,10 @@ ivas_error ivas_dec( st_ivas->ini_active_frame++; } +#ifdef OMASA_BRATE_SW + st_ivas->last_ivas_format = st_ivas->ivas_format; +#endif + #ifdef DEBUG_MODE_INFO dbgwrite( &st_ivas->bfi, sizeof( int16_t ), 1, output_frame, "res/bfi" ); dbgwrite( &st_ivas->BER_detect, sizeof( int16_t ), 1, output_frame, "res/BER_detect" ); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e8fccfb9cf..a97da59693 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -181,18 +181,25 @@ ivas_error ivas_dec_setup( if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { #ifdef OMASA_BRATE_SW - if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#else - if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->nCPE == 1 ) + if ( st_ivas->last_ivas_format == MASA_FORMAT ) { - st_ivas->hCPE[0]->nchan_out = 1; +#endif + if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->nCPE == 1 ) + { + st_ivas->hCPE[0]->nchan_out = 1; + } + else + { + if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#ifdef OMASA_BRATE_SW } else { - if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 9d6e1d9612..31acee4924 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1478,6 +1478,14 @@ ivas_error ivas_masa_dec_reconfigure( #endif ); +#ifdef OMASA_BRATE_SW + if ( st_ivas->ivas_format == MASA_FORMAT ) + { + st_ivas->nchan_ism = 0; + st_ivas->ism_mode = ISM_MODE_NONE; + } +#endif + return error; } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 1afaa4696b..036b72a939 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -145,7 +145,6 @@ ivas_error ivas_omasa_dec_config( { int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; int32_t ivas_total_brate, ism_total_brate, cpe_brate; - IVAS_FORMAT ivas_format_old; ISM_MODE ism_mode_old; ivas_error error; @@ -157,26 +156,10 @@ ivas_error ivas_omasa_dec_config( ism_mode_old = ivas_omasa_ism_mode_select( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->nchan_ism ); st_ivas->ism_mode = ism_mode_old; - ivas_format_old = st_ivas->ivas_format; -#ifdef OMASA_UPDATES - if ( ism_mode_old == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_DISC ) -#else - if ( ism_mode_old == ISM_MASA_MODE_PARAM || ism_mode_old == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode_old == ISM_MASA_MODE_DISC ) -#endif - { - st_ivas->ivas_format = MASA_ISM_FORMAT; - } ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); nSCE_old = st_ivas->nSCE; nchan_hp20_old = getNumChanSynthesis( st_ivas ); - /* reconstruct parameters */ - st_ivas->ivas_format = ivas_format_old; - if ( st_ivas->ivas_format == MASA_FORMAT ) - { - st_ivas->nchan_ism = 0; - } - /* set ism_mode of current frame */ st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -191,7 +174,6 @@ ivas_error ivas_omasa_dec_config( return error; } - // VE!!!!!: verification needed, see comment "/* Todo: Nokia make for MASA_ISM*/" in ivas_masa_dec_reconfigure() if ( cpe_brate < MASA_STEREO_MIN_BITRATE ) { st_ivas->hCPE[0]->nchan_out = 1; @@ -219,30 +201,20 @@ ivas_error ivas_omasa_dec_config( } /* reconfigure core-coders for ISMs */ - if ( st_ivas->ivas_format == MASA_FORMAT ) + k = 0; + while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) { - if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, -1, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } + k++; } - else - { - k = 0; - while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) - { - k++; - } - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) - { - ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; - } + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) + { + ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; + } - if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + { + return error; } if ( ism_mode_old != st_ivas->ism_mode ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index dd9aa2c94f..e1297e9381 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1218,6 +1218,9 @@ typedef struct Decoder_Struct DECODER_CONFIG_HANDLE hDecoderConfig; /* Decoder configuration structure */ IVAS_FORMAT ivas_format; /* IVAS format */ +#ifdef OMASA_BRATE_SW + IVAS_FORMAT last_ivas_format; /* last frame IVAS format */ +#endif int16_t sid_format; /* IVAS format indicator from SID frame */ int16_t nchan_transport; /* number of transport channels */ IVAS_OUTPUT_SETUP hOutSetup; /* output setup structure */ -- GitLab From 02723cade9388c4f42476be12fa63646749095c1 Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Wed, 5 Apr 2023 14:32:35 -0400 Subject: [PATCH 0077/1418] as tested in the short AB test --- lib_com/ivas_prot.h | 6 +++--- lib_com/ivas_stereo_td_bit_alloc.c | 18 +++++++----------- lib_enc/ivas_cpe_enc.c | 18 +++++++----------- lib_enc/ivas_stereo_classifier.c | 14 -------------- lib_enc/ivas_stereo_td_analysis.c | 24 +++++++++++++----------- lib_enc/ivas_stereo_td_enc.c | 4 ++-- 6 files changed, 32 insertions(+), 52 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 56ec490530..ae82f8b2b6 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1766,9 +1766,6 @@ int16_t select_stereo_mode( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : IVAS total brate */ -#ifdef OMASA_TUNING - ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ -#endif ); void stereo_classifier_init( @@ -1833,6 +1830,9 @@ int16_t stereo_tdm_ener_analysis( const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ +#ifdef OMASA_TUNING + ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#endif ); void stereo_tdm_downmix( diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index b6d3f214b3..b0ae12ecd8 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -140,7 +140,8 @@ void tdm_bit_alloc( /* secondary channel bitrate allocation based on the energy scaling ratio */ #ifdef OMASA_TUNING - if ( (IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || + if ( (IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) + || ( IsOmasa == 1 && coder_type > UNVOICED ) ) #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) @@ -412,11 +413,11 @@ void tdm_bit_alloc( } *total_brate_sec += ( fast_FCB_rates_2sfr[idx] - tmp_rate ); } - ///* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ - //if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) - //{ - // *total_brate_sec += 100; - //} + /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ + if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) + { + *total_brate_sec += 100; + } /* To prevent 13.2 kb/s for primary channel as some bitstream issues arrise with it */ if ( element_brate_wo_meta - *total_brate_sec == ACELP_13k20 ) @@ -424,11 +425,6 @@ void tdm_bit_alloc( *total_brate_sec += 100; } } - /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ - if ( *total_brate_sec == PPP_NELP_2k80 || *total_brate_sec == SID_2k40 ) - { - *total_brate_sec += 100; - } *total_brate_pri = element_brate_wo_meta - *total_brate_sec; return; diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 53a30ce4d5..6800966f99 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -169,20 +169,12 @@ ivas_error ivas_cpe_enc( #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && ivas_total_brate == IVAS_48k ) { - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k -#ifdef OMASA_TUNING - ,st_ivas->hOMasa!=NULL -#endif - ); + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k ); } else { #endif - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate -#ifdef OMASA_TUNING - ,st_ivas->hOMasa!=NULL -#endif - ); + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); #ifdef OMASA_UPDATES } #endif @@ -421,7 +413,11 @@ ivas_error ivas_cpe_enc( else if ( hCPE->element_mode == IVAS_CPE_TD ) { /* Determine the energy ratio between the 2 channels */ - tdm_ratio_idx = stereo_tdm_ener_analysis( hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM ); + tdm_ratio_idx = stereo_tdm_ener_analysis( hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM +#ifdef OMASA_TUNING + , st_ivas->hOMasa != NULL +#endif + ); /* Compute the downmix signal based on the ratio index */ stereo_tdm_downmix( hCPE->hStereoTD, sts[0]->input, sts[1]->input, input_frame, tdm_ratio_idx, ( ( hCPE->hStereoTD->tdm_LRTD_flag == 0 ) ? tdm_SM_or_LRTD_Pri : 0 ), tdm_ratio_idx_SM ); diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index 36f06ccadc..8e20c13c8a 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -90,9 +90,6 @@ int16_t select_stereo_mode( CPE_ENC_HANDLE hCPE, /* i/o: CPE encoder structure */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int32_t ivas_total_brate /* i : IVAS total brate */ -#ifdef OMASA_TUNING - ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ -#endif ) { int16_t element_mode; @@ -212,17 +209,6 @@ int16_t select_stereo_mode( set_f( hStereoClassif->xtalk_fv, -1.0f, SSC_MAX_NFEA ); } } -#ifdef OMASA_TUNING - else if ( element_mode == IVAS_CPE_TD && isOmasa ) - { - if ( ( hStereoClassif->lrtd_mode == 1 || hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 ) && ( hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus + hCPE->brate_surplus < 15000 ) ) - { - hStereoClassif->lrtd_mode = 0; - hStereoClassif->prev_lrtd_mode = 0; - } - } -#endif - #ifdef DEBUG_MODE_TD dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, L_FRAME16k, "res/unclr_decision.enc" ); diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index 70aaf2ebed..97522ef861 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -115,6 +115,9 @@ int16_t stereo_tdm_ener_analysis( const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ +#ifdef OMASA_TUNING + ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#endif ) { float rms_R, rms_L; @@ -194,7 +197,16 @@ int16_t stereo_tdm_ener_analysis( * When the energies of channels are low enough, compute the ratio * of L and R needed to create new mono/side signals *----------------------------------------------------------------*/ +#ifdef OMASA_TUNING + if ( isOmasa ) + { + if ( ( hCPE->hStereoClassif->lrtd_mode == 1 || hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 ) && ( hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus + hCPE->brate_surplus < 15000 ) ) + { + hStereoTD->prev_fr_LRTD_TD_dec = 0; + } + } +#endif rms_thd = RMS_MIN; if ( hCPE->hStereoClassif->lrtd_mode == 1 ) { @@ -229,17 +241,7 @@ int16_t stereo_tdm_ener_analysis( hStereoTD->prev_fr_LRTD_TD_dec = 0; } } - //if ( hCPE->hStereoTD != NULL ) - //{ - - // if ( /*hStereoClassif->lrtd_mode == 1*/ hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 && hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 ) - // { - // //hStereoClassif->xtalk_decision = 0; - // //hStereoClassif->lrtd_mode = 0; - // hCPE->hStereoTD->prev_fr_LRTD_TD_dec = 0; - // //hCPE->hStereoClassif->lrtd_mode = 0; - // } - //} + side_can_change = 0; /* update LRTD->DFT stereo hangover counters */ diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 2f34424f70..6e13ec2075 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -431,9 +431,9 @@ void tdm_configure_enc( } hStereoTD->tdm_lp_reuse_flag = 1; #ifdef OMASA_TUNING - if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 6000 && hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 0 ) + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 11000 ) #else - if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 /*&& hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 0*/ ) + if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) #endif { sts[1]->coder_type = INACTIVE; -- GitLab From ff5314ab3351a768ecb5d1ebfa5b4535e6542b0b Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 6 Apr 2023 08:49:50 +0200 Subject: [PATCH 0078/1418] fixes for bitrate switching and MC output config. --- lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_init_dec.c | 23 +++++++++----- lib_dec/ivas_omasa_dec.c | 68 ++++++++++++++++++++++++++++------------ 3 files changed, 64 insertions(+), 29 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index ecfa303713..c0deb07a1a 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -603,7 +603,7 @@ ivas_error ivas_dec( ivas_masa_ism_set_edited_objects( st_ivas ); /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 792521c573..c26a94f2dc 100755 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1541,19 +1541,26 @@ ivas_error ivas_init_decoder( } #ifdef OMASA_UPDATES - // VE: introduce a new renderer_type for this case - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - /* Allocate TD renderer for the objects in DISC mode */ - if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) + // VE: introduce a new renderer_type for this case + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL ) { - return error; + /* Allocate TD renderer for the objects in DISC mode */ + if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } } - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + // VE: introduce a new renderer_type for this case + if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { - return error; + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } } } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 036b72a939..a688e0062f 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -271,39 +271,67 @@ ivas_error ivas_omasa_dec_config( } #ifdef OMASA_UPDATES - // VE: introduce a new renderer_type for this case - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { - /* Allocate TD renderer for the objects in DISC mode */ - if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - return error; - } + /* Allocate TD renderer for the objects in DISC mode */ + if ( ( error = ivas_td_binaural_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else { - return error; + /* TD renderer handle */ + if ( st_ivas->hBinRendererTd != NULL ) + { + ivas_td_binaural_close( &st_ivas->hBinRendererTd ); + } + + if ( st_ivas->hHrtfTD != NULL ) // VE: this is copied from ivas_ism_bitrate_switching() but a review is needed + { + st_ivas->hHrtfTD = NULL; + } + + /* ISM renderer handle */ + if ( st_ivas->hIsmRendererData != NULL ) + { + free( st_ivas->hIsmRendererData ); + st_ivas->hIsmRendererData = NULL; + } } } - else + + if ( st_ivas->renderer_type == RENDERER_DIRAC ) { - /* TD renderer handle */ - if ( st_ivas->hBinRendererTd != NULL ) + if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_RECONFIGURE ) ) != IVAS_ERR_OK ) { - ivas_td_binaural_close( &st_ivas->hBinRendererTd ); + return error; } - if ( st_ivas->hHrtfTD != NULL ) // VE: this is copied from ivas_ism_bitrate_switching() but a review is needed + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - st_ivas->hHrtfTD = NULL; + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + if ( ( error = ivas_masa_ism_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } } - - /* ISM renderer handle */ - if ( st_ivas->hIsmRendererData != NULL ) + else { - free( st_ivas->hIsmRendererData ); - st_ivas->hIsmRendererData = NULL; + /* ISM renderer handle */ + if ( st_ivas->hIsmRendererData != NULL ) + { + free( st_ivas->hIsmRendererData ); + st_ivas->hIsmRendererData = NULL; + } } } #endif -- GitLab From e75295863c886f2d18b663e3bfadaf05b8568f30 Mon Sep 17 00:00:00 2001 From: szczerba Date: Thu, 6 Apr 2023 10:41:20 +0200 Subject: [PATCH 0079/1418] Contribution 37 - Control metadata for reverb --- apps/decoder.c | 62 +- apps/renderer.c | 72 ++ lib_com/ivas_cnst.h | 3 + lib_com/ivas_error.h | 4 + lib_com/options.h | 2 + lib_dec/ivas_init_dec.c | 12 + lib_dec/ivas_ism_dec.c | 8 + lib_dec/ivas_ism_metadata_dec.c | 1 - lib_dec/ivas_ism_param_dec.c | 16 + lib_dec/ivas_mct_dec.c | 4 + lib_dec/ivas_output_config.c | 8 + lib_dec/ivas_spar_decoder.c | 4 + lib_dec/lib_dec.c | 12 + lib_dec/lib_dec.h | 3 + lib_enc/ivas_ism_metadata_enc.c | 1 - lib_rend/ivas_crend.c | 7 + lib_rend/ivas_output_init.c | 6 + lib_rend/lib_rend.c | 52 +- lib_rend/lib_rend.h | 3 + lib_util/render_config_reader.c | 981 +++++++++++++++++- lib_util/render_config_reader.h | 14 + scripts/config/self_test.prm | 16 +- scripts/pyivastest/constants.py | 3 +- .../rend_config_hospital_patientroom.cfg | 37 +- scripts/testv/rend_config_recreation.cfg | 37 +- scripts/testv/rend_config_renderer.cfg | 16 +- 26 files changed, 1312 insertions(+), 72 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index d2260713c2..d3aa314f5f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -76,6 +76,10 @@ static #define IVAS_PUBLIC_ORIENT_TRK_REF_VEC ( 3 ) #define IVAS_PUBLIC_ORIENT_TRK_REF_VEC_LEV ( 4 ) +#ifdef CONTROL_METADATA_REVERB +#define ACOUSTIC_ENVIRONMENT_ID 0 +#endif + typedef struct { char *inputBitstreamFilename; @@ -229,7 +233,11 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); @@ -251,7 +259,11 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { fprintf( stderr, "\nError: Head-rotation file file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -271,7 +283,7 @@ int main( if ( arg.enableReferenceRotation ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) { fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -298,7 +310,7 @@ int main( if ( arg.enableReferenceVectorTracking ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) { fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -338,7 +350,11 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -461,9 +477,17 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL ) +#else if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL ) +#endif { +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + fprintf( stderr, "\nExternal Renderer Config is supported only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB. Exiting. \n\n" ); +#else fprintf( stderr, "\nExternal Renderer Config is supported only for BINAURAL and BINAURAL_ROOM. Exiting. \n\n" ); +#endif goto cleanup; } @@ -473,12 +497,36 @@ int main( goto cleanup; } +#ifdef CONTROL_METADATA_REVERB + if ( RenderConfigReader_read( renderConfigReader ) != IVAS_ERR_OK ) +#else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; } +#ifdef CONTROL_METADATA_REVERB + if ( RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); + goto cleanup; + } + +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_REVERB ) + { + renderConfig.room_acoustics.late_reverb_on = true; + renderConfig.room_acoustics.override = true; + renderConfig.room_acoustics.use_brir = false; + } +#else + renderConfig.room_acoustics.late_reverb_on = true; + renderConfig.room_acoustics.override = true; +#endif +#endif + if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -721,6 +769,12 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( { output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + else if ( strcmp( argv_to_upper, "BINAURAL_REVERB" ) == 0 ) + { + output_config = IVAS_DEC_OUTPUT_BINAURAL_REVERB; + } +#endif else { output_config = IVAS_DEC_OUTPUT_LS_CUSTOM; @@ -1152,7 +1206,11 @@ static void usage_dec( void ) fprintf( stdout, "Mandatory parameters:\n" ); fprintf( stdout, "---------------------\n" ); fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, BINAURAL_REVERB, EXT\n" ); +#else fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, EXT\n" ); +#endif fprintf( stdout, " By default, channel order and loudspeaker positions are equal to the\n" ); fprintf( stdout, " encoder. For loudspeaker outputs, OutputConf can be a custom loudspeaker\n" ); fprintf( stdout, " layout file. See readme.txt for details.\n" ); diff --git a/apps/renderer.c b/apps/renderer.c index c2fb6add8a..03b2398947 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -60,6 +60,10 @@ #define RENDERER_MAX_METADATA_LENGTH 8192 #define RENDERER_MAX_METADATA_LINE_LENGTH 1024 +#ifdef CONTROL_METADATA_REVERB +#define ACOUSTIC_ENVIRONMENT_ID 0 +#endif + #if !defined( DEBUGGING ) && !defined( WMOPS ) static #endif @@ -213,25 +217,41 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_trajFile, .match = "trajectory_file", .matchShort = "tf", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB outputs)", +#else .description = "Head rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, { .id = CmdLnOptionId_refRotFile, .match = "reference_rotation_file", .matchShort = "rf", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Reference rotation trajectory file for simulation of head tracking (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB outputs)", +#else .description = "Reference rotation trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, { .id = CmdLnOptionId_customHrtfFile, .match = "custom_hrtf", .matchShort = "hrtf", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Custom HRTF file for binaural rendering (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB outputs)", +#else .description = "Custom HRTF file for binaural rendering (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, { .id = CmdLnOptionId_renderConfigFile, .match = "render_config", .matchShort = "rc", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Binaural renderer configuration file (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB outputs)", +#else .description = "Binaural renderer configuration file (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, { .id = CmdLnOptionId_noDiegeticPan, @@ -243,7 +263,11 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_orientationTracking, .match = "tracking_type", .matchShort = "otr", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB)", +#else .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for BINAURAL and BINAURAL_ROOM)", +#endif }, { .id = CmdlnOptionId_lfePosition, @@ -283,7 +307,11 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_referenceVectorFile, .match = "reference_vector_file", .matchShort = "rvf", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + .description = "Reference vector trajectory file for simulation of head tracking (only for BINAURAL, BINAURAL_ROOM, and BINAURAL_REVERB outputs)", +#else .description = "Reference vector trajectory file for simulation of head tracking (only for BINAURAL and BINAURAL_ROOM outputs)", +#endif }, }; @@ -673,7 +701,11 @@ int main( } /* === Configure === */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( error = IVAS_REND_InitConfig( hIvasRend, ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) || ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) ) != IVAS_ERR_OK ) +#else 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 ) +#endif { fprintf( stderr, "Error in Renderer Config Init\n" ); exit( -1 ); @@ -684,9 +716,17 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) +#else if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) ) +#endif { +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL, BINAURAL_ROOM, or BINAURAL_REVERB is used as output. Exiting. \n" ); +#else fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL or BINAURAL_ROOM is used as output. Exiting. \n" ); +#endif exit( -1 ); } @@ -696,12 +736,35 @@ int main( exit( -1 ); } +#ifdef CONTROL_METADATA_REVERB + if ( RenderConfigReader_read( renderConfigReader ) != IVAS_ERR_OK ) +#else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); } +#ifdef CONTROL_METADATA_REVERB + if ( RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); + exit( -1 ); + } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) + { + renderConfig.room_acoustics.late_reverb_on = TRUE; + renderConfig.room_acoustics.override = TRUE; + renderConfig.room_acoustics.use_brir = FALSE; + } +#else + renderConfig.room_acoustics.late_reverb_on = TRUE; + renderConfig.room_acoustics.override = TRUE; +#endif +#endif + if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed\n" ); @@ -1482,6 +1545,12 @@ static IVAS_REND_AudioConfig parseAudioConfig( { return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( strcmp( charBuf, "BINAURAL_REVERB" ) == 0 ) + { + return IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB; + } +#endif if ( strcmp( charBuf, "BINAURAL" ) == 0 ) { return IVAS_REND_AUDIO_CONFIG_BINAURAL; @@ -2506,6 +2575,9 @@ static void printSupportedAudioConfigs() "MASAx (input only)", "BINAURAL (output only)", "BINAURAL_ROOM (output only)", +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + "BINAURAL_REVERB (output only)", +#endif }; fprintf( stdout, "Supported audio formats:\n" ); diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 1da32f2145..8b02bbfa92 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -102,6 +102,9 @@ typedef enum AUDIO_CONFIG_OBA, /* object based audio */ AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */ AUDIO_CONFIG_BINAURAL_ROOM, /* binaural with HRIR and BRIR */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + AUDIO_CONFIG_BINAURAL_REVERB, /* binaural with reverberation */ +#endif AUDIO_CONFIG_ISM1, /* ISM1 */ AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 9438ad44a1..a13395d825 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -133,6 +133,10 @@ typedef enum IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, +#ifdef CONTROL_METADATA_REVERB + IVAS_ERR_INVALID_RENDER_CONFIG, + IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING, +#endif /*----------------------------------------* * unknown error * diff --git a/lib_com/options.h b/lib_com/options.h index 6d97909f18..08ed5c4991 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -141,6 +141,8 @@ #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 CONTROL_METADATA_REVERB /* Philips: renderer configuration change to binary format */ +#define COMMAND_LINE_OPTION_LATE_REVERB /* Philips: late reverb command line option */ #define FIX_103_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ /*#define SBA_HPF_TUNING_DEC*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index e53218d3e7..4b85e52ba4 100755 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -676,14 +676,22 @@ ivas_error ivas_init_decoder_front( * Allocate and initialize Binaural Renderer configuration handle *--------------------------------------------------------------------*/ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { if ( ( error = ivas_render_config_open( &( st_ivas->hRenderConfig ) ) ) != IVAS_ERR_OK ) { return error; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( error = ivas_render_config_init_from_rom( &st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_render_config_init_from_rom( &st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2109,7 +2117,11 @@ static ivas_error doSanityChecks_IVAS( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) +#endif { return IVAS_ERROR( IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED, "Wrong set-up: Head-rotation not supported in this configuration" ); } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index e6571e83d9..ece13ab3d5 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -148,7 +148,11 @@ static ivas_error ivas_ism_bitrate_switching( } } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { /* close the parametric binaural renderer */ ivas_dirac_dec_close_binaural_data( &st_ivas->hDiracDecBin ); @@ -211,7 +215,11 @@ static ivas_error ivas_ism_bitrate_switching( } } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { /* open the parametric binaural renderer */ if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 75b9164e1d..e60cad7ee2 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -817,7 +817,6 @@ static int16_t decode_radius( return idx_radius; } - #ifdef DISCRETE_ISM_DTX_CNG /*-------------------------------------------------------------------* * ivas_ism_metadata_sid_dec() diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index f66323d8a4..0340ca57e4 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -364,7 +364,11 @@ static ivas_error ivas_param_ism_rendering_init( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) +#endif { /* computation of proto matrix */ ivas_ism_get_proto_matrix( hOutSetup, nchan_transport, hParamIsmRendering->proto_matrix ); @@ -519,7 +523,11 @@ ivas_error ivas_param_ism_dec_open( } } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB || output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) +#else if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) +#endif { /* Initialize efap handle */ if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), hOutSetup.ls_azimuth, hOutSetup.ls_elevation, hOutSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) @@ -537,7 +545,11 @@ ivas_error ivas_param_ism_dec_open( hDirAC->dirac_read_idx = 0; hDirAC->spar_to_dirac_write_idx = 0; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) +#endif { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; if ( ( hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ) ) == NULL ) @@ -680,7 +692,11 @@ void ivas_param_ism_dec_close( hDirAC->hParamIsm = NULL; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) +#endif { for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) { diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index f39951e087..e2c4c269d0 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1031,7 +1031,11 @@ static ivas_error ivas_mc_dec_reconfig( output_config = st_ivas->hDecoderConfig->output_config; /* binaural renderers*/ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { /* remove unneeded binaural renderers */ if ( st_ivas->hBinRenderer != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f522a3217d..5729b79ff4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -76,7 +76,11 @@ void ivas_renderer_select( st_ivas->hHeadTrackData->shd_rot_max_order = -1; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM || output_config == AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -226,7 +230,11 @@ void ivas_renderer_select( } } } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + else /* AUDIO_CONFIG_BINAURAL_ROOM or AUDIO_CONFIG_BINAURAL_REVERB */ +#else else /* AUDIO_CONFIG_BINAURAL_ROOM */ +#endif { if ( st_ivas->mc_mode == MC_MODE_MCT ) { diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 01e4db2ed4..440cca8009 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1171,7 +1171,11 @@ void ivas_spar_dec_upmixer( } else { +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) +#endif { for ( ts = 0; ts < MAX_PARAM_SPATIAL_SUBFRAMES; ts++ ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 0497a0a713..1d293f21ef 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -334,6 +334,12 @@ static AUDIO_CONFIG mapOutputFormat( { output_config = AUDIO_CONFIG_BINAURAL_ROOM; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL_REVERB ) + { + output_config = AUDIO_CONFIG_BINAURAL_REVERB; + } +#endif else { output_config = AUDIO_CONFIG_INVALID; @@ -1865,6 +1871,12 @@ static ivas_error get_channel_config( { strcpy( str, "Binaural_ROOM" ); } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + else if ( config == AUDIO_CONFIG_BINAURAL_REVERB ) + { + strcpy( str, "Binaural_REVERB" ); + } +#endif else if ( config == AUDIO_CONFIG_EXTERNAL ) { strcpy( str, "External renderer" ); diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index e1e5bfe9f4..20ff5a919b 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -57,6 +57,9 @@ typedef enum _IVAS_DEC_OUTPUT_CONFIG IVAS_DEC_OUTPUT_HOA3, IVAS_DEC_OUTPUT_BINAURAL, IVAS_DEC_OUTPUT_BINAURAL_ROOM, +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + IVAS_DEC_OUTPUT_BINAURAL_REVERB, +#endif IVAS_DEC_OUTPUT_EXT, IVAS_DEC_OUTPUT_UNKNOWN = 0xffff } IVAS_DEC_AUDIO_CONFIG; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 5b45d909f1..242bc17faf 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -937,7 +937,6 @@ static void encode_angle_indices( return; } - #ifdef DISCRETE_ISM_DTX_CNG /*-------------------------------------------------------------------* * ivas_ism_metadata_sid_enc() diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index c05ae7c262..c8b4ac8959 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -182,7 +182,11 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported input config in Crend" ); } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Encountered unsupported output type in Crend" ); } @@ -197,6 +201,9 @@ static ivas_error ivas_rend_initCrend( /* set BRIR flag */ use_brir = false; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + /* note: use_brir = false for IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB */ +#endif if ( ( ( hRendCfg != NULL ) && hRendCfg->roomAcoustics.use_brir ) || ( ( hRendCfg == NULL ) && ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) ) { use_brir = true; diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 193e775f22..e5f7894d77 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -92,6 +92,9 @@ int16_t audioCfg2channels( break; case AUDIO_CONFIG_BINAURAL: case AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case AUDIO_CONFIG_BINAURAL_REVERB: +#endif nchan_out = 2; break; case AUDIO_CONFIG_ISM1: @@ -218,6 +221,9 @@ void ivas_output_init( break; case AUDIO_CONFIG_BINAURAL: case AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case AUDIO_CONFIG_BINAURAL_REVERB: +#endif case AUDIO_CONFIG_ISM1: case AUDIO_CONFIG_ISM2: case AUDIO_CONFIG_ISM3: diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e97ae461cf..555c9af5c6 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -346,6 +346,10 @@ AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( return AUDIO_CONFIG_BINAURAL; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: return AUDIO_CONFIG_BINAURAL_ROOM; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: + return AUDIO_CONFIG_BINAURAL_REVERB; +#endif case IVAS_REND_AUDIO_CONFIG_MASA1: return AUDIO_CONFIG_MASA1; case IVAS_REND_AUDIO_CONFIG_MASA2: @@ -376,6 +380,10 @@ IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( return IVAS_REND_AUDIO_CONFIG_BINAURAL; case AUDIO_CONFIG_BINAURAL_ROOM: return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case AUDIO_CONFIG_BINAURAL_REVERB: + return IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB; +#endif case AUDIO_CONFIG_5_1: return IVAS_REND_AUDIO_CONFIG_5_1; case AUDIO_CONFIG_7_1: @@ -422,6 +430,9 @@ static ivas_error validateOutputAudioConfig( case IVAS_REND_AUDIO_CONFIG_HOA3: case IVAS_REND_AUDIO_CONFIG_BINAURAL: case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif return IVAS_ERR_OK; default: break; @@ -495,6 +506,9 @@ ivas_error getAudioConfigNumChannels( case IVAS_REND_AUDIO_CONFIG_STEREO: case IVAS_REND_AUDIO_CONFIG_BINAURAL: case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif case IVAS_REND_AUDIO_CONFIG_MASA2: *numChannels = 2; break; @@ -783,7 +797,11 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { pEfapWrapper->speakerConfig = IVAS_REND_AUDIO_CONFIG_7_1_4; } @@ -1107,7 +1125,11 @@ static ivas_error setRendInputActiveIsm( return error; } } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + else if ( ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) ) +#else else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { @@ -1737,6 +1759,9 @@ static ivas_error updateMcPanGains( case IVAS_REND_AUDIO_CONFIG_BINAURAL: break; /* Do nothing */ case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif /* Prepare rendering to intermediate format */ error = updateMcPanGainsForMcOut( inputMc, IVAS_REND_AUDIO_CONFIG_7_1_4 ); break; @@ -1801,7 +1826,7 @@ static ivas_error initMcBinauralRendering( /* TODO tmu : needs review allocate both renderers; needed if headrotation is toggled so the renderer can be switched */ // bool initTDRend; // initTDRend = false; - // if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) + // if ( ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) ) // { // if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) // { @@ -1937,7 +1962,11 @@ static ivas_error setRendInputActiveMc( initRotGains( inputMc->rot_gains_prev ); inputMc->lfeRouting = defaultLfeRouting( inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ); +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { @@ -2104,6 +2133,9 @@ static ivas_error updateSbaPanGains( *rendCtx.pOutSampleRate ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_REND_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -2458,7 +2490,11 @@ static DecoderDummy *initDecoderDummy( decDummy->hDecoderConfig->output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); decDummy->nchan_transport = numTransChannels; +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { decDummy->hHeadTrackData = malloc( sizeof( HEAD_TRACK_DATA ) ); /* Initialise Rmat_prev to I, Rmat will be computed later */ @@ -3190,7 +3226,11 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return error; } +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) +#else if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) +#endif { if ( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) { @@ -4602,6 +4642,9 @@ static ivas_error renderInputIsm( error = renderIsmToBinaural( ismInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif error = renderIsmToBinauralRoom( ismInput, outAudio ); break; default: @@ -4994,6 +5037,9 @@ static ivas_error renderInputMc( error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif if ( mcInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); @@ -5244,6 +5290,9 @@ static ivas_error renderInputSba( error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: +#endif error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); break; default: @@ -5417,6 +5466,7 @@ static ivas_error renderInputMasa( break; /* ToDo */ // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: + // case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: // renderMasaToBinauralRoom( masaInput, outConfig, outAudio ); // break; default: diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 99b33dc381..70034fc2ff 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -114,6 +114,9 @@ typedef enum IVAS_REND_AUDIO_CONFIG_BINAURAL = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 0, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 1, +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 2, +#endif IVAS_REND_AUDIO_CONFIG_MASA1 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 0, IVAS_REND_AUDIO_CONFIG_MASA2 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 1, diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 54f2d012ce..c6e68eae25 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -31,21 +31,24 @@ *******************************************************************************************************/ #include "render_config_reader.h" -#include #include -#include -#include -#include "cmdl_tools.h" #include "prot.h" - +#ifdef CONTROL_METADATA_REVERB +#include +#else +#include +#include "cmdl_tools.h" +#endif /*------------------------------------------------------------------------------------------* * PreProc Macros *------------------------------------------------------------------------------------------*/ +#ifndef CONTROL_METADATA_REVERB #define MAX_LINE_LENGTH ( 1024 ) #define MAX_ITEM_LENGTH ( 64 ) #define N_REVERB_VECTORS ( 3 ) +#endif #define SHORTEST_REV_DEL_LINE ( 0.015f ) #define N_BANDS_MIN ( 2 ) @@ -68,12 +71,607 @@ * Type definitions *------------------------------------------------------------------------------------------*/ +typedef struct +{ + uint32_t nrBands; /* Number of frequency bands */ + float *pFc; /* Center frequencies */ +} FrequencyGrid; + +typedef enum _FREQ_GRID_MODE +{ + FREQ_GRID_MODE_INDIVIDUAL_FREQUENCIES = 0, + FREQ_GRID_MODE_START_HOP_AMOUNT = 1, + FREQ_GRID_MODE_DEFAULT_BANDING = 2 +} FREQ_GRID_MODE; + +typedef struct +{ + uint32_t id; /* Acoustic environment ID */ + FrequencyGrid *pFG; /* Pointer into Frequency grids table */ + float *pRT60; /* RT60 table */ + float *pDSR; /* DSR table */ + float preDelay; /* Pre-delay */ +} AcousticEnv; + struct RenderConfigReader { FILE *pConfigFile; +#ifdef CONTROL_METADATA_REVERB + uint8_t *pBitstream; /* Renderer config bitstream */ + size_t length; /* Bitstream length */ + size_t readOffset; /* Bitstream read offset */ + uint32_t nFG; /* Number of frequency grids */ + FrequencyGrid *pFG; /* Frequency grids */ + uint32_t nAE; /* Number of acoustic environments */ + AcousticEnv *pAE; /* Acoustic environments */ +#endif +}; + +#ifdef CONTROL_METADATA_REVERB + +typedef enum _RC_LUT +{ + RC_LUT_INVALID = 0x00, + RC_LUT_COUNT_IDX_LO, + RC_LUT_COUNT_IDX_HI, + RC_LUT_DECI_SEC, + RC_LUT_SEC, + RC_LUT_MILLI_SEC, + RC_LUT_MICRO_SEC, + RC_LUT_FREQ, + RC_LUT_FREQ_HOP, + RC_LUT_DSR, +} RC_LUT; + +/*------------------------------------------------------------------------------------------* + * Lookup tables + *------------------------------------------------------------------------------------------*/ + +const float lutCountIdxLo_Value[] = { + 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, + 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, + 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, + 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f +}; +const uint16_t lutCountIdxLo_Code[] = { + 7, 4, 12, 13, 10, 11, 8, 9, 15, 14, 13, 12, 11, 10, 9, 8, + 7, 6, 5, 4, 3, 2, 1, 0, 63, 62, 61, 60, 59, 58, 57, 56, + 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, + 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80 +}; +const uint8_t lutCountIdxLo_Len[] = { + 4, 3, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 +}; + +const float lutCountIdxHi_Value[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f }; +const uint16_t lutCountIdxHi_Code[] = { 1, 0, 6, 5, 4, 7, 5, 15, 14, 13, 9, 8, 25, 49, 48 }; +const uint8_t lutCountIdxHi_Len[] = { 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 7, 7 }; + +const float lutDeciSec_Value[] = { 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f }; +const uint16_t lutDeciSec_Code[] = { 6, 4, 5, 6, 7, 7, 4, 5, 2, 3, 0 }; +const uint8_t lutDeciSec_Len[] = { 3, 3, 3, 4, 4, 3, 4, 4, 4, 4, 3 }; + +const float lutSec_Value[] = { + 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, + 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, + 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f +}; +const uint16_t lutSec_Code[] = { 3, 1, 0, 15, 13, 12, 11, 9, 8, 14, 13, 12, 11, 9, 8, 5, 29, 28, 21, 31, 30, 21, 9, 8, 41, 41, 40, 81, 161, 160 }; +const uint8_t lutSec_Len[] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8 }; + +const float lutMilliSec_Value[] = { + 0.00f, 0.001f, 0.002f, 0.003f, 0.004f, 0.005f, 0.006f, 0.007f, 0.008f, 0.009f, + 0.01f, 0.011f, 0.012f, 0.013f, 0.014f, 0.015f, 0.016f, 0.017f, 0.018f, 0.019f, + 0.02f, 0.021f, 0.022f, 0.023f, 0.024f, 0.025f, 0.026f, 0.027f, 0.028f, 0.029f, + 0.03f, 0.031f, 0.032f, 0.033f, 0.034f, 0.035f, 0.036f, 0.037f, 0.038f, 0.039f, + 0.04f, 0.041f, 0.042f, 0.043f, 0.044f, 0.045f, 0.046f, 0.047f, 0.048f, 0.049f, + 0.05f, 0.051f, 0.052f, 0.053f, 0.054f, 0.055f, 0.056f, 0.057f, 0.058f, 0.059f, + 0.06f, 0.061f, 0.062f, 0.063f, 0.064f, 0.065f, 0.066f, 0.067f, 0.068f, 0.069f, + 0.07f, 0.071f, 0.072f, 0.073f, 0.074f, 0.075f, 0.076f, 0.077f, 0.078f, 0.079f, + 0.08f, 0.081f, 0.082f, 0.083f, 0.084f, 0.085f, 0.086f, 0.087f, 0.088f, 0.089f, + 0.09f, 0.091f, 0.092f, 0.093f, 0.094f, 0.095f, 0.096f, 0.097f, 0.098f, 0.099f +}; +const uint16_t lutMilliSec_Code[] = { + 122, 123, 120, 121, 126, 127, 124, 125, 114, 115, 25, 112, 113, 118, 119, 116, 117, 42, 43, 40, + 18, 41, 46, 47, 44, 45, 34, 35, 32, 33, 19, 38, 39, 36, 37, 58, 59, 56, 57, 62, + 16, 63, 60, 61, 50, 51, 48, 49, 54, 55, 17, 52, 53, 10, 11, 8, 9, 14, 15, 12, + 22, 13, 2, 3, 0, 1, 6, 7, 4, 5, 23, 26, 27, 24, 25, 30, 31, 28, 29, 18, + 20, 19, 16, 17, 22, 23, 20, 21, 106, 107, 21, 104, 105, 110, 111, 108, 109, 98, 99, 48 +}; +const uint8_t lutMilliSec_Len[] = { + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 6 +}; + +const float lutMicroSec_Value[] = { + 0.00001f, 0.00002f, 0.00003f, 0.00004f, 0.00005f, 0.00006f, 0.00007f, 0.00008f, 0.00009f, 0.0001f, + 0.00011f, 0.00012f, 0.00013f, 0.00014f, 0.00015f, 0.00016f, 0.00017f, 0.00018f, 0.00019f, 0.0002f, + 0.00021f, 0.00022f, 0.00023f, 0.00024f, 0.00025f, 0.00026f, 0.00027f, 0.00028f, 0.00029f, 0.0003f, + 0.00031f, 0.00032f, 0.00033f, 0.00034f, 0.00035f, 0.00036f, 0.00037f, 0.00038f, 0.00039f, 0.0004f, + 0.00041f, 0.00042f, 0.00043f, 0.00044f, 0.00045f, 0.00046f, 0.00047f, 0.00048f, 0.00049f, 0.0005f, + 0.00051f, 0.00052f, 0.00053f, 0.00054f, 0.00055f, 0.00056f, 0.00057f, 0.00058f, 0.00059f, 0.0006f, + 0.00061f, 0.00062f, 0.00063f, 0.00064f, 0.00065f, 0.00066f, 0.00067f, 0.00068f, 0.00069f, 0.0007f, + 0.00071f, 0.00072f, 0.00073f, 0.00074f, 0.00075f, 0.00076f, 0.00077f, 0.00078f, 0.00079f, 0.0008f, + 0.00081f, 0.00082f, 0.00083f, 0.00084f, 0.00085f, 0.00086f, 0.00087f, 0.00088f, 0.00089f, 0.0009f, + 0.00091f, 0.00092f, 0.00093f, 0.00094f, 0.00095f, 0.00096f, 0.00097f, 0.00098f, 0.00099f +}; +const uint16_t lutMicroSec_Code[] = { + 444, 18, 445, 19, 894, 16, 895, 17, 892, 22, 893, 23, 434, 20, 435, 21, 432, 10, 433, 11, + 438, 8, 439, 9, 436, 14, 437, 15, 410, 12, 411, 13, 408, 2, 409, 3, 414, 0, 415, 1, + 412, 6, 413, 7, 402, 4, 403, 5, 400, 26, 401, 27, 406, 24, 407, 25, 404, 30, 405, 31, + 426, 28, 427, 29, 424, 18, 425, 19, 430, 16, 431, 17, 428, 22, 429, 23, 418, 20, 419, 21, + 416, 58, 417, 59, 422, 56, 423, 57, 420, 62, 421, 63, 442, 60, 443, 61, 440, 24, 441 +}; +const uint8_t lutMicroSec_Len[] = { + 9, 5, 9, 5, 10, 5, 10, 5, 10, 5, 10, 5, 9, 5, 9, 5, 9, 6, 9, 6, + 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, + 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, + 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, + 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 6, 9, 5, 9 +}; + +const float lutFreq_Value[] = { + 16.0f, 20.0f, 25.0f, 31.5f, 40.0f, 50.0f, 63.0f, 80.0f, 100.0f, 125.0f, + 160.0f, 200.0f, 250.0f, 315.0f, 400.0f, 500.0f, 630.0f, 800.0f, 1000.0f, 1250.0f, + 1600.0f, 2000.0f, 2500.0f, 3150.0f, 4000.0f, 5000.0f, 6300.0f, 8000.0f, 10000.0f, 12500.0f, + 16000.0f, 20000.0f, 25000.0f, 31500.0f, 40000.0f +}; +const uint16_t lutFreq_Code[] = { 35, 14, 15, 9, 12, 13, 0, 26, 27, 1, 24, 25, 14, 30, 31, 15, 28, 29, 12, 18, 19, 13, 16, 17, 10, 22, 23, 11, 20, 21, 2, 16, 138, 139, 68 }; +const uint8_t lutFreq_Len[] = { 6, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 5, 8, 8, 7 }; + +const float lutFreqHop_Value[] = { 1.090507733f, 1.104089514f, 1.122462048f, 1.148698355f, 1.189207115f, 1.25992105f, 1.414213562f, 2.0f, 4.0f }; +const uint16_t lutFreqHop_Code[] = { 12, 13, 2, 3, 0, 1, 1, 2, 7 }; +const uint8_t lutFreqHop_Len[] = { 4, 4, 4, 4, 4, 2, 4, 2, 3 }; + +const float lutDsr_Value[] = { + -150.0f, -149.0f, -148.0f, -147.0f, -146.0f, -145.0f, -144.0f, -143.0f, -142.0f, -141.0f, + -140.0f, -139.0f, -138.0f, -137.0f, -136.0f, -135.0f, -134.0f, -133.0f, -132.0f, -131.0f, + -130.0f, -129.0f, -128.0f, -127.0f, -126.0f, -125.0f, -124.0f, -123.0f, -122.0f, -121.0f, + -120.0f, -119.0f, -118.0f, -117.0f, -116.0f, -115.0f, -114.0f, -113.0f, -112.0f, -111.0f, + -110.0f, -109.0f, -108.0f, -107.0f, -106.0f, -105.0f, -104.0f, -103.0f, -102.0f, -101.0f, + -100.0f, -99.0f, -98.0f, -97.0f, -96.0f, -95.0f, -94.0f, -93.0f, -92.0f, -91.0f, + -90.0f, -89.0f, -88.0f, -87.0f, -86.0f, -85.0f, -84.0f, -83.0f, -82.0f, -81.0f, + -80.0f, -79.0f, -78.0f, -77.0f, -76.0f, -75.0f, -74.0f, -73.0f, -72.0f, -71.0f, + -70.0f, -69.0f, -68.0f, -67.0f, -66.0f, -65.0f, -64.0f, -63.0f, -62.0f, -61.0f, + -60.0f, -59.0f, -58.0f, -57.0f, -56.0f, -55.0f, -54.0f, -53.0f, -52.0f, -51.0f, + -50.0f, -49.0f, -48.0f, -47.0f, -46.0f, -45.0f, -44.0f, -43.0f, -42.0f, -41.0f, + -40.0f, -39.0f, -38.0f, -37.0f, -36.0f, -35.0f, -34.0f, -33.0f, -32.0f, -31.0f, + -30.0f, -29.0f, -28.0f, -27.0f, -26.0f, -25.0f, -24.0f, -23.0f, -22.0f, -21.0f, + -20.0f, -19.0f, -18.0f, -17.0f, -16.0f, -15.0f, -14.0f, -13.0f, -12.0f, -11.0f, + -10.0f +}; +const uint16_t lutDsr_Code[] = { + 140, 141, 286, 287, 284, 285, 130, 131, 128, 129, 134, 135, 132, 133, 234, 235, 232, 233, 238, 239, + 236, 237, 226, 227, 224, 225, 230, 231, 228, 229, 250, 251, 248, 249, 254, 255, 252, 253, 242, 243, + 240, 241, 246, 247, 244, 245, 202, 203, 200, 201, 206, 207, 204, 205, 194, 195, 192, 193, 198, 199, + 196, 197, 218, 219, 216, 217, 222, 223, 220, 221, 20, 21, 38, 39, 36, 37, 58, 59, 56, 57, + 62, 63, 60, 61, 50, 51, 48, 49, 54, 55, 52, 53, 10, 11, 8, 9, 14, 15, 12, 13, + 2, 3, 0, 1, 6, 7, 4, 5, 42, 43, 40, 41, 46, 47, 44, 45, 18, 19, 16, 17, + 22, 210, 211, 208, 209, 214, 215, 212, 213, 186, 187, 184, 185, 190, 191, 188, 189, 138, 139, 136, + 137 +}; +const uint8_t lutDsr_Len[] = { + 8, 8, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, + 8 +}; + +/*------------------------------------------------------------------------------------------* + * Default frequency grids + *------------------------------------------------------------------------------------------*/ + +const float defaultFrequencyGrid_0[] = { 31.5f, 63.0f, 125.0f, 250.0f, 500.0f, 1000.0f, 2000.0f, 4000.0f, 8000.0f, 16000.0f }; +const float defaultFrequencyGrid_1[] = { 25.0f, 50.0f, 100.0f, 200.0f, 400.0f, 800.0f, 1600.0f, 3150.0f, 6300.0f, 12500.0f }; +const float defaultFrequencyGrid_2[] = { + 20.0f, 25.0f, 31.5f, 40.0f, 50.0f, 63.0f, 80.0f, 100.0f, 125.0f, 160.0f, + 200.0f, 250.0f, 315.0f, 400.0f, 500.0f, 630.0f, 800.0f, 1000.0f, 1250.0f, 1600.0f, + 2000.0f, 2500.0f, 3150.0f, 4000.0f, 5000.0f, 6300.0f, 8000.0f, 10000.0f, 12500.0f, 16000.0f, 20000.0f +}; +const float defaultFrequencyGrid_3[] = { 25.0f, 100.0f, 400.0f, 1600.0f, 6300.0f }; +const float defaultFrequencyGrid_4[] = { 125.0f, 250.0f, 500.0f, 1000.0f, 2000.0f, 4000.0f }; +const float defaultFrequencyGrid_5[] = { 25.0f, 250.0f, 2500.0f }; +const float defaultFrequencyGrid_6[] = { + 27.0f, 56.0f, 89.0f, 126.0f, 168.0f, 214.0f, 265.0f, 323.0f, 387.0f, 459.0f, + 539.0f, 628.0f, 727.0f, 839.0f, 963.0f, 1101.0f, 1256.0f, 1429.0f, 1621.0f, 1836.0f, + 2077.0f, 2345.0f, 2644.0f, 2978.0f, 3351.0f, 3767.0f, 4232.0f, 4750.0f, 5329.0f, 5975.0f, + 6697.0f, 7502.0f, 8401.0f, 9405.0f, 10525.0f, 11775.0f, 13171.0f, 14729.0f, 16468.0f, 18410.0f, 20577.0f }; +const float defaultFrequencyGrid_7[] = { + 27.0f, 89.0f, 168.0f, 265.0f, 387.0f, 539.0f, 727.0f, 963.0f, 1256.0f, 1621.0f, + 2077.0f, 2644.0f, 3351.0f, 4232.0f, 5329.0f, 6697.0f, 8401.0f, 10525.0f, 13171.0f, 16468.0f, 20577.0f +}; +const float defaultFrequencyGrid_8[] = { + 50.0f, 150.0f, 250.0f, 350.0f, 450.0f, 570.0f, 700.0f, 840.0f, 1000.0f, 1170.0f, + 1370.0f, 1600.0f, 1850.0f, 2150.0f, 2150.0f, 2500.0f, 2900.0f, 3400.0f, 4000.0f, 4800.0f, + 5800.0f, 7000.0f, 8500.0f, 10500.0f, 13500.0f +}; + +/*-----------------------------------------------------------------------------------------* + * Function read_bits() + * Reads a given number of bits from the bitstream + *-----------------------------------------------------------------------------------------*/ +static ivas_error read_bits( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + uint32_t *pTarget, /* i/o : Target read data pointer */ + const size_t nBits /* i : Number of bits to read */ +) +{ + uint8_t n; + uint32_t nByte; + uint8_t bit; + + if ( this == NULL || this->pBitstream == NULL || pTarget == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( this->readOffset + nBits > this->length * 8 ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + + for ( n = 0; n < nBits; n++ ) + { + nByte = ( this->readOffset + n ) >> 3; + bit = this->pBitstream[nByte] >> ( 7 - ( ( this->readOffset + n ) % 8 ) ) & 1; + *pTarget = ( *pTarget << 1 ) + bit; + } + + this->readOffset += nBits; + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function read_bool() + * Reads a boolean value from a bitstream + *-----------------------------------------------------------------------------------------*/ +static ivas_error read_bool( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + uint32_t *pResult /* o : Target read data pointer */ +) +{ + *pResult = false; + return read_bits( this, pResult, 1 ); +} + +/*-----------------------------------------------------------------------------------------* + * Function get_id() + * Reads an ID from a bitstream + *-----------------------------------------------------------------------------------------*/ +static ivas_error get_id( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + uint32_t *pResult /* o : Target read data pointer */ +) +{ + ivas_error error; + uint32_t id; + uint32_t cont; + + *pResult = 0; + id = 0; + cont = true; + + if ( pResult == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + while ( cont ) + { + if ( ( error = read_bits( this, &id, 7 ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult = ( *pResult << 7 ) | id; + + if ( ( error = read_bool( this, &cont ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function read_code_word() + * Reads a code word from a LUT + *-----------------------------------------------------------------------------------------*/ +static ivas_error read_code_word( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + const RC_LUT table, /* i : Table enum */ + float *pResult /* o : Code value */ +) +{ + ivas_error error; + const float *pValues; + const uint16_t *pCodes; + const uint8_t *pLengths; + uint8_t minLen; + uint8_t maxLen; + uint8_t size; + uint8_t n; + uint32_t code; + uint8_t len; + + minLen = 255; + maxLen = 0; + code = 0; + + if ( pResult == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + /* Select the right tables */ + switch ( table ) + { + case RC_LUT_COUNT_IDX_LO: + pValues = lutCountIdxLo_Value; + pCodes = lutCountIdxLo_Code; + pLengths = lutCountIdxLo_Len; + size = sizeof lutCountIdxLo_Len / sizeof( uint8_t ); + break; + case RC_LUT_COUNT_IDX_HI: + pValues = lutCountIdxHi_Value; + pCodes = lutCountIdxHi_Code; + pLengths = lutCountIdxHi_Len; + size = sizeof lutCountIdxHi_Len / sizeof( uint8_t ); + break; + case RC_LUT_DECI_SEC: + pValues = lutDeciSec_Value; + pCodes = lutDeciSec_Code; + pLengths = lutDeciSec_Len; + size = sizeof lutDeciSec_Len / sizeof( uint8_t ); + break; + case RC_LUT_SEC: + pValues = lutSec_Value; + pCodes = lutSec_Code; + pLengths = lutSec_Len; + size = sizeof lutSec_Len / sizeof( uint8_t ); + break; + case RC_LUT_MILLI_SEC: + pValues = lutMilliSec_Value; + pCodes = lutMilliSec_Code; + pLengths = lutMilliSec_Len; + size = sizeof lutMilliSec_Len / sizeof( uint8_t ); + break; + case RC_LUT_MICRO_SEC: + pValues = lutMicroSec_Value; + pCodes = lutMicroSec_Code; + pLengths = lutMicroSec_Len; + size = sizeof lutMicroSec_Len / sizeof( uint8_t ); + break; + case RC_LUT_FREQ: + pValues = lutFreq_Value; + pCodes = lutFreq_Code; + pLengths = lutFreq_Len; + size = sizeof lutFreq_Len / sizeof( uint8_t ); + break; + case RC_LUT_FREQ_HOP: + pValues = lutFreqHop_Value; + pCodes = lutFreqHop_Code; + pLengths = lutFreqHop_Len; + size = sizeof lutFreqHop_Len / sizeof( uint8_t ); + break; + case RC_LUT_DSR: + pValues = lutDsr_Value; + pCodes = lutDsr_Code; + pLengths = lutDsr_Len; + size = sizeof lutDsr_Len / sizeof( uint8_t ); + break; + case RC_LUT_INVALID: + default: + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + + /* First read minLen bits, then add one bit per iteration to find the correct value */ + for (n = 0; n < size; n++) + { + minLen = min(minLen, pLengths[n]); + maxLen = max(maxLen, pLengths[n]); + } + for ( len = minLen; len <= maxLen; len++ ) + { + if ( ( error = read_bits( this, &code, ( len == minLen ) ? minLen : 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( n = 0; n < size; n++ ) + { + if ( code == pCodes[n] && len == pLengths[n] ) + { + *pResult = pValues[n]; + return IVAS_ERR_OK; + } + } + } + return IVAS_ERR_INVALID_RENDER_CONFIG; +} + +/*-----------------------------------------------------------------------------------------* + * Function get_count_or_index() + * Gets a count or index + *-----------------------------------------------------------------------------------------*/ +static ivas_error get_count_or_index( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + uint32_t *pResult /* o : Count or index value */ +) +{ + ivas_error error; + float value; + uint32_t isLarge; + + if ( pResult == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + if ( ( error = read_code_word( this, RC_LUT_COUNT_IDX_LO, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult = (uint32_t) value; + + if ( ( error = read_bool( this, &isLarge ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( isLarge ) + { + if ( ( error = read_code_word( this, RC_LUT_COUNT_IDX_HI, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += (uint32_t) value << 6; + } + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function get_duration() + * Gets a duration value + *-----------------------------------------------------------------------------------------*/ +static ivas_error get_duration( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + float *pResult /* o : Duration value */ +) +{ + ivas_error error; + float value; + uint32_t addFlag; + + /* Deciseconds */ + if ( ( error = read_code_word( this, RC_LUT_DECI_SEC, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult = value; + + /* Milliseconds */ + if ( ( error = read_bool( this, &addFlag ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( addFlag ) + { + if ( ( error = read_code_word( this, RC_LUT_MILLI_SEC, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value; + + /* Microseconds */ + if ( ( error = read_bool( this, &addFlag ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( addFlag ) + { + if ( ( error = read_code_word( this, RC_LUT_MICRO_SEC, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value; + } + } + + /* Seconds */ + if ( ( error = read_bool( this, &addFlag ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( addFlag ) + { + if ( ( error = read_code_word( this, RC_LUT_SEC, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value; + } + + /* Correct rounding errors due to multiple additions: */ + *pResult = roundf( *pResult * 100000.0f ) / 100000.0f; + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function get_frequency() + * Gets a frequency value + *-----------------------------------------------------------------------------------------*/ +static ivas_error get_frequency( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + float *pResult /* o : Frequency value */ +) +{ + ivas_error error; + uint32_t hiRes; + uint32_t refine; + + hiRes = 0; + refine = 0; + + if ( ( error = read_code_word( this, RC_LUT_FREQ, pResult ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( ( error = read_bool( this, &hiRes ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( hiRes ) + { + if ( ( error = read_bits( this, &refine, 4 ) ) != IVAS_ERR_OK ) + { + return error; + } + + *pResult *= powf( 2.0f, ( (float) refine + 1.0f ) / 51.0f ); + } + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function get_dsr() + * Gets a DSR value + *-----------------------------------------------------------------------------------------*/ +static ivas_error get_dsr( + RenderConfigReader *this, /* i/o : Renderer config reader handle */ + float *pResult /* o : DSR value */ +) +{ + ivas_error error; + float value; + + if ( ( error = read_code_word( this, RC_LUT_DSR, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult = powf( 10.0f, value / 10.0f ); + return IVAS_ERR_OK; +} +#else /*-----------------------------------------------------------------------------------------* * Function read_bool() * Reads a boolean value from a line @@ -105,7 +703,6 @@ static int16_t read_bool( return true; } - /*-----------------------------------------------------------------------------------------* * Function read_vector() * @@ -311,7 +908,7 @@ static ivas_error RenderConfigReader_checkValues( return IVAS_ERR_OK; } - +#endif /*------------------------------------------------------------------------------------------* * RenderConfigReader_open() @@ -326,6 +923,9 @@ ivas_error RenderConfigReader_open( { RenderConfigReader *pSelf; FILE *pConfigFile; +#ifndef CONTROL_METADATA_REVERB + int length; +#endif /* Open the configuration file */ if ( strlen( pConfigPath ) < 1 ) @@ -333,7 +933,17 @@ ivas_error RenderConfigReader_open( return IVAS_ERR_FAILED_FILE_OPEN; } +#ifdef CONTROL_METADATA_REVERB + pConfigFile = fopen( pConfigPath, "rb" ); +#else + /* use corresponding .cfg file */ + length = strlen( pConfigPath ); + if ( length >= 4 && strcmp( &pConfigPath[length - 4], ".dat" ) == 0 ) + { + strcpy( &pConfigPath[length - 4], ".cfg" ); + } pConfigFile = fopen( pConfigPath, "r" ); +#endif if ( !pConfigFile ) { @@ -354,9 +964,296 @@ ivas_error RenderConfigReader_open( * Reads the configuration from a file *------------------------------------------------------------------------------------------*/ +#ifdef CONTROL_METADATA_REVERB +ivas_error RenderConfigReader_read( + RenderConfigReader *pRenderConfigReader /* i/o : RenderConfigReader handle */ +) +{ + uint32_t file_size; + uint32_t value; + uint32_t i, n, m; + ivas_error error; + float freqHop; + uint32_t gridLen; + uint32_t subGridLen; + const float *pGrid; + + /* Read the bitstream */ + fseek( pRenderConfigReader->pConfigFile, 0, SEEK_END ); + file_size = ftell( pRenderConfigReader->pConfigFile ); + rewind( pRenderConfigReader->pConfigFile ); + + pRenderConfigReader->pBitstream = (uint8_t *) malloc( file_size * sizeof( uint8_t ) ); + if ( pRenderConfigReader->pBitstream == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + fread( pRenderConfigReader->pBitstream, sizeof( uint8_t ), file_size, pRenderConfigReader->pConfigFile ); + pRenderConfigReader->length = file_size; + + /****************************/ + /* Read the frequency grids */ + /****************************/ + + /* Number of frequency grids */ + if ( ( error = get_count_or_index( pRenderConfigReader, &pRenderConfigReader->nFG ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Allocate memory for the frequency grids */ + if ( ( pRenderConfigReader->pFG = (FrequencyGrid *) malloc( pRenderConfigReader->nFG * sizeof( FrequencyGrid ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + /* Initialize memory pointers to allow safe freeing ico errors */ + for ( n = 0; n < pRenderConfigReader->nFG; n++ ) + { + pRenderConfigReader->pFG[n].pFc = 0; + } + + for ( n = 0; n < pRenderConfigReader->nFG; n++ ) + { + /* Read the representation method */ + value = 0; + if ( ( error = read_bits( pRenderConfigReader, &value, 2 ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Process depending on the representation method */ + switch ( value ) + { + case FREQ_GRID_MODE_INDIVIDUAL_FREQUENCIES: + if ( ( error = get_count_or_index( pRenderConfigReader, &pRenderConfigReader->pFG[n].nrBands ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Allocate memory for the center frequency array */ + if ( ( pRenderConfigReader->pFG[n].pFc = (float *) malloc( pRenderConfigReader->pFG[n].nrBands * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + /* Read the individual frequencies */ + for ( m = 0; m < pRenderConfigReader->pFG[n].nrBands; m++ ) + { + if ( ( error = get_frequency( pRenderConfigReader, &pRenderConfigReader->pFG[n].pFc[m] ) ) != IVAS_ERR_OK ) + { + return error; + } + } + break; + case FREQ_GRID_MODE_START_HOP_AMOUNT: + if ( ( error = get_count_or_index( pRenderConfigReader, &pRenderConfigReader->pFG[n].nrBands ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Allocate memory for the center frequency array */ + if ( ( pRenderConfigReader->pFG[n].pFc = (float *) malloc( pRenderConfigReader->pFG[n].nrBands * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + /* Read the first frequency */ + if ( ( error = get_frequency( pRenderConfigReader, &pRenderConfigReader->pFG[n].pFc[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Read frequency hop from LUT */ + if ( ( error = read_code_word( pRenderConfigReader, RC_LUT_FREQ_HOP, &freqHop ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Fill up the center frequency array */ + for ( m = 1; m < pRenderConfigReader->pFG[n].nrBands; m++ ) + { + pRenderConfigReader->pFG[n].pFc[m] = pRenderConfigReader->pFG[n].pFc[m - 1] * freqHop; + } + break; + case FREQ_GRID_MODE_DEFAULT_BANDING: + /* Read the default grid ID */ + value = 0; + if ( ( error = read_bits( pRenderConfigReader, &value, 4 ) ) != IVAS_ERR_OK ) + { + return error; + } + switch ( value ) + { + case 0: + gridLen = sizeof( defaultFrequencyGrid_0 ) / sizeof( defaultFrequencyGrid_0[0] ); + pGrid = defaultFrequencyGrid_0; + break; + case 1: + gridLen = sizeof( defaultFrequencyGrid_1 ) / sizeof( defaultFrequencyGrid_1[0] ); + pGrid = defaultFrequencyGrid_1; + break; + case 2: + gridLen = sizeof( defaultFrequencyGrid_2 ) / sizeof( defaultFrequencyGrid_2[0] ); + pGrid = defaultFrequencyGrid_2; + break; + case 3: + gridLen = sizeof( defaultFrequencyGrid_3 ) / sizeof( defaultFrequencyGrid_3[0] ); + pGrid = defaultFrequencyGrid_3; + break; + case 4: + gridLen = sizeof( defaultFrequencyGrid_4 ) / sizeof( defaultFrequencyGrid_4[0] ); + pGrid = defaultFrequencyGrid_4; + break; + case 5: + gridLen = sizeof( defaultFrequencyGrid_5 ) / sizeof( defaultFrequencyGrid_5[0] ); + pGrid = defaultFrequencyGrid_5; + break; + case 6: + gridLen = sizeof( defaultFrequencyGrid_6 ) / sizeof( defaultFrequencyGrid_6[0] ); + pGrid = defaultFrequencyGrid_6; + break; + case 7: + gridLen = sizeof( defaultFrequencyGrid_7 ) / sizeof( defaultFrequencyGrid_7[0] ); + pGrid = defaultFrequencyGrid_7; + break; + case 8: + gridLen = sizeof( defaultFrequencyGrid_8 ) / sizeof( defaultFrequencyGrid_8[0] ); + pGrid = defaultFrequencyGrid_8; + break; + default: + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + + m = 0; + /* Read sub-grid flag */ + if ( ( error = read_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( value != false ) + { + /* Read the sub-grid offset */ + if ( ( error = read_bits( pRenderConfigReader, &m, 3 ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Read the sub-grid length */ + subGridLen = 0; + if ( ( error = read_bits( pRenderConfigReader, &subGridLen, 6 ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( m + subGridLen > gridLen ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + gridLen = subGridLen; + } + pRenderConfigReader->pFG[n].nrBands = gridLen; + /* Allocate memory for the center frequency array */ + if ( ( pRenderConfigReader->pFG[n].pFc = (float *) malloc( gridLen * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + /* Copy the ROM content to the frequency grid*/ + for ( i = 0; i < gridLen; i++ ) + { + pRenderConfigReader->pFG[n].pFc[i] = pGrid[m + i]; + } + + break; + default: + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + } + + /**********************************/ + /* Read the acoustic environments */ + /**********************************/ + + /* Number of acoustic environments */ + if ( ( error = get_count_or_index( pRenderConfigReader, &pRenderConfigReader->nAE ) ) != IVAS_ERR_OK ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + + /* Allocate memory for the acoustic environments array */ + if ( ( pRenderConfigReader->pAE = (AcousticEnv *) malloc( pRenderConfigReader->nAE * sizeof( AcousticEnv ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + /* Initialize memory pointers to allow safe freeing ico errors */ + for ( n = 0; n < pRenderConfigReader->nAE; n++ ) + { + pRenderConfigReader->pAE[n].pRT60 = 0; + pRenderConfigReader->pAE[n].pDSR = 0; + } + + for ( n = 0; n < pRenderConfigReader->nAE; n++ ) + { + /* Read the AE ID */ + if ( ( error = get_id( pRenderConfigReader, &pRenderConfigReader->pAE[n].id ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Read the frequency grid ID */ + if ( ( error = get_count_or_index( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Associate the frequency grid */ + if ( value >= pRenderConfigReader->nFG ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + + pRenderConfigReader->pAE[n].pFG = &( pRenderConfigReader->pFG[value] ); + + /* Allocate memory for RT60 and DSR arrays */ + if ( ( pRenderConfigReader->pAE[n].pRT60 = (float *) malloc( pRenderConfigReader->pAE[n].pFG->nrBands * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + if ( ( pRenderConfigReader->pAE[n].pDSR = (float *) malloc( pRenderConfigReader->pAE[n].pFG->nrBands * sizeof( float ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + /* Read the values */ + if ( ( error = get_duration( pRenderConfigReader, &pRenderConfigReader->pAE[n].preDelay ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( m = 0; m < pRenderConfigReader->pAE[n].pFG->nrBands; m++ ) + { + if ( ( error = get_duration( pRenderConfigReader, &pRenderConfigReader->pAE[n].pRT60[m] ) ) != IVAS_ERR_OK ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + } + for ( m = 0; m < pRenderConfigReader->pAE[n].pFG->nrBands; m++ ) + { + if ( ( error = get_dsr( pRenderConfigReader, &pRenderConfigReader->pAE[n].pDSR[m] ) ) != IVAS_ERR_OK ) + { + return IVAS_ERR_INVALID_RENDER_CONFIG; + } + } + } + + /* Cleanup */ + free( pRenderConfigReader->pBitstream ); + + // TODO: Check the values, apply DSR epsilon + return IVAS_ERR_OK; +} + +#else ivas_error RenderConfigReader_read( - RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ + RenderConfigReader *pRenderConfigReader, /* i/o : RenderConfigReader handle */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { int32_t file_size; @@ -418,7 +1315,7 @@ ivas_error RenderConfigReader_read( while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { hRenderConfig->room_acoustics.override = TRUE; - params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); #ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); #endif @@ -505,7 +1402,7 @@ ivas_error RenderConfigReader_read( pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { - params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); if ( strcmp( item, "RENDERER" ) == 0 ) { @@ -565,10 +1462,49 @@ ivas_error RenderConfigReader_read( fprintf( stderr, "Errors occurred\n" ); return IVAS_ERR_FAILED_FILE_PARSE; } - return RenderConfigReader_checkValues( hRenderConfig ); } +#endif +#ifdef CONTROL_METADATA_REVERB +/*------------------------------------------------------------------------------------------* + * RenderConfigReader_getEnvironment() + * + * Gets Acoustic environment with a given ID + *------------------------------------------------------------------------------------------*/ + +ivas_error RenderConfigReader_getAcousticEnvironment( + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + uint16_t id, /* i : Acoustic environment ID */ + IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pAcEnv /* o : Target acoustic environment pointer */ +) +{ + uint16_t n, m; + + if ( pRenderConfigReader == NULL || pAcEnv == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + for ( n = 0; n < pRenderConfigReader->nAE; n++ ) + { + if ( id == pRenderConfigReader->pAE[n].id ) + { + pAcEnv->nBands = (int16_t) pRenderConfigReader->pAE[n].pFG->nrBands; + pAcEnv->inputPreDelay = pRenderConfigReader->pAE[n].preDelay; + + for ( m = 0; m < pAcEnv->nBands; m++ ) + { + pAcEnv->pFc_input[m] = pRenderConfigReader->pAE[n].pFG->pFc[m]; + pAcEnv->pAcoustic_rt60[m] = pRenderConfigReader->pAE[n].pRT60[m]; + pAcEnv->pAcoustic_dsr[m] = pRenderConfigReader->pAE[n].pDSR[m]; + } + return IVAS_ERR_OK; + } + } + return IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING; +} +#endif /*------------------------------------------------------------------------------------------* * RenderConfigReader_close() @@ -580,11 +1516,32 @@ void RenderConfigReader_close( RenderConfigReader **ppRenderConfigReader /* i : RenderConfigReader handle */ ) { +#ifdef CONTROL_METADATA_REVERB + uint16_t n; +#endif + if ( ppRenderConfigReader == NULL || *ppRenderConfigReader == NULL ) { return; } +#ifdef CONTROL_METADATA_REVERB + /* Free the acoustic environments */ + for ( n = 0; n < ( *ppRenderConfigReader )->nAE; n++ ) + { + free( ( *ppRenderConfigReader )->pAE[n].pRT60 ); + free( ( *ppRenderConfigReader )->pAE[n].pDSR ); + } + free( ( *ppRenderConfigReader )->pAE ); + + /* Free the frequency grids */ + for ( n = 0; n < ( *ppRenderConfigReader )->nFG; n++ ) + { + free( ( *ppRenderConfigReader )->pFG[n].pFc ); + } + free( ( *ppRenderConfigReader )->pFG ); +#endif + fclose( ( *ppRenderConfigReader )->pConfigFile ); free( *ppRenderConfigReader ); diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index c2afb92e8b..53894f7043 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -52,10 +52,24 @@ ivas_error RenderConfigReader_open( ); /* Reads a configuration */ +#ifdef CONTROL_METADATA_REVERB +ivas_error RenderConfigReader_read( + RenderConfigReader *pRenderConfigReader /* i : RenderConfigReader handle */ +); + +/* Get an acoustic environment */ +ivas_error RenderConfigReader_getAcousticEnvironment( + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + uint16_t id, /* i : Acoustic environment ID */ + IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pAcEnv /* o : Target acoustic environment pointer */ +); + +#else ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); +#endif /* Closes the renderer configuration reader and deallocates memory */ void RenderConfigReader_close( diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 70f0ef6b36..f01861eaf3 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -909,35 +909,35 @@ // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config hospital_patientroom ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst +../IVAS_dec -render_config testv/rend_config_hospital_patientroom.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config recreation ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst +../IVAS_dec -render_config testv/rend_config_recreation.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst // Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1_2 512000 48 testv/stv512MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst // Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, 7_1_4 out ../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit diff --git a/scripts/pyivastest/constants.py b/scripts/pyivastest/constants.py index f42796376a..60d98bc54e 100644 --- a/scripts/pyivastest/constants.py +++ b/scripts/pyivastest/constants.py @@ -48,6 +48,7 @@ OC_TO_NCHANNELS = { "STEREO": 2, "BINAURAL": 2, "BINAURAL_ROOM": 2, + "BINAURAL_REVERB": 2, "5_1": 6, "7_1": 8, "5_1_2": 8, @@ -64,7 +65,7 @@ OC_TO_NCHANNELS = { "MASA1TC": 1, "MASA2TC": 2, } -DECODER_OUTPUT_CONFIGS = {"MONO", "STEREO", "BINAURAL", "BINAURAL_ROOM", "5_1", "7_1", "5_1_4", "5_1_2", +DECODER_OUTPUT_CONFIGS = {"MONO", "STEREO", "BINAURAL", "BINAURAL_ROOM", "BINAURAL_REVERB", "5_1", "7_1", "5_1_4", "5_1_2", "7_1_4", "FOA", "HOA2", "HOA3", "EXT"} LOG_FILE_EXT = ".txt" LOG_FILE_DIR ="logs" diff --git a/scripts/testv/rend_config_hospital_patientroom.cfg b/scripts/testv/rend_config_hospital_patientroom.cfg index b68ac921f9..0ce43444ed 100644 --- a/scripts/testv/rend_config_hospital_patientroom.cfg +++ b/scripts/testv/rend_config_hospital_patientroom.cfg @@ -12,24 +12,23 @@ fc = [20.0, 25.0, 31.5, 40.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, 20000.0]; -rt60 = [0.812749, 0.618878, 0.451113, 0.346723, - 0.466827, 0.539871, 0.61874, 0.702911, - 0.666569, 0.730374, 0.750904, 0.724695, - 0.754858, 0.758571, 0.768437, 0.749991, - 0.776221, 0.782269, 0.774414, 0.74688, - 0.735205, 0.737815, 0.719275, 0.71708, - 0.714652, 0.605922, 0.520307, 0.517676, - 0.521016, 0.379562, 0.307856]; +rt60 = [0.81275, 0.61888, 0.45111, 0.34672, + 0.46683, 0.53987, 0.61874, 0.70291, + 0.66657, 0.73037, 0.75090, 0.72470, + 0.75486, 0.75857, 0.76844, 0.74999, + 0.77622, 0.78227, 0.77441, 0.74688, + 0.73521, 0.73782, 0.71928, 0.71708, + 0.71465, 0.60592, 0.52031, 0.51768, + 0.52102, 0.37956, 0.30786]; -dsr = [0.000219780698, 0.000205275364, 7.18711e-05, 4.5745977e-05, - 8.381106e-06, 6.884964e-06, 6.532765e-06, 8.296928e-06, - 1.0005793e-05, 9.191127e-06, 8.635287e-06, 9.627704e-06, - 1.0806965e-05, 1.0041916e-05, 7.77047e-06, 9.695803e-06, - 9.594324e-06, 8.32215e-06, 7.564813e-06, 6.215871e-06, - 6.379496e-06, 6.358105e-06, 6.6696e-06, 6.369334e-06, - 6.378474e-06, 3.339913e-06, 3.129318e-06, 2.892564e-06, - 6.00202e-07, 3.40124e-07, 3.37705e-07]; +dsr = [0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, + 7.943284e-06 , 6.3095763e-06, 6.3095763e-06, 7.943284e-06 , + 1e-05 , 1e-05 , 7.943284e-06 , 1e-05 , + 1e-05 , 1e-05 , 7.943284e-06 , 1e-05 , + 1e-05 , 7.943284e-06 , 7.943284e-06 , 6.3095763e-06, + 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, + 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, + 6.3095763e-07, 3.1622776e-07, 3.1622776e-07]; - -acousticPreDelay = 0.016; -inputPreDelay = 0.081625; +acousticPreDelay = 0.016; +inputPreDelay = 0.08163; \ No newline at end of file diff --git a/scripts/testv/rend_config_recreation.cfg b/scripts/testv/rend_config_recreation.cfg index afdc0f858b..cc822d630c 100644 --- a/scripts/testv/rend_config_recreation.cfg +++ b/scripts/testv/rend_config_recreation.cfg @@ -12,24 +12,23 @@ fc = [20.0, 25.0, 31.5, 40.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, 20000.0]; -rt60 = [4.519163, 4.895527, 4.832761, 5.001975, - 5.344683, 5.760259, 6.36818, 6.955033, - 7.275571, 7.625591, 8.088915, 8.160022, - 8.138999, 8.179192, 8.162802, 8.462264, - 9.618056, 9.930476, 9.813532, 8.593404, - 8.388852, 8.368234, 6.518449, 3.760885, - 3.753736, 3.574508, 1.287239, 1.221739, - 1.22448, 1.716312, 2.143427]; +rt60 = [4.51916, 4.89553, 4.83276, 5.00198, + 5.34468, 5.76026, 6.36818, 6.95503, + 7.27557, 7.62559, 8.08892, 8.16002, + 8.13900, 8.17919, 8.16280, 8.46226, + 9.61806, 9.93048, 9.81353, 8.59340, + 8.38885, 8.36823, 6.51845, 3.76089, + 3.75374, 3.57451, 1.28724, 1.22174, + 1.22448, 1.71631, 2.14343]; -dsr = [9.18578e-07, 7.63803e-07, 9.23183e-07, 1.048656e-06, - 1.61449e-06, 2.13745e-06, 2.854805e-06, 3.979651e-06, - 6.229977e-06, 7.782421e-06, 9.091754e-06, 8.545798e-06, - 7.482083e-06, 7.351071e-06, 7.947039e-06, 8.152676e-06, - 5.201189e-06, 4.744103e-06, 4.397069e-06, 3.017449e-06, - 2.958383e-06, 2.725911e-06, 7.94912e-07, 6.20198e-07, - 5.71181e-07, 5.5546e-08, 1.3987e-08, 1.338e-08, - 1.322e-09, 1.3e-11, 4e-12]; +dsr = [1e-06 , 7.943284e-07 , 1e-06 , 1e-06 , + 1.5848925e-06, 1.9952631e-06, 3.1622776e-06, 3.9810707e-06, + 6.3095763e-06, 7.943284e-06 , 1e-05 , 7.943284e-06 , + 7.943284e-06 , 7.943284e-06 , 7.943284e-06 , 7.943284e-06 , + 5.01187e-06 , 5.01187e-06 , 3.9810707e-06, 3.1622776e-06, + 3.1622776e-06, 2.511887e-06 , 7.943284e-07 , 6.3095763e-07, + 6.3095763e-07, 5.01187e-08 , 1.2589251e-08, 1.2589251e-08, + 1.2589265e-09, 1.2589266e-11, 3.981075e-12]; - -acousticPreDelay = 0.032; -inputPreDelay = 0.430312; +acousticPreDelay = 0.016; +inputPreDelay = 0.43031; diff --git a/scripts/testv/rend_config_renderer.cfg b/scripts/testv/rend_config_renderer.cfg index 8aa9dec1b2..442edf2506 100644 --- a/scripts/testv/rend_config_renderer.cfg +++ b/scripts/testv/rend_config_renderer.cfg @@ -21,14 +21,14 @@ rt60 = [1.3622, 1.4486, 1.3168, 1.5787, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, 0.60031]; -dsr = [1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, - 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, - 8.9719e-08, 1.902e-07, 3.702e-07, 6.1341e-07, - 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, - 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, - 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, - 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, - 6.2001e-08, 2.8483e-08, 2.6267e-08]; +dsr = [1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, + 1.2589251e-08, 1.9952632e-08, 2.511887e-08 , 3.9810708e-08, + 1e-07 , 1.9952633e-07, 3.981071e-07 , 6.3095763e-07, + 7.943284e-07 , 6.3095763e-07, 5.01187e-07 , 5.01187e-07 , + 6.3095763e-07, 6.3095763e-07, 7.943284e-07 , 6.3095763e-07, + 5.01187e-07 , 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, + 5.01187e-07 , 2.511887e-07 , 1.2589251e-07, 1e-07 , + 6.309576e-08 , 3.1622776e-08, 2.511887e-08]; acousticPreDelay = 0.016; inputPreDelay = 0.1; \ No newline at end of file -- GitLab From 20b558a1e51f8daf89d37ba10a328911d17e4a98 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Thu, 6 Apr 2023 17:41:30 +0200 Subject: [PATCH 0080/1418] Added missing files --- scripts/reverb/generate_reverb_metadata.py | 400 ++++++++++++++++++ .../rend_config_hospital_patientroom.dat | 3 + scripts/testv/rend_config_recreation.dat | 3 + scripts/testv/rend_config_renderer.dat | 3 + 4 files changed, 409 insertions(+) create mode 100644 scripts/reverb/generate_reverb_metadata.py create mode 100644 scripts/testv/rend_config_hospital_patientroom.dat create mode 100644 scripts/testv/rend_config_recreation.dat create mode 100644 scripts/testv/rend_config_renderer.dat diff --git a/scripts/reverb/generate_reverb_metadata.py b/scripts/reverb/generate_reverb_metadata.py new file mode 100644 index 0000000000..a05bbeb2d8 --- /dev/null +++ b/scripts/reverb/generate_reverb_metadata.py @@ -0,0 +1,400 @@ +#!/usr/bin/env python3 + +""" + (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. +""" + +# +# Generate binary render configuration output files for testing purposes +# The binary code generation is based on the MPEG-I audio standard +# which defines functions to decode raw bitstream into internal parameters +# + + +from bitarray import bitarray, test as bitarray_test +import math +from enum import Enum +import numpy as np + + +# Set to True to print values suitable for inclusion into .cfg configuration files +print_cfg = False + +def get_id_code(id): + code = format(id % 128, '07b') + '0' + id //= 128 + while id > 0: + code = format(id % 128, '07b') + '1' + code + id = id // 128 + return code + + +def get_count_or_index_code(n): + # 0, 1, ... 63 + countOrIndexLoCodes = [ + '0111', '100', '01100', '01101', '01010', '01011', '01000', '01001', '001111', '001110', + '001101', '001100', '001011', '001010', '001001', '001000', '000111', '000110', '000101', '000100', + '000011', '000010', '000001', '000000', '111111', '111110', '111101', '111100', '111011', '111010', + '111001', '111000', '1101111', '1101110', '1101101', '1101100', '1101011', '1101010', '1101001', '1101000', + '1100111', '1100110', '1100101', '1100100', '1100011', '1100010', '1100001', '1100000', '1011111', '1011110', + '1011101', '1011100', '1011011', '1011010', '1011001', '1011000', '1010111', '1010110', '1010101', '1010100', + '1010011', '1010010', '1010001', '1010000'] + + # 1, 2, ... 15 + countOrIndexHiCode = [ + '001', '000', '110', '101', '100', '0111', '0101', '1111', '1110', '01101', + '01001', '01000', '011001', '0110001', '0110000'] + + assert 0 <= n < 16 * 64 + code = countOrIndexLoCodes[n % 64] + if n < 64: + code += '0' + else: + code += '1' + countOrIndexHiCode[n // 64 - 1] + return code + + +def get_duration_code(duration): + # 1, 2, ... 30 + secondsCode = [ + '0011', '0001', '0000', '1111', '1101', '1100', '1011', '1001', '1000', '01110', + '01101', '01100', '01011', '01001', '01000', '00101', '11101', '11100', '10101', '011111', + '011110', '010101', '001001', '001000', '101001', '0101001', '0101000', '1010001', '10100001', '10100000' ] + + # 0, 0.1, ... 1.0 + deciSecondsCode = [ + '110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ] + + # 0, 1, ..., 99 + millisecondsCode = [ + '1111010', '1111011', '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '1110010', '1110011', + '11001', '1110000', '1110001', '1110110', '1110111', '1110100', '1110101', '0101010', '0101011', '0101000', + '10010', '0101001', '0101110', '0101111', '0101100', '0101101', '0100010', '0100011', '0100000', '0100001', + '10011', '0100110', '0100111', '0100100', '0100101', '0111010', '0111011', '0111000', '0111001', '0111110', + '10000', '0111111', '0111100', '0111101', '0110010', '0110011', '0110000', '0110001', '0110110', '0110111', + '10001', '0110100', '0110101', '0001010', '0001011', '0001000', '0001001', '0001110', '0001111', '0001100', + '10110', '0001101', '0000010', '0000011', '0000000', '0000001', '0000110', '0000111', '0000100', '0000101', + '10111', '0011010', '0011011', '0011000', '0011001', '0011110', '0011111', '0011100', '0011101', '0010010', + '10100', '0010011', '0010000', '0010001', '0010110', '0010111', '0010100', '0010101', '1101010', '1101011', + '10101', '1101000', '1101001', '1101110', '1101111', '1101100', '1101101', '1100010', '1100011', '110000' ] + + # 10, 20, ... 990 + microsecondsCode = [ + '110111100', '10010', '110111101', '10011', '1101111110', '10000', '1101111111', '10001', '1101111100', '10110', + '1101111101', '10111', '110110010', '10100', '110110011', '10101', '110110000', '001010', '110110001', '001011', + '110110110', '001000', '110110111', '001001', '110110100', '001110', '110110101', '001111', '110011010', '001100', + '110011011', '001101', '110011000', '000010', '110011001', '000011', '110011110', '000000', '110011111', '000001', + '110011100', '000110', '110011101', '000111', '110010010', '000100', '110010011', '000101', '110010000', '011010', + '110010001', '011011', '110010110', '011000', '110010111', '011001', '110010100', '011110', '110010101', '011111', + '110101010', '011100', '110101011', '011101', '110101000', '010010', '110101001', '010011', '110101110', '010000', + '110101111', '010001', '110101100', '010110', '110101101', '010111', '110100010', '010100', '110100011', '010101', + '110100000', '111010', '110100001', '111011', '110100110', '111000', '110100111', '111001', '110100100', '111110', + '110100101', '111111', '110111010', '111100', '110111011', '111101', '110111000', '11000', '110111001' ] + + duration_dus = int(round(np.float32(duration) * np.float32(100000))) # [deca us] + if print_cfg: + print('duration: ', duration_dus) + + dus = duration_dus # [deca us] + s = dus // 100000 # 0, 1, ... 30 [s] + ms = (dus % 100000) // 100 # 0, 1, ... 999 [ms] + dus = (dus % 100) # 0, 1, ... 99 [deca us] + ds = ms // 100 # 0, 1, ... 9 [deci s] + ms = ms % 100 # 0, 1, ... 99 [ms] + if s >= 1 and ds == 0: + s -= 1 + ds = 10 # 0, 1, ... 10 [deci s] + + assert 0 <= s <= 30 + assert 0 <= ds <= 10 + assert 0 <= ms <= 99 + assert 0 <= dus <= 99 + assert duration_dus == s * 100000 + ds * 10000 + ms * 100 + dus + + code = deciSecondsCode[ds] + if ms > 0 or dus > 0: + code += '1' + millisecondsCode[ms] + if dus > 0: + code += '1' + microsecondsCode[dus - 1] + else: + code += '0' + else: + code += '0' + if s > 0: + # long range mode not implemented + code += '1' + secondsCode[s - 1] + else: + code += '0' + + return code + + +def get_frequency_code(f): + frequencyCode = { + 16 : '100011', 20 : '001110', 25 : '001111', 31.5 : '1001', 40 : '001100', + 50 : '001101', 63 : '0000', 80 : '011010', 100 : '011011', 125 : '0001', + 160 : '011000', 200 : '011001', 250 : '1110', 315 : '011110', 400 : '011111', + 500 : '1111', 630 : '011100', 800 : '011101', 1000 : '1100', 1250 : '010010', + 1600 : '010011', 2000 : '1101', 2500 : '010000', 3150 : '010001', 4000 : '1010', + 5000 : '010110', 6300 : '010111', 8000 : '1011', 10000: '010100', 12500: '010101', + 16000: '0010', 20000: '10000', 25000: '10001010', 31500: '10001011', 40000: '1000100', } + + assert 16 <= f <= 40000 + if f in frequencyCode.keys(): + if print_cfg: + print('frequency:', f) + return frequencyCode[f] + '0' + else: + # exact frequency not found, use frequency refinement to aproximate + # (largest relative deviation seen for range(16, 40000) was 0.006818) + # find frequencies enveloping f + f_low = 16 + f_high = 40000 + for key in frequencyCode.keys(): + if key < f: + f_low = max(f_low, key) + else: + f_high = min(f_high, key) + refinement = round(51 * math.log(f / f_low, 2)) - 1 + if refinement >= 16: + # choose next higer frequency + if print_cfg: + print('frequency:', list(frequencyCode)[f_high]) + return frequencyCode[f_high] + '0' + else: + if print_cfg: + print('frequency:', list(frequencyCode)[f_low], ', refined: ', f_low * 2 ** ((refinement + 1) / 51)) + return frequencyCode[f_low] + '1' + format(refinement, '04b') + + +def get_frequency_hop_code(index): + assert 0 <= index < 9 + return [ + '1100', # 2^(1/8) + '1101', # 2^(1/7) + '0010', # 2^(1/6) + '0011', # 2^(1/5) + '0000', # 2^(1/4) + '01', # 2^(1/3) + '0001', # 2^(1/2) + '10', # 2^1 + '111'][index] # 2^2 + + + +def get_dsr_code(dsr): + # -150.0, -149.0, ... -10.0 + dsrCode = [ + '10001100', '10001101', '100011110', '100011111', '100011100', '100011101', '10000010', '10000011', '10000000', '10000001', + '10000110', '10000111', '10000100', '10000101', '011101010', '011101011', '011101000', '011101001', '011101110', '011101111', + '011101100', '011101101', '011100010', '011100011', '011100000', '011100001', '011100110', '011100111', '011100100', '011100101', + '011111010', '011111011', '011111000', '011111001', '011111110', '011111111', '011111100', '011111101', '011110010', '011110011', + '011110000', '011110001', '011110110', '011110111', '011110100', '011110101', '011001010', '011001011', '011001000', '011001001', + '011001110', '011001111', '011001100', '011001101', '011000010', '011000011', '011000000', '011000001', '011000110', '011000111', + '011000100', '011000101', '011011010', '011011011', '011011000', '011011001', '011011110', '011011111', '011011100', '011011101', + '010100', '010101', '100110', '100111', '100100', '100101', '111010', '111011', '111000', '111001', + '111110', '111111', '111100', '111101', '110010', '110011', '110000', '110001', '110110', '110111', + '110100', '110101', '001010', '001011', '001000', '001001', '001110', '001111', '001100', '001101', + '000010', '000011', '000000', '000001', '000110', '000111', '000100', '000101', '101010', '101011', + '101000', '101001', '101110', '101111', '101100', '101101', '010010', '010011', '010000', '010001', + '010110', '011010010', '011010011', '011010000', '011010001', '011010110', '011010111', '011010100', '011010101', '010111010', + '010111011', '010111000', '010111001', '010111110', '010111111', '010111100', '010111101', '10001010', '10001011', '10001000', + '10001001' ] + + d = math.log10(dsr) * 10 + d = round(d + 150) + assert 0 <= d <= 140 + if print_cfg: + print('dsr:', np.float32(np.power(np.float32(10), np.float32(d - 150) / np.float32(10)))) # C decoder uses float precision math + return dsrCode[d] + + +class fgdMethod(Enum): + Individual_Frequencies = '00' + Start_Hop_Amount = '01' + Default_Banding = '10' + + +# apply function to elements of list and concatenate the resulting strings +def concatenate(function, data): + return ''.join([function(d) for d in data]) + + +def test(): + # generate binary output which can be compared with the Matlab implementation output + string = '' + + # count or index encoding + string += concatenate(get_count_or_index_code, [n for n in range(0, 16 * 64)]) + + # duration encoding + string += concatenate(get_duration_code, [d / 1000 for d in range(0, 30 * 1000)]) + string += concatenate(get_duration_code, [d / 10000 for d in range(0, 30 * 1000)]) + string += concatenate(get_duration_code, [d / 100000 for d in range(0, 30 * 1000)]) + + # frequency encoding + string += concatenate(get_frequency_code, + [16 , 20 , 25 , 31.5 , 40 , 50 , 63 , 80 , 100 , 125 , + 160 , 200 , 250 , 315 , 400 , 500 , 630 , 800 , 1000 , 1250 , + 1600 , 2000 , 2500 , 3150 , 4000 , 5000 , 6300 , 8000, 10000, 12500, + 16000, 20000, 25000, 31500, 40000]) + + # frequency hop encoding + string += concatenate(get_frequency_hop_code, [index for index in range(0, 9)]) + + # DSR encoding + string += concatenate(get_dsr_code, [math.pow(10, dsr / 10) for dsr in range(-150, -10 + 1)]) + + data = bitarray(string, endian='big') + + file = open('test_python.dat', 'wb') + data.tofile(file) + file.close() + + +def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): + # based on config_renderer.cfg + # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values + data = bitarray( + get_count_or_index_code(1) # fgdNrGrids + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(31) # fgdNrBands + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, + 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, + 20000.0 ]) + + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + + concatenate(get_duration_code, # RT60 + [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, + 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, + 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, + 0.60031 ]) + + + concatenate(get_dsr_code, # DSR + [ 1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, 8.9719e-08, 1.902e-07, + 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, + 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, + 2.6267e-08 ]) + + , endian='big') + + file = open('rend_config_renderer.dat', 'wb') + data.tofile(file) + file.close() + + +def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg(): + # based on config_hospital_patientroom.cfg + # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values + data = bitarray( + get_count_or_index_code(1) # fgdNrGrids + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(31) # fgdNrBands + + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, + 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, + 20000.0 ]) + + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.08163) # (input)Predelay + + + concatenate(get_duration_code, # RT60 + [ 0.81275, 0.61888, 0.45111, 0.34672, 0.46683, 0.53987, 0.61874, 0.70291, 0.66657, 0.73037, + 0.75090, 0.72470, 0.75486, 0.75857, 0.76844, 0.74999, 0.77622, 0.78227, 0.77441, 0.74688, + 0.73521, 0.73782, 0.71928, 0.71708, 0.71465, 0.60592, 0.52031, 0.51768, 0.52102, 0.37956, + 0.30786 ]) + + + concatenate(get_dsr_code, # DSR + [ 0.000219780698, 0.000205275364, 7.18711e-05, 4.5745977e-05, 8.381106e-06, 6.884964e-06, 6.532765e-06, 8.296928e-06, 1.0005793e-05, 9.191127e-06, + 8.635287e-06, 9.627704e-06, 1.0806965e-05, 1.0041916e-05, 7.77047e-06, 9.695803e-06, 9.594324e-06, 8.32215e-06, 7.564813e-06, 6.215871e-06, + 6.379496e-06, 6.358105e-06, 6.6696e-06, 6.369334e-06, 6.378474e-06, 3.339913e-06, 3.129318e-06, 2.892564e-06, 6.00202e-07, 3.40124e-07, + 3.37705e-07 ]) + + , endian='big') + + file = open('rend_config_hospital_patientroom.dat', 'wb') + data.tofile(file) + file.close() + + +def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): + # based on config_recreation.cfg + # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values + data = bitarray( + get_count_or_index_code(1) # fgdNrGrids + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(31) # fgdNrBands + + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, + 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, + 20000.0 ]) + + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(0) # FreqGridID + + get_duration_code(0.43031) # (input)Predelay + + + concatenate(get_duration_code, # RT60 + [ 4.51916, 4.89553, 4.83276, 5.00198, 5.34468, 5.76026, 6.36818, 6.95503, 7.27557, 7.62559, + 8.08892, 8.16002, 8.13900, 8.17919, 8.16280, 8.46226, 9.61806, 9.93048, 9.81353, 8.59340, + 8.38885, 8.36823, 6.51845, 3.76089, 3.75374, 3.57451, 1.28724, 1.22174, 1.22448, 1.71631, + 2.14343 ]) + + + concatenate(get_dsr_code, # DSR + [ 9.18578e-07, 7.63803e-07, 9.23183e-07, 1.048656e-06, 1.61449e-06, 2.13745e-06, 2.854805e-06, 3.979651e-06, 6.229977e-06, 7.782421e-06, + 9.091754e-06, 8.545798e-06, 7.482083e-06, 7.351071e-06, 7.947039e-06, 8.152676e-06, 5.201189e-06, 4.744103e-06, 4.397069e-06, 3.017449e-06, + 2.958383e-06, 2.725911e-06, 7.94912e-07, 6.20198e-07, 5.71181e-07, 5.5546e-08, 1.3987e-08, 1.338e-08, 1.322e-09, 1.3e-11, + 4e-12 ]) + + , endian='big') + + file = open('rend_config_recreation.dat', 'wb') + data.tofile(file) + file.close() + + +#test() +generate_reverb_payload_equivalent_to_rend_config_renderer_cfg() +generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() +generate_reverb_payload_equivalent_to_rend_config_recreation_cfg() diff --git a/scripts/testv/rend_config_hospital_patientroom.dat b/scripts/testv/rend_config_hospital_patientroom.dat new file mode 100644 index 0000000000..20455a95b7 --- /dev/null +++ b/scripts/testv/rend_config_hospital_patientroom.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3b4cf6b770f85bc82129901324078afc0953661b3ff753796d7d4bd15d8c468 +size 136 diff --git a/scripts/testv/rend_config_recreation.dat b/scripts/testv/rend_config_recreation.dat new file mode 100644 index 0000000000..456eedbbf7 --- /dev/null +++ b/scripts/testv/rend_config_recreation.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cb9adc877960d2a7e827126c2f44612569e5554e974b5bb98d3be92cb1ee14a +size 149 diff --git a/scripts/testv/rend_config_renderer.dat b/scripts/testv/rend_config_renderer.dat new file mode 100644 index 0000000000..6ea8ed4f1d --- /dev/null +++ b/scripts/testv/rend_config_renderer.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7941266900de8753e847cfef95298b5ee529e3f8f90ca5421ba46d71bc353821 +size 130 -- GitLab From 86ec9deca5a28914eea62afe973dabda01278ae0 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Thu, 6 Apr 2023 18:00:20 +0200 Subject: [PATCH 0081/1418] Corrected renderer.c command line parsing, added missing #ifdef guards --- apps/decoder.c | 8 ++++++++ apps/renderer.c | 5 +++++ lib_com/options.h | 2 +- scripts/config/self_test.prm | 16 ++++++++-------- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index d3aa314f5f..3357eda4b8 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -283,7 +283,11 @@ int main( if ( arg.enableReferenceRotation ) { /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) +#else + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -310,7 +314,11 @@ int main( if ( arg.enableReferenceVectorTracking ) { /* sanity check */ +#ifdef COMMAND_LINE_OPTION_LATE_REVERB if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_REVERB ) +#else + if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) +#endif { fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 03b2398947..0a2dd702f7 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1467,8 +1467,13 @@ static bool parseOrientationTracking( static IVAS_REND_AudioConfig parseAudioConfig( const char *configString ) { +#ifdef COMMAND_LINE_OPTION_LATE_REVERB + char charBuf[16]; + charBuf[15] = '\0'; +#else char charBuf[14]; charBuf[13] = '\0'; +#endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; diff --git a/lib_com/options.h b/lib_com/options.h index 08ed5c4991..192e31e482 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -141,7 +141,7 @@ #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 CONTROL_METADATA_REVERB /* Philips: renderer configuration change to binary format */ +#define CONTROL_METADATA_REVERB /* Philips: renderer configuration change to binary format */ #define COMMAND_LINE_OPTION_LATE_REVERB /* Philips: late reverb command line option */ #define FIX_103_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ /*#define SBA_HPF_TUNING_DEC*/ diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index f01861eaf3..b56bcff2d8 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -907,35 +907,35 @@ ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv51MC48c.wav_MC51_256000_48-48_MC_custom_setup.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config hospital_patientroom +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config hospital_patientroom ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config recreation +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config recreation ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_recreation.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst -// Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1_2 512000 48 testv/stv512MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst -// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst -- GitLab From 1b9e750b9f24208e15e8d8cd64547d222226a14c Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Tue, 11 Apr 2023 06:49:44 -0400 Subject: [PATCH 0082/1418] just remove option2 as it didn't show significative improvement --- lib_com/ivas_stereo_td_bit_alloc.c | 2 +- lib_enc/ivas_stereo_classifier.c | 1 - lib_enc/ivas_stereo_td_enc.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index b0ae12ecd8..5daaf61e12 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -139,7 +139,7 @@ void tdm_bit_alloc( *total_brate_sec = tdm_bit_allc_tbl[idx][coder_type]; /* secondary channel bitrate allocation based on the energy scaling ratio */ -#ifdef OMASA_TUNING +#if defined OMASA_TUNING if ( (IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( IsOmasa == 1 && coder_type > UNVOICED ) ) diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index 8e20c13c8a..534dc2189c 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -209,7 +209,6 @@ int16_t select_stereo_mode( set_f( hStereoClassif->xtalk_fv, -1.0f, SSC_MAX_NFEA ); } } - #ifdef DEBUG_MODE_TD dbgwrite( &hStereoClassif->unclr_decision, sizeof( int16_t ), 1, L_FRAME16k, "res/unclr_decision.enc" ); dbgwrite( &hStereoClassif->xtalk_decision, sizeof( int16_t ), 1, L_FRAME16k, "res/xtalk_decision.enc" ); diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 6e13ec2075..11da8f6404 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -430,6 +430,7 @@ void tdm_configure_enc( sts[1]->coder_type = GENERIC; } hStereoTD->tdm_lp_reuse_flag = 1; + #ifdef OMASA_TUNING if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 11000 ) #else -- GitLab From 4f30e166afc2d359b756ece40a960aa29014dae2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 11 Apr 2023 16:19:47 +0200 Subject: [PATCH 0083/1418] - rename compilation switch OMASA_TUNING to OMASA_TUNING_TD_STEREO - revert changes in MSVC project files --- Workspace_msvc/decoder.vcxproj | 6 +++--- Workspace_msvc/encoder.vcxproj | 8 ++++---- Workspace_msvc/lib_com.vcxproj | 8 ++++---- Workspace_msvc/lib_debug.vcxproj | 8 ++++---- Workspace_msvc/lib_dec.vcxproj | 8 ++++---- Workspace_msvc/lib_enc.vcxproj | 8 ++++---- Workspace_msvc/lib_rend.vcxproj | 8 ++++---- Workspace_msvc/lib_util.vcxproj | 8 ++++---- Workspace_msvc/renderer.vcxproj | 8 ++++---- lib_com/ivas_prot.h | 16 ++++++++-------- lib_com/ivas_stereo_td_bit_alloc.c | 11 +++++------ lib_com/options.h | 2 +- lib_dec/ivas_cpe_dec.c | 9 +++++---- lib_dec/ivas_stereo_td_dec.c | 12 +++++++----- lib_enc/ivas_cpe_enc.c | 10 ++++++---- lib_enc/ivas_stereo_td_analysis.c | 10 ++++++---- lib_enc/ivas_stereo_td_enc.c | 16 +++++++++------- 17 files changed, 82 insertions(+), 74 deletions(-) diff --git a/Workspace_msvc/decoder.vcxproj b/Workspace_msvc/decoder.vcxproj index f0016965e0..e59992847c 100644 --- a/Workspace_msvc/decoder.vcxproj +++ b/Workspace_msvc/decoder.vcxproj @@ -14,18 +14,18 @@ decoder {E3DCBC31-7FC9-D127-E000-529F8460D5FD} decoder - 10.0 + 10.0.17763.0 Application - v142 + v141 false MultiByte Application - v142 + v141 false MultiByte diff --git a/Workspace_msvc/encoder.vcxproj b/Workspace_msvc/encoder.vcxproj index fc7e189560..bcfe92a4db 100644 --- a/Workspace_msvc/encoder.vcxproj +++ b/Workspace_msvc/encoder.vcxproj @@ -18,24 +18,24 @@ encoder {B3FC9DFC-7268-8660-7C0D-B60BAF02C554} encoder - 10.0 + 10.0.17763.0 Application - v142 + v141 false MultiByte Application - v142 + v141 false MultiByte Application - v142 + v141 false MultiByte diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index ed8012c4d3..78ed7bb39d 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -17,24 +17,24 @@ {39EC200D-7795-4FF8-B214-B24EDA5526AE} common - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index 6a5e102b0c..3b648fae04 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -17,22 +17,22 @@ {54509728-928B-44D9-A118-A6F92F08B34F} debug - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 MultiByte StaticLibrary - v142 + v141 MultiByte StaticLibrary - v142 + v141 MultiByte true diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index facb2d3bc3..dd2ed44443 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -18,24 +18,24 @@ lib_dec {E822DDAF-0F5F-4CD0-A694-38AE69DE74D3} evs_dec - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index eede51cfde..af7ca35b12 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -18,24 +18,24 @@ lib_enc {824DA4CF-06F0-45C9-929A-8792F0E19C3E} evs_enc - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 1cb397d10f..865652649a 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -18,24 +18,24 @@ lib_rend {718DE063-A18B-BB72-9150-62B892E6FFA6} evs_dec - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte StaticLibrary - v142 + v141 false MultiByte diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index d1a1a8d818..5b5e5f30cc 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -17,22 +17,22 @@ {2FA8F384-0775-F3B7-F8C3-85209222FC70} utility - 10.0 + 10.0.17763.0 StaticLibrary - v142 + v141 MultiByte StaticLibrary - v142 + v141 MultiByte StaticLibrary - v142 + v141 MultiByte true diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj index d90b4a6251..94ad9f774e 100644 --- a/Workspace_msvc/renderer.vcxproj +++ b/Workspace_msvc/renderer.vcxproj @@ -18,24 +18,24 @@ renderer {12B4C8A5-1E06-4E30-B443-D1F916F52B47} renderer - 10.0 + 10.0.17763.0 Application - v142 + v141 false MultiByte Application - v142 + v141 false MultiByte Application - v142 + v141 false MultiByte diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 61a40222ed..0964ffe870 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1825,8 +1825,8 @@ int16_t stereo_tdm_ener_analysis( const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ -#ifdef OMASA_TUNING - ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#ifdef OMASA_TUNING_TD_STEREO + ,const int16_t isOmasa /* i : flag that indicates OMASA format */ #endif ); @@ -1849,8 +1849,8 @@ void tdm_configure_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#ifdef OMASA_TUNING_TD_STEREO + ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ #endif ); @@ -1906,8 +1906,8 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#ifdef OMASA_TUNING_TD_STEREO + ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ #endif ); @@ -1932,8 +1932,8 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx /* i : instantaneous correlation ratio index */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : Flag that indicates presence of OMASA */ +#ifdef OMASA_TUNING_TD_STEREO + ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ #endif ); diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 5daaf61e12..ac56cd6537 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -88,8 +88,9 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx_ref /* i : instantaneous correlation ratio idx */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : Flag that indicates presence of OMASA */ +#ifdef OMASA_TUNING_TD_STEREO + , + const int16_t IsOmasa /* i : flag that indicates OMASA format */ #endif ) { @@ -139,10 +140,8 @@ void tdm_bit_alloc( *total_brate_sec = tdm_bit_allc_tbl[idx][coder_type]; /* secondary channel bitrate allocation based on the energy scaling ratio */ -#if defined OMASA_TUNING - if ( (IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) - || - ( IsOmasa == 1 && coder_type > UNVOICED ) ) +#ifdef OMASA_TUNING_TD_STEREO + if ( ( IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( IsOmasa == 1 && coder_type > UNVOICED ) ) #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) #endif diff --git a/lib_com/options.h b/lib_com/options.h index ce6430957f..024ea86156 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,7 @@ #define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ #define OMASA_BRATE_SW /* VA: support of bitrate switching in OMASA format */ #define FIX_TD5_IN_OMASA // do not transmit extended MD in OMASA -#define OMASA_TUNING +#define OMASA_TUNING_TD_STEREO /* VA: tuning of TD stereo in OMASA format */ #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index f42dfe42e7..d1495e7f91 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -413,11 +413,12 @@ ivas_error ivas_cpe_dec( { if ( !st_ivas->bfi ) { - tdm_configure_dec( hCPE, &tdm_ratio_idx, nb_bits_metadata -#ifdef OMASA_TUNING - , (st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_24k4)) + tdm_configure_dec( hCPE, &tdm_ratio_idx, nb_bits_metadata +#ifdef OMASA_TUNING_TD_STEREO + , + ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_24k4 ) ) #endif - ); + ); sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC ); } diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 7cfa3d92fd..e613e8ea2e 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -87,8 +87,9 @@ void tdm_configure_dec( CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#ifdef OMASA_TUNING_TD_STEREO + , + const int16_t IsOmasa /* i : flag that indicates OMASA format*/ #endif ) @@ -313,10 +314,11 @@ void tdm_configure_dec( hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx -#ifdef OMASA_TUNING - ,IsOmasa +#ifdef OMASA_TUNING_TD_STEREO + , + IsOmasa #endif - ); + ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 0865e2b281..422d7f9156 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -414,8 +414,9 @@ ivas_error ivas_cpe_enc( { /* Determine the energy ratio between the 2 channels */ tdm_ratio_idx = stereo_tdm_ener_analysis( hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM -#ifdef OMASA_TUNING - , st_ivas->hOMasa != NULL +#ifdef OMASA_TUNING_TD_STEREO + , + st_ivas->hOMasa != NULL #endif ); @@ -584,8 +585,9 @@ ivas_error ivas_cpe_enc( tdm_ol_pitch_comparison( hCPE, pitch_fr, voicing_fr ); tdm_configure_enc( hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata -#ifdef OMASA_TUNING - ,st_ivas->hOMasa != NULL +#ifdef OMASA_TUNING_TD_STEREO + , + st_ivas->hOMasa != NULL #endif ); diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index 97522ef861..5ef8001b7a 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -115,8 +115,9 @@ int16_t stereo_tdm_ener_analysis( const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ -#ifdef OMASA_TUNING - ,const int16_t isOmasa /* i : Flag to indicate that Omasa is present */ +#ifdef OMASA_TUNING_TD_STEREO + , + const int16_t isOmasa /* i : flag that indicates OMASA format */ #endif ) { @@ -197,8 +198,9 @@ int16_t stereo_tdm_ener_analysis( * When the energies of channels are low enough, compute the ratio * of L and R needed to create new mono/side signals *----------------------------------------------------------------*/ -#ifdef OMASA_TUNING - if ( isOmasa ) + +#ifdef OMASA_TUNING_TD_STEREO + if ( isOmasa ) { if ( ( hCPE->hStereoClassif->lrtd_mode == 1 || hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 ) && ( hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus + hCPE->brate_surplus < 15000 ) ) diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 11da8f6404..82e3f4bdfd 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -309,8 +309,9 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING - ,const int16_t IsOmasa /* i : flag that indicate the presence of Omasa*/ +#ifdef OMASA_TUNING_TD_STEREO + , + const int16_t IsOmasa /* i : flag that indicates OMASA format */ #endif ) { @@ -425,13 +426,13 @@ void tdm_configure_enc( #ifdef MASA_AND_OBJECTS if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) { - if ( sts[1]->coder_type == UNVOICED) + if ( sts[1]->coder_type == UNVOICED ) { sts[1]->coder_type = GENERIC; } hStereoTD->tdm_lp_reuse_flag = 1; -#ifdef OMASA_TUNING +#ifdef OMASA_TUNING_TD_STEREO if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 11000 ) #else if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) @@ -488,10 +489,11 @@ void tdm_configure_enc( hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx -#ifdef OMASA_TUNING - ,IsOmasa +#ifdef OMASA_TUNING_TD_STEREO + , + IsOmasa #endif - ); + ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #endif -- GitLab From 6e84dd1c22ac89b7b8adbcb4504a8a1e46b1a199 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 18 Apr 2023 15:49:04 +0200 Subject: [PATCH 0084/1418] comment --- lib_enc/ivas_masa_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index dd025797d2..5e81132ced 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2315,11 +2315,12 @@ static void copy_masa_metadata( * Compare the similarity of MASA metadata in two sub-frames *-------------------------------------------------------------------*/ +/* r: similarity decision */ static uint8_t are_masa_subframes_similar( const MASA_METADATA_HANDLE frame1, /* i : MASA metadata frame 1 */ const uint8_t sf1_idx, /* i : index of the subframe of frame1 to inspect */ const MASA_METADATA_HANDLE frame2, /* i : MASA metadata frame 2 */ - const uint8_t sf2_idx /* o : index of the subframe of frame2 to inspect */ + const uint8_t sf2_idx /* i : index of the subframe of frame2 to inspect */ ) { uint8_t num_dir; -- GitLab From e71215d99e750557a18aa57573de637d6f19ec6c Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 19 Apr 2023 15:27:03 +0300 Subject: [PATCH 0085/1418] Disable switch for issue 350 to restore BE within OMASA until branch is fully adapted to it. --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 29d3c3340e..8bd854e1b4 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -144,7 +144,7 @@ #define FIX_103_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ /*#define SBA_HPF_TUNING_DEC*/ -#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ +/*#define FIX_350_MASA_DELAY_COMP*/ /* Nokia: Issue 350: MASA audio/meta delay compensation */ #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 */ -- GitLab From f404d857adc8f4ac419154e05ec25a3b75f91074 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Wed, 19 Apr 2023 17:32:17 +0200 Subject: [PATCH 0086/1418] Combined the use of text-based render configuration files and binary reverb configuration files --- apps/decoder.c | 9 ++- apps/renderer.c | 9 ++- lib_util/render_config_reader.c | 80 +++++++++++++------ lib_util/render_config_reader.h | 13 ++- scripts/config/self_test.prm | 16 ++-- .../rend_config_hospital_patientroom.cfg | 36 +-------- scripts/testv/rend_config_recreation.cfg | 36 +-------- scripts/testv/rend_config_renderer.cfg | 36 +-------- tests/renderer/test_renderer.py | 1 + 9 files changed, 85 insertions(+), 151 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3357eda4b8..f947498556 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -505,11 +505,7 @@ int main( goto cleanup; } -#ifdef CONTROL_METADATA_REVERB - if ( RenderConfigReader_read( renderConfigReader ) != IVAS_ERR_OK ) -#else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; @@ -521,6 +517,11 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); goto cleanup; } + if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + goto cleanup; + } #ifdef COMMAND_LINE_OPTION_LATE_REVERB if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_REVERB ) diff --git a/apps/renderer.c b/apps/renderer.c index 486f51b6a8..1c2f21e71f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -742,11 +742,7 @@ int main( exit( -1 ); } -#ifdef CONTROL_METADATA_REVERB - if ( RenderConfigReader_read( renderConfigReader ) != IVAS_ERR_OK ) -#else if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); @@ -758,6 +754,11 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); exit( -1 ); } + if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + exit( -1 ); + } #ifdef COMMAND_LINE_OPTION_LATE_REVERB if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) { diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index c6e68eae25..82ffb230a1 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -35,10 +35,9 @@ #include "prot.h" #ifdef CONTROL_METADATA_REVERB #include -#else +#endif #include #include "cmdl_tools.h" -#endif /*------------------------------------------------------------------------------------------* * PreProc Macros @@ -46,7 +45,9 @@ #ifndef CONTROL_METADATA_REVERB #define MAX_LINE_LENGTH ( 1024 ) -#define MAX_ITEM_LENGTH ( 64 ) +#endif +#define MAX_ITEM_LENGTH ( 64 ) +#ifndef CONTROL_METADATA_REVERB #define N_REVERB_VECTORS ( 3 ) #endif @@ -702,6 +703,7 @@ static int16_t read_bool( return true; } +#endif /*-----------------------------------------------------------------------------------------* * Function read_vector() @@ -823,7 +825,7 @@ static int32_t errorHandler( * Verifies if the configuration parameters lie within acceptable limits *------------------------------------------------------------------------------------------*/ -static ivas_error RenderConfigReader_checkValues( +ivas_error RenderConfigReader_checkValues( IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { @@ -908,7 +910,6 @@ static ivas_error RenderConfigReader_checkValues( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------------------------* * RenderConfigReader_open() @@ -933,17 +934,7 @@ ivas_error RenderConfigReader_open( return IVAS_ERR_FAILED_FILE_OPEN; } -#ifdef CONTROL_METADATA_REVERB - pConfigFile = fopen( pConfigPath, "rb" ); -#else - /* use corresponding .cfg file */ - length = strlen( pConfigPath ); - if ( length >= 4 && strcmp( &pConfigPath[length - 4], ".dat" ) == 0 ) - { - strcpy( &pConfigPath[length - 4], ".cfg" ); - } pConfigFile = fopen( pConfigPath, "r" ); -#endif if ( !pConfigFile ) { @@ -959,14 +950,15 @@ ivas_error RenderConfigReader_open( /*------------------------------------------------------------------------------------------* - * RenderConfigReader_read() + * RenderConfigReader_readReverb() * - * Reads the configuration from a file + * Reads the binary reverb configuration from a file *------------------------------------------------------------------------------------------*/ #ifdef CONTROL_METADATA_REVERB -ivas_error RenderConfigReader_read( - RenderConfigReader *pRenderConfigReader /* i/o : RenderConfigReader handle */ +static ivas_error RenderConfigReader_readReverb( + const char *pReverbConfigPath, /* i : Reverb configuration file path */ + RenderConfigReader *pRenderConfigReader /* i/o : RenderConfigReader handle */ ) { uint32_t file_size; @@ -977,11 +969,20 @@ ivas_error RenderConfigReader_read( uint32_t gridLen; uint32_t subGridLen; const float *pGrid; + FILE *pReverbConfigFile; + + /* Open the configuration file */ + pReverbConfigFile = fopen( pReverbConfigPath, "rb" ); + + if ( !pReverbConfigFile ) + { + return IVAS_ERR_FAILED_FILE_OPEN; + } /* Read the bitstream */ - fseek( pRenderConfigReader->pConfigFile, 0, SEEK_END ); - file_size = ftell( pRenderConfigReader->pConfigFile ); - rewind( pRenderConfigReader->pConfigFile ); + fseek( pReverbConfigFile, 0, SEEK_END ); + file_size = ftell( pReverbConfigFile ); + rewind( pReverbConfigFile ); pRenderConfigReader->pBitstream = (uint8_t *) malloc( file_size * sizeof( uint8_t ) ); if ( pRenderConfigReader->pBitstream == NULL ) @@ -989,7 +990,7 @@ ivas_error RenderConfigReader_read( return IVAS_ERR_FAILED_ALLOC; } - fread( pRenderConfigReader->pBitstream, sizeof( uint8_t ), file_size, pRenderConfigReader->pConfigFile ); + fread( pRenderConfigReader->pBitstream, sizeof( uint8_t ), file_size, pReverbConfigFile ); pRenderConfigReader->length = file_size; /****************************/ @@ -1250,7 +1251,8 @@ ivas_error RenderConfigReader_read( return IVAS_ERR_OK; } -#else +#endif + ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i/o : RenderConfigReader handle */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ @@ -1266,7 +1268,11 @@ ivas_error RenderConfigReader_read( char chapter[MAX_ITEM_LENGTH + 1]; char *pValue; int16_t nBandsInput; +#ifdef CONTROL_METADATA_REVERB + ivas_error error; +#else int16_t nVectorsMissing; +#endif fseek( pRenderConfigReader->pConfigFile, 0, SEEK_END ); file_size = ftell( pRenderConfigReader->pConfigFile ); @@ -1275,7 +1281,9 @@ ivas_error RenderConfigReader_read( pParams = (char *) calloc( file_size + 1, sizeof( char ) ); pTemp = (char *) calloc( file_size + 1, sizeof( char ) ); nBandsInput = hRenderConfig->room_acoustics.nBands; +#ifndef CONTROL_METADATA_REVERB nVectorsMissing = N_REVERB_VECTORS; +#endif /* read file line by line */ while ( fgets( pConfig_str, file_size, pRenderConfigReader->pConfigFile ) != NULL ) @@ -1308,6 +1316,7 @@ ivas_error RenderConfigReader_read( to_upper( chapter ); /* interpret params */ +#ifndef CONTROL_METADATA_REVERB if ( strcmp( chapter, "ROOMACOUSTICS" ) == 0 ) { params_idx = 0; @@ -1397,6 +1406,13 @@ ivas_error RenderConfigReader_read( } #ifdef DEBUGGING else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) +#endif +#else +#ifdef DEBUGGING + if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) +#endif +#endif +#ifdef DEBUGGING { params_idx = 0; pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); @@ -1426,6 +1442,15 @@ ivas_error RenderConfigReader_read( errorHandler( item, ERROR_VALUE_INVALID ); } } + if ( strcmp( item, "REVERBFILE" ) == 0 ) + { + // TODO: need to preserve file name case for non Windows OSes + if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK) + { + printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error ); + errorHandler( item, error ); + } + } #ifdef DEBUGGING else { @@ -1462,9 +1487,12 @@ ivas_error RenderConfigReader_read( fprintf( stderr, "Errors occurred\n" ); return IVAS_ERR_FAILED_FILE_PARSE; } - return RenderConfigReader_checkValues( hRenderConfig ); -} +#ifdef CONTROL_METADATA_REVERB + return IVAS_ERR_OK; +#else + RenderConfigReader_checkValues( hRenderConfig ); #endif +} #ifdef CONTROL_METADATA_REVERB /*------------------------------------------------------------------------------------------* diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index 53894f7043..d0d37d6fc3 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -51,25 +51,24 @@ ivas_error RenderConfigReader_open( RenderConfigReader **ppRenderConfigReader /* o : RenderConfigReader handle */ ); -/* Reads a configuration */ #ifdef CONTROL_METADATA_REVERB -ivas_error RenderConfigReader_read( - RenderConfigReader *pRenderConfigReader /* i : RenderConfigReader handle */ -); - /* Get an acoustic environment */ ivas_error RenderConfigReader_getAcousticEnvironment( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ uint16_t id, /* i : Acoustic environment ID */ IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pAcEnv /* o : Target acoustic environment pointer */ ); +/* Verifies configuration parameters */ +ivas_error RenderConfigReader_checkValues( + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ +); +#endif -#else +/* Reads a configuration */ ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); -#endif /* Closes the renderer configuration reader and deallocates memory */ void RenderConfigReader_close( diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index b56bcff2d8..8da3550e00 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -909,35 +909,35 @@ // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config hospital_patientroom ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_hospital_patientroom.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst +../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst // Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config recreation ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_recreation.dat BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst +../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst // Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1_2 512000 48 testv/stv512MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst // Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer ../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.dat BINAURAL_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst +../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst // Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, 7_1_4 out ../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit diff --git a/scripts/testv/rend_config_hospital_patientroom.cfg b/scripts/testv/rend_config_hospital_patientroom.cfg index 0ce43444ed..c00b642947 100644 --- a/scripts/testv/rend_config_hospital_patientroom.cfg +++ b/scripts/testv/rend_config_hospital_patientroom.cfg @@ -1,34 +1,2 @@ -[roomAcoustics] -reverb = true; -brir = false; -nBands = 31; - -fc = [20.0, 25.0, 31.5, 40.0, - 50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0, - 12500.0, 16000.0, 20000.0]; - -rt60 = [0.81275, 0.61888, 0.45111, 0.34672, - 0.46683, 0.53987, 0.61874, 0.70291, - 0.66657, 0.73037, 0.75090, 0.72470, - 0.75486, 0.75857, 0.76844, 0.74999, - 0.77622, 0.78227, 0.77441, 0.74688, - 0.73521, 0.73782, 0.71928, 0.71708, - 0.71465, 0.60592, 0.52031, 0.51768, - 0.52102, 0.37956, 0.30786]; - -dsr = [0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, - 7.943284e-06 , 6.3095763e-06, 6.3095763e-06, 7.943284e-06 , - 1e-05 , 1e-05 , 7.943284e-06 , 1e-05 , - 1e-05 , 1e-05 , 7.943284e-06 , 1e-05 , - 1e-05 , 7.943284e-06 , 7.943284e-06 , 6.3095763e-06, - 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, - 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, - 6.3095763e-07, 3.1622776e-07, 3.1622776e-07]; - -acousticPreDelay = 0.016; -inputPreDelay = 0.08163; \ No newline at end of file +[general] +reverbFile = scripts/testv/rend_config_hospital_patientroom.dat; diff --git a/scripts/testv/rend_config_recreation.cfg b/scripts/testv/rend_config_recreation.cfg index cc822d630c..cd5929919e 100644 --- a/scripts/testv/rend_config_recreation.cfg +++ b/scripts/testv/rend_config_recreation.cfg @@ -1,34 +1,2 @@ -[roomAcoustics] -reverb = true; -brir = false; -nBands = 31; - -fc = [20.0, 25.0, 31.5, 40.0, - 50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0, - 12500.0, 16000.0, 20000.0]; - -rt60 = [4.51916, 4.89553, 4.83276, 5.00198, - 5.34468, 5.76026, 6.36818, 6.95503, - 7.27557, 7.62559, 8.08892, 8.16002, - 8.13900, 8.17919, 8.16280, 8.46226, - 9.61806, 9.93048, 9.81353, 8.59340, - 8.38885, 8.36823, 6.51845, 3.76089, - 3.75374, 3.57451, 1.28724, 1.22174, - 1.22448, 1.71631, 2.14343]; - -dsr = [1e-06 , 7.943284e-07 , 1e-06 , 1e-06 , - 1.5848925e-06, 1.9952631e-06, 3.1622776e-06, 3.9810707e-06, - 6.3095763e-06, 7.943284e-06 , 1e-05 , 7.943284e-06 , - 7.943284e-06 , 7.943284e-06 , 7.943284e-06 , 7.943284e-06 , - 5.01187e-06 , 5.01187e-06 , 3.9810707e-06, 3.1622776e-06, - 3.1622776e-06, 2.511887e-06 , 7.943284e-07 , 6.3095763e-07, - 6.3095763e-07, 5.01187e-08 , 1.2589251e-08, 1.2589251e-08, - 1.2589265e-09, 1.2589266e-11, 3.981075e-12]; - -acousticPreDelay = 0.016; -inputPreDelay = 0.43031; +[general] +reverbFile = scripts/testv/rend_config_recreation.dat; diff --git a/scripts/testv/rend_config_renderer.cfg b/scripts/testv/rend_config_renderer.cfg index 442edf2506..86e2f181f4 100644 --- a/scripts/testv/rend_config_renderer.cfg +++ b/scripts/testv/rend_config_renderer.cfg @@ -1,34 +1,2 @@ -[roomAcoustics] -reverb = true; # Reverb switch, in case BRIR is undefined or false, reverb flag is inherited from the room flag -brir = false; -nBands = 31; - -fc = [20.0, 25.0, 31.5, 40.0, - 50.0, 63.0, 80.0, 100.0, - 125.0, 160.0, 200.0, 250.0, - 315.0, 400.0, 500.0, 630.0, - 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, - 5000.0, 6300.0, 8000.0, 10000.0, - 12500.0, 16000.0, 20000.0]; - -rt60 = [1.3622, 1.4486, 1.3168, 1.5787, - 1.4766, 1.3954, 1.2889, 1.3462, - 1.0759, 1.0401, 1.0970, 1.0850, - 1.0910, 1.0404, 1.0499, 1.0699, - 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, - 1.0421, 0.97822, 0.80487, 0.75944, - 0.71945, 0.61682, 0.60031]; - -dsr = [1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, - 1.2589251e-08, 1.9952632e-08, 2.511887e-08 , 3.9810708e-08, - 1e-07 , 1.9952633e-07, 3.981071e-07 , 6.3095763e-07, - 7.943284e-07 , 6.3095763e-07, 5.01187e-07 , 5.01187e-07 , - 6.3095763e-07, 6.3095763e-07, 7.943284e-07 , 6.3095763e-07, - 5.01187e-07 , 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, - 5.01187e-07 , 2.511887e-07 , 1.2589251e-07, 1e-07 , - 6.309576e-08 , 3.1622776e-08, 2.511887e-08]; - -acousticPreDelay = 0.016; -inputPreDelay = 0.1; \ No newline at end of file +[general] +reverbFile = scripts/testv/rend_config_renderer.dat; \ No newline at end of file diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 00ea239714..df8f67efcd 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -58,6 +58,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): # Test compares rendering with render config file containing just reverb defaults against rendering without config file. # These should be binary equivalent. +@pytest.mark.skip("disable until .cfg parsing is enabled again") @pytest.mark.parametrize("config_file", CONFIG_FILES_TO_TEST) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -- GitLab From d34332b6fe1b4b0fff45c990d7f76f2e32e53352 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Thu, 20 Apr 2023 10:13:54 +0300 Subject: [PATCH 0087/1418] Fixes to stereo, binaural_room, and edited rendering, and fixes to msan errors. --- lib_com/bitstream.c | 14 ++++++++++---- lib_dec/ivas_masa_dec.c | 4 ++++ lib_dec/lib_dec.c | 4 ++++ lib_rend/ivas_dirac_dec_binaural_functions.c | 17 +++++++++++------ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 3b11ab8c3d..ac201dffbc 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1979,17 +1979,22 @@ ivas_error preview_indices( else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { /* read number of objects from the bitstream */ +#ifdef OMASA_UPDATES + st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ + st_ivas->nchan_ism = 0; +#else st_ivas->nchan_transport = 0; +#endif if ( total_brate != SID_2k40 && total_brate != FRAME_NO_DATA ) { +#ifdef OMASA_UPDATES + st_ivas->nchan_ism = 2 * bit_stream[total_brate / FRAMES_PER_SEC - 1] + bit_stream[total_brate / FRAMES_PER_SEC - 2] + 1; +#endif st_ivas->ism_mode = ivas_omasa_ism_mode_select( total_brate, st_ivas->nchan_ism ); -#ifdef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else +#ifndef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { st_ivas->nchan_transport = 0; } @@ -2004,6 +2009,7 @@ ivas_error preview_indices( st_ivas->nchan_transport++; k--; } +#endif } } #endif diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 38ef2a4c06..959300ca74 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -2462,6 +2462,10 @@ void ivas_masa_ism_set_edited_objects( { hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism] = st_ivas->azimuth_edited; hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism] = st_ivas->elevation_edited; +#ifdef OMASA_UPDATES + st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->azimuth = st_ivas->azimuth_edited; + st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->elevation = st_ivas->elevation_edited; +#endif } } #ifdef OMASA_UPDATES diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index bcd93ece03..1826052808 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2026,7 +2026,11 @@ static ivas_error printConfigInfo_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifdef OMASA_UPDATES + fprintf( stdout, "Input configuration: combined ISM and MASA (%i ISM stream(s)) \n", st_ivas->nchan_ism ); +#else fprintf( stdout, "Input configuration: combined ISM and MASA (%i separated ISM stream(s)) \n", st_ivas->nchan_transport ); +#endif } #endif } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e219e5bd54..1e1e591508 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -467,6 +467,10 @@ static void ivas_dirac_dec_binaural_internal( { numInChannels++; } + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) + { + numInChannels += (uint8_t) st_ivas->nchan_ism; + } #else if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) { @@ -1220,6 +1224,13 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( } #endif } +#ifdef OMASA_UPDATES + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) + { + separateCenterChannelRendering = 1; + nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; + } +#endif #else separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; #endif @@ -1386,11 +1397,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES - aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism; - eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; - instantChange = 1; -#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB]; @@ -1402,7 +1408,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; instantChange = 1; } -#endif } for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) -- GitLab From 4ca9d699225f79593671fd8bf64f9f4492724da5 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Thu, 20 Apr 2023 17:39:04 +0200 Subject: [PATCH 0088/1418] Preserve binary reverb file path text case --- lib_util/render_config_reader.c | 41 +++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 82ffb230a1..2a12e5f552 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -825,7 +825,11 @@ static int32_t errorHandler( * Verifies if the configuration parameters lie within acceptable limits *------------------------------------------------------------------------------------------*/ +#ifdef CONTROL_METADATA_REVERB ivas_error RenderConfigReader_checkValues( +#else +static ivas_error RenderConfigReader_checkValues( +#endif IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { @@ -1404,22 +1408,35 @@ ivas_error RenderConfigReader_read( fprintf( stderr, "Reverb config: number of bands changed but configuration vectors missing\n" ); } } -#ifdef DEBUGGING else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) -#endif #else -#ifdef DEBUGGING if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) #endif -#endif -#ifdef DEBUGGING { params_idx = 0; pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { +#ifndef CONTROL_METADATA_REVERB params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); +#endif +#ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); +#endif +#ifdef CONTROL_METADATA_REVERB + if ( strcmp( item, "REVERBFILE" ) == 0 ) + { + /* get correct case file path */ + sscanf( pTemp + params_idx, "%*[^=] = %[^;];", pValue ); + if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK) + { + printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error ); + errorHandler( item, error ); + } + } + else +#endif +#ifdef DEBUGGING if ( strcmp( item, "RENDERER" ) == 0 ) { if ( strcmp( pValue, "CREND" ) == 0 ) @@ -1442,25 +1459,19 @@ ivas_error RenderConfigReader_read( errorHandler( item, ERROR_VALUE_INVALID ); } } - if ( strcmp( item, "REVERBFILE" ) == 0 ) - { - // TODO: need to preserve file name case for non Windows OSes - if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK) - { - printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error ); - errorHandler( item, error ); - } - } #ifdef DEBUGGING else { fprintf( stderr, "Unsupported configuration property %s\n", item ); } +#endif +#endif +#ifdef CONTROL_METADATA_REVERB + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #endif } free( pValue ); } -#endif else { fprintf( stderr, "Unknown chapter: %s\n", chapter ); -- GitLab From 2c8286b9473230e9f283fe73a2ef7804fe2183cb Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Mon, 24 Apr 2023 15:04:30 +0200 Subject: [PATCH 0089/1418] Make reverb configuration file path relative to render configuration file path --- apps/decoder.c | 2 +- apps/renderer.c | 2 +- lib_util/render_config_reader.c | 29 +++++++++++++++---- lib_util/render_config_reader.h | 1 + scripts/testv/config_directivity.cfg | 2 +- .../rend_config_hospital_patientroom.cfg | 2 +- scripts/testv/rend_config_recreation.cfg | 2 +- scripts/testv/rend_config_renderer.cfg | 2 +- 8 files changed, 31 insertions(+), 11 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index d24158a47a..f7da07e3fc 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -505,7 +505,7 @@ int main( goto cleanup; } - if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) + if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 46714ecbda..29cfd52993 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -731,7 +731,7 @@ int main( exit( -1 ); } - if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) + if ( RenderConfigReader_read( renderConfigReader, args.renderConfigFilePath, &renderConfig ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2a12e5f552..813916ad2e 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -1259,6 +1259,7 @@ static ivas_error RenderConfigReader_readReverb( ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i/o : RenderConfigReader handle */ + const char *pRenderConfigPath, /* i : Renderer configuration file path */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { @@ -1274,6 +1275,8 @@ ivas_error RenderConfigReader_read( int16_t nBandsInput; #ifdef CONTROL_METADATA_REVERB ivas_error error; + int32_t params_length; + int32_t length; #else int16_t nVectorsMissing; #endif @@ -1417,7 +1420,9 @@ ivas_error RenderConfigReader_read( pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { -#ifndef CONTROL_METADATA_REVERB +#ifdef CONTROL_METADATA_REVERB + params_length = (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); +#else params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); #endif #ifdef DEBUGGING @@ -1426,13 +1431,27 @@ ivas_error RenderConfigReader_read( #ifdef CONTROL_METADATA_REVERB if ( strcmp( item, "REVERBFILE" ) == 0 ) { - /* get correct case file path */ + /* get correct case reverb configuration file path */ sscanf( pTemp + params_idx, "%*[^=] = %[^;];", pValue ); - if ( ( error = RenderConfigReader_readReverb(pValue, pRenderConfigReader) ) != IVAS_ERR_OK) + + /* make reverb configuration file path relative to render configuration file path */ + for ( length = (int32_t) strlen( pRenderConfigPath ) - 1; length >= 0; length-- ) + { + if ( pRenderConfigPath[length] == '\\' || pRenderConfigPath[length] == '/' ) + { + length++; + break; + } + } + char *pCombinedName = calloc( length + (int32_t) strlen( pValue ) + 1, sizeof( char ) ); + strncpy( pCombinedName, pRenderConfigPath, length ); + strcpy( pCombinedName + length, pValue ); + + if ( ( error = RenderConfigReader_readReverb( pCombinedName, pRenderConfigReader ) ) != IVAS_ERR_OK ) { - printf( "RenderConfigReader_readReverb(%s) returned %d\n", pValue, error ); errorHandler( item, error ); } + free( pCombinedName ); } else #endif @@ -1467,7 +1486,7 @@ ivas_error RenderConfigReader_read( #endif #endif #ifdef CONTROL_METADATA_REVERB - params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += params_length; #endif } free( pValue ); diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index d0d37d6fc3..e108f0297d 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -67,6 +67,7 @@ ivas_error RenderConfigReader_checkValues( /* Reads a configuration */ ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + const char *pRenderConfigPath, /* i : Renderer configuration file path */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); diff --git a/scripts/testv/config_directivity.cfg b/scripts/testv/config_directivity.cfg index 94807d688c..77f392ca7c 100644 --- a/scripts/testv/config_directivity.cfg +++ b/scripts/testv/config_directivity.cfg @@ -1,3 +1,3 @@ [general] directivity = [0.0, 360.0, 0.2512]; - +reverbFile = rend_config_renderer.dat; diff --git a/scripts/testv/rend_config_hospital_patientroom.cfg b/scripts/testv/rend_config_hospital_patientroom.cfg index c00b642947..75bfdf910f 100644 --- a/scripts/testv/rend_config_hospital_patientroom.cfg +++ b/scripts/testv/rend_config_hospital_patientroom.cfg @@ -1,2 +1,2 @@ [general] -reverbFile = scripts/testv/rend_config_hospital_patientroom.dat; +reverbFile = rend_config_hospital_patientroom.dat; diff --git a/scripts/testv/rend_config_recreation.cfg b/scripts/testv/rend_config_recreation.cfg index cd5929919e..d91064856c 100644 --- a/scripts/testv/rend_config_recreation.cfg +++ b/scripts/testv/rend_config_recreation.cfg @@ -1,2 +1,2 @@ [general] -reverbFile = scripts/testv/rend_config_recreation.dat; +reverbFile = rend_config_recreation.dat; diff --git a/scripts/testv/rend_config_renderer.cfg b/scripts/testv/rend_config_renderer.cfg index 86e2f181f4..cbada86bec 100644 --- a/scripts/testv/rend_config_renderer.cfg +++ b/scripts/testv/rend_config_renderer.cfg @@ -1,2 +1,2 @@ [general] -reverbFile = scripts/testv/rend_config_renderer.dat; \ No newline at end of file +reverbFile = rend_config_renderer.dat; \ No newline at end of file -- GitLab From 9649dad5232f5eabca597721934243e9890435ca Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 12:29:34 +0200 Subject: [PATCH 0090/1418] fix build when MASA_AND_OBJECTS is disabled --- lib_com/options.h | 10 +++++----- lib_dec/ivas_cpe_dec.c | 2 ++ lib_dec/ivas_sce_dec.c | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8bd854e1b4..f5f9f9d214 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,13 +58,13 @@ #ifdef DEBUGGING -#define DEBUG_MODE_INFO /* output most important parameters to the subdirectory "res/" */ +/*#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_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_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/" */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index f78f5f08c8..12bcab4584 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -597,12 +597,14 @@ ivas_error ivas_cpe_dec( dbgwrite( output[j], sizeof( float ), output_frame, 1, fname( debug_dir, "output.cpe", j, cpe_id, DEC ) ); } +#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) { tmpF = 0; dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.sce", 0, cpe_id, DEC ) ); dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, cpe_id, DEC ) ); } +#endif } } #endif diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index ccb5fcca89..dc44097d9d 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -326,12 +326,14 @@ ivas_error ivas_sce_dec( dbgwrite( output, sizeof( float ), output_frame, 1, fname( debug_dir, "output.sce", 0, sce_id, DEC ) ); +#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) { tmpF = 0; dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.cpe", 0, sce_id, DEC ) ); dbgwrite( &tmpF, sizeof( float ), 1, output_frame, fname( debug_dir, "output.mct", 0, sce_id, DEC ) ); } +#endif } } #endif -- GitLab From 8d38e91d2277806687070c44d9c38cfbdb70307e Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 12:32:04 +0200 Subject: [PATCH 0091/1418] fix in tdm_configure_dec() within MASA_AND_OBJECTS --- lib_dec/ivas_stereo_td_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index e613e8ea2e..fbfa270727 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -291,7 +291,7 @@ void tdm_configure_dec( /* set the BW of the secondary channel */ #ifdef MASA_AND_OBJECTS - if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel > IVAS_16k4 / FRAMES_PER_SEC ) + if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel >= IVAS_16k4 / FRAMES_PER_SEC ) #else if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 ) #endif -- GitLab From d5025ce2109d4e1934b148b311443a2b3690c4e2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 12:34:40 +0200 Subject: [PATCH 0092/1418] clang-format --- lib_dec/ivas_dirac_dec.c | 82 ++++++++++++++++----------------- lib_dec/ivas_ism_metadata_dec.c | 12 ++--- lib_dec/ivas_ism_renderer.c | 6 +-- lib_enc/ivas_cpe_enc.c | 4 +- lib_enc/ivas_enc.c | 4 +- lib_enc/ivas_stereo_td_enc.c | 4 +- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index e471738ca3..e2bf03e4fb 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -321,7 +321,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->masa_stereo_type_detect = (MASA_STEREO_TYPE_DETECT *) malloc( sizeof( MASA_STEREO_TYPE_DETECT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } ivas_masa_init_stereotype_detection( hDirAC->masa_stereo_type_detect ); } @@ -401,7 +401,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } if ( hDirAC->num_outputs_dir != num_outputs_dir_old && flag_config == DIRAC_RECONFIGURE ) @@ -410,7 +410,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_dir = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_s( hDirAC->proto_index_dir, 0, hDirAC->num_outputs_dir ); @@ -420,7 +420,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_s( hDirAC->proto_index_diff, 0, hDirAC->num_outputs_diff ); @@ -543,7 +543,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } /* reallocate static memory */ else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->num_outputs_dir != num_outputs_dir_old ) @@ -553,7 +553,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } if ( ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_LS ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) ) @@ -574,7 +574,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->hoa_encoder && ( hDirAC->num_outputs_diff != num_outputs_diff_old ) ) { @@ -583,7 +583,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_f( hDirAC->hoa_encoder, 0.0f, nchan_out_woLFE * hDirAC->num_outputs_diff ); compute_hoa_encoder_mtx( ls_azimuth, ls_elevation, hDirAC->hoa_encoder, hDirAC->num_outputs_diff, hDirAC->hOutSetup.ambisonics_order ); @@ -673,17 +673,17 @@ ivas_error ivas_dirac_dec_config( if ( ( flag_config == DIRAC_OPEN && hDirAC->proto_signal_decorr_on ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->proto_signal_decorr_on && !proto_signal_decorr_on_old ) ) ) { if ( ( error = ivas_dirac_dec_decorr_open( &( hDirAC->h_freq_domain_decorr_ap_params ), - &( hDirAC->h_freq_domain_decorr_ap_state ), - hDirAC->num_freq_bands, - hDirAC->num_outputs_diff, - hDirAC->num_protos_diff, - hDirAC->synthesisConf, - hDirAC->frequency_axis, - nchan_transport > 2 ? 4 : nchan_transport, + &( hDirAC->h_freq_domain_decorr_ap_state ), + hDirAC->num_freq_bands, + hDirAC->num_outputs_diff, + hDirAC->num_protos_diff, + hDirAC->synthesisConf, + hDirAC->frequency_axis, + nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK ) { return error; - } + } } else if ( flag_config == DIRAC_RECONFIGURE && ( !hDirAC->proto_signal_decorr_on && proto_signal_decorr_on_old ) ) { @@ -697,19 +697,19 @@ ivas_error ivas_dirac_dec_config( ivas_dirac_dec_decorr_close( &hDirAC->h_freq_domain_decorr_ap_params, &hDirAC->h_freq_domain_decorr_ap_state ); if ( ( error = ivas_dirac_dec_decorr_open( &( hDirAC->h_freq_domain_decorr_ap_params ), - &( hDirAC->h_freq_domain_decorr_ap_state ), - hDirAC->num_freq_bands, - hDirAC->num_outputs_diff, - hDirAC->num_protos_diff, - hDirAC->synthesisConf, - hDirAC->frequency_axis, - nchan_transport > 2 ? 4 : nchan_transport, + &( hDirAC->h_freq_domain_decorr_ap_state ), + hDirAC->num_freq_bands, + hDirAC->num_outputs_diff, + hDirAC->num_protos_diff, + hDirAC->synthesisConf, + hDirAC->frequency_axis, + nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK ) { return error; + } } } - } /* output synthesis */ if ( flag_config == DIRAC_OPEN ) @@ -755,7 +755,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } else if ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->num_protos_diff != num_protos_diff_old ) ) { @@ -764,9 +764,9 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } } } - } if ( flag_config == DIRAC_OPEN ) @@ -793,7 +793,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->buffer_energy = (float *) malloc( DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_f( hDirAC->buffer_energy, 0.0f, DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX ); } @@ -1329,9 +1329,9 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->frame_dec_f = (float *) malloc( sizeof( float ) * 2 * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } - } hDirAC->h_output_synthesis_psd_state.proto_power_smooth = hDirAC_mem->proto_power_smooth; hDirAC->h_output_synthesis_psd_state.proto_power_diff_smooth = hDirAC_mem->proto_power_diff_smooth; hDirAC->h_output_synthesis_psd_state.cy_auto_dir_smooth = hDirAC_mem->cy_auto_dir_smooth; @@ -1388,17 +1388,17 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * size ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } } else { if ( ( hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } } - } hDirAC->h_output_synthesis_psd_state.proto_direct_buffer_f = hDirAC_mem->proto_direct_buffer_f; hDirAC->h_output_synthesis_psd_state.proto_diffuse_buffer_f = hDirAC_mem->proto_diffuse_buffer_f; @@ -1410,7 +1410,7 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->direct_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } if ( ( hDirAC_mem->diffuse_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) { @@ -1435,10 +1435,10 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } } - } else { if ( num_protos_dir > 2 ) @@ -1446,7 +1446,7 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->reference_power = (float *) malloc( sizeof( float ) * 5 * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } } if ( hDirAC->proto_signal_decorr_on ) @@ -1454,9 +1454,9 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * 2 * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } - } return IVAS_ERR_OK; } @@ -1755,10 +1755,10 @@ void ivas_qmetadata_to_dirac( { meta_write_index = ( hDirAC->dirac_bs_md_write_idx + block ) % hDirAC->dirac_md_buffer_length; - for ( band = 0; band < hMasa->config.numCodingBands; ++band ) - { - for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + for ( band = 0; band < hMasa->config.numCodingBands; ++band ) { + for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + { hDirAC->azimuth[meta_write_index][b] = (int16_t) q_direction->band_data[band].azimuth[block]; hDirAC->elevation[meta_write_index][b] = (int16_t) q_direction->band_data[band].elevation[block]; hDirAC->energy_ratio1[meta_write_index][b] = q_direction->band_data[band].energy_ratio[block]; @@ -1827,10 +1827,10 @@ void ivas_qmetadata_to_dirac( { meta_write_index = ( hDirAC->dirac_bs_md_write_idx + block ) % hDirAC->dirac_md_buffer_length; - for ( band = 0; band < hMasa->config.numCodingBands; ++band ) - { - for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + for ( band = 0; band < hMasa->config.numCodingBands; ++band ) { + for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + { hDirAC->azimuth2[meta_write_index][b] = (int16_t) q_direction->band_data[band].azimuth[block]; hDirAC->elevation2[meta_write_index][b] = (int16_t) q_direction->band_data[band].elevation[block]; hDirAC->energy_ratio2[meta_write_index][b] = q_direction->band_data[band].energy_ratio[block]; @@ -1883,7 +1883,7 @@ void ivas_qmetadata_to_dirac( set_s( hDirAC->elevation2[meta_write_index], 0, hDirAC->num_freq_bands ); set_zero( hDirAC->energy_ratio2[meta_write_index], hDirAC->num_freq_bands ); set_zero( hDirAC->spreadCoherence2[meta_write_index], hDirAC->num_freq_bands ); - } + } } #endif } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 1cc7028c55..0565447847 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -396,8 +396,8 @@ ivas_error ivas_ism_metadata_dec( if ( ism_metadata_flag_global ) { /*----------------------------------------------------------------* - * Metadata decoding and dequantization, loop over all objects - *----------------------------------------------------------------*/ + * Metadata decoding and dequantization, loop over all objects + *----------------------------------------------------------------*/ int16_t total_bits_metadata = 0, bits_metadata_ism = 0; int16_t nb_bits_objcod_read; @@ -732,8 +732,8 @@ ivas_error ivas_ism_metadata_dec( } /*----------------------------------------------------------------* - * Set bitsream pointers - *----------------------------------------------------------------*/ + * Set bitsream pointers + *----------------------------------------------------------------*/ /* set the bitstream pointer to its original position */ st0->bit_stream = bstr_orig; @@ -747,8 +747,8 @@ ivas_error ivas_ism_metadata_dec( #ifdef DISCRETE_ISM_DTX_CNG /*----------------------------------------------------------------* - * Updates - *----------------------------------------------------------------*/ + * Updates + *----------------------------------------------------------------*/ set_s( md_diff_flag, 1, nchan_ism ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 00d93d15b6..119845d462 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -256,8 +256,8 @@ void ivas_ism_get_stereo_gains( #ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------------* -* ivas_masa_ism_separate_object_renderer_open() -* + * ivas_masa_ism_separate_object_renderer_open() + * * Open structures, reserve memory, and init values. *-------------------------------------------------------------------------*/ @@ -348,7 +348,7 @@ void ivas_masa_ism_separate_object_render( lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; #ifdef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 490cd41d1e..bfa7d86756 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -820,7 +820,7 @@ ivas_error ivas_cpe_enc( dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_NCShift" ); dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_ica_gD" ); n = -1; - //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + // dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } else if ( hCPE->element_mode == IVAS_CPE_TD ) { @@ -837,7 +837,7 @@ ivas_error ivas_cpe_enc( else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { n = -2; - //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + // dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 5d329701cb..920193c999 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -249,7 +249,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ) ) != IVAS_ERR_OK ) { @@ -459,7 +459,7 @@ ivas_error ivas_enc( if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 82e3f4bdfd..7c0649c5ab 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -283,8 +283,8 @@ ivas_error stereo_set_tdm( dbgwrite( &tmp, 2, 1, 320, "res/inst_ratio_L" ); dbgwrite( &ftmp, 4, 1, 320, "res/ratio_L" ); dbgwrite( &tmp, 2, 1, 320, "res/tdm_low_rate_mode" ); - //dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); - //dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); + // dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); + // dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); } #endif hCPE->hCoreCoder[0]->tdm_LRTD_flag = 0; -- GitLab From b12b6b9a5cd566d1778323c0c7f1d148f8f2f4cc Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 12:37:50 +0200 Subject: [PATCH 0093/1418] build warnings --- lib_enc/ivas_masa_enc.c | 4 ++-- lib_enc/ivas_omasa_enc.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 5e81132ced..c62fc4b3bf 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -71,7 +71,7 @@ static void quantize_ratio_ism_vector( const float *ratio_ism, int16_t *idx, con static int16_t index_slice_enum( const int16_t *ratio_ism_idx, const int16_t nchan_ism ); -static int16_t encode_ratio_ism_subframe( const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t sf, const int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); +static int16_t encode_ratio_ism_subframe( const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const uint8_t numCodingBands, const int16_t sf, const int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); static void transform_index_and_GR_encode( int16_t *diff_idx, const int16_t len, const int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); @@ -3064,7 +3064,7 @@ static void estimate_bits_subband_ism_ratio( static int16_t encode_ratio_ism_subframe( const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, - const int16_t numCodingBands, + const uint8_t numCodingBands, const int16_t sf, const int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 86b5cbe90f..ac89c528a6 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -228,13 +228,11 @@ ivas_error ivas_omasa_enc_config( { int16_t k, sce_id, nSCE_old; int32_t ivas_total_brate, ism_total_brate; - ISM_MODE ism_mode_old; ENCODER_CONFIG_HANDLE hEncoderConfig; ivas_error error; hEncoderConfig = st_ivas->hEncoderConfig; ivas_total_brate = hEncoderConfig->ivas_total_brate; - ism_mode_old = st_ivas->ism_mode; nSCE_old = st_ivas->nSCE; st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, hEncoderConfig->nchan_ism ); -- GitLab From a0fdc85f356f42c6c7383d8cdddc33912839b683 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 13:12:25 +0200 Subject: [PATCH 0094/1418] build warnings --- lib_enc/ivas_masa_enc.c | 45 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index c62fc4b3bf..67c935d187 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -67,20 +67,6 @@ static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_H #endif ); -static void quantize_ratio_ism_vector( const float *ratio_ism, int16_t *idx, const int16_t nchan_ism, const float masa_to_total_energy_ratio, const int16_t idx_sep_object ); - -static int16_t index_slice_enum( const int16_t *ratio_ism_idx, const int16_t nchan_ism ); - -static int16_t encode_ratio_ism_subframe( const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const uint8_t numCodingBands, const int16_t sf, const int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, const int16_t idx_sep_obj ); - -static void transform_index_and_GR_encode( int16_t *diff_idx, const int16_t len, const int16_t GR_order, BSTR_ENC_HANDLE hMetaData ); - -static void transform_difference_index( const int16_t *diff_idx, int16_t *idx, const int16_t len ); - -static void independent_coding_ratio_ism_idx( const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const float *masa_to_total_energy_ratio, const int16_t nchan_ism, const int16_t numCodingBands, const int16_t bits_index, BSTR_ENC_HANDLE hMetaData ); - -static void remove_sep_obj( int16_t *diff_idx, const int16_t nchan_ism, const int16_t idx_sep_obj ); - #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif @@ -764,6 +750,7 @@ ivas_error ivas_masa_enc_config( { #ifdef FIX_382_MASA_META_FRAMING_ASYNC detect_framing_async( hMasa ); /* detect the offset, set 1sf/4sf mode based on this. potentially also shift the metadata using a history buffer */ + if ( hMasa->data.sync_state.frame_mode == MASA_FRAME_1SF && hMasa->data.sync_state.prev_offset != 0 ) { /* average over sub-frames */ @@ -2871,7 +2858,7 @@ static void transform_index_and_GR_encode( int16_t *diff_idx, /* i : differenc eindex to encode */ const int16_t len, /* i : input length */ const int16_t GR_order, /* i : GR order */ - BSTR_ENC_HANDLE hMetaData /* i/o: bitstream */ + BSTR_ENC_HANDLE hMetaData /* i/o: metadata bitstream handle */ ) { int16_t i; @@ -2893,7 +2880,7 @@ static void transform_index_and_GR_encode( static int16_t try_differential( const int16_t numCodingBands, const float *masa_to_total_energy_ratio, - const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t bits_index, int16_t *p_b_signif ) @@ -2945,7 +2932,7 @@ static void differential_coding_first_subframe( BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t b_signif, - const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const int16_t numCodingBands, const int16_t bits_index ) @@ -2982,12 +2969,12 @@ static void differential_coding_first_subframe( static void independent_coding_ratio_ism_idx( - const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* i : ISM ratios */ - const float *masa_to_total_energy_ratio, /* i : MASA to total ratios */ - const int16_t nchan_ism, /* i : number of objects */ - const int16_t numCodingBands, /* i : number of subbands */ - const int16_t bits_index, /* i : number of bits per index */ - BSTR_ENC_HANDLE hMetaData /* i/o: bitstream */ + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], /* i : ISM ratios */ + const float *masa_to_total_energy_ratio, /* i : MASA to total ratios */ + const int16_t nchan_ism, /* i : number of objects */ + const int16_t numCodingBands, /* i : number of subbands */ + const int16_t bits_index, /* i : number of bits per index */ + BSTR_ENC_HANDLE hMetaData /* i/o: metadata bitstream handle */ ) { int16_t b, index; @@ -3040,14 +3027,16 @@ static void estimate_bits_subband_ism_ratio( /* take difference with respect to previous subframe */ v_sub_s( ratio_ism_idx, ratio_ism_idx_ref, diff_idx, nchan_ism ); + if ( shift_one ) { remove_sep_obj( diff_idx, nchan_ism, idx_sep_obj ); } + /* transform difference index into positive */ transform_difference_index( diff_idx, diff_idx, nchan_ism - 1 - shift_one ); - /* GR encoding */ + /* GR encoding */ for ( i = 0; i < nchan_ism - 1 - shift_one; i++ ) { nbits0 += ivas_qmetadata_encode_extended_gr_length( diff_idx[i], 100, 0 ); @@ -3062,11 +3051,11 @@ static void estimate_bits_subband_ism_ratio( static int16_t encode_ratio_ism_subframe( - const int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t ratio_ism_idx[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], const int16_t nchan_ism, const uint8_t numCodingBands, const int16_t sf, - const int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], + int16_t ratio_ism_idx_prev_sf[MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS], BSTR_ENC_HANDLE hMetaData, const float *masa_to_total_energy_ratio, const int16_t shift_one, @@ -3289,6 +3278,7 @@ static int16_t encode_ratio_ism_subframe( { /* take difference with respect to previous subframe */ v_sub_s( ratio_ism_idx[0], ratio_ism_idx_prev_sf[0], diff_idx, nchan_ism ); + if ( shift_one ) { remove_sep_obj( diff_idx, nchan_ism, idx_sep_obj_local ); @@ -3478,8 +3468,10 @@ static void ivas_encode_masaism_metadata( assert( ( hMasa->data.energy_ratio_ism[sf][band][obj] >= 0 ) && ( hMasa->data.energy_ratio_ism[sf][band][obj] <= 1 ) ); ratio_ism[band][obj] = hMasa->data.energy_ratio_ism[sf][band][obj]; } + /* Quantize ISM ratios */ quantize_ratio_ism_vector( ratio_ism[band], ratio_ism_idx[band], hMasa->data.nchan_ism, hQMetaData->masa_to_total_energy_ratio[sf][band], idx_separated_object ); + if ( n_ism_tmp == numCodingBands && ratio_ism_idx[band][idx_separated_object] != 0 && hQMetaData->masa_to_total_energy_ratio[sf][band] < MASA2TOTAL_THR ) { i = 0; @@ -3553,7 +3545,6 @@ static void ivas_encode_masaism_metadata( encode_ratio_ism_subframe( ratio_ism_idx, hMasa->data.nchan_ism, numCodingBands, sf, ratio_ism_idx_prev_sf, hMetaData, hQMetaData->masa_to_total_energy_ratio[sf], 0, idx_separated_object ); } - /* calculate quantized ISM ratios */ /* save previous subframe indexes */ for ( band = 0; band < numCodingBands; band++ ) -- GitLab From ea30c7e221bfe2cbb1395943c3730e0aa591e7c4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 13:21:46 +0200 Subject: [PATCH 0095/1418] attempt to fix error: "MemorySanitizer: use-of-uninitialized-value" --- lib_dec/ivas_dirac_output_synthesis_dec.c | 1 + lib_dec/ivas_masa_dec.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 40883784bd..461ce67274 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -1526,6 +1526,7 @@ void ivas_dirac_dec_compute_directional_responses( num_channels_dir = hDirAC->num_outputs_dir; azimuth = hDirAC->azimuth[hDirAC->dirac_read_idx]; elevation = hDirAC->elevation[hDirAC->dirac_read_idx]; + #ifdef MASA_AND_OBJECTS if ( hDirAC->numParametricDirections == 2 ) #else diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 959300ca74..99c9cdaf60 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1523,6 +1523,9 @@ void ivas_spar_param_to_masa_param_mapping( /* Set values */ hDirAC = st_ivas->hDirAC; +#ifdef MASA_AND_OBJECTS + hDirAC->numParametricDirections = 1; +#endif hDirAC->numSimultaneousDirections = 1; hDiffuseDist = st_ivas->hDirAC->hDiffuseDist; nchan_transport = st_ivas->nchan_transport; -- GitLab From fce075b35370a055aba597f2f02241c34672b1e9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 13:38:19 +0200 Subject: [PATCH 0096/1418] attempt to fix error: "MemorySanitizer: use-of-uninitialized-value" --- lib_rend/lib_rend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3d2420632d..4249b4790e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5312,6 +5312,9 @@ static void copyMasaMetadataToDiracRenderer( int16_t meta_write_index; #endif +#ifdef MASA_AND_OBJECTS + hDirAC->numParametricDirections = meta->descriptive_meta.numberOfDirections; +#endif hDirAC->numSimultaneousDirections = meta->descriptive_meta.numberOfDirections + 1; for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) -- GitLab From d9037ac9e13d6d893f7afbbe1bd00859bb6aaa98 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 25 Apr 2023 14:21:34 +0200 Subject: [PATCH 0097/1418] updates within OMASA_TUNING_TD_STEREO --- lib_com/ivas_prot.h | 26 +++++++++++++------------- lib_com/ivas_stereo_td_bit_alloc.c | 9 ++++----- lib_dec/ivas_cpe_dec.c | 7 +++---- lib_dec/ivas_stereo_td_dec.c | 22 ++++++++++------------ lib_enc/ivas_cpe_enc.c | 14 ++++++-------- lib_enc/ivas_stereo_td_analysis.c | 10 +++++----- lib_enc/ivas_stereo_td_enc.c | 20 +++++++++----------- 7 files changed, 50 insertions(+), 58 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 1bc5b19ea4..3ca21a13d1 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1826,14 +1826,15 @@ void stereo_tdm_prep_dwnmx ( const float *input1, /* i : right channel input */ const int16_t input_frame /* i : frame lenght */ ); + int16_t stereo_tdm_ener_analysis( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_ENC_HANDLE hCPE, /* i : CPE structure */ const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ -#ifdef OMASA_TUNING_TD_STEREO - ,const int16_t isOmasa /* i : flag that indicates OMASA format */ -#endif ); void stereo_tdm_downmix( @@ -1852,13 +1853,12 @@ void stereo_td_init_dec( ); void tdm_configure_dec( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING_TD_STEREO - ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ -#endif - ); void tdm_upmix_plain( @@ -1905,6 +1905,9 @@ void tdm_ol_pitch_comparison( ); void tdm_configure_enc( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -1912,9 +1915,6 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING_TD_STEREO - ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ -#endif ); ivas_error signaling_enc_secondary( @@ -1924,6 +1924,9 @@ ivas_error signaling_enc_secondary( ); void tdm_bit_alloc( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ int32_t *total_brate_pri, /* o : Allocated primary channel bitrate */ @@ -1938,9 +1941,6 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx /* i : instantaneous correlation ratio index */ -#ifdef OMASA_TUNING_TD_STEREO - ,const int16_t IsOmasa /* i : flag that indicates OMASA format */ -#endif ); void td_stereo_param_updt( diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index ac56cd6537..48c5eaf8ae 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -74,6 +74,9 @@ *-------------------------------------------------------------------*/ void tdm_bit_alloc( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ int32_t *total_brate_pri, /* o : Allocated primary channel bitrate */ @@ -88,10 +91,6 @@ void tdm_bit_alloc( const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t coder_type0, /* i : coder type (temporary in the encoder, from bitstream in decoder) */ const int16_t tdm_inst_ratio_idx_ref /* i : instantaneous correlation ratio idx */ -#ifdef OMASA_TUNING_TD_STEREO - , - const int16_t IsOmasa /* i : flag that indicates OMASA format */ -#endif ) { int16_t idx, four_subfr_fcb, two_subfr_fcb; @@ -141,7 +140,7 @@ void tdm_bit_alloc( /* secondary channel bitrate allocation based on the energy scaling ratio */ #ifdef OMASA_TUNING_TD_STEREO - if ( ( IsOmasa == 0 && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( IsOmasa == 1 && coder_type > UNVOICED ) ) + if ( ( ivas_format != MASA_ISM_FORMAT && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && coder_type > UNVOICED ) ) #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 12bcab4584..74f22590ad 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -413,12 +413,11 @@ ivas_error ivas_cpe_dec( { if ( !st_ivas->bfi ) { - tdm_configure_dec( hCPE, &tdm_ratio_idx, nb_bits_metadata + tdm_configure_dec( #ifdef OMASA_TUNING_TD_STEREO - , - ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_24k4 ) ) + st_ivas->ivas_format, #endif - ); + hCPE, &tdm_ratio_idx, nb_bits_metadata ); sts[1]->bit_stream = sts[0]->bit_stream + ( sts[0]->total_brate / FRAMES_PER_SEC ); } diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index fbfa270727..d8e817638a 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -84,14 +84,12 @@ void stereo_td_init_dec( *-------------------------------------------------------------------*/ void tdm_configure_dec( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING_TD_STEREO - , - const int16_t IsOmasa /* i : flag that indicates OMASA format*/ -#endif - ) { STEREO_TD_DEC_DATA_HANDLE hStereoTD; @@ -310,15 +308,15 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, - hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), - &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx + tdm_bit_alloc( #ifdef OMASA_TUNING_TD_STEREO - , - IsOmasa + ivas_format, #endif - ); + + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index bfa7d86756..48a343bec1 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -435,12 +435,11 @@ ivas_error ivas_cpe_enc( else if ( hCPE->element_mode == IVAS_CPE_TD ) { /* Determine the energy ratio between the 2 channels */ - tdm_ratio_idx = stereo_tdm_ener_analysis( hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM + tdm_ratio_idx = stereo_tdm_ener_analysis( #ifdef OMASA_TUNING_TD_STEREO - , - st_ivas->hOMasa != NULL + ivas_format, #endif - ); + hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM ); /* Compute the downmix signal based on the ratio index */ stereo_tdm_downmix( hCPE->hStereoTD, sts[0]->input, sts[1]->input, input_frame, tdm_ratio_idx, ( ( hCPE->hStereoTD->tdm_LRTD_flag == 0 ) ? tdm_SM_or_LRTD_Pri : 0 ), tdm_ratio_idx_SM ); @@ -606,12 +605,11 @@ ivas_error ivas_cpe_enc( { tdm_ol_pitch_comparison( hCPE, pitch_fr, voicing_fr ); - tdm_configure_enc( hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata + tdm_configure_enc( #ifdef OMASA_TUNING_TD_STEREO - , - st_ivas->hOMasa != NULL + ivas_format, #endif - ); + hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); if ( hEncoderConfig->Opt_DTX_ON ) { diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index 5ef8001b7a..ee07ae2f52 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -111,14 +111,13 @@ static float Comp_diff_lt_corr( CPE_ENC_HANDLE hCPE, const int16_t IsSideMono, c *-------------------------------------------------------------------*/ int16_t stereo_tdm_ener_analysis( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_ENC_HANDLE hCPE, /* i : CPE structure */ const int16_t input_frame, /* i : Number of samples */ int16_t *tdm_SM_or_LRTD_Pri, /* o : channel combination scheme flag in TD stereo OR LRTD primary channel */ int16_t *tdm_ratio_idx_SM /* o : TDM ratio index for SM mode */ -#ifdef OMASA_TUNING_TD_STEREO - , - const int16_t isOmasa /* i : flag that indicates OMASA format */ -#endif ) { float rms_R, rms_L; @@ -200,7 +199,7 @@ int16_t stereo_tdm_ener_analysis( *----------------------------------------------------------------*/ #ifdef OMASA_TUNING_TD_STEREO - if ( isOmasa ) + if ( ivas_format == MASA_ISM_FORMAT ) { if ( ( hCPE->hStereoClassif->lrtd_mode == 1 || hCPE->hStereoTD->prev_fr_LRTD_TD_dec == 1 ) && ( hCPE->element_brate - 50 * FRAMES_PER_SEC + hCPE->brate_surplus + hCPE->brate_surplus < 15000 ) ) @@ -209,6 +208,7 @@ int16_t stereo_tdm_ener_analysis( } } #endif + rms_thd = RMS_MIN; if ( hCPE->hStereoClassif->lrtd_mode == 1 ) { diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 7c0649c5ab..d8c8086562 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -302,6 +302,9 @@ ivas_error stereo_set_tdm( *-------------------------------------------------------------------*/ void tdm_configure_enc( +#ifdef OMASA_TUNING_TD_STEREO + const int16_t ivas_format, /* i : IVAS format */ +#endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ const int16_t tdm_SM_or_LRTD_Pri, /* i : channel combination scheme flag in TD stereo OR LRTD primary channel */ @@ -309,10 +312,6 @@ void tdm_configure_enc( const int16_t tdm_ratio_idx_SM, /* i : ratio index in SM mode */ const int16_t attack_flag, /* i : Primary channel attack flag */ const int16_t nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_TUNING_TD_STEREO - , - const int16_t IsOmasa /* i : flag that indicates OMASA format */ -#endif ) { int16_t tdm_ratio_bit_alloc_idx, mod_ct; @@ -485,15 +484,14 @@ void tdm_configure_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, - hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), - &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx + tdm_bit_alloc( #ifdef OMASA_TUNING_TD_STEREO - , - IsOmasa + ivas_format, #endif - ); + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #endif -- GitLab From ee0cb4895bc1712f029a540ed01bfab2778dbadf Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Tue, 25 Apr 2023 17:42:41 +0200 Subject: [PATCH 0098/1418] reverb configuration no longer required in render configuration file; test_ambisonics_binaural_headrotation_defaultrenderconfig() removed (defaults can not be achieved bit-exact via reverb configuration; does not change code coverage) --- apps/decoder.c | 13 ++++++++----- apps/renderer.c | 13 ++++++++----- scripts/testv/config_directivity.cfg | 1 - scripts/testv/just_reverb.cfg | 2 -- tests/renderer/constants.py | 4 ---- tests/renderer/test_renderer.py | 20 -------------------- 6 files changed, 16 insertions(+), 37 deletions(-) delete mode 100644 scripts/testv/just_reverb.cfg diff --git a/apps/decoder.c b/apps/decoder.c index f7da07e3fc..6843c26eff 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -512,14 +512,17 @@ int main( } #ifdef CONTROL_METADATA_REVERB - if ( RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) != IVAS_ERR_OK ) + if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { - fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); - goto cleanup; + if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + goto cleanup; + } } - if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + else if ( error != IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING ) { - fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); goto cleanup; } diff --git a/apps/renderer.c b/apps/renderer.c index 29cfd52993..72a8c05600 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -738,14 +738,17 @@ int main( } #ifdef CONTROL_METADATA_REVERB - if ( RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) != IVAS_ERR_OK ) + if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, ACOUSTIC_ENVIRONMENT_ID, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { - fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); - exit( -1 ); + if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + exit( -1 ); + } } - if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) + else if ( error != IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING ) { - fprintf( stderr, "Invalid reverberation configuration parameters\n\n" ); + fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", ACOUSTIC_ENVIRONMENT_ID ); exit( -1 ); } #ifdef COMMAND_LINE_OPTION_LATE_REVERB diff --git a/scripts/testv/config_directivity.cfg b/scripts/testv/config_directivity.cfg index 77f392ca7c..f958df1d31 100644 --- a/scripts/testv/config_directivity.cfg +++ b/scripts/testv/config_directivity.cfg @@ -1,3 +1,2 @@ [general] directivity = [0.0, 360.0, 0.2512]; -reverbFile = rend_config_renderer.dat; diff --git a/scripts/testv/just_reverb.cfg b/scripts/testv/just_reverb.cfg deleted file mode 100644 index 28acb76dc6..0000000000 --- a/scripts/testv/just_reverb.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[roomAcoustics] -reverb = true; # Reverb switch, in case BRIR is undefined or false, reverb flag is inherited from the room flag diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index e29696adec..3625a9307e 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -193,10 +193,6 @@ HR_TRAJECTORIES_TO_TEST = [ "rotate_yaw_pitch_roll1", ] -CONFIG_FILES_TO_TEST = [ - "just_reverb" -] - """ Per-testcase xfail SNR thresholds (dB) """ pass_snr = dict() # not relevant for tests anymore, should be deprecated soon _pass_snr = { diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index df8f67efcd..b4ecf611da 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -55,26 +55,6 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), ) - -# Test compares rendering with render config file containing just reverb defaults against rendering without config file. -# These should be binary equivalent. -@pytest.mark.skip("disable until .cfg parsing is enabled again") -@pytest.mark.parametrize("config_file", CONFIG_FILES_TO_TEST) -@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) -@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ambisonics_binaural_headrotation_defaultrenderconfig(test_info, in_fmt, out_fmt, config_file): - compare_renderer_args( - test_info, - in_fmt, - out_fmt, - ref_kwargs={ - "name_extension": "defaultrenderconfig" - }, - cut_kwargs={ - "config_file": TESTV_DIR.joinpath(f"{config_file}.cfg") - } - ) - # 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) -- GitLab From b852f843b388327e38f5f06a06618fe8f29adc35 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 25 Apr 2023 21:07:31 +0300 Subject: [PATCH 0099/1418] Changes sync between audio and metadata in OMASA to follow the paradigm in MASA. --- lib_com/delay_comp.c | 8 ++ lib_com/ivas_prot.h | 4 + lib_com/options.h | 3 +- lib_dec/ivas_dec.c | 49 +++++++ lib_dec/ivas_dirac_dec.c | 4 + lib_dec/ivas_dirac_output_synthesis_dec.c | 32 +++++ lib_dec/ivas_ism_renderer.c | 127 +++++++++++++------ lib_dec/ivas_masa_dec.c | 86 +++++++++++++ lib_dec/ivas_stat_dec.h | 11 ++ lib_enc/ivas_init_enc.c | 4 + lib_enc/ivas_omasa_enc.c | 28 ++++ lib_enc/ivas_stat_enc.h | 2 + lib_rend/ivas_dirac_dec_binaural_functions.c | 46 +++++++ 13 files changed, 362 insertions(+), 42 deletions(-) diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index b96798815e..909a335516 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -70,7 +70,11 @@ int32_t get_delay( delay = IVAS_ENC_DELAY_NS; #ifdef FIX_350_MASA_DELAY_COMP +#ifdef FIX_OMASA_DELAY_COMP + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { delay = 0; /* All delay is compensated in the decoder with MASA */ } @@ -108,7 +112,11 @@ int32_t get_delay( #ifdef FIX_350_MASA_DELAY_COMP +#ifdef FIX_OMASA_DELAY_COMP + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) +#else if ( ivas_format == MASA_FORMAT ) +#endif { delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */ } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 1bc5b19ea4..f20fd0ab88 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5191,8 +5191,12 @@ ivas_error ivas_omasa_enc_open( ); void ivas_omasa_enc_close( +#ifdef FIX_OMASA_DELAY_COMP + OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ +#else OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ const int16_t nchan_ism /* i : number of objects */ +#endif ); #ifdef OMASA_BRATE_SW diff --git a/lib_com/options.h b/lib_com/options.h index 8bd854e1b4..de3c8de9a7 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -144,7 +144,7 @@ #define FIX_103_RA_PARAMS_PARAM_BIN_REND /* Issue 103: Digest room acoustics parameters for Parametric Binaural Renderer*/ /*#define SBA_HPF_TUNING_DEC*/ -/*#define FIX_350_MASA_DELAY_COMP*/ /* Nokia: Issue 350: MASA audio/meta delay compensation */ +#define FIX_350_MASA_DELAY_COMP /* Nokia: Issue 350: MASA audio/meta delay compensation */ #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 */ @@ -177,6 +177,7 @@ #define OMASA_BRATE_SW /* VA: support of bitrate switching in OMASA format */ #define FIX_TD5_IN_OMASA // do not transmit extended MD in OMASA #define OMASA_TUNING_TD_STEREO /* VA: tuning of TD stereo in OMASA format */ +#define FIX_OMASA_DELAY_COMP /* Nokia: OMASA audio/meta delay compensation */ #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 4b885ea217..c069a5847e 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -479,6 +479,10 @@ ivas_error ivas_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { +#ifdef FIX_OMASA_DELAY_COMP + int16_t dirac_bs_md_write_idx = 0; +#endif + st = st_ivas->hCPE[0]->hCoreCoder[0]; nb_bits_metadata[0] = 0; set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); @@ -498,6 +502,10 @@ ivas_error ivas_dec( { st_ivas->hDirAC->numIsmDirections = 0; } + +#ifdef FIX_OMASA_DELAY_COMP + dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ +#endif } /* MASA metadata decoding */ @@ -548,6 +556,13 @@ ivas_error ivas_dec( if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) #endif { +#ifdef FIX_OMASA_DELAY_COMP + int16_t azimuth_ism; + int16_t elevation_ism; + int16_t block; + int16_t meta_write_index; +#endif + /* decode ISM metadata */ #ifdef NCHAN_ISM_PARAMETER if ( ( error = ivas_ism_metadata_dec( ism_total_brate, @@ -570,14 +585,38 @@ ivas_error ivas_dec( { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { +#ifdef FIX_OMASA_DELAY_COMP + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; + } +#else st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); +#endif } } else /* ISM_MASA_MODE_MASA_ONE_OBJ */ { +#ifdef FIX_OMASA_DELAY_COMP + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); + + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; + } +#else st_ivas->hMasaIsmData->azimuth_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); st_ivas->hMasaIsmData->elevation_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); +#endif } #else for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -687,6 +726,10 @@ ivas_error ivas_dec( #endif { float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; +#ifdef FIX_OMASA_DELAY_COMP + int16_t dirac_read_idx; +#endif + #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else @@ -703,8 +746,14 @@ ivas_error ivas_dec( } } +#ifdef FIX_OMASA_DELAY_COMP + dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; +#endif ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hDirAC->dirac_read_idx = dirac_read_idx; /* Original read index is needed for the next function which will update it again */ +#endif ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); } else diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index e471738ca3..4f19654485 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -845,7 +845,11 @@ ivas_error ivas_dirac_dec_config( { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; } +#ifdef FIX_OMASA_DELAY_COMP + else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) +#else else if ( st_ivas->ivas_format == MASA_FORMAT ) +#endif { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR; hDirAC->dirac_bs_md_write_idx = DELAY_MASA_PARAM_DEC_SFR; diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 40883784bd..e137962811 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -1626,12 +1626,20 @@ void ivas_dirac_dec_compute_directional_responses( } else { +#ifdef FIX_OMASA_DELAY_COMP + ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir][hDirAC->dirac_read_idx], hMasaIsm->elevation_ism[dir][hDirAC->dirac_read_idx], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); +#else ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); +#endif } for ( l = 0; l < num_channels_dir; l++ ) { +#ifdef FIX_OMASA_DELAY_COMP + direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; +#else direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; +#endif } } @@ -1640,10 +1648,18 @@ void ivas_dirac_dec_compute_directional_responses( { masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; } +#ifdef FIX_OMASA_DELAY_COMP + ismDirect = hMasaIsm->energy_ratio_ism[0][hDirAC->dirac_read_idx][k]; +#else ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; +#endif for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) { +#ifdef FIX_OMASA_DELAY_COMP + ismDirect += hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; +#else ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; +#endif } totalDirect = masaDirect + ismDirect; @@ -1747,7 +1763,11 @@ void ivas_dirac_dec_compute_directional_responses( else { #ifdef OMASA_UPDATES +#ifdef FIX_OMASA_DELAY_COMP + vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir][hDirAC->dirac_read_idx], hMasaIsm->elevation_ism[dir][hDirAC->dirac_read_idx], 1 ); +#else vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], 1 ); +#endif #else vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir] ); #endif @@ -1755,7 +1775,11 @@ void ivas_dirac_dec_compute_directional_responses( for ( l = 0; l < num_channels_dir; l++ ) { +#ifdef FIX_OMASA_DELAY_COMP + direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; +#else direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; +#endif } } normalizePanningGains( direct_response_ism, num_channels_dir ); @@ -1765,10 +1789,18 @@ void ivas_dirac_dec_compute_directional_responses( { masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; } +#ifdef FIX_OMASA_DELAY_COMP + ismDirect = hMasaIsm->energy_ratio_ism[0][hDirAC->dirac_read_idx][k]; +#else ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; +#endif for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) { +#ifdef FIX_OMASA_DELAY_COMP + ismDirect += hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; +#else ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; +#endif } totalDirect = masaDirect + ismDirect; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 00d93d15b6..54856c700d 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -278,7 +278,11 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( set_f( st_ivas->hIsmRendererData->prev_gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); } +#ifdef FIX_OMASA_DELAY_COMP + interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); +#else interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / 50 ); +#endif for ( i = 0; i < interpolator_length; i++ ) { st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length ); @@ -341,11 +345,20 @@ void ivas_masa_ism_separate_object_render( int16_t azimuth, elevation; int16_t num_objects; uint8_t single_separated; +#ifdef FIX_OMASA_DELAY_COMP + int16_t block; + int16_t subframe_len; + int16_t idx_offset; + int16_t dirac_read_idx; +#endif hVBAPdata = st_ivas->hVBAPdata; nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; hRendererData = st_ivas->hIsmRendererData; lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; +#ifdef FIX_OMASA_DELAY_COMP + subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#endif #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) @@ -366,67 +379,99 @@ void ivas_masa_ism_separate_object_render( { delay_signal( input_f[obj], output_frame, st_ivas->hMasaIsmData->delayBuffer[obj], st_ivas->hMasaIsmData->delayBuffer_size ); /* Delay the signal to match CLDFB delay */ - if ( single_separated ) - { - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; - elevation = st_ivas->hMasaIsmData->elevation_separated_ism; - } - else +#ifdef FIX_OMASA_DELAY_COMP + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; - elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; - } + idx_offset = block * subframe_len; + dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; +#endif - if ( st_ivas->hOutSetup.is_planar_setup ) - { - /* If no elevation support in output format, then rendering should be done with zero elevation */ - elevation = 0; - } + if ( single_separated ) + { +#ifdef FIX_OMASA_DELAY_COMP + azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; + elevation = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; +#else + azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; + elevation = st_ivas->hMasaIsmData->elevation_separated_ism; +#endif + } + else + { +#ifdef FIX_OMASA_DELAY_COMP + azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; + elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; +#else + azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; + elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; +#endif + } + + if ( st_ivas->hOutSetup.is_planar_setup ) + { + /* If no elevation support in output format, then rendering should be done with zero elevation */ + elevation = 0; + } #ifndef OMASA_UPDATES - else if ( output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_4 ) - { - /* For no negative elevations, it's better to map them to zero */ - elevation = elevation < 0 ? 0 : elevation; - } + else if ( output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_4 ) + { + /* For no negative elevations, it's better to map them to zero */ + elevation = elevation < 0 ? 0 : elevation; + } #endif - if ( hVBAPdata != NULL ) - { + if ( hVBAPdata != NULL ) + { #ifdef OMASA_UPDATES - vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); + vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); #else - vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); + vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); #endif - } - else - { - ivas_dirac_dec_get_response( azimuth, elevation, gains, st_ivas->hDirAC->hOutSetup.ambisonics_order ); - } - - for ( j = 0; j < nchan_out_woLFE; j++ ) - { - if ( st_ivas->hDirAC->hOutSetup.num_lfe > 0 ) - { - j2 = j + ( j >= lfe_index ); } else { - j2 = j; + ivas_dirac_dec_get_response( azimuth, elevation, gains, st_ivas->hDirAC->hOutSetup.ambisonics_order ); } - if ( fabsf( gains[j] ) > 0.0f || fabsf( hRendererData->prev_gains[obj][j] ) > 0.0f ) + for ( j = 0; j < nchan_out_woLFE; j++ ) { - for ( k = 0; k < output_frame; k++ ) + if ( st_ivas->hDirAC->hOutSetup.num_lfe > 0 ) { - g1 = hRendererData->interpolator[k]; - g2 = 1.0f - g1; - output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; + j2 = j + ( j >= lfe_index ); } + else + { + j2 = j; + } + + if ( fabsf( gains[j] ) > 0.0f || fabsf( hRendererData->prev_gains[obj][j] ) > 0.0f ) + { +#ifdef FIX_OMASA_DELAY_COMP + for ( k = 0; k < subframe_len; k++ ) +#else + for ( k = 0; k < output_frame; k++ ) +#endif + { + g1 = hRendererData->interpolator[k]; + g2 = 1.0f - g1; +#ifdef FIX_OMASA_DELAY_COMP + output_f[j2][k + idx_offset] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k + idx_offset]; +#else + output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; +#endif + } + } + hRendererData->prev_gains[obj][j] = gains[j]; } - hRendererData->prev_gains[obj][j] = gains[j]; +#ifdef FIX_OMASA_DELAY_COMP } +#endif } +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hDirAC->dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hDirAC->dirac_md_buffer_length; +#endif + return; } #endif diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 959300ca74..c91b31b288 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -80,7 +80,11 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS +#ifdef FIX_OMASA_DELAY_COMP +static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length ); +#else static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp ); +#endif static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); @@ -113,6 +117,9 @@ ivas_error ivas_masa_decode( #ifdef MASA_AND_OBJECTS int16_t obj; int16_t i, ch, ism_imp; +#ifdef FIX_OMASA_DELAY_COMP + int16_t dirac_bs_md_write_idx; +#endif ism_imp = 0; #endif @@ -329,7 +336,11 @@ ivas_error ivas_masa_decode( #endif { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); +#else st_ivas->hMasaIsmData->idx_separated_ism, ism_imp ); +#endif } #ifdef OMASA_UPDATES @@ -342,8 +353,20 @@ ivas_error ivas_masa_decode( { if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) { +#ifdef FIX_OMASA_DELAY_COMP + int16_t sf; + int16_t meta_write_index; + + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + meta_write_index = ( st_ivas->hDirAC->dirac_bs_md_write_idx + sf ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->azimuth_ism[obj][meta_write_index]; + st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->elevation_ism[obj][meta_write_index]; + } +#else st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->hMasaIsmData->azimuth_ism[obj]; st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->hMasaIsmData->elevation_ism[obj]; +#endif } } } @@ -450,6 +473,9 @@ ivas_error ivas_masa_decode( if ( st_ivas->hDirAC != NULL ) { +#ifdef FIX_OMASA_DELAY_COMP + dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ +#endif ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, SBA_MODE_NONE, 0 ); } @@ -468,22 +494,39 @@ ivas_error ivas_masa_decode( { int16_t b; int16_t block; +#ifdef FIX_OMASA_DELAY_COMP + int16_t meta_write_index; +#endif for ( i = 0; i < st_ivas->hDirAC->numIsmDirections; i++ ) /* Todo Nokia: Probably there is a better place for this eventually */ { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { +#ifdef FIX_OMASA_DELAY_COMP + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; +#endif for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] -= st_ivas->hMasaIsmData->energy_ratio_ism[i][meta_write_index][b]; +#else st_ivas->hDirAC->diffuseness_vector[block][b] -= st_ivas->hMasaIsmData->energy_ratio_ism[i][block][b]; +#endif } } } for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { +#ifdef FIX_OMASA_DELAY_COMP + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; +#endif for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] = max( 0.0f, st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] ); +#else st_ivas->hDirAC->diffuseness_vector[block][b] = max( 0.0f, st_ivas->hDirAC->diffuseness_vector[block][b] ); +#endif } } } @@ -2298,7 +2341,13 @@ static int16_t ivas_decode_masaism_metadata( uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, +#ifdef FIX_OMASA_DELAY_COMP + const int16_t ism_imp, + const int16_t dirac_bs_md_write_idx, + const int16_t dirac_md_buffer_length ) +#else const int16_t ism_imp ) +#endif { int16_t sf, band, dir, nbands, nblocks, obj, i; float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; @@ -2310,6 +2359,9 @@ static int16_t ivas_decode_masaism_metadata( int16_t nb_bits_read; #ifdef OMASA_UPDATES float delta_phi; +#ifdef FIX_OMASA_DELAY_COMP + int16_t meta_write_index; +#endif #endif nb_bits_read = *next_bit_pos; nbands = hQMetaData->q_direction->cfg.nbands; @@ -2395,8 +2447,17 @@ static int16_t ivas_decode_masaism_metadata( #endif +#ifdef FIX_OMASA_DELAY_COMP + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + sf ) % dirac_md_buffer_length; + hMasaIsmData->azimuth_ism[obj][meta_write_index] = (int16_t) rint( azimuth ); + hMasaIsmData->elevation_ism[obj][meta_write_index] = (int16_t) rint( elevation ); + } +#else hMasaIsmData->azimuth_ism[obj] = (int16_t) rint( azimuth ); hMasaIsmData->elevation_ism[obj] = (int16_t) rint( elevation ); +#endif } /* Modify ISM metadata based on the MASA-to-total energy ratios */ @@ -2427,10 +2488,17 @@ static int16_t ivas_decode_masaism_metadata( { i = sf; } +#ifdef FIX_OMASA_DELAY_COMP + meta_write_index = ( dirac_bs_md_write_idx + sf ) % dirac_md_buffer_length; +#endif for ( dir = 0; dir < nchan_ism; dir++ ) { +#ifdef FIX_OMASA_DELAY_COMP + hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; +#else hMasaIsmData->energy_ratio_ism[dir][sf][b] = energy_ratio_ism[i][band][dir]; +#endif } } } @@ -2460,8 +2528,17 @@ void ivas_masa_ism_set_edited_objects( { if ( st_ivas->editing_ism_enabled ) { +#ifdef FIX_OMASA_DELAY_COMP + int16_t sf; + for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) + { + hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->azimuth_edited; + hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->elevation_edited; + } +#else hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism] = st_ivas->azimuth_edited; hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism] = st_ivas->elevation_edited; +#endif #ifdef OMASA_UPDATES st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->azimuth = st_ivas->azimuth_edited; st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->elevation = st_ivas->elevation_edited; @@ -2498,8 +2575,17 @@ void ivas_masa_ism_set_edited_objects( { if ( st_ivas->hMasaIsmData->idx_separated_ism == st_ivas->index_of_edited_ism ) { +#ifdef FIX_OMASA_DELAY_COMP + int16_t sf; + for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) + { + st_ivas->hMasaIsmData->azimuth_separated_ism[sf] = st_ivas->azimuth_edited; + st_ivas->hMasaIsmData->elevation_separated_ism[sf] = st_ivas->elevation_edited; + } +#else st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->azimuth_edited; st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->elevation_edited; +#endif } } } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index ccaed09898..a412616749 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1162,17 +1162,28 @@ typedef struct ivas_masa_decoder_struct /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure { +#ifdef FIX_OMASA_DELAY_COMP + int16_t azimuth_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; + int16_t elevation_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; + float energy_ratio_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; +#else int16_t azimuth_ism[MAX_NUM_OBJECTS]; int16_t elevation_ism[MAX_NUM_OBJECTS]; float energy_ratio_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif int16_t azimuth_ism_edited[MAX_NUM_OBJECTS]; int16_t elevation_ism_edited[MAX_NUM_OBJECTS]; uint8_t ism_is_edited[MAX_NUM_OBJECTS]; int16_t idx_separated_ism; +#ifdef FIX_OMASA_DELAY_COMP + int16_t azimuth_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; + int16_t elevation_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; +#else int16_t azimuth_separated_ism; int16_t elevation_separated_ism; +#endif #ifdef OMASA_UPDATES float q_azimuth_old[MAX_NUM_OBJECTS]; float q_elevation_old[MAX_NUM_OBJECTS]; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 1fd102c07c..c6d1066e66 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -1101,7 +1101,11 @@ void ivas_destroy_enc( #ifdef MASA_AND_OBJECTS if ( st_ivas->hOMasa != NULL ) { +#ifdef FIX_OMASA_DELAY_COMP + ivas_omasa_enc_close( st_ivas->hOMasa ); +#else ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); +#endif st_ivas->hOMasa = NULL; } #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 86b5cbe90f..002a4d52c7 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -89,6 +89,7 @@ ivas_error ivas_omasa_enc_open( numAnalysisChannels = st_ivas->hEncoderConfig->nchan_ism; +#ifndef FIX_OMASA_DELAY_COMP /* initialize delay compensation */ hOMasa->num_samples_delay_comp = NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS ); tmp_f = ( (float) hOMasa->num_samples_delay_comp ) / (float) ( NS2SA( st_ivas->hEncoderConfig->input_Fs, DIRAC_SLOT_NS ) ); @@ -111,6 +112,7 @@ ivas_error ivas_omasa_enc_open( hOMasa->delay_buffer[i] = (float *) malloc( NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) * sizeof( float ) ); /* Todo Nokia: Return errors if alloc fails */ set_zero( hOMasa->delay_buffer[i], NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) ); } +#endif /* open/initialize CLDFB */ hOMasa->num_Cldfb_instances = numAnalysisChannels; @@ -174,17 +176,23 @@ ivas_error ivas_omasa_enc_open( *--------------------------------------------------------------------------*/ void ivas_omasa_enc_close( +#ifdef FIX_OMASA_DELAY_COMP + OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ +#else OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ const int16_t nchan_ism /* i : number of objects */ +#endif ) { int16_t i, j; +#ifndef FIX_OMASA_DELAY_COMP for ( i = 0; i < nchan_ism; i++ ) { free( hOMasa->delay_buffer[i] ); hOMasa->delay_buffer[i] = NULL; } +#endif for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) { @@ -299,7 +307,11 @@ ivas_error ivas_omasa_enc_config( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hOMasa != NULL ) { +#ifdef FIX_OMASA_DELAY_COMP + ivas_omasa_enc_close( st_ivas->hOMasa ); +#else ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); +#endif st_ivas->hOMasa = NULL; } @@ -957,11 +969,13 @@ static void ivas_omasa_param_est_enc( set_zero( renormalization_factor_diff, hOMasa->nbands ); set_zero( diffuseness_m, hOMasa->nbands ); +#ifndef FIX_OMASA_DELAY_COMP /* Copy current frame to memory for delay compensation */ for ( i = 0; i < nchan_ism; i++ ) { mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); } +#endif /* Compute ISM to FOA matrices */ for ( i = 0; i < nchan_ism; i++ ) @@ -991,6 +1005,9 @@ static void ivas_omasa_param_est_enc( { for ( i = 0; i < nchan_ism; i++ ) { +#ifdef FIX_OMASA_DELAY_COMP + cldfbAnalysis_ts( &( data_f[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); +#else if ( ts < hOMasa->num_slots_delay_comp ) { cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); @@ -999,6 +1016,7 @@ static void ivas_omasa_param_est_enc( { cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); } +#endif } /* Compute energy */ @@ -1116,11 +1134,13 @@ static void ivas_omasa_param_est_enc( energyRatio[band_m_idx] = 1.0f - diffuseness_m[band_m_idx]; } +#ifndef FIX_OMASA_DELAY_COMP /* Update memory */ for ( i = 0; i < nchan_ism; i++ ) { mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); } +#endif return; } @@ -1148,11 +1168,13 @@ static void ivas_omasa_energy_and_ratio_est( l_ts = input_frame / CLDFB_NO_COL_MAX; +#ifndef FIX_OMASA_DELAY_COMP /* Copy current frame to memory for delay compensation */ for ( i = 0; i < nchan_inp; i++ ) { mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); } +#endif /* do processing over all CLDFB time slots */ for ( block_m_idx = 0; block_m_idx < hOMasa->nSubframes; block_m_idx++ ) @@ -1172,6 +1194,9 @@ static void ivas_omasa_energy_and_ratio_est( { for ( i = 0; i < nchan_inp; i++ ) { +#ifdef FIX_OMASA_DELAY_COMP + cldfbAnalysis_ts( &( data_f[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); +#else if ( ts < hOMasa->num_slots_delay_comp ) { cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); @@ -1180,6 +1205,7 @@ static void ivas_omasa_energy_and_ratio_est( { cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); } +#endif } /* Compute energy */ @@ -1221,11 +1247,13 @@ static void ivas_omasa_energy_and_ratio_est( hMasa->data.nchan_ism = nchan_inp; } +#ifndef FIX_OMASA_DELAY_COMP /* Update memory */ for ( i = 0; i < nchan_inp; i++ ) { mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); } +#endif return; } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 643bd32164..e5ccdc7b19 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -861,11 +861,13 @@ typedef struct ivas_omasa_enc_data_structure uint8_t nCodingBands; uint8_t nSubframes; +#ifndef FIX_OMASA_DELAY_COMP /* delay compensation */ float *delay_buffer[MAX_NUM_OBJECTS]; /* Delay buffer for parameter estimation */ int16_t num_samples_delay_comp; int16_t num_slots_delay_comp; int16_t offset_comp; +#endif /* CLDFB analysis */ int16_t num_Cldfb_instances; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1e1e591508..38f2d8eed5 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -657,6 +657,9 @@ static void ivas_dirac_dec_binaural_internal( ivas_dirac_dec_binaural_process_output( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, firstSlot, slotEnd ); st_ivas->hDirAC->hDiffuseDist = NULL; +#ifdef FIX_OMASA_DELAY_COMP + st_ivas->hDirAC->dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + nSubframes ) % st_ivas->hDirAC->dirac_md_buffer_length; +#endif return; } @@ -898,10 +901,19 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } else { +#ifdef FIX_OMASA_DELAY_COMP + aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx]; +#else aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex]; eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex]; +#endif } +#ifdef FIX_OMASA_DELAY_COMP + ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; +#else ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; +#endif spreadCoh = 0.0f; } #endif @@ -1118,7 +1130,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } +#ifndef FIX_OMASA_DELAY_COMP hDirAC->dirac_read_idx = ( hDirAC->dirac_read_idx + 1 ) % hDirAC->dirac_md_buffer_length; +#endif } /* Formulate average diffuseness over frame */ @@ -1204,6 +1218,9 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( uint8_t nchanSeparateChannels; #endif int16_t nBins; +#ifdef FIX_OMASA_DELAY_COMP + int16_t dirac_read_idx; +#endif DIRAC_DEC_BIN_HANDLE h; h = st_ivas->hDiracDecBin; #ifdef MASA_AND_OBJECTS @@ -1235,6 +1252,9 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; #endif nBins = st_ivas->hDirAC->num_freq_bands; /* Actually bins */ +#ifdef FIX_OMASA_DELAY_COMP + dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; +#endif for ( bin = 0; bin < nBins; bin++ ) { @@ -1399,13 +1419,23 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { +#ifdef FIX_OMASA_DELAY_COMP + aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB][dirac_read_idx]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism[chB][dirac_read_idx]; +#else aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB]; eleDeg = st_ivas->hMasaIsmData->elevation_ism[chB]; +#endif } else { +#ifdef FIX_OMASA_DELAY_COMP + aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; + eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; +#else aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism; eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; +#endif instantChange = 1; } } @@ -2393,6 +2423,9 @@ void preProcessStereoTransportsForMovedObjects( DIRAC_DEC_HANDLE hDirAC; MASA_ISM_DATA_HANDLE hMasaIsmData; uint8_t enableCentering; +#ifdef FIX_OMASA_DELAY_COMP + int16_t dirac_read_idx; +#endif hDirAC = st_ivas->hDirAC; hMasaIsmData = st_ivas->hMasaIsmData; @@ -2426,6 +2459,10 @@ void preProcessStereoTransportsForMovedObjects( /* Perform object-movement based processing */ for ( subframe = firstSubframe; subframe < ( firstSubframe + nSubframes ); subframe++ ) { +#ifdef FIX_OMASA_DELAY_COMP + dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; +#endif + for ( bin = 0; bin < nBins; bin++ ) { float ismPreprocMtxNew[2][2]; @@ -2471,12 +2508,21 @@ void preProcessStereoTransportsForMovedObjects( float panEnesIn[2]; float centeringFactor; +#ifdef FIX_OMASA_DELAY_COMP + ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; +#else ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; +#endif ismRatioAcc += ratio; /* Get input and output panning gains */ +#ifdef FIX_OMASA_DELAY_COMP + ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], + hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], +#else ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex], hMasaIsmData->elevation_ism[ismDirIndex], +#endif panGainsIn ); if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) -- GitLab From b9622617087d96e8f23cee040cb03889979e1db7 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 25 Apr 2023 21:09:01 +0300 Subject: [PATCH 0100/1418] Apply clang format --- lib_dec/ivas_dirac_dec.c | 82 ++++++++++++++++----------------- lib_dec/ivas_ism_metadata_dec.c | 12 ++--- lib_dec/ivas_ism_renderer.c | 20 ++++---- lib_enc/ivas_cpe_enc.c | 4 +- lib_enc/ivas_enc.c | 4 +- lib_enc/ivas_stereo_td_enc.c | 4 +- 6 files changed, 63 insertions(+), 63 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 4f19654485..878657ec8a 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -321,7 +321,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->masa_stereo_type_detect = (MASA_STEREO_TYPE_DETECT *) malloc( sizeof( MASA_STEREO_TYPE_DETECT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } ivas_masa_init_stereotype_detection( hDirAC->masa_stereo_type_detect ); } @@ -401,7 +401,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } if ( hDirAC->num_outputs_dir != num_outputs_dir_old && flag_config == DIRAC_RECONFIGURE ) @@ -410,7 +410,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_dir = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_s( hDirAC->proto_index_dir, 0, hDirAC->num_outputs_dir ); @@ -420,7 +420,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_s( hDirAC->proto_index_diff, 0, hDirAC->num_outputs_diff ); @@ -543,7 +543,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } /* reallocate static memory */ else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->num_outputs_dir != num_outputs_dir_old ) @@ -553,7 +553,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } if ( ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_LS ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) ) @@ -574,7 +574,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->hoa_encoder && ( hDirAC->num_outputs_diff != num_outputs_diff_old ) ) { @@ -583,7 +583,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_f( hDirAC->hoa_encoder, 0.0f, nchan_out_woLFE * hDirAC->num_outputs_diff ); compute_hoa_encoder_mtx( ls_azimuth, ls_elevation, hDirAC->hoa_encoder, hDirAC->num_outputs_diff, hDirAC->hOutSetup.ambisonics_order ); @@ -673,17 +673,17 @@ ivas_error ivas_dirac_dec_config( if ( ( flag_config == DIRAC_OPEN && hDirAC->proto_signal_decorr_on ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->proto_signal_decorr_on && !proto_signal_decorr_on_old ) ) ) { if ( ( error = ivas_dirac_dec_decorr_open( &( hDirAC->h_freq_domain_decorr_ap_params ), - &( hDirAC->h_freq_domain_decorr_ap_state ), - hDirAC->num_freq_bands, - hDirAC->num_outputs_diff, - hDirAC->num_protos_diff, - hDirAC->synthesisConf, - hDirAC->frequency_axis, - nchan_transport > 2 ? 4 : nchan_transport, + &( hDirAC->h_freq_domain_decorr_ap_state ), + hDirAC->num_freq_bands, + hDirAC->num_outputs_diff, + hDirAC->num_protos_diff, + hDirAC->synthesisConf, + hDirAC->frequency_axis, + nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK ) { return error; - } + } } else if ( flag_config == DIRAC_RECONFIGURE && ( !hDirAC->proto_signal_decorr_on && proto_signal_decorr_on_old ) ) { @@ -697,19 +697,19 @@ ivas_error ivas_dirac_dec_config( ivas_dirac_dec_decorr_close( &hDirAC->h_freq_domain_decorr_ap_params, &hDirAC->h_freq_domain_decorr_ap_state ); if ( ( error = ivas_dirac_dec_decorr_open( &( hDirAC->h_freq_domain_decorr_ap_params ), - &( hDirAC->h_freq_domain_decorr_ap_state ), - hDirAC->num_freq_bands, - hDirAC->num_outputs_diff, - hDirAC->num_protos_diff, - hDirAC->synthesisConf, - hDirAC->frequency_axis, - nchan_transport > 2 ? 4 : nchan_transport, + &( hDirAC->h_freq_domain_decorr_ap_state ), + hDirAC->num_freq_bands, + hDirAC->num_outputs_diff, + hDirAC->num_protos_diff, + hDirAC->synthesisConf, + hDirAC->frequency_axis, + nchan_transport > 2 ? 4 : nchan_transport, output_Fs ) ) != IVAS_ERR_OK ) { return error; + } } } - } /* output synthesis */ if ( flag_config == DIRAC_OPEN ) @@ -755,7 +755,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } else if ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->num_protos_diff != num_protos_diff_old ) ) { @@ -764,9 +764,9 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); + } } } - } if ( flag_config == DIRAC_OPEN ) @@ -793,7 +793,7 @@ ivas_error ivas_dirac_dec_config( if ( ( hDirAC->buffer_energy = (float *) malloc( DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); - } + } } set_f( hDirAC->buffer_energy, 0.0f, DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX ); } @@ -1333,9 +1333,9 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->frame_dec_f = (float *) malloc( sizeof( float ) * 2 * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } - } hDirAC->h_output_synthesis_psd_state.proto_power_smooth = hDirAC_mem->proto_power_smooth; hDirAC->h_output_synthesis_psd_state.proto_power_diff_smooth = hDirAC_mem->proto_power_diff_smooth; hDirAC->h_output_synthesis_psd_state.cy_auto_dir_smooth = hDirAC_mem->cy_auto_dir_smooth; @@ -1392,17 +1392,17 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * size ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } } else { if ( ( hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } } - } hDirAC->h_output_synthesis_psd_state.proto_direct_buffer_f = hDirAC_mem->proto_direct_buffer_f; hDirAC->h_output_synthesis_psd_state.proto_diffuse_buffer_f = hDirAC_mem->proto_diffuse_buffer_f; @@ -1414,7 +1414,7 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->direct_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } if ( ( hDirAC_mem->diffuse_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ) ) == NULL ) { @@ -1439,10 +1439,10 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * num_outputs_diff * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } } - } else { if ( num_protos_dir > 2 ) @@ -1450,7 +1450,7 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->reference_power = (float *) malloc( sizeof( float ) * 5 * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); - } + } } if ( hDirAC->proto_signal_decorr_on ) @@ -1458,9 +1458,9 @@ static ivas_error ivas_dirac_alloc_mem( if ( ( hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * 2 * num_freq_bands ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate stack memory for DirAC\n" ) ); + } } } - } return IVAS_ERR_OK; } @@ -1759,10 +1759,10 @@ void ivas_qmetadata_to_dirac( { meta_write_index = ( hDirAC->dirac_bs_md_write_idx + block ) % hDirAC->dirac_md_buffer_length; - for ( band = 0; band < hMasa->config.numCodingBands; ++band ) - { - for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + for ( band = 0; band < hMasa->config.numCodingBands; ++band ) { + for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + { hDirAC->azimuth[meta_write_index][b] = (int16_t) q_direction->band_data[band].azimuth[block]; hDirAC->elevation[meta_write_index][b] = (int16_t) q_direction->band_data[band].elevation[block]; hDirAC->energy_ratio1[meta_write_index][b] = q_direction->band_data[band].energy_ratio[block]; @@ -1831,10 +1831,10 @@ void ivas_qmetadata_to_dirac( { meta_write_index = ( hDirAC->dirac_bs_md_write_idx + block ) % hDirAC->dirac_md_buffer_length; - for ( band = 0; band < hMasa->config.numCodingBands; ++band ) - { - for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + for ( band = 0; band < hMasa->config.numCodingBands; ++band ) { + for ( b = MASA_band_grouping_24[band_mapping[band]]; b < MASA_band_grouping_24[band_mapping[band + 1]]; ++b ) + { hDirAC->azimuth2[meta_write_index][b] = (int16_t) q_direction->band_data[band].azimuth[block]; hDirAC->elevation2[meta_write_index][b] = (int16_t) q_direction->band_data[band].elevation[block]; hDirAC->energy_ratio2[meta_write_index][b] = q_direction->band_data[band].energy_ratio[block]; @@ -1887,7 +1887,7 @@ void ivas_qmetadata_to_dirac( set_s( hDirAC->elevation2[meta_write_index], 0, hDirAC->num_freq_bands ); set_zero( hDirAC->energy_ratio2[meta_write_index], hDirAC->num_freq_bands ); set_zero( hDirAC->spreadCoherence2[meta_write_index], hDirAC->num_freq_bands ); - } + } } #endif } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 1cc7028c55..0565447847 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -396,8 +396,8 @@ ivas_error ivas_ism_metadata_dec( if ( ism_metadata_flag_global ) { /*----------------------------------------------------------------* - * Metadata decoding and dequantization, loop over all objects - *----------------------------------------------------------------*/ + * Metadata decoding and dequantization, loop over all objects + *----------------------------------------------------------------*/ int16_t total_bits_metadata = 0, bits_metadata_ism = 0; int16_t nb_bits_objcod_read; @@ -732,8 +732,8 @@ ivas_error ivas_ism_metadata_dec( } /*----------------------------------------------------------------* - * Set bitsream pointers - *----------------------------------------------------------------*/ + * Set bitsream pointers + *----------------------------------------------------------------*/ /* set the bitstream pointer to its original position */ st0->bit_stream = bstr_orig; @@ -747,8 +747,8 @@ ivas_error ivas_ism_metadata_dec( #ifdef DISCRETE_ISM_DTX_CNG /*----------------------------------------------------------------* - * Updates - *----------------------------------------------------------------*/ + * Updates + *----------------------------------------------------------------*/ set_s( md_diff_flag, 1, nchan_ism ); diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 54856c700d..0b99968a5a 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -256,8 +256,8 @@ void ivas_ism_get_stereo_gains( #ifdef MASA_AND_OBJECTS /*-------------------------------------------------------------------------* -* ivas_masa_ism_separate_object_renderer_open() -* + * ivas_masa_ism_separate_object_renderer_open() + * * Open structures, reserve memory, and init values. *-------------------------------------------------------------------------*/ @@ -361,7 +361,7 @@ void ivas_masa_ism_separate_object_render( #endif #ifdef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) #else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) #endif @@ -392,8 +392,8 @@ void ivas_masa_ism_separate_object_render( azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; #else - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; - elevation = st_ivas->hMasaIsmData->elevation_separated_ism; + azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; + elevation = st_ivas->hMasaIsmData->elevation_separated_ism; #endif } else @@ -402,8 +402,8 @@ void ivas_masa_ism_separate_object_render( azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; #else - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; - elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; + azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; + elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; #endif } @@ -425,7 +425,7 @@ void ivas_masa_ism_separate_object_render( #ifdef OMASA_UPDATES vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); #else - vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); + vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); #endif } else @@ -449,7 +449,7 @@ void ivas_masa_ism_separate_object_render( #ifdef FIX_OMASA_DELAY_COMP for ( k = 0; k < subframe_len; k++ ) #else - for ( k = 0; k < output_frame; k++ ) + for ( k = 0; k < output_frame; k++ ) #endif { g1 = hRendererData->interpolator[k]; @@ -457,7 +457,7 @@ void ivas_masa_ism_separate_object_render( #ifdef FIX_OMASA_DELAY_COMP output_f[j2][k + idx_offset] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k + idx_offset]; #else - output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; + output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; #endif } } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 490cd41d1e..bfa7d86756 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -820,7 +820,7 @@ ivas_error ivas_cpe_enc( dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_NCShift" ); dbgwrite( &n, 2, 1, input_frame, "res/TCA_idx_ica_gD" ); n = -1; - //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + // dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } else if ( hCPE->element_mode == IVAS_CPE_TD ) { @@ -837,7 +837,7 @@ ivas_error ivas_cpe_enc( else if ( hCPE->element_mode == IVAS_CPE_MDCT ) { n = -2; - //dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); + // dbgwrite( &n, 2, 1, input_frame, "res/tdm_ratio_idx.enc" ); } { diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 5d329701cb..920193c999 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -249,7 +249,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ) ) != IVAS_ERR_OK ) { @@ -459,7 +459,7 @@ ivas_error ivas_enc( if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 82e3f4bdfd..7c0649c5ab 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -283,8 +283,8 @@ ivas_error stereo_set_tdm( dbgwrite( &tmp, 2, 1, 320, "res/inst_ratio_L" ); dbgwrite( &ftmp, 4, 1, 320, "res/ratio_L" ); dbgwrite( &tmp, 2, 1, 320, "res/tdm_low_rate_mode" ); - //dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); - //dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); + // dbgwrite( &tmp, 2, 1, 320, "res/tdm_lp_reuse_flag" ); + // dbgwrite( &tmp, 2, 1, 320, "res/mod_ct.enx" ); } #endif hCPE->hCoreCoder[0]->tdm_LRTD_flag = 0; -- GitLab From f15d1763c619cf1d4cb875708d581749564477c1 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 25 Apr 2023 21:12:13 +0300 Subject: [PATCH 0101/1418] Disable DEBUG_MODE_INFO --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index de3c8de9a7..8d94dd3c1e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -#define DEBUG_MODE_INFO /* output most important parameters to the subdirectory "res/" */ +/*#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/" */ -- GitLab From b2357112fb13c7c59f7068381e480a47529a5cd3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 08:50:46 +0200 Subject: [PATCH 0102/1418] MSVC compilation warnings --- lib_dec/ivas_masa_dec.c | 2 ++ lib_enc/ivas_omasa_enc.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 75dfcbe9b0..20bd5c18f9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -119,6 +119,8 @@ ivas_error ivas_masa_decode( int16_t i, ch, ism_imp; #ifdef FIX_OMASA_DELAY_COMP int16_t dirac_bs_md_write_idx; + + dirac_bs_md_write_idx = 0; #endif ism_imp = 0; #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index bcd73cc42a..677558db09 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -72,7 +72,9 @@ ivas_error ivas_omasa_enc_open( ) { int16_t i, j; +#ifndef FIX_OMASA_DELAY_COMP float tmp_f; +#endif OMASA_ENC_HANDLE hOMasa; int16_t numAnalysisChannels; int16_t input_frame; -- GitLab From a3e043792609f56b22d94f91d82a388113dac41d Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 16:24:27 +0200 Subject: [PATCH 0103/1418] merge OMASA_BRATE_SW into MASA_AND_OBJECTS --- lib_com/ivas_ism_com.c | 4 +- lib_com/ivas_omasa_com.c | 2 - lib_com/ivas_prot.h | 10 +-- lib_com/options.h | 1 - lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_init_dec.c | 67 ++------------------ lib_dec/ivas_ism_metadata_dec.c | 6 +- lib_dec/ivas_masa_dec.c | 2 +- lib_dec/ivas_omasa_dec.c | 8 +-- lib_dec/ivas_stat_dec.h | 2 +- lib_dec/ivas_stereo_switching_dec.c | 2 +- lib_enc/ivas_corecoder_enc_reconfig.c | 6 +- lib_enc/ivas_cpe_enc.c | 2 +- lib_enc/ivas_enc.c | 21 ------ lib_enc/ivas_init_enc.c | 8 +-- lib_enc/ivas_ism_metadata_enc.c | 30 --------- lib_enc/ivas_omasa_enc.c | 11 ++-- lib_rend/ivas_dirac_dec_binaural_functions.c | 7 +- 18 files changed, 32 insertions(+), 159 deletions(-) diff --git a/lib_com/ivas_ism_com.c b/lib_com/ivas_ism_com.c index adde308208..3db790e924 100644 --- a/lib_com/ivas_ism_com.c +++ b/lib_com/ivas_ism_com.c @@ -606,7 +606,7 @@ ISM_MODE ivas_ism_mode_select( void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS , const int16_t first_idx /* i : index of first handle to deallocate */ #endif @@ -619,7 +619,7 @@ void ivas_ism_metadata_close( return; } -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS for ( n = first_idx; n < MAX_NUM_OBJECTS; n++ ) #else for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 57618c9540..4bf5c3ed83 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -178,7 +178,6 @@ ISM_MODE ivas_omasa_ism_mode_select( } -#ifdef OMASA_BRATE_SW /*--------------------------------------------------------------- * ivas_set_omasa_TC() * @@ -221,7 +220,6 @@ void ivas_set_omasa_TC( return; } -#endif /*--------------------------------------------------------------- diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 5a5d7023d8..bcf208f550 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -883,7 +883,7 @@ void ivas_param_ism_enc_close( void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS , const int16_t first_idx /* i : index of first handle to deallocate */ #endif @@ -5135,7 +5135,7 @@ void ivas_omasa_enc_close( #endif ); -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS ivas_error ivas_omasa_enc_config( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); @@ -5149,7 +5149,7 @@ void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs, /* i : Input sample rate */ - const ISM_MODE ismMode /* i : ISM mode */ + const ISM_MODE ism_mode /* i : ISM mode */ ); void ivas_omasa_enc( @@ -5211,7 +5211,7 @@ ISM_MODE ivas_omasa_ism_mode_select( const int16_t nchan_ism /* i : number of input ISM's */ ); -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS void ivas_set_omasa_TC( const ISM_MODE ism_mode, /* i : ISM mode */ const int16_t nchan_ism, /* i : number of input ISMs */ @@ -5232,7 +5232,7 @@ ivas_error ivas_masa_ism_data_open( Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS void ivas_masa_ism_data_close( MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 32b61cf5ba..f0218d53e0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,7 +169,6 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ -#define OMASA_BRATE_SW /* VA: support of bitrate switching in OMASA format */ #define FIX_TD5_IN_OMASA // do not transmit extended MD in OMASA #define OMASA_TUNING_TD_STEREO /* VA: tuning of TD stereo in OMASA format */ #define FIX_OMASA_DELAY_COMP /* Nokia: OMASA audio/meta delay compensation */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 6a6b190dfc..6b368ab391 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -915,7 +915,7 @@ ivas_error ivas_dec( st_ivas->ini_active_frame++; } -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS st_ivas->last_ivas_format = st_ivas->ivas_format; #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 3170f3629f..99e2fb0a15 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -70,11 +70,7 @@ ivas_error ivas_dec_setup( Decoder_State *st; int32_t ivas_total_brate; ivas_error error; -#ifdef MASA_AND_OBJECTS -#ifndef OMASA_BRATE_SW - int32_t cpe_brate; -#endif -#endif + error = IVAS_ERR_OK; num_bits_read = 0; @@ -166,7 +162,7 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( st_ivas->last_ivas_format == MASA_FORMAT ) { #endif @@ -181,7 +177,7 @@ ivas_error ivas_dec_setup( return error; } } -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS } else { @@ -208,22 +204,10 @@ ivas_error ivas_dec_setup( /* reconfigure in case a change of operation mode is detected */ if ( ( ivas_total_brate > IVAS_SID_5k2 && ivas_total_brate != st_ivas->hDecoderConfig->last_ivas_total_brate ) || ( st_ivas->ini_active_frame == 0 ) ) { -#ifdef OMASA_BRATE_SW if ( ( error = ivas_omasa_dec_config( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); - if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) && st_ivas->nCPE == 1 ) - { - st_ivas->hCPE[0]->nchan_out = 1; - } - else if ( ( error = ivas_masa_dec_reconfigure( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } } } @@ -1095,36 +1079,10 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifdef OMASA_BRATE_SW if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) { return error; } -#else -#ifdef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) - { - int32_t temp_brate[MAX_SCE]; - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, temp_brate ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); - } - } -#else - if ( ( st_ivas->hIsmMetaData[0] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); - } -#endif -#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -1870,7 +1828,7 @@ void ivas_destroy_dec( } /* ISM metadata handles */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #else ivas_ism_metadata_close( st_ivas->hIsmMetaData ); @@ -1955,24 +1913,7 @@ void ivas_destroy_dec( #ifdef MASA_AND_OBJECTS /* MASA ISM structure */ -#ifdef OMASA_BRATE_SW ivas_masa_ism_data_close( &st_ivas->hMasaIsmData ); -#else - if ( st_ivas->hMasaIsmData != NULL ) - { - if ( st_ivas->hMasaIsmData->delayBuffer != NULL ) - { - for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) - { - free( st_ivas->hMasaIsmData->delayBuffer[i] ); - } - free( st_ivas->hMasaIsmData->delayBuffer ); - st_ivas->hMasaIsmData->delayBuffer = NULL; - } - free( st_ivas->hMasaIsmData ); - st_ivas->hMasaIsmData = NULL; - } -#endif #endif /* Head track data handle */ diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 0f14195073..610ed868e5 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -669,7 +669,7 @@ ivas_error ivas_ism_metadata_dec_create( ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); } -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( element_brate_tmp != NULL ) { #endif @@ -682,7 +682,7 @@ ivas_error ivas_ism_metadata_dec_create( { return error; } -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS } #endif @@ -701,7 +701,7 @@ ivas_error ivas_ism_metadata_dec_create( 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_angle1 /* o : Azimuth/yaw encoding mode */ + int16_t *flag_abs_angle1 /* o : Azimuth/yaw encoding mode */ ) { int16_t idx_angle1, nbits_diff_angle1, diff, sgn; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 325f02ad3b..4ad5e8f437 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1507,7 +1507,7 @@ ivas_error ivas_masa_dec_reconfigure( #endif ); -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_FORMAT ) { st_ivas->nchan_ism = 0; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index a688e0062f..a02a2bf051 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -38,7 +38,7 @@ #ifdef OMASA_UPDATES #include "ivas_prot_rend.h" #endif -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS #include "ivas_rom_com.h" #endif #ifdef DEBUGGING @@ -95,7 +95,6 @@ ivas_error ivas_masa_ism_data_open( } -#ifdef OMASA_BRATE_SW /*-------------------------------------------------------------------* * ivas_masa_ism_data_close() * @@ -128,11 +127,8 @@ void ivas_masa_ism_data_close( return; } -#endif -#endif -#ifdef OMASA_BRATE_SW /*--------------------------------------------------------------------------* * ivas_omasa_dec_config() * @@ -339,10 +335,8 @@ ivas_error ivas_omasa_dec_config( return IVAS_ERR_OK; } -#endif -#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------------------* * ivas_set_surplus_brate_dec() * diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index cd14053522..793b438aaf 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1225,7 +1225,7 @@ typedef struct Decoder_Struct DECODER_CONFIG_HANDLE hDecoderConfig; /* Decoder configuration structure */ IVAS_FORMAT ivas_format; /* IVAS format */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS IVAS_FORMAT last_ivas_format; /* last frame IVAS format */ #endif int16_t sid_format; /* IVAS format indicator from SID frame */ diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index ff37582cc4..584b48f906 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -880,7 +880,7 @@ ivas_error stereo_memory_dec( * Bitrate switching in MASA format *---------------------------------------------------------------*/ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && nchan_transport == 2 ) #else if ( ivas_format == MASA_FORMAT && nchan_transport == 2 ) diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index a7cd931a1a..31dce8ad0a 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -251,7 +251,7 @@ ivas_error ivas_corecoder_enc_reconfig( } /* propagate input audio buffers */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( n_CoreCoder_existing > sce_id && hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) #else if ( n_CoreCoder_existing > sce_id ) @@ -264,7 +264,7 @@ ivas_error ivas_corecoder_enc_reconfig( st_ivas->hSCE[sce_id]->hCoreCoder[0]->hBstr->ind_list = ind_list + sce_id * MAX_NUM_INDICES; /* only reset indices if it is not the first index list, this already contains the IVAS format bits */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( sce_id > 0 || hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) #else if ( sce_id > 0 ) @@ -299,7 +299,7 @@ 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() */ st_ivas->hCPE[cpe_id]->hCoreCoder[n]->hBstr->ind_list = ind_list + ( cpe_id * CPE_CHANNELS + n + st_ivas->nSCE ) * MAX_NUM_INDICES; -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS if ( ( cpe_id * CPE_CHANNELS + n > 0 ) || ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->nSCE > 0 ) || ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 ) ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 3042bab0c4..c34216b079 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -283,7 +283,7 @@ ivas_error ivas_cpe_enc( if ( hCPE->element_mode != IVAS_CPE_MDCT && ( hCPE->element_brate != hCPE->last_element_brate || hCPE->last_element_mode != hCPE->element_mode || sts[0]->ini_frame == 0 || -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS ( ivas_total_brate != st_ivas->hEncoderConfig->last_ivas_total_brate ) || #endif sts[0]->last_core_brate <= SID_2k40 ) ) /* If the last frame was SID or NO_DATA, we need to run stereo_dft_config here since VAD decision is not known yet */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 514e90fb51..1708e4d701 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -294,14 +294,10 @@ ivas_error ivas_enc( float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; -#ifdef OMASA_BRATE_SW if ( ( error = ivas_omasa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_masa_enc_reconfigure( st_ivas ); -#endif hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; @@ -312,25 +308,8 @@ ivas_error ivas_enc( mvr2r( data_f[hEncoderConfig->nchan_ism], data_f[hEncoderConfig->nchan_ism + 1], input_frame ); } - /* nb_bits_metadata[0] = 0; */ set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); - -#ifdef OMASA_BRATE_SW idx_separated_object = 0; -#else - /* Configure MASA encoder based on frame parameters */ - if ( ( error = ivas_masa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - idx_separated_object = 0; - - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - /* Configure oMASA analysis based on MASA config */ - ivas_omasa_set_config( st_ivas->hOMasa, st_ivas->hMasa, st_ivas->hEncoderConfig->input_Fs, st_ivas->ism_mode ); - } -#endif /* Estimate TF-tile energy for the input MASA stream */ ivas_masa_estimate_energy( st_ivas->hMasa, &( data_f[hEncoderConfig->nchan_ism] ), input_frame, st_ivas->nchan_transport ); diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 404a0d577c..7e9bdcd0e0 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -610,12 +610,10 @@ ivas_error ivas_init_encoder( return error; } -#ifdef OMASA_BRATE_SW for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { set_f( st_ivas->hQMetaData->masa_to_total_energy_ratio[i], 0, MASA_FREQUENCY_BANDS ); } -#endif if ( ( error = ivas_masa_enc_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -630,11 +628,7 @@ ivas_error ivas_init_encoder( } } -#ifdef OMASA_UPDATES if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) -#else - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) -#endif { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } @@ -1046,7 +1040,7 @@ void ivas_destroy_enc( } /* ISM metadata handles */ -#ifdef OMASA_BRATE_SW +#ifdef MASA_AND_OBJECTS ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); #else ivas_ism_metadata_close( st_ivas->hIsmMetaData ); diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 5bac1b332e..13d7d64e4f 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -730,37 +730,7 @@ ivas_error ivas_ism_metadata_enc_create( if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { nchan_transport = MAX_PARAM_ISM_WAVE; -#ifdef OMASA_BRATE_SW ivas_set_omasa_TC( st_ivas->ism_mode, n_ISms, &st_ivas->nSCE, &st_ivas->nCPE ); -#else - switch ( st_ivas->ism_mode ) - { - case ISM_MASA_MODE_PARAM: - st_ivas->nCPE = 1; - st_ivas->nSCE = 0; - break; -#ifdef OMASA_UPDATES - case ISM_MASA_MODE_MASA_ONE_OBJ: - case ISM_MASA_MODE_PARAM_ONE_OBJ: -#else - case ISM_MASA_MODE_ONE_OBJ: -#endif - st_ivas->nCPE = 1; - st_ivas->nSCE = 1; - break; - case ISM_MASA_MODE_DISC: - st_ivas->nCPE = 1; - st_ivas->nSCE = n_ISms; - break; - case ISM_MODE_NONE: - st_ivas->nSCE = 0; - st_ivas->nCPE = 1; - - break; - default: - break; - } -#endif } else { diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 677558db09..fdbe8d063d 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -225,7 +225,6 @@ void ivas_omasa_enc_close( } -#ifdef OMASA_BRATE_SW /*--------------------------------------------------------------------------* * ivas_omasa_enc_config() * @@ -345,7 +344,6 @@ ivas_error ivas_omasa_enc_config( return IVAS_ERR_OK; } -#endif /*--------------------------------------------------------------------------* @@ -357,18 +355,17 @@ ivas_error ivas_omasa_enc_config( void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ - const int32_t input_Fs /* i : Input sample rate */ - , - const ISM_MODE ismMode /* i : ISM mode */ + const int32_t input_Fs, /* i : Input sample rate */ + const ISM_MODE ism_mode /* i : ISM mode */ ) { uint8_t i, maxBin; /* Determine the number of bands */ #ifdef OMASA_UPDATES - if ( ismMode == ISM_MODE_NONE || ismMode == ISM_MASA_MODE_MASA_ONE_OBJ ) + if ( ism_mode == ISM_MODE_NONE || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) #else - if ( ismMode == ISM_MODE_NONE ) + if ( ism_mode == ISM_MODE_NONE ) #endif { /* use full resolution for the ISM+MASA merge and reduce later */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1525c4a508..7ee3add834 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -2246,10 +2246,11 @@ static void hrtfShGetHrtf( /*! r: Configured reqularization factor value to be set. */ static float configure_reqularization_factor( - const IVAS_FORMAT ivas_format, /* i: IVAS codec format in use */ - const int32_t ivas_brate ) /* i: Current IVAS bitrate */ + const IVAS_FORMAT ivas_format, /* i : IVAS codec format in use */ + const int32_t ivas_brate ) /* i : Current IVAS bitrate */ { float reqularizationFactor; + reqularizationFactor = 1.0f; /* Default value */ if ( ivas_format == MASA_FORMAT ) @@ -2308,7 +2309,7 @@ static float configure_reqularization_factor( } } - /* For SBA and parametric ISM, currently in default value of 1.0f. */ + /* For SBA and parametric ISM, default value of 1.0f. */ return reqularizationFactor; } -- GitLab From f69a7dcb58cdb54876e468de9e16d202563714e7 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 16:28:39 +0200 Subject: [PATCH 0104/1418] merge OMASA_TUNING_TD_STEREO and FIX_TD5_IN_OMASA into MASA_AND_OBJECTS --- lib_com/ivas_prot.h | 8 ++++---- lib_com/ivas_stereo_td_bit_alloc.c | 4 ++-- lib_com/options.h | 2 -- lib_dec/ivas_cpe_dec.c | 2 +- lib_dec/ivas_ism_metadata_dec.c | 2 +- lib_dec/ivas_stereo_td_dec.c | 15 +++++---------- lib_enc/ivas_cpe_enc.c | 4 ++-- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_stereo_td_analysis.c | 4 ++-- lib_enc/ivas_stereo_td_enc.c | 18 +++++------------- 10 files changed, 23 insertions(+), 38 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index bcf208f550..79a8a6db6d 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1778,7 +1778,7 @@ void stereo_tdm_prep_dwnmx ( ); int16_t stereo_tdm_ener_analysis( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE structure */ @@ -1803,7 +1803,7 @@ void stereo_td_init_dec( ); void tdm_configure_dec( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ @@ -1855,7 +1855,7 @@ void tdm_ol_pitch_comparison( ); void tdm_configure_enc( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ @@ -1874,7 +1874,7 @@ ivas_error signaling_enc_secondary( ); void tdm_bit_alloc( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index f593d41a18..97ddb731fe 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -74,7 +74,7 @@ *-------------------------------------------------------------------*/ void tdm_bit_alloc( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ @@ -139,7 +139,7 @@ void tdm_bit_alloc( *total_brate_sec = tdm_bit_allc_tbl[idx][coder_type]; /* secondary channel bitrate allocation based on the energy scaling ratio */ -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS if ( ( ivas_format != MASA_ISM_FORMAT && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && coder_type > UNVOICED ) ) #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) diff --git a/lib_com/options.h b/lib_com/options.h index f0218d53e0..d251f3b838 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,8 +169,6 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ -#define FIX_TD5_IN_OMASA // do not transmit extended MD in OMASA -#define OMASA_TUNING_TD_STEREO /* VA: tuning of TD stereo in OMASA format */ #define FIX_OMASA_DELAY_COMP /* Nokia: OMASA audio/meta delay compensation */ #endif /* MASA_AND_OBJECTS */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 43b02b0120..e6cbf2bc74 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -414,7 +414,7 @@ ivas_error ivas_cpe_dec( if ( !st_ivas->bfi ) { tdm_configure_dec( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS st_ivas->ivas_format, #endif hCPE, &tdm_ratio_idx, nb_bits_metadata ); diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 610ed868e5..9b12be21ed 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -233,7 +233,7 @@ ivas_error ivas_ism_metadata_dec( } /* read extended metadata presence flag */ -#ifdef FIX_TD5_IN_OMASA +#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MODE_DISC && ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) #else if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index d8e817638a..1b90885b0f 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -84,7 +84,7 @@ void stereo_td_init_dec( *-------------------------------------------------------------------*/ void tdm_configure_dec( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ @@ -308,15 +308,10 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( -#ifdef OMASA_TUNING_TD_STEREO - ivas_format, -#endif - - hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, - hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), - &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); + tdm_bit_alloc( ivas_format, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index c34216b079..bce8d37984 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -419,7 +419,7 @@ ivas_error ivas_cpe_enc( { /* Determine the energy ratio between the 2 channels */ tdm_ratio_idx = stereo_tdm_ener_analysis( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS ivas_format, #endif hCPE, input_frame, &tdm_SM_or_LRTD_Pri, &tdm_ratio_idx_SM ); @@ -589,7 +589,7 @@ ivas_error ivas_cpe_enc( tdm_ol_pitch_comparison( hCPE, pitch_fr, voicing_fr ); tdm_configure_enc( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS ivas_format, #endif hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 13d7d64e4f..e0451811ac 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -279,7 +279,7 @@ ivas_error ivas_ism_metadata_enc( #endif /* write extended metadata presence flag */ -#ifdef FIX_TD5_IN_OMASA +#ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MODE_DISC && *ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) #else if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE ) diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index ee07ae2f52..8f86f25986 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -111,7 +111,7 @@ static float Comp_diff_lt_corr( CPE_ENC_HANDLE hCPE, const int16_t IsSideMono, c *-------------------------------------------------------------------*/ int16_t stereo_tdm_ener_analysis( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE structure */ @@ -198,7 +198,7 @@ int16_t stereo_tdm_ener_analysis( * of L and R needed to create new mono/side signals *----------------------------------------------------------------*/ -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index d8c8086562..0626f3d859 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -302,7 +302,7 @@ ivas_error stereo_set_tdm( *-------------------------------------------------------------------*/ void tdm_configure_enc( -#ifdef OMASA_TUNING_TD_STEREO +#ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ @@ -431,11 +431,7 @@ void tdm_configure_enc( } hStereoTD->tdm_lp_reuse_flag = 1; -#ifdef OMASA_TUNING_TD_STEREO if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 11000 ) -#else - if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12000 ) -#endif { sts[1]->coder_type = INACTIVE; } @@ -484,14 +480,10 @@ void tdm_configure_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( -#ifdef OMASA_TUNING_TD_STEREO - ivas_format, -#endif - hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, - hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), - &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, - sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); + tdm_bit_alloc( ivas_format, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), + &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, + sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #else tdm_bit_alloc( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); #endif -- GitLab From 3b9c6d094869565165ea61841cae3b5a0967f07a Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 16:38:44 +0200 Subject: [PATCH 0105/1418] merge FIX_OMASA_DELAY_COMP into MASA_AND_OBJECTS --- lib_com/delay_comp.c | 4 +- lib_com/ivas_prot.h | 7 -- lib_com/options.h | 4 +- lib_dec/ivas_dec.c | 24 +---- lib_dec/ivas_dirac_dec.c | 2 +- lib_dec/ivas_dirac_output_synthesis_dec.c | 50 +--------- lib_dec/ivas_ism_renderer.c | 48 +-------- lib_dec/ivas_masa_dec.c | 63 +----------- lib_dec/ivas_stat_dec.h | 12 +-- lib_enc/ivas_init_enc.c | 6 +- lib_enc/ivas_omasa_enc.c | 100 ------------------- lib_enc/ivas_stat_enc.h | 8 -- lib_rend/ivas_dirac_dec_binaural_functions.c | 46 ++------- 13 files changed, 23 insertions(+), 351 deletions(-) diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 8e811e6938..2566ad5fad 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -69,7 +69,7 @@ int32_t get_delay( { delay = IVAS_ENC_DELAY_NS; -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else if ( ivas_format == MASA_FORMAT ) @@ -109,7 +109,7 @@ int32_t get_delay( } -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else if ( ivas_format == MASA_FORMAT ) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 79a8a6db6d..338e1b4d24 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5127,15 +5127,9 @@ ivas_error ivas_omasa_enc_open( ); void ivas_omasa_enc_close( -#ifdef FIX_OMASA_DELAY_COMP OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ -#else - OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ - const int16_t nchan_ism /* i : number of objects */ -#endif ); -#ifdef MASA_AND_OBJECTS ivas_error ivas_omasa_enc_config( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ); @@ -5143,7 +5137,6 @@ ivas_error ivas_omasa_enc_config( ivas_error ivas_omasa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#endif void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ diff --git a/lib_com/options.h b/lib_com/options.h index d251f3b838..d86a5355fa 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -169,9 +169,7 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ -#define FIX_OMASA_DELAY_COMP /* Nokia: OMASA audio/meta delay compensation */ - -#endif /* MASA_AND_OBJECTS */ +#endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 6b368ab391..8e5ab73f21 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -404,9 +404,7 @@ ivas_error ivas_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_OMASA_DELAY_COMP int16_t dirac_bs_md_write_idx = 0; -#endif st = st_ivas->hCPE[0]->hCoreCoder[0]; nb_bits_metadata[0] = 0; @@ -428,9 +426,7 @@ ivas_error ivas_dec( st_ivas->hDirAC->numIsmDirections = 0; } -#ifdef FIX_OMASA_DELAY_COMP dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ -#endif } /* MASA metadata decoding */ @@ -481,12 +477,10 @@ ivas_error ivas_dec( if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) #endif { -#ifdef FIX_OMASA_DELAY_COMP int16_t azimuth_ism; int16_t elevation_ism; int16_t block; int16_t meta_write_index; -#endif /* decode ISM metadata */ if ( ( error = ivas_ism_metadata_dec( ism_total_brate, @@ -506,7 +500,6 @@ ivas_error ivas_dec( { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#ifdef FIX_OMASA_DELAY_COMP azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); @@ -516,15 +509,10 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; } -#else - st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); - st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); -#endif } } else /* ISM_MASA_MODE_MASA_ONE_OBJ */ { -#ifdef FIX_OMASA_DELAY_COMP azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); @@ -534,10 +522,6 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; } -#else - st_ivas->hMasaIsmData->azimuth_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); - st_ivas->hMasaIsmData->elevation_separated_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); -#endif } #else for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -647,9 +631,7 @@ ivas_error ivas_dec( #endif { float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#ifdef FIX_OMASA_DELAY_COMP int16_t dirac_read_idx; -#endif #ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) @@ -667,14 +649,12 @@ ivas_error ivas_dec( } } -#ifdef FIX_OMASA_DELAY_COMP dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; -#endif + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); -#ifdef FIX_OMASA_DELAY_COMP st_ivas->hDirAC->dirac_read_idx = dirac_read_idx; /* Original read index is needed for the next function which will update it again */ -#endif + ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); } else diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index db8caed4bb..7fb40f6a4f 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -843,7 +843,7 @@ ivas_error ivas_dirac_dec_config( { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; } -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) #else else if ( st_ivas->ivas_format == MASA_FORMAT ) diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index a7fd962ff9..d5e5710fa2 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -1625,48 +1625,25 @@ void ivas_dirac_dec_compute_directional_responses( } else { -#ifdef FIX_OMASA_DELAY_COMP ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir][hDirAC->dirac_read_idx], hMasaIsm->elevation_ism[dir][hDirAC->dirac_read_idx], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); -#else - ivas_dirac_dec_get_response( hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], direct_response_temp, hDirAC->hOutSetup.ambisonics_order ); -#endif } for ( l = 0; l < num_channels_dir; l++ ) { -#ifdef FIX_OMASA_DELAY_COMP direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; -#else - direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; -#endif } } -#ifdef FIX_OMASA_DELAY_COMP masaDirect = hDirAC->energy_ratio1[hDirAC->dirac_read_idx][k] + EPSILON; -#else - masaDirect = hDirAC->energy_ratio1[subframe_idx][k] + EPSILON; -#endif if ( hDirAC->numParametricDirections == 2 ) { -#ifdef FIX_OMASA_DELAY_COMP masaDirect += hDirAC->energy_ratio2[hDirAC->dirac_read_idx][k]; -#else - masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; -#endif } -#ifdef FIX_OMASA_DELAY_COMP + ismDirect = hMasaIsm->energy_ratio_ism[0][hDirAC->dirac_read_idx][k]; -#else - ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; -#endif for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) { -#ifdef FIX_OMASA_DELAY_COMP ismDirect += hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; -#else - ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; -#endif } totalDirect = masaDirect + ismDirect; @@ -1770,11 +1747,7 @@ void ivas_dirac_dec_compute_directional_responses( else { #ifdef OMASA_UPDATES -#ifdef FIX_OMASA_DELAY_COMP vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir][hDirAC->dirac_read_idx], hMasaIsm->elevation_ism[dir][hDirAC->dirac_read_idx], 1 ); -#else - vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir], 1 ); -#endif #else vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir] ); #endif @@ -1782,40 +1755,21 @@ void ivas_dirac_dec_compute_directional_responses( for ( l = 0; l < num_channels_dir; l++ ) { -#ifdef FIX_OMASA_DELAY_COMP direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; -#else - direct_response_ism[l] += direct_response_temp[l] * hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; -#endif } } normalizePanningGains( direct_response_ism, num_channels_dir ); -#ifdef FIX_OMASA_DELAY_COMP masaDirect = hDirAC->energy_ratio1[hDirAC->dirac_read_idx][k] + EPSILON; -#else - masaDirect = hDirAC->energy_ratio1[subframe_idx][k] + EPSILON; -#endif if ( hDirAC->numParametricDirections == 2 ) { -#ifdef FIX_OMASA_DELAY_COMP masaDirect += hDirAC->energy_ratio2[hDirAC->dirac_read_idx][k]; -#else - masaDirect += hDirAC->energy_ratio2[subframe_idx][k]; -#endif } -#ifdef FIX_OMASA_DELAY_COMP + ismDirect = hMasaIsm->energy_ratio_ism[0][hDirAC->dirac_read_idx][k]; -#else - ismDirect = hMasaIsm->energy_ratio_ism[0][subframe_idx][k]; -#endif for ( dir = 1; dir < hDirAC->numIsmDirections; dir++ ) { -#ifdef FIX_OMASA_DELAY_COMP ismDirect += hMasaIsm->energy_ratio_ism[dir][hDirAC->dirac_read_idx][k]; -#else - ismDirect += hMasaIsm->energy_ratio_ism[dir][subframe_idx][k]; -#endif } totalDirect = masaDirect + ismDirect; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 9ffc1b479c..a44a8c4588 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -274,11 +274,8 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( set_f( st_ivas->hIsmRendererData->prev_gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); } -#ifdef FIX_OMASA_DELAY_COMP interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); -#else - interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / 50 ); -#endif + for ( i = 0; i < interpolator_length; i++ ) { st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length ); @@ -341,26 +338,18 @@ void ivas_masa_ism_separate_object_render( int16_t azimuth, elevation; int16_t num_objects; uint8_t single_separated; -#ifdef FIX_OMASA_DELAY_COMP int16_t block; int16_t subframe_len; int16_t idx_offset; int16_t dirac_read_idx; -#endif hVBAPdata = st_ivas->hVBAPdata; nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; hRendererData = st_ivas->hIsmRendererData; lfe_index = st_ivas->hDirAC->hOutSetup.index_lfe[0]; -#ifdef FIX_OMASA_DELAY_COMP subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; -#endif -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { single_separated = 1; num_objects = 1; @@ -375,32 +364,20 @@ void ivas_masa_ism_separate_object_render( { delay_signal( input_f[obj], output_frame, st_ivas->hMasaIsmData->delayBuffer[obj], st_ivas->hMasaIsmData->delayBuffer_size ); /* Delay the signal to match CLDFB delay */ -#ifdef FIX_OMASA_DELAY_COMP for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { idx_offset = block * subframe_len; dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; -#endif if ( single_separated ) { -#ifdef FIX_OMASA_DELAY_COMP azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; -#else - azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism; - elevation = st_ivas->hMasaIsmData->elevation_separated_ism; -#endif } else { -#ifdef FIX_OMASA_DELAY_COMP azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; -#else - azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj]; - elevation = st_ivas->hMasaIsmData->elevation_ism[obj]; -#endif } if ( st_ivas->hOutSetup.is_planar_setup ) @@ -408,21 +385,10 @@ void ivas_masa_ism_separate_object_render( /* If no elevation support in output format, then rendering should be done with zero elevation */ elevation = 0; } -#ifndef OMASA_UPDATES - else if ( output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_5_1_4 ) - { - /* For no negative elevations, it's better to map them to zero */ - elevation = elevation < 0 ? 0 : elevation; - } -#endif if ( hVBAPdata != NULL ) { -#ifdef OMASA_UPDATES vbap_determine_gains( hVBAPdata, gains, azimuth, elevation, 1 ); -#else - vbap_determine_gains( hVBAPdata, gains, azimuth, elevation ); -#endif } else { @@ -442,31 +408,19 @@ void ivas_masa_ism_separate_object_render( if ( fabsf( gains[j] ) > 0.0f || fabsf( hRendererData->prev_gains[obj][j] ) > 0.0f ) { -#ifdef FIX_OMASA_DELAY_COMP for ( k = 0; k < subframe_len; k++ ) -#else - for ( k = 0; k < output_frame; k++ ) -#endif { g1 = hRendererData->interpolator[k]; g2 = 1.0f - g1; -#ifdef FIX_OMASA_DELAY_COMP output_f[j2][k + idx_offset] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k + idx_offset]; -#else - output_f[j2][k] += ( g1 * gains[j] + g2 * hRendererData->prev_gains[obj][j] ) * input_f[obj][k]; -#endif } } hRendererData->prev_gains[obj][j] = gains[j]; } -#ifdef FIX_OMASA_DELAY_COMP } -#endif } -#ifdef FIX_OMASA_DELAY_COMP st_ivas->hDirAC->dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hDirAC->dirac_md_buffer_length; -#endif return; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 4ad5e8f437..37941c7328 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -76,11 +76,7 @@ static int16_t decode_lfe_to_total_energy_ratio( MCMASA_LFE_SYNTH_DATA_HANDLE hM static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas ); #ifdef MASA_AND_OBJECTS -#ifdef FIX_OMASA_DELAY_COMP static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length ); -#else -static int16_t ivas_decode_masaism_metadata( IVAS_QMETADATA_HANDLE hQMetaData, MASA_DECODER_HANDLE hMasa, MASA_ISM_DATA_HANDLE hMasaIsmData, const int16_t nchan_ism, uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, const int16_t ism_imp ); -#endif static void decode_index_slice( int16_t index, int16_t *ratio_idx_ism, const int16_t nchan_ism, const int16_t K ); @@ -113,11 +109,9 @@ ivas_error ivas_masa_decode( #ifdef MASA_AND_OBJECTS int16_t obj; int16_t i, ch, ism_imp; -#ifdef FIX_OMASA_DELAY_COMP int16_t dirac_bs_md_write_idx; dirac_bs_md_write_idx = 0; -#endif ism_imp = 0; #endif @@ -334,11 +328,7 @@ ivas_error ivas_masa_decode( #endif { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, -#ifdef FIX_OMASA_DELAY_COMP st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); -#else - st_ivas->hMasaIsmData->idx_separated_ism, ism_imp ); -#endif } #ifdef OMASA_UPDATES @@ -351,7 +341,6 @@ ivas_error ivas_masa_decode( { if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) { -#ifdef FIX_OMASA_DELAY_COMP int16_t sf; int16_t meta_write_index; @@ -361,10 +350,6 @@ ivas_error ivas_masa_decode( st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->azimuth_ism[obj][meta_write_index]; st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->elevation_ism[obj][meta_write_index]; } -#else - st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->hMasaIsmData->azimuth_ism[obj]; - st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->hMasaIsmData->elevation_ism[obj]; -#endif } } } @@ -471,9 +456,8 @@ ivas_error ivas_masa_decode( if ( st_ivas->hDirAC != NULL ) { -#ifdef FIX_OMASA_DELAY_COMP dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ -#endif + ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, SBA_MODE_NONE, 0 ); } @@ -492,39 +476,27 @@ ivas_error ivas_masa_decode( { int16_t b; int16_t block; -#ifdef FIX_OMASA_DELAY_COMP int16_t meta_write_index; -#endif for ( i = 0; i < st_ivas->hDirAC->numIsmDirections; i++ ) /* Todo Nokia: Probably there is a better place for this eventually */ { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { -#ifdef FIX_OMASA_DELAY_COMP meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; -#endif + for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { -#ifdef FIX_OMASA_DELAY_COMP st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] -= st_ivas->hMasaIsmData->energy_ratio_ism[i][meta_write_index][b]; -#else - st_ivas->hDirAC->diffuseness_vector[block][b] -= st_ivas->hMasaIsmData->energy_ratio_ism[i][block][b]; -#endif } } } for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { -#ifdef FIX_OMASA_DELAY_COMP meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; -#endif + for ( b = 0; b < CLDFB_NO_CHANNELS_MAX; b++ ) { -#ifdef FIX_OMASA_DELAY_COMP st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] = max( 0.0f, st_ivas->hDirAC->diffuseness_vector[meta_write_index][b] ); -#else - st_ivas->hDirAC->diffuseness_vector[block][b] = max( 0.0f, st_ivas->hDirAC->diffuseness_vector[block][b] ); -#endif } } } @@ -2328,13 +2300,9 @@ static int16_t ivas_decode_masaism_metadata( uint16_t *bit_stream, int16_t *next_bit_pos, const int16_t idx_separated_object, -#ifdef FIX_OMASA_DELAY_COMP const int16_t ism_imp, const int16_t dirac_bs_md_write_idx, const int16_t dirac_md_buffer_length ) -#else - const int16_t ism_imp ) -#endif { int16_t sf, band, dir, nbands, nblocks, obj, i; float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; @@ -2346,10 +2314,9 @@ static int16_t ivas_decode_masaism_metadata( int16_t nb_bits_read; #ifdef OMASA_UPDATES float delta_phi; -#ifdef FIX_OMASA_DELAY_COMP int16_t meta_write_index; #endif -#endif + nb_bits_read = *next_bit_pos; nbands = hQMetaData->q_direction->cfg.nbands; nblocks = hQMetaData->q_direction->cfg.nblocks; /* To do: what if other value than 4? */ @@ -2434,17 +2401,12 @@ static int16_t ivas_decode_masaism_metadata( #endif -#ifdef FIX_OMASA_DELAY_COMP for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { meta_write_index = ( dirac_bs_md_write_idx + sf ) % dirac_md_buffer_length; hMasaIsmData->azimuth_ism[obj][meta_write_index] = (int16_t) rint( azimuth ); hMasaIsmData->elevation_ism[obj][meta_write_index] = (int16_t) rint( elevation ); } -#else - hMasaIsmData->azimuth_ism[obj] = (int16_t) rint( azimuth ); - hMasaIsmData->elevation_ism[obj] = (int16_t) rint( elevation ); -#endif } /* Modify ISM metadata based on the MASA-to-total energy ratios */ @@ -2475,17 +2437,12 @@ static int16_t ivas_decode_masaism_metadata( { i = sf; } -#ifdef FIX_OMASA_DELAY_COMP + meta_write_index = ( dirac_bs_md_write_idx + sf ) % dirac_md_buffer_length; -#endif for ( dir = 0; dir < nchan_ism; dir++ ) { -#ifdef FIX_OMASA_DELAY_COMP hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; -#else - hMasaIsmData->energy_ratio_ism[dir][sf][b] = energy_ratio_ism[i][band][dir]; -#endif } } } @@ -2515,17 +2472,12 @@ void ivas_masa_ism_set_edited_objects( { if ( st_ivas->editing_ism_enabled ) { -#ifdef FIX_OMASA_DELAY_COMP int16_t sf; for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) { hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->azimuth_edited; hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->elevation_edited; } -#else - hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism] = st_ivas->azimuth_edited; - hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism] = st_ivas->elevation_edited; -#endif #ifdef OMASA_UPDATES st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->azimuth = st_ivas->azimuth_edited; st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->elevation = st_ivas->elevation_edited; @@ -2562,17 +2514,12 @@ void ivas_masa_ism_set_edited_objects( { if ( st_ivas->hMasaIsmData->idx_separated_ism == st_ivas->index_of_edited_ism ) { -#ifdef FIX_OMASA_DELAY_COMP int16_t sf; for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) { st_ivas->hMasaIsmData->azimuth_separated_ism[sf] = st_ivas->azimuth_edited; st_ivas->hMasaIsmData->elevation_separated_ism[sf] = st_ivas->elevation_edited; } -#else - st_ivas->hMasaIsmData->azimuth_separated_ism = st_ivas->azimuth_edited; - st_ivas->hMasaIsmData->elevation_separated_ism = st_ivas->elevation_edited; -#endif } } } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 793b438aaf..a643fe15a0 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1144,28 +1144,18 @@ typedef struct ivas_masa_decoder_struct /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure { -#ifdef FIX_OMASA_DELAY_COMP int16_t azimuth_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; int16_t elevation_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; float energy_ratio_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; -#else - int16_t azimuth_ism[MAX_NUM_OBJECTS]; - int16_t elevation_ism[MAX_NUM_OBJECTS]; - float energy_ratio_ism[MAX_NUM_OBJECTS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif int16_t azimuth_ism_edited[MAX_NUM_OBJECTS]; int16_t elevation_ism_edited[MAX_NUM_OBJECTS]; uint8_t ism_is_edited[MAX_NUM_OBJECTS]; int16_t idx_separated_ism; -#ifdef FIX_OMASA_DELAY_COMP int16_t azimuth_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; int16_t elevation_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; -#else - int16_t azimuth_separated_ism; - int16_t elevation_separated_ism; -#endif + #ifdef OMASA_UPDATES float q_azimuth_old[MAX_NUM_OBJECTS]; float q_elevation_old[MAX_NUM_OBJECTS]; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 7e9bdcd0e0..6c8c10226f 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -1087,11 +1087,7 @@ void ivas_destroy_enc( #ifdef MASA_AND_OBJECTS if ( st_ivas->hOMasa != NULL ) { -#ifdef FIX_OMASA_DELAY_COMP - ivas_omasa_enc_close( st_ivas->hOMasa ); -#else - ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); -#endif + ivas_omasa_enc_close( st_ivas->hOMasa ); // VE!!!!! st_ivas->hOMasa = NULL; } #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index fdbe8d063d..bd38a64945 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -72,9 +72,6 @@ ivas_error ivas_omasa_enc_open( ) { int16_t i, j; -#ifndef FIX_OMASA_DELAY_COMP - float tmp_f; -#endif OMASA_ENC_HANDLE hOMasa; int16_t numAnalysisChannels; int16_t input_frame; @@ -91,31 +88,6 @@ ivas_error ivas_omasa_enc_open( numAnalysisChannels = st_ivas->hEncoderConfig->nchan_ism; -#ifndef FIX_OMASA_DELAY_COMP - /* initialize delay compensation */ - hOMasa->num_samples_delay_comp = NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS ); - tmp_f = ( (float) hOMasa->num_samples_delay_comp ) / (float) ( NS2SA( st_ivas->hEncoderConfig->input_Fs, DIRAC_SLOT_NS ) ); - hOMasa->num_slots_delay_comp = (int16_t) ( tmp_f ); - - if ( tmp_f > hOMasa->num_slots_delay_comp ) - { - hOMasa->num_slots_delay_comp++; - hOMasa->offset_comp = -hOMasa->num_samples_delay_comp; - hOMasa->num_samples_delay_comp = hOMasa->num_slots_delay_comp * NS2SA( st_ivas->hEncoderConfig->input_Fs, DIRAC_SLOT_NS ); - hOMasa->offset_comp += hOMasa->num_samples_delay_comp; - } - else - { - hOMasa->offset_comp = 0; - } - - for ( i = 0; i < numAnalysisChannels; i++ ) - { - hOMasa->delay_buffer[i] = (float *) malloc( NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) * sizeof( float ) ); /* Todo Nokia: Return errors if alloc fails */ - set_zero( hOMasa->delay_buffer[i], NS2SA( st_ivas->hEncoderConfig->input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_NS ) ); - } -#endif - /* open/initialize CLDFB */ hOMasa->num_Cldfb_instances = numAnalysisChannels; for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) @@ -178,24 +150,11 @@ ivas_error ivas_omasa_enc_open( *--------------------------------------------------------------------------*/ void ivas_omasa_enc_close( -#ifdef FIX_OMASA_DELAY_COMP OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ -#else - OMASA_ENC_HANDLE hOMasa, /* i/o: encoder OMASA handle */ - const int16_t nchan_ism /* i : number of objects */ -#endif ) { int16_t i, j; -#ifndef FIX_OMASA_DELAY_COMP - for ( i = 0; i < nchan_ism; i++ ) - { - free( hOMasa->delay_buffer[i] ); - hOMasa->delay_buffer[i] = NULL; - } -#endif - for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) { deleteCldfb( &( hOMasa->cldfbAnaEnc[i] ) ); @@ -306,11 +265,7 @@ ivas_error ivas_omasa_enc_config( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hOMasa != NULL ) { -#ifdef FIX_OMASA_DELAY_COMP ivas_omasa_enc_close( st_ivas->hOMasa ); -#else - ivas_omasa_enc_close( st_ivas->hOMasa, st_ivas->hEncoderConfig->nchan_ism ); -#endif st_ivas->hOMasa = NULL; } @@ -966,14 +921,6 @@ static void ivas_omasa_param_est_enc( set_zero( renormalization_factor_diff, hOMasa->nbands ); set_zero( diffuseness_m, hOMasa->nbands ); -#ifndef FIX_OMASA_DELAY_COMP - /* Copy current frame to memory for delay compensation */ - for ( i = 0; i < nchan_ism; i++ ) - { - mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); - } -#endif - /* Compute ISM to FOA matrices */ for ( i = 0; i < nchan_ism; i++ ) { @@ -1002,18 +949,7 @@ static void ivas_omasa_param_est_enc( { for ( i = 0; i < nchan_ism; i++ ) { -#ifdef FIX_OMASA_DELAY_COMP cldfbAnalysis_ts( &( data_f[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); -#else - if ( ts < hOMasa->num_slots_delay_comp ) - { - cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); - } - else - { - cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); - } -#endif } /* Compute energy */ @@ -1131,14 +1067,6 @@ static void ivas_omasa_param_est_enc( energyRatio[band_m_idx] = 1.0f - diffuseness_m[band_m_idx]; } -#ifndef FIX_OMASA_DELAY_COMP - /* Update memory */ - for ( i = 0; i < nchan_ism; i++ ) - { - mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); - } -#endif - return; } @@ -1164,15 +1092,6 @@ static void ivas_omasa_energy_and_ratio_est( num_freq_bands = hOMasa->nbands; l_ts = input_frame / CLDFB_NO_COL_MAX; - -#ifndef FIX_OMASA_DELAY_COMP - /* Copy current frame to memory for delay compensation */ - for ( i = 0; i < nchan_inp; i++ ) - { - mvr2r( &data_f[i][0], &( hOMasa->delay_buffer[i][hOMasa->num_samples_delay_comp - hOMasa->offset_comp] ), hOMasa->offset_comp ); - } -#endif - /* do processing over all CLDFB time slots */ for ( block_m_idx = 0; block_m_idx < hOMasa->nSubframes; block_m_idx++ ) { @@ -1191,18 +1110,7 @@ static void ivas_omasa_energy_and_ratio_est( { for ( i = 0; i < nchan_inp; i++ ) { -#ifdef FIX_OMASA_DELAY_COMP cldfbAnalysis_ts( &( data_f[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); -#else - if ( ts < hOMasa->num_slots_delay_comp ) - { - cldfbAnalysis_ts( &( hOMasa->delay_buffer[i][l_ts * ts] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); - } - else - { - cldfbAnalysis_ts( &( data_f[i][hOMasa->offset_comp + l_ts * ( ts - hOMasa->num_slots_delay_comp )] ), Chnl_RealBuffer[i], Chnl_ImagBuffer[i], l_ts, hOMasa->cldfbAnaEnc[i] ); - } -#endif } /* Compute energy */ @@ -1244,14 +1152,6 @@ static void ivas_omasa_energy_and_ratio_est( hMasa->data.nchan_ism = nchan_inp; } -#ifndef FIX_OMASA_DELAY_COMP - /* Update memory */ - for ( i = 0; i < nchan_inp; i++ ) - { - mvr2r( &data_f[i][input_frame - hOMasa->num_samples_delay_comp + hOMasa->offset_comp], &( hOMasa->delay_buffer[i][0] ), ( hOMasa->num_samples_delay_comp - hOMasa->offset_comp ) ); - } -#endif - return; } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 0c7a3bc375..80dddaf9dd 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -852,14 +852,6 @@ typedef struct ivas_omasa_enc_data_structure uint8_t nCodingBands; uint8_t nSubframes; -#ifndef FIX_OMASA_DELAY_COMP - /* delay compensation */ - float *delay_buffer[MAX_NUM_OBJECTS]; /* Delay buffer for parameter estimation */ - int16_t num_samples_delay_comp; - int16_t num_slots_delay_comp; - int16_t offset_comp; -#endif - /* CLDFB analysis */ int16_t num_Cldfb_instances; HANDLE_CLDFB_FILTER_BANK cldfbAnaEnc[MAX_NUM_OBJECTS]; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 7ee3add834..0135239e2e 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -641,7 +641,7 @@ static void ivas_dirac_dec_binaural_internal( ivas_dirac_dec_binaural_process_output( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, firstSlot, slotEnd ); st_ivas->hDirAC->hDiffuseDist = NULL; -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS st_ivas->hDirAC->dirac_read_idx = ( st_ivas->hDirAC->dirac_read_idx + nSubframes ) % st_ivas->hDirAC->dirac_md_buffer_length; #endif @@ -885,19 +885,10 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } else { -#ifdef FIX_OMASA_DELAY_COMP aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx]; eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx]; -#else - aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex]; - eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex]; -#endif } -#ifdef FIX_OMASA_DELAY_COMP ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; -#else - ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; -#endif spreadCoh = 0.0f; } #endif @@ -1113,10 +1104,6 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric #endif frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } - -#ifndef FIX_OMASA_DELAY_COMP - hDirAC->dirac_read_idx = ( hDirAC->dirac_read_idx + 1 ) % hDirAC->dirac_md_buffer_length; -#endif } /* Formulate average diffuseness over frame */ @@ -1202,14 +1189,16 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( uint8_t nchanSeparateChannels; #endif int16_t nBins; -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS int16_t dirac_read_idx; #endif DIRAC_DEC_BIN_HANDLE h; + h = st_ivas->hDiracDecBin; #ifdef MASA_AND_OBJECTS separateCenterChannelRendering = 0; nchanSeparateChannels = 0; + #ifdef OMASA_UPDATES if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) #else @@ -1235,8 +1224,9 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( #else separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; #endif + nBins = st_ivas->hDirAC->num_freq_bands; /* Actually bins */ -#ifdef FIX_OMASA_DELAY_COMP +#ifdef MASA_AND_OBJECTS dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; #endif @@ -1395,23 +1385,13 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { -#ifdef FIX_OMASA_DELAY_COMP aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB][dirac_read_idx]; eleDeg = st_ivas->hMasaIsmData->elevation_ism[chB][dirac_read_idx]; -#else - aziDeg = st_ivas->hMasaIsmData->azimuth_ism[chB]; - eleDeg = st_ivas->hMasaIsmData->elevation_ism[chB]; -#endif } else { -#ifdef FIX_OMASA_DELAY_COMP aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism[dirac_read_idx]; eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism[dirac_read_idx]; -#else - aziDeg = st_ivas->hMasaIsmData->azimuth_separated_ism; - eleDeg = st_ivas->hMasaIsmData->elevation_separated_ism; -#endif instantChange = 1; } } @@ -2334,9 +2314,7 @@ void preProcessStereoTransportsForMovedObjects( DIRAC_DEC_HANDLE hDirAC; MASA_ISM_DATA_HANDLE hMasaIsmData; uint8_t enableCentering; -#ifdef FIX_OMASA_DELAY_COMP int16_t dirac_read_idx; -#endif hDirAC = st_ivas->hDirAC; hMasaIsmData = st_ivas->hMasaIsmData; @@ -2370,9 +2348,7 @@ void preProcessStereoTransportsForMovedObjects( /* Perform object-movement based processing */ for ( subframe = firstSubframe; subframe < ( firstSubframe + nSubframes ); subframe++ ) { -#ifdef FIX_OMASA_DELAY_COMP dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; -#endif for ( bin = 0; bin < nBins; bin++ ) { @@ -2419,21 +2395,13 @@ void preProcessStereoTransportsForMovedObjects( float panEnesIn[2]; float centeringFactor; -#ifdef FIX_OMASA_DELAY_COMP ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; -#else - ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][subframe][bin]; -#endif + ismRatioAcc += ratio; /* Get input and output panning gains */ -#ifdef FIX_OMASA_DELAY_COMP ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], -#else - ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex], - hMasaIsmData->elevation_ism[ismDirIndex], -#endif panGainsIn ); if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) -- GitLab From 81ef67c806106225a5c531fa9b3b647dfd0e7d8f Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 16:47:38 +0200 Subject: [PATCH 0106/1418] formal improvement --- lib_com/ivas_prot.h | 2 +- lib_dec/ivas_masa_dec.c | 2 ++ lib_enc/ivas_init_enc.c | 7 ++----- lib_enc/ivas_omasa_enc.c | 28 +++++++++++++++++----------- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 338e1b4d24..21488cafbf 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5127,7 +5127,7 @@ ivas_error ivas_omasa_enc_open( ); void ivas_omasa_enc_close( - OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ + OMASA_ENC_HANDLE *hOMasa /* i/o: encoder OMASA handle */ ); ivas_error ivas_omasa_enc_config( diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 37941c7328..23865f11ec 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -456,7 +456,9 @@ ivas_error ivas_masa_decode( if ( st_ivas->hDirAC != NULL ) { +#ifdef MASA_AND_OBJECTS dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ +#endif ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, ivas_total_brate, SBA_MODE_NONE, 0 ); } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 6c8c10226f..a9d1c83c43 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -1085,11 +1085,8 @@ void ivas_destroy_enc( ivas_mcmasa_enc_close( &( st_ivas->hMcMasa ), st_ivas->hEncoderConfig->input_Fs ); #ifdef MASA_AND_OBJECTS - if ( st_ivas->hOMasa != NULL ) - { - ivas_omasa_enc_close( st_ivas->hOMasa ); // VE!!!!! - st_ivas->hOMasa = NULL; - } + /* OMASA handle */ + ivas_omasa_enc_close( &( st_ivas->hOMasa ) ); #endif /* Stereo downmix for EVS encoder handle */ diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index bd38a64945..a9f182705a 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -150,35 +150,41 @@ ivas_error ivas_omasa_enc_open( *--------------------------------------------------------------------------*/ void ivas_omasa_enc_close( - OMASA_ENC_HANDLE hOMasa /* i/o: encoder OMASA handle */ + OMASA_ENC_HANDLE *hOMasa /* i/o: encoder OMASA handle */ ) { int16_t i, j; - for ( i = 0; i < hOMasa->num_Cldfb_instances; i++ ) + if ( hOMasa == NULL || *hOMasa == NULL ) + { + return; + } + + for ( i = 0; i < ( *hOMasa )->num_Cldfb_instances; i++ ) { - deleteCldfb( &( hOMasa->cldfbAnaEnc[i] ) ); + deleteCldfb( &( ( *hOMasa )->cldfbAnaEnc[i] ) ); } for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - free( hOMasa->direction_vector_m[i][j] ); - hOMasa->direction_vector_m[i][j] = NULL; + free( ( *hOMasa )->direction_vector_m[i][j] ); + ( *hOMasa )->direction_vector_m[i][j] = NULL; } for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) { - free( hOMasa->buffer_intensity_real[i][j] ); - hOMasa->buffer_intensity_real[i][j] = NULL; + free( ( *hOMasa )->buffer_intensity_real[i][j] ); + ( *hOMasa )->buffer_intensity_real[i][j] = NULL; } - free( hOMasa->direction_vector_m[i] ); - hOMasa->direction_vector_m[i] = NULL; + free( ( *hOMasa )->direction_vector_m[i] ); + ( *hOMasa )->direction_vector_m[i] = NULL; } - free( hOMasa ); + free( *hOMasa ); + ( *hOMasa ) = NULL; return; } @@ -265,7 +271,7 @@ ivas_error ivas_omasa_enc_config( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hOMasa != NULL ) { - ivas_omasa_enc_close( st_ivas->hOMasa ); + ivas_omasa_enc_close( &( st_ivas->hOMasa ) ); st_ivas->hOMasa = NULL; } -- GitLab From b4e8c3286fcdc50e5bfd232d7de1e4cfe42c92f8 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 16:58:02 +0200 Subject: [PATCH 0107/1418] merge OMASA_UPDATES into MASA_AND_OBJECTS; decoder side --- lib_dec/ivas_cpe_dec.c | 18 +----- lib_dec/ivas_dec.c | 69 +---------------------- lib_dec/ivas_dirac_dec.c | 11 +--- lib_dec/ivas_dirac_output_synthesis_dec.c | 12 +--- lib_dec/ivas_init_dec.c | 15 +---- lib_dec/ivas_ism_metadata_dec.c | 36 ------------ lib_dec/ivas_ism_renderer.c | 4 -- lib_dec/ivas_masa_dec.c | 69 +---------------------- lib_dec/ivas_mono_dmx_renderer.c | 5 +- lib_dec/ivas_omasa_dec.c | 41 +------------- lib_dec/ivas_sce_dec.c | 12 ---- lib_dec/ivas_stat_dec.h | 4 +- lib_dec/ivas_vbap.c | 24 ++++---- 13 files changed, 27 insertions(+), 293 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index e6cbf2bc74..97a046fe9d 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -268,11 +268,7 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { sts[0]->total_brate += hCPE->brate_surplus; } @@ -301,11 +297,7 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; @@ -339,11 +331,7 @@ ivas_error ivas_cpe_dec( #ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; @@ -681,11 +669,7 @@ ivas_error create_cpe_dec( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { cpe_brate = element_brate; } @@ -1116,7 +1100,7 @@ static void read_stereo_mode_and_bwidth( else { /* read stereo technology info */ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k ) ) #else if ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 8e5ab73f21..199af09c8d 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -413,11 +413,7 @@ ivas_error ivas_dec( /* Set the number of objects for the parametric rendering */ if ( st_ivas->hDirAC != NULL ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) -#endif { st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; } @@ -440,7 +436,7 @@ ivas_error ivas_dec( st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); -#ifdef OMASA_UPDATES + //VE: !!!!! /* set ISM parameters */ int16_t nchan_ism, nchan_transport_ism; nchan_ism = st_ivas->nchan_ism; @@ -455,27 +451,9 @@ ivas_error ivas_dec( nchan_ism = 0; nchan_transport_ism = 1; } -#endif /* decode ISM metadata */ -#ifndef OMASA_UPDATES - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - if ( st_ivas->nSCE == 1 ) - { - ivas_sce_dec( st_ivas, 0, &output[2], output_frame, nb_bits_metadata[1] ); - } - else - { -#ifdef DEBUGGING - assert( ( st_ivas->nSCE <= 1 ) && "nSCE should be 1 if not in ISM_MASA_MODE_DISC." ); -#endif - } - } - else -#else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#endif { int16_t azimuth_ism; int16_t elevation_ism; @@ -483,19 +461,12 @@ ivas_error ivas_dec( int16_t meta_write_index; /* decode ISM metadata */ - if ( ( error = ivas_ism_metadata_dec( ism_total_brate, -#ifdef OMASA_UPDATES - nchan_ism, &nchan_transport_ism, -#else - st_ivas->nchan_ism, &( st_ivas->nSCE ), -#endif - st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_metadata_dec( ism_total_brate, nchan_ism, &nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt ) ) != IVAS_ERR_OK ) { return error; } // VE: move the following updates into ivas_ism_metadata_dec() -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -523,31 +494,8 @@ ivas_error ivas_dec( st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; } } -#else - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - st_ivas->hMasaIsmData->azimuth_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); - st_ivas->hMasaIsmData->elevation_ism[n] = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); - } -#endif - -#ifndef OMASA_UPDATES - for ( n = 0; n < st_ivas->nSCE - 1; n++ ) - { - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( ( error = ivas_sce_dec( st_ivas, n, &output[2 * st_ivas->nCPE + n], output_frame, sum_s( &nb_bits_metadata[1], st_ivas->nSCE ) ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } -#ifdef OMASA_UPDATES /* decode ISM channels */ for ( n = 0; n < nchan_transport_ism; n++ ) { @@ -556,7 +504,6 @@ ivas_error ivas_dec( return error; } } -#endif /* decode MASA channels */ if ( ( error = ivas_cpe_dec( st_ivas, 0, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) @@ -581,7 +528,6 @@ ivas_error ivas_dec( /* Rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; @@ -614,9 +560,6 @@ ivas_error ivas_dec( { ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); } -#else - ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); -#endif } else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) { @@ -624,20 +567,12 @@ ivas_error ivas_dec( } else if ( st_ivas->hDirAC ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; int16_t dirac_read_idx; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { mvr2r( output[2], data_separated_objects[0], output_frame ); } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 7fb40f6a4f..69e9dcfef4 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2250,18 +2250,9 @@ void ivas_dirac_dec( } } -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) -#endif { - preProcessStereoTransportsForMovedObjects( st_ivas, - Cldfb_RealBuffer_Temp, - Cldfb_ImagBuffer_Temp, - (uint8_t) ( hDirAC->num_freq_bands ), - (uint8_t) subframe_idx, - 1 ); + preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, (uint8_t) ( hDirAC->num_freq_bands ), (uint8_t) subframe_idx, 1 ); } } #endif diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index d5e5710fa2..d245849376 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -1738,19 +1738,11 @@ void ivas_dirac_dec_compute_directional_responses( { if ( hMasaIsm->ism_is_edited[dir] ) { -#ifdef OMASA_UPDATES vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir], 1 ); -#else - vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism_edited[dir], hMasaIsm->elevation_ism_edited[dir] ); -#endif } else { -#ifdef OMASA_UPDATES vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir][hDirAC->dirac_read_idx], hMasaIsm->elevation_ism[dir][hDirAC->dirac_read_idx], 1 ); -#else - vbap_determine_gains( hVBAPdata, direct_response_temp, hMasaIsm->azimuth_ism[dir], hMasaIsm->elevation_ism[dir] ); -#endif } for ( l = 0; l < num_channels_dir; l++ ) @@ -2268,7 +2260,7 @@ static void spreadCoherencePanningVbap( return; } -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation, 0 ); #else vbap_determine_gains( hVBAPdata, direct_response, azimuth, elevation ); @@ -2276,7 +2268,7 @@ static void spreadCoherencePanningVbap( if ( spreadCoh > 0.f ) { -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS vbap_determine_gains( hVBAPdata, direct_response_left, azimuth + 30, elevation, 0 ); vbap_determine_gains( hVBAPdata, direct_response_right, azimuth - 30, elevation, 0 ); #else diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 99e2fb0a15..560618b552 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1062,11 +1062,8 @@ ivas_error ivas_init_decoder( { k++; } -#ifdef OMASA_UPDATES + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { /* one separated object */ st_ivas->nSCE = 1; @@ -1247,7 +1244,7 @@ ivas_error ivas_init_decoder( } else { -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0, 0 ); #else vbap_determine_gains( st_ivas->hVBAPdata, st_ivas->hLsSetupCustom->separate_ch_gains, 0, 0 ); @@ -1414,10 +1411,9 @@ ivas_error ivas_init_decoder( st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; } -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - // VE: introduce a new renderer_type for this case if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { /* Allocate TD renderer for the objects in DISC mode */ @@ -1433,7 +1429,6 @@ ivas_error ivas_init_decoder( } } - // VE: introduce a new renderer_type for this case if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ @@ -1997,11 +1992,7 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbAnalyses += st_ivas->nchan_ism; } -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { *numCldfbAnalyses = st_ivas->nchan_transport + 1; } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 9b12be21ed..e512061cfb 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -204,11 +204,7 @@ ivas_error ivas_ism_metadata_dec( /* number of objects was read in ivas_dec_setup() */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode != ISM_MASA_MODE_DISC ) -#endif #endif { /* number of objects was read in ivas_dec_setup() */ @@ -261,11 +257,7 @@ ivas_error ivas_ism_metadata_dec( for ( ch = 0; ch < *nchan_transport; ch++ ) { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* ISM importance flag is already read in ivas_masa_decode() */ ism_imp[ch] = hIsmMeta[ch]->ism_imp; @@ -300,11 +292,7 @@ ivas_error ivas_ism_metadata_dec( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* VAD flag is already read in ivas_masa_decode() */ localVAD[ch] = hIsmMeta[ch]->ism_vad_flag; @@ -339,11 +327,7 @@ ivas_error ivas_ism_metadata_dec( { hIsmMetaData = hIsmMeta[ch]; #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -405,11 +389,7 @@ ivas_error ivas_ism_metadata_dec( /* save number of metadata bits read */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -497,11 +477,7 @@ ivas_error ivas_ism_metadata_dec( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { ism_metadata_flag_global = 1; } @@ -515,11 +491,7 @@ ivas_error ivas_ism_metadata_dec( { #ifdef MASA_AND_OBJECTS int16_t masa_ism_flag = 0; -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { masa_ism_flag = 1; @@ -550,11 +522,7 @@ ivas_error ivas_ism_metadata_dec( hSCE[ch]->hCoreCoder[0]->low_rate_mode = 0; #endif #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -569,11 +537,7 @@ ivas_error ivas_ism_metadata_dec( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode != ISM_MASA_MODE_DISC ) -#endif #endif { hSCE[ch]->element_brate = element_brate[ch]; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index a44a8c4588..9957522feb 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -283,11 +283,7 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { st_ivas->hMasaIsmData->delayBuffer_nchan = 1; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 23865f11ec..b84d8d1cca 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -121,11 +121,7 @@ ivas_error ivas_masa_decode( low_bitrate_mode = -1; /* This means that LBR mode is not used. */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->hOutSetup.separateChannelEnabled || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( st_ivas->hOutSetup.separateChannelEnabled ) #endif @@ -177,11 +173,7 @@ ivas_error ivas_masa_decode( st->next_bit_pos -= NO_BITS_MASA_ISM_NO_OBJ; *nb_bits_read += NO_BITS_MASA_ISM_NO_OBJ; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { /* read index of separated object */ /* nchan_ism should be > 1*/ @@ -196,7 +188,6 @@ ivas_error ivas_masa_decode( } /* read ISM importance flag (one per object) */ -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { ism_imp = 0; @@ -208,10 +199,8 @@ ivas_error ivas_masa_decode( } st_ivas->hIsmMetaData[0]->ism_imp = ism_imp; } + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { ism_imp = 0; for ( i = 0; i < ISM_METADATA_FLAG_BITS; i++ ) @@ -222,7 +211,6 @@ ivas_error ivas_masa_decode( } st_ivas->hIsmMetaData[0]->ism_imp = ism_imp; -#ifdef OMASA_UPDATES /* reset */ st_ivas->hIsmMetaData[0]->ism_vad_flag = 1; if ( st_ivas->hIsmMetaData[0]->ism_imp == ISM_NO_META ) @@ -231,7 +219,6 @@ ivas_error ivas_masa_decode( st_ivas->hIsmMetaData[0]->ism_vad_flag = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read ) += ISM_METADATA_VAD_FLAG_BITS; } -#endif } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { @@ -321,21 +308,13 @@ ivas_error ivas_masa_decode( #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) -#endif { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); } -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) { @@ -358,11 +337,7 @@ ivas_error ivas_masa_decode( *nb_bits_read += ivas_qmetadata_dec_decode( hQMetaData, st->bit_stream, &st->next_bit_pos ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) -#endif { /* Modify spatial metadata based on the MASA-to-total energy ratios */ modify_masa_energy_ratios( hQMetaData ); @@ -589,11 +564,7 @@ ivas_error ivas_masa_dec_open( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -738,11 +709,7 @@ static ivas_error ivas_masa_dec_config( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -754,18 +721,14 @@ static ivas_error ivas_masa_dec_config( if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) { ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); } else { -#endif ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); -#ifdef OMASA_UPDATES } -#endif } else { @@ -1461,11 +1424,7 @@ ivas_error ivas_masa_dec_reconfigure( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( n = 0; n < st_ivas->nSCE; n++ ) { @@ -2314,10 +2273,8 @@ static int16_t ivas_decode_masaism_metadata( uint16_t idx_el, idx_az; float azimuth, elevation; int16_t nb_bits_read; -#ifdef OMASA_UPDATES float delta_phi; int16_t meta_write_index; -#endif nb_bits_read = *next_bit_pos; nbands = hQMetaData->q_direction->cfg.nbands; @@ -2347,7 +2304,6 @@ static int16_t ivas_decode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { index = 0; -#ifdef OMASA_UPDATES if ( bits_ism[obj] < 8 ) /* if low resolution, can look to the past */ { /* read if same as previous */ @@ -2394,15 +2350,7 @@ static int16_t ivas_decode_masaism_metadata( hMasaIsmData->q_azimuth_old[obj] = azimuth; hMasaIsmData->q_elevation_old[obj] = elevation; } -#else - for ( i = 0; i < bits_ism[obj]; i++ ) - { - index = ( index << 1 ) + bit_stream[( *next_bit_pos )--]; - } - deindex_spherical_component( index, &azimuth, &elevation, &idx_az, &idx_el, bits_ism[obj], MC_LS_SETUP_INVALID ); - -#endif for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { meta_write_index = ( dirac_bs_md_write_idx + sf ) % dirac_md_buffer_length; @@ -2464,7 +2412,7 @@ void ivas_masa_ism_set_edited_objects( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { - int16_t dir; + int16_t dir, sf; MASA_ISM_DATA_HANDLE hMasaIsmData; hMasaIsmData = st_ivas->hMasaIsmData; @@ -2474,24 +2422,20 @@ void ivas_masa_ism_set_edited_objects( { if ( st_ivas->editing_ism_enabled ) { - int16_t sf; for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) { hMasaIsmData->azimuth_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->azimuth_edited; hMasaIsmData->elevation_ism[st_ivas->index_of_edited_ism][sf] = st_ivas->elevation_edited; } -#ifdef OMASA_UPDATES + st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->azimuth = st_ivas->azimuth_edited; st_ivas->hIsmMetaData[st_ivas->index_of_edited_ism]->elevation = st_ivas->elevation_edited; -#endif } } -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { /* Directions cannot be edited in this mode */ } -#endif else { for ( dir = 0; dir < MAX_NUM_OBJECTS; dir++ ) @@ -2508,15 +2452,10 @@ void ivas_masa_ism_set_edited_objects( } } -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->editing_ism_enabled ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st_ivas->editing_ism_enabled ) -#endif { if ( st_ivas->hMasaIsmData->idx_separated_ism == st_ivas->index_of_edited_ism ) { - int16_t sf; for ( sf = 0; sf < ( MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); sf++ ) { st_ivas->hMasaIsmData->azimuth_separated_ism[sf] = st_ivas->azimuth_edited; @@ -2528,6 +2467,4 @@ void ivas_masa_ism_set_edited_objects( return; } - - #endif diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index a0ba899f0d..a6f0abfddb 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -101,11 +101,7 @@ void ivas_mono_downmix_render_passive( { numInputChannels = st_ivas->nchan_transport; } -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { numInputChannels = st_ivas->nchan_transport + 1; } @@ -115,6 +111,7 @@ void ivas_mono_downmix_render_passive( } } #endif + hDownmix = st_ivas->hMonoDmxRenderer; set_zero( proto_signal, output_frame ); diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index a02a2bf051..777d6bfbe5 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -35,12 +35,8 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#ifdef OMASA_UPDATES #include "ivas_prot_rend.h" -#endif -#ifdef MASA_AND_OBJECTS #include "ivas_rom_com.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -81,13 +77,11 @@ ivas_error ivas_masa_ism_data_open( hMasaIsmData->objectsMoved = 0; hMasaIsmData->delayBuffer = NULL; -#ifdef OMASA_UPDATES for ( ch = 0; ch < st_ivas->nchan_ism; ch++ ) { hMasaIsmData->q_elevation_old[ch] = 0.0f; hMasaIsmData->q_azimuth_old[ch] = 0.0f; } -#endif st_ivas->hMasaIsmData = hMasaIsmData; @@ -218,11 +212,7 @@ ivas_error ivas_omasa_dec_config( /* ISM MD reconfig. */ n_MD = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#endif { n_MD = 1; @@ -257,16 +247,11 @@ ivas_error ivas_omasa_dec_config( st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; /* objects renderer reconfig. */ -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) -#else - if ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) -#endif { ivas_masa_ism_data_close( &( st_ivas->hMasaIsmData ) ); } -#ifdef OMASA_UPDATES if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -330,7 +315,6 @@ ivas_error ivas_omasa_dec_config( } } } -#endif } return IVAS_ERR_OK; @@ -353,28 +337,13 @@ void ivas_set_surplus_brate_dec( *ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { *ism_total_brate = ivas_interformat_brate( st_ivas->ism_mode, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ); -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - *ism_total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp -#ifdef FIX_4OBJ_128 - , - 0 -#endif - ); -#endif st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - *ism_total_brate; -#ifdef OMASA_UPDATES /* set 'st->total_brate'; there are no meta-data in ISM_MASA_MODE_PARAM_ONE_OBJ mode */ -#else - /* set 'st->total_brate'; there are no meta-data in ISM_MASA_MODE_ONE_OBJ mode */ -#endif st_ivas->hSCE[0]->hCoreCoder[0]->total_brate = *ism_total_brate; st_ivas->hSCE[0]->hCoreCoder[0]->low_rate_mode = 0; @@ -385,7 +354,6 @@ void ivas_set_surplus_brate_dec( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { -#ifdef OMASA_UPDATES int16_t brate_limit_flag, ism_imp[MAX_NUM_OBJECTS]; for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -395,8 +363,6 @@ void ivas_set_surplus_brate_dec( brate_limit_flag = calculate_brate_limit_flag( ism_imp, st_ivas->nchan_ism ); -#endif - ism_total_brate_ref = 0; for ( n = 0; n < st_ivas->nchan_ism; n++ ) { @@ -413,12 +379,7 @@ void ivas_set_surplus_brate_dec( { st_ivas->hSCE[n]->element_brate = element_brate[n]; - *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp -#ifdef OMASA_UPDATES - , - brate_limit_flag -#endif - ); + *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp, brate_limit_flag ); } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 9b6ea5ec29..201355fc5b 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -159,19 +159,11 @@ ivas_error ivas_sce_dec( ( st_ivas->sba_mode != SBA_MODE_SPAR ) ) { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL ); } -#ifdef OMASA_UPDATES else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - else if ( ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) || ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif #else if ( st_ivas->mc_mode == MC_MODE_MCMASA && ivas_total_brate >= MCMASA_SEPARATE_BRATE ) #endif @@ -228,11 +220,7 @@ ivas_error ivas_sce_dec( /* set ACELP12k8 / ACELP16k flag for flexible ACELP core */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) && -#else - if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) && -#endif st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) #else if ( st_ivas->ivas_format == ISM_FORMAT && st->low_rate_mode && !( st->total_brate == SID_2k40 || st->total_brate == FRAME_NO_DATA ) ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index a643fe15a0..e474e0fd1f 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1026,7 +1026,7 @@ typedef struct vbap_data_structure float *bottom_virtual_speaker_node_division_gains; float *top_virtual_speaker_node_division_gains; float *back_virtual_speaker_node_division_gains; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS float *object_mode_bottom_virtual_speaker_node_division_gains; float *object_mode_top_virtual_speaker_node_division_gains; float *object_mode_back_virtual_speaker_node_division_gains; @@ -1156,10 +1156,8 @@ typedef struct ivas_masa_ism_data_structure int16_t azimuth_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; int16_t elevation_separated_ism[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR]; -#ifdef OMASA_UPDATES float q_azimuth_old[MAX_NUM_OBJECTS]; float q_elevation_old[MAX_NUM_OBJECTS]; -#endif float ismPreprocMatrix[2][2][CLDFB_NO_CHANNELS_MAX]; uint8_t objectsMoved; diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index 37547deaad..ed2ce47942 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -141,7 +141,7 @@ static enum VirtualSpeakerNodeType check_need_of_virtual_speaker_node( VBAP_HAND static int16_t determine_best_triplet_and_gains( VBAP_SEARCH_STRUCT *search_struct, const float panning_unit_vec[3], const int16_t azi_deg, float gains[3] ); -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes, const int16_t use_object_mode ); #else static void determine_virtual_speaker_node_division_gains( const int16_t virtual_speaker_node_index, float *virtual_node_division_gains, int16_t connections[][2], const enum VirtualSpeakerNodeType type, const int16_t max_num_connections, const int16_t num_speaker_nodes ); @@ -161,7 +161,7 @@ ivas_error vbap_init_data( const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS , const int16_t support_object_mode /* i : init VBAP also for object panning mode */ #endif @@ -213,7 +213,7 @@ ivas_error vbap_init_data( vbap->bottom_virtual_speaker_node_division_gains = NULL; vbap->top_virtual_speaker_node_division_gains = NULL; vbap->back_virtual_speaker_node_division_gains = NULL; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS vbap->object_mode_bottom_virtual_speaker_node_division_gains = NULL; vbap->object_mode_top_virtual_speaker_node_division_gains = NULL; vbap->object_mode_back_virtual_speaker_node_division_gains = NULL; @@ -240,7 +240,7 @@ ivas_error vbap_init_data( } set_zero( vbap->bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->bottom_virtual_speaker_node_division_gains != NULL; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( support_object_mode ) { vbap->object_mode_bottom_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); @@ -260,7 +260,7 @@ ivas_error vbap_init_data( } set_zero( vbap->top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->top_virtual_speaker_node_division_gains != NULL; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( support_object_mode ) { vbap->object_mode_top_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); @@ -280,7 +280,7 @@ ivas_error vbap_init_data( } set_zero( vbap->back_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->back_virtual_speaker_node_division_gains != NULL; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( support_object_mode ) { vbap->object_mode_back_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); @@ -377,7 +377,7 @@ ivas_error vbap_init_data( /* Determine how the virtual node gains should be distributed to real nodes, if necessary (checked within function). */ if ( is_success ) { -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes, 0 ); @@ -438,7 +438,7 @@ void vbap_free_data( { free( ( *hVBAPdata )->back_virtual_speaker_node_division_gains ); } -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains != NULL ) { free( ( *hVBAPdata )->object_mode_bottom_virtual_speaker_node_division_gains ); @@ -479,7 +479,7 @@ void vbap_determine_gains( float *gains, /* o : gain vector for loudspeakers for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left)*/ const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up)*/ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS , const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ #endif @@ -516,7 +516,7 @@ void vbap_determine_gains( bottom_virtual_speaker_node_index = hVBAPdata->bottom_virtual_speaker_node_index; top_virtual_speaker_node_index = hVBAPdata->top_virtual_speaker_node_index; back_virtual_speaker_node_index = hVBAPdata->back_virtual_speaker_node_index; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( use_object_mode ) { bottom_virtual_speaker_node_division_gains = hVBAPdata->object_mode_bottom_virtual_speaker_node_division_gains; @@ -782,7 +782,7 @@ static void determine_virtual_speaker_node_division_gains( const enum VirtualSpeakerNodeType type, /* i : virtual speaker node typel */ const int16_t max_num_connections, /* i : max number of connections */ const int16_t num_speaker_nodes /* i : max number of speaker nodes */ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS , const int16_t use_object_mode /* i : use VBAP in object panning mode vs. spatial panning mode */ #endif @@ -828,7 +828,7 @@ static void determine_virtual_speaker_node_division_gains( for ( ch = 0; ch < num_speaker_nodes; ch++ ) { virtual_node_division_gains[ch] /= sum_val; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( use_object_mode ) { virtual_node_division_gains[ch] = powf( virtual_node_division_gains[ch], 0.8f ); -- GitLab From 687ce1a008e155efd5e6bee33736b10b603c79f1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 18:46:03 +0200 Subject: [PATCH 0108/1418] merge OMASA_UPDATES into MASA_AND_OBJECTS; encoder side --- lib_com/bitstream.c | 24 --- lib_com/ivas_cnst.h | 10 +- lib_com/ivas_masa_com.c | 12 -- lib_com/ivas_omasa_com.c | 65 ++------ lib_com/ivas_prot.h | 10 +- lib_com/ivas_stat_com.h | 2 - lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 3 +- lib_dec/lib_dec.c | 4 - lib_enc/ivas_cpe_enc.c | 16 +- lib_enc/ivas_decision_matrix_enc.c | 2 +- lib_enc/ivas_enc.c | 14 +- lib_enc/ivas_ism_enc.c | 44 +---- lib_enc/ivas_ism_metadata_enc.c | 64 +------ lib_enc/ivas_masa_enc.c | 76 +-------- lib_enc/ivas_omasa_enc.c | 165 +------------------ lib_enc/ivas_sce_enc.c | 27 --- lib_enc/ivas_stereo_classifier.c | 3 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 42 +---- lib_rend/ivas_objectRenderer.c | 4 +- 20 files changed, 42 insertions(+), 546 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 9b54224860..d7c063bf1a 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1972,37 +1972,13 @@ ivas_error preview_indices( else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { /* read number of objects from the bitstream */ -#ifdef OMASA_UPDATES st_ivas->nchan_transport = 2; /* always 2 MASA transport channels */ st_ivas->nchan_ism = 0; -#else - st_ivas->nchan_transport = 0; -#endif if ( total_brate != SID_2k40 && total_brate != FRAME_NO_DATA ) { -#ifdef OMASA_UPDATES st_ivas->nchan_ism = 2 * bit_stream[total_brate / FRAMES_PER_SEC - 1] + bit_stream[total_brate / FRAMES_PER_SEC - 2] + 1; -#endif st_ivas->ism_mode = ivas_omasa_ism_mode_select( total_brate, st_ivas->nchan_ism ); - -#ifndef OMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - st_ivas->nchan_transport = 0; - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - st_ivas->nchan_transport = 2 * st_ivas->bit_stream[total_brate / FRAMES_PER_SEC - 2] + st_ivas->bit_stream[total_brate / FRAMES_PER_SEC - 3] + 1; - } - - k = (int16_t) ( ( total_brate / FRAMES_PER_SEC ) - 1 ); - - { - st_ivas->nchan_transport++; - k--; - } -#endif } } #endif diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 07d6c66f75..2ebd9e359e 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -374,12 +374,8 @@ typedef enum #ifdef MASA_AND_OBJECTS , ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ -#ifdef OMASA_UPDATES ISM_MASA_MODE_MASA_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using MASA parameters */ ISM_MASA_MODE_PARAM_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using parametric object model */ -#else - ISM_MASA_MODE_ONE_OBJ, /* MASA ISM mode when one object is encoded separarately */ -#endif ISM_MASA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ #endif } ISM_MODE; @@ -639,11 +635,7 @@ enum IND_STEREO_DFT_SIDEGAIN_FLAG, IND_STEREO_DFT_SIDEGAINS, - #ifdef OMASA_UPDATES - IND_STEREO_DFT_ITD_MODE = IND_STEREO_DFT_SIDEGAINS + 4 * STEREO_DFT_BAND_MAX + 120, - #else - IND_STEREO_DFT_ITD_MODE = IND_STEREO_DFT_SIDEGAINS + 4 * STEREO_DFT_BAND_MAX + 72, - #endif + IND_STEREO_DFT_ITD_MODE = IND_STEREO_DFT_SIDEGAINS + 4 * STEREO_DFT_BAND_MAX + 120, IND_STEREO_DFT_ITD_HUFF, IND_STEREO_DFT_ITD_NEG, diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index c4ab8be9af..dd088fca52 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -96,11 +96,7 @@ void ivas_masa_set_elements( if ( ivas_total_brate > MIN_BRATE_MDCT_STEREO ) { *element_mode = IVAS_CPE_MDCT; -#ifdef OMASA_UPDATES if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) && ( ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) ) -#else - if ( ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_ONE_OBJ ) && ( ivas_total_brate - ism_total_brate < MIN_BRATE_MDCT_STEREO ) ) -#endif { *element_mode = IVAS_CPE_DFT; } @@ -119,11 +115,7 @@ void ivas_masa_set_elements( } hQMetaData->bits_frame_nominal = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { hQMetaData->bits_frame_nominal -= (int16_t) ( ism_total_brate / FRAMES_PER_SEC ); } @@ -634,11 +626,7 @@ int32_t calculate_cpe_brate_MASA_ISM( k++; } -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { cpe_brate = ivas_total_brate - sep_object_brate[k - 2][0]; /* take data from the first column */ } diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 4bf5c3ed83..5501fa79aa 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -58,15 +58,9 @@ #define GAMMA_ISM_MEDIUM_IMP3 1.15f #define GAMMA_ISM_HIGH_IMP3 1.3f -#ifdef OMASA_UPDATES #define GAMMA_ISM_LOW_IMP4 0.8f #define GAMMA_ISM_MEDIUM_IMP4 1.0f #define GAMMA_ISM_HIGH_IMP4 1.2f -#else -#define GAMMA_ISM_LOW_IMP4 0.6f -#define GAMMA_ISM_MEDIUM_IMP4 0.8f -#define GAMMA_ISM_HIGH_IMP4 1.0f -#endif /*--------------------------------------------------------------- @@ -103,11 +97,7 @@ ISM_MODE ivas_omasa_ism_mode_select( } else if ( ivas_total_brate >= IVAS_32k ) { -#ifdef OMASA_UPDATES ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; -#else - ism_mode = ISM_MASA_MODE_ONE_OBJ; -#endif } else { @@ -121,23 +111,12 @@ ISM_MODE ivas_omasa_ism_mode_select( } else if ( ivas_total_brate >= IVAS_64k ) { -#ifdef OMASA_UPDATES ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; -#else - ism_mode = ISM_MASA_MODE_ONE_OBJ; -#endif } -#ifdef OMASA_UPDATES else if ( ivas_total_brate >= IVAS_32k ) { ism_mode = ISM_MASA_MODE_MASA_ONE_OBJ; } -#else - else if ( ivas_total_brate >= IVAS_48k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } -#endif else { ism_mode = ISM_MODE_NONE; @@ -148,7 +127,6 @@ ISM_MODE ivas_omasa_ism_mode_select( { ism_mode = ISM_MASA_MODE_DISC; } -#ifdef OMASA_UPDATES else if ( ivas_total_brate >= IVAS_64k ) { ism_mode = ISM_MASA_MODE_PARAM_ONE_OBJ; @@ -157,16 +135,6 @@ ISM_MODE ivas_omasa_ism_mode_select( { ism_mode = ISM_MASA_MODE_MASA_ONE_OBJ; } -#else - else if ( ivas_total_brate >= IVAS_64k ) - { - ism_mode = ISM_MASA_MODE_ONE_OBJ; - } - else if ( ivas_total_brate >= IVAS_48k ) - { - ism_mode = ISM_MASA_MODE_PARAM; - } -#endif else { ism_mode = ISM_MODE_NONE; @@ -197,12 +165,8 @@ void ivas_set_omasa_TC( *nCPE = 1; *nSCE = 0; break; -#ifdef OMASA_UPDATES case ISM_MASA_MODE_MASA_ONE_OBJ: case ISM_MASA_MODE_PARAM_ONE_OBJ: -#else - case ISM_MASA_MODE_ONE_OBJ: -#endif *nCPE = 1; *nSCE = 1; break; @@ -230,14 +194,11 @@ void ivas_set_omasa_TC( /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( - const ISM_MODE ism_mode, /* i : ISM mode */ - const int16_t nchan_ism, /* i : number of ISM channels */ - const int32_t element_brate, /* i : element bitrate */ - const int16_t ism_imp /* i : ISM importance flag */ -#ifdef OMASA_UPDATES - , - const int16_t limit_flag /* i : flag to limit the bitrate increase */ -#endif + const ISM_MODE ism_mode, /* i : ISM mode */ + const int16_t nchan_ism, /* i : number of ISM channels */ + const int32_t element_brate, /* i : element bitrate */ + const int16_t ism_imp, /* i : ISM importance flag */ + const int16_t limit_flag /* i : flag to limit the bitrate increase */ ) { int32_t element_brate_out; @@ -254,12 +215,11 @@ int32_t ivas_interformat_brate( if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate <= 24000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) /* for border case in DISC mode */ { -#ifdef OMASA_UPDATES - if ( ( limit_flag == 1 ) && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) + if ( limit_flag == 1 && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) { return element_brate; } -#endif + if ( ism_imp == ISM_LOW_IMP ) { nBits = (int16_t) ( nBits * GAMMA_ISM_LOW_IMP4 ); @@ -281,14 +241,9 @@ int32_t ivas_interformat_brate( } } } - else -#ifdef OMASA_UPDATES - if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || -#else - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ || -#endif - ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 24400 and 1 object */ - ) + else if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || + ( ism_mode == ISM_MASA_MODE_DISC && element_brate == 9600 ) /* this condition corresponds to the ivas_total_brate = 24400 and 1 object */ + ) { if ( ism_imp == ISM_LOW_IMP ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 21488cafbf..a6392e2a09 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4844,7 +4844,7 @@ ivas_error vbap_init_data( const float *speaker_node_azi_deg, /* i : vector of speaker node azimuths (positive left) */ const float *speaker_node_ele_deg, /* i : vector of speaker node elevations (positive up) */ const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS , const int16_t support_object_mode /* i : init VBAP also for object panning mode */ #endif @@ -4859,7 +4859,7 @@ void vbap_determine_gains( float *gains, /* o : gain vector for speaker nodes for given direction */ const int16_t azi_deg, /* i : azimuth in degrees for panning direction (positive left) */ const int16_t ele_deg /* i : elevation in degrees for panning direction (positive up) */ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS , const int16_t use_object_mode /* i : select between object mode panning and spatial mode panning */ #endif @@ -5185,10 +5185,8 @@ int32_t ivas_interformat_brate( const ISM_MODE ism_mode, /* i : ISM mode */ const int16_t nchan_ism, /* i : number of ISM channels */ const int32_t element_brate, /* i : element bitrate */ - const int16_t ism_imp /* i : ISM importance flag */ -#ifdef OMASA_UPDATES - , const int16_t limit_flag /* i : flag to limit the bitrate increase */ -#endif + const int16_t ism_imp, /* i : ISM importance flag */ + const int16_t limit_flag /* i : flag to limit the bitrate increase */ ); void ivas_combined_format_brate_sanity( diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 80e3712dad..5f09e0d45a 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -74,11 +74,9 @@ typedef struct #ifdef MASA_AND_OBJECTS int16_t ism_imp; /* ISM importance flag */ int16_t ism_vad_flag; -#ifdef OMASA_UPDATES float q_azimuth_old; float q_elevation_old; #endif -#endif } ISM_METADATA_FRAME, *ISM_METADATA_HANDLE; diff --git a/lib_com/options.h b/lib_com/options.h index d86a5355fa..64aab79878 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,7 +168,6 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ -#define OMASA_UPDATES /* Nokia: Updates to the OMASA processing */ #endif diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 69e9dcfef4..2fb2af0de4 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -609,7 +609,8 @@ ivas_error ivas_dirac_dec_config( { vbap_free_data( &( st_ivas->hVBAPdata ) ); } -#ifdef OMASA_UPDATES + +#ifdef MASA_AND_OBJECTS if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE, st_ivas->ivas_format == MASA_ISM_FORMAT ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4371a8dc20..8c90a3a82d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2012,11 +2012,7 @@ static ivas_error printConfigInfo_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES fprintf( stdout, "Input configuration: combined ISM and MASA (%i ISM stream(s)) \n", st_ivas->nchan_ism ); -#else - fprintf( stdout, "Input configuration: combined ISM and MASA (%i separated ISM stream(s)) \n", st_ivas->nchan_transport ); -#endif } #endif } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index bce8d37984..db0da4666d 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -169,7 +169,7 @@ ivas_error ivas_cpe_enc( if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL ) { -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && ivas_total_brate == IVAS_48k ) { hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k ); @@ -178,7 +178,7 @@ ivas_error ivas_cpe_enc( { #endif hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS } #endif } @@ -329,11 +329,7 @@ ivas_error ivas_cpe_enc( #ifdef MASA_AND_OBJECTS /* compute bit-rate surplus per channel in combined format coding */ int32_t brate_surplus[CPE_CHANNELS]; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { brate_surplus[0] = ( ( hCPE->brate_surplus / FRAMES_PER_SEC ) >> 1 ) * FRAMES_PER_SEC; brate_surplus[1] = hCPE->brate_surplus - brate_surplus[0]; @@ -362,11 +358,7 @@ ivas_error ivas_cpe_enc( #ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { sts[n]->bits_frame_channel += (int16_t) ( brate_surplus[n] / FRAMES_PER_SEC ); sts[n]->total_brate += brate_surplus[n]; @@ -723,11 +715,7 @@ ivas_error ivas_cpe_enc( #ifdef MASA_AND_OBJECTS /* subtract bit-rate for combined format coding */ -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { sts[0]->total_brate += hCPE->brate_surplus; } diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index e26d1e7a72..1ef2fc00b0 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -404,7 +404,7 @@ void ivas_signaling_enc( /*-------------------------------------------------------------------------- * Write element mode info *--------------------------------------------------------------------------*/ -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ #else if ( st->element_mode >= IVAS_CPE_DFT && element_brate < MIN_BRATE_MDCT_STEREO && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 1708e4d701..87b6505716 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -323,18 +323,13 @@ ivas_error ivas_enc( /* Encode ISMs transport channels */ n = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { if ( ( error = ivas_sce_enc( st_ivas, 0, data_separated_object, input_frame, nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) /* there are no metadata bits in SCE in this mode */ { return error; } } -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) @@ -342,7 +337,6 @@ ivas_error ivas_enc( return error; } } -#endif else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { /* Analysis, decision about bitrates per channel & core coding */ @@ -355,12 +349,7 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa -#ifdef MASA_AND_OBJECTS - , - st_ivas->hIsmMetaData[0]->ism_imp -#endif - ); + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp ); /* Configuration of combined-format bit-budget distribution */ #ifdef DEBUG_MODE_INFO @@ -369,7 +358,6 @@ ivas_error ivas_enc( ivas_set_surplus_brate_enc( st_ivas ); #endif - /* Encode MASA transport channels */ if ( ( ivas_cpe_enc( st_ivas, 0, data_f[n], data_f[n + 1], input_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 8cf039868c..b560d04f4d 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -87,10 +87,11 @@ ivas_error ivas_ism_enc( int16_t localVAD_HE_SAD[1]; /* local HE VAD */ int16_t nchan_ism, dtx_flag, sid_flag, flag_noisy_speech; int16_t md_diff_flag[MAX_NUM_OBJECTS]; - ivas_error error; #ifdef MASA_AND_OBJECTS + int32_t ism_total_brate_ref, ism_total_brate; int16_t i, nchan_transport_ism; #endif + ivas_error error; push_wmops( "ivas_ism_enc" ); @@ -109,15 +110,12 @@ ivas_error ivas_ism_enc( #ifdef MASA_AND_OBJECTS nchan_transport_ism = st_ivas->nchan_transport; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { nchan_transport_ism = 1; nchan_ism = 1; } - else -#endif - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { nchan_transport_ism = st_ivas->hEncoderConfig->nchan_ism; } @@ -245,36 +243,17 @@ ivas_error ivas_ism_enc( } else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - // VE: call ivas_ism_metadata_enc() with 'st_ivas' - TBD - ivas_ism_metadata_enc( -#ifdef MASA_AND_OBJECTS - &st_ivas->hEncoderConfig->ivas_total_brate, -#else - st_ivas->hEncoderConfig->ivas_total_brate, -#endif - nchan_ism, #ifdef MASA_AND_OBJECTS - nchan_transport_ism, + ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, 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, -1 ); #else - st_ivas->nchan_transport, + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, 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 ); #endif - 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 -#ifdef MASA_AND_OBJECTS - , - -1 -#endif - ); } else /* ISM_MODE_DISC */ { #ifdef MASA_AND_OBJECTS - int32_t ism_total_brate_ref; - int32_t ism_total_brate; -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { ism_total_brate = 0; for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -289,20 +268,15 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; - // VE: change the interface of the following function and call it with 'st_ivas' only - ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, - nchan_transport_ism, 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, - st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ); + ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, 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, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ); if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - ism_total_brate; } - #else - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, - nchan_ism, - 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 ); + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, 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 ); #endif } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index e0451811ac..24924a25bb 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -214,11 +214,7 @@ ivas_error ivas_ism_metadata_enc( set_s( flag_abs_radius, 0, nchan_ism ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /*----------------------------------------------------------------* * Rate importance of particular ISM streams in combined format coding @@ -261,11 +257,7 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode != ISM_MASA_MODE_DISC ) -#endif { #endif /* write number of objects - unary coding */ @@ -296,11 +288,7 @@ ivas_error ivas_ism_metadata_enc( #endif { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* ISM importance flag will be written in ivas_masa_encode() */ hIsmMeta[ch]->ism_imp = ism_imp[ch]; @@ -318,11 +306,7 @@ ivas_error ivas_ism_metadata_enc( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -331,11 +315,7 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_transport; ch++ ) { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* reset */ hIsmMeta[ch]->ism_vad_flag = 1; @@ -346,11 +326,7 @@ ivas_error ivas_ism_metadata_enc( { /* this flag distinguishes between coding of inactive frame and active frame w/o. metadata */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* VAD flag will be written in ivas_masa_encode() */ hIsmMeta[ch]->ism_vad_flag = localVAD[ch]; @@ -382,11 +358,7 @@ ivas_error ivas_ism_metadata_enc( { hIsmMetaData = hIsmMeta[ch]; #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -401,11 +373,7 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -434,11 +402,7 @@ ivas_error ivas_ism_metadata_enc( /* save number of metadata bits written */ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) -#endif #else if ( ism_mode == ISM_MODE_DISC ) #endif @@ -574,18 +538,13 @@ ivas_error ivas_ism_metadata_enc( * Take into account the combined format bit-budget distribution *----------------------------------------------------------------*/ -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; -#ifdef OMASA_UPDATES int16_t brate_limit_flag; + brate_limit_flag = calculate_brate_limit_flag( ism_imp, nchan_ism ); -#endif bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); set_s( bits_element, bits_ism / nchan_ism, nchan_ism ); @@ -595,11 +554,7 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate = 0; for ( ch = 0; ch < nchan_ism; ch++ ) { -#ifdef OMASA_UPDATES *ism_total_brate += ivas_interformat_brate( ism_mode, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag ); -#else - *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch] ); -#endif } ism_metadata_flag_global = 1; } @@ -610,7 +565,6 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { if ( ( error = ivas_ism_config( *ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, 1 ) ) != IVAS_ERR_OK ) @@ -625,12 +579,6 @@ ivas_error ivas_ism_metadata_enc( return error; } } -#else - if ( ( error = ivas_ism_config( ism_total_brate, nchan_transport, nchan_ism, hIsmMeta, localVAD, ism_imp, element_brate, total_brate, nb_bits_metadata, ism_mode == ISM_MASA_MODE_DISC ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif #else 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 ) { @@ -656,11 +604,7 @@ ivas_error ivas_ism_metadata_enc( hSCE[ch]->element_brate = element_brate[ch]; } -#ifdef OMASA_UPDATES else if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - else if ( ism_mode == ISM_MASA_MODE_DISC ) -#endif { if ( ism_imp[ch] == ISM_INACTIVE_IMP ) { @@ -788,10 +732,8 @@ ivas_error ivas_ism_metadata_enc_create( #ifdef MASA_AND_OBJECTS st_ivas->hIsmMetaData[ch]->ism_imp = -1; st_ivas->hIsmMetaData[ch]->ism_vad_flag = 1; -#ifdef OMASA_UPDATES st_ivas->hIsmMetaData[ch]->q_azimuth_old = 0.0f; st_ivas->hIsmMetaData[ch]->q_elevation_old = 0.0f; -#endif #endif ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); @@ -803,11 +745,7 @@ ivas_error ivas_ism_metadata_enc_create( #ifdef MASA_AND_OBJECTS if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, 1, NULL, NULL, NULL, element_brate_tmp, NULL, NULL, 1 ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index b588302bf9..c1f509d9bb 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -64,12 +64,7 @@ static int16_t encode_lfe_to_total_energy_ratio( MASA_ENCODER_HANDLE hMasa, BSTR #ifdef MASA_AND_OBJECTS static void ivas_encode_masaism_metadata( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMetaData, BSTR_ENC_HANDLE hMetaData, ISM_METADATA_HANDLE hIsmMeta[], const int16_t low_bitrate_mode, const int16_t omasa_nbands, const int16_t omasa_nblocks, const int16_t idx_separated_object, const int16_t ism_imp ); -static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format -#ifndef OMASA_UPDATES - , - const ISM_MODE ism_mode -#endif -); +static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #else static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); @@ -150,11 +145,7 @@ ivas_error ivas_masa_enc_open( } #ifdef MASA_AND_OBJECTS ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -320,11 +311,7 @@ ivas_error ivas_masa_encode( #endif { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) || ( ivas_format != MASA_ISM_FORMAT ) ) -#else - if ( ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) || ( ivas_format != MASA_ISM_FORMAT ) ) -#endif { /* Combine directions */ ivas_masa_combine_directions( hMasa ); @@ -364,27 +351,18 @@ ivas_error ivas_masa_encode( hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; /* write index of separated object if needed */ -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && hMasa->data.nchan_ism > 1 ) -#else - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ && hMasa->data.nchan_ism > 1 ) -#endif { push_next_indice( hMetaData, idx_separated_object, NO_BITS_MASA_ISM_NO_OBJ ); hQMetaData->metadata_max_bits -= NO_BITS_MASA_ISM_NO_OBJ; } /* write ISM importance flag (one per object) */ -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif { push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; } -#ifdef OMASA_UPDATES else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); @@ -397,7 +375,6 @@ ivas_error ivas_masa_encode( hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; } } -#endif else if ( ism_mode == ISM_MASA_MODE_DISC ) { for ( i = 0; i < nchan_ism; i++ ) @@ -455,12 +432,8 @@ ivas_error ivas_masa_encode( if ( hMasa->config.max_metadata_bits < MINIMUM_BIT_BUDGET_NORMAL_META && !hMasa->config.joinedSubframes ) { #ifdef MASA_AND_OBJECTS - reduce_metadata_further( hMasa, hQMetaData, ivas_format -#ifndef OMASA_UPDATES - , - ism_mode -#endif - ); + reduce_metadata_further( hMasa, hQMetaData, ivas_format ); + low_bitrate_mode = ( ivas_total_brate <= 32000 ); #else reduce_metadata_further( hMasa, hQMetaData, ivas_format ); @@ -472,11 +445,7 @@ ivas_error ivas_masa_encode( #ifdef MASA_AND_OBJECTS /* Encode MASA+ISM metadata */ -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { /* encode MASA/ISM energy ratios */ ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes, @@ -491,11 +460,7 @@ ivas_error ivas_masa_encode( ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { /* Modify spatial metadata based on the MASA-to-total energy ratios */ modify_masa_energy_ratios( hQMetaData ); @@ -674,11 +639,7 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( i = 0; i < st_ivas->nSCE; i++ ) { @@ -731,18 +692,14 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { -#ifdef OMASA_UPDATES if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) { ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); } else { -#endif ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); -#ifdef OMASA_UPDATES } -#endif } else { @@ -843,11 +800,7 @@ ivas_error ivas_masa_enc_config( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) { @@ -1528,14 +1481,7 @@ static void compensate_energy_ratios( static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, - const IVAS_FORMAT ivas_format -#ifdef MASA_AND_OBJECTS -#ifndef OMASA_UPDATES - , - const ISM_MODE ism_mode -#endif -#endif -) + const IVAS_FORMAT ivas_format ) { int16_t sf; int16_t band; @@ -1559,11 +1505,7 @@ static void reduce_metadata_further( /* Get energy for the input data in 4-subframe, 5-band format */ totalEnergySum = 0.0f; #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ -#else - if ( ivas_format == MASA_FORMAT || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE ) ) /* Energy data is in 4-subframe, 24-band format */ -#endif #else if ( ivas_format == MASA_FORMAT ) /* Energy data is in 4-subframe, 24-band format */ #endif @@ -1953,11 +1895,7 @@ void ivas_masa_enc_reconfigure( #ifdef MASA_AND_OBJECTS ism_total_brate = 0; -#ifdef OMASA_UPDATES if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) ) -#endif { for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { @@ -3633,7 +3571,6 @@ static void ivas_encode_masaism_metadata( /* quantize directions */ for ( obj = 0; obj < hMasa->data.nchan_ism; obj++ ) { -#ifdef OMASA_UPDATES if ( bits_ism[obj] < 8 ) { /* check is same as previous */ @@ -3658,11 +3595,6 @@ static void ivas_encode_masaism_metadata( hIsmMeta[obj]->q_elevation_old = hIsmMeta[obj]->elevation; hIsmMeta[obj]->q_azimuth_old = hIsmMeta[obj]->azimuth; } - -#else - idx_sph = quantize_direction( hIsmMeta[obj]->elevation, hIsmMeta[obj]->azimuth, bits_ism[obj], &theta_q, &phi_q, &index_theta, &index_phi, MC_LS_SETUP_INVALID ); - push_next_indice( hMetaData, idx_sph, bits_ism[obj] ); -#endif } return; diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index a9f182705a..d9acdc7d2f 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -277,11 +277,7 @@ ivas_error ivas_omasa_enc_config( st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; -#ifdef OMASA_UPDATES if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) -#else - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) -#endif { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } @@ -323,11 +319,7 @@ void ivas_omasa_set_config( uint8_t i, maxBin; /* Determine the number of bands */ -#ifdef OMASA_UPDATES if ( ism_mode == ISM_MODE_NONE || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( ism_mode == ISM_MODE_NONE ) -#endif { /* use full resolution for the ISM+MASA merge and reduce later */ hOMasa->nbands = 24; @@ -399,140 +391,8 @@ void ivas_omasa_enc( int16_t i, j; float data_out_f[MASA_MAX_TRANSPORT_CHANNELS][L_FRAME48k]; - -#ifdef OMASA_UPDATES /* Determine separated object (when applicable) */ if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - /* Analysis */ - if ( ism_mode == ISM_MODE_NONE ) - { -#ifdef OMASA_DIFFUSE_ISM_MERGE - OMASA_SPATIAL_META OMasaMeta; /* working memory for the ISM-object MASA-parameters */ - OMASA_SPATIAL_META_HANDLE hOMasaMeta; - uint8_t n_bands_orig, n_subframes_orig; - uint8_t numCodingBands_orig, joinedSubframes_orig; -#else - float elevation_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - float azimuth_m_values[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - float energyRatio[MASA_FREQUENCY_BANDS]; - float spreadCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - float surroundingCoherence[MASA_FREQUENCY_BANDS]; - int16_t nBands, nBlocks; - uint8_t fixedDistance = 0; - - nBands = hOMasa->nbands; - nBlocks = hOMasa->nSubframes; -#endif - -#ifdef OMASA_DIFFUSE_ISM_MERGE - hOMasaMeta = &OMasaMeta; - hOMasaMeta->num_dirs = 1; /* TODO: hard-coding for now */ - - /* merge MASA directions before adding ISM to the mixture */ - if ( hMasa->config.numberOfDirections == 2 ) - { - n_bands_orig = hMasa->config.numCodingBands; - hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; - - ivas_masa_combine_directions( hMasa ); - - hMasa->config.numCodingBands = (int8_t) n_bands_orig; - } - - /* force computation into high resolution */ - n_bands_orig = hOMasa->nbands; - n_subframes_orig = hOMasa->nSubframes; - - hOMasa->nbands = MASA_FREQUENCY_BANDS; - hOMasa->nSubframes = MAX_PARAM_SPATIAL_SUBFRAMES; - - /* Estimate MASA parameters from the objects */ - /* NB: only first direction is populated */ - /* NB2: in energy_ratios and surround_coherence only first sub-frame contains valid data */ - ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, hOMasaMeta->directional_meta[0].elevation, hOMasaMeta->directional_meta[0].azimuth, hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].spread_coherence, hOMasaMeta->common_meta.surround_coherence[0], - hOMasaMeta->common_meta.diffuse_to_total_ratio[0], input_frame, nchan_ism ); - - /* copy energy_ratios and surrCoh from first sub-frame to the remaining ones */ - for ( i = 1; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) - { - mvr2r( hOMasaMeta->directional_meta[0].energy_ratio[0], hOMasaMeta->directional_meta[0].energy_ratio[i], MASA_FREQUENCY_BANDS ); - mvr2r( hOMasaMeta->common_meta.surround_coherence[0], hOMasaMeta->common_meta.surround_coherence[i], MASA_FREQUENCY_BANDS ); - mvr2r( hOMasaMeta->common_meta.diffuse_to_total_ratio[0], hOMasaMeta->common_meta.diffuse_to_total_ratio[i], MASA_FREQUENCY_BANDS ); - } -#else - /* Estimate MASA parameters from the objects */ - ivas_omasa_param_est_enc( hOMasa, hMasa, hIsmMeta, data_in_f, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame, nchan_ism ); -#endif - -#ifdef OMASA_DIFFUSE_ISM_MERGE - /* restore resolution parameters */ - hOMasa->nbands = n_bands_orig; - hOMasa->nSubframes = n_subframes_orig; - - /* perform MASA+ISM merge in full resolution */ - numCodingBands_orig = hMasa->config.numCodingBands; - joinedSubframes_orig = hMasa->config.joinedSubframes; - - hMasa->config.numCodingBands = MASA_FREQUENCY_BANDS; - hMasa->config.joinedSubframes = 0; - - ivas_merge_masa_metadata( hMasa, hOMasaMeta ); /* => merge result in hMasa->masaMetadata */ - - hMasa->config.numCodingBands = numCodingBands_orig; - hMasa->config.joinedSubframes = joinedSubframes_orig; -#else - - /* Set analyzed values to the QMeta struct */ - for ( i = 0; i < nBands; i++ ) - { - for ( j = 0; j < nBlocks; j++ ) - { - hQMeta->q_direction[0].band_data[i].azimuth[j] = azimuth_m_values[j][i]; - hQMeta->q_direction[0].band_data[i].elevation[j] = elevation_m_values[j][i]; - hQMeta->q_direction[0].band_data[i].energy_ratio[j] = energyRatio[i]; /* Only one value is transmitted for all subframes */ - hQMeta->q_direction[0].band_data[i].distance[j] = fixedDistance; - - if ( hQMeta->surcoh_band_data != NULL ) - { - hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = (uint8_t) roundf( spreadCoherence[j][i] * UINT8_MAX ); - hQMeta->surcoh_band_data[i].surround_coherence[j] = (uint8_t) roundf( surroundingCoherence[i] * UINT8_MAX ); - } - } - } - - /* At lower sampling rates, set zeros for higher bands that were not analyzed */ - if ( nBands < hOMasa->nCodingBands ) - { - for ( i = nBands; i < hOMasa->nCodingBands; i++ ) - { - for ( j = 0; j < nBlocks; j++ ) - { - hQMeta->q_direction[0].band_data[i].azimuth[j] = 0.0f; - hQMeta->q_direction[0].band_data[i].elevation[j] = 0.0f; - hQMeta->q_direction[0].band_data[i].energy_ratio[j] = 0.0f; - hQMeta->q_direction[0].band_data[i].distance[j] = 0; - - if ( hQMeta->surcoh_band_data != NULL ) - { - hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = 0; - hQMeta->surcoh_band_data[i].surround_coherence[j] = 0; - } - } - } - } -#endif - } - else if ( ism_mode == ISM_MASA_MODE_PARAM ) - { -#ifdef REDUCE_OMASA_META_BITS - *idx_separated_object = -1; -#endif - /* Estimate energies and ratios */ - ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); - } - else -#endif { float broadband_energy[MAX_NUM_OBJECTS + MASA_MAX_TRANSPORT_CHANNELS]; int16_t loudest_object; @@ -647,7 +507,6 @@ void ivas_omasa_enc( { set_zero( data_in_f[selected_object], input_frame ); } -#ifdef OMASA_UPDATES } /* Analysis */ @@ -715,20 +574,17 @@ void ivas_omasa_enc( { *idx_separated_object = -1; } -#endif /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); } -#ifdef OMASA_UPDATES /* Move the ISM metadata to the first entry for encoding in the MASA_ONE_OBJ mode */ if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { hIsmMeta[0]->azimuth = hIsmMeta[*idx_separated_object]->azimuth; hIsmMeta[0]->elevation = hIsmMeta[*idx_separated_object]->elevation; } -#endif /* Downmix */ ivas_omasa_dmx( data_in_f, data_out_f, input_frame, nchan_transport, nchan_ism, hIsmMeta, hOMasa->prev_object_dm_gains, hOMasa->interpolator ); @@ -820,27 +676,12 @@ void ivas_set_surplus_brate_enc( #endif ) { -#ifdef OMASA_UPDATES if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_PARAM_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ); -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - st_ivas->hCPE[0]->brate_surplus = st_ivas->hSCE[0]->element_brate - ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, st_ivas->hSCE[0]->element_brate, st_ivas->hIsmMetaData[0]->ism_imp -#ifdef FIX_4OBJ_128 - , - 0 -#endif - ); -#endif /* note: ISM st->total_brate is iset in ivas_sce_enc() */ } -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { /* it is already set in ivas_ism_enc() */ } @@ -854,12 +695,8 @@ void ivas_set_surplus_brate_enc( { int16_t input_frame = (int16_t) ( st_ivas->hEncoderConfig->input_Fs / FRAMES_PER_SEC ); float tmpF = 0; -#ifdef OMAOMASA_UPDATES - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - if ( 1 ) // st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) -#endif + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { tmpF += st_ivas->hSCE[0]->hCoreCoder[0]->total_brate + (float) ( nb_bits_metadata[1] * 50 ); } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 1a42cf635f..e236ecf5ba 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -144,11 +144,7 @@ ivas_error ivas_sce_enc( if ( st_ivas->hQMetaData != NULL && st_ivas->hSpar == NULL ) { #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( ( ( st_ivas->mc_mode == MC_MODE_MCMASA ) && ( st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) ) || ( st_ivas->ism_mode >= ISM_MASA_MODE_ONE_OBJ ) ) -#endif #else if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hEncoderConfig->ivas_total_brate >= MCMASA_SEPARATE_BRATE ) #endif @@ -220,27 +216,12 @@ ivas_error ivas_sce_enc( * Combined format coding: get the ISM importance and the bit-rate *----------------------------------------------------------------*/ -#ifdef OMASA_UPDATES if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_PARAM_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp, 0 ) - nb_bits_metadata * FRAMES_PER_SEC; } -#else - if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ ) - { - set_ism_importance_interformat( hSCE->element_brate, 1, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hMasa->data.lp_noise_CPE, &st_ivas->hIsmMetaData[0]->ism_imp ); - - st->total_brate = ivas_interformat_brate( ISM_MASA_MODE_ONE_OBJ, 1, hSCE->element_brate, st_ivas->hIsmMetaData[0]->ism_imp -#ifdef FIX_4OBJ_128 - , - 0 -#endif - ) - - nb_bits_metadata * FRAMES_PER_SEC; - } -#endif #endif /*----------------------------------------------------------------* @@ -262,11 +243,7 @@ ivas_error ivas_sce_enc( st->flag_ACELP16k = set_ACELP_flag( IVAS_SCE, hSCE->element_brate, st->core_brate, 0, 0, -1, -1 ); } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st->low_rate_mode ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ && st->low_rate_mode ) -#endif { st->flag_ACELP16k = 0; } @@ -376,11 +353,7 @@ ivas_error create_sce_enc( copy_encoder_config( st_ivas, st, 1 ); #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#else - if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { st->element_mode = IVAS_SCE; } diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index 534dc2189c..59b7c0a399 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -118,7 +118,8 @@ int16_t select_stereo_mode( { stereo_switching_flag = 0; } -#ifdef OMASA_UPDATES + +#ifdef MASA_AND_OBJECTS if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO && !( hCPE->element_brate == IVAS_48k && ivas_total_brate == IVAS_32k ) ) /* the second condition for PARAM mode OMASA */ #else if ( hCPE->element_brate >= MIN_BRATE_MDCT_STEREO ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 0135239e2e..e6f645197a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -448,7 +448,6 @@ static void ivas_dirac_dec_binaural_internal( /* The input channel number at this processing function (not nchan_transport) */ numInChannels = BINAURAL_CHANNELS; #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) { numInChannels++; @@ -457,19 +456,6 @@ static void ivas_dirac_dec_binaural_internal( { numInChannels += (uint8_t) st_ivas->nchan_ism; } -#else - if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) - { - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - numInChannels += (uint8_t) st_ivas->nchan_ism; - } - else - { - numInChannels++; - } - } -#endif #else if ( st_ivas->hOutSetup.separateChannelEnabled ) { @@ -594,18 +580,9 @@ static void ivas_dirac_dec_binaural_internal( } #ifdef MASA_AND_OBJECTS -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) -#endif { - preProcessStereoTransportsForMovedObjects( st_ivas, - Cldfb_RealBuffer_in, - Cldfb_ImagBuffer_in, - nBins, - firstSubframe, - nSubframes ); + preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, nBins, firstSubframe, nSubframes ); } #endif @@ -1199,28 +1176,16 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( separateCenterChannelRendering = 0; nchanSeparateChannels = 0; -#ifdef OMASA_UPDATES if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) -#else - if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) -#endif { separateCenterChannelRendering = 1; nchanSeparateChannels = 1; -#ifndef OMASA_UPDATES - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; - } -#endif } -#ifdef OMASA_UPDATES else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { separateCenterChannelRendering = 1; nchanSeparateChannels = (uint8_t) st_ivas->nchan_ism; } -#endif #else separateCenterChannelRendering = st_ivas->hOutSetup.separateChannelEnabled; #endif @@ -1367,7 +1332,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( #ifdef MASA_AND_OBJECTS uint8_t instantChange = 0; -#ifdef OMASA_UPDATES if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { gainFactor = 0.7943f * sqrtf( h->earlyPartEneCorrection[bin] ); /* Todo Nokia: Temporary gain for roughly matching the loudness of other processing paths. */ @@ -1376,9 +1340,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( { gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); } -#else - gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); -#endif + for ( chB = 0; chB < nchanSeparateChannels; chB++ ) { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 732b7f84da..ce68f4f313 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -211,7 +211,7 @@ ivas_error ivas_td_binaural_open_unwrap( *hBinRendererTd = pBinRendTd; -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( ivas_format != MASA_ISM_FORMAT ) { *binaural_latency_ns = (int32_t) ( ( *hBinRendererTd )->HrFiltSet_p->latency_s * 1000000000.f ); @@ -436,7 +436,7 @@ void TDREND_Update_object_positions( c_indx++; } -#ifdef OMASA_UPDATES +#ifdef MASA_AND_OBJECTS if ( in_format == ISM_FORMAT || in_format == MASA_ISM_FORMAT ) #else if ( in_format == ISM_FORMAT ) -- GitLab From 1d5d629e4473b1e03b82c1e358ffe59c3877a07a Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 20:02:33 +0200 Subject: [PATCH 0109/1418] introduce function ivas_omasa_ism_metadata_dec(0 in order to simplify ivas_dec.c() --- lib_com/ivas_prot.h | 14 +++++--- lib_dec/ivas_dec.c | 78 +++++++--------------------------------- lib_dec/ivas_omasa_dec.c | 76 +++++++++++++++++++++++++++++++++++++++ lib_enc/ivas_enc.c | 9 +++-- 4 files changed, 103 insertions(+), 74 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a6392e2a09..eeb267aec7 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5196,20 +5196,17 @@ void ivas_combined_format_brate_sanity( int16_t *diff_nBits /* o : number of differential bits */ ); - ISM_MODE ivas_omasa_ism_mode_select( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t nchan_ism /* i : number of input ISM's */ ); -#ifdef MASA_AND_OBJECTS void ivas_set_omasa_TC( const ISM_MODE ism_mode, /* i : ISM mode */ const int16_t nchan_ism, /* i : number of input ISMs */ int16_t *nSCE, /* o : number of SCEs */ int16_t *nCPE /* o : number of CPEs */ ); -#endif void ivas_merge_masa_transports( float data_in_f1[][L_FRAME48k], /* i : Transport audio signals 1 */ @@ -5219,15 +5216,22 @@ void ivas_merge_masa_transports( const int16_t num_transport_channels /* i : Number of transport audio signals */ ); +ivas_error ivas_omasa_ism_metadata_dec( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ + int16_t *nchan_ism, /* o : number of ISM separated channels */ + int16_t *nchan_transport_ism, /* o : number of ISM TCs */ + const int16_t dirac_bs_md_write_idx, /* i : DirAC bitstream write index */ + int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ +); + ivas_error ivas_masa_ism_data_open( Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ ); -#ifdef MASA_AND_OBJECTS void ivas_masa_ism_data_close( MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ ); -#endif void preProcessStereoTransportsForMovedObjects( Decoder_Struct* st_ivas, diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 199af09c8d..a01cee2056 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -404,23 +404,21 @@ ivas_error ivas_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - int16_t dirac_bs_md_write_idx = 0; + int16_t nchan_ism, nchan_transport_ism; + int16_t dirac_bs_md_write_idx, dirac_read_idx; st = st_ivas->hCPE[0]->hCoreCoder[0]; - nb_bits_metadata[0] = 0; set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); /* Set the number of objects for the parametric rendering */ + dirac_bs_md_write_idx = 0; if ( st_ivas->hDirAC != NULL ) { + st_ivas->hDirAC->numIsmDirections = 0; if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { st_ivas->hDirAC->numIsmDirections = st_ivas->nchan_ism; } - else - { - st_ivas->hDirAC->numIsmDirections = 0; - } dirac_bs_md_write_idx = st_ivas->hDirAC->dirac_bs_md_write_idx; /* Store the write-index for this frame */ } @@ -436,64 +434,10 @@ ivas_error ivas_dec( st->bit_stream = &( st_ivas->bit_stream[( ism_total_brate / FRAMES_PER_SEC )] ); - //VE: !!!!! - /* set ISM parameters */ - int16_t nchan_ism, nchan_transport_ism; - nchan_ism = st_ivas->nchan_ism; - nchan_transport_ism = st_ivas->nchan_ism; - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) - { - nchan_ism = 1; - nchan_transport_ism = 1; - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - nchan_ism = 0; - nchan_transport_ism = 1; - } - - /* decode ISM metadata */ - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + /* set ISM parameters and decode ISM metadata in OMASA format */ + if ( ( error = ivas_omasa_ism_metadata_dec( st_ivas, ism_total_brate, &nchan_ism, &nchan_transport_ism, dirac_bs_md_write_idx, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) { - int16_t azimuth_ism; - int16_t elevation_ism; - int16_t block; - int16_t meta_write_index; - - /* decode ISM metadata */ - if ( ( error = ivas_ism_metadata_dec( ism_total_brate, nchan_ism, &nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, &nb_bits_metadata[1], st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt ) ) != IVAS_ERR_OK ) - { - return error; - } - - // VE: move the following updates into ivas_ism_metadata_dec() - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); - elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); - - for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) - { - meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; - st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; - st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; - } - } - } - else /* ISM_MASA_MODE_MASA_ONE_OBJ */ - { - azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); - elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); - - for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) - { - meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; - st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; - st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; - } - } + return error; } /* decode ISM channels */ @@ -569,18 +513,20 @@ ivas_error ivas_dec( { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { + //ivas_omasa_rend( st_ivas, output ); + + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - int16_t dirac_read_idx; if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { - mvr2r( output[2], data_separated_objects[0], output_frame ); + // mvr2r( output[2], data_separated_objects[0], output_frame ); } else { for ( n = 0; n < st_ivas->nchan_ism; n++ ) { - mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + // mvr2r( output[n + 2], data_separated_objects[n], output_frame ); } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 777d6bfbe5..d538462db6 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -392,4 +392,80 @@ void ivas_set_surplus_brate_dec( return; } + + +/*--------------------------------------------------------------------------* + * ivas_omasa_ism_metadata_dec() + * + * decode ISM metadata in OMASA format + *--------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_ism_metadata_dec( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const int32_t ism_total_brate, /* i : ISM total bitrate */ + int16_t *nchan_ism, /* o : number of ISM separated channels */ + int16_t *nchan_transport_ism, /* o : number of ISM TCs */ + const int16_t dirac_bs_md_write_idx, /* i : DirAC bitstream write index */ + int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ +) +{ + int16_t n, block; + int16_t azimuth_ism, elevation_ism, meta_write_index; + ivas_error error; + + /* set ISM parameters */ + *nchan_ism = st_ivas->nchan_ism; + *nchan_transport_ism = st_ivas->nchan_ism; + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + *nchan_ism = 1; + *nchan_transport_ism = 1; + } + else if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + *nchan_ism = 0; + *nchan_transport_ism = 1; + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) + { + /* decode ISM metadata */ + if ( ( error = ivas_ism_metadata_dec( ism_total_brate, *nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, + nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; + } + } + } + else /* ISM_MASA_MODE_MASA_ONE_OBJ */ + { + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); + + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; + } + } + } + + return IVAS_ERR_OK; +} + #endif diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 87b6505716..457d56a5e9 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -348,8 +348,11 @@ ivas_error ivas_enc( } /* Encode MASA parameters and write MASA metadata bitstream */ - ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp ); + if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp ) ) != IVAS_ERR_OK ) + { + return error; + } /* Configuration of combined-format bit-budget distribution */ #ifdef DEBUG_MODE_INFO @@ -368,7 +371,7 @@ ivas_error ivas_enc( else if ( ivas_format == MC_FORMAT ) { /* select MC format mode; write MC LS setup; reconfigure the MC format encoder */ - if ( ( ivas_mc_enc_config( st_ivas ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_mc_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 214ddc703fc11dd81d2ff34999b267fc1ad86c62 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 20:19:17 +0200 Subject: [PATCH 0110/1418] introduce function ivas_omasa_rend() in order to safe stack memory --- lib_com/ivas_prot.h | 18 ++++++++++++------ lib_dec/ivas_dec.c | 28 +++------------------------- lib_dec/ivas_omasa_dec.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index eeb267aec7..238492a510 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5216,6 +5216,14 @@ void ivas_merge_masa_transports( const int16_t num_transport_channels /* i : Number of transport audio signals */ ); +ivas_error ivas_masa_ism_data_open( + Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ +); + +void ivas_masa_ism_data_close( + MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ +); + ivas_error ivas_omasa_ism_metadata_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const int32_t ism_total_brate, /* i : ISM total bitrate */ @@ -5225,12 +5233,10 @@ ivas_error ivas_omasa_ism_metadata_dec( int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ ); -ivas_error ivas_masa_ism_data_open( - Decoder_Struct* st_ivas /* i/o: IVAS decoder handle */ -); - -void ivas_masa_ism_data_close( - MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle */ +void ivas_omasa_rend( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* o : output synthesis signal */ + const int16_t output_frame /* i : output frame length per channel */ ); void preProcessStereoTransportsForMovedObjects( diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index a01cee2056..3e43b6aec5 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -509,37 +509,15 @@ ivas_error ivas_dec( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } - else if ( st_ivas->hDirAC ) + else if ( st_ivas->renderer_type == RENDERER_DIRAC ) // VE2TP: please verify, it was "else if (st_ivas->hDirAC)" { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - //ivas_omasa_rend( st_ivas, output ); - - - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - // mvr2r( output[2], data_separated_objects[0], output_frame ); - } - else - { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - // mvr2r( output[n + 2], data_separated_objects[n], output_frame ); - } - } - - dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; - - ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); - - st_ivas->hDirAC->dirac_read_idx = dirac_read_idx; /* Original read index is needed for the next function which will update it again */ - - ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); + ivas_omasa_rend( st_ivas, output, output_frame ); } else { + // VE2TP: this should never happen (ISM_MODE_NONE is renderered via ivas_format==MASA_FORMAT if branch) ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index d538462db6..bd4af659d0 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -468,4 +468,42 @@ ivas_error ivas_omasa_ism_metadata_dec( return IVAS_ERR_OK; } + +/*--------------------------------------------------------------------------* + * ivas_omasa_rend() + * + * Rendering in OMASA format + *--------------------------------------------------------------------------*/ + +void ivas_omasa_rend( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* o : output synthesis signal */ + const int16_t output_frame /* i : output frame length per channel */ +) +{ + int16_t n, dirac_read_idx; + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + mvr2r( output[2], data_separated_objects[0], output_frame ); + } + else + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + mvr2r( output[n + 2], data_separated_objects[n], output_frame ); + } + } + + dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; + + ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); + + st_ivas->hDirAC->dirac_read_idx = dirac_read_idx; /* Original read index is needed for the next function which will update it again */ + + ivas_masa_ism_separate_object_render( st_ivas, data_separated_objects, output, output_frame ); + + return; +} #endif -- GitLab From b029297cfedf12982fc5aaf44cc5de8be6bfd677 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 20:29:10 +0200 Subject: [PATCH 0111/1418] introduce function ivas_omasa_dirac_td_binaural() in order to safe stack memory --- lib_com/ivas_prot.h | 8 ++++++- lib_dec/ivas_dec.c | 29 ++++-------------------- lib_dec/ivas_omasa_dec.c | 48 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 238492a510..dd3c658455 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5233,7 +5233,13 @@ ivas_error ivas_omasa_ism_metadata_dec( int16_t nb_bits_metadata[] /* o : number of ISM metadata bits */ ); -void ivas_omasa_rend( +ivas_error ivas_omasa_dirac_td_binaural( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* o : output synthesis signal */ + const int16_t output_frame /* i : output frame length per channel */ +); + +void ivas_omasa_dirac_rend( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float output[][L_FRAME48k], /* o : output synthesis signal */ const int16_t output_frame /* i : output frame length per channel */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 3e43b6aec5..6d8ab4db78 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -405,7 +405,7 @@ ivas_error ivas_dec( else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { int16_t nchan_ism, nchan_transport_ism; - int16_t dirac_bs_md_write_idx, dirac_read_idx; + int16_t dirac_bs_md_write_idx; st = st_ivas->hCPE[0]->hCoreCoder[0]; set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); @@ -474,31 +474,10 @@ ivas_error ivas_dec( { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ) { - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; - float gain = 0.7943f; /* Todo Nokia: Temporary gain for roughly matching the loudness of other processing paths. */ - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - mvr2r( output[2 + n], data_separated_objects[n], output_frame ); - v_multc( data_separated_objects[n], gain, data_separated_objects[n], output_frame ); - } - - for ( n = 0; n < st_ivas->nchan_ism; n++ ) - { - delay_signal( data_separated_objects[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); - } - - ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); - - if ( ( error = ivas_td_binaural_renderer( st_ivas, data_separated_objects, output_frame ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_omasa_dirac_td_binaural( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) { return error; } - - for ( n = 0; n < BINAURAL_CHANNELS; n++ ) - { - v_add( output[n], data_separated_objects[n], output[n], output_frame ); - } } else { @@ -513,11 +492,11 @@ ivas_error ivas_dec( { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - ivas_omasa_rend( st_ivas, output, output_frame ); + ivas_omasa_dirac_rend( st_ivas, output, output_frame ); } else { - // VE2TP: this should never happen (ISM_MODE_NONE is renderered via ivas_format==MASA_FORMAT if branch) + // VE2TP: please verify - this should probably never happen (ISM_MODE_NONE is renderered via "ivas_format == MASA_FORMAT" if branch) ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index bd4af659d0..870ba29169 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -470,12 +470,12 @@ ivas_error ivas_omasa_ism_metadata_dec( /*--------------------------------------------------------------------------* - * ivas_omasa_rend() + * ivas_omasa_dirac_rend() * * Rendering in OMASA format *--------------------------------------------------------------------------*/ -void ivas_omasa_rend( +void ivas_omasa_dirac_rend( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float output[][L_FRAME48k], /* o : output synthesis signal */ const int16_t output_frame /* i : output frame length per channel */ @@ -506,4 +506,48 @@ void ivas_omasa_rend( return; } + + +/*--------------------------------------------------------------------------* + * ivas_omasa_dirac_td_binaural() + * + * Binaural rendering in OMASA format + *--------------------------------------------------------------------------*/ + +ivas_error ivas_omasa_dirac_td_binaural( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* o : output synthesis signal */ + const int16_t output_frame /* i : output frame length per channel */ +) +{ + int16_t n; + float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; + float gain = 0.7943f; /* Todo Nokia: Temporary gain for roughly matching the loudness of other processing paths. */ + ivas_error error; + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + mvr2r( output[2 + n], data_separated_objects[n], output_frame ); + v_multc( data_separated_objects[n], gain, data_separated_objects[n], output_frame ); + } + + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + delay_signal( data_separated_objects[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size ); + } + + ivas_dirac_dec_binaural( st_ivas, output, st_ivas->nchan_transport ); + + if ( ( error = ivas_td_binaural_renderer( st_ivas, data_separated_objects, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( n = 0; n < BINAURAL_CHANNELS; n++ ) + { + v_add( output[n], data_separated_objects[n], output[n], output_frame ); + } + + return IVAS_ERR_OK; +} #endif -- GitLab From 5aadd51042e74d56f6e83a39d1fe4937f0b144de Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 26 Apr 2023 20:37:10 +0200 Subject: [PATCH 0112/1418] remove obsolete ISM_MASA_MODE_PARAM mode --- lib_com/ivas_cnst.h | 2 +- lib_com/ivas_omasa_com.c | 5 ----- lib_dec/ivas_cpe_dec.c | 4 ---- lib_dec/ivas_masa_dec.c | 9 +-------- lib_dec/ivas_mono_dmx_renderer.c | 6 +----- lib_enc/ivas_cpe_enc.c | 13 +------------ lib_enc/ivas_init_enc.c | 2 +- lib_enc/ivas_masa_enc.c | 13 +++---------- lib_enc/ivas_omasa_enc.c | 9 ++------- 9 files changed, 10 insertions(+), 53 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 2ebd9e359e..2f8d004a9e 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -373,11 +373,11 @@ typedef enum ISM_MODE_PARAM /* parametric ISM */ #ifdef MASA_AND_OBJECTS , - ISM_MASA_MODE_PARAM, /* parametric ISM mode for combined MASA ISM format */ ISM_MASA_MODE_MASA_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using MASA parameters */ ISM_MASA_MODE_PARAM_ONE_OBJ, /* MASA ISM mode when one object is encoded separately and remainder using parametric object model */ ISM_MASA_MODE_DISC /* MASA ISM mode when all objects are encoded separarately */ #endif + } ISM_MODE; diff --git a/lib_com/ivas_omasa_com.c b/lib_com/ivas_omasa_com.c index 5501fa79aa..8e385537c3 100644 --- a/lib_com/ivas_omasa_com.c +++ b/lib_com/ivas_omasa_com.c @@ -161,10 +161,6 @@ void ivas_set_omasa_TC( { switch ( ism_mode ) { - case ISM_MASA_MODE_PARAM: - *nCPE = 1; - *nSCE = 0; - break; case ISM_MASA_MODE_MASA_ONE_OBJ: case ISM_MASA_MODE_PARAM_ONE_OBJ: *nCPE = 1; @@ -214,7 +210,6 @@ int32_t ivas_interformat_brate( { if ( ism_mode == ISM_MASA_MODE_DISC && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate <= 24000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) /* for border case in DISC mode */ { - if ( limit_flag == 1 && ( ( nchan_ism == 4 && element_brate == 24000 ) || ( nchan_ism == 3 && element_brate == 20000 ) || ( nchan_ism == 2 && element_brate <= 11000 ) ) ) { return element_brate; diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 97a046fe9d..9667995683 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -1100,11 +1100,7 @@ static void read_stereo_mode_and_bwidth( else { /* read stereo technology info */ -#ifdef MASA_AND_OBJECTS - if ( ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) || ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && hCPE->element_brate == IVAS_48k ) ) -#else if ( hCPE->element_brate < MIN_BRATE_MDCT_STEREO && st_ivas->hMCT == NULL ) -#endif { hCPE->element_mode = get_next_indice( sts[0], NBITS_ELEMENT_MODE ) + IVAS_CPE_DFT; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index b84d8d1cca..d559c05261 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -721,14 +721,7 @@ static ivas_error ivas_masa_dec_config( if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) - { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); - } - else - { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); - } + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); } else { diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index a6f0abfddb..4e16edca30 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -97,11 +97,7 @@ void ivas_mono_downmix_render_passive( #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) - { - numInputChannels = st_ivas->nchan_transport; - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { numInputChannels = st_ivas->nchan_transport + 1; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index db0da4666d..5c13e032e8 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -169,18 +169,7 @@ ivas_error ivas_cpe_enc( if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL ) { -#ifdef MASA_AND_OBJECTS - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM && ivas_total_brate == IVAS_48k ) - { - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, IVAS_32k ); - } - else - { -#endif - hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); -#ifdef MASA_AND_OBJECTS - } -#endif + hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index a9d1c83c43..f2b30df804 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -628,7 +628,7 @@ ivas_error ivas_init_encoder( } } - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) { st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index c1f509d9bb..e12251abf7 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -445,7 +445,7 @@ ivas_error ivas_masa_encode( #ifdef MASA_AND_OBJECTS /* Encode MASA+ISM metadata */ - if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) + if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { /* encode MASA/ISM energy ratios */ ivas_encode_masaism_metadata( hMasa, hQMetaData, hMetaData, hIsmMetaData, low_bitrate_mode, hOMasa->nCodingBands, hOMasa->nSubframes, @@ -460,7 +460,7 @@ ivas_error ivas_masa_encode( ivas_qmetadata_enc_encode( hMetaData, hQMetaData ); #ifdef MASA_AND_OBJECTS - if ( ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) + if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { /* Modify spatial metadata based on the MASA-to-total energy ratios */ modify_masa_energy_ratios( hQMetaData ); @@ -692,14 +692,7 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->hCPE[0]->element_brate == IVAS_48k && st_ivas->ism_mode == ISM_MASA_MODE_PARAM ) - { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, IVAS_32k, st_ivas->nchan_transport, MC_MODE_NONE ); - } - else - { - ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); - } + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); } else { diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index d9acdc7d2f..8c6cd7038c 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -277,7 +277,7 @@ ivas_error ivas_omasa_enc_config( st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; - if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO && ( st_ivas->ism_mode != ISM_MASA_MODE_PARAM ) ) + if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) { hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; } @@ -568,13 +568,8 @@ void ivas_omasa_enc( hMasa->config.numCodingBands = numCodingBands_orig; hMasa->config.joinedSubframes = joinedSubframes_orig; } - else if ( ism_mode == ISM_MASA_MODE_PARAM || ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + else if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { - if ( ism_mode == ISM_MASA_MODE_PARAM ) - { - *idx_separated_object = -1; - } - /* Estimate energies and ratios */ ivas_omasa_energy_and_ratio_est( hOMasa, hMasa, data_in_f, input_frame, nchan_ism ); } -- GitLab From 3e53ed8d1b53f3170b2487fcf9eeea63c87d824b Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 27 Apr 2023 11:03:19 +0300 Subject: [PATCH 0113/1418] Fixes to OMASA mono output path and addressing VE2TP comments. --- lib_dec/ivas_dec.c | 12 ++---------- lib_dec/ivas_masa_dec.c | 35 ++++++++++++++++++++--------------- lib_dec/ivas_omasa_dec.c | 39 +++++++++++++++++++++------------------ 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 6d8ab4db78..a45fe2bb7d 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -488,17 +488,9 @@ ivas_error ivas_dec( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) // VE2TP: please verify, it was "else if (st_ivas->hDirAC)" + else if ( st_ivas->renderer_type == RENDERER_DIRAC ) { - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - ivas_omasa_dirac_rend( st_ivas, output, output_frame ); - } - else - { - // VE2TP: please verify - this should probably never happen (ISM_MODE_NONE is renderered via "ivas_format == MASA_FORMAT" if branch) - ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport, NULL, NULL, -1 ); - } + ivas_omasa_dirac_rend( st_ivas, output, output_frame ); } } #endif diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index d559c05261..9f1c5750c3 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -308,29 +308,34 @@ ivas_error ivas_masa_decode( #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) - { - *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, - st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); - } - if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { - for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) + if ( st_ivas->hDirAC != NULL ) { - if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) - { - int16_t sf; - int16_t meta_write_index; + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) + { + if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) { - meta_write_index = ( st_ivas->hDirAC->dirac_bs_md_write_idx + sf ) % st_ivas->hDirAC->dirac_md_buffer_length; - st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->azimuth_ism[obj][meta_write_index]; - st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->elevation_ism[obj][meta_write_index]; + int16_t sf; + int16_t meta_write_index; + + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) + { + meta_write_index = ( st_ivas->hDirAC->dirac_bs_md_write_idx + sf ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->azimuth_ism[obj][meta_write_index]; + st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->elevation_ism[obj][meta_write_index]; + } } } } + else + { + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); + } } } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 870ba29169..c568f646c5 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -436,33 +436,36 @@ ivas_error ivas_omasa_ism_metadata_dec( return error; } - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + if (st_ivas->hDirAC != NULL ) { - for ( n = 0; n < st_ivas->nchan_ism; n++ ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( n = 0; n < st_ivas->nchan_ism; n++ ) + { + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + + for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) + { + meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; + st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; + } + } + } + else /* ISM_MASA_MODE_MASA_ONE_OBJ */ { - azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->azimuth + 0.5f ); - elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[n]->elevation + 0.5f ); + azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); + elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; - st_ivas->hMasaIsmData->azimuth_ism[n][meta_write_index] = azimuth_ism; - st_ivas->hMasaIsmData->elevation_ism[n][meta_write_index] = elevation_ism; + st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; + st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; } } } - else /* ISM_MASA_MODE_MASA_ONE_OBJ */ - { - azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); - elevation_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->elevation + 0.5f ); - - for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) - { - meta_write_index = ( dirac_bs_md_write_idx + block ) % st_ivas->hDirAC->dirac_md_buffer_length; - st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = azimuth_ism; - st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = elevation_ism; - } - } } return IVAS_ERR_OK; -- GitLab From bd4d275e8facc9c2e98c2d0436160a1207913276 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 27 Apr 2023 11:10:01 +0300 Subject: [PATCH 0114/1418] Apply clang format --- lib_dec/ivas_omasa_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index c568f646c5..4fe74fd841 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -436,7 +436,7 @@ ivas_error ivas_omasa_ism_metadata_dec( return error; } - if (st_ivas->hDirAC != NULL ) + if ( st_ivas->hDirAC != NULL ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { -- GitLab From 9aa8bea31b0fd3fcbcb4dc18e51e35945921ee04 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 28 Apr 2023 14:54:12 +0200 Subject: [PATCH 0115/1418] introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps; under FIX_OMASA_STEREO_SWITCHING --- lib_com/cnst.h | 3 ++ lib_com/ivas_cnst.h | 9 +++++- lib_com/ivas_prot.h | 3 ++ lib_com/options.h | 3 +- lib_dec/ivas_cpe_dec.c | 40 ++++++++++++++++++++++++ lib_enc/ivas_cpe_enc.c | 54 +++++++++++++++++++++++++++++++++ lib_enc/ivas_ism_enc.c | 14 +++++++-- lib_enc/ivas_ism_metadata_enc.c | 21 ++++++++++++- lib_enc/ivas_masa_enc.c | 9 ++++++ lib_enc/ivas_stat_enc.h | 6 +++- 10 files changed, 156 insertions(+), 6 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 7b359e2f40..fd241c8acd 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -263,6 +263,9 @@ enum{ enum { IND_IVAS_FORMAT, +#ifdef FIX_OMASA_STEREO_SWITCHING + IND_SMODE_OMASA, +#endif IND_SMODE, IND_SID_TYPE, IND_BWIDTH, diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 2f8d004a9e..fe849fca55 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1214,10 +1214,17 @@ enum #define MASA_STEREO_MIN_BITRATE IVAS_24k4 #ifdef MASA_AND_OBJECTS #define MAXIMUM_OMASA_FREQ_BANDS 8 /* Corresponds to maximum number of coding bands at 32 kbps */ + +#ifdef FIX_OMASA_STEREO_SWITCHING +#define OMASA_STEREO_SW_CNT_MAX 100 +#define OMASA_STEREO_SW_CNT_MAX2 5 +#endif + #endif #define MASA_BIT_REDUCT_PARAM 10 -#define MASA_MAXIMUM_TWO_DIR_BANDS 18 +#define MASA_MAXIMUM_TWO_DIR_BANDS 18 + typedef enum { MASA_STEREO_NOT_DEFINED, diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index dd3c658455..6ca23dd915 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -837,6 +837,9 @@ ivas_error ivas_ism_metadata_enc( const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ #ifdef MASA_AND_OBJECTS ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ +#ifdef FIX_OMASA_STEREO_SWITCHING + ,int16_t *omasa_stereo_sw_cnt +#endif #endif ); diff --git a/lib_com/options.h b/lib_com/options.h index 64aab79878..1f33b8c36f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -/*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ +#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/" */ @@ -168,6 +168,7 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ +#define FIX_OMASA_STEREO_SWITCHING // VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 9667995683..714149b9aa 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -79,6 +79,9 @@ ivas_error ivas_cpe_dec( ivas_error error; #ifdef MASA_AND_OBJECTS int32_t cpe_brate; +#ifdef FIX_OMASA_STEREO_SWITCHING + int32_t element_brate_ref; +#endif #endif error = IVAS_ERR_OK; @@ -95,10 +98,40 @@ ivas_error ivas_cpe_dec( sts[0]->BER_detect |= st_ivas->BER_detect; sts[1]->BER_detect |= st_ivas->BER_detect; +#ifdef FIX_OMASA_STEREO_SWITCHING + element_brate_ref = hCPE->element_brate; +#endif + /*------------------------------------------------------------------* * Read stereo technology info & audio bandwidth *-----------------------------------------------------------------*/ +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && + ( ( st_ivas->nchan_ism == 3 && ivas_total_brate == IVAS_96k ) || + ( st_ivas->nchan_ism == 4 && ivas_total_brate == IVAS_128k ) ) ) + { + /* read OMASA stereo mode signalling */ + if ( get_next_indice( sts[0], NBITS_ELEMENT_MODE ) ) + { + hCPE->element_mode = IVAS_CPE_MDCT; + } + else + { + hCPE->element_mode = IVAS_CPE_DFT; + } + + if ( hCPE->element_mode == IVAS_CPE_MDCT ) + { + hCPE->element_brate = IVAS_64k; + hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); + } + } + } +#endif + read_stereo_mode_and_bwidth( hCPE, st_ivas ); /*----------------------------------------------------------------* @@ -551,6 +584,13 @@ ivas_error ivas_cpe_dec( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + hCPE->element_brate = element_brate_ref; + } +#endif + if ( hCPE->element_mode == IVAS_CPE_DFT || hCPE->element_mode == IVAS_CPE_TD ) { stereo_cng_dec_update( hCPE, ivas_total_brate ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5c13e032e8..c6b33d7539 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -103,6 +103,10 @@ ivas_error ivas_cpe_enc( ivas_error error; #ifdef MASA_AND_OBJECTS int32_t cpe_brate; +#ifdef FIX_OMASA_STEREO_SWITCHING + int32_t element_brate_ref; + int16_t element_mode_ref; +#endif #endif error = IVAS_ERR_OK; @@ -117,6 +121,10 @@ ivas_error ivas_cpe_enc( ivas_format = hEncoderConfig->ivas_format; input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; +#ifdef FIX_OMASA_STEREO_SWITCHING + element_brate_ref = hCPE->element_brate; + element_mode_ref = hCPE->element_mode; +#endif /*------------------------------------------------------------------* * Initialization - general @@ -172,6 +180,43 @@ ivas_error ivas_cpe_enc( hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( ivas_format == MASA_ISM_FORMAT ) + { + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && + ( ( hEncoderConfig->nchan_ism == 3 && ivas_total_brate == IVAS_96k ) || + ( hEncoderConfig->nchan_ism == 4 && ivas_total_brate == IVAS_128k ) ) ) + { + if ( hCPE->element_brate + hCPE->brate_surplus > IVAS_64k ) + { + st_ivas->hMasa->data.omasa_stereo_sw_cnt = 0; + } + else + { + st_ivas->hMasa->data.omasa_stereo_sw_cnt++; + st_ivas->hMasa->data.omasa_stereo_sw_cnt = min( st_ivas->hMasa->data.omasa_stereo_sw_cnt, OMASA_STEREO_SW_CNT_MAX ); + } + + if ( st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) + { + hCPE->element_mode = IVAS_CPE_MDCT; + hCPE->element_brate = IVAS_64k; + hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); + } + + /* write OMASA stereo mode signalling */ + if ( hCPE->element_mode == IVAS_CPE_MDCT ) + { + push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 1, NBITS_ELEMENT_MODE ); + } + else + { + push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 0, NBITS_ELEMENT_MODE ); + } + } + } +#endif + if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -197,6 +242,7 @@ ivas_error ivas_cpe_enc( return error; } + /*----------------------------------------------------------------* * Set TD stereo parameters *----------------------------------------------------------------*/ @@ -728,6 +774,14 @@ ivas_error ivas_cpe_enc( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( ivas_format == MASA_ISM_FORMAT ) + { + hCPE->element_brate = element_brate_ref; + } +#endif + + if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) { /* update input samples buffer */ diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index b560d04f4d..35de64ab26 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -245,7 +245,12 @@ ivas_error ivas_ism_enc( { #ifdef MASA_AND_OBJECTS ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, 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, -1 ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1 +#ifdef FIX_OMASA_STEREO_SWITCHING + , + NULL +#endif + ); #else ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, 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 ); #endif @@ -269,7 +274,12 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, 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, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 +#ifdef FIX_OMASA_STEREO_SWITCHING + , + st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL +#endif + ); if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 24924a25bb..922bfa5123 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -180,6 +180,10 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS , const float lp_noise_CPE +#ifdef FIX_OMASA_STEREO_SWITCHING + , + int16_t *omasa_stereo_sw_cnt +#endif #endif ) { @@ -539,7 +543,6 @@ ivas_error ivas_ism_metadata_enc( *----------------------------------------------------------------*/ if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) - { int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; int16_t brate_limit_flag; @@ -557,6 +560,22 @@ ivas_error ivas_ism_metadata_enc( *ism_total_brate += ivas_interformat_brate( ism_mode, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag ); } ism_metadata_flag_global = 1; + +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( ism_mode == ISM_MASA_MODE_DISC ) + { + brate_limit_flag = 0; + for ( int16_t n = 0; n < nchan_ism; n++ ) + { + brate_limit_flag += ism_imp[n]; + } + + if ( brate_limit_flag >= nchan_ism * ISM_HIGH_IMP - 2 ) + { + *omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; + } + } +#endif } #endif diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index e12251abf7..048adbe2dc 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -185,6 +185,10 @@ ivas_error ivas_masa_enc_open( #ifdef MASA_AND_OBJECTS hMasa->data.lp_noise_CPE = -1; +#ifdef FIX_OMASA_STEREO_SWITCHING + hMasa->data.omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; + hMasa->data.omasa_stereo_sw_cnt2 = OMASA_STEREO_SW_CNT_MAX2; +#endif #endif st_ivas->hMasa = hMasa; @@ -795,7 +799,12 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { +#ifdef FIX_OMASA_STEREO_SWITCHING + if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT || st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) +#else + if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) +#endif { st_ivas->hMasa->data.lp_noise_CPE = st_ivas->hCPE[0]->hCoreCoder[0]->lp_noise; } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 80dddaf9dd..45c95b38fa 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -750,7 +750,11 @@ typedef struct ivas_masa_encoder_data_struct float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t nchan_ism; - float lp_noise_CPE; /* LP filterend total noise estimation */ + float lp_noise_CPE; /* LP filtered total noise estimation */ +#ifdef FIX_OMASA_STEREO_SWITCHING + int16_t omasa_stereo_sw_cnt; + int16_t omasa_stereo_sw_cnt2; +#endif #endif int16_t num_Cldfb_instances; -- GitLab From 7443af46d0f1249d8c66b0e4bf6778c8eb7ba36b Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 1 May 2023 22:45:22 +1000 Subject: [PATCH 0116/1418] fix for compilation errors when SPLIT_REND_WITH_HEAD_ROT is disabled --- apps/renderer.c | 8 +++++--- lib_rend/ivas_CQMFDecoder.c | 4 +++- lib_rend/ivas_CQMFDecoder.h | 7 +++++-- lib_rend/ivas_CQMFEncoder.c | 5 +++-- lib_rend/ivas_CQMFEncoder.h | 5 +++-- lib_rend/ivas_CQMFHuff.c | 4 +++- lib_rend/ivas_MSPred.c | 4 +++- lib_rend/ivas_NoiseGen.c | 4 +++- lib_rend/ivas_PerceptualModel.c | 4 +++- lib_rend/ivas_PredDecoder.c | 4 +++- lib_rend/ivas_PredDecoder.h | 5 ++++- lib_rend/ivas_PredEncoder.c | 4 +++- lib_rend/ivas_PredEncoder.h | 5 ++++- lib_rend/ivas_Tables.c | 3 +++ lib_rend/ivas_cldfb_codec_bitstream.c | 7 ++++--- lib_rend/ivas_cldfb_codec_bitstream.h | 5 +++++ lib_rend/lib_rend.c | 4 ++-- 17 files changed, 59 insertions(+), 23 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index c52579c745..155ac16d9b 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -420,8 +420,9 @@ static int16_t getTotalNumInChannels( IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS], IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS], IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS], - IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS], + IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] #ifdef SPLIT_REND_WITH_HEAD_ROT + , IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] #endif ) @@ -1240,6 +1241,7 @@ int main( outBuffer.config.numSamplesPerChannel = (int16_t) CLDFBframeSize_smpls; } #else + inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); outFloatBuffer = malloc( outBufferSize * sizeof( float ) ); outBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; @@ -1402,11 +1404,11 @@ int main( } else { - error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL + error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS -#endif +#endif ); if ( ( error != IVAS_ERR_OK ) && ( error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC { diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 0e3d27f67e..c2980fa6c3 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -36,6 +36,8 @@ Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ #include "ivas_CQMFDecoder.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_CQMFHuff.h" #include "ivas_NoiseGen.h" @@ -43,7 +45,6 @@ Nations Convention on Contracts on the International Sales of Goods. #include "ivas_RMSEnvDeltaHuff.h" #include "ivas_Tables.h" #include "ivas_cldfb_codec_bitstream.h" -#include "options.h" #include "prot.h" #include #include @@ -1372,3 +1373,4 @@ static void ComputeAllocation( const int32_t iChannels, } } } +#endif diff --git a/lib_rend/ivas_CQMFDecoder.h b/lib_rend/ivas_CQMFDecoder.h index a68c2451fb..f331ed20d3 100644 --- a/lib_rend/ivas_CQMFDecoder.h +++ b/lib_rend/ivas_CQMFDecoder.h @@ -37,6 +37,10 @@ extern "C" { #endif + +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT + #include "lib_rend.h" #define DECODER_ERROR_NONE ( 0 ) #define DECODER_ERROR_FS_NOT_SUPPORTED ( -1 ) @@ -56,9 +60,8 @@ extern "C" ivas_split_rend_bits_t *pBits, float ***pppfCQMFReal, float ***pppfCQMFImag ); - +#endif #ifdef __cplusplus } #endif - #endif /* _CQMF_DECODER_H_ */ diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c index 076805eddd..892eb92012 100644 --- a/lib_rend/ivas_CQMFEncoder.c +++ b/lib_rend/ivas_CQMFEncoder.c @@ -31,13 +31,13 @@ *******************************************************************************************************/ #include "ivas_CQMFEncoder.h" - +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include #include #include #include "ivas_Tables.h" -#include "options.h" #include "prot.h" #include "ivas_RMSEnvGrouping.h" #include "ivas_PerceptualModel.h" @@ -2047,3 +2047,4 @@ static int32_t ComputeAllocation( const int32_t iChannels, return iBitsUsed; } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_CQMFEncoder.h b/lib_rend/ivas_CQMFEncoder.h index 3466eae6b4..e78aa4614d 100644 --- a/lib_rend/ivas_CQMFEncoder.h +++ b/lib_rend/ivas_CQMFEncoder.h @@ -37,6 +37,8 @@ extern "C" { #endif +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include "lib_rend.h" #define ENCODER_ERROR_NONE ( 0 ) #define ENCODER_ERROR_FS_NOT_SUPPORTED ( -1 ) @@ -61,9 +63,8 @@ extern "C" const int32_t available_bits, ivas_split_rend_bits_t *pBits ); int32_t GetNumGroups( CQMFEncoder *psCQMFEncoder ); - +#endif #ifdef __cplusplus } #endif - #endif /* _CQMF_ENCODER_H_ */ diff --git a/lib_rend/ivas_CQMFHuff.c b/lib_rend/ivas_CQMFHuff.c index 4aca93fc65..af4d4d11ee 100644 --- a/lib_rend/ivas_CQMFHuff.c +++ b/lib_rend/ivas_CQMFHuff.c @@ -31,6 +31,8 @@ *******************************************************************************************************/ #include "ivas_CQMFHuff.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_prot_rend.h" #include "wmc_auto.h" @@ -4121,5 +4123,5 @@ const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { #endif - +#endif /* clang-format on */ diff --git a/lib_rend/ivas_MSPred.c b/lib_rend/ivas_MSPred.c index 0a3e6e8e3c..4cecace732 100644 --- a/lib_rend/ivas_MSPred.c +++ b/lib_rend/ivas_MSPred.c @@ -31,11 +31,12 @@ *******************************************************************************************************/ #include "ivas_MSPred.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_Tables.h" #include "ivas_RMSEnvDeltaHuff.h" #include #include -#include "options.h" #include "prot.h" #include "ivas_prot_rend.h" #include "wmc_auto.h" @@ -356,3 +357,4 @@ void writeMSPred( int32_t *phaseQuant, int32_t *predQuant, int32_t MSMode, int32 } fprintf( fid, "\n" ); } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_NoiseGen.c b/lib_rend/ivas_NoiseGen.c index 66efe7873d..39d8b9c177 100644 --- a/lib_rend/ivas_NoiseGen.c +++ b/lib_rend/ivas_NoiseGen.c @@ -31,10 +31,11 @@ *******************************************************************************************************/ #include "ivas_NoiseGen.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include #include -#include "options.h" #include "prot.h" #include "ivas_prot_rend.h" #include "wmc_auto.h" @@ -81,3 +82,4 @@ void DeleteNoiseGen( NoiseGen *psNoiseGen ) } extern float GetNoise( NoiseGen *psNoiseGen ); +#endif \ No newline at end of file diff --git a/lib_rend/ivas_PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c index 8ba92a1409..efa63b4247 100644 --- a/lib_rend/ivas_PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -31,8 +31,9 @@ *******************************************************************************************************/ #include "ivas_PerceptualModel.h" -#include "ivas_Tables.h" #include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT +#include "ivas_Tables.h" #include "prot.h" #include "ivas_prot_rend.h" #include @@ -314,3 +315,4 @@ void PerceptualModelStereo( const int32_t iMaxQuantBands, piSMR1[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope1[n] + c_aiBandwidthAdjust48[n] - piSMR1[n]; } } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index 0185ad74a1..aa15db6509 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -31,10 +31,11 @@ *******************************************************************************************************/ #include "ivas_PredDecoder.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include #include -#include "options.h" #include "prot.h" #include "ivas_prot_rend.h" #include "ivas_Tables.h" @@ -258,3 +259,4 @@ void ApplyInversePredictros( PredictionDecoder *psPredictionDecoder, } } } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_PredDecoder.h b/lib_rend/ivas_PredDecoder.h index 435c4f2238..47f986bc7d 100644 --- a/lib_rend/ivas_PredDecoder.h +++ b/lib_rend/ivas_PredDecoder.h @@ -38,6 +38,9 @@ extern "C" { #endif +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT + #include "ivas_cldfb_codec_bitstream.h" // typedef struct PREDICTION_DECODER PredictionDecoder; @@ -76,7 +79,7 @@ extern "C" float ***pppfReal, float ***pppfImag ); - +#endif #ifdef __cplusplus } #endif diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 7d21f0e257..1dd0725466 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -31,12 +31,13 @@ *******************************************************************************************************/ #include "ivas_PredEncoder.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include #include #include "ivas_Tables.h" #include "ivas_PredTables.h" -#include "options.h" #include "prot.h" #include "ivas_prot_rend.h" #include "ivas_cldfb_codec_bitstream.h" @@ -475,3 +476,4 @@ int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, return iBitsWritten; } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_PredEncoder.h b/lib_rend/ivas_PredEncoder.h index 5ebbe7b48d..e74c61d76b 100644 --- a/lib_rend/ivas_PredEncoder.h +++ b/lib_rend/ivas_PredEncoder.h @@ -38,6 +38,9 @@ extern "C" { #endif +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT + #include "ivas_cldfb_codec_bitstream.h" typedef struct PREDICTION_ENCODER @@ -80,7 +83,7 @@ extern "C" int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, ivas_split_rend_bits_t *pBits ); - +#endif #ifdef __cplusplus } #endif diff --git a/lib_rend/ivas_Tables.c b/lib_rend/ivas_Tables.c index 8d23ee756a..534aff5254 100644 --- a/lib_rend/ivas_Tables.c +++ b/lib_rend/ivas_Tables.c @@ -31,6 +31,8 @@ *******************************************************************************************************/ #include "ivas_Tables.h" +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_prot_rend.h" #include "wmc_auto.h" @@ -194,4 +196,5 @@ const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { 729, 729, 28, 29, 32, 37, 39, 46, 55, 65, 77, 91, 109, 129, 153, 181, }; +#endif /* clang-format on */ diff --git a/lib_rend/ivas_cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_codec_bitstream.c index eb82a4a6f7..d12cb39d61 100644 --- a/lib_rend/ivas_cldfb_codec_bitstream.c +++ b/lib_rend/ivas_cldfb_codec_bitstream.c @@ -29,15 +29,15 @@ the United Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ - #include "ivas_cldfb_codec_bitstream.h" - +#include "options.h" +#ifdef SPLIT_REND_WITH_HEAD_ROT #include #include -#include "options.h" #include "prot.h" #include "wmc_auto.h" + #define MAX_BUFFER 1024 static const uint32_t MASKS[] = { @@ -305,3 +305,4 @@ int32_t BSGetError( Bitstream *psBitstream ) { return psBitstream->iError; } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_cldfb_codec_bitstream.h b/lib_rend/ivas_cldfb_codec_bitstream.h index 07ceb79fb8..a058b901ee 100644 --- a/lib_rend/ivas_cldfb_codec_bitstream.h +++ b/lib_rend/ivas_cldfb_codec_bitstream.h @@ -44,6 +44,10 @@ extern "C" #endif #include "lib_rend.h" #include "ivas_prot_rend.h" +#include "options.h" + +#ifdef SPLIT_REND_WITH_HEAD_ROT + enum { BS_READ, @@ -93,6 +97,7 @@ extern "C" int32_t BSGetAvailableBytes( Bitstream *psBitstream ); int32_t BSGetError( Bitstream *psBitstream ); +#endif #ifdef __cplusplus } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 91184e353f..5376b18126 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2367,7 +2367,7 @@ updateSbaPanGains( } #endif case IVAS_REND_AUDIO_CONFIG_BINAURAL: -#ifdef DEBUGGING +#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT if ( hRendCfg->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { @@ -5948,7 +5948,7 @@ static ivas_error renderSbaToBinaural( push_wmops( "renderSbaToBinaural" ); -#ifdef DEBUGGING +#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -- GitLab From f795b400f4964757d4601673f0c2db7753c95d8a Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Mon, 1 May 2023 14:49:42 +0200 Subject: [PATCH 0117/1418] RenderConfigReader_checkValues() return value was was erroneously discarded in RenderConfigReader_read() --- apps/decoder.c | 4 ++++ apps/renderer.c | 4 ++++ lib_util/render_config_reader.c | 11 +++++------ lib_util/render_config_reader.h | 6 ++++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 6843c26eff..96e3e1b153 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -505,7 +505,11 @@ int main( goto cleanup; } +#ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) +#else + if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 72a8c05600..6b439bb991 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -731,7 +731,11 @@ int main( exit( -1 ); } +#ifdef CONTROL_METADATA_REVERB if ( RenderConfigReader_read( renderConfigReader, args.renderConfigFilePath, &renderConfig ) != IVAS_ERR_OK ) +#else + if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath ); exit( -1 ); diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 813916ad2e..7ab86bab5f 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -928,9 +928,6 @@ ivas_error RenderConfigReader_open( { RenderConfigReader *pSelf; FILE *pConfigFile; -#ifndef CONTROL_METADATA_REVERB - int length; -#endif /* Open the configuration file */ if ( strlen( pConfigPath ) < 1 ) @@ -1259,8 +1256,10 @@ static ivas_error RenderConfigReader_readReverb( ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i/o : RenderConfigReader handle */ - const char *pRenderConfigPath, /* i : Renderer configuration file path */ - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ +#ifdef CONTROL_METADATA_REVERB + const char *pRenderConfigPath, /* i : Renderer configuration file path */ +#endif + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { int32_t file_size; @@ -1520,7 +1519,7 @@ ivas_error RenderConfigReader_read( #ifdef CONTROL_METADATA_REVERB return IVAS_ERR_OK; #else - RenderConfigReader_checkValues( hRenderConfig ); + return RenderConfigReader_checkValues( hRenderConfig ); #endif } diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index e108f0297d..70b4cf42d7 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -67,8 +67,10 @@ ivas_error RenderConfigReader_checkValues( /* Reads a configuration */ ivas_error RenderConfigReader_read( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - const char *pRenderConfigPath, /* i : Renderer configuration file path */ - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ +#ifdef CONTROL_METADATA_REVERB + const char *pRenderConfigPath, /* i : Renderer configuration file path */ +#endif + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); /* Closes the renderer configuration reader and deallocates memory */ -- GitLab From dc15a6cd11338788882f9215bad136d171f7f2a8 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 1 May 2023 23:15:26 +1000 Subject: [PATCH 0118/1418] fix for JBM tests --- apps/decoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 711706c9b3..575a696452 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2241,6 +2241,10 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + + SplitFileReadWrite *hSplitRendFileReadWrite = NULL; +#endif error = initOnFirstGoodFrame( hIvasDec, arg, @@ -2257,7 +2261,7 @@ static ivas_error decodeVoIP( &numObj #ifdef SPLIT_REND_WITH_HEAD_ROT , - NULL + &hSplitRendFileReadWrite #endif ); if ( error != IVAS_ERR_OK ) -- GitLab From 26e59ff1b9c690b449d44c8e2e8ede8b52518dc2 Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 1 May 2023 23:23:13 +1000 Subject: [PATCH 0119/1418] fix for uninitialized PLC file path --- apps/renderer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index 155ac16d9b..9f9f6f1ea8 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2193,6 +2193,9 @@ static CmdlnArgs defaultArgs( clearString( args.headRotationFilePath ); #ifdef SPLIT_REND_WITH_HEAD_ROT clearString( args.outMetadataFilePath ); +#endif +#ifdef SPLIT_REND_PLC + clearString( args.splitRendBFIFilePath ); #endif clearString( args.referenceVectorFilePath ); clearString( args.referenceRotationFilePath ); -- GitLab From 27af0e05f07a31dfd87b6adc8423bb98865f979d Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 2 May 2023 10:34:21 +1000 Subject: [PATCH 0120/1418] clang format fixes --- lib_com/delay_comp.c | 10 +- lib_dec/ivas_binRenderer_internal.c | 2 +- lib_rend/ivas_CQMFEncoder.c | 2 +- lib_rend/ivas_CQMFHuff.h | 299 +++++++++++++------------- lib_rend/ivas_MSPred.c | 2 +- lib_rend/ivas_NoiseGen.c | 2 +- lib_rend/ivas_PerceptualModel.c | 2 +- lib_rend/ivas_PerceptualModel.h | 26 +-- lib_rend/ivas_PredDecoder.c | 2 +- lib_rend/ivas_PredEncoder.c | 2 +- lib_rend/ivas_PredTables.h | 12 +- lib_rend/ivas_RMSEnvDeltaHuff.c | 2 +- lib_rend/ivas_RMSEnvDeltaHuff.h | 8 +- lib_rend/ivas_cldfb_codec_bitstream.c | 3 +- lib_rend/ivas_splitRendererPLC.c | 2 +- lib_rend/ivas_splitRendererPost.c | 2 +- lib_rend/ivas_splitRendererPre.c | 2 +- lib_util/split_rend_bfi_file_reader.c | 9 +- lib_util/split_rend_bfi_file_reader.h | 5 +- 19 files changed, 196 insertions(+), 198 deletions(-) diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 6a70eaa8b2..bc5a1784f1 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -106,11 +106,11 @@ int32_t get_delay( if ( output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) #endif { - if ( hCldfb != NULL ) - { - /* compensate for filterbank delay */ - delay += IVAS_FB_DEC_DELAY_NS; - } + if ( hCldfb != NULL ) + { + /* compensate for filterbank delay */ + delay += IVAS_FB_DEC_DELAY_NS; + } } diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index f13cc5bae7..c7cf76137a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1534,4 +1534,4 @@ void ivas_rend_CldfbMultiBinRendProcess( return; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c index 892eb92012..a933b2f7cb 100644 --- a/lib_rend/ivas_CQMFEncoder.c +++ b/lib_rend/ivas_CQMFEncoder.c @@ -2047,4 +2047,4 @@ static int32_t ComputeAllocation( const int32_t iChannels, return iBitsUsed; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_CQMFHuff.h b/lib_rend/ivas_CQMFHuff.h index 3e6eebaba4..bf28158bea 100644 --- a/lib_rend/ivas_CQMFHuff.h +++ b/lib_rend/ivas_CQMFHuff.h @@ -39,308 +39,309 @@ extern "C" #endif #include "ivas_Tables.h" +#include // For NULL +#include -//#define USE_DEMOD_TABLES + //#define USE_DEMOD_TABLES #ifndef HUFF_READ_SIZE -#define HUFF_READ_SIZE (4) +#define HUFF_READ_SIZE ( 4 ) #endif #ifndef HUFF_DEC_TABLE_SIZE -#define HUFF_DEC_TABLE_SIZE (16) +#define HUFF_DEC_TABLE_SIZE ( 16 ) #endif -#include // For NULL -#include -extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; -extern const uint32_t c_aauiCQMFHuffDec1[3][16]; + extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; + + extern const uint32_t c_aauiCQMFHuffDec1[3][16]; -extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; + extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; -extern const uint32_t c_aauiCQMFHuffDec2[3][16]; + extern const uint32_t c_aauiCQMFHuffDec2[3][16]; -extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; + extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; -extern const uint32_t c_aauiCQMFHuffDec3[10][16]; + extern const uint32_t c_aauiCQMFHuffDec3[10][16]; -extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; + extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; -extern const uint32_t c_aauiCQMFHuffDec4[5][16]; + extern const uint32_t c_aauiCQMFHuffDec4[5][16]; -extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; + extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; -extern const uint32_t c_aauiCQMFHuffDec5[10][16]; + extern const uint32_t c_aauiCQMFHuffDec5[10][16]; -extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; + extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; -extern const uint32_t c_aauiCQMFHuffDec6[7][16]; + extern const uint32_t c_aauiCQMFHuffDec6[7][16]; -extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; + extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; -extern const uint32_t c_aauiCQMFHuffDec7[25][16]; + extern const uint32_t c_aauiCQMFHuffDec7[25][16]; -extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; + extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; -extern const uint32_t c_aauiCQMFHuffDec8[16][16]; + extern const uint32_t c_aauiCQMFHuffDec8[16][16]; -extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; + extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; -extern const uint32_t c_aauiCQMFHuffDec9[22][16]; + extern const uint32_t c_aauiCQMFHuffDec9[22][16]; -extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; + extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; -extern const uint32_t c_aauiCQMFHuffDec10[45][16]; + extern const uint32_t c_aauiCQMFHuffDec10[45][16]; -extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; + extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; -extern const uint32_t c_aauiCQMFHuffDec11[50][16]; + extern const uint32_t c_aauiCQMFHuffDec11[50][16]; -extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; + extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; -extern const uint32_t c_aauiCQMFHuffDec12[76][16]; + extern const uint32_t c_aauiCQMFHuffDec12[76][16]; -extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; + extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; -extern const uint32_t c_aauiCQMFHuffDec13[89][16]; + extern const uint32_t c_aauiCQMFHuffDec13[89][16]; -extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; + extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; -extern const uint32_t c_aauiCQMFHuffDec14[53][16]; + extern const uint32_t c_aauiCQMFHuffDec14[53][16]; -extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; + extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; -extern const uint32_t c_aauiCQMFHuffDec15[73][16]; + extern const uint32_t c_aauiCQMFHuffDec15[73][16]; -extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; + extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; -extern const uint32_t c_aauiCQMFHuffDec16[85][16]; + extern const uint32_t c_aauiCQMFHuffDec16[85][16]; -extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; + extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; -extern const uint32_t c_aauiCQMFHuffDec17[93][16]; + extern const uint32_t c_aauiCQMFHuffDec17[93][16]; -extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; + extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; -extern const uint32_t c_aauiCQMFHuffDec18[6][16]; + extern const uint32_t c_aauiCQMFHuffDec18[6][16]; -extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; + extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; -extern const uint32_t c_aauiCQMFHuffDec19[6][16]; + extern const uint32_t c_aauiCQMFHuffDec19[6][16]; -extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; + extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; -extern const uint32_t c_aauiCQMFHuffDec20[6][16]; + extern const uint32_t c_aauiCQMFHuffDec20[6][16]; -extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; + extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; -extern const uint32_t c_aauiCQMFHuffDec21[7][16]; + extern const uint32_t c_aauiCQMFHuffDec21[7][16]; -extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; + extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; -extern const uint32_t c_aauiCQMFHuffDec22[9][16]; + extern const uint32_t c_aauiCQMFHuffDec22[9][16]; -extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; + extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; -extern const uint32_t c_aauiCQMFHuffDec23[12][16]; + extern const uint32_t c_aauiCQMFHuffDec23[12][16]; -extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; + extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; -extern const uint32_t c_aauiCQMFHuffDec24[17][16]; + extern const uint32_t c_aauiCQMFHuffDec24[17][16]; -extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; + extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; -extern const uint32_t c_aauiCQMFHuffDec25[19][16]; + extern const uint32_t c_aauiCQMFHuffDec25[19][16]; -extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; + extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; -extern const uint32_t c_aauiCQMFHuffDec26[26][16]; + extern const uint32_t c_aauiCQMFHuffDec26[26][16]; -extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; + extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; -extern const uint32_t c_aauiCQMFHuffDec27[28][16]; + extern const uint32_t c_aauiCQMFHuffDec27[28][16]; -extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; + extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; -extern const uint32_t c_aauiCQMFHuffDec28[30][16]; + extern const uint32_t c_aauiCQMFHuffDec28[30][16]; -extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; + extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; -extern const uint32_t c_aauiCQMFHuffDec29[34][16]; + extern const uint32_t c_aauiCQMFHuffDec29[34][16]; -extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; + extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; -extern const uint32_t c_aauiCQMFHuffDec30[39][16]; + extern const uint32_t c_aauiCQMFHuffDec30[39][16]; -extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; + extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; -extern const uint32_t c_aauiCQMFHuffDec31[43][16]; + extern const uint32_t c_aauiCQMFHuffDec31[43][16]; -extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; + extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; -extern const uint32_t c_aauiCQMFHuffDec33[2][16]; + extern const uint32_t c_aauiCQMFHuffDec33[2][16]; -extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; + extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; -extern const uint32_t c_aauiCQMFHuffDec34[2][16]; + extern const uint32_t c_aauiCQMFHuffDec34[2][16]; -extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; + extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; -extern const uint32_t c_aauiCQMFHuffDec35[9][16]; + extern const uint32_t c_aauiCQMFHuffDec35[9][16]; -extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; + extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; -extern const uint32_t c_aauiCQMFHuffDec36[7][16]; + extern const uint32_t c_aauiCQMFHuffDec36[7][16]; -extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; + extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; -extern const uint32_t c_aauiCQMFHuffDec37[4][16]; + extern const uint32_t c_aauiCQMFHuffDec37[4][16]; -extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; + extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; -extern const uint32_t c_aauiCQMFHuffDec38[22][16]; + extern const uint32_t c_aauiCQMFHuffDec38[22][16]; -extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; + extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; -extern const uint32_t c_aauiCQMFHuffDec39[12][16]; + extern const uint32_t c_aauiCQMFHuffDec39[12][16]; -extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; + extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; -extern const uint32_t c_aauiCQMFHuffDec40[36][16]; + extern const uint32_t c_aauiCQMFHuffDec40[36][16]; -extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; + extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; -extern const uint32_t c_aauiCQMFHuffDec41[16][16]; + extern const uint32_t c_aauiCQMFHuffDec41[16][16]; -extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; + extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; -extern const uint32_t c_aauiCQMFHuffDec42[28][16]; + extern const uint32_t c_aauiCQMFHuffDec42[28][16]; -extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; + extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; -extern const uint32_t c_aauiCQMFHuffDec43[32][16]; + extern const uint32_t c_aauiCQMFHuffDec43[32][16]; -extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; + extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; -extern const uint32_t c_aauiCQMFHuffDec44[27][16]; + extern const uint32_t c_aauiCQMFHuffDec44[27][16]; -extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; + extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; -extern const uint32_t c_aauiCQMFHuffDec45[50][16]; + extern const uint32_t c_aauiCQMFHuffDec45[50][16]; -extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; + extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; -extern const uint32_t c_aauiCQMFHuffDec46[61][16]; + extern const uint32_t c_aauiCQMFHuffDec46[61][16]; -extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; + extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; -extern const uint32_t c_aauiCQMFHuffDec47[87][16]; + extern const uint32_t c_aauiCQMFHuffDec47[87][16]; -extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; + extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; -extern const uint32_t c_aauiCQMFHuffDec48[110][16]; + extern const uint32_t c_aauiCQMFHuffDec48[110][16]; -extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; + extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; -extern const uint32_t c_aauiCQMFHuffDec49[113][16]; + extern const uint32_t c_aauiCQMFHuffDec49[113][16]; -extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; + extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; -extern const uint32_t c_aauiCQMFHuffDec50[6][16]; + extern const uint32_t c_aauiCQMFHuffDec50[6][16]; -extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; + extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; -extern const uint32_t c_aauiCQMFHuffDec51[6][16]; + extern const uint32_t c_aauiCQMFHuffDec51[6][16]; -extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; + extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; -extern const uint32_t c_aauiCQMFHuffDec52[7][16]; + extern const uint32_t c_aauiCQMFHuffDec52[7][16]; -extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; + extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; -extern const uint32_t c_aauiCQMFHuffDec53[9][16]; + extern const uint32_t c_aauiCQMFHuffDec53[9][16]; -extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; + extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; -extern const uint32_t c_aauiCQMFHuffDec54[9][16]; + extern const uint32_t c_aauiCQMFHuffDec54[9][16]; -extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; + extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; -extern const uint32_t c_aauiCQMFHuffDec55[10][16]; + extern const uint32_t c_aauiCQMFHuffDec55[10][16]; -extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; + extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; -extern const uint32_t c_aauiCQMFHuffDec56[12][16]; + extern const uint32_t c_aauiCQMFHuffDec56[12][16]; -extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; + extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; -extern const uint32_t c_aauiCQMFHuffDec57[14][16]; + extern const uint32_t c_aauiCQMFHuffDec57[14][16]; -extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; + extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; -extern const uint32_t c_aauiCQMFHuffDec58[17][16]; + extern const uint32_t c_aauiCQMFHuffDec58[17][16]; -extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; + extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; -extern const uint32_t c_aauiCQMFHuffDec59[20][16]; + extern const uint32_t c_aauiCQMFHuffDec59[20][16]; -extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; + extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; -extern const uint32_t c_aauiCQMFHuffDec60[24][16]; + extern const uint32_t c_aauiCQMFHuffDec60[24][16]; -extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; + extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; -extern const uint32_t c_aauiCQMFHuffDec61[33][16]; + extern const uint32_t c_aauiCQMFHuffDec61[33][16]; -extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; + extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; -extern const uint32_t c_aauiCQMFHuffDec62[41][16]; + extern const uint32_t c_aauiCQMFHuffDec62[41][16]; -extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; + extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; -extern const uint32_t c_aauiCQMFHuffDec63[39][16]; + extern const uint32_t c_aauiCQMFHuffDec63[39][16]; -extern const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2]; + extern const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; -extern const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE]; + extern const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; #ifdef USE_DEMOD_TABLES -extern const int32_t c_aaiHuffDemod1[16][2]; + extern const int32_t c_aaiHuffDemod1[16][2]; -extern const int32_t c_aaiHuffDemod2[16][2]; + extern const int32_t c_aaiHuffDemod2[16][2]; -extern const int32_t c_aaiHuffDemod3[25][2]; + extern const int32_t c_aaiHuffDemod3[25][2]; -extern const int32_t c_aaiHuffDemod4[36][2]; + extern const int32_t c_aaiHuffDemod4[36][2]; -extern const int32_t c_aaiHuffDemod5[36][2]; + extern const int32_t c_aaiHuffDemod5[36][2]; -extern const int32_t c_aaiHuffDemod6[49][2]; + extern const int32_t c_aaiHuffDemod6[49][2]; -extern const int32_t c_aaiHuffDemod7[64][2]; + extern const int32_t c_aaiHuffDemod7[64][2]; -extern const int32_t c_aaiHuffDemod8[81][2]; + extern const int32_t c_aaiHuffDemod8[81][2]; -extern const int32_t c_aaiHuffDemod9[100][2]; + extern const int32_t c_aaiHuffDemod9[100][2]; -extern const int32_t c_aaiHuffDemod10[169][2]; + extern const int32_t c_aaiHuffDemod10[169][2]; -extern const int32_t c_aaiHuffDemod11[196][2]; + extern const int32_t c_aaiHuffDemod11[196][2]; -extern const int32_t c_aaiHuffDemod12[289][2]; + extern const int32_t c_aaiHuffDemod12[289][2]; -extern const int32_t c_aaiHuffDemod13[324][2]; + extern const int32_t c_aaiHuffDemod13[324][2]; -extern const int32_t c_aaiHuffDemod14[400][2]; + extern const int32_t c_aaiHuffDemod14[400][2]; -extern const int32_t c_aaiHuffDemod15[576][2]; + extern const int32_t c_aaiHuffDemod15[576][2]; -extern const int32_t c_aaiHuffDemod16[729][2]; + extern const int32_t c_aaiHuffDemod16[729][2]; -extern const int32_t c_aaiHuffDemod17[729][2]; + extern const int32_t c_aaiHuffDemod17[729][2]; -extern const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2]; + extern const int32_t ( *c_apaiDemodTables[ALLOC_TABLE_SIZE] )[2]; #endif #ifdef __cplusplus diff --git a/lib_rend/ivas_MSPred.c b/lib_rend/ivas_MSPred.c index 4cecace732..3694f07510 100644 --- a/lib_rend/ivas_MSPred.c +++ b/lib_rend/ivas_MSPred.c @@ -357,4 +357,4 @@ void writeMSPred( int32_t *phaseQuant, int32_t *predQuant, int32_t MSMode, int32 } fprintf( fid, "\n" ); } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_NoiseGen.c b/lib_rend/ivas_NoiseGen.c index 39d8b9c177..44a794b69a 100644 --- a/lib_rend/ivas_NoiseGen.c +++ b/lib_rend/ivas_NoiseGen.c @@ -82,4 +82,4 @@ void DeleteNoiseGen( NoiseGen *psNoiseGen ) } extern float GetNoise( NoiseGen *psNoiseGen ); -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c index efa63b4247..67adf974a0 100644 --- a/lib_rend/ivas_PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -315,4 +315,4 @@ void PerceptualModelStereo( const int32_t iMaxQuantBands, piSMR1[n] = PERCEPTUAL_MODEL_SCALE * piRMSEnvelope1[n] + c_aiBandwidthAdjust48[n] - piSMR1[n]; } } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_PerceptualModel.h b/lib_rend/ivas_PerceptualModel.h index 2d3346183f..da8afca756 100644 --- a/lib_rend/ivas_PerceptualModel.h +++ b/lib_rend/ivas_PerceptualModel.h @@ -38,19 +38,19 @@ extern "C" { #endif #include -void PerceptualModel(const int32_t iMaxQuantBands, - const int32_t *piRMSEnvelope, - int32_t *piExcitation, - int32_t *piSMR); - -void PerceptualModelStereo(const int32_t iMaxQuantBands, - const int32_t *piMSFlags, - const int32_t *piRMSEnvelope0, - const int32_t *piRMSEnvelope1, - int32_t *piExcitation0, - int32_t *piExcitation1, - int32_t *piSMR0, - int32_t *piSMR1); + void PerceptualModel( const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR ); + + void PerceptualModelStereo( const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1 ); #ifdef __cplusplus } diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index aa15db6509..3bab1b9056 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -259,4 +259,4 @@ void ApplyInversePredictros( PredictionDecoder *psPredictionDecoder, } } } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 1dd0725466..56bbca0f73 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -476,4 +476,4 @@ int32_t WritePredictors( PredictionEncoder *psPredictionEncoder, return iBitsWritten; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_PredTables.h b/lib_rend/ivas_PredTables.h index ee9caf425a..71bdf21437 100644 --- a/lib_rend/ivas_PredTables.h +++ b/lib_rend/ivas_PredTables.h @@ -39,12 +39,12 @@ extern "C" #endif -#define PRED_QUNAT_FILTER_MAG_BITS (3) -#define PRED_QUANT_FILTER_PHASE_BITS (5) -#define PRED_QUANT_FILTER_MAG_MIN (0) -#define PRED_QUANT_FILTER_MAG_MAX (7) -#define PRED_QUANT_FILTER_PHASE_MIN (-16) -#define PRED_QUANT_FILTER_PHASE_MAX (15) +#define PRED_QUNAT_FILTER_MAG_BITS ( 3 ) +#define PRED_QUANT_FILTER_PHASE_BITS ( 5 ) +#define PRED_QUANT_FILTER_MAG_MIN ( 0 ) +#define PRED_QUANT_FILTER_MAG_MAX ( 7 ) +#define PRED_QUANT_FILTER_PHASE_MIN ( -16 ) +#define PRED_QUANT_FILTER_PHASE_MAX ( 15 ) #ifdef __cplusplus } diff --git a/lib_rend/ivas_RMSEnvDeltaHuff.c b/lib_rend/ivas_RMSEnvDeltaHuff.c index ac746d5382..0f613a8f47 100644 --- a/lib_rend/ivas_RMSEnvDeltaHuff.c +++ b/lib_rend/ivas_RMSEnvDeltaHuff.c @@ -63,4 +63,4 @@ const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, }; -/* clang-format on */ \ No newline at end of file +/* clang-format on */ diff --git a/lib_rend/ivas_RMSEnvDeltaHuff.h b/lib_rend/ivas_RMSEnvDeltaHuff.h index 13120d100e..25d2fc625e 100644 --- a/lib_rend/ivas_RMSEnvDeltaHuff.h +++ b/lib_rend/ivas_RMSEnvDeltaHuff.h @@ -39,16 +39,16 @@ extern "C" #endif #ifndef HUFF_READ_SIZE -#define HUFF_READ_SIZE (4) +#define HUFF_READ_SIZE ( 4 ) #endif #ifndef HUFF_DEC_TABLE_SIZE -#define HUFF_DEC_TABLE_SIZE (16) +#define HUFF_DEC_TABLE_SIZE ( 16 ) #endif #include -extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; + extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; -extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; + extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; #ifdef __cplusplus } diff --git a/lib_rend/ivas_cldfb_codec_bitstream.c b/lib_rend/ivas_cldfb_codec_bitstream.c index d12cb39d61..7e8950ab28 100644 --- a/lib_rend/ivas_cldfb_codec_bitstream.c +++ b/lib_rend/ivas_cldfb_codec_bitstream.c @@ -37,7 +37,6 @@ #include "prot.h" #include "wmc_auto.h" - #define MAX_BUFFER 1024 static const uint32_t MASKS[] = { @@ -305,4 +304,4 @@ int32_t BSGetError( Bitstream *psBitstream ) { return psBitstream->iError; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_splitRendererPLC.c b/lib_rend/ivas_splitRendererPLC.c index 76e14be4f5..eafc5617dd 100644 --- a/lib_rend/ivas_splitRendererPLC.c +++ b/lib_rend/ivas_splitRendererPLC.c @@ -489,4 +489,4 @@ void ivas_splitBinRendPLC( return; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 88345ad673..3b22d644ce 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -1849,4 +1849,4 @@ void ivas_init_split_post_rend_handles( SPLIT_POST_REND_WRAPPER *hSplitRendWrapp #endif return; } -#endif \ No newline at end of file +#endif diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index b4b303600d..f498128c91 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1814,4 +1814,4 @@ ivas_error ivas_renderMultiBinToSplitBinaural( } return error; } -#endif \ No newline at end of file +#endif diff --git a/lib_util/split_rend_bfi_file_reader.c b/lib_util/split_rend_bfi_file_reader.c index 3851d83718..2c1fe4e3b8 100644 --- a/lib_util/split_rend_bfi_file_reader.c +++ b/lib_util/split_rend_bfi_file_reader.c @@ -54,7 +54,7 @@ struct SplitRendBFIFileReader *-----------------------------------------------------------------------*/ ivas_error SplitRendBFIFileReader_open( - char *bfiFilePath, /* i : frame loss file name */ + char *bfiFilePath, /* i : frame loss file name */ SplitRendBFIFileReader **SplitRendBFIReader /* o : SplitRendBFIFileReader handle */ ) { @@ -99,16 +99,15 @@ ivas_error SplitRendBFIFileReader_open( ivas_error SplitRendBFIFileReading( SplitRendBFIFileReader *SplitRendBFIReader, /* i/o: SplitRendBFIFileReader handle */ - int16_t *bfi -) + int16_t *bfi ) { - if ( SplitRendBFIReader->txtfile ? 1 != fscanf( SplitRendBFIReader->bfiFile, "%hd", bfi ) : 1 != fread(bfi,sizeof(*bfi),1,SplitRendBFIReader->bfiFile)) + if ( SplitRendBFIReader->txtfile ? 1 != fscanf( SplitRendBFIReader->bfiFile, "%hd", bfi ) : 1 != fread( bfi, sizeof( *bfi ), 1, SplitRendBFIReader->bfiFile ) ) { if ( feof( SplitRendBFIReader->bfiFile ) ) { rewind( SplitRendBFIReader->bfiFile ); SplitRendBFIReader->fileRewind = true; - return SplitRendBFIFileReading( SplitRendBFIReader, bfi); + return SplitRendBFIFileReading( SplitRendBFIReader, bfi ); } return IVAS_ERR_FAILED_FILE_PARSE; } diff --git a/lib_util/split_rend_bfi_file_reader.h b/lib_util/split_rend_bfi_file_reader.h index 655c4fe800..97df1c7fbb 100644 --- a/lib_util/split_rend_bfi_file_reader.h +++ b/lib_util/split_rend_bfi_file_reader.h @@ -40,14 +40,13 @@ typedef struct SplitRendBFIFileReader SplitRendBFIFileReader; ivas_error SplitRendBFIFileReader_open( - char *trajFilePath, /* i : head rotation trajectory file name */ + char *trajFilePath, /* i : head rotation trajectory file name */ SplitRendBFIFileReader **SplitRendBFIReader /* o : SplitRendBFIFileReader handle */ ); ivas_error SplitRendBFIFileReading( SplitRendBFIFileReader *SplitRendBFIReader, /* i/o: SplitRendBFIFileReader handle */ - int16_t *bfi -); + int16_t *bfi ); void SplitRendBFIFileReader_close( SplitRendBFIFileReader **SplitRendBFIReader /* i/o: SplitRendBFIFileReader handle */ -- GitLab From 437a016d83351f4fce6d037ad8e7deef00e648bf Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 2 May 2023 08:37:32 +0200 Subject: [PATCH 0121/1418] bugfix: ISM extended metadata -related variables need to be initialized also in OMASA --- lib_dec/ivas_init_dec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 560618b552..a1360fc985 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1051,6 +1051,9 @@ ivas_error ivas_init_decoder( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { + st_ivas->ism_extmeta_active = -1; + st_ivas->ism_extmeta_cnt = 0; + if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) { return error; -- GitLab From 0badcc3496b8ab6e949efd09885ed69fcba25026 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 2 May 2023 10:23:18 +0200 Subject: [PATCH 0122/1418] fix global-buffer-overflow --- lib_dec/ivas_omasa_dec.c | 2 +- lib_enc/ivas_omasa_enc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 4fe74fd841..a5ba2d6ddf 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -202,7 +202,7 @@ ivas_error ivas_omasa_dec_config( ism_total_brate += sep_object_brate[k - 2][st_ivas->nSCE - 1]; } - if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_corecoder_dec_reconfig( st_ivas, nSCE_old, 1, 2, 0, st_ivas->nSCE > 0 ? sep_object_brate[k - 2][st_ivas->nSCE - 1] : 0, ivas_total_brate - ism_total_brate ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 8c6cd7038c..fc479d3f0b 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -245,7 +245,7 @@ ivas_error ivas_omasa_enc_config( } /* reconfigure core-coders for ISMs */ - if ( ( error = ivas_corecoder_enc_reconfig( st_ivas, nSCE_old, 1, 2, sep_object_brate[k - 2][st_ivas->nSCE - 1], ivas_total_brate - ism_total_brate, MC_MODE_NONE ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_corecoder_enc_reconfig( st_ivas, nSCE_old, 1, 2, st_ivas->nSCE > 0 ? sep_object_brate[k - 2][st_ivas->nSCE - 1] : 0, ivas_total_brate - ism_total_brate, MC_MODE_NONE ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 2f12af7b0113d53e2116a0f5201372f556db34c3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 2 May 2023 10:56:35 +0200 Subject: [PATCH 0123/1418] update OMASA for FIX_417_TD_DECORR_BRATE_SW (fixes crash for BR switching) --- lib_dec/ivas_masa_dec.c | 43 ++++++++++++++++++++++++---------------- lib_dec/ivas_omasa_dec.c | 11 ++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a8fa913024..57dfa13fd5 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1427,31 +1427,40 @@ ivas_error ivas_masa_dec_reconfigure( } } +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) + { +#endif + #ifdef FIX_417_TD_DECORR_BRATE_SW - /*-----------------------------------------------------------------* - * TD Decorrelator - *-----------------------------------------------------------------*/ + /*-----------------------------------------------------------------* + * TD Decorrelator + *-----------------------------------------------------------------*/ - if ( st_ivas->hDiracDecBin != NULL ) - { - if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) + if ( st_ivas->hDiracDecBin != NULL ) + { + if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + /*-----------------------------------------------------------------* + * CLDFB instances + *-----------------------------------------------------------------*/ + + if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, st_ivas->nchan_transport, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { return error; } - } - /*-----------------------------------------------------------------* - * CLDFB instances - *-----------------------------------------------------------------*/ + /*-----------------------------------------------------------------* + * Set-up MASA coding elements and bitrates + *-----------------------------------------------------------------*/ +#endif - if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, st_ivas->nchan_transport, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) - { - return error; +#ifdef MASA_AND_OBJECTS } - - /*-----------------------------------------------------------------* - * Set-up MASA coding elements and bitrates - *-----------------------------------------------------------------*/ #endif #ifdef MASA_AND_OBJECTS diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index a5ba2d6ddf..a6bd23db3f 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -238,6 +238,17 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); +#ifdef FIX_417_TD_DECORR_BRATE_SW + /* TD Decorrelator */ + if ( st_ivas->hDiracDecBin != NULL ) + { + if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + /* CLDFB instances */ if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { -- GitLab From e032fd5c6424b01d67dd4ecbfcb4c20f43b17210 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 2 May 2023 11:41:11 +0200 Subject: [PATCH 0124/1418] fix memory leaks in bitrate switching --- lib_dec/ivas_masa_dec.c | 2 +- lib_dec/ivas_omasa_dec.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 57dfa13fd5..810bd7bc09 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1428,7 +1428,7 @@ ivas_error ivas_masa_dec_reconfigure( } #ifdef MASA_AND_OBJECTS - if ( st_ivas->ivas_format != MASA_ISM_FORMAT ) + if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) /* note: switching within OMASA is handled in ivas_omasa_dec_config() */ { #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index a6bd23db3f..b89ce05019 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -136,6 +136,7 @@ ivas_error ivas_omasa_dec_config( int16_t k, sce_id, nSCE_old, nchan_hp20_old, numCldfbAnalyses_old, numCldfbSyntheses_old, n_MD; int32_t ivas_total_brate, ism_total_brate, cpe_brate; ISM_MODE ism_mode_old; + IVAS_FORMAT ivas_format_orig; ivas_error error; /* initializations */ @@ -146,7 +147,11 @@ ivas_error ivas_omasa_dec_config( ism_mode_old = ivas_omasa_ism_mode_select( st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->nchan_ism ); st_ivas->ism_mode = ism_mode_old; + ivas_format_orig = st_ivas->ivas_format; + st_ivas->ivas_format = st_ivas->last_ivas_format; ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); + st_ivas->ivas_format = ivas_format_orig; + nSCE_old = st_ivas->nSCE; nchan_hp20_old = getNumChanSynthesis( st_ivas ); -- GitLab From a0678acad21784d3bdf1604e7db607912e336cd2 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Tue, 2 May 2023 15:10:45 +0200 Subject: [PATCH 0125/1418] solved some compiler and clang-format warnings --- lib_util/render_config_reader.c | 29 ++++++++++++++++------------- lib_util/render_config_reader.h | 11 +++++++---- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 7ab86bab5f..32a2cfb0c6 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -44,7 +44,7 @@ *------------------------------------------------------------------------------------------*/ #ifndef CONTROL_METADATA_REVERB -#define MAX_LINE_LENGTH ( 1024 ) +#define MAX_LINE_LENGTH ( 1024 ) #endif #define MAX_ITEM_LENGTH ( 64 ) #ifndef CONTROL_METADATA_REVERB @@ -477,10 +477,10 @@ static ivas_error read_code_word( } /* First read minLen bits, then add one bit per iteration to find the correct value */ - for (n = 0; n < size; n++) + for ( n = 0; n < size; n++ ) { - minLen = min(minLen, pLengths[n]); - maxLen = max(maxLen, pLengths[n]); + minLen = min( minLen, pLengths[n] ); + maxLen = max( maxLen, pLengths[n] ); } for ( len = minLen; len <= maxLen; len++ ) { @@ -1255,11 +1255,14 @@ static ivas_error RenderConfigReader_readReverb( #endif ivas_error RenderConfigReader_read( - RenderConfigReader *pRenderConfigReader, /* i/o : RenderConfigReader handle */ #ifdef CONTROL_METADATA_REVERB - const char *pRenderConfigPath, /* i : Renderer configuration file path */ + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + const char *pRenderConfigPath, /* i : Renderer configuration file path */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ +#else + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ #endif - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ) { int32_t file_size; @@ -1271,12 +1274,12 @@ ivas_error RenderConfigReader_read( char item[MAX_ITEM_LENGTH + 1]; char chapter[MAX_ITEM_LENGTH + 1]; char *pValue; - int16_t nBandsInput; #ifdef CONTROL_METADATA_REVERB ivas_error error; int32_t params_length; int32_t length; #else + int16_t nBandsInput; int16_t nVectorsMissing; #endif @@ -1286,8 +1289,8 @@ ivas_error RenderConfigReader_read( pConfig_str = (char *) calloc( file_size + 1, sizeof( char ) ); pParams = (char *) calloc( file_size + 1, sizeof( char ) ); pTemp = (char *) calloc( file_size + 1, sizeof( char ) ); - nBandsInput = hRenderConfig->room_acoustics.nBands; #ifndef CONTROL_METADATA_REVERB + nBandsInput = hRenderConfig->room_acoustics.nBands; nVectorsMissing = N_REVERB_VECTORS; #endif @@ -1330,7 +1333,7 @@ ivas_error RenderConfigReader_read( while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { hRenderConfig->room_acoustics.override = TRUE; - params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); #endif @@ -1422,7 +1425,7 @@ ivas_error RenderConfigReader_read( #ifdef CONTROL_METADATA_REVERB params_length = (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #else - params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #endif #ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); @@ -1448,14 +1451,14 @@ ivas_error RenderConfigReader_read( if ( ( error = RenderConfigReader_readReverb( pCombinedName, pRenderConfigReader ) ) != IVAS_ERR_OK ) { - errorHandler( item, error ); + errorHandler( item, ERROR_VALUE_INVALID ); } free( pCombinedName ); } else #endif #ifdef DEBUGGING - if ( strcmp( item, "RENDERER" ) == 0 ) + if ( strcmp( item, "RENDERER" ) == 0 ) { if ( strcmp( pValue, "CREND" ) == 0 ) { diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index 70b4cf42d7..4facb5b9cd 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -60,17 +60,20 @@ ivas_error RenderConfigReader_getAcousticEnvironment( ); /* Verifies configuration parameters */ ivas_error RenderConfigReader_checkValues( - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); #endif /* Reads a configuration */ ivas_error RenderConfigReader_read( - RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ #ifdef CONTROL_METADATA_REVERB - const char *pRenderConfigPath, /* i : Renderer configuration file path */ + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + const char *pRenderConfigPath, /* i : Renderer configuration file path */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ +#else + RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ #endif - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ ); /* Closes the renderer configuration reader and deallocates memory */ -- GitLab From fde101818c899d25b71619b9dada8ad29a8ce12c Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 2 May 2023 16:03:07 +0200 Subject: [PATCH 0126/1418] Script update to generate acoustic environments metadata including early reflections --- ...enerate_acoustic_environments_metadata.py} | 225 +++++++++++++++++- 1 file changed, 218 insertions(+), 7 deletions(-) rename scripts/reverb/{generate_reverb_metadata.py => generate_acoustic_environments_metadata.py} (64%) diff --git a/scripts/reverb/generate_reverb_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py similarity index 64% rename from scripts/reverb/generate_reverb_metadata.py rename to scripts/reverb/generate_acoustic_environments_metadata.py index a05bbeb2d8..c7d49bf3f4 100644 --- a/scripts/reverb/generate_reverb_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -196,10 +196,8 @@ def get_frequency_code(f): def get_frequency_hop_code(index): assert 0 <= index < 9 return [ - '1100', # 2^(1/8) - '1101', # 2^(1/7) - '0010', # 2^(1/6) - '0011', # 2^(1/5) + '0010', # 2^(1/12) + '0011', # 2^(1/6) '0000', # 2^(1/4) '01', # 2^(1/3) '0001', # 2^(1/2) @@ -241,6 +239,93 @@ class fgdMethod(Enum): Default_Banding = '10' +def get_distance_code(dist, isSmallScene = True): + # 0, 1, ... 99 + metersCode = [ + '111101', '110010', '110011', '110000', '110001', '110110', '110111', '110100', '110101', '001010', + '001011', '001000', '001001', '001110', '001111', '001100', '001101', '000010', '000011', '000000', + '000001', '000110', '000111', '000100', '000101', '011010', '011011', '011000', '011001', '011110', + '011111', '011100', '011101', '010010', '010011', '010000', '010001', '010110', '010111', '010100', + '010101', '101010', '101011', '101000', '101001', '101110', '101111', '101100', '101101', '10000', + '1000100', '1000101', '10001110', '10001111', '10001100', '10001101', '10011010', '10011011', '10011000', '10011001', + '10011110', '10011111', '10011100', '10011101', '10010010', '10010011', '10010000', '10010001', '10010110', '10010111', + '10010100', '10010101', '11101010', '11101011', '11101000', '11101001', '11101110', '11101111', '11101100', '11101101', + '11100010', '11100011', '11100000', '11100001', '11100110', '11100111', '11100100', '11100101', '11111010', '11111011', + '11111000', '11111001', '11111110', '11111111', '11111100', '11111101', '11110010', '11110011', '11110000', '11110001' ] + + # 0, 1, ... 9 + hectometersCode = [ + '000', '001', '110', '111', '100', '101', '0110', '0111', '0100', '0101' ] + + # 1, 2, ... 10 + kilometersCode = [ + '10', '011', '001', '000', '111', '0101', '0100', '1101', '11001', '11000' ] + + # 0, 1, ... 99 + centimetersCode = [ + '110010', '110011', '110000', '110001', '110110', '110111', '110100', '110101', '0101010', '0101011', + '0101000', '0101001', '0101110', '0101111', '0101100', '0101101', '0100010', '0100011', '0100000', '0100001', + '0100110', '0100111', '0100100', '0100101', '0111010', '0111011', '0111000', '0111001', '0111110', '0111111', + '0111100', '0111101', '0110010', '0110011', '0110000', '0110001', '0110110', '0110111', '0110100', '0110101', + '0001010', '0001011', '0001000', '0001001', '0001110', '0001111', '0001100', '0001101', '0000010', '0000011', + '0000000', '0000001', '0000110', '0000111', '0000100', '0000101', '0011010', '0011011', '0011000', '0011001', + '0011110', '0011111', '0011100', '0011101', '0010010', '0010011', '0010000', '0010001', '0010110', '0010111', + '0010100', '0010101', '101010', '101011', '101000', '101001', '101110', '101111', '101100', '101101', + '100010', '100011', '100000', '100001', '100110', '100111', '100100', '100101', '1111010', '1111011', + '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '111010', '111011', '111000', '111001' ] + + distance_mm = int(round(np.float32(distance) * np.float32(1000))) # distance in mm + if print_cfg: + print('distance: ', distance_mm) + + mm = distance_mm # [mm] + cm = mm // 10 # [cm] + m = cm // 100 # [m] + hm = m // 100 # [hm] + km = hm // 10 # [km] + + mm = (mm % 10) # 0, 1, ... 9 [mm] + cm = (cm % 100) # 0, 1, ... 99 [cm] + m = (m % 100) # 0, 1, ... 99 [m] + hm = (hm % 9) # 0, 1, ... 9 [hm] + + assert 0 <= mm <= 9 + assert 0 <= cm <= 99 + assert 0 <= m <= 99 + assert 0 <= hm <= 9 + assert distance_mm == km * 1000000 + hm * 100000 + m * 1000 + cm * 10 + mm + + code = metersCode[m] + + if not isSmallScene: + # large scenes + if hm > 0 or km > 0: + # hectometers + code += '1' + hectometersCode[hm] + while km > 0: + # kilometers + code += '1' + kilometersCode[min(km, 10)] + km = km - 10 + code += '0' + else: + code += '0' + + # centimeters + if cm > 0: + code += '1' + centimetersCode[cm] + else: + code += '0' + + return code + + +def get_absorption_code(absorption): + assert 0.0 <= absorption <= 1.0 + + index = round(absorption * 10.0) + + return ['110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ][index] + # apply function to elements of list and concatenate the resulting strings def concatenate(function, data): return ''.join([function(d) for d in data]) @@ -248,6 +333,7 @@ def concatenate(function, data): def test(): # generate binary output which can be compared with the Matlab implementation output + string = '' # count or index encoding @@ -282,7 +368,8 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): # based on config_renderer.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - get_count_or_index_code(1) # fgdNrGrids + '1' # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod + get_count_or_index_code(31) # fgdNrBands @@ -308,6 +395,62 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, 2.6267e-08 ]) + + '0' # hasEarlyReflections + , endian='big') + + file = open('rend_config_renderer.dat', 'wb') + data.tofile(file) + file.close() + +def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin(): + # based on config_renderer.cfg + # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values + data = bitarray( + '1' # hasAcEnv + + get_count_or_index_code(2) # fgdNrGrids + # frequency grid #1 + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(1) # fgdNrBands + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 10000.0 ]) + + # frequency grid #2 + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(31) # fgdNrBands + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, + 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, + 20000.0 ]) + + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(1) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + + concatenate(get_duration_code, # RT60 + [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, + 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, + 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, + 0.60031 ]) + + + concatenate(get_dsr_code, # DSR + [ 1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, 8.9719e-08, 1.902e-07, + 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, + 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, + 2.6267e-08 ]) + + + '1' # hasEarlyReflections + + concatenate(get_distance_code, # room dimensions + [ 3.0, 4.0, 2.5 ]) + + + get_count_or_index_code(0) # FreqGridID + + concatenate(get_absorption_code, # absorptionCode + [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) + + + '0' # listener origin flag , endian='big') @@ -316,11 +459,74 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): file.close() +def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_listener_origin(): + # based on config_renderer.cfg + # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values + data = bitarray( + '1' # hasAcEnv + + get_count_or_index_code(2) # fgdNrGrids + # frequency grid #1 + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(1) # fgdNrBands + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 10000.0 ]) + + # frequency grid #2 + + fgdMethod.Individual_Frequencies.value # fgdMethod + + get_count_or_index_code(31) # fgdNrBands + + + concatenate(get_frequency_code, # fgdCenterFreq + [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, + 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, + 20000.0 ]) + + + get_count_or_index_code(1) # AcousticEnvCount + + get_id_code(0) # ID + + get_count_or_index_code(1) # FreqGridID + + get_duration_code(0.1) # (input)Predelay + + + concatenate(get_duration_code, # RT60 + [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, + 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, + 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, + 0.60031 ]) + + + concatenate(get_dsr_code, # DSR + [ 1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, 8.9719e-08, 1.902e-07, + 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, + 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, + 2.6267e-08 ]) + + + '1' # hasEarlyReflections + + concatenate(get_distance_code, # room dimensions + [ 3.0, 4.0, 2.5 ]) + + + get_count_or_index_code(0) # FreqGridID + + concatenate(get_absorption_code, # absorptionCode + [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) + + + '1' # listener origin flag + + '1' # positive x origin + + '0' # negative y origin + + concatenate(get_distance_code, # listener origin (x, y, z) + [ 0.5, 0.5, 1.5 ]) + + , endian='big') + + file = open('rend_config_renderer.dat', 'wb') + data.tofile(file) + file.close() + + + def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg(): # based on config_hospital_patientroom.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - get_count_or_index_code(1) # fgdNrGrids + 1 # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod + get_count_or_index_code(31) # fgdNrBands @@ -348,6 +554,8 @@ def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() 6.379496e-06, 6.358105e-06, 6.6696e-06, 6.369334e-06, 6.378474e-06, 3.339913e-06, 3.129318e-06, 2.892564e-06, 6.00202e-07, 3.40124e-07, 3.37705e-07 ]) + + '0' # hasEarlyReflections + , endian='big') file = open('rend_config_hospital_patientroom.dat', 'wb') @@ -359,7 +567,8 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): # based on config_recreation.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - get_count_or_index_code(1) # fgdNrGrids + 1 # hasAcEnv + + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod + get_count_or_index_code(31) # fgdNrBands @@ -387,6 +596,8 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): 2.958383e-06, 2.725911e-06, 7.94912e-07, 6.20198e-07, 5.71181e-07, 5.5546e-08, 1.3987e-08, 1.338e-08, 1.322e-09, 1.3e-11, 4e-12 ]) + + '0' # hasEarlyReflections + , endian='big') file = open('rend_config_recreation.dat', 'wb') -- GitLab From ecd7c7884a3ec8c931ee255644217004a458d472 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 3 May 2023 11:32:03 +1000 Subject: [PATCH 0127/1418] renderer static memory optimization --- lib_com/options.h | 3 + lib_rend/lib_rend.c | 227 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 212 insertions(+), 18 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a27d4ddace..c93d72823d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -201,6 +201,9 @@ #define OPTIMIZE_DPCM_QUANT #define SPLIT_REND_PLC /*CLDFB CODEC SWITCHES -- END*/ + +#define REND_STATIC_MEM_OPT + #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5376b18126..7ec283f674 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -115,7 +115,9 @@ typedef struct IVAS_REND_AudioConfig inConfig; IVAS_REND_InputId id; IVAS_REND_AudioBuffer inputBuffer; +#ifndef REND_STATIC_MEM_OPT float bufferData[MAX_BUFFER_LENGTH]; +#endif float gain; /* Linear, not in dB */ rendering_context ctx; int32_t numNewSamplesPerChannel; /* Used to keep track how much new audio was fed before rendering current frame */ @@ -130,6 +132,9 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; +#ifdef REND_STATIC_MEM_OPT + float *bufferData; +#endif } input_ism; typedef struct @@ -157,6 +162,9 @@ typedef struct REVERB_HANDLE hReverb; rotation_gains rot_gains_prev; lfe_routing lfeRouting; +#ifdef REND_STATIC_MEM_OPT + float *bufferData; +#endif } input_mc; typedef struct @@ -173,6 +181,10 @@ typedef struct #else rotation_gains rot_gains_prev; #endif + +#ifdef REND_STATIC_MEM_OPT + float *bufferData; +#endif } input_sba; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -180,6 +192,9 @@ typedef struct { input_base base; SPLIT_POST_REND_WRAPPER splitPostRendWrapper; +#ifdef REND_STATIC_MEM_OPT + float *bufferData; +#endif } input_split_post_rend; #endif @@ -193,6 +208,9 @@ typedef struct DecoderDummy *decDummy; MASA_METADATA_FRAME masaMetadata; bool metadataHasBeenFed; +#ifdef REND_STATIC_MEM_OPT + float *bufferData; +#endif } input_masa; struct IVAS_REND @@ -231,6 +249,30 @@ struct IVAS_REND * Local functions *-------------------------------------------------------------------*/ +#ifdef REND_STATIC_MEM_OPT +static ivas_error allocateInputBaseBufferData( float **data, const int16_t data_size ) +{ + *data = (float *) malloc( data_size * sizeof( float ) ); + if ( *data == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for input base buffer data" ); + } + + return IVAS_ERR_OK; +} + +static void freeInputBaseBufferData( float **data ) +{ + if ( *data != NULL ) + { + free( *data ); + *data = NULL; + } + + return; +} +#endif + static IVAS_QUATERNION quaternionInit( void ) { @@ -1134,7 +1176,13 @@ static void initRendInputBase( input_base *inputBase, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_InputId id, - const rendering_context rendCtx ) + const rendering_context rendCtx +#ifdef REND_STATIC_MEM_OPT + , + float *dataBuf, + const int16_t dataBufSize +#endif +) { inputBase->inConfig = inConfig; inputBase->id = id; @@ -1144,10 +1192,17 @@ static void initRendInputBase( inputBase->inputBuffer.config.numSamplesPerChannel = 0; inputBase->inputBuffer.config.numChannels = 0; +#ifndef REND_STATIC_MEM_OPT inputBase->inputBuffer.data = inputBase->bufferData; set_zero( inputBase->bufferData, MAX_BUFFER_LENGTH ); - +#else + inputBase->inputBuffer.data = dataBuf; + if ( inputBase->inputBuffer.data != NULL ) + { + set_zero( inputBase->inputBuffer.data, dataBufSize ); + } +#endif return; } @@ -1255,7 +1310,18 @@ static ivas_error setRendInputActiveIsm( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } - initRendInputBase( &inputIsm->base, inConfig, id, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + if ( ( error = allocateInputBaseBufferData( &inputIsm->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + initRendInputBase( &inputIsm->base, inConfig, id, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + inputIsm->bufferData, MAX_BUFFER_LENGTH +#endif + ); inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); @@ -1311,7 +1377,15 @@ static void clearInputIsm( rendCtx = inputIsm->base.ctx; - initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + freeInputBaseBufferData( &inputIsm->base.inputBuffer.data ); +#endif + initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); /* Free input's internal handles */ @@ -2114,7 +2188,18 @@ static ivas_error setRendInputActiveMc( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } - initRendInputBase( &inputMc->base, inConfig, id, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + if ( ( error = allocateInputBaseBufferData( &inputMc->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + initRendInputBase( &inputMc->base, inConfig, id, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + inputMc->bufferData, MAX_BUFFER_LENGTH +#endif + ); setZeroPanMatrix( inputMc->panGains ); inputMc->customLsInput = defaultCustomLs(); inputMc->tdRendWrapper = defaultTdRendWrapper(); @@ -2146,7 +2231,15 @@ static void clearInputMc( rendCtx = inputMc->base.ctx; - initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + freeInputBaseBufferData( &inputMc->bufferData ); +#endif + initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); /* Free input's internal handles */ if ( inputMc->efapInWrapper.hEfap != NULL ) @@ -2445,7 +2538,18 @@ static ivas_error setRendInputActiveSplitPostRend( rendCtx = inputSplitPostRend->base.ctx; outConfig = *rendCtx.pOutConfig; - initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH +#endif + ); if ( ( error = updateSplitPostRendPanGains( inputSplitPostRend, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { @@ -2479,7 +2583,18 @@ static ivas_error setRendInputActiveSba( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } - initRendInputBase( &inputSba->base, inConfig, id, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + if ( ( error = allocateInputBaseBufferData( &inputSba->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + initRendInputBase( &inputSba->base, inConfig, id, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + inputSba->bufferData, MAX_BUFFER_LENGTH +#endif + ); setZeroPanMatrix( inputSba->hoaDecMtx ); #ifdef SPLIT_REND_WITH_HEAD_ROT inputSba->crendWrapper = NULL; @@ -2504,10 +2619,19 @@ static ivas_error setRendInputActiveSba( static void clearInputSplitRend( input_split_post_rend *inputSplitRend ) { - // rendering_context rendCtx; + rendering_context rendCtx; - // rendCtx = inputSplitRend->base.ctx; + rendCtx = inputSplitRend->base.ctx; +#ifdef REND_STATIC_MEM_OPT + freeInputBaseBufferData( &inputSplitRend->bufferData ); +#endif + initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) { ivas_splitBinPostRendClose( &inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend ); @@ -2528,7 +2652,15 @@ static void clearInputSba( rendCtx = inputSba->base.ctx; - initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + freeInputBaseBufferData( &inputSba->bufferData ); +#endif + initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); /* Free input's internal handles */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2895,7 +3027,18 @@ static ivas_error setRendInputActiveMasa( return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED; } - initRendInputBase( &inputMasa->base, inConfig, id, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + if ( ( error = allocateInputBaseBufferData( &inputMasa->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + initRendInputBase( &inputMasa->base, inConfig, id, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + inputMasa->bufferData, MAX_BUFFER_LENGTH +#endif + ); if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK ) { @@ -2988,7 +3131,15 @@ static void clearInputMasa( rendCtx = inputMasa->base.ctx; - initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); +#ifdef REND_STATIC_MEM_OPT + freeInputBaseBufferData( &inputMasa->bufferData ); +#endif + initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); freeDecoderDummy( &inputMasa->decDummy ); return; @@ -3063,37 +3214,69 @@ ivas_error IVAS_REND_Open( /* Initialize inputs */ for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); + initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; +#ifdef REND_STATIC_MEM_OPT + hIvasRend->inputsIsm[i].bufferData = NULL; +#endif } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); + initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; hIvasRend->inputsMc[i].crendWrapper = NULL; hIvasRend->inputsMc[i].hReverb = NULL; hIvasRend->inputsMc[i].tdRendWrapper.hBinRendererTd = NULL; +#ifdef REND_STATIC_MEM_OPT + hIvasRend->inputsMc[i].bufferData = NULL; +#endif } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); + initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); hIvasRend->inputsSba[i].crendWrapper = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT hIvasRend->inputsSba[i].cldfbRendWrapper.hCldfbRend = NULL; hIvasRend->inputsSba[i].cldfbRendWrapper.hHrtfFastConv = NULL; ivas_init_split_rend_handles( &hIvasRend->inputsSba[i].splitRendWrapper ); +#endif +#ifdef REND_STATIC_MEM_OPT + hIvasRend->inputsSba[i].bufferData = NULL; #endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); + initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; +#ifdef REND_STATIC_MEM_OPT + hIvasRend->inputsMasa[i].bufferData = NULL; +#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) @@ -3101,10 +3284,18 @@ ivas_error IVAS_REND_Open( initRendInputBase( &hIvasRend->inputsSplitPost[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, - getRendCtx( hIvasRend ) ); + getRendCtx( hIvasRend ) +#ifdef REND_STATIC_MEM_OPT + , + NULL, 0 +#endif + ); ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper ); #ifdef SPLIT_REND_PLC hIvasRend->splitRendBFI = 0; +#endif +#ifdef REND_STATIC_MEM_OPT + hIvasRend->inputsSplitPost[i].bufferData = NULL; #endif } #endif -- GitLab From 0d0f0325ff4db419d22965596ed57a4d32321368 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 3 May 2023 15:17:44 +1000 Subject: [PATCH 0128/1418] euler to quat fix --- lib_com/options.h | 1 + lib_rend/ivas_rotation.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c93d72823d..ed3b91621d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -203,6 +203,7 @@ /*CLDFB CODEC SWITCHES -- END*/ #define REND_STATIC_MEM_OPT +#define EUALER2QUAT_FIX #endif diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 2f3c3cee3e..80e7d5c23e 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -192,7 +192,6 @@ void QuatToRotMat( * * Calculate corresponding Quaternion from Euler angles in radians *------------------------------------------------------------------------*/ - void Euler2Quat( const float yaw, /* i : yaw (x) */ const float pitch, /* i : pitch (y) */ @@ -203,14 +202,24 @@ void Euler2Quat( float cr = cosf( roll * 0.5f ); float sr = sinf( roll * 0.5f ); float cp = cosf( pitch * 0.5f ); +#ifdef EUALER2QUAT_FIX + float sp = sinf( pitch * 0.5f ); +#else float sp = sinf( -pitch * 0.5f ); +#endif float cy = cosf( yaw * 0.5f ); float sy = sinf( yaw * 0.5f ); - +#ifdef EUALER2QUAT_FIX + quat->w = cr * cp * cy + sr * sp * sy; + quat->x = sr * cp * cy - cr * sp * sy; + quat->y = sr * cp * sy + cr * sp * cy; + quat->z = cr * cp * sy - sr * sp * cy; +#else 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; +#endif return; } @@ -231,8 +240,17 @@ void Quat2EulerDegree( { if ( quat.w != -3.0 ) { +#ifdef EUALER2QUAT_FIX + float p; +#endif *yaw = atan2f( 2 * ( quat.w * quat.x + quat.y * quat.z ), 1 - 2 * ( quat.x * quat.x + quat.y * quat.y ) ); +#ifdef EUALER2QUAT_FIX + p = 2 * ( quat.w * quat.y - quat.z * quat.x ); + p = max( -1.0f, min( 1.0f, p ) ); + *pitch = asinf( p ); +#else *pitch = asinf( 2 * ( quat.w * quat.y - quat.z * quat.x ) ); +#endif *roll = atan2f( 2 * ( quat.w * quat.z + quat.x * quat.y ), 1 - 2 * ( quat.y * quat.y + quat.z * quat.z ) ); *yaw *= _180_OVER_PI; *pitch *= _180_OVER_PI; -- GitLab From 2e820810273e7f5ec2ae8cd1976c00bfe17302b2 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Wed, 3 May 2023 10:29:47 +0200 Subject: [PATCH 0129/1418] Reverb control metadata parser extension to support early reflections --- lib_com/options.h | 5 +- lib_util/render_config_reader.c | 382 +++++++++++++++++++++++++++++++- 2 files changed, 375 insertions(+), 12 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 23fc0f759f..86de207929 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -141,7 +141,10 @@ #endif #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define CONTROL_METADATA_REVERB /* Philips: renderer configuration change to binary format */ +#define CONTROL_METADATA_REVERB /* Philips: reverb configuration change to binary format */ +#ifdef CONTROL_METADATA_REVERB +#define CONTROL_METADATA_EARLY_REFLECTIONS /* Philips/Qualcomm: early reflections extension to reverb configuration */ +#endif #define COMMAND_LINE_OPTION_LATE_REVERB /* Philips: late reverb command line option */ #define FIX_ISM_DTX_CNG_BWIDTH_ALT /* VA: issue 396 - alternative fix for bw changes on CNG frames in ISM DTX for objects that use the decoder-side noise estimation */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index c6e68eae25..71dea98dc1 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -48,6 +48,8 @@ #define MAX_LINE_LENGTH ( 1024 ) #define MAX_ITEM_LENGTH ( 64 ) #define N_REVERB_VECTORS ( 3 ) +#else +#define N_ABS_COEFFS ( 6 ) #endif #define SHORTEST_REV_DEL_LINE ( 0.015f ) @@ -84,13 +86,26 @@ typedef enum _FREQ_GRID_MODE FREQ_GRID_MODE_DEFAULT_BANDING = 2 } FREQ_GRID_MODE; +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS +typedef struct +{ + IVAS_VECTOR3 dimensions; /* Room dimensions [m] */ + FrequencyGrid *pFG; /* Pointer to a frequency grid for absorption coeffs */ + float ( *pAbsCoeff )[N_ABS_COEFFS]; /* Absorption coeffs table pointer */ + IVAS_VECTOR3 *pListenerOrigin; /* Listener origin */ +} EarlyReflectionsConfig; +#endif + typedef struct { uint32_t id; /* Acoustic environment ID */ - FrequencyGrid *pFG; /* Pointer into Frequency grids table */ + FrequencyGrid *pFG; /* Pointer into Frequency grids table for late reverb coeffs */ float *pRT60; /* RT60 table */ float *pDSR; /* DSR table */ float preDelay; /* Pre-delay */ +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS + EarlyReflectionsConfig *pEarlyReflections; /* Early reflections configuration */ +#endif } AcousticEnv; struct RenderConfigReader @@ -121,6 +136,11 @@ typedef enum _RC_LUT RC_LUT_FREQ, RC_LUT_FREQ_HOP, RC_LUT_DSR, + RC_LUT_METERS, + RC_LUT_HECTOMETERS, + RC_LUT_KILOMETERS, + RC_LUT_CENTIMETERS, + RC_LUT_ABSORPTION } RC_LUT; /*------------------------------------------------------------------------------------------* @@ -223,9 +243,9 @@ const float lutFreq_Value[] = { const uint16_t lutFreq_Code[] = { 35, 14, 15, 9, 12, 13, 0, 26, 27, 1, 24, 25, 14, 30, 31, 15, 28, 29, 12, 18, 19, 13, 16, 17, 10, 22, 23, 11, 20, 21, 2, 16, 138, 139, 68 }; const uint8_t lutFreq_Len[] = { 6, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 6, 6, 4, 5, 8, 8, 7 }; -const float lutFreqHop_Value[] = { 1.090507733f, 1.104089514f, 1.122462048f, 1.148698355f, 1.189207115f, 1.25992105f, 1.414213562f, 2.0f, 4.0f }; -const uint16_t lutFreqHop_Code[] = { 12, 13, 2, 3, 0, 1, 1, 2, 7 }; -const uint8_t lutFreqHop_Len[] = { 4, 4, 4, 4, 4, 2, 4, 2, 3 }; +const float lutFreqHop_Value[] = { 1.059463094f, 1.122462048f, 1.189207115f, 1.259921050f, 1.414213562f, 2.0f, 4.0f }; +const uint16_t lutFreqHop_Code[] = { 2, 3, 0, 1, 1, 3, 2 }; +const uint8_t lutFreqHop_Len[] = { 4, 4, 4, 2, 4, 2, 2 }; const float lutDsr_Value[] = { -150.0f, -149.0f, -148.0f, -147.0f, -146.0f, -145.0f, -144.0f, -143.0f, -142.0f, -141.0f, @@ -265,6 +285,96 @@ const uint8_t lutDsr_Len[] = { 8 }; +const float lutMeters_Value[] = { + 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, + 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, + 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, + 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, + 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, + 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, + 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, + 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, + 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, + 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f +}; + +const uint16_t lutMeters_Code[] = { + 61, 50, 51, 48, 49, 54, 55, 52, 53, 10, + 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, + 1, 6, 7, 4, 5, 26, 27, 24, 25, 30, + 31, 28, 29, 18, 19, 16, 17, 22, 23, 20, + 21, 42, 43, 40, 41, 46, 47, 44, 45, 16, + 68, 69, 142, 143, 140, 141, 154, 155, 152, 153, + 158, 159, 156, 157, 146, 147, 144, 145, 150, 151, + 148, 149, 234, 235, 232, 233, 238, 239, 236, 237, + 226, 227, 224, 225, 230, 231, 228, 229, 250, 251, + 248, 249, 254, 255, 252, 253, 242, 243, 240, 241 +}; + +const uint8_t lutMeters_Len[] = { + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, + 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 +}; + +const float lutHectometers_Value[] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f }; +const uint16_t lutHectometers_Code[] = { 0, 1, 6, 7, 4, 5, 6, 7, 4, 5 }; +const uint8_t lutHectometers_Len[] = { 3, 3, 3, 3, 3, 3, 4, 4, 4, 4 }; + +const float lutKilometers_Value[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; +const uint16_t lutKilometers_Code[] = { 2, 3, 1, 0, 7, 5, 4, 13, 25, 24 }; +const uint8_t lutKilometers_Len[] = { 2, 3, 3, 3, 3, 4, 4, 4, 5, 5 }; + +const float lutCentimeters_Value[] = { + 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, + 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, + 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, + 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, + 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, + 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, + 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, + 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, + 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, + 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f +}; + +const uint16_t lutCentimeters_Code[] = { + 50, 51, 48, 49, 54, 55, 52, 53, 42, 43, + 40, 41, 46, 47, 44, 45, 34, 35, 32, 33, + 38, 39, 36, 37, 58, 59, 56, 57, 62, 63, + 60, 61, 50, 51, 48, 49, 54, 55, 52, 53, + 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, + 0, 1, 6, 7, 4, 5, 26, 27, 24, 25, + 30, 31, 28, 29, 18, 19, 16, 17, 22, 23, + 20, 21, 42, 43, 40, 41, 46, 47, 44, 45, + 34, 35, 32, 33, 38, 39, 36, 37, 122, 123, + 120, 121, 126, 127, 124, 125, 58, 59, 56, 57 +}; + +const uint8_t lutCentimeters_Len[] = { + 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, + 7, 7, 7, 7, 7, 7, 6, 6, 6, 6 +}; + +const float lutAbsorption_Value[] = { 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f }; +const uint16_t lutAbsorption_Code[] = { 6, 4, 5, 6, 7, 7, 4, 5, 2, 3, 0 }; +const uint8_t lutAbsorption_Len[] = { 3, 3, 3, 4, 4, 3, 4, 4, 4, 4, 3 }; + /*------------------------------------------------------------------------------------------* * Default frequency grids *------------------------------------------------------------------------------------------*/ @@ -470,16 +580,46 @@ static ivas_error read_code_word( pLengths = lutDsr_Len; size = sizeof lutDsr_Len / sizeof( uint8_t ); break; + case RC_LUT_METERS: + pValues = lutMeters_Value; + pCodes = lutMeters_Code; + pLengths = lutMeters_Len; + size = sizeof lutMeters_Len / sizeof( uint8_t ); + break; + case RC_LUT_HECTOMETERS: + pValues = lutHectometers_Value; + pCodes = lutHectometers_Code; + pLengths = lutHectometers_Len; + size = sizeof lutHectometers_Len / sizeof( uint8_t ); + break; + case RC_LUT_KILOMETERS: + pValues = lutKilometers_Value; + pCodes = lutKilometers_Code; + pLengths = lutKilometers_Len; + size = sizeof lutKilometers_Len / sizeof( uint8_t ); + break; + case RC_LUT_CENTIMETERS: + pValues = lutCentimeters_Value; + pCodes = lutCentimeters_Code; + pLengths = lutCentimeters_Len; + size = sizeof lutCentimeters_Len / sizeof( uint8_t ); + break; + case RC_LUT_ABSORPTION: + pValues = lutAbsorption_Value; + pCodes = lutAbsorption_Code; + pLengths = lutAbsorption_Len; + size = sizeof lutAbsorption_Len / sizeof( uint8_t ); + break; case RC_LUT_INVALID: default: return IVAS_ERR_INVALID_RENDER_CONFIG; } /* First read minLen bits, then add one bit per iteration to find the correct value */ - for (n = 0; n < size; n++) + for ( n = 0; n < size; n++ ) { - minLen = min(minLen, pLengths[n]); - maxLen = max(maxLen, pLengths[n]); + minLen = min( minLen, pLengths[n] ); + maxLen = max( maxLen, pLengths[n] ); } for ( len = minLen; len <= maxLen; len++ ) { @@ -671,6 +811,106 @@ static ivas_error get_dsr( return IVAS_ERR_OK; } +/*-----------------------------------------------------------------------------------------* + * Function get_distance() + * Gets a distance value (in meters) + *-----------------------------------------------------------------------------------------*/ + +static ivas_error get_distance( + RenderConfigReader *this, /* i/o : Render config reader handle */ + uint16_t isSmall, /* i : Flag indicating a small distance */ + float *pResult /* o : Distance value */ +) +{ + ivas_error error; + float value; + uint32_t flag; + + if ( ( error = read_code_word( this, RC_LUT_METERS, pResult ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( isSmall == false ) + { + /* addHectometers flag */ + if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( flag == true ) + { + /* Hectometers */ + if ( ( error = read_code_word( this, RC_LUT_HECTOMETERS, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value * 100.0f; + + /* addKilometers flag */ + if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + + while ( flag == true ) + { + /* Kilometers */ + if ( ( error = read_code_word( this, RC_LUT_KILOMETERS, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value * 1000.0f; + + /* addKilometers flag */ + if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + + /* addCentimeters flag */ + if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( flag == true ) + { + /* Centimeters */ + /* Kilometers */ + if ( ( error = read_code_word( this, RC_LUT_CENTIMETERS, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + *pResult += value * 0.01f; + } + } + + return IVAS_ERR_OK; +} + +/*-----------------------------------------------------------------------------------------* + * Function get_absorption() + * Gets an absorption value + *-----------------------------------------------------------------------------------------*/ + +static ivas_error get_absorption( + RenderConfigReader *this, /* i/o : Render config reader handle */ + float *pResult /* o : Distance value */ +) +{ + ivas_error error; + + if ( ( error = read_code_word( this, RC_LUT_ABSORPTION, pResult ) ) != IVAS_ERR_OK ) + { + return error; + } + + return IVAS_ERR_OK; +} + #else /*-----------------------------------------------------------------------------------------* * Function read_bool() @@ -971,7 +1211,10 @@ ivas_error RenderConfigReader_read( { uint32_t file_size; uint32_t value; - uint32_t i, n, m; +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS + uint32_t signx, signy, k; +#endif + uint32_t i, m, n; ivas_error error; float freqHop; uint32_t gridLen; @@ -992,6 +1235,20 @@ ivas_error RenderConfigReader_read( fread( pRenderConfigReader->pBitstream, sizeof( uint8_t ), file_size, pRenderConfigReader->pConfigFile ); pRenderConfigReader->length = file_size; + /****************************/ + /* Read the presence flag */ + /****************************/ + if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Just return in case no acoustic environment data available */ + if ( value == false ) + { + return IVAS_ERR_OK; + } + /****************************/ /* Read the frequency grids */ /****************************/ @@ -1241,6 +1498,98 @@ ivas_error RenderConfigReader_read( return IVAS_ERR_INVALID_RENDER_CONFIG; } } + +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS + /* Has early reflections */ + if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( value == true ) + { + if ( ( pRenderConfigReader->pAE[n].pEarlyReflections = (EarlyReflectionsConfig *) malloc( sizeof( EarlyReflectionsConfig ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + /* Room sizes */ + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->dimensions.x ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->dimensions.y ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->dimensions.z ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Frequency grid ID */ + if ( ( error = get_count_or_index( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) + { + return error; + } + pRenderConfigReader->pAE[n].pEarlyReflections->pFG = &pRenderConfigReader->pFG[value]; + + /* Absorption coefficients */ + if ( ( pRenderConfigReader->pAE[n].pEarlyReflections->pAbsCoeff = malloc( pRenderConfigReader->pAE[n].pEarlyReflections->pFG->nrBands * sizeof( float[N_ABS_COEFFS] ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + for ( m = 0; m < pRenderConfigReader->pAE[n].pEarlyReflections->pFG->nrBands; m++ ) + { + for ( k = 0; k < N_ABS_COEFFS; k++ ) + { + if ( ( error = get_absorption( pRenderConfigReader, &pRenderConfigReader->pAE[n].pEarlyReflections->pAbsCoeff[m][k] ) ) != IVAS_ERR_OK ) + { + return error; + } + } + } + + /* Has listener origin */ + if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( value == true ) + { + if ( ( pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin = malloc( sizeof( IVAS_VECTOR3 ) ) ) == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + + if ( ( error = read_bits( pRenderConfigReader, &signx, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( ( error = read_bits( pRenderConfigReader, &signy, 1 ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->x ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( signx == 0 ) + { + pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->x *= -1.0f; + } + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->y ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( signy == 0 ) + { + pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->y *= -1.0f; + } + } + } +#endif } /* Cleanup */ @@ -1315,7 +1664,7 @@ ivas_error RenderConfigReader_read( while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { hRenderConfig->room_acoustics.override = TRUE; - params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); #ifdef DEBUGGING fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); #endif @@ -1402,7 +1751,7 @@ ivas_error RenderConfigReader_read( pValue = (char *) calloc( strlen( pParams ), sizeof( char ) ); while ( sscanf( pParams + params_idx, "%64[^=]=%[^;];", item, pValue ) == 2 ) { - params_idx += ( int32_t )( strlen( item ) + strlen( pValue ) + 2 ); + params_idx += (int32_t) ( strlen( item ) + strlen( pValue ) + 2 ); fprintf( stderr, " PARAM: %s -> %s\n", item, pValue ); if ( strcmp( item, "RENDERER" ) == 0 ) { @@ -1517,7 +1866,7 @@ void RenderConfigReader_close( ) { #ifdef CONTROL_METADATA_REVERB - uint16_t n; + uint32_t n; #endif if ( ppRenderConfigReader == NULL || *ppRenderConfigReader == NULL ) @@ -1529,6 +1878,17 @@ void RenderConfigReader_close( /* Free the acoustic environments */ for ( n = 0; n < ( *ppRenderConfigReader )->nAE; n++ ) { +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS + if ( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections != NULL ) + { + if ( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pListenerOrigin != NULL ) + { + free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pListenerOrigin ); + } + free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pAbsCoeff ); + free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections ); + } +#endif free( ( *ppRenderConfigReader )->pAE[n].pRT60 ); free( ( *ppRenderConfigReader )->pAE[n].pDSR ); } -- GitLab From 8537b1dd6e85c309bfe13d27b849626d490f4af3 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Wed, 3 May 2023 10:32:43 +0200 Subject: [PATCH 0130/1418] further updates to acoustic environments metadata including early reflections --- ...generate_acoustic_environments_metadata.py | 91 ++++++++++--------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/scripts/reverb/generate_acoustic_environments_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py index c7d49bf3f4..77c9841b40 100644 --- a/scripts/reverb/generate_acoustic_environments_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -117,9 +117,9 @@ def get_duration_code(duration): '110100000', '111010', '110100001', '111011', '110100110', '111000', '110100111', '111001', '110100100', '111110', '110100101', '111111', '110111010', '111100', '110111011', '111101', '110111000', '11000', '110111001' ] - duration_dus = int(round(np.float32(duration) * np.float32(100000))) # [deca us] + duration_dus = round(np.float32(duration) * np.float32(100000)) # [deca us] if print_cfg: - print('duration: ', duration_dus) + print('duration: ', duration_dus, 'dus') dus = duration_dus # [deca us] s = dus // 100000 # 0, 1, ... 30 [s] @@ -168,7 +168,7 @@ def get_frequency_code(f): assert 16 <= f <= 40000 if f in frequencyCode.keys(): if print_cfg: - print('frequency:', f) + print('frequency:', f, 'Hz') return frequencyCode[f] + '0' else: # exact frequency not found, use frequency refinement to aproximate @@ -185,25 +185,24 @@ def get_frequency_code(f): if refinement >= 16: # choose next higer frequency if print_cfg: - print('frequency:', list(frequencyCode)[f_high]) + print('frequency:', list(frequencyCode)[f_high], 'Hz') return frequencyCode[f_high] + '0' else: if print_cfg: - print('frequency:', list(frequencyCode)[f_low], ', refined: ', f_low * 2 ** ((refinement + 1) / 51)) + print('frequency:', list(frequencyCode)[f_low], ', Hz, refined: ', f_low * 2 ** ((refinement + 1) / 51), 'Hz') return frequencyCode[f_low] + '1' + format(refinement, '04b') def get_frequency_hop_code(index): - assert 0 <= index < 9 + assert 0 <= index < 7 return [ - '0010', # 2^(1/12) - '0011', # 2^(1/6) - '0000', # 2^(1/4) - '01', # 2^(1/3) - '0001', # 2^(1/2) - '10', # 2^1 - '111'][index] # 2^2 - + '0010', # 2^(1/12) + '0011', # 2^(1/6) + '0000', # 2^(1/4) + '01', # 2^(1/3) + '0001', # 2^(1/2) + '11', # 2^1 + '10'][index] # 2^2 def get_dsr_code(dsr): @@ -239,7 +238,7 @@ class fgdMethod(Enum): Default_Banding = '10' -def get_distance_code(dist, isSmallScene = True): +def get_distance_code(distance, isSmallScene = True): # 0, 1, ... 99 metersCode = [ '111101', '110010', '110011', '110000', '110001', '110110', '110111', '110100', '110101', '001010', @@ -274,37 +273,36 @@ def get_distance_code(dist, isSmallScene = True): '100010', '100011', '100000', '100001', '100110', '100111', '100100', '100101', '1111010', '1111011', '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '111010', '111011', '111000', '111001' ] - distance_mm = int(round(np.float32(distance) * np.float32(1000))) # distance in mm + distance_cm = round(np.float32(distance) * np.float32(100)) # distance in cm if print_cfg: - print('distance: ', distance_mm) + print('distance: ', distance_cm, 'cm') - mm = distance_mm # [mm] - cm = mm // 10 # [cm] + cm = distance_cm # [cm] m = cm // 100 # [m] hm = m // 100 # [hm] km = hm // 10 # [km] - mm = (mm % 10) # 0, 1, ... 9 [mm] cm = (cm % 100) # 0, 1, ... 99 [cm] m = (m % 100) # 0, 1, ... 99 [m] - hm = (hm % 9) # 0, 1, ... 9 [hm] + hm = (hm % 10) # 0, 1, ... 9 [hm] - assert 0 <= mm <= 9 assert 0 <= cm <= 99 assert 0 <= m <= 99 assert 0 <= hm <= 9 - assert distance_mm == km * 1000000 + hm * 100000 + m * 1000 + cm * 10 + mm + assert distance_cm == km * 100000 + hm * 10000 + m * 100 + cm code = metersCode[m] - if not isSmallScene: + if isSmallScene: + assert(m == hm == km == 0) + else: # large scenes if hm > 0 or km > 0: # hectometers code += '1' + hectometersCode[hm] while km > 0: # kilometers - code += '1' + kilometersCode[min(km, 10)] + code += '1' + kilometersCode[min(km, 10) - 1] km = km - 10 code += '0' else: @@ -326,6 +324,7 @@ def get_absorption_code(absorption): return ['110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ][index] + # apply function to elements of list and concatenate the resulting strings def concatenate(function, data): return ''.join([function(d) for d in data]) @@ -333,16 +332,15 @@ def concatenate(function, data): def test(): # generate binary output which can be compared with the Matlab implementation output - string = '' # count or index encoding - string += concatenate(get_count_or_index_code, [n for n in range(0, 16 * 64)]) + string += concatenate(get_count_or_index_code, [n for n in range(16 * 64)]) # duration encoding - string += concatenate(get_duration_code, [d / 1000 for d in range(0, 30 * 1000)]) - string += concatenate(get_duration_code, [d / 10000 for d in range(0, 30 * 1000)]) - string += concatenate(get_duration_code, [d / 100000 for d in range(0, 30 * 1000)]) + string += concatenate(get_duration_code, [d / 1000 for d in range(30 * 1000)]) + string += concatenate(get_duration_code, [d / 10000 for d in range(30 * 1000)]) + string += concatenate(get_duration_code, [d / 100000 for d in range(30 * 1000)]) # frequency encoding string += concatenate(get_frequency_code, @@ -352,11 +350,20 @@ def test(): 16000, 20000, 25000, 31500, 40000]) # frequency hop encoding - string += concatenate(get_frequency_hop_code, [index for index in range(0, 9)]) + string += concatenate(get_frequency_hop_code, [index for index in range(7)]) # DSR encoding string += concatenate(get_dsr_code, [math.pow(10, dsr / 10) for dsr in range(-150, -10 + 1)]) + # distance encoding + string += concatenate(lambda d : get_distance_code(d, False), [d for d in range(20 * 1000)]) + string += concatenate(lambda d : get_distance_code(d, False), [d / 10 for d in range(20 * 1000)]) + string += concatenate(lambda d : get_distance_code(d, False), [d / 100 for d in range(20 * 1000)]) + string += concatenate(lambda d : get_distance_code(d, True), [d / 100 for d in range( 100)]) + + # absorption encoding + string += concatenate(get_absorption_code, [a / 100 for a in range(100 + 1)]) + data = bitarray(string, endian='big') file = open('test_python.dat', 'wb') @@ -443,8 +450,8 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re 2.6267e-08 ]) + '1' # hasEarlyReflections - + concatenate(get_distance_code, # room dimensions - [ 3.0, 4.0, 2.5 ]) + + concatenate(lambda d : get_distance_code(d, False), + [ 3.0, 4.0, 2.5 ]) # room dimensions + get_count_or_index_code(0) # FreqGridID + concatenate(get_absorption_code, # absorptionCode @@ -500,9 +507,9 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re 2.6267e-08 ]) + '1' # hasEarlyReflections - + concatenate(get_distance_code, # room dimensions - [ 3.0, 4.0, 2.5 ]) - + + concatenate(lambda code : get_distance_code(code, False), + [ 3.0, 4.0, 2.5 ]) # room dimensions + + get_count_or_index_code(0) # FreqGridID + concatenate(get_absorption_code, # absorptionCode [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) @@ -510,8 +517,8 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re + '1' # listener origin flag + '1' # positive x origin + '0' # negative y origin - + concatenate(get_distance_code, # listener origin (x, y, z) - [ 0.5, 0.5, 1.5 ]) + + concatenate(lambda d : get_distance_code(d, False), + [ 0.5, 0.5, 1.5 ]) # listener origin (x, y, z) , endian='big') @@ -520,12 +527,11 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re file.close() - def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg(): # based on config_hospital_patientroom.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - 1 # hasAcEnv + '1' # hasAcEnv + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod + get_count_or_index_code(31) # fgdNrBands @@ -567,7 +573,7 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): # based on config_recreation.cfg # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values data = bitarray( - 1 # hasAcEnv + '1' # hasAcEnv + get_count_or_index_code(1) # fgdNrGrids + fgdMethod.Individual_Frequencies.value # fgdMethod + get_count_or_index_code(31) # fgdNrBands @@ -609,3 +615,6 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): generate_reverb_payload_equivalent_to_rend_config_renderer_cfg() generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() generate_reverb_payload_equivalent_to_rend_config_recreation_cfg() + +#generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin() +#generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_listener_origin() -- GitLab From 8a3be442bc6489a3c727df3f0e96ecd733035b33 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Wed, 3 May 2023 16:00:49 +0530 Subject: [PATCH 0131/1418] ROM to RAM conversion --- lib_com/options.h | 2 + lib_rend/ivas_CQMFDecoder.c | 314 +++++++++++++++++++++++++++++++++++- lib_rend/ivas_CQMFHuff.c | 191 +++++++++++++++------- lib_rend/ivas_CQMFHuff.h | 131 ++++++++++++++- lib_rend/ivas_Tables.h | 4 +- 5 files changed, 579 insertions(+), 63 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ed3b91621d..488c81999d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -205,6 +205,8 @@ #define REND_STATIC_MEM_OPT #define EUALER2QUAT_FIX +#define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ + #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index c2980fa6c3..16e6afc614 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -57,6 +57,23 @@ Nations Convention on Contracts on the International Sales of Goods. #include "ivas_prot_rend.h" #include "wmc_auto.h" +#ifdef ROM_TO_RAM +typedef struct TableNode +{ + struct TableNode **ppoNextTable; + struct TableNode *poOrderedNext; + + int32_t *piCodeIndex; + int32_t *piDifference; + int32_t *piLength; +} TableNode; +typedef struct TableList +{ + TableNode *poOrderedTop; + TableNode *poOrderedBottom; + +} TableList; +#endif struct CQMF_DECODER { int32_t iSampleRate; @@ -68,6 +85,11 @@ struct CQMF_DECODER int32_t iMSMode; int32_t *piMSFlags; +#ifdef ROM_TO_RAM + TableList *ptable_list; + uint32_t ( *c_apauiHuffDecTable_RAM[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; + uint32_t num_decode_table[2 * ALLOC_TABLE_SIZE]; +#endif #ifdef ENABLE_MS_PRED int32_t piMSPredCoefs[MAX_BANDS]; int32_t piLRPhaseDiffs[MAX_BANDS]; @@ -99,11 +121,250 @@ struct CQMF_DECODER int32_t iLastError; }; +#ifdef ROM_TO_RAM +static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ); +static TableNode *CreateTableList( int32_t iReadLength ); +static void DeleteTableList( TableList *ptable_list, int32_t iReadLength, int32_t iTables ); +static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, int32_t iReadLength, uint32_t *iTablesCreated ); +static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t iCode, int32_t iCodeIndex, int32_t iReadLength, uint32_t *iTables ); +static void CompleteTables( CQMFDecoder *psCQMFDecoder, int32_t n, TableList *ptable_list, int32_t iReadLength, int32_t iTablesCreated ); + +static TableNode *CreateTableList( int32_t iReadLength ) +{ + int32_t n; + int32_t iMaxTables; + TableNode *ptable_top; + iMaxTables = 1 << iReadLength; + ptable_top = (TableNode *) malloc( sizeof( TableNode ) ); + ptable_top->ppoNextTable = + (TableNode **) malloc( iMaxTables * sizeof( TableNode * ) ); + ptable_top->piCodeIndex = (int32_t *) malloc( iMaxTables * sizeof( int32_t ) ); + ptable_top->piDifference = (int32_t *) malloc( iMaxTables * sizeof( int32_t ) ); + ptable_top->piLength = (int32_t *) malloc( iMaxTables * sizeof( int32_t ) ); + for ( n = 0; n < iMaxTables; n++ ) + { + ptable_top->ppoNextTable[n] = NULL; + ptable_top->piCodeIndex[n] = 0xffff; + ptable_top->piDifference[n] = 0; + ptable_top->piLength[n] = 0; + } + + return ptable_top; +} +static void DeleteTableList( TableList *ptable_list, int32_t iReadLength, int32_t iTables ) +{ + + TableNode *node; + int32_t iMaxTables; + node = ptable_list->poOrderedTop; + + + iMaxTables = 1 << iReadLength; + while ( ( iTables ) ) + { + + TableNode *node1 = node; + node = node1->poOrderedNext; + if ( node1->piCodeIndex != NULL ) + { + free( node1->piCodeIndex ); + } + if ( node1->piLength != NULL ) + { + free( node1->piLength ); + } + if ( node1->piDifference != NULL ) + { + free( node1->piDifference ); + } + if ( node1->ppoNextTable != NULL ) + { + free( node1->ppoNextTable ); + } + if ( node1 != NULL ) + { + free( node1 ); + } + iTables--; + } + if ( ptable_list != NULL ) + { + free( ptable_list ); + } +} +static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, int32_t iReadLength, uint32_t *iTablesCreated ) +{ + TableNode *poNextNode; + + if ( poParent->ppoNextTable[iIndex] == NULL ) + { + poNextNode = CreateTableList( iReadLength ); + poParent->ppoNextTable[iIndex] = poNextNode; + poParent->piDifference[iIndex] = + *iTablesCreated; // this is a link to the next table rather than the + // difference + table_list->poOrderedBottom->poOrderedNext = poNextNode; + table_list->poOrderedBottom = poNextNode; + + ( *iTablesCreated )++; + } + else + { + poNextNode = poParent->ppoNextTable[iIndex]; + } + + return poNextNode; +} +static void CompleteTables( CQMFDecoder *psCQMFDecoder, int32_t n, TableList *ptable_list, int32_t iReadLength, int32_t iTablesCreated ) +{ + + int32_t iMaxTables; + int32_t j; + TableNode *poNode; + + iMaxTables = 1 << iReadLength; + psCQMFDecoder->c_apauiHuffDecTable_RAM[n] = + malloc( iTablesCreated * iMaxTables * sizeof( uint32_t * ) ); + + poNode = ptable_list->poOrderedTop; + for ( j = 0; j < iTablesCreated; j++ ) + { + int32_t k; + if ( poNode != NULL ) + { + for ( k = 0; k < iMaxTables; k++ ) + { + uint32_t uiCode; + uiCode = poNode->piDifference[k]; + uiCode <<= 16; + uiCode |= poNode->piCodeIndex[k]; + psCQMFDecoder->c_apauiHuffDecTable_RAM[n][j][k] = uiCode; + } + } + poNode = poNode->poOrderedNext; + } +} +static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t iCode, int32_t iCodeIndex, int32_t iReadLength, uint32_t *iTables ) +{ + int32_t iDifference; + int32_t iMask; + int32_t iCurrentLength; + int32_t iIndex; + int32_t iCodeLow; + int32_t iCodeHigh; + + TableNode *poNode; + poNode = ptable_list->poOrderedTop; + iMask = ( 1 << iReadLength ) - 1; + iCurrentLength = iLength; + while ( iCurrentLength > iReadLength ) + { + iDifference = iCurrentLength - iReadLength; + iIndex = iCode >> iDifference; + iIndex &= iMask; + poNode = GetNextTable( iIndex, ptable_list, poNode, iReadLength, iTables ); + iCurrentLength -= iReadLength; + } + + iMask = ( 1 << iCurrentLength ) - 1; + iDifference = iReadLength - iCurrentLength; + iCodeLow = ( iCode & iMask ) << iDifference; + iMask = ( 1 << iDifference ) - 1; + iCodeHigh = iCodeLow | iMask; + for ( iIndex = iCodeLow; iIndex <= iCodeHigh; iIndex++ ) + { + poNode->piCodeIndex[iIndex] = iCodeIndex; + poNode->piDifference[iIndex] = iDifference; + poNode->piLength[iIndex] = iLength; + } +} + +static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ) +{ + int32_t n; + int32_t iMaxTables; + uint32_t **ppsort_enc_table; + TableList *ptable_list; + ptable_list = (TableList *) malloc( sizeof( TableList ) ); + iMaxTables = 1 << iReadLength; + + ppsort_enc_table = (uint32_t **) malloc( iSize * sizeof( int32_t * ) ); + for ( n = 0; n < iSize; n++ ) + { + ppsort_enc_table[n] = (uint32_t *) malloc( 3 * sizeof( int32_t ) ); + ppsort_enc_table[n][0] = ppuiEncTable[n][0]; + ppsort_enc_table[n][1] = ppuiEncTable[n][1]; + ppsort_enc_table[n][2] = (uint32_t) n; + } + + for ( n = 0; n < iSize; n++ ) + { + uint32_t iMin; + int32_t iMinIndex; + int32_t k; + + iMin = ppsort_enc_table[n][0]; + iMinIndex = n; + for ( k = n; k < iSize; k++ ) + { + if ( ppsort_enc_table[k][0] < iMin ) + { + iMin = ppsort_enc_table[k][0]; + iMinIndex = k; + } + } + + if ( iMinIndex != n ) + { + uint32_t uiLength; + uint32_t uiCode; + uint32_t uiCodeIndex; + + uiLength = ppsort_enc_table[n][0]; + uiCode = ppsort_enc_table[n][1]; + uiCodeIndex = ppsort_enc_table[n][2]; + + ppsort_enc_table[n][0] = ppsort_enc_table[iMinIndex][0]; + ppsort_enc_table[n][1] = ppsort_enc_table[iMinIndex][1]; + ppsort_enc_table[n][2] = ppsort_enc_table[iMinIndex][2]; + + ppsort_enc_table[iMinIndex][0] = uiLength; + ppsort_enc_table[iMinIndex][1] = uiCode; + ppsort_enc_table[iMinIndex][2] = uiCodeIndex; + } + } + ptable_list->poOrderedTop = CreateTableList( iReadLength ); + ptable_list->poOrderedBottom = ptable_list->poOrderedTop; + for ( n = 0; n < iSize; n++ ) + { + int32_t iLength; + int32_t iCode; + int32_t iCodeIndex; + + iLength = ppsort_enc_table[n][0]; + iCode = ppsort_enc_table[n][1]; + iCodeIndex = ppsort_enc_table[n][2]; + AddcodeTableList( ptable_list, iLength, iCode, iCodeIndex, iReadLength, + iTables ); + } + + CompleteTables( psCQMFDecoder, num, ptable_list, iReadLength, *iTables ); + DeleteTableList( ptable_list, iReadLength, *iTables ); + for ( n = 0; n < iSize; n++ ) + { + free( ppsort_enc_table[n] ); + } + free( ppsort_enc_table ); +} +#endif CQMFDecoder *CreateCQMFDecoder( const int32_t iSampleRate, const int32_t iChannels ) { int32_t n; +#ifdef ROM_TO_RAM + int32_t read_length; +#endif CQMFDecoder *psCQMFDecoder = NULL; assert( iSampleRate == 48000 ); // Fix @@ -203,7 +464,22 @@ CQMFDecoder *CreateCQMFDecoder( const int32_t iSampleRate, (int32_t *) malloc( CQMF_BANDS * sizeof( int32_t ) ); } } +#ifdef ROM_TO_RAM + read_length = READ_LENGTH; + for ( n = 0; n < ALLOC_TABLE_SIZE * 2; n++ ) + { + psCQMFDecoder->num_decode_table[n] = 1; // initialising the value to 1 + if ( c_apauiHuffEncTabels[n] != NULL ) + { + CreateDecodeTable( psCQMFDecoder, n, c_apauiHuffEncTabels[n], num_row_aauiCQMFHuff[n], read_length, &psCQMFDecoder->num_decode_table[n] ); + } + else + { + psCQMFDecoder->c_apauiHuffDecTable_RAM[n] = NULL; + } + } +#endif psCQMFDecoder->psPredictionDecoder = CreatePredictionDecoder( iChannels, psCQMFDecoder->iNumBlocks ); // psCQMFDecoder->pReadBuff = @@ -377,6 +653,19 @@ void DeleteCQMFDecoder( CQMFDecoder *psCQMFDecoder ) //{ // free( psCQMFDecoder->pReadBuff ); // } +#ifdef ROM_TO_RAM + for ( uint32_t n = 0; n < ALLOC_TABLE_SIZE * 2; n++ ) + { + if ( psCQMFDecoder->num_decode_table[n] > 1 ) + { + + if ( psCQMFDecoder->c_apauiHuffDecTable_RAM[n] != NULL ) + { + free( psCQMFDecoder->c_apauiHuffDecTable_RAM[n] ); + } + } + } +#endif DeletePredictionDecoder( psCQMFDecoder->psPredictionDecoder ); @@ -445,9 +734,13 @@ static int32_t ReadRMSEnvelope( const int32_t iChannels, ivas_split_rend_bits_t *pBits ); static int32_t ReadAllocInformation( int32_t *piAllocOffset, ivas_split_rend_bits_t *pBits ); - +#ifdef ROM_TO_RAM +static int32_t +ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ); +#else static int32_t ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ); +#endif static void ComputeAllocation( const int32_t iChannels, const int32_t *piNumGroups, @@ -487,12 +780,14 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, psCQMFDecoder->iChannels, psCQMFDecoder->iNumBlocks, &psCQMFDecoder->iCommonGrouping, psCQMFDecoder->piNumGroups, psCQMFDecoder->ppiGroupLengths, - pBits ); + pBits + ); iBitsRead += ReadRMSEnvelope( psCQMFDecoder->iChannels, (const int32_t *) psCQMFDecoder->piNumGroups, psCQMFDecoder->iNumBands, psCQMFDecoder->pppiRMSEnvelope, - pBits ); + pBits + ); #ifdef ENABLE_PMOD_ADJUST iBitsRead += @@ -549,7 +844,12 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, psCQMFDecoder->pppiAlloc[n], psCQMFDecoder->pppiCQMFSignReal[n], psCQMFDecoder->pppiCQMFSignImag[n], psCQMFDecoder->pppiQCQMFReal[n], psCQMFDecoder->pppiQCQMFImag[n], - pBits ); + pBits +#ifdef ROM_TO_RAM + , + psCQMFDecoder->c_apauiHuffDecTable_RAM +#endif + ); } for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) @@ -1216,9 +1516,13 @@ static int32_t ReadAllocInformation( int32_t *piAllocOffset, return iBitsRead; } - +#ifdef ROM_TO_RAM +static int32_t +ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits, uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] ) +#else static int32_t ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int32_t iNumBands, const int32_t *piBandwidths, const int32_t *piPredEnable, int32_t **ppiAlloc, int32_t **ppiSignReal, int32_t **ppiSignImag, int32_t **ppiQReal, int32_t **ppiQImag, ivas_split_rend_bits_t *pBits ) +#endif { int32_t n; int32_t iBitsRead; diff --git a/lib_rend/ivas_CQMFHuff.c b/lib_rend/ivas_CQMFHuff.c index af4d4d11ee..a5344b9db1 100644 --- a/lib_rend/ivas_CQMFHuff.c +++ b/lib_rend/ivas_CQMFHuff.c @@ -43,12 +43,14 @@ const uint32_t c_aauiCQMFHuffEnc1[16][2] = {0x0006, 0x0001}, {0x0008, 0x0001}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec1[3][16] = { {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc2[16][2] = { @@ -56,12 +58,14 @@ const uint32_t c_aauiCQMFHuffEnc2[16][2] = {0x0006, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000b, 0x0003}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec2[3][16] = { {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, {0x00000003, 0x00000007, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0001000f, 0x0001000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc3[25][2] = { @@ -72,6 +76,7 @@ const uint32_t c_aauiCQMFHuffEnc3[25][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec3[10][16] = { {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -85,7 +90,7 @@ const uint32_t c_aauiCQMFHuffDec3[10][16] = {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc4[36][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0000}, {0x0010, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, @@ -96,6 +101,7 @@ const uint32_t c_aauiCQMFHuffEnc4[36][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec4[5][16] = { {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -104,7 +110,7 @@ const uint32_t c_aauiCQMFHuffDec4[5][16] = {0x0000001f, 0x00000020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, {0x00000004, 0x00000005, 0x0000000a, 0x0000000b, 0x00000010, 0x00000011, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc5[36][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, @@ -115,6 +121,7 @@ const uint32_t c_aauiCQMFHuffEnc5[36][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec5[10][16] = { {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -128,7 +135,7 @@ const uint32_t c_aauiCQMFHuffDec5[10][16] = {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc6[49][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0003}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0002, 0x0001}, @@ -141,6 +148,7 @@ const uint32_t c_aauiCQMFHuffEnc6[49][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec6[7][16] = { {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -151,7 +159,7 @@ const uint32_t c_aauiCQMFHuffDec6[7][16] = {0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010024, 0x00010024, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, {0x00000005, 0x00000006, 0x0000000c, 0x0000000d, 0x00000013, 0x00000014, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000025, 0x00000026, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc7[64][2] = { {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0002}, {0x0015, 0x0000}, {0x0015, 0x0001}, {0x0015, 0x0002}, @@ -164,6 +172,7 @@ const uint32_t c_aauiCQMFHuffEnc7[64][2] = {0x0015, 0x001a}, {0x0015, 0x001b}, {0x0015, 0x001c}, {0x0015, 0x001d}, {0x0015, 0x001e}, {0x0015, 0x001f}, {0x0015, 0x0020}, {0x0015, 0x0021}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec7[25][16] = { {0x0001ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, @@ -192,6 +201,7 @@ const uint32_t c_aauiCQMFHuffDec7[25][16] = {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc8[81][2] = { @@ -209,6 +219,7 @@ const uint32_t c_aauiCQMFHuffEnc8[81][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec8[16][16] = { {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -228,6 +239,7 @@ const uint32_t c_aauiCQMFHuffDec8[16][16] = {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc9[100][2] = { @@ -247,6 +259,7 @@ const uint32_t c_aauiCQMFHuffEnc9[100][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec9[22][16] = { {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -272,6 +285,7 @@ const uint32_t c_aauiCQMFHuffDec9[22][16] = {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc10[169][2] = { @@ -300,6 +314,7 @@ const uint32_t c_aauiCQMFHuffEnc10[169][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec10[45][16] = { {0x0002ffff, 0x0001ffff, 0x00000001, 0x0000000d, 0x0000000f, 0x0000001b, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -348,6 +363,7 @@ const uint32_t c_aauiCQMFHuffDec10[45][16] = {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc11[196][2] = { @@ -379,6 +395,7 @@ const uint32_t c_aauiCQMFHuffEnc11[196][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec11[50][16] = { {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x0000000e, 0x0000001d, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -432,6 +449,7 @@ const uint32_t c_aauiCQMFHuffDec11[50][16] = {0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, }, {0x000200be, 0x000200be, 0x000200be, 0x000200be, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc12[289][2] = { @@ -475,6 +493,7 @@ const uint32_t c_aauiCQMFHuffEnc12[289][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec12[76][16] = { {0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x00000011, 0x00000012, 0x00000023, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -554,7 +573,7 @@ const uint32_t c_aauiCQMFHuffDec12[76][16] = {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002011a, 0x0002011a, 0x0002011a, 0x0002011a, }, {0x0002011b, 0x0002011b, 0x0002011b, 0x0002011b, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011e, 0x0002011e, 0x0002011e, 0x0002011e, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc13[324][2] = { {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0006, 0x0004}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x0007}, @@ -601,6 +620,7 @@ const uint32_t c_aauiCQMFHuffEnc13[324][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec13[89][16] = { {0x0006ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000001, 0x00000012, 0x00000014, 0x00000015, 0x00000025, 0x00000026, 0x00000037, 0x00010013, 0x00010013, }, @@ -693,7 +713,7 @@ const uint32_t c_aauiCQMFHuffDec13[89][16] = {0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, }, {0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc14[400][2] = { {0x0005, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x0008}, @@ -748,6 +768,7 @@ const uint32_t c_aauiCQMFHuffEnc14[400][2] = {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec14[53][16] = { {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x00000001, 0x00000014, 0x00000015, 0x00000016, 0x00000029, 0x0000002a, 0x0000003d, }, @@ -804,7 +825,7 @@ const uint32_t c_aauiCQMFHuffDec14[53][16] = {0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, }, {0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc15[576][2] = { {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0008}, @@ -881,6 +902,7 @@ const uint32_t c_aauiCQMFHuffEnc15[576][2] = {0x0014, 0x0191}, {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0013, 0x00db}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec15[73][16] = { {0x000cffff, 0x000bffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000019, 0x0000001a, 0x00000031, 0x00000032, }, @@ -957,6 +979,7 @@ const uint32_t c_aauiCQMFHuffDec15[73][16] = {0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, }, {0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc16[729][2] = { @@ -1055,6 +1078,7 @@ const uint32_t c_aauiCQMFHuffEnc16[729][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec16[85][16] = { {0x000fffff, 0x000dffff, 0x000effff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0000001c, }, @@ -1143,6 +1167,7 @@ const uint32_t c_aauiCQMFHuffDec16[85][16] = {0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x000002b6, 0x000002b7, 0x000002b8, 0x000002b9, 0x000002ba, 0x000002bb, 0x000002bc, 0x000002bd, 0x000002be, 0x000002bf, 0x000002c0, 0x000002c1, }, {0x000002c2, 0x000002c3, 0x000002c4, 0x000002c5, 0x000002c6, 0x000002c7, 0x000002c8, 0x000002c9, 0x000002ca, 0x000002cb, 0x000002cc, 0x000002cd, 0x000002ce, 0x000002cf, 0x000002d0, 0x000002d1, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc17[729][2] = { @@ -1241,6 +1266,7 @@ const uint32_t c_aauiCQMFHuffEnc17[729][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec17[93][16] = { {0x0010ffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0006ffff, 0x0005ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, @@ -1337,6 +1363,7 @@ const uint32_t c_aauiCQMFHuffDec17[93][16] = {0x0000028e, 0x0000028f, 0x00000290, 0x00000291, 0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, }, {0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, 0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, }, }; +#endif const uint32_t c_aauiCQMFHuffEnc18[28][2] = { @@ -1347,6 +1374,7 @@ const uint32_t c_aauiCQMFHuffEnc18[28][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec18[6][16] = { {0x0001ffff, 0x00000000, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, }, @@ -1356,7 +1384,7 @@ const uint32_t c_aauiCQMFHuffDec18[6][16] = {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc19[29][2] = { {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, @@ -1366,6 +1394,7 @@ const uint32_t c_aauiCQMFHuffEnc19[29][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec19[6][16] = { {0x0001ffff, 0x0002ffff, 0x00000000, 0x00000006, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, }, @@ -1375,7 +1404,7 @@ const uint32_t c_aauiCQMFHuffDec19[6][16] = {0x0005ffff, 0x00000016, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc20[32][2] = { {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, @@ -1384,6 +1413,7 @@ const uint32_t c_aauiCQMFHuffEnc20[32][2] = {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0011, 0x0001}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec20[6][16] = { {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, @@ -1393,7 +1423,7 @@ const uint32_t c_aauiCQMFHuffDec20[6][16] = {0x0005ffff, 0x00000019, 0x00010018, 0x00010018, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, {0x0000001b, 0x0000001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc21[37][2] = { {0x0005, 0x0002}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, @@ -1404,6 +1434,7 @@ const uint32_t c_aauiCQMFHuffEnc21[37][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec21[7][16] = { {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, @@ -1414,7 +1445,7 @@ const uint32_t c_aauiCQMFHuffDec21[7][16] = {0x0006ffff, 0x0000001e, 0x0001001d, 0x0001001d, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, {0x00000020, 0x00000021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc22[39][2] = { {0x0005, 0x0002}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, @@ -1425,6 +1456,7 @@ const uint32_t c_aauiCQMFHuffEnc22[39][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec22[9][16] = { {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, }, @@ -1437,7 +1469,7 @@ const uint32_t c_aauiCQMFHuffDec22[9][16] = {0x0008ffff, 0x00000025, 0x00010022, 0x00010022, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc23[46][2] = { {0x0005, 0x0003}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, @@ -1449,6 +1481,7 @@ const uint32_t c_aauiCQMFHuffEnc23[46][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec23[12][16] = { {0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, }, @@ -1464,7 +1497,7 @@ const uint32_t c_aauiCQMFHuffDec23[12][16] = {0x000bffff, 0x0000002a, 0x00010029, 0x00010029, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc24[55][2] = { {0x0005, 0x0004}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, @@ -1477,6 +1510,7 @@ const uint32_t c_aauiCQMFHuffEnc24[55][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec24[17][16] = { {0x0008ffff, 0x0009ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, }, @@ -1497,7 +1531,7 @@ const uint32_t c_aauiCQMFHuffDec24[17][16] = {0x0010ffff, 0x00000032, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, {0x00010034, 0x00010034, 0x00010036, 0x00010036, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc25[65][2] = { {0x0005, 0x0005}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x0006}, {0x0004, 0x000f}, {0x0005, 0x0007}, {0x0005, 0x0008}, @@ -1512,6 +1546,7 @@ const uint32_t c_aauiCQMFHuffEnc25[65][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec25[19][16] = { {0x000cffff, 0x000bffff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000001, 0x00000002, 0x00000003, 0x00000005, }, @@ -1534,7 +1569,7 @@ const uint32_t c_aauiCQMFHuffDec25[19][16] = {0x0012ffff, 0x00000038, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010037, 0x00010037, 0x00010039, 0x00010039, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc26[77][2] = { {0x0006, 0x0004}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, @@ -1550,6 +1585,7 @@ const uint32_t c_aauiCQMFHuffEnc26[77][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec26[26][16] = { {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, @@ -1579,7 +1615,7 @@ const uint32_t c_aauiCQMFHuffDec26[26][16] = {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc27[91][2] = { {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, @@ -1597,6 +1633,7 @@ const uint32_t c_aauiCQMFHuffEnc27[91][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec27[28][16] = { {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, @@ -1628,7 +1665,7 @@ const uint32_t c_aauiCQMFHuffDec27[28][16] = {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc28[109][2] = { {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, @@ -1648,6 +1685,7 @@ const uint32_t c_aauiCQMFHuffEnc28[109][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec28[30][16] = { {0x000fffff, 0x0010ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, }, @@ -1681,7 +1719,7 @@ const uint32_t c_aauiCQMFHuffDec28[30][16] = {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc29[129][2] = { {0x0006, 0x0009}, {0x0005, 0x0019}, {0x0006, 0x000a}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0006, 0x000b}, {0x0005, 0x001d}, @@ -1704,6 +1742,7 @@ const uint32_t c_aauiCQMFHuffEnc29[129][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec29[34][16] = { {0x000fffff, 0x0010ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, @@ -1741,7 +1780,7 @@ const uint32_t c_aauiCQMFHuffDec29[34][16] = {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc30[153][2] = { {0x0007, 0x0009}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, @@ -1767,6 +1806,7 @@ const uint32_t c_aauiCQMFHuffEnc30[153][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec30[39][16] = { {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, @@ -1809,7 +1849,7 @@ const uint32_t c_aauiCQMFHuffDec30[39][16] = {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, }, {0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc31[181][2] = { {0x0007, 0x000b}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, @@ -1838,6 +1878,7 @@ const uint32_t c_aauiCQMFHuffEnc31[181][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec31[43][16] = { {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, @@ -1884,31 +1925,33 @@ const uint32_t c_aauiCQMFHuffDec31[43][16] = {0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, }, {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc33[16][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec33[2][16] = { {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc34[16][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec34[2][16] = { {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc35[25][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0007, 0x0006}, {0x0009, 0x0000}, {0x0009, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0009, 0x0002}, @@ -1918,6 +1961,7 @@ const uint32_t c_aauiCQMFHuffEnc35[25][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec35[9][16] = { {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -1930,7 +1974,7 @@ const uint32_t c_aauiCQMFHuffDec35[9][16] = {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc36[36][2] = { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0000}, {0x000b, 0x0001}, {0x000b, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, @@ -1941,6 +1985,7 @@ const uint32_t c_aauiCQMFHuffEnc36[36][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec36[7][16] = { {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -1951,7 +1996,7 @@ const uint32_t c_aauiCQMFHuffDec36[7][16] = {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, }, {0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc37[36][2] = { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, @@ -1962,6 +2007,7 @@ const uint32_t c_aauiCQMFHuffEnc37[36][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec37[4][16] = { {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -1969,7 +2015,7 @@ const uint32_t c_aauiCQMFHuffDec37[4][16] = {0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00010023, 0x00010023, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, {0x00000003, 0x00000004, 0x00000005, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc38[49][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0012}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x000d, 0x0002}, {0x0002, 0x0001}, @@ -1982,6 +2028,7 @@ const uint32_t c_aauiCQMFHuffEnc38[49][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec38[22][16] = { {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2007,7 +2054,7 @@ const uint32_t c_aauiCQMFHuffDec38[22][16] = {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc39[64][2] = { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x000f, 0x0003}, @@ -2020,6 +2067,7 @@ const uint32_t c_aauiCQMFHuffEnc39[64][2] = {0x000f, 0x0029}, {0x000e, 0x0015}, {0x000e, 0x0016}, {0x000e, 0x0017}, {0x000e, 0x0018}, {0x000e, 0x0019}, {0x000e, 0x001a}, {0x000e, 0x001b}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec39[12][16] = { {0x0001ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2035,7 +2083,7 @@ const uint32_t c_aauiCQMFHuffDec39[12][16] = {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc40[81][2] = { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x0011}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, @@ -2051,7 +2099,7 @@ const uint32_t c_aauiCQMFHuffEnc40[81][2] = {0x0010, 0x0021}, }; - +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec40[36][16] = { {0x0001ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2091,7 +2139,7 @@ const uint32_t c_aauiCQMFHuffDec40[36][16] = {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc41[100][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0014}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, @@ -2110,6 +2158,7 @@ const uint32_t c_aauiCQMFHuffEnc41[100][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec41[16][16] = { {0x0001ffff, 0x0000000b, 0x00010001, 0x00010001, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2129,7 +2178,7 @@ const uint32_t c_aauiCQMFHuffDec41[16][16] = {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc42[169][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000e, 0x0006}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, @@ -2157,6 +2206,7 @@ const uint32_t c_aauiCQMFHuffEnc42[169][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec42[28][16] = { {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2188,7 +2238,7 @@ const uint32_t c_aauiCQMFHuffDec42[28][16] = {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, }, {0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc43[196][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x0010, 0x0017}, {0x0013, 0x0000}, {0x0013, 0x0001}, @@ -2219,6 +2269,7 @@ const uint32_t c_aauiCQMFHuffEnc43[196][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec43[32][16] = { {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2254,7 +2305,7 @@ const uint32_t c_aauiCQMFHuffDec43[32][16] = {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc44[289][2] = { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0002}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000a}, {0x0011, 0x0022}, {0x0014, 0x0000}, @@ -2297,6 +2348,7 @@ const uint32_t c_aauiCQMFHuffEnc44[289][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec44[27][16] = { {0x0002ffff, 0x0001ffff, 0x00010001, 0x00010001, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, @@ -2327,7 +2379,7 @@ const uint32_t c_aauiCQMFHuffDec44[27][16] = {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc45[324][2] = { {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x0010, 0x0025}, {0x0012, 0x0088}, @@ -2374,6 +2426,7 @@ const uint32_t c_aauiCQMFHuffEnc45[324][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec45[50][16] = { {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000025, 0x00010001, 0x00010001, 0x00010013, 0x00010013, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, @@ -2427,7 +2480,7 @@ const uint32_t c_aauiCQMFHuffDec45[50][16] = {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc46[400][2] = { {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0004}, {0x0009, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x000a}, {0x000f, 0x0018}, @@ -2482,6 +2535,7 @@ const uint32_t c_aauiCQMFHuffEnc46[400][2] = {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0012, 0x00ab}, {0x0012, 0x00ac}, {0x0012, 0x00ad}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec46[61][16] = { {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x00010015, 0x00010015, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, @@ -2546,7 +2600,7 @@ const uint32_t c_aauiCQMFHuffDec46[61][16] = {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc47[576][2] = { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0005}, {0x0006, 0x0004}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000b}, {0x000d, 0x000d}, @@ -2623,6 +2677,7 @@ const uint32_t c_aauiCQMFHuffEnc47[576][2] = {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, {0x0012, 0x00fd}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec47[87][16] = { {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x0000001a, 0x00000031, 0x00010001, 0x00010001, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, @@ -2713,7 +2768,7 @@ const uint32_t c_aauiCQMFHuffDec47[87][16] = {0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, }, {0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc48[729][2] = { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0006}, {0x0006, 0x0006}, {0x0008, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x000b}, {0x000c, 0x000d}, @@ -2811,6 +2866,7 @@ const uint32_t c_aauiCQMFHuffEnc48[729][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec48[110][16] = { {0x0005ffff, 0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000037, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, @@ -2924,7 +2980,7 @@ const uint32_t c_aauiCQMFHuffDec48[110][16] = {0x000102c4, 0x000102c4, 0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, }, {0x000102cc, 0x000102cc, 0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc49[729][2] = { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0007}, {0x0007, 0x000a}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0009, 0x0009}, {0x000b, 0x000d}, @@ -3022,6 +3078,7 @@ const uint32_t c_aauiCQMFHuffEnc49[729][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec49[113][16] = { {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, @@ -3138,7 +3195,7 @@ const uint32_t c_aauiCQMFHuffDec49[113][16] = {0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, 0x000102cc, 0x000102cc, }, {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc50[28][2] = { {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, @@ -3148,6 +3205,7 @@ const uint32_t c_aauiCQMFHuffEnc50[28][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec50[6][16] = { {0x0001ffff, 0x00000004, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, @@ -3157,7 +3215,7 @@ const uint32_t c_aauiCQMFHuffDec50[6][16] = {0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc51[29][2] = { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, @@ -3167,6 +3225,7 @@ const uint32_t c_aauiCQMFHuffEnc51[29][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec51[6][16] = { {0x0001ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3176,7 +3235,7 @@ const uint32_t c_aauiCQMFHuffDec51[6][16] = {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc52[32][2] = { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0005, 0x0002}, @@ -3185,6 +3244,7 @@ const uint32_t c_aauiCQMFHuffEnc52[32][2] = {0x0013, 0x0003}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0004}, {0x0013, 0x0005}, }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec52[7][16] = { {0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3195,7 +3255,7 @@ const uint32_t c_aauiCQMFHuffDec52[7][16] = {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, {0x00000017, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc53[37][2] = { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0002}, {0x0005, 0x0003}, @@ -3206,6 +3266,7 @@ const uint32_t c_aauiCQMFHuffEnc53[37][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec53[9][16] = { {0x0002ffff, 0x0001ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3218,7 +3279,7 @@ const uint32_t c_aauiCQMFHuffDec53[9][16] = {0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc54[39][2] = { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, @@ -3229,6 +3290,7 @@ const uint32_t c_aauiCQMFHuffEnc54[39][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec54[9][16] = { {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3241,7 +3303,7 @@ const uint32_t c_aauiCQMFHuffDec54[9][16] = {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc55[46][2] = { {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, @@ -3253,6 +3315,7 @@ const uint32_t c_aauiCQMFHuffEnc55[46][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec55[10][16] = { {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3266,7 +3329,7 @@ const uint32_t c_aauiCQMFHuffDec55[10][16] = {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc56[55][2] = { {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0005, 0x0004}, @@ -3279,6 +3342,7 @@ const uint32_t c_aauiCQMFHuffEnc56[55][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec56[12][16] = { {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000004, 0x00000005, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3294,7 +3358,7 @@ const uint32_t c_aauiCQMFHuffDec56[12][16] = {0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, {0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc57[65][2] = { {0x0003, 0x0004}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0004}, @@ -3309,6 +3373,7 @@ const uint32_t c_aauiCQMFHuffEnc57[65][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec57[14][16] = { {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3326,7 +3391,7 @@ const uint32_t c_aauiCQMFHuffDec57[14][16] = {0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, {0x0001002f, 0x0001002f, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc58[77][2] = { {0x0004, 0x0005}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, @@ -3342,6 +3407,7 @@ const uint32_t c_aauiCQMFHuffEnc58[77][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec58[17][16] = { {0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, @@ -3362,7 +3428,7 @@ const uint32_t c_aauiCQMFHuffDec58[17][16] = {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc59[91][2] = { {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0006}, @@ -3380,6 +3446,7 @@ const uint32_t c_aauiCQMFHuffEnc59[91][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec59[20][16] = { {0x0006ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, @@ -3403,7 +3470,7 @@ const uint32_t c_aauiCQMFHuffDec59[20][16] = {0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, }, {0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc60[109][2] = { {0x0004, 0x0007}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, @@ -3423,6 +3490,7 @@ const uint32_t c_aauiCQMFHuffEnc60[109][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec60[24][16] = { {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, @@ -3450,7 +3518,7 @@ const uint32_t c_aauiCQMFHuffDec60[24][16] = {0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, }, {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc61[129][2] = { {0x0004, 0x0008}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0008}, {0x0005, 0x0009}, @@ -3473,6 +3541,7 @@ const uint32_t c_aauiCQMFHuffEnc61[129][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec61[33][16] = { {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00000005, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, @@ -3509,7 +3578,7 @@ const uint32_t c_aauiCQMFHuffDec61[33][16] = {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc62[153][2] = { {0x0004, 0x0009}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, @@ -3535,6 +3604,7 @@ const uint32_t c_aauiCQMFHuffEnc62[153][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec62[41][16] = { {0x0009ffff, 0x0008ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, @@ -3579,7 +3649,7 @@ const uint32_t c_aauiCQMFHuffDec62[41][16] = {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, }; - +#endif const uint32_t c_aauiCQMFHuffEnc63[181][2] = { {0x0004, 0x0008}, {0x0003, 0x0005}, {0x0002, 0x0003}, {0x0004, 0x0009}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, @@ -3608,6 +3678,7 @@ const uint32_t c_aauiCQMFHuffEnc63[181][2] = }; +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec63[39][16] = { {0x0008ffff, 0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x00000000, 0x00000003, 0x00010001, 0x00010001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, @@ -3650,7 +3721,7 @@ const uint32_t c_aauiCQMFHuffDec63[39][16] = {0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, }, {0x00000075, 0x00000079, 0x0000007f, 0x00000081, 0x00000082, 0x00000083, 0x00000085, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, }, }; - +#endif const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = { NULL, c_aauiCQMFHuffEnc1, @@ -3717,7 +3788,7 @@ const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = { c_aauiCQMFHuffEnc62, c_aauiCQMFHuffEnc63, }; - +#ifndef ROM_TO_RAM const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] = { NULL, c_aauiCQMFHuffDec1, @@ -3784,7 +3855,17 @@ const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE c_aauiCQMFHuffDec62, c_aauiCQMFHuffDec63, }; - +#else +const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE] = +{ 0, 16, 16, 25, 36, 36, 49, 64, 81, 100, + 169, 196, 289, 324, 400, 576, 729, 729, 28, 29, + 32, 37, 39, 46, 55, 65, 77, 91, 109, 129, + 153, 181, 0, 16, 16, 25, 36, 36, 49, 64, 81, + 100, 169, 196, 289, 324, 400, 576, 729, 729, 28, + 29, 32, 37, 39, 46, 55, 65, 77, 91, 109, + 129, 153, 181 +}; +#endif #ifdef USE_DEMOD_TABLES const int32_t c_aaiHuffDemod1[16][2] = { 0,0,0,1,0,2,0,3,1,0,1,1,1,2,1,3,2,0,2,1,2,2,2,3,3,0,3,1,3,2,3,3, diff --git a/lib_rend/ivas_CQMFHuff.h b/lib_rend/ivas_CQMFHuff.h index bf28158bea..a4c28a3bac 100644 --- a/lib_rend/ivas_CQMFHuff.h +++ b/lib_rend/ivas_CQMFHuff.h @@ -38,6 +38,7 @@ extern "C" { #endif +#include "options.h" #include "ivas_Tables.h" #include // For NULL #include @@ -55,256 +56,382 @@ extern "C" extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec1[3][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec2[3][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec3[10][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec4[5][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec5[10][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec6[7][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec7[25][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec8[16][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec9[22][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec10[45][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec11[50][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec12[76][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec13[89][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec14[53][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec15[73][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec16[85][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec17[93][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec18[6][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec19[6][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec20[6][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec21[7][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec22[9][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec23[12][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec24[17][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec25[19][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec26[26][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec27[28][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec28[30][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec29[34][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec30[39][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec31[43][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec33[2][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec34[2][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec35[9][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec36[7][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec37[4][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec38[22][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec39[12][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec40[36][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec41[16][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec42[28][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec43[32][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec44[27][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec45[50][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec46[61][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec47[87][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec48[110][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec49[113][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec50[6][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec51[6][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec52[7][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec53[9][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec54[9][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec55[10][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec56[12][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec57[14][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec58[17][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec59[20][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec60[24][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec61[33][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec62[41][16]; +#endif extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; +#ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffDec63[39][16]; - +#endif extern const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; - +#ifndef ROM_TO_RAM extern const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; +#else +extern const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE]; +#endif #ifdef USE_DEMOD_TABLES extern const int32_t c_aaiHuffDemod1[16][2]; diff --git a/lib_rend/ivas_Tables.h b/lib_rend/ivas_Tables.h index 676ecd43d0..61abfb30c9 100644 --- a/lib_rend/ivas_Tables.h +++ b/lib_rend/ivas_Tables.h @@ -75,7 +75,9 @@ extern "C" #define MIN_ALLOC_OFFSET ( -128 ) #define MAX_ALLOC_OFFSET ( 127 ) - +#ifdef ROM_TO_RAM +#define READ_LENGTH ( 4 ) +#endif #define ALLOC_TABLE_SIZE ( 32 ) -- GitLab From a444b46f2e83dda49997c405f603904d126aac6f Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 3 May 2023 13:53:27 +0300 Subject: [PATCH 0132/1418] Fix addressing 128k quality --- lib_com/ivas_cnst.h | 6 +- lib_com/ivas_prot.h | 12 +++ lib_com/options.h | 1 + lib_dec/ivas_cpe_dec.c | 5 +- lib_dec/ivas_masa_dec.c | 8 ++ lib_dec/ivas_omasa_dec.c | 12 +++ lib_dec/ivas_stat_dec.h | 3 + lib_enc/ivas_cpe_enc.c | 5 -- lib_enc/ivas_enc.c | 78 ++++++++++++++++++-- lib_enc/ivas_init_enc.c | 1 + lib_enc/ivas_ism_enc.c | 12 +++ lib_enc/ivas_ism_metadata_enc.c | 68 ++++++++++------- lib_enc/ivas_masa_enc.c | 12 ++- lib_enc/ivas_stat_enc.h | 2 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 +- 15 files changed, 184 insertions(+), 43 deletions(-) mode change 100755 => 100644 lib_com/ivas_prot.h mode change 100755 => 100644 lib_com/options.h diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index be34fdb477..113d7a67bd 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -318,6 +318,10 @@ typedef enum #ifdef MASA_AND_OBJECTS #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM no meta / inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC ) +#ifdef OMASA_ENERGIES +#define ADJUST_ISM_BRATE_NEG 6000 +#define ADJUST_ISM_BRATE_POS 8000 +#endif #endif #define ISM_AZIMUTH_NBITS 7 @@ -1221,12 +1225,10 @@ enum #define MASA_STEREO_MIN_BITRATE IVAS_24k4 #ifdef MASA_AND_OBJECTS #define MAXIMUM_OMASA_FREQ_BANDS 8 /* Corresponds to maximum number of coding bands at 32 kbps */ - #ifdef FIX_OMASA_STEREO_SWITCHING #define OMASA_STEREO_SW_CNT_MAX 100 #define OMASA_STEREO_SW_CNT_MAX2 5 #endif - #endif #define MASA_BIT_REDUCT_PARAM 10 diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h old mode 100755 new mode 100644 index 21439160e0..5625fc2fb7 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -817,6 +817,10 @@ ivas_error ivas_ism_enc( float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ const int16_t input_frame, /* i : input frame length per channel */ int16_t *nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate +#endif ); ivas_error ivas_ism_metadata_enc( @@ -837,6 +841,10 @@ ivas_error ivas_ism_metadata_enc( const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ #ifdef MASA_AND_OBJECTS ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate +#endif #ifdef FIX_OMASA_STEREO_SWITCHING ,int16_t *omasa_stereo_sw_cnt #endif @@ -4625,6 +4633,10 @@ ivas_error ivas_masa_encode( const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ const int16_t ism_imp /* i : importance of separated object */ +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate /* i: flag for using less bitrate for objects in OMASA */ +#endif #endif ); diff --git a/lib_com/options.h b/lib_com/options.h old mode 100755 new mode 100644 index c23efa7568..99627150c5 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -179,6 +179,7 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ +#define OMASA_ENERGIES #define FIX_OMASA_STEREO_SWITCHING // VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps #endif diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 714149b9aa..c4440417c9 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -97,6 +97,9 @@ ivas_error ivas_cpe_dec( sts[0]->BER_detect |= st_ivas->BER_detect; sts[1]->BER_detect |= st_ivas->BER_detect; +#ifdef FIX_OMASA_STEREO_SWITCHING + element_brate_ref = hCPE->element_brate; +#endif #ifdef FIX_OMASA_STEREO_SWITCHING element_brate_ref = hCPE->element_brate; @@ -105,7 +108,6 @@ ivas_error ivas_cpe_dec( /*------------------------------------------------------------------* * Read stereo technology info & audio bandwidth *-----------------------------------------------------------------*/ - #ifdef FIX_OMASA_STEREO_SWITCHING if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -131,7 +133,6 @@ ivas_error ivas_cpe_dec( } } #endif - read_stereo_mode_and_bwidth( hCPE, st_ivas ); /*----------------------------------------------------------------* diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 810bd7bc09..866a20103c 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -242,6 +242,14 @@ ivas_error ivas_masa_decode( ( *nb_bits_read ) += ISM_METADATA_VAD_FLAG_BITS; } } +#ifdef OMASA_ENERGIES + st_ivas->flag_omasa_brate = 0; + if ( st_ivas->nchan_ism >= 3 && ivas_total_brate == IVAS_128k ) + { + st_ivas->flag_omasa_brate = st->bit_stream[( st->next_bit_pos )--]; + ( *nb_bits_read ) += 1; + } +#endif } } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index b89ce05019..92cb4336ec 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -396,6 +396,18 @@ void ivas_set_surplus_brate_dec( st_ivas->hSCE[n]->element_brate = element_brate[n]; *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp, brate_limit_flag ); +#ifdef OMASA_ENERGIES + if ( ism_imp[n] > 1 && st_ivas->flag_omasa_brate == 1 && brate_limit_flag >= 0 ) + { + *ism_total_brate -= ADJUST_ISM_BRATE_NEG; + } + + if ( brate_limit_flag == -1 && ism_imp[n] >= 1 && st_ivas->nchan_ism >= 3 && ( ism_total_brate_ref - *ism_total_brate > IVAS_48k ) ) + { + *ism_total_brate += ADJUST_ISM_BRATE_POS; + } + +#endif } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index fbaedb0453..10319e4f68 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1299,6 +1299,9 @@ typedef struct Decoder_Struct int16_t index_of_edited_ism; /* Todo Nokia: Temporary, used until proper ISM control available */ int16_t azimuth_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ int16_t elevation_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ + #ifdef OMASA_ENERGIES + int16_t flag_omasa_brate; + #endif #endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index c6b33d7539..9a54cdaf5a 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -105,7 +105,6 @@ ivas_error ivas_cpe_enc( int32_t cpe_brate; #ifdef FIX_OMASA_STEREO_SWITCHING int32_t element_brate_ref; - int16_t element_mode_ref; #endif #endif @@ -123,7 +122,6 @@ ivas_error ivas_cpe_enc( ivas_total_brate = hEncoderConfig->ivas_total_brate; #ifdef FIX_OMASA_STEREO_SWITCHING element_brate_ref = hCPE->element_brate; - element_mode_ref = hCPE->element_mode; #endif /*------------------------------------------------------------------* @@ -179,7 +177,6 @@ ivas_error ivas_cpe_enc( { hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } - #ifdef FIX_OMASA_STEREO_SWITCHING if ( ivas_format == MASA_ISM_FORMAT ) { @@ -216,7 +213,6 @@ ivas_error ivas_cpe_enc( } } #endif - if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -781,7 +777,6 @@ ivas_error ivas_cpe_enc( } #endif - if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) { /* update input samples buffer */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 457d56a5e9..b945ac48c6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -63,6 +63,9 @@ ivas_error ivas_enc( Encoder_State *st; /* used for bitstream handling */ #ifdef MASA_AND_OBJECTS int16_t nb_bits_metadata[MAX_SCE + 1]; +#ifdef OMASA_ENERGIES + int16_t flag_omasa_brate; +#endif #else int16_t nb_bits_metadata[MAX_SCE]; #endif @@ -89,6 +92,9 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); +#ifdef OMASA_ENERGIES + flag_omasa_brate = 0; +#endif #else set_s( nb_bits_metadata, 0, MAX_SCE ); #endif @@ -185,7 +191,12 @@ ivas_error ivas_enc( ivas_param_ism_stereo_dmx( st_ivas, data_f, input_frame ); /* Core coding of Stereo DMX */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata +#ifdef OMASA_ENERGIES + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -193,7 +204,12 @@ ivas_error ivas_enc( else if ( st_ivas->ism_mode == ISM_MODE_DISC ) { /* Analysis, decision about bitrates per channel & core coding */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata +#ifdef OMASA_ENERGIES + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -245,6 +261,10 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS , ISM_MODE_NONE, -1, NULL, -1, NULL, 0 +#endif +#ifdef OMASA_ENERGIES + , + 0 #endif ) ) != IVAS_ERR_OK ) { @@ -332,15 +352,53 @@ ivas_error ivas_enc( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { - if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1] +#ifdef OMASA_ENERGIES + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; } } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { +#ifdef OMASA_ENERGIES + float energy_ism, energy_masa; + + energy_ism = 0.0f; + + if ( st_ivas->nSCE >= 3 && st_ivas->hEncoderConfig->ivas_total_brate == IVAS_128k ) + { + for ( i = 0; i < st_ivas->nSCE; i++ ) + { + energy_ism += sum2_f( data_f[i], input_frame ); + } + + energy_masa = 0.0f; + + for ( i = st_ivas->nSCE; i < st_ivas->nSCE + 2; i++ ) + { + energy_masa += sum2_f( data_f[i], input_frame ); + } + + energy_ism = energy_ism / ( energy_masa + 1.0f ) * 2.0f / (float) ( st_ivas->nSCE ); + flag_omasa_brate = 0; + if ( energy_ism < 1.0f ) + { + flag_omasa_brate = 1; + } + dbgwrite( &energy_ism, sizeof( float ), 1, 1, "en_ratio.bin" ); + } +#endif /* Analysis, decision about bitrates per channel & core coding */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] +#ifdef OMASA_ENERGIES + , + flag_omasa_brate +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -349,7 +407,12 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp ) ) != IVAS_ERR_OK ) + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp +#ifdef OMASA_ENERGIES + , + flag_omasa_brate +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -426,6 +489,11 @@ ivas_error ivas_enc( , ISM_MODE_NONE, -1, NULL, -1, NULL, 0 #endif +#ifdef OMASA_ENERGIES + , + 0 +#endif + ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index c2c348f19c..d17a70ea44 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -647,6 +647,7 @@ ivas_error ivas_init_encoder( return error; } + /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 35de64ab26..a8ca36ccfb 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -53,6 +53,10 @@ ivas_error ivas_ism_enc( float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ const int16_t input_frame, /* i : input frame length per channel */ int16_t *nb_bits_metadata /* i : number of metadata bits */ +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate +#endif ) { SCE_ENC_HANDLE hSCE; @@ -246,6 +250,10 @@ ivas_error ivas_ism_enc( #ifdef MASA_AND_OBJECTS ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, 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, -1 +#ifdef OMASA_ENERGIES + , + 0 +#endif #ifdef FIX_OMASA_STEREO_SWITCHING , NULL @@ -275,6 +283,10 @@ ivas_error ivas_ism_enc( ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, 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, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 +#ifdef OMASA_ENERGIES + , + flag_omasa_brate +#endif #ifdef FIX_OMASA_STEREO_SWITCHING , st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 2fcffbb358..a28cc7c79b 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -185,6 +185,10 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS , const float lp_noise_CPE +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate +#endif #ifdef FIX_OMASA_STEREO_SWITCHING , int16_t *omasa_stereo_sw_cnt @@ -252,37 +256,37 @@ ivas_error ivas_ism_metadata_enc( hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10; #ifdef FIX_387_ISM_MD_FEC - /* in inactive frames, send MD 1) in ISM_MD_INC_DIFF_CNT_MAX consecutive frames when MD significantly change, 2) at least every ISM_MD_FEC_DIFF frames */ - if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) - { - if ( ( fabsf( hIsmMeta[ch]->azimuth - hIsmMeta[ch]->last_true_azimuth ) > ISM_MD_FEC_DIFF ) || - ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_true_elevation ) > ISM_MD_FEC_DIFF ) ) + /* in inactive frames, send MD 1) in ISM_MD_INC_DIFF_CNT_MAX consecutive frames when MD significantly change, 2) at least every ISM_MD_FEC_DIFF frames */ + if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { - hIsmMeta[ch]->ism_metadata_flag = 1; - hIsmMeta[ch]->ism_md_inc_diff_cnt = 0; - } - else if ( hIsmMeta[ch]->ism_md_inc_diff_cnt < ISM_MD_INC_DIFF_CNT_MAX ) - { - hIsmMeta[ch]->ism_metadata_flag = 1; - - if ( hIsmMeta[ch]->ism_md_inc_diff_cnt % 2 == 0 ) + if ( ( fabsf( hIsmMeta[ch]->azimuth - hIsmMeta[ch]->last_true_azimuth ) > ISM_MD_FEC_DIFF ) || + ( fabsf( hIsmMeta[ch]->elevation - hIsmMeta[ch]->last_true_elevation ) > ISM_MD_FEC_DIFF ) ) { - hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; + hIsmMeta[ch]->ism_metadata_flag = 1; + hIsmMeta[ch]->ism_md_inc_diff_cnt = 0; } - else + else if ( hIsmMeta[ch]->ism_md_inc_diff_cnt < ISM_MD_INC_DIFF_CNT_MAX ) { - hIsmMeta[ch]->position_angle.angle2_diff_cnt = ISM_FEC_MAX; + hIsmMeta[ch]->ism_metadata_flag = 1; + + if ( hIsmMeta[ch]->ism_md_inc_diff_cnt % 2 == 0 ) + { + hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; + } + else + { + hIsmMeta[ch]->position_angle.angle2_diff_cnt = ISM_FEC_MAX; + } + } + else if ( hIsmMeta[ch]->ism_md_fec_cnt_enc == ISM_MD_FEC_CNT_MAX ) + { + hIsmMeta[ch]->ism_metadata_flag = 1; + hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; } } - else if ( hIsmMeta[ch]->ism_md_fec_cnt_enc == ISM_MD_FEC_CNT_MAX ) - { - hIsmMeta[ch]->ism_metadata_flag = 1; - hIsmMeta[ch]->position_angle.angle1_diff_cnt = ISM_FEC_MAX; - } - } #endif + } } - } /*----------------------------------------------------------------* * Rate importance of particular ISM streams @@ -590,7 +594,8 @@ ivas_error ivas_ism_metadata_enc( { int16_t bits_ism, bits_element[MAX_NUM_OBJECTS]; int16_t brate_limit_flag; - + int32_t ism_total_brate_ref; + ism_total_brate_ref = *ism_total_brate; brate_limit_flag = calculate_brate_limit_flag( ism_imp, nchan_ism ); bits_ism = (int16_t) ( *ism_total_brate / FRAMES_PER_SECOND ); @@ -602,9 +607,20 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_ism; ch++ ) { *ism_total_brate += ivas_interformat_brate( ism_mode, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag ); +#ifdef OMASA_ENERGIES + if ( ism_imp[ch] > 1 && flag_omasa_brate == 1 && brate_limit_flag >= 0 ) + { + *ism_total_brate -= flag_omasa_brate * ADJUST_ISM_BRATE_NEG; + } + + if ( brate_limit_flag == -1 && ism_imp[ch] >= 1 && nchan_ism >= 3 && ( ism_total_brate_ref - *ism_total_brate > IVAS_48k ) ) + { + *ism_total_brate += ADJUST_ISM_BRATE_POS; + } + +#endif } ism_metadata_flag_global = 1; - #ifdef FIX_OMASA_STEREO_SWITCHING if ( ism_mode == ISM_MASA_MODE_DISC ) { @@ -657,7 +673,7 @@ ivas_error ivas_ism_metadata_enc( if ( hIsmMeta[ch]->ism_metadata_flag == 0 ) { hIsmMeta[ch]->ism_md_fec_cnt_enc++; - } + } else { hIsmMeta[ch]->ism_md_fec_cnt_enc = 0; diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 048adbe2dc..bfa5e60735 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -251,6 +251,10 @@ ivas_error ivas_masa_encode( const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ const int16_t ism_imp /* i : importance of separated object */ +#ifdef OMASA_ENERGIES + , + int16_t flag_omasa_brate /* i: flag for using less bitrate for objects in OMASA */ +#endif #endif ) { @@ -393,6 +397,13 @@ ivas_error ivas_masa_encode( hQMetaData->metadata_max_bits -= ISM_METADATA_VAD_FLAG_BITS; } } +#ifdef OMASA_ENERGIES + if ( ivas_total_brate == IVAS_128k && nchan_ism >= 3 ) + { + push_next_indice( hMetaData, flag_omasa_brate, 1 ); + hQMetaData->metadata_max_bits -= 1; + } +#endif } } else @@ -802,7 +813,6 @@ ivas_error ivas_masa_enc_config( #ifdef FIX_OMASA_STEREO_SWITCHING if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT || st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) #else - if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) #endif { diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 67345ab8c9..cf470e9248 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -750,7 +750,7 @@ typedef struct ivas_masa_encoder_data_struct float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t nchan_ism; - float lp_noise_CPE; /* LP filtered total noise estimation */ + float lp_noise_CPE; /* LP filterend total noise estimation */ #ifdef FIX_OMASA_STEREO_SWITCHING int16_t omasa_stereo_sw_cnt; int16_t omasa_stereo_sw_cnt2; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index a2c7b242e1..23b8f36e6b 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -52,7 +52,7 @@ * Local constants *------------------------------------------------------------------------*/ -#define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f +#define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f #ifdef FIX_417_TD_DECORR_BRATE_SW #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) #define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) -- GitLab From a035b93b9e2f9d1999385d4c6f7d0198e7a4475e Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Wed, 3 May 2023 17:38:34 +0530 Subject: [PATCH 0133/1418] pipeline_fixes_set-1 --- lib_rend/ivas_CQMFDecoder.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 16e6afc614..44f1cbeb9d 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -124,7 +124,7 @@ struct CQMF_DECODER #ifdef ROM_TO_RAM static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ); static TableNode *CreateTableList( int32_t iReadLength ); -static void DeleteTableList( TableList *ptable_list, int32_t iReadLength, int32_t iTables ); +static void DeleteTableList( TableList *ptable_list, int32_t iTables ); static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, int32_t iReadLength, uint32_t *iTablesCreated ); static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t iCode, int32_t iCodeIndex, int32_t iReadLength, uint32_t *iTables ); static void CompleteTables( CQMFDecoder *psCQMFDecoder, int32_t n, TableList *ptable_list, int32_t iReadLength, int32_t iTablesCreated ); @@ -151,15 +151,15 @@ static TableNode *CreateTableList( int32_t iReadLength ) return ptable_top; } -static void DeleteTableList( TableList *ptable_list, int32_t iReadLength, int32_t iTables ) +static void DeleteTableList( TableList *ptable_list, int32_t iTables ) { TableNode *node; - int32_t iMaxTables; + //int32_t iMaxTables; node = ptable_list->poOrderedTop; - iMaxTables = 1 << iReadLength; + //iMaxTables = 1 << iReadLength; while ( ( iTables ) ) { @@ -282,11 +282,11 @@ static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t i static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ) { int32_t n; - int32_t iMaxTables; + //int32_t iMaxTables; uint32_t **ppsort_enc_table; TableList *ptable_list; ptable_list = (TableList *) malloc( sizeof( TableList ) ); - iMaxTables = 1 << iReadLength; + //iMaxTables = 1 << iReadLength; ppsort_enc_table = (uint32_t **) malloc( iSize * sizeof( int32_t * ) ); for ( n = 0; n < iSize; n++ ) @@ -350,7 +350,7 @@ static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const ui } CompleteTables( psCQMFDecoder, num, ptable_list, iReadLength, *iTables ); - DeleteTableList( ptable_list, iReadLength, *iTables ); + DeleteTableList( ptable_list, *iTables ); for ( n = 0; n < iSize; n++ ) { free( ppsort_enc_table[n] ); @@ -780,14 +780,12 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, psCQMFDecoder->iChannels, psCQMFDecoder->iNumBlocks, &psCQMFDecoder->iCommonGrouping, psCQMFDecoder->piNumGroups, psCQMFDecoder->ppiGroupLengths, - pBits - ); + pBits ); iBitsRead += ReadRMSEnvelope( psCQMFDecoder->iChannels, (const int32_t *) psCQMFDecoder->piNumGroups, psCQMFDecoder->iNumBands, psCQMFDecoder->pppiRMSEnvelope, - pBits - ); + pBits ); #ifdef ENABLE_PMOD_ADJUST iBitsRead += @@ -1558,10 +1556,14 @@ ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int #ifdef USE_DEMOD_TABLES const int32_t( *paiDemodTable )[2] = NULL; #endif - +#ifdef ROM_TO_RAM + pauiHuffmanTable = (const uint32_t( * )[HUFF_DEC_TABLE_SIZE]) c_apauiHuffDecTables[iAlloc]; + pauiHuffmanTableDPCM = (const uint32_t( * )[HUFF_DEC_TABLE_SIZE]) c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; +#else pauiHuffmanTable = c_apauiHuffDecTables[iAlloc]; pauiHuffmanTableDPCM = c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; +#endif #ifdef USE_DEMOD_TABLES paiDemodTable = c_apaiDemodTables[iAlloc]; #endif -- GitLab From a2b85f9b716b447eee56754f29a783a67bdbb9d8 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Wed, 3 May 2023 18:08:57 +0530 Subject: [PATCH 0134/1418] clean up & clang format fixes --- lib_rend/ivas_CQMFDecoder.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 44f1cbeb9d..9981f84932 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -155,11 +155,8 @@ static void DeleteTableList( TableList *ptable_list, int32_t iTables ) { TableNode *node; - //int32_t iMaxTables; node = ptable_list->poOrderedTop; - - //iMaxTables = 1 << iReadLength; while ( ( iTables ) ) { @@ -282,11 +279,9 @@ static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t i static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ) { int32_t n; - //int32_t iMaxTables; uint32_t **ppsort_enc_table; TableList *ptable_list; ptable_list = (TableList *) malloc( sizeof( TableList ) ); - //iMaxTables = 1 << iReadLength; ppsort_enc_table = (uint32_t **) malloc( iSize * sizeof( int32_t * ) ); for ( n = 0; n < iSize; n++ ) -- GitLab From 63535b6d53de5a4ac5bfd5335121536e0029a1c4 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Wed, 3 May 2023 16:52:03 +0200 Subject: [PATCH 0135/1418] fixed a small error; generated new format binary reverb files --- lib_util/render_config_reader.c | 1 + scripts/testv/rend_config_hospital_patientroom.dat | 2 +- scripts/testv/rend_config_recreation.dat | 4 ++-- scripts/testv/rend_config_renderer.dat | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index e7002f9e61..d8edca110b 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -1445,6 +1445,7 @@ static ivas_error RenderConfigReader_readReverb( { pRenderConfigReader->pAE[n].pRT60 = 0; pRenderConfigReader->pAE[n].pDSR = 0; + pRenderConfigReader->pAE[n].pEarlyReflections = 0; } for ( n = 0; n < pRenderConfigReader->nAE; n++ ) diff --git a/scripts/testv/rend_config_hospital_patientroom.dat b/scripts/testv/rend_config_hospital_patientroom.dat index 20455a95b7..dd09f2ddb4 100644 --- a/scripts/testv/rend_config_hospital_patientroom.dat +++ b/scripts/testv/rend_config_hospital_patientroom.dat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a3b4cf6b770f85bc82129901324078afc0953661b3ff753796d7d4bd15d8c468 +oid sha256:84321b26550df78456eea5595f8e7d99cca2b558117cddf117b738f1d8c2e316 size 136 diff --git a/scripts/testv/rend_config_recreation.dat b/scripts/testv/rend_config_recreation.dat index 456eedbbf7..d17f39b2f1 100644 --- a/scripts/testv/rend_config_recreation.dat +++ b/scripts/testv/rend_config_recreation.dat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6cb9adc877960d2a7e827126c2f44612569e5554e974b5bb98d3be92cb1ee14a -size 149 +oid sha256:6329e3e202458bfae10c8811f4018e8df2c7f2dc8789850ef2d17b72e490f23d +size 150 diff --git a/scripts/testv/rend_config_renderer.dat b/scripts/testv/rend_config_renderer.dat index 6ea8ed4f1d..979bbf9a87 100644 --- a/scripts/testv/rend_config_renderer.dat +++ b/scripts/testv/rend_config_renderer.dat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7941266900de8753e847cfef95298b5ee529e3f8f90ca5421ba46d71bc353821 -size 130 +oid sha256:24a7142edde4f689273970edc73f0ed5c9ac0bbdcc75736ce3c1604e925a6fbf +size 131 -- GitLab From fbbb2c2470f669ba6f46156260030ece45e9d2c4 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 4 May 2023 10:25:24 +1000 Subject: [PATCH 0136/1418] SBA rotation BE optimization, FOA, HOA2 fix with crend --- lib_com/options.h | 3 ++- lib_dec/lib_dec.c | 2 ++ lib_rend/lib_rend.c | 53 ++++++++++++++++++++++++++++++++++----------- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 488c81999d..1c5d43770d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -203,7 +203,8 @@ /*CLDFB CODEC SWITCHES -- END*/ #define REND_STATIC_MEM_OPT -#define EUALER2QUAT_FIX +//#define EUALER2QUAT_FIX +#define SBA_CREND_ROT_OPT #define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 3b30033565..5b58da5874 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -948,9 +948,11 @@ ivas_error IVAS_DEC_FeedHeadTrackData( { /* check for Euler angle signaling */ #ifdef SPLIT_REND_WITH_HEAD_ROT +#ifndef EUALER2QUAT_FIX /* TODO: temp change until Euler2Quat() is fixed*/ if ( ( hIvasDec->st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) && ( hIvasDec->st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) +#endif #endif { if ( orientation[i].w == -3.0f ) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 7ec283f674..1f1be0b7b0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2422,37 +2422,41 @@ updateSbaPanGains( case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: { int16_t is_cldfb_in; - assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural mode is currently supported with HOA3 input and 48k sampling rate only" ); + is_cldfb_in = 1; ivas_renderSplitGetMultiBinPoseData( &rendCtx.hhRendererConfig[0]->split_rend_config, &inputSba->splitRendWrapper.multiBinPoseData, rendCtx.pHeadRotData->sr_pose_pred_axis ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hRendCfg->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) +#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT + if ( hRendCfg->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { - error = ivas_rend_openMultiBinCrend( &inputSba->crendWrapper, inConfig, outConfig, - &inputSba->splitRendWrapper.multiBinPoseData, - *rendCtx.pOutSampleRate ); + assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); + error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, hRendCfg, + &inputSba->splitRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate ); if ( error != IVAS_ERR_OK ) { return error; } - is_cldfb_in = 0; + is_cldfb_in = 1; } + else #endif { - error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, hRendCfg, - &inputSba->splitRendWrapper.multiBinPoseData, - *rendCtx.pOutSampleRate ); + assert( ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural crend mode is currently supported with 48k sampling rate only" ); + error = ivas_rend_openMultiBinCrend( &inputSba->crendWrapper, inConfig, outConfig, + &inputSba->splitRendWrapper.multiBinPoseData, + *rendCtx.pOutSampleRate ); if ( error != IVAS_ERR_OK ) { return error; } - is_cldfb_in = 1; + is_cldfb_in = 0; } + error = ivas_split_renderer_open( &inputSba->splitRendWrapper, &inputSba->base.ctx.hhRendererConfig[0]->split_rend_config, *rendCtx.pOutSampleRate, is_cldfb_in, ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); @@ -2539,7 +2543,7 @@ static ivas_error setRendInputActiveSplitPostRend( outConfig = *rendCtx.pOutConfig; #ifdef REND_STATIC_MEM_OPT - if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) ) != IVAS_ERR_OK ) { return error; } @@ -2547,7 +2551,7 @@ static ivas_error setRendInputActiveSplitPostRend( initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx #ifdef REND_STATIC_MEM_OPT , - inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH + inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS #endif ); @@ -4539,7 +4543,11 @@ ivas_error IVAS_REND_SetHeadRotation( ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { +#ifndef EUALER2QUAT_FIX rotQuat = headRot[i]; /* TODO: temp change until Euler2Quat() is fixed*/ +#else + Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); +#endif } else #endif @@ -4949,11 +4957,19 @@ static ivas_error rotateFrameSba( int16_t m1, m2; int16_t shd_rot_max_order; int16_t subframe_idx, subframe_len; +#ifdef SBA_CREND_ROT_OPT + float *writePtr; +#else float *readPtr, *writePtr; +#endif rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; rotation_gains gains; ivas_error error; +#ifdef SBA_CREND_ROT_OPT + int16_t idx; + float val, cf, oneminuscf; +#endif push_wmops( "rotateFrameSba" ); @@ -4980,6 +4996,11 @@ static ivas_error rotateFrameSba( for ( i = 0; i < subframe_len; i++ ) { +#ifdef SBA_CREND_ROT_OPT + idx = subframe_idx * subframe_len + i; + cf = headRotData->crossfade[i]; + oneminuscf = 1 - cf; +#endif /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ /* apply each angular-momentum block individually to save complexity. */ @@ -4995,10 +5016,16 @@ static ivas_error rotateFrameSba( for ( m = m1; m < m2; m++ ) { +#ifdef SBA_CREND_ROT_OPT + val = inAudio.data[m * inAudio.config.numSamplesPerChannel + idx]; + /* crossfade with previous rotation gains */ + tmpRot[n - m1] += ( cf * gains[n][m] * val + oneminuscf * gains_prev[n][m] * val ); +#else readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); /* crossfade with previous rotation gains */ tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#endif } } /* write back the result */ -- GitLab From 29e1af81f39cb993ce083a95f2b213e7e1fca976 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 4 May 2023 10:28:24 +1000 Subject: [PATCH 0137/1418] enable EUALER2QUAT_FIX --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1c5d43770d..dec3063de3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -203,7 +203,7 @@ /*CLDFB CODEC SWITCHES -- END*/ #define REND_STATIC_MEM_OPT -//#define EUALER2QUAT_FIX +#define EUALER2QUAT_FIX #define SBA_CREND_ROT_OPT #define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ -- GitLab From ef8dc8e6aa277e07a79d92736b42ef7812465ef0 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Thu, 4 May 2023 14:54:08 +0530 Subject: [PATCH 0138/1418] moved the tables to ivas_lcld_tables.c --- Workspace_msvc/lib_rend.vcxproj | 5 +- lib_rend/ivas_CQMFDecoder.c | 16 +- lib_rend/ivas_CQMFEncoder.c | 45 +- lib_rend/ivas_MSPred.c | 3 +- lib_rend/ivas_PerceptualModel.c | 114 +-- lib_rend/ivas_PerceptualModel.h | 59 -- lib_rend/ivas_PredDecoder.c | 2 +- lib_rend/ivas_PredEncoder.c | 2 +- lib_rend/ivas_RMSEnvDeltaHuff.c | 66 -- lib_rend/ivas_RMSEnvDeltaHuff.h | 57 -- lib_rend/ivas_RMSEnvGrouping.c | 3 +- lib_rend/ivas_Tables.c | 200 ----- lib_rend/ivas_Tables.h | 128 --- .../{ivas_CQMFHuff.c => ivas_lcld_tables.c} | 750 +++++++++++++++--- .../{ivas_CQMFHuff.h => ivas_lcld_tables.h} | 389 +++++---- 15 files changed, 947 insertions(+), 892 deletions(-) delete mode 100644 lib_rend/ivas_PerceptualModel.h delete mode 100644 lib_rend/ivas_RMSEnvDeltaHuff.c delete mode 100644 lib_rend/ivas_RMSEnvDeltaHuff.h delete mode 100644 lib_rend/ivas_Tables.c delete mode 100644 lib_rend/ivas_Tables.h rename lib_rend/{ivas_CQMFHuff.c => ivas_lcld_tables.c} (96%) rename lib_rend/{ivas_CQMFHuff.h => ivas_lcld_tables.h} (60%) diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 0488574583..423c250c03 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -199,20 +199,18 @@ + - - - @@ -245,6 +243,7 @@ + diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 9981f84932..5a5888fa09 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -39,11 +39,8 @@ Nations Convention on Contracts on the International Sales of Goods. #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_CQMFHuff.h" #include "ivas_NoiseGen.h" -#include "ivas_PerceptualModel.h" -#include "ivas_RMSEnvDeltaHuff.h" -#include "ivas_Tables.h" +#include "ivas_lcld_tables.h" #include "ivas_cldfb_codec_bitstream.h" #include "prot.h" #include @@ -122,7 +119,7 @@ struct CQMF_DECODER int32_t iLastError; }; #ifdef ROM_TO_RAM -static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ); +static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint16_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ); static TableNode *CreateTableList( int32_t iReadLength ); static void DeleteTableList( TableList *ptable_list, int32_t iTables ); static TableNode *GetNextTable( int32_t iIndex, TableList *table_list, TableNode *poParent, int32_t iReadLength, uint32_t *iTablesCreated ); @@ -276,7 +273,7 @@ static void AddcodeTableList( TableList *ptable_list, int32_t iLength, int32_t i } } -static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint32_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ) +static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const uint16_t ( *ppuiEncTable )[2], int32_t iSize, int32_t iReadLength, uint32_t *iTables ) { int32_t n; uint32_t **ppsort_enc_table; @@ -288,8 +285,8 @@ static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const ui { ppsort_enc_table[n] = (uint32_t *) malloc( 3 * sizeof( int32_t ) ); - ppsort_enc_table[n][0] = ppuiEncTable[n][0]; - ppsort_enc_table[n][1] = ppuiEncTable[n][1]; + ppsort_enc_table[n][0] = (uint32_t)ppuiEncTable[n][0]; + ppsort_enc_table[n][1] = (uint32_t)ppuiEncTable[n][1]; ppsort_enc_table[n][2] = (uint32_t) n; } @@ -1556,8 +1553,7 @@ ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int pauiHuffmanTableDPCM = (const uint32_t( * )[HUFF_DEC_TABLE_SIZE]) c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; #else pauiHuffmanTable = c_apauiHuffDecTables[iAlloc]; - pauiHuffmanTableDPCM = - c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; + pauiHuffmanTableDPCM = c_apauiHuffDecTables[ALLOC_TABLE_SIZE + iAlloc]; #endif #ifdef USE_DEMOD_TABLES paiDemodTable = c_apaiDemodTables[iAlloc]; diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c index a933b2f7cb..05c992516e 100644 --- a/lib_rend/ivas_CQMFEncoder.c +++ b/lib_rend/ivas_CQMFEncoder.c @@ -37,12 +37,9 @@ #include #include #include -#include "ivas_Tables.h" +#include "ivas_lcld_tables.h" #include "prot.h" #include "ivas_RMSEnvGrouping.h" -#include "ivas_PerceptualModel.h" -#include "ivas_RMSEnvDeltaHuff.h" -#include "ivas_CQMFHuff.h" #include "ivas_cldfb_codec_bitstream.h" #include "ivas_prot_rend.h" #ifdef ENABLE_MS_PRED @@ -1081,12 +1078,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1096,12 +1093,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } @@ -1139,12 +1136,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset]; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1154,12 +1151,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset]; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1241,12 +1238,12 @@ static void QuantizeSpectrumDPCM( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } #ifdef _DEBUG_VERBOSE @@ -1264,12 +1261,12 @@ static void QuantizeSpectrumDPCM( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; if ( fVal > 0.0 ) { - iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); + iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } @@ -1357,9 +1354,13 @@ static int32_t CountCQMFBits( const int32_t iNumGroups, if ( iAlloc > 0 ) { +#ifndef ROM_TO_RAM const uint32_t( *pauiHuffmanTable )[2] = NULL; const uint32_t( *pauiHuffmanTableDPCM )[2] = NULL; - +#else + const uint16_t( *pauiHuffmanTable )[2] = NULL; + const uint16_t( *pauiHuffmanTableDPCM )[2] = NULL; +#endif // pauiHuffmanTable = GetHuffEncTable(iAlloc); pauiHuffmanTable = c_apauiHuffEncTabels[iAlloc]; pauiHuffmanTableDPCM = c_apauiHuffEncTabels[ALLOC_TABLE_SIZE + iAlloc]; @@ -1805,9 +1806,13 @@ static int32_t WriteCQMFData( const int32_t iNumGroups, if ( iAlloc > 0 ) { - const uint32_t( *pauiHuffmanTable )[2] = NULL; - const uint32_t( *pauiHuffmanTableDPCM )[2] = NULL; - +#ifndef ROM_TO_RAM + const uint32_t(*pauiHuffmanTable)[2] = NULL; + const uint32_t(*pauiHuffmanTableDPCM)[2] = NULL; +#else + const uint16_t(*pauiHuffmanTable)[2] = NULL; + const uint16_t(*pauiHuffmanTableDPCM)[2] = NULL; +#endif // pauiHuffmanTable = GetHuffEncTable(iAlloc); pauiHuffmanTable = c_apauiHuffEncTabels[iAlloc]; pauiHuffmanTableDPCM = c_apauiHuffEncTabels[ALLOC_TABLE_SIZE + iAlloc]; diff --git a/lib_rend/ivas_MSPred.c b/lib_rend/ivas_MSPred.c index 3694f07510..cec626c3aa 100644 --- a/lib_rend/ivas_MSPred.c +++ b/lib_rend/ivas_MSPred.c @@ -33,8 +33,7 @@ #include "ivas_MSPred.h" #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_Tables.h" -#include "ivas_RMSEnvDeltaHuff.h" +#include "ivas_lcld_tables.h" #include #include #include "prot.h" diff --git a/lib_rend/ivas_PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c index 67adf974a0..2f0072ee97 100644 --- a/lib_rend/ivas_PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -29,11 +29,9 @@ the United Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ - -#include "ivas_PerceptualModel.h" #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_Tables.h" +#include "ivas_lcld_tables.h" #include "prot.h" #include "ivas_prot_rend.h" #include @@ -41,43 +39,6 @@ /* clang-format off */ -#define LOG_ADD_TABLE_LENGTH (512) - -/*TODO : rtyag : move this to tables.c*/ -const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { - 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D, 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39, - 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, - 0x31, 0x31, 0x31, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2B, - 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x29, 0x29, 0x29, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26, 0x26, - 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23, 0x23, 0x23, 0x23, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21, - 0x20, 0x20, 0x20, 0x20, 0x1F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1D, 0x1D, 0x1D, 0x1C, 0x1C, - 0x1C, 0x1C, 0x1B, 0x1B, 0x1B, 0x1B, 0x1A, 0x1A, 0x1A, 0x1A, 0x19, 0x19, 0x19, 0x19, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x17, 0x16, 0x16, 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x15, - 0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, - 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0F, 0x0F, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, - 0x0D, 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, - 0x0B, 0x0B, 0x0B, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; static inline int32_t LogAdd(int32_t iVal1,int32_t iVal2) { @@ -97,79 +58,6 @@ static inline int32_t LogAdd(int32_t iVal1,int32_t iVal2) return iRetVal; } -#define PERCEPTUAL_MODEL_SCALE (64) - -#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) - -#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) - -#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) - -#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) - -#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (8)//(4) - -const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48] = { - 0,0,0,0,0,0,0,0,0,0,0,64,64,64,64,64, - 101,101,128,165,165,180,213,}; - -const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48] = { - -1787,-1787,-1787,-1787,-1787,-1787,-1787,-1787,-1782,-1761,-1737,-1679,-1638,-1613,-1590,-1568, - -1516,-1459,-1395,-1289,-671,-409,-401,}; - - -#if PERCEPTUAL_MODEL_SLGAIN_SHIFT == 4 -const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { - 7,7,6,5,5,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4, -}; -#elif PERCEPTUAL_MODEL_SLGAIN_SHIFT == 8 -const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { - 112,112,96,80,80,64,64,64,64,64,64,64,64,64,64,64, - 64,64,64,64,64,64,64, -}; -#endif - -const int32_t c_aaiSpreadFunction48[MAX_BANDS_48*MAX_BANDS_48] = { - 0,-1561,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-289,-4,-1234,-2295,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-569,-229, - -8,-905,-1705,-2324,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-789,-445,-173,-16,-656,-1271,-1765,-2172,-2520,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-961,-616,-340,-136, - -28,-488,-976,-1382,-1729,-2032,-2305,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-1088,-743,-465,-257,-148,-31,-371,-769,-1114,-1417,-1689,-2054,-2483, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1198,-852,-574,-364,-209,-148, - -42,-300,-635,-936,-1207,-1572,-2000,-2376,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-1293,-948,-669,-458,-301,-183,-145,-56,-258,-547,-816,-1179,-1606,-1982,-2311, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1375,-1029,-750,-539,-381,-260,-180,-142, - -68,-231,-487,-846,-1272,-1647,-1976,-2261,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1444, - -1099,-820,-608,-449,-328,-233,-194,-138,-77,-213,-555,-978,-1352,-1681,-1966,-2268, - -2552,-2552,-2552,-2552,-2552,-2552,-1501,-1155,-876,-665,-505,-383,-287,-210,-193,-130, - -79,-298,-711,-1083,-1411,-1696,-1997,-2288,-2550,-2552,-2552,-2552,-2552,-1567,-1221,-942, - -730,-570,-448,-351,-272,-206,-189,-151,-72,-349,-713,-1039,-1324,-1625,-1915,-2177, - -2448,-2552,-2552,-2552,-1650,-1304,-1025,-813,-653,-530,-432,-352,-285,-227,-177,-163, - -69,-297,-613,-895,-1195,-1485,-1746,-2017,-2238,-2401,-2545,-1727,-1381,-1102,-890,-730, - -607,-509,-428,-360,-301,-249,-180,-153,-72,-257,-527,-824,-1112,-1373,-1643,-1865, - -2028,-2171,-1798,-1452,-1173,-960,-800,-677,-579,-498,-430,-370,-317,-246,-192,-145, - -76,-224,-505,-790,-1050,-1320,-1540,-1703,-1847,-1860,-1514,-1234,-1022,-862,-738,-640, - -559,-490,-430,-377,-306,-224,-197,-136,-81,-242,-515,-771,-1040,-1260,-1422,-1566, - -1923,-1577,-1297,-1085,-925,-801,-703,-621,-553,-492,-439,-367,-284,-213,-198,-144, - -83,-235,-479,-744,-963,-1125,-1268,-1986,-1640,-1360,-1148,-988,-864,-766,-684,-615, - -555,-501,-429,-345,-273,-211,-204,-146,-89,-216,-465,-680,-841,-984,-2043,-1697, - -1417,-1205,-1044,-921,-822,-741,-672,-611,-557,-485,-401,-328,-264,-211,-205,-140, - -93,-227,-430,-588,-729,-2104,-1758,-1479,-1266,-1106,-982,-884,-802,-733,-673,-619, - -546,-461,-388,-324,-269,-212,-211,-151,-100,-195,-336,-472,-2163,-1817,-1537,-1324, - -1164,-1040,-942,-860,-791,-731,-676,-604,-519,-445,-380,-325,-268,-226,-219,-147, - -114,-167,-280,-2203,-1857,-1577,-1365,-1205,-1081,-982,-901,-831,-771,-717,-644,-559, - -485,-420,-364,-306,-252,-239,-206,-132,-122,-163,-2224,-1878,-1598,-1386,-1225,-1102, - -1003,-921,-852,-792,-737,-665,-580,-505,-441,-385,-326,-271,-222,-224,-176,-121,-114, -}; - - -/* clang-format on */ - - void PerceptualModel( const int32_t iMaxQuantBands, const int32_t *piRMSEnvelope, int32_t *piExcitation, diff --git a/lib_rend/ivas_PerceptualModel.h b/lib_rend/ivas_PerceptualModel.h deleted file mode 100644 index da8afca756..0000000000 --- a/lib_rend/ivas_PerceptualModel.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 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_PERCEPTUAL_MODEL_H_ -#define _IVAS_PERCEPTUAL_MODEL_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif -#include - void PerceptualModel( const int32_t iMaxQuantBands, - const int32_t *piRMSEnvelope, - int32_t *piExcitation, - int32_t *piSMR ); - - void PerceptualModelStereo( const int32_t iMaxQuantBands, - const int32_t *piMSFlags, - const int32_t *piRMSEnvelope0, - const int32_t *piRMSEnvelope1, - int32_t *piExcitation0, - int32_t *piExcitation1, - int32_t *piSMR0, - int32_t *piSMR1 ); - -#ifdef __cplusplus -} -#endif - -#endif /* _PERCEPTUAL_MODEL_H_ */ diff --git a/lib_rend/ivas_PredDecoder.c b/lib_rend/ivas_PredDecoder.c index 3bab1b9056..0105abedb5 100644 --- a/lib_rend/ivas_PredDecoder.c +++ b/lib_rend/ivas_PredDecoder.c @@ -38,7 +38,7 @@ #include #include "prot.h" #include "ivas_prot_rend.h" -#include "ivas_Tables.h" +#include "ivas_lcld_tables.h" #include "ivas_PredTables.h" #include "ivas_cldfb_codec_bitstream.h" #include "wmc_auto.h" diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index 56bbca0f73..e982cf7eed 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -36,7 +36,7 @@ #include #include #include -#include "ivas_Tables.h" +#include "ivas_lcld_tables.h" #include "ivas_PredTables.h" #include "prot.h" #include "ivas_prot_rend.h" diff --git a/lib_rend/ivas_RMSEnvDeltaHuff.c b/lib_rend/ivas_RMSEnvDeltaHuff.c deleted file mode 100644 index 0f613a8f47..0000000000 --- a/lib_rend/ivas_RMSEnvDeltaHuff.c +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 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 "ivas_RMSEnvDeltaHuff.h" -#include "ivas_prot_rend.h" -#include "wmc_auto.h" - -/* clang-format off */ -const uint32_t c_aaiRMSEnvHuffEnc[64][2] = -{ - {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0003}, {0x0013, 0x0004}, - {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0012, 0x000b}, {0x000d, 0x0002}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000d, 0x0003}, - {0x000b, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0008, 0x0005}, - {0x0008, 0x0006}, {0x0007, 0x0004}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0005, 0x0003}, {0x0004, 0x0002}, {0x0003, 0x0002}, {0x0002, 0x0002}, - {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x0009, 0x0008}, - {0x0009, 0x0009}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, - {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, -}; - -const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = -{ - {0x0002ffff, 0x0001ffff, 0x0000001d, 0x00000022, 0x0001001e, 0x0001001e, 0x00010021, 0x00010021, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000017, 0x00000018, 0x00000025, 0x00010019, 0x00010019, 0x00010024, 0x00010024, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x0009ffff, 0x0008ffff, 0x0000002c, 0x0000002d, 0x00010010, 0x00010010, 0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x000bffff, 0x000cffff, 0x000affff, 0x00000031, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, - {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, -}; -/* clang-format on */ diff --git a/lib_rend/ivas_RMSEnvDeltaHuff.h b/lib_rend/ivas_RMSEnvDeltaHuff.h deleted file mode 100644 index 25d2fc625e..0000000000 --- a/lib_rend/ivas_RMSEnvDeltaHuff.h +++ /dev/null @@ -1,57 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 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_RMS_ENV_DELTA_HUFF_H_ -#define _IVAS_RMS_ENV_DELTA_HUFF_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifndef HUFF_READ_SIZE -#define HUFF_READ_SIZE ( 4 ) -#endif - -#ifndef HUFF_DEC_TABLE_SIZE -#define HUFF_DEC_TABLE_SIZE ( 16 ) -#endif -#include - extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; - - extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; - -#ifdef __cplusplus -} -#endif - -#endif /* _RMS_ENV_DELTA_HUFF_H_ */ diff --git a/lib_rend/ivas_RMSEnvGrouping.c b/lib_rend/ivas_RMSEnvGrouping.c index 64dfe46c84..f5e18c3c1c 100644 --- a/lib_rend/ivas_RMSEnvGrouping.c +++ b/lib_rend/ivas_RMSEnvGrouping.c @@ -41,8 +41,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot_rend.h" -#include "ivas_Tables.h" -#include "ivas_RMSEnvDeltaHuff.h" // To compute RMS transmission cost +#include "ivas_lcld_tables.h" #include "wmc_auto.h" diff --git a/lib_rend/ivas_Tables.c b/lib_rend/ivas_Tables.c deleted file mode 100644 index 534aff5254..0000000000 --- a/lib_rend/ivas_Tables.c +++ /dev/null @@ -1,200 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 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 "ivas_Tables.h" -#include "options.h" -#ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_prot_rend.h" -#include "wmc_auto.h" - -/* clang-format off */ -const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL+1][2] = { - {1.0f, 0.0f}, /* zero */ - {0.0f, 1.0f}, /* pi/2 */ - {-1.0f, 0.0f}, /* pi */ - {0.0f, -1.0f}, /* 3*pi/2 */ -}; - -/* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ -const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = { - {-1.00000000f, -0.00000000f}, - {-0.96592583f, -0.25881905f}, - {-0.86602540f, -0.50000000f}, - {-0.70710678f, -0.70710678f}, - {-0.50000000f, -0.86602540f}, - {-0.25881905f, -0.96592583f}, - {0.00000000f, -1.00000000f}, - {0.25881905f, -0.96592583f}, - {0.50000000f, -0.86602540f}, - {0.70710678f, -0.70710678f}, - {0.86602540f, -0.50000000f}, - {0.96592583f, -0.25881905f}, - {1.00000000f, 0.00000000f}, - {0.96592583f, 0.25881905f}, - {0.86602540f, 0.50000000f}, - {0.70710678f, 0.70710678f}, - {0.50000000f, 0.86602540f}, - {0.25881905f, 0.96592583f}, - {0.00000000f, 1.00000000f}, - {-0.25881905f, 0.96592583f}, - {-0.50000000f, 0.86602540f}, - {-0.70710678f, 0.70710678f}, - {-0.86602540f, 0.50000000f}, - {-0.96592583f, 0.25881905f}, - {-1.00000000f, 0.00000000f} -}; - -/* Move this to perceptual model ? */ -const int32_t c_aiBandwidths48[MAX_BANDS_48] = { - 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, -}; - - -const float c_afScaleFactor[ALLOC_TABLE_SIZE] = { - 0.0f, - 0.353553390593f, - 0.420448207627f, - 0.500000000000f, - 0.594603557501f, - 0.707106781187f, - 0.840896415254f, - 1.000000000000f, - 1.189207115003f, - 1.414213562373f, - 1.681792830507f, - 2.000000000000f, - 2.378414230005f, - 2.828427124746f, - 3.363585661015f, - 4.0f, - 4.756828460011f, - 5.656854249492f, - 6.727171322030f, - 8.0f, - 9.513656920022f, - 11.31370849898f, - 13.45434264406f, - 16.00000000000f, - 19.02731384004f, - 22.62741699797f, - 26.90868528812f, - 32.000000000000000f, - 38.054627680087073f, - 45.254833995939038f, - 53.817370576237735f, - 64.000000000000000f, -}; - -const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { - 0.0f, - 2.367513562373095f, - 2.046407115002721f, - 1.775900000000000f, - 1.536446415253715f, - 1.323056781186548f, - 1.132903557501360f, - 0.965800000000000f, - 0.821348207626857f, - 0.695103390593274f, - 0.587801778750680f, - 0.495800000000000f, - 0.418124103813429f, - 0.352176695296637f, - 0.296200889375340f, - 0.249400000000000f, - 0.209812051906714f, - 0.176538347648318f, - 0.148525444687670f, - 0.124900000000000f, - 0.105056025953357f, - 0.088388347648318f, - 0.074325444687670f, - 0.062500000000000f, - 0.052556025953357f, - 0.044194173824159f, - 0.037162722343835f, - 0.031250000000000f, - 0.026278012976679f, - 0.022097086912080f, - 0.018581361171918f, - 0.015625000000000f, -}; - -const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { - 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, - 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, - 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, - 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, - 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, - 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, - 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, - 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, - 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, - 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, - 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, - 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, - 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, - 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, - 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, - 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, - 4.29496730e+09f, -}; - -const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { - 0, 3, 3, 4, 5, 5, 6, 7, - 8, 9, 12, 13, 16, 17, 19, 23, - 26, 26, 27, 28, 31, 36, 38, 45, - 54, 64, 76, 90, 108, 128, 152, 180, -}; - -const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, -}; - -const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { - 0, 4, 4, 5, 6, 6, 7, 8, - 9, 10, 13, 14, 17, 18, 20, 24, - 27, 27, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, -}; - -const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { - 1, 16, 16, 25, 36, 36, 49, 64, - 81, 100, 169, 196, 289, 324, 400, 576, - 729, 729, 28, 29, 32, 37, 39, 46, - 55, 65, 77, 91, 109, 129, 153, 181, -}; -#endif -/* clang-format on */ diff --git a/lib_rend/ivas_Tables.h b/lib_rend/ivas_Tables.h deleted file mode 100644 index 61abfb30c9..0000000000 --- a/lib_rend/ivas_Tables.h +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 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_TABLES_H_ -#define _IVAS_TABLES_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#ifndef M_PI - -#define M_PI 3.14159265358979323846264338327950288f - -#endif - -#define CQMF_BLOCKS_PER_FRAME ( 16 ) -#define CQMF_MAX_BLOCKS_PER_FRAME ( 16 ) -#define CQMF_BANDS ( 60 ) - -#define MAX_BANDS ( 23 ) -#define MAX_BANDS_48 ( 23 ) - - extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this - - -#define ENV_MIN ( -64 ) -#define ENV_MAX ( 64 ) - -#define ENV0_BITS ( 7 ) - -#define ENV_DELTA_MIN ( -32 ) -#define ENV_DELTA_MAX ( 31 ) - -#define ENV_RECONSTRUCT_TABLE_SIZE ( 129 ) - -#define ENV_RECONSTRUCT_TABLE_CENTER ( 64 ) - -#define MIN_ALLOC ( 0 ) -#define MAX_ALLOC ( 31 ) - -#define ALLOC_OFFSET_SCALE ( 8 ) - -#define ALLOC_OFFSET_BITS ( 8 ) - -#define MIN_ALLOC_OFFSET ( -128 ) -#define MAX_ALLOC_OFFSET ( 127 ) -#ifdef ROM_TO_RAM -#define READ_LENGTH ( 4 ) -#endif - -#define ALLOC_TABLE_SIZE ( 32 ) - -#ifndef _PI_ -#define _PI_ ( 3.14159265358979f ) -#endif -#define PRED_MAX_VAL ( 12 ) -#define PRED_MIN_VAL ( -PRED_MAX_VAL ) -#define PRED_QUANT_FACTOR ( (float) PRED_MAX_VAL ) -#define PRED_BAND0_BITS ( 5 ) - -#define PHASE_MAX_VAL ( 12 ) -#define PHASE_MIN_VAL ( -PHASE_MAX_VAL ) -#define PHASE_QUANT_FACTOR ( (float) PHASE_MAX_VAL / _PI_ ) -#define PHASE_DIFF_DIM ( 2 ) -#define PHASE_BAND0_BITS ( 5 ) - -#define SIMPLE_PHASE_MAX_VAL ( 3 ) -#define SIMPLE_PHASE_MIN_VAL ( 0 ) -#define SIMPLE_PHASE_BITS ( 2 ) -#define SIMPLE_PHASE_QUANT_FACTOR ( 2.0f / _PI_ ) - -#define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) -#define TON_QUOTA_INC_THRESHOLD ( 4.0f ) - - extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; - extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; - extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; - - extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; - - extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; - - extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; - - extern const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; - - extern const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE]; - - extern const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE]; - - extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; - -#ifdef __cplusplus -} -#endif - -#endif /* _TABLES_H_ */ diff --git a/lib_rend/ivas_CQMFHuff.c b/lib_rend/ivas_lcld_tables.c similarity index 96% rename from lib_rend/ivas_CQMFHuff.c rename to lib_rend/ivas_lcld_tables.c index a5344b9db1..7afb33a184 100644 --- a/lib_rend/ivas_CQMFHuff.c +++ b/lib_rend/ivas_lcld_tables.c @@ -30,14 +30,209 @@ *******************************************************************************************************/ -#include "ivas_CQMFHuff.h" +#include "ivas_lcld_tables.h" #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_prot_rend.h" #include "wmc_auto.h" +#include +#include "prot.h" /* clang-format off */ +const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2] = { + {1.0f, 0.0f}, /* zero */ + {0.0f, 1.0f}, /* pi/2 */ + {-1.0f, 0.0f}, /* pi */ + {0.0f, -1.0f}, /* 3*pi/2 */ +}; + +/* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ +const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = { + {-1.00000000f, -0.00000000f}, + {-0.96592583f, -0.25881905f}, + {-0.86602540f, -0.50000000f}, + {-0.70710678f, -0.70710678f}, + {-0.50000000f, -0.86602540f}, + {-0.25881905f, -0.96592583f}, + {0.00000000f, -1.00000000f}, + {0.25881905f, -0.96592583f}, + {0.50000000f, -0.86602540f}, + {0.70710678f, -0.70710678f}, + {0.86602540f, -0.50000000f}, + {0.96592583f, -0.25881905f}, + {1.00000000f, 0.00000000f}, + {0.96592583f, 0.25881905f}, + {0.86602540f, 0.50000000f}, + {0.70710678f, 0.70710678f}, + {0.50000000f, 0.86602540f}, + {0.25881905f, 0.96592583f}, + {0.00000000f, 1.00000000f}, + {-0.25881905f, 0.96592583f}, + {-0.50000000f, 0.86602540f}, + {-0.70710678f, 0.70710678f}, + {-0.86602540f, 0.50000000f}, + {-0.96592583f, 0.25881905f}, + {-1.00000000f, 0.00000000f} +}; + +/* Move this to perceptual model ? */ +const int32_t c_aiBandwidths48[MAX_BANDS_48] = { + 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, +}; + + +const float c_afScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 0.353553390593f, + 0.420448207627f, + 0.500000000000f, + 0.594603557501f, + 0.707106781187f, + 0.840896415254f, + 1.000000000000f, + 1.189207115003f, + 1.414213562373f, + 1.681792830507f, + 2.000000000000f, + 2.378414230005f, + 2.828427124746f, + 3.363585661015f, + 4.0f, + 4.756828460011f, + 5.656854249492f, + 6.727171322030f, + 8.0f, + 9.513656920022f, + 11.31370849898f, + 13.45434264406f, + 16.00000000000f, + 19.02731384004f, + 22.62741699797f, + 26.90868528812f, + 32.000000000000000f, + 38.054627680087073f, + 45.254833995939038f, + 53.817370576237735f, + 64.000000000000000f, +}; + +const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { + 0.0f, + 2.367513562373095f, + 2.046407115002721f, + 1.775900000000000f, + 1.536446415253715f, + 1.323056781186548f, + 1.132903557501360f, + 0.965800000000000f, + 0.821348207626857f, + 0.695103390593274f, + 0.587801778750680f, + 0.495800000000000f, + 0.418124103813429f, + 0.352176695296637f, + 0.296200889375340f, + 0.249400000000000f, + 0.209812051906714f, + 0.176538347648318f, + 0.148525444687670f, + 0.124900000000000f, + 0.105056025953357f, + 0.088388347648318f, + 0.074325444687670f, + 0.062500000000000f, + 0.052556025953357f, + 0.044194173824159f, + 0.037162722343835f, + 0.031250000000000f, + 0.026278012976679f, + 0.022097086912080f, + 0.018581361171918f, + 0.015625000000000f, +}; + +const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { + 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, + 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, + 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, + 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, + 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, + 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, + 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, + 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, + 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, + 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, + 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, + 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, + 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, + 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, + 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, + 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, + 4.29496730e+09f, +}; + +const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { + 0, 3, 3, 4, 5, 5, 6, 7, + 8, 9, 12, 13, 16, 17, 19, 23, + 26, 26, 27, 28, 31, 36, 38, 45, + 54, 64, 76, 90, 108, 128, 152, 180, +}; + +const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { + 0, 4, 4, 5, 6, 6, 7, 8, + 9, 10, 13, 14, 17, 18, 20, 24, + 27, 27, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { + 1, 16, 16, 25, 36, 36, 49, 64, + 81, 100, 169, 196, 289, 324, 400, 576, + 729, 729, 28, 29, 32, 37, 39, 46, + 55, 65, 77, 91, 109, 129, 153, 181, +}; + +const uint32_t c_aaiRMSEnvHuffEnc[64][2] = +{ + {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0003}, {0x0013, 0x0004}, + {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0012, 0x000b}, {0x000d, 0x0002}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000d, 0x0003}, + {0x000b, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0008, 0x0005}, + {0x0008, 0x0006}, {0x0007, 0x0004}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0005, 0x0003}, {0x0004, 0x0002}, {0x0003, 0x0002}, {0x0002, 0x0002}, + {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x0009, 0x0008}, + {0x0009, 0x0009}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, + {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, + {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, +}; + +const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = +{ + {0x0002ffff, 0x0001ffff, 0x0000001d, 0x00000022, 0x0001001e, 0x0001001e, 0x00010021, 0x00010021, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, + {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, + {0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000017, 0x00000018, 0x00000025, 0x00010019, 0x00010019, 0x00010024, 0x00010024, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, + {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, + {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, + {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, + {0x0009ffff, 0x0008ffff, 0x0000002c, 0x0000002d, 0x00010010, 0x00010010, 0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, + {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, + {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, + {0x000bffff, 0x000cffff, 0x000affff, 0x00000031, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, + {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, + {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, + {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, +}; + +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc1[16][2] = +#else +const uint16_t c_aauiCQMFHuffEnc1[16][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000b, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0006, 0x0001}, {0x0008, 0x0001}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, @@ -50,9 +245,13 @@ const uint32_t c_aauiCQMFHuffDec1[3][16] = {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc2[16][2] = +#else +const uint16_t c_aauiCQMFHuffEnc2[16][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000c, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000c, 0x0001}, {0x0006, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000b, 0x0003}, @@ -66,8 +265,11 @@ const uint32_t c_aauiCQMFHuffDec2[3][16] = {0x00000003, 0x00000007, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0001000f, 0x0001000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, }; #endif - +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc3[25][2] = +#else +const uint16_t c_aauiCQMFHuffEnc3[25][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0009, 0x0001}, @@ -91,7 +293,12 @@ const uint32_t c_aauiCQMFHuffDec3[10][16] = {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, }; #endif + +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc4[36][2] = +#else +const uint16_t c_aauiCQMFHuffEnc4[36][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0000}, {0x0010, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000e, 0x0006}, @@ -110,8 +317,13 @@ const uint32_t c_aauiCQMFHuffDec4[5][16] = {0x0000001f, 0x00000020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, {0x00000004, 0x00000005, 0x0000000a, 0x0000000b, 0x00000010, 0x00000011, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc5[36][2] = +#else +const uint16_t c_aauiCQMFHuffEnc5[36][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0008}, {0x0012, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000c, 0x0001}, @@ -135,8 +347,13 @@ const uint32_t c_aauiCQMFHuffDec5[10][16] = {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc6[49][2] = +#else +const uint16_t c_aauiCQMFHuffEnc6[49][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0003}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x0010, 0x0004}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, @@ -159,8 +376,13 @@ const uint32_t c_aauiCQMFHuffDec6[7][16] = {0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010024, 0x00010024, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, {0x00000005, 0x00000006, 0x0000000c, 0x0000000d, 0x00000013, 0x00000014, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000025, 0x00000026, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc7[64][2] = +#else +const uint16_t c_aauiCQMFHuffEnc7[64][2] = +#endif { {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0002}, {0x0015, 0x0000}, {0x0015, 0x0001}, {0x0015, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000f, 0x0003}, {0x0014, 0x0011}, {0x0015, 0x0003}, {0x0015, 0x0004}, @@ -201,9 +423,13 @@ const uint32_t c_aauiCQMFHuffDec7[25][16] = {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc8[81][2] = +#else +const uint16_t c_aauiCQMFHuffEnc8[81][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0002}, {0x0014, 0x0008}, {0x0017, 0x0000}, {0x0017, 0x0001}, {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0004}, {0x0015, 0x000d}, @@ -239,9 +465,13 @@ const uint32_t c_aauiCQMFHuffDec8[16][16] = {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc9[100][2] = +#else +const uint16_t c_aauiCQMFHuffEnc9[100][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000d, 0x0002}, {0x0011, 0x0004}, {0x0014, 0x000a}, {0x0017, 0x0000}, {0x0017, 0x0001}, {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0003}, {0x0010, 0x0004}, @@ -285,9 +515,13 @@ const uint32_t c_aauiCQMFHuffDec9[22][16] = {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc10[169][2] = +#else +const uint16_t c_aauiCQMFHuffEnc10[169][2] = +#endif { {0x0001, 0x0001}, {0x0004, 0x0002}, {0x0005, 0x0002}, {0x0007, 0x0002}, {0x000a, 0x0002}, {0x000e, 0x0004}, {0x0011, 0x0007}, {0x0013, 0x0012}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0004}, @@ -363,9 +597,13 @@ const uint32_t c_aauiCQMFHuffDec10[45][16] = {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc11[196][2] = +#else +const uint16_t c_aauiCQMFHuffEnc11[196][2] = +#endif { {0x0001, 0x0001}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x000f, 0x0005}, {0x0012, 0x000d}, {0x0014, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0004}, {0x0003, 0x0003}, @@ -449,9 +687,13 @@ const uint32_t c_aauiCQMFHuffDec11[50][16] = {0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, }, {0x000200be, 0x000200be, 0x000200be, 0x000200be, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc12[289][2] = +#else +const uint16_t c_aauiCQMFHuffEnc12[289][2] = +#endif { {0x0001, 0x0001}, {0x0004, 0x0004}, {0x0005, 0x0004}, {0x0007, 0x0004}, {0x0008, 0x0002}, {0x000b, 0x0004}, {0x000e, 0x0006}, {0x0010, 0x0009}, {0x0012, 0x0014}, {0x0013, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0016, 0x0005}, @@ -573,8 +815,13 @@ const uint32_t c_aauiCQMFHuffDec12[76][16] = {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002011a, 0x0002011a, 0x0002011a, 0x0002011a, }, {0x0002011b, 0x0002011b, 0x0002011b, 0x0002011b, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011e, 0x0002011e, 0x0002011e, 0x0002011e, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc13[324][2] = +#else +const uint16_t c_aauiCQMFHuffEnc13[324][2] = +#endif { {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0006, 0x0004}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x0007}, {0x000e, 0x000b}, {0x0010, 0x0011}, {0x0012, 0x002d}, {0x0015, 0x0000}, {0x0014, 0x0035}, {0x0015, 0x0001}, {0x0015, 0x0002}, {0x0015, 0x0003}, @@ -713,8 +960,13 @@ const uint32_t c_aauiCQMFHuffDec13[89][16] = {0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, }, {0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc14[400][2] = +#else +const uint16_t c_aauiCQMFHuffEnc14[400][2] = +#endif { {0x0005, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x0008}, {0x000d, 0x000c}, {0x000f, 0x0013}, {0x0010, 0x001b}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, @@ -825,8 +1077,13 @@ const uint32_t c_aauiCQMFHuffDec14[53][16] = {0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, }, {0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc15[576][2] = +#else +const uint16_t c_aauiCQMFHuffEnc15[576][2] = +#endif { {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0008}, {0x000b, 0x000b}, {0x000d, 0x000e}, {0x000e, 0x0011}, {0x000f, 0x001a}, {0x0012, 0x006e}, {0x0014, 0x0000}, {0x0013, 0x00cc}, {0x0014, 0x0001}, @@ -979,9 +1236,13 @@ const uint32_t c_aauiCQMFHuffDec15[73][16] = {0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, }, {0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc16[729][2] = +#else +const uint16_t c_aauiCQMFHuffEnc16[729][2] = +#endif { {0x0006, 0x000d}, {0x0005, 0x0010}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x000a}, {0x0009, 0x000b}, {0x000b, 0x000d}, {0x000c, 0x000e}, {0x000e, 0x0016}, {0x0010, 0x002d}, {0x0011, 0x0051}, {0x0012, 0x008c}, {0x0014, 0x0000}, @@ -1167,9 +1428,13 @@ const uint32_t c_aauiCQMFHuffDec16[85][16] = {0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x000002b6, 0x000002b7, 0x000002b8, 0x000002b9, 0x000002ba, 0x000002bb, 0x000002bc, 0x000002bd, 0x000002be, 0x000002bf, 0x000002c0, 0x000002c1, }, {0x000002c2, 0x000002c3, 0x000002c4, 0x000002c5, 0x000002c6, 0x000002c7, 0x000002c8, 0x000002c9, 0x000002ca, 0x000002cb, 0x000002cc, 0x000002cd, 0x000002ce, 0x000002cf, 0x000002d0, 0x000002d1, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc17[729][2] = +#else +const uint16_t c_aauiCQMFHuffEnc17[729][2] = +#endif { {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000e}, {0x0008, 0x000f}, {0x0009, 0x000f}, {0x000a, 0x000f}, {0x000c, 0x0011}, {0x000d, 0x0014}, {0x000e, 0x0017}, {0x0010, 0x002d}, {0x0011, 0x004c}, @@ -1363,9 +1628,13 @@ const uint32_t c_aauiCQMFHuffDec17[93][16] = {0x0000028e, 0x0000028f, 0x00000290, 0x00000291, 0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, }, {0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, 0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, }, }; -#endif +#endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc18[28][2] = +#else +const uint16_t c_aauiCQMFHuffEnc18[28][2] = +#endif { {0x0004, 0x0001}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, @@ -1384,8 +1653,13 @@ const uint32_t c_aauiCQMFHuffDec18[6][16] = {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc19[29][2] = +#else +const uint16_t c_aauiCQMFHuffEnc19[29][2] = +#endif { {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, @@ -1404,8 +1678,13 @@ const uint32_t c_aauiCQMFHuffDec19[6][16] = {0x0005ffff, 0x00000016, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc20[32][2] = +#else +const uint16_t c_aauiCQMFHuffEnc20[32][2] = +#endif { {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, @@ -1423,8 +1702,13 @@ const uint32_t c_aauiCQMFHuffDec20[6][16] = {0x0005ffff, 0x00000019, 0x00010018, 0x00010018, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, {0x0000001b, 0x0000001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc21[37][2] = +#else +const uint16_t c_aauiCQMFHuffEnc21[37][2] = +#endif { {0x0005, 0x0002}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0002}, @@ -1445,8 +1729,13 @@ const uint32_t c_aauiCQMFHuffDec21[7][16] = {0x0006ffff, 0x0000001e, 0x0001001d, 0x0001001d, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, {0x00000020, 0x00000021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc22[39][2] = +#else +const uint16_t c_aauiCQMFHuffEnc22[39][2] = +#endif { {0x0005, 0x0002}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, @@ -1469,8 +1758,13 @@ const uint32_t c_aauiCQMFHuffDec22[9][16] = {0x0008ffff, 0x00000025, 0x00010022, 0x00010022, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc23[46][2] = +#else +const uint16_t c_aauiCQMFHuffEnc23[46][2] = +#endif { {0x0005, 0x0003}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, @@ -1497,8 +1791,13 @@ const uint32_t c_aauiCQMFHuffDec23[12][16] = {0x000bffff, 0x0000002a, 0x00010029, 0x00010029, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc24[55][2] = +#else +const uint16_t c_aauiCQMFHuffEnc24[55][2] = +#endif { {0x0005, 0x0004}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, @@ -1531,8 +1830,13 @@ const uint32_t c_aauiCQMFHuffDec24[17][16] = {0x0010ffff, 0x00000032, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, {0x00010034, 0x00010034, 0x00010036, 0x00010036, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc25[65][2] = +#else +const uint16_t c_aauiCQMFHuffEnc25[65][2] = +#endif { {0x0005, 0x0005}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x0006}, {0x0004, 0x000f}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, @@ -1569,8 +1873,13 @@ const uint32_t c_aauiCQMFHuffDec25[19][16] = {0x0012ffff, 0x00000038, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010037, 0x00010037, 0x00010039, 0x00010039, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc26[77][2] = +#else +const uint16_t c_aauiCQMFHuffEnc26[77][2] = +#endif { {0x0006, 0x0004}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, @@ -1615,8 +1924,13 @@ const uint32_t c_aauiCQMFHuffDec26[26][16] = {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc27[91][2] = +#else +const uint16_t c_aauiCQMFHuffEnc27[91][2] = +#endif { {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, @@ -1665,8 +1979,13 @@ const uint32_t c_aauiCQMFHuffDec27[28][16] = {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc28[109][2] = +#else +const uint16_t c_aauiCQMFHuffEnc28[109][2] = +#endif { {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, @@ -1719,8 +2038,13 @@ const uint32_t c_aauiCQMFHuffDec28[30][16] = {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc29[129][2] = +#else +const uint16_t c_aauiCQMFHuffEnc29[129][2] = +#endif { {0x0006, 0x0009}, {0x0005, 0x0019}, {0x0006, 0x000a}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0006, 0x000b}, {0x0005, 0x001d}, {0x0005, 0x001e}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0005, 0x001f}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, @@ -1780,8 +2104,13 @@ const uint32_t c_aauiCQMFHuffDec29[34][16] = {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc30[153][2] = +#else +const uint16_t c_aauiCQMFHuffEnc30[153][2] = +#endif { {0x0007, 0x0009}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, @@ -1849,8 +2178,13 @@ const uint32_t c_aauiCQMFHuffDec30[39][16] = {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, }, {0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc31[181][2] = +#else +const uint16_t c_aauiCQMFHuffEnc31[181][2] = +#endif { {0x0007, 0x000b}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, {0x0006, 0x0023}, @@ -1925,8 +2259,13 @@ const uint32_t c_aauiCQMFHuffDec31[43][16] = {0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, }, {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc33[16][2] = +#else +const uint16_t c_aauiCQMFHuffEnc33[16][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, @@ -1938,8 +2277,13 @@ const uint32_t c_aauiCQMFHuffDec33[2][16] = {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc34[16][2] = +#else +const uint16_t c_aauiCQMFHuffEnc34[16][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, @@ -1951,8 +2295,13 @@ const uint32_t c_aauiCQMFHuffDec34[2][16] = {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc35[25][2] = +#else +const uint16_t c_aauiCQMFHuffEnc35[25][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0007, 0x0006}, {0x0009, 0x0000}, {0x0009, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0007, 0x0007}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, @@ -1974,8 +2323,13 @@ const uint32_t c_aauiCQMFHuffDec35[9][16] = {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc36[36][2] = +#else +const uint16_t c_aauiCQMFHuffEnc36[36][2] = +#endif { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0000}, {0x000b, 0x0001}, {0x000b, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0003}, {0x000b, 0x0006}, {0x000b, 0x0007}, @@ -1996,8 +2350,13 @@ const uint32_t c_aauiCQMFHuffDec36[7][16] = {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, }, {0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc37[36][2] = +#else +const uint16_t c_aauiCQMFHuffEnc37[36][2] = +#endif { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0006, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x000a, 0x0007}, {0x000c, 0x0006}, @@ -2015,8 +2374,13 @@ const uint32_t c_aauiCQMFHuffDec37[4][16] = {0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00010023, 0x00010023, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, {0x00000003, 0x00000004, 0x00000005, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc38[49][2] = +#else +const uint16_t c_aauiCQMFHuffEnc38[49][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0012}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x000d, 0x0002}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x000a}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, @@ -2054,8 +2418,13 @@ const uint32_t c_aauiCQMFHuffDec38[22][16] = {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc39[64][2] = +#else +const uint16_t c_aauiCQMFHuffEnc39[64][2] = +#endif { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x000f, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, {0x000f, 0x0007}, @@ -2083,8 +2452,13 @@ const uint32_t c_aauiCQMFHuffDec39[12][16] = {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc40[81][2] = +#else +const uint16_t c_aauiCQMFHuffEnc40[81][2] = +#endif { {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x0011}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x000e, 0x0009}, {0x0011, 0x0004}, {0x0011, 0x0005}, @@ -2099,6 +2473,7 @@ const uint32_t c_aauiCQMFHuffEnc40[81][2] = {0x0010, 0x0021}, }; + #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec40[36][16] = { @@ -2139,8 +2514,13 @@ const uint32_t c_aauiCQMFHuffDec40[36][16] = {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc41[100][2] = +#else +const uint16_t c_aauiCQMFHuffEnc41[100][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0014}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x000b}, {0x0013, 0x0005}, @@ -2178,8 +2558,13 @@ const uint32_t c_aauiCQMFHuffDec41[16][16] = {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc42[169][2] = +#else +const uint16_t c_aauiCQMFHuffEnc42[169][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000e, 0x0006}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, @@ -2238,8 +2623,13 @@ const uint32_t c_aauiCQMFHuffDec42[28][16] = {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, }, {0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc43[196][2] = +#else +const uint16_t c_aauiCQMFHuffEnc43[196][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x0010, 0x0017}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, @@ -2305,8 +2695,13 @@ const uint32_t c_aauiCQMFHuffDec43[32][16] = {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc44[289][2] = +#else +const uint16_t c_aauiCQMFHuffEnc44[289][2] = +#endif { {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0002}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000a}, {0x0011, 0x0022}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, @@ -2379,8 +2774,13 @@ const uint32_t c_aauiCQMFHuffDec44[27][16] = {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc45[324][2] = +#else +const uint16_t c_aauiCQMFHuffEnc45[324][2] = +#endif { {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x0010, 0x0025}, {0x0012, 0x0088}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, @@ -2480,8 +2880,13 @@ const uint32_t c_aauiCQMFHuffDec45[50][16] = {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc46[400][2] = +#else +const uint16_t c_aauiCQMFHuffEnc46[400][2] = +#endif { {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0004}, {0x0009, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x000a}, {0x000f, 0x0018}, {0x0012, 0x00a6}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, @@ -2600,8 +3005,13 @@ const uint32_t c_aauiCQMFHuffDec46[61][16] = {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc47[576][2] = +#else +const uint16_t c_aauiCQMFHuffEnc47[576][2] = +#endif { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0005}, {0x0006, 0x0004}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000b}, {0x000d, 0x000d}, {0x0010, 0x0041}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, @@ -2768,8 +3178,13 @@ const uint32_t c_aauiCQMFHuffDec47[87][16] = {0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, }, {0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc48[729][2] = +#else +const uint16_t c_aauiCQMFHuffEnc48[729][2] = +#endif { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0006}, {0x0006, 0x0006}, {0x0008, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x000b}, {0x000c, 0x000d}, {0x000f, 0x0030}, {0x0010, 0x0055}, {0x0012, 0x0136}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, @@ -2980,8 +3395,13 @@ const uint32_t c_aauiCQMFHuffDec48[110][16] = {0x000102c4, 0x000102c4, 0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, }, {0x000102cc, 0x000102cc, 0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, }, }; + #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc49[729][2] = +#else +const uint16_t c_aauiCQMFHuffEnc49[729][2] = +#endif { {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0007}, {0x0007, 0x000a}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0009, 0x0009}, {0x000b, 0x000d}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x0010, 0x0052}, {0x0011, 0x0098}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, @@ -3077,7 +3497,6 @@ const uint32_t c_aauiCQMFHuffEnc49[729][2] = {0x0013, 0x0253}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec49[113][16] = { @@ -3196,7 +3615,11 @@ const uint32_t c_aauiCQMFHuffDec49[113][16] = {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc50[28][2] = +#else +const uint16_t c_aauiCQMFHuffEnc50[28][2] = +#endif { {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, @@ -3204,7 +3627,6 @@ const uint32_t c_aauiCQMFHuffEnc50[28][2] = {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec50[6][16] = { @@ -3216,7 +3638,11 @@ const uint32_t c_aauiCQMFHuffDec50[6][16] = {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc51[29][2] = +#else +const uint16_t c_aauiCQMFHuffEnc51[29][2] = +#endif { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, @@ -3224,7 +3650,6 @@ const uint32_t c_aauiCQMFHuffEnc51[29][2] = {0x0013, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec51[6][16] = { @@ -3236,14 +3661,17 @@ const uint32_t c_aauiCQMFHuffDec51[6][16] = {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc52[32][2] = +#else +const uint16_t c_aauiCQMFHuffEnc52[32][2] = +#endif { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0014, 0x0000}, {0x0013, 0x0003}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0004}, {0x0013, 0x0005}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec52[7][16] = { @@ -3256,7 +3684,11 @@ const uint32_t c_aauiCQMFHuffDec52[7][16] = {0x00000017, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc53[37][2] = +#else +const uint16_t c_aauiCQMFHuffEnc53[37][2] = +#endif { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000b, 0x0002}, @@ -3265,7 +3697,6 @@ const uint32_t c_aauiCQMFHuffEnc53[37][2] = {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec53[9][16] = { @@ -3280,7 +3711,11 @@ const uint32_t c_aauiCQMFHuffDec53[9][16] = {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc54[39][2] = +#else +const uint16_t c_aauiCQMFHuffEnc54[39][2] = +#endif { {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0008, 0x0002}, @@ -3289,7 +3724,6 @@ const uint32_t c_aauiCQMFHuffEnc54[39][2] = {0x0011, 0x0003}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec54[9][16] = { @@ -3304,7 +3738,11 @@ const uint32_t c_aauiCQMFHuffDec54[9][16] = {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc55[46][2] = +#else +const uint16_t c_aauiCQMFHuffEnc55[46][2] = +#endif { {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0007, 0x0004}, @@ -3314,7 +3752,6 @@ const uint32_t c_aauiCQMFHuffEnc55[46][2] = {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec55[10][16] = { @@ -3330,7 +3767,11 @@ const uint32_t c_aauiCQMFHuffDec55[10][16] = {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc56[55][2] = +#else +const uint16_t c_aauiCQMFHuffEnc56[55][2] = +#endif { {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0003}, {0x0007, 0x0004}, @@ -3341,7 +3782,6 @@ const uint32_t c_aauiCQMFHuffEnc56[55][2] = {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec56[12][16] = { @@ -3359,7 +3799,11 @@ const uint32_t c_aauiCQMFHuffDec56[12][16] = {0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc57[65][2] = +#else +const uint16_t c_aauiCQMFHuffEnc57[65][2] = +#endif { {0x0003, 0x0004}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, @@ -3372,7 +3816,6 @@ const uint32_t c_aauiCQMFHuffEnc57[65][2] = {0x0013, 0x000d}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec57[14][16] = { @@ -3392,7 +3835,11 @@ const uint32_t c_aauiCQMFHuffDec57[14][16] = {0x0001002f, 0x0001002f, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc58[77][2] = +#else +const uint16_t c_aauiCQMFHuffEnc58[77][2] = +#endif { {0x0004, 0x0005}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, @@ -3406,7 +3853,6 @@ const uint32_t c_aauiCQMFHuffEnc58[77][2] = {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec58[17][16] = { @@ -3429,7 +3875,11 @@ const uint32_t c_aauiCQMFHuffDec58[17][16] = {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc59[91][2] = +#else +const uint16_t c_aauiCQMFHuffEnc59[91][2] = +#endif { {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, @@ -3445,7 +3895,6 @@ const uint32_t c_aauiCQMFHuffEnc59[91][2] = {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0012, 0x000f}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec59[20][16] = { @@ -3471,7 +3920,11 @@ const uint32_t c_aauiCQMFHuffDec59[20][16] = {0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc60[109][2] = +#else +const uint16_t c_aauiCQMFHuffEnc60[109][2] = +#endif { {0x0004, 0x0007}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, @@ -3489,7 +3942,6 @@ const uint32_t c_aauiCQMFHuffEnc60[109][2] = {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0012, 0x0013}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec60[24][16] = { @@ -3519,7 +3971,11 @@ const uint32_t c_aauiCQMFHuffDec60[24][16] = {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc61[129][2] = +#else +const uint16_t c_aauiCQMFHuffEnc61[129][2] = +#endif { {0x0004, 0x0008}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x0008}, {0x0006, 0x0009}, @@ -3540,7 +3996,6 @@ const uint32_t c_aauiCQMFHuffEnc61[129][2] = {0x0012, 0x0029}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec61[33][16] = { @@ -3579,7 +4034,11 @@ const uint32_t c_aauiCQMFHuffDec61[33][16] = {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc62[153][2] = +#else +const uint16_t c_aauiCQMFHuffEnc62[153][2] = +#endif { {0x0004, 0x0009}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, @@ -3603,7 +4062,6 @@ const uint32_t c_aauiCQMFHuffEnc62[153][2] = {0x0011, 0x001d}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec62[41][16] = { @@ -3650,7 +4108,11 @@ const uint32_t c_aauiCQMFHuffDec62[41][16] = {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, }; #endif +#ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffEnc63[181][2] = +#else +const uint16_t c_aauiCQMFHuffEnc63[181][2] = +#endif { {0x0004, 0x0008}, {0x0003, 0x0005}, {0x0002, 0x0003}, {0x0004, 0x0009}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, @@ -3677,7 +4139,6 @@ const uint32_t c_aauiCQMFHuffEnc63[181][2] = {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, }; - #ifndef ROM_TO_RAM const uint32_t c_aauiCQMFHuffDec63[39][16] = { @@ -3722,74 +4183,80 @@ const uint32_t c_aauiCQMFHuffDec63[39][16] = {0x00000075, 0x00000079, 0x0000007f, 0x00000081, 0x00000082, 0x00000083, 0x00000085, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, }, }; #endif -const uint32_t (*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = { - NULL, - c_aauiCQMFHuffEnc1, - c_aauiCQMFHuffEnc2, - c_aauiCQMFHuffEnc3, - c_aauiCQMFHuffEnc4, - c_aauiCQMFHuffEnc5, - c_aauiCQMFHuffEnc6, - c_aauiCQMFHuffEnc7, - c_aauiCQMFHuffEnc8, - c_aauiCQMFHuffEnc9, - c_aauiCQMFHuffEnc10, - c_aauiCQMFHuffEnc11, - c_aauiCQMFHuffEnc12, - c_aauiCQMFHuffEnc13, - c_aauiCQMFHuffEnc14, - c_aauiCQMFHuffEnc15, - c_aauiCQMFHuffEnc16, - c_aauiCQMFHuffEnc17, - c_aauiCQMFHuffEnc18, - c_aauiCQMFHuffEnc19, - c_aauiCQMFHuffEnc20, - c_aauiCQMFHuffEnc21, - c_aauiCQMFHuffEnc22, - c_aauiCQMFHuffEnc23, - c_aauiCQMFHuffEnc24, - c_aauiCQMFHuffEnc25, - c_aauiCQMFHuffEnc26, - c_aauiCQMFHuffEnc27, - c_aauiCQMFHuffEnc28, - c_aauiCQMFHuffEnc29, - c_aauiCQMFHuffEnc30, - c_aauiCQMFHuffEnc31, - NULL, - c_aauiCQMFHuffEnc33, - c_aauiCQMFHuffEnc34, - c_aauiCQMFHuffEnc35, - c_aauiCQMFHuffEnc36, - c_aauiCQMFHuffEnc37, - c_aauiCQMFHuffEnc38, - c_aauiCQMFHuffEnc39, - c_aauiCQMFHuffEnc40, - c_aauiCQMFHuffEnc41, - c_aauiCQMFHuffEnc42, - c_aauiCQMFHuffEnc43, - c_aauiCQMFHuffEnc44, - c_aauiCQMFHuffEnc45, - c_aauiCQMFHuffEnc46, - c_aauiCQMFHuffEnc47, - c_aauiCQMFHuffEnc48, - c_aauiCQMFHuffEnc49, - c_aauiCQMFHuffEnc50, - c_aauiCQMFHuffEnc51, - c_aauiCQMFHuffEnc52, - c_aauiCQMFHuffEnc53, - c_aauiCQMFHuffEnc54, - c_aauiCQMFHuffEnc55, - c_aauiCQMFHuffEnc56, - c_aauiCQMFHuffEnc57, - c_aauiCQMFHuffEnc58, - c_aauiCQMFHuffEnc59, - c_aauiCQMFHuffEnc60, - c_aauiCQMFHuffEnc61, - c_aauiCQMFHuffEnc62, - c_aauiCQMFHuffEnc63, + +#ifndef ROM_TO_RAM +const uint32_t(*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = +#else +const uint16_t(*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = +#endif +{ + NULL, + c_aauiCQMFHuffEnc1, + c_aauiCQMFHuffEnc2, + c_aauiCQMFHuffEnc3, + c_aauiCQMFHuffEnc4, + c_aauiCQMFHuffEnc5, + c_aauiCQMFHuffEnc6, + c_aauiCQMFHuffEnc7, + c_aauiCQMFHuffEnc8, + c_aauiCQMFHuffEnc9, + c_aauiCQMFHuffEnc10, + c_aauiCQMFHuffEnc11, + c_aauiCQMFHuffEnc12, + c_aauiCQMFHuffEnc13, + c_aauiCQMFHuffEnc14, + c_aauiCQMFHuffEnc15, + c_aauiCQMFHuffEnc16, + c_aauiCQMFHuffEnc17, + c_aauiCQMFHuffEnc18, + c_aauiCQMFHuffEnc19, + c_aauiCQMFHuffEnc20, + c_aauiCQMFHuffEnc21, + c_aauiCQMFHuffEnc22, + c_aauiCQMFHuffEnc23, + c_aauiCQMFHuffEnc24, + c_aauiCQMFHuffEnc25, + c_aauiCQMFHuffEnc26, + c_aauiCQMFHuffEnc27, + c_aauiCQMFHuffEnc28, + c_aauiCQMFHuffEnc29, + c_aauiCQMFHuffEnc30, + c_aauiCQMFHuffEnc31, + NULL, + c_aauiCQMFHuffEnc33, + c_aauiCQMFHuffEnc34, + c_aauiCQMFHuffEnc35, + c_aauiCQMFHuffEnc36, + c_aauiCQMFHuffEnc37, + c_aauiCQMFHuffEnc38, + c_aauiCQMFHuffEnc39, + c_aauiCQMFHuffEnc40, + c_aauiCQMFHuffEnc41, + c_aauiCQMFHuffEnc42, + c_aauiCQMFHuffEnc43, + c_aauiCQMFHuffEnc44, + c_aauiCQMFHuffEnc45, + c_aauiCQMFHuffEnc46, + c_aauiCQMFHuffEnc47, + c_aauiCQMFHuffEnc48, + c_aauiCQMFHuffEnc49, + c_aauiCQMFHuffEnc50, + c_aauiCQMFHuffEnc51, + c_aauiCQMFHuffEnc52, + c_aauiCQMFHuffEnc53, + c_aauiCQMFHuffEnc54, + c_aauiCQMFHuffEnc55, + c_aauiCQMFHuffEnc56, + c_aauiCQMFHuffEnc57, + c_aauiCQMFHuffEnc58, + c_aauiCQMFHuffEnc59, + c_aauiCQMFHuffEnc60, + c_aauiCQMFHuffEnc61, + c_aauiCQMFHuffEnc62, + c_aauiCQMFHuffEnc63, }; #ifndef ROM_TO_RAM -const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] = { +const uint32_t(*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] = { NULL, c_aauiCQMFHuffDec1, c_aauiCQMFHuffDec2, @@ -3857,7 +4324,7 @@ const uint32_t (*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE }; #else const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE] = -{ 0, 16, 16, 25, 36, 36, 49, 64, 81, 100, +{ 0, 16, 16, 25, 36, 36, 49, 64, 81, 100, 169, 196, 289, 324, 400, 576, 729, 729, 28, 29, 32, 37, 39, 46, 55, 65, 77, 91, 109, 129, 153, 181, 0, 16, 16, 25, 36, 36, 49, 64, 81, @@ -4145,7 +4612,7 @@ const int32_t c_aaiHuffDemod17[729][2] = { 14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,14,20,14,21, 14,22,14,23,14,24,14,25,14,26,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10, 15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23,15,24,15,25,15,26, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, + 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,17,0,17,1,17,2,17,3,17,4, 17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20, 17,21,17,22,17,23,17,24,17,25,17,26,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9, @@ -4165,9 +4632,8 @@ const int32_t c_aaiHuffDemod17[729][2] = { 26,2,26,3,26,4,26,5,26,6,26,7,26,8,26,9,26,10,26,11,26,12,26,13,26,14,26,15,26,16,26,17, 26,18,26,19,26,20,26,21,26,22,26,23,26,24,26,25,26,26, }; -}; -const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { +const int32_t(*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { NULL, c_aaiHuffDemod1, c_aaiHuffDemod2, @@ -4201,8 +4667,98 @@ const int32_t (*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { NULL, NULL, }; +#endif +const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { + 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D, 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39, + 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, + 0x31, 0x31, 0x31, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2B, + 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x29, 0x29, 0x29, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26, 0x26, + 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23, 0x23, 0x23, 0x23, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21, + 0x20, 0x20, 0x20, 0x20, 0x1F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1D, 0x1D, 0x1D, 0x1C, 0x1C, + 0x1C, 0x1C, 0x1B, 0x1B, 0x1B, 0x1B, 0x1A, 0x1A, 0x1A, 0x1A, 0x19, 0x19, 0x19, 0x19, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x17, 0x16, 0x16, 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x15, + 0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, + 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0F, 0x0F, 0x0F, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x09, 0x09, + 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48] = { + 0,0,0,0,0,0,0,0,0,0,0,64,64,64,64,64, + 101,101,128,165,165,180,213, }; + +const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48] = { + -1787,-1787,-1787,-1787,-1787,-1787,-1787,-1787,-1782,-1761,-1737,-1679,-1638,-1613,-1590,-1568, + -1516,-1459,-1395,-1289,-671,-409,-401, }; + + +#if PERCEPTUAL_MODEL_SLGAIN_SHIFT == 4 +const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { + 7,7,6,5,5,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4, +}; +#elif PERCEPTUAL_MODEL_SLGAIN_SHIFT == 8 +const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { + 112,112,96,80,80,64,64,64,64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64, +}; #endif +const int32_t c_aaiSpreadFunction48[MAX_BANDS_48*MAX_BANDS_48] = { + 0,-1561,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-289,-4,-1234,-2295,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-569,-229, + -8,-905,-1705,-2324,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-789,-445,-173,-16,-656,-1271,-1765,-2172,-2520,-2552,-2552, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-961,-616,-340,-136, + -28,-488,-976,-1382,-1729,-2032,-2305,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-2552,-2552,-1088,-743,-465,-257,-148,-31,-371,-769,-1114,-1417,-1689,-2054,-2483, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1198,-852,-574,-364,-209,-148, + -42,-300,-635,-936,-1207,-1572,-2000,-2376,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, + -2552,-1293,-948,-669,-458,-301,-183,-145,-56,-258,-547,-816,-1179,-1606,-1982,-2311, + -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1375,-1029,-750,-539,-381,-260,-180,-142, + -68,-231,-487,-846,-1272,-1647,-1976,-2261,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1444, + -1099,-820,-608,-449,-328,-233,-194,-138,-77,-213,-555,-978,-1352,-1681,-1966,-2268, + -2552,-2552,-2552,-2552,-2552,-2552,-1501,-1155,-876,-665,-505,-383,-287,-210,-193,-130, + -79,-298,-711,-1083,-1411,-1696,-1997,-2288,-2550,-2552,-2552,-2552,-2552,-1567,-1221,-942, + -730,-570,-448,-351,-272,-206,-189,-151,-72,-349,-713,-1039,-1324,-1625,-1915,-2177, + -2448,-2552,-2552,-2552,-1650,-1304,-1025,-813,-653,-530,-432,-352,-285,-227,-177,-163, + -69,-297,-613,-895,-1195,-1485,-1746,-2017,-2238,-2401,-2545,-1727,-1381,-1102,-890,-730, + -607,-509,-428,-360,-301,-249,-180,-153,-72,-257,-527,-824,-1112,-1373,-1643,-1865, + -2028,-2171,-1798,-1452,-1173,-960,-800,-677,-579,-498,-430,-370,-317,-246,-192,-145, + -76,-224,-505,-790,-1050,-1320,-1540,-1703,-1847,-1860,-1514,-1234,-1022,-862,-738,-640, + -559,-490,-430,-377,-306,-224,-197,-136,-81,-242,-515,-771,-1040,-1260,-1422,-1566, + -1923,-1577,-1297,-1085,-925,-801,-703,-621,-553,-492,-439,-367,-284,-213,-198,-144, + -83,-235,-479,-744,-963,-1125,-1268,-1986,-1640,-1360,-1148,-988,-864,-766,-684,-615, + -555,-501,-429,-345,-273,-211,-204,-146,-89,-216,-465,-680,-841,-984,-2043,-1697, + -1417,-1205,-1044,-921,-822,-741,-672,-611,-557,-485,-401,-328,-264,-211,-205,-140, + -93,-227,-430,-588,-729,-2104,-1758,-1479,-1266,-1106,-982,-884,-802,-733,-673,-619, + -546,-461,-388,-324,-269,-212,-211,-151,-100,-195,-336,-472,-2163,-1817,-1537,-1324, + -1164,-1040,-942,-860,-791,-731,-676,-604,-519,-445,-380,-325,-268,-226,-219,-147, + -114,-167,-280,-2203,-1857,-1577,-1365,-1205,-1081,-982,-901,-831,-771,-717,-644,-559, + -485,-420,-364,-306,-252,-239,-206,-132,-122,-163,-2224,-1878,-1598,-1386,-1225,-1102, + -1003,-921,-852,-792,-737,-665,-580,-505,-441,-385,-326,-271,-222,-224,-176,-121,-114, +}; #endif -/* clang-format on */ + diff --git a/lib_rend/ivas_CQMFHuff.h b/lib_rend/ivas_lcld_tables.h similarity index 60% rename from lib_rend/ivas_CQMFHuff.h rename to lib_rend/ivas_lcld_tables.h index a4c28a3bac..ad2a836f49 100644 --- a/lib_rend/ivas_CQMFHuff.h +++ b/lib_rend/ivas_lcld_tables.h @@ -29,19 +29,97 @@ the United Nations Convention on Contracts on the International Sales of Goods. *******************************************************************************************************/ - -#ifndef _IVAS_CQMF_HUFF_H_ -#define _IVAS_CQMF_HUFF_H_ +#ifndef _IVAS_TABLES_H_ +#define _IVAS_TABLES_H_ #ifdef __cplusplus extern "C" { #endif - -#include "options.h" -#include "ivas_Tables.h" -#include // For NULL #include +#include // For NULL +#include "options.h" + +#ifndef M_PI + +#define M_PI 3.14159265358979323846264338327950288f + +#endif + +#define CQMF_BLOCKS_PER_FRAME ( 16 ) +#define CQMF_MAX_BLOCKS_PER_FRAME ( 16 ) +#define CQMF_BANDS ( 60 ) + +#define MAX_BANDS ( 23 ) +#define MAX_BANDS_48 ( 23 ) + + extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this + + +#define ENV_MIN ( -64 ) +#define ENV_MAX ( 64 ) + +#define ENV0_BITS ( 7 ) + +#define ENV_DELTA_MIN ( -32 ) +#define ENV_DELTA_MAX ( 31 ) + +#define ENV_RECONSTRUCT_TABLE_SIZE ( 129 ) + +#define ENV_RECONSTRUCT_TABLE_CENTER ( 64 ) + +#define MIN_ALLOC ( 0 ) +#define MAX_ALLOC ( 31 ) + +#define ALLOC_OFFSET_SCALE ( 8 ) + +#define ALLOC_OFFSET_BITS ( 8 ) + +#define MIN_ALLOC_OFFSET ( -128 ) +#define MAX_ALLOC_OFFSET ( 127 ) +#ifdef ROM_TO_RAM +#define READ_LENGTH ( 4 ) +#endif + +#define ALLOC_TABLE_SIZE ( 32 ) + +#ifndef _PI_ +#define _PI_ ( 3.14159265358979f ) +#endif +#define PRED_MAX_VAL ( 12 ) +#define PRED_MIN_VAL ( -PRED_MAX_VAL ) +#define PRED_QUANT_FACTOR ( (float) PRED_MAX_VAL ) +#define PRED_BAND0_BITS ( 5 ) + +#define PHASE_MAX_VAL ( 12 ) +#define PHASE_MIN_VAL ( -PHASE_MAX_VAL ) +#define PHASE_QUANT_FACTOR ( (float) PHASE_MAX_VAL / _PI_ ) +#define PHASE_DIFF_DIM ( 2 ) +#define PHASE_BAND0_BITS ( 5 ) + +#define SIMPLE_PHASE_MAX_VAL ( 3 ) +#define SIMPLE_PHASE_MIN_VAL ( 0 ) +#define SIMPLE_PHASE_BITS ( 2 ) +#define SIMPLE_PHASE_QUANT_FACTOR ( 2.0f / _PI_ ) + +#define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) +#define TON_QUOTA_INC_THRESHOLD ( 4.0f ) + +#define LOG_ADD_TABLE_LENGTH ( 512 ) + +#define PERCEPTUAL_MODEL_SCALE ( 64 ) + +#define PERCEPTUAL_MODEL_SCALE_SHIFT ( 6 ) + +#define PERCEPTUAL_MODEL_ALPHA_SCALE ( 614 ) + +#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE ( 6827 ) + +#define PERCEPTUAL_MODEL_ALPHA_SHIFT ( 11 ) + +#define PERCEPTUAL_MODEL_SLGAIN_SHIFT ( 8 ) //(4) + +#define MAX_BANDS_48 ( 23 ) //#define USE_DEMOD_TABLES @@ -53,383 +131,410 @@ extern "C" #define HUFF_DEC_TABLE_SIZE ( 16 ) #endif + extern const float c_afRotRealImag[PRED_MAX_VAL - PRED_MIN_VAL + 1][2]; + extern const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2]; + extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; - extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; + extern const float c_afScaleFactor[ALLOC_TABLE_SIZE]; + + extern const float c_afInvScaleFactor[ALLOC_TABLE_SIZE]; + + extern const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE]; + + extern const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; + + extern const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH]; + extern const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48]; + extern const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48]; + extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; + extern const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48]; #ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; + + extern const uint32_t c_aauiCQMFHuffDec1[3][16]; -#endif + extern const uint32_t c_aauiCQMFHuffEnc2[16][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec2[3][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc3[25][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec3[10][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc4[36][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec4[5][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc5[36][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec5[10][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc6[49][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec6[7][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc7[64][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec7[25][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc8[81][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec8[16][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc9[100][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec9[22][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc10[169][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec10[45][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc11[196][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec11[50][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc12[289][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec12[76][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc13[324][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec13[89][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc14[400][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec14[53][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc15[576][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec15[73][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc16[729][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec16[85][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc17[729][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec17[93][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc18[28][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec18[6][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc19[29][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec19[6][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc20[32][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec20[6][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc21[37][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec21[7][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc22[39][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec22[9][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc23[46][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec23[12][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc24[55][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec24[17][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc25[65][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec25[19][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc26[77][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec26[26][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc27[91][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec27[28][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc28[109][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec28[30][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc29[129][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec29[34][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc30[153][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec30[39][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc31[181][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec31[43][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc33[16][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec33[2][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc34[16][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec34[2][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc35[25][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec35[9][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc36[36][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec36[7][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc37[36][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec37[4][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc38[49][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec38[22][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc39[64][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec39[12][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc40[81][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec40[36][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc41[100][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec41[16][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc42[169][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec42[28][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc43[196][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec43[32][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc44[289][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec44[27][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc45[324][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec45[50][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc46[400][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec46[61][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc47[576][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec47[87][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc48[729][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec48[110][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc49[729][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec49[113][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc50[28][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec50[6][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc51[29][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec51[6][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc52[32][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec52[7][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc53[37][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec53[9][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc54[39][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec54[9][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc55[46][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec55[10][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc56[55][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec56[12][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc57[65][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec57[14][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc58[77][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec58[17][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc59[91][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec59[20][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc60[109][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec60[24][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc61[129][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec61[33][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc62[153][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec62[41][16]; -#endif extern const uint32_t c_aauiCQMFHuffEnc63[181][2]; -#ifndef ROM_TO_RAM + extern const uint32_t c_aauiCQMFHuffDec63[39][16]; -#endif + extern const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; -#ifndef ROM_TO_RAM + extern const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE]; #else +extern const uint16_t c_aauiCQMFHuffEnc1[16][2]; +extern const uint16_t c_aauiCQMFHuffEnc2[16][2]; +extern const uint16_t c_aauiCQMFHuffEnc3[25][2]; +extern const uint16_t c_aauiCQMFHuffEnc4[36][2]; +extern const uint16_t c_aauiCQMFHuffEnc5[36][2]; +extern const uint16_t c_aauiCQMFHuffEnc6[49][2]; +extern const uint16_t c_aauiCQMFHuffEnc7[64][2]; +extern const uint16_t c_aauiCQMFHuffEnc8[81][2]; +extern const uint16_t c_aauiCQMFHuffEnc9[100][2]; +extern const uint16_t c_aauiCQMFHuffEnc10[169][2]; +extern const uint16_t c_aauiCQMFHuffEnc11[196][2]; +extern const uint16_t c_aauiCQMFHuffEnc12[289][2]; +extern const uint16_t c_aauiCQMFHuffEnc13[324][2]; +extern const uint16_t c_aauiCQMFHuffEnc14[400][2]; +extern const uint16_t c_aauiCQMFHuffEnc15[576][2]; +extern const uint16_t c_aauiCQMFHuffEnc16[729][2]; +extern const uint16_t c_aauiCQMFHuffEnc17[729][2]; +extern const uint16_t c_aauiCQMFHuffEnc18[28][2]; +extern const uint16_t c_aauiCQMFHuffEnc19[29][2]; +extern const uint16_t c_aauiCQMFHuffEnc20[32][2]; +extern const uint16_t c_aauiCQMFHuffEnc21[37][2]; +extern const uint16_t c_aauiCQMFHuffEnc22[39][2]; +extern const uint16_t c_aauiCQMFHuffEnc23[46][2]; +extern const uint16_t c_aauiCQMFHuffEnc24[55][2]; +extern const uint16_t c_aauiCQMFHuffEnc25[65][2]; +extern const uint16_t c_aauiCQMFHuffEnc26[77][2]; +extern const uint16_t c_aauiCQMFHuffEnc27[91][2]; +extern const uint16_t c_aauiCQMFHuffEnc28[109][2]; +extern const uint16_t c_aauiCQMFHuffEnc29[129][2]; +extern const uint16_t c_aauiCQMFHuffEnc30[153][2]; +extern const uint16_t c_aauiCQMFHuffEnc31[181][2]; +extern const uint16_t c_aauiCQMFHuffEnc33[16][2]; +extern const uint16_t c_aauiCQMFHuffEnc34[16][2]; +extern const uint16_t c_aauiCQMFHuffEnc35[25][2]; +extern const uint16_t c_aauiCQMFHuffEnc36[36][2]; +extern const uint16_t c_aauiCQMFHuffEnc37[36][2]; +extern const uint16_t c_aauiCQMFHuffEnc38[49][2]; +extern const uint16_t c_aauiCQMFHuffEnc39[64][2]; +extern const uint16_t c_aauiCQMFHuffEnc40[81][2]; +extern const uint16_t c_aauiCQMFHuffEnc41[100][2]; +extern const uint16_t c_aauiCQMFHuffEnc42[169][2]; +extern const uint16_t c_aauiCQMFHuffEnc43[196][2]; +extern const uint16_t c_aauiCQMFHuffEnc44[289][2]; +extern const uint16_t c_aauiCQMFHuffEnc45[324][2]; +extern const uint16_t c_aauiCQMFHuffEnc46[400][2]; +extern const uint16_t c_aauiCQMFHuffEnc47[576][2]; +extern const uint16_t c_aauiCQMFHuffEnc48[729][2]; +extern const uint16_t c_aauiCQMFHuffEnc49[729][2]; +extern const uint16_t c_aauiCQMFHuffEnc50[28][2]; +extern const uint16_t c_aauiCQMFHuffEnc51[29][2]; +extern const uint16_t c_aauiCQMFHuffEnc52[32][2]; +extern const uint16_t c_aauiCQMFHuffEnc53[37][2]; +extern const uint16_t c_aauiCQMFHuffEnc54[39][2]; +extern const uint16_t c_aauiCQMFHuffEnc55[46][2]; +extern const uint16_t c_aauiCQMFHuffEnc56[55][2]; +extern const uint16_t c_aauiCQMFHuffEnc57[65][2]; +extern const uint16_t c_aauiCQMFHuffEnc58[77][2]; +extern const uint16_t c_aauiCQMFHuffEnc59[91][2]; +extern const uint16_t c_aauiCQMFHuffEnc60[109][2]; +extern const uint16_t c_aauiCQMFHuffEnc61[129][2]; +extern const uint16_t c_aauiCQMFHuffEnc62[153][2]; +extern const uint16_t c_aauiCQMFHuffEnc63[181][2]; +extern const uint16_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2]; extern const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE]; #endif @@ -471,8 +576,26 @@ extern const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE]; extern const int32_t ( *c_apaiDemodTables[ALLOC_TABLE_SIZE] )[2]; #endif + extern const uint32_t c_aaiRMSEnvHuffEnc[64][2]; + + extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; + + void PerceptualModel( const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR ); + + void PerceptualModelStereo( const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1 ); + #ifdef __cplusplus } #endif -#endif /* _CQMF_HUFF_H_ */ +#endif /* _TABLES_H_ */ -- GitLab From 8e906a8572a83d4187b90a31a963d7e7afbf23d1 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Thu, 4 May 2023 17:29:22 +0530 Subject: [PATCH 0139/1418] Clang format fix & readdition of ivas_PerceptualModel.h --- Workspace_msvc/lib_rend.vcxproj | 1 + lib_rend/ivas_CQMFDecoder.c | 5 +- lib_rend/ivas_CQMFEncoder.c | 9 +- lib_rend/ivas_PerceptualModel.c | 2 +- lib_rend/ivas_PerceptualModel.h | 75 + lib_rend/ivas_lcld_tables.c | 55914 ++++++++++++++++++++++++++++-- lib_rend/ivas_lcld_tables.h | 36 +- 7 files changed, 52194 insertions(+), 3848 deletions(-) create mode 100644 lib_rend/ivas_PerceptualModel.h diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index 423c250c03..cf98947589 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -244,6 +244,7 @@ + diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 5a5888fa09..0c152e95e3 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -40,6 +40,7 @@ Nations Convention on Contracts on the International Sales of Goods. #ifdef SPLIT_REND_WITH_HEAD_ROT #include "ivas_NoiseGen.h" +#include "ivas_PerceptualModel.h" #include "ivas_lcld_tables.h" #include "ivas_cldfb_codec_bitstream.h" #include "prot.h" @@ -285,8 +286,8 @@ static void CreateDecodeTable( CQMFDecoder *psCQMFDecoder, int32_t num, const ui { ppsort_enc_table[n] = (uint32_t *) malloc( 3 * sizeof( int32_t ) ); - ppsort_enc_table[n][0] = (uint32_t)ppuiEncTable[n][0]; - ppsort_enc_table[n][1] = (uint32_t)ppuiEncTable[n][1]; + ppsort_enc_table[n][0] = (uint32_t) ppuiEncTable[n][0]; + ppsort_enc_table[n][1] = (uint32_t) ppuiEncTable[n][1]; ppsort_enc_table[n][2] = (uint32_t) n; } diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c index 05c992516e..82bcf6879a 100644 --- a/lib_rend/ivas_CQMFEncoder.c +++ b/lib_rend/ivas_CQMFEncoder.c @@ -40,6 +40,7 @@ #include "ivas_lcld_tables.h" #include "prot.h" #include "ivas_RMSEnvGrouping.h" +#include "ivas_PerceptualModel.h" #include "ivas_cldfb_codec_bitstream.h" #include "ivas_prot_rend.h" #ifdef ENABLE_MS_PRED @@ -1807,11 +1808,11 @@ static int32_t WriteCQMFData( const int32_t iNumGroups, if ( iAlloc > 0 ) { #ifndef ROM_TO_RAM - const uint32_t(*pauiHuffmanTable)[2] = NULL; - const uint32_t(*pauiHuffmanTableDPCM)[2] = NULL; + const uint32_t( *pauiHuffmanTable )[2] = NULL; + const uint32_t( *pauiHuffmanTableDPCM )[2] = NULL; #else - const uint16_t(*pauiHuffmanTable)[2] = NULL; - const uint16_t(*pauiHuffmanTableDPCM)[2] = NULL; + const uint16_t( *pauiHuffmanTable )[2] = NULL; + const uint16_t( *pauiHuffmanTableDPCM )[2] = NULL; #endif // pauiHuffmanTable = GetHuffEncTable(iAlloc); pauiHuffmanTable = c_apauiHuffEncTabels[iAlloc]; diff --git a/lib_rend/ivas_PerceptualModel.c b/lib_rend/ivas_PerceptualModel.c index 2f0072ee97..131ca8af0d 100644 --- a/lib_rend/ivas_PerceptualModel.c +++ b/lib_rend/ivas_PerceptualModel.c @@ -31,7 +31,7 @@ *******************************************************************************************************/ #include "options.h" #ifdef SPLIT_REND_WITH_HEAD_ROT -#include "ivas_lcld_tables.h" +#include "ivas_PerceptualModel.h" #include "prot.h" #include "ivas_prot_rend.h" #include diff --git a/lib_rend/ivas_PerceptualModel.h b/lib_rend/ivas_PerceptualModel.h new file mode 100644 index 0000000000..fdd1027623 --- /dev/null +++ b/lib_rend/ivas_PerceptualModel.h @@ -0,0 +1,75 @@ +/****************************************************************************************************** + + (C) 2022 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_PERCEPTUAL_MODEL_H_ +#define _IVAS_PERCEPTUAL_MODEL_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif +#include + +#define LOG_ADD_TABLE_LENGTH (512) +#define PERCEPTUAL_MODEL_SCALE (64) +#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) +#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) +#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) +#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) +#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (8)//(4) +#define MAX_BANDS_48 ( 23 ) + + extern const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH]; + extern const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48]; + extern const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48]; + extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; + extern const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48]; + + extern void PerceptualModel(const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR); + + extern void PerceptualModelStereo(const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1); + +#ifdef __cplusplus +} +#endif + +#endif /* _PERCEPTUAL_MODEL_H_ */ diff --git a/lib_rend/ivas_lcld_tables.c b/lib_rend/ivas_lcld_tables.c index 7afb33a184..834e0536af 100644 --- a/lib_rend/ivas_lcld_tables.c +++ b/lib_rend/ivas_lcld_tables.c @@ -37,47 +37,71 @@ #include "wmc_auto.h" #include #include "prot.h" +#include "ivas_PerceptualModel.h" /* clang-format off */ + const float c_afRotRealImagSimple[SIMPLE_PHASE_MAX_VAL + 1][2] = { - {1.0f, 0.0f}, /* zero */ - {0.0f, 1.0f}, /* pi/2 */ - {-1.0f, 0.0f}, /* pi */ - {0.0f, -1.0f}, /* 3*pi/2 */ + { 1.0f, 0.0f }, /* zero */ + { 0.0f, 1.0f }, /* pi/2 */ + { -1.0f, 0.0f }, /* pi */ + { 0.0f, -1.0f }, /* 3*pi/2 */ }; /* phi = (-12:12)'/12 *pi; tmp = [cos(phi),sin(phi)]; tmp = tmp';sprintf('{%.8ff, %.8ff},\n',tmp(:)) */ const float c_afRotRealImag[PHASE_MAX_VAL - PHASE_MIN_VAL + 1][2] = { - {-1.00000000f, -0.00000000f}, - {-0.96592583f, -0.25881905f}, - {-0.86602540f, -0.50000000f}, - {-0.70710678f, -0.70710678f}, - {-0.50000000f, -0.86602540f}, - {-0.25881905f, -0.96592583f}, - {0.00000000f, -1.00000000f}, - {0.25881905f, -0.96592583f}, - {0.50000000f, -0.86602540f}, - {0.70710678f, -0.70710678f}, - {0.86602540f, -0.50000000f}, - {0.96592583f, -0.25881905f}, - {1.00000000f, 0.00000000f}, - {0.96592583f, 0.25881905f}, - {0.86602540f, 0.50000000f}, - {0.70710678f, 0.70710678f}, - {0.50000000f, 0.86602540f}, - {0.25881905f, 0.96592583f}, - {0.00000000f, 1.00000000f}, - {-0.25881905f, 0.96592583f}, - {-0.50000000f, 0.86602540f}, - {-0.70710678f, 0.70710678f}, - {-0.86602540f, 0.50000000f}, - {-0.96592583f, 0.25881905f}, - {-1.00000000f, 0.00000000f} + { -1.00000000f, -0.00000000f }, + { -0.96592583f, -0.25881905f }, + { -0.86602540f, -0.50000000f }, + { -0.70710678f, -0.70710678f }, + { -0.50000000f, -0.86602540f }, + { -0.25881905f, -0.96592583f }, + { 0.00000000f, -1.00000000f }, + { 0.25881905f, -0.96592583f }, + { 0.50000000f, -0.86602540f }, + { 0.70710678f, -0.70710678f }, + { 0.86602540f, -0.50000000f }, + { 0.96592583f, -0.25881905f }, + { 1.00000000f, 0.00000000f }, + { 0.96592583f, 0.25881905f }, + { 0.86602540f, 0.50000000f }, + { 0.70710678f, 0.70710678f }, + { 0.50000000f, 0.86602540f }, + { 0.25881905f, 0.96592583f }, + { 0.00000000f, 1.00000000f }, + { -0.25881905f, 0.96592583f }, + { -0.50000000f, 0.86602540f }, + { -0.70710678f, 0.70710678f }, + { -0.86602540f, 0.50000000f }, + { -0.96592583f, 0.25881905f }, + { -1.00000000f, 0.00000000f } }; /* Move this to perceptual model ? */ const int32_t c_aiBandwidths48[MAX_BANDS_48] = { - 1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,4,6,6,7,10, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 4, + 6, + 6, + 7, + 10, }; @@ -152,80 +176,579 @@ const float c_afInvScaleFactor[ALLOC_TABLE_SIZE] = { }; const float c_afRMSEnvReconstructTable[ENV_RECONSTRUCT_TABLE_SIZE] = { - 2.32830644e-10f, 3.29272254e-10f, 4.65661287e-10f, 6.58544508e-10f, 9.31322575e-10f, 1.31708902e-09f, 1.86264515e-09f, 2.63417803e-09f, - 3.72529030e-09f, 5.26835606e-09f, 7.45058060e-09f, 1.05367121e-08f, 1.49011612e-08f, 2.10734243e-08f, 2.98023224e-08f, 4.21468485e-08f, - 5.96046448e-08f, 8.42936970e-08f, 1.19209290e-07f, 1.68587394e-07f, 2.38418579e-07f, 3.37174788e-07f, 4.76837158e-07f, 6.74349576e-07f, - 9.53674316e-07f, 1.34869915e-06f, 1.90734863e-06f, 2.69739830e-06f, 3.81469727e-06f, 5.39479661e-06f, 7.62939453e-06f, 1.07895932e-05f, - 1.52587891e-05f, 2.15791864e-05f, 3.05175781e-05f, 4.31583729e-05f, 6.10351562e-05f, 8.63167458e-05f, 1.22070312e-04f, 1.72633492e-04f, - 2.44140625e-04f, 3.45266983e-04f, 4.88281250e-04f, 6.90533966e-04f, 9.76562500e-04f, 1.38106793e-03f, 1.95312500e-03f, 2.76213586e-03f, - 3.90625000e-03f, 5.52427173e-03f, 7.81250000e-03f, 1.10485435e-02f, 1.56250000e-02f, 2.20970869e-02f, 3.12500000e-02f, 4.41941738e-02f, - 6.25000000e-02f, 8.83883476e-02f, 1.25000000e-01f, 1.76776695e-01f, 2.50000000e-01f, 3.53553391e-01f, 5.00000000e-01f, 7.07106781e-01f, - 1.00000000e+00f, 1.41421356e+00f, 2.00000000e+00f, 2.82842712e+00f, 4.00000000e+00f, 5.65685425e+00f, 8.00000000e+00f, 1.13137085e+01f, - 1.60000000e+01f, 2.26274170e+01f, 3.20000000e+01f, 4.52548340e+01f, 6.40000000e+01f, 9.05096680e+01f, 1.28000000e+02f, 1.81019336e+02f, - 2.56000000e+02f, 3.62038672e+02f, 5.12000000e+02f, 7.24077344e+02f, 1.02400000e+03f, 1.44815469e+03f, 2.04800000e+03f, 2.89630938e+03f, - 4.09600000e+03f, 5.79261875e+03f, 8.19200000e+03f, 1.15852375e+04f, 1.63840000e+04f, 2.31704750e+04f, 3.27680000e+04f, 4.63409500e+04f, - 6.55360000e+04f, 9.26819000e+04f, 1.31072000e+05f, 1.85363800e+05f, 2.62144000e+05f, 3.70727600e+05f, 5.24288000e+05f, 7.41455200e+05f, - 1.04857600e+06f, 1.48291040e+06f, 2.09715200e+06f, 2.96582080e+06f, 4.19430400e+06f, 5.93164160e+06f, 8.38860800e+06f, 1.18632832e+07f, - 1.67772160e+07f, 2.37265664e+07f, 3.35544320e+07f, 4.74531328e+07f, 6.71088640e+07f, 9.49062656e+07f, 1.34217728e+08f, 1.89812531e+08f, - 2.68435456e+08f, 3.79625062e+08f, 5.36870912e+08f, 7.59250125e+08f, 1.07374182e+09f, 1.51850025e+09f, 2.14748365e+09f, 3.03700050e+09f, + 2.32830644e-10f, + 3.29272254e-10f, + 4.65661287e-10f, + 6.58544508e-10f, + 9.31322575e-10f, + 1.31708902e-09f, + 1.86264515e-09f, + 2.63417803e-09f, + 3.72529030e-09f, + 5.26835606e-09f, + 7.45058060e-09f, + 1.05367121e-08f, + 1.49011612e-08f, + 2.10734243e-08f, + 2.98023224e-08f, + 4.21468485e-08f, + 5.96046448e-08f, + 8.42936970e-08f, + 1.19209290e-07f, + 1.68587394e-07f, + 2.38418579e-07f, + 3.37174788e-07f, + 4.76837158e-07f, + 6.74349576e-07f, + 9.53674316e-07f, + 1.34869915e-06f, + 1.90734863e-06f, + 2.69739830e-06f, + 3.81469727e-06f, + 5.39479661e-06f, + 7.62939453e-06f, + 1.07895932e-05f, + 1.52587891e-05f, + 2.15791864e-05f, + 3.05175781e-05f, + 4.31583729e-05f, + 6.10351562e-05f, + 8.63167458e-05f, + 1.22070312e-04f, + 1.72633492e-04f, + 2.44140625e-04f, + 3.45266983e-04f, + 4.88281250e-04f, + 6.90533966e-04f, + 9.76562500e-04f, + 1.38106793e-03f, + 1.95312500e-03f, + 2.76213586e-03f, + 3.90625000e-03f, + 5.52427173e-03f, + 7.81250000e-03f, + 1.10485435e-02f, + 1.56250000e-02f, + 2.20970869e-02f, + 3.12500000e-02f, + 4.41941738e-02f, + 6.25000000e-02f, + 8.83883476e-02f, + 1.25000000e-01f, + 1.76776695e-01f, + 2.50000000e-01f, + 3.53553391e-01f, + 5.00000000e-01f, + 7.07106781e-01f, + 1.00000000e+00f, + 1.41421356e+00f, + 2.00000000e+00f, + 2.82842712e+00f, + 4.00000000e+00f, + 5.65685425e+00f, + 8.00000000e+00f, + 1.13137085e+01f, + 1.60000000e+01f, + 2.26274170e+01f, + 3.20000000e+01f, + 4.52548340e+01f, + 6.40000000e+01f, + 9.05096680e+01f, + 1.28000000e+02f, + 1.81019336e+02f, + 2.56000000e+02f, + 3.62038672e+02f, + 5.12000000e+02f, + 7.24077344e+02f, + 1.02400000e+03f, + 1.44815469e+03f, + 2.04800000e+03f, + 2.89630938e+03f, + 4.09600000e+03f, + 5.79261875e+03f, + 8.19200000e+03f, + 1.15852375e+04f, + 1.63840000e+04f, + 2.31704750e+04f, + 3.27680000e+04f, + 4.63409500e+04f, + 6.55360000e+04f, + 9.26819000e+04f, + 1.31072000e+05f, + 1.85363800e+05f, + 2.62144000e+05f, + 3.70727600e+05f, + 5.24288000e+05f, + 7.41455200e+05f, + 1.04857600e+06f, + 1.48291040e+06f, + 2.09715200e+06f, + 2.96582080e+06f, + 4.19430400e+06f, + 5.93164160e+06f, + 8.38860800e+06f, + 1.18632832e+07f, + 1.67772160e+07f, + 2.37265664e+07f, + 3.35544320e+07f, + 4.74531328e+07f, + 6.71088640e+07f, + 9.49062656e+07f, + 1.34217728e+08f, + 1.89812531e+08f, + 2.68435456e+08f, + 3.79625062e+08f, + 5.36870912e+08f, + 7.59250125e+08f, + 1.07374182e+09f, + 1.51850025e+09f, + 2.14748365e+09f, + 3.03700050e+09f, 4.29496730e+09f, }; const int32_t c_aiQuantMaxValues[ALLOC_TABLE_SIZE] = { - 0, 3, 3, 4, 5, 5, 6, 7, - 8, 9, 12, 13, 16, 17, 19, 23, - 26, 26, 27, 28, 31, 36, 38, 45, - 54, 64, 76, 90, 108, 128, 152, 180, + 0, + 3, + 3, + 4, + 5, + 5, + 6, + 7, + 8, + 9, + 12, + 13, + 16, + 17, + 19, + 23, + 26, + 26, + 27, + 28, + 31, + 36, + 38, + 45, + 54, + 64, + 76, + 90, + 108, + 128, + 152, + 180, }; const int32_t c_aiHuffmanDim[ALLOC_TABLE_SIZE] = { - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, }; const int32_t c_aiHuffmanMod[ALLOC_TABLE_SIZE] = { - 0, 4, 4, 5, 6, 6, 7, 8, - 9, 10, 13, 14, 17, 18, 20, 24, - 27, 27, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, + 0, + 4, + 4, + 5, + 6, + 6, + 7, + 8, + 9, + 10, + 13, + 14, + 17, + 18, + 20, + 24, + 27, + 27, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, }; const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE] = { - 1, 16, 16, 25, 36, 36, 49, 64, - 81, 100, 169, 196, 289, 324, 400, 576, - 729, 729, 28, 29, 32, 37, 39, 46, - 55, 65, 77, 91, 109, 129, 153, 181, + 1, + 16, + 16, + 25, + 36, + 36, + 49, + 64, + 81, + 100, + 169, + 196, + 289, + 324, + 400, + 576, + 729, + 729, + 28, + 29, + 32, + 37, + 39, + 46, + 55, + 65, + 77, + 91, + 109, + 129, + 153, + 181, }; -const uint32_t c_aaiRMSEnvHuffEnc[64][2] = -{ - {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0003}, {0x0013, 0x0004}, - {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0012, 0x000b}, {0x000d, 0x0002}, {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000d, 0x0003}, - {0x000b, 0x0002}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0008, 0x0005}, - {0x0008, 0x0006}, {0x0007, 0x0004}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0005, 0x0003}, {0x0004, 0x0002}, {0x0003, 0x0002}, {0x0002, 0x0002}, - {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x0009, 0x0008}, - {0x0009, 0x0009}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, - {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, +const uint32_t c_aaiRMSEnvHuffEnc[64][2] = { + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0012, 0x000b }, + { 0x000d, 0x0002 }, + { 0x000e, 0x0001 }, + { 0x000e, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000b, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0007, 0x0004 }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0005, 0x0003 }, + { 0x0004, 0x0002 }, + { 0x0003, 0x0002 }, + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0003 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0007 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x0010, 0x0003 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, }; -const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = -{ - {0x0002ffff, 0x0001ffff, 0x0000001d, 0x00000022, 0x0001001e, 0x0001001e, 0x00010021, 0x00010021, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000017, 0x00000018, 0x00000025, 0x00010019, 0x00010019, 0x00010024, 0x00010024, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x0009ffff, 0x0008ffff, 0x0000002c, 0x0000002d, 0x00010010, 0x00010010, 0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x000bffff, 0x000cffff, 0x000affff, 0x00000031, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, }, - {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, +const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE] = { + { + 0x0002ffff, + 0x0001ffff, + 0x0000001d, + 0x00000022, + 0x0001001e, + 0x0001001e, + 0x00010021, + 0x00010021, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0006ffff, + 0x0007ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x00000017, + 0x00000018, + 0x00000025, + 0x00010019, + 0x00010019, + 0x00010024, + 0x00010024, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + }, + { + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x0009ffff, + 0x0008ffff, + 0x0000002c, + 0x0000002d, + 0x00010010, + 0x00010010, + 0x0001002b, + 0x0001002b, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x000bffff, + 0x000cffff, + 0x000affff, + 0x00000031, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + }, + { + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x00000000, + 0x00000001, + 0x00000002, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + }, + { + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + }, }; #ifndef ROM_TO_RAM @@ -233,17 +756,81 @@ const uint32_t c_aauiCQMFHuffEnc1[16][2] = #else const uint16_t c_aauiCQMFHuffEnc1[16][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000b, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x0001}, - {0x0006, 0x0001}, {0x0008, 0x0001}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, -}; + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0005, 0x0001 }, + { 0x000b, 0x0000 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec1[3][16] = -{ - {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00010003, 0x00010003, 0x00010007, 0x00010007, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +const uint32_t c_aauiCQMFHuffDec1[3][16] = { + { + 0x0001ffff, + 0x00000005, + 0x00010001, + 0x00010001, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x00000009, + 0x00010006, + 0x00010006, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00010003, + 0x00010003, + 0x00010007, + 0x00010007, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, }; #endif @@ -252,17 +839,81 @@ const uint32_t c_aauiCQMFHuffEnc2[16][2] = #else const uint16_t c_aauiCQMFHuffEnc2[16][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0005, 0x0001}, {0x000c, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000c, 0x0001}, - {0x0006, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000b, 0x0003}, -}; + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0005, 0x0001 }, + { 0x000c, 0x0000 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000b, 0x0003 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec2[3][16] = -{ - {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000009, 0x00010006, 0x00010006, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00000003, 0x00000007, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0001000f, 0x0001000f, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, +const uint32_t c_aauiCQMFHuffDec2[3][16] = { + { + 0x0001ffff, + 0x00000005, + 0x00010001, + 0x00010001, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x00000009, + 0x00010006, + 0x00010006, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00000003, + 0x00000007, + 0x0000000b, + 0x0000000c, + 0x0000000d, + 0x0000000e, + 0x0001000f, + 0x0001000f, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, }; #endif #ifndef ROM_TO_RAM @@ -270,27 +921,217 @@ const uint32_t c_aauiCQMFHuffEnc3[25][2] = #else const uint16_t c_aauiCQMFHuffEnc3[25][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, - {0x000d, 0x0002}, {0x000d, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0009, 0x0001}, - {0x000c, 0x0007}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, - {0x000d, 0x000d}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000d, 0x0000 }, + { 0x000d, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x0009, 0x0001 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec3[10][16] = -{ - {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x0000000c, 0x00010007, 0x00010007, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x00000010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, +const uint32_t c_aauiCQMFHuffDec3[10][16] = { + { + 0x0001ffff, + 0x00000006, + 0x00010001, + 0x00010001, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x0000000c, + 0x00010007, + 0x00010007, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x00000010, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, }; #endif @@ -299,23 +1140,138 @@ const uint32_t c_aauiCQMFHuffEnc4[36][2] = #else const uint16_t c_aauiCQMFHuffEnc4[36][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0000}, {0x0010, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, - {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000e, 0x0006}, - {0x0010, 0x0004}, {0x0010, 0x0005}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000e, 0x0007}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0010, 0x0008}, - {0x0010, 0x0009}, {0x0010, 0x000a}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0010, 0x0010}, - {0x0010, 0x0011}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x0010, 0x0000 }, + { 0x0010, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000e, 0x0006 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000e, 0x0007 }, + { 0x0010, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0010, 0x0008 }, + { 0x0010, 0x0009 }, + { 0x0010, 0x000a }, + { 0x0010, 0x000b }, + { 0x0010, 0x000c }, + { 0x0010, 0x000d }, + { 0x0010, 0x000e }, + { 0x0010, 0x000f }, + { 0x0010, 0x0010 }, + { 0x0010, 0x0011 }, + { 0x000f, 0x0009 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec4[5][16] = -{ - {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x0000000e, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x0004ffff, 0x0003ffff, 0x00010003, 0x00010003, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0000001f, 0x00000020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, - {0x00000004, 0x00000005, 0x0000000a, 0x0000000b, 0x00000010, 0x00000011, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, }, +const uint32_t c_aauiCQMFHuffDec4[5][16] = { + { + 0x0001ffff, + 0x00000007, + 0x00010001, + 0x00010001, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x0000000e, + 0x00010008, + 0x00010008, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + }, + { + 0x0004ffff, + 0x0003ffff, + 0x00010003, + 0x00010003, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x0000001f, + 0x00000020, + 0x00010021, + 0x00010021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + }, + { + 0x00000004, + 0x00000005, + 0x0000000a, + 0x0000000b, + 0x00000010, + 0x00000011, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000018, + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x0000001d, + 0x0000001e, + }, }; #endif @@ -324,28 +1280,228 @@ const uint32_t c_aauiCQMFHuffEnc5[36][2] = #else const uint16_t c_aauiCQMFHuffEnc5[36][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0000}, {0x0002, 0x0001}, {0x0004, 0x0001}, - {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0008}, {0x0012, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000c, 0x0001}, - {0x0012, 0x0002}, {0x0012, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000d, 0x0001}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, - {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, - {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0011, 0x000b}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000f, 0x0003 }, + { 0x0012, 0x0000 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x0011, 0x0008 }, + { 0x0012, 0x0001 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000d, 0x0001 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0011, 0x0009 }, + { 0x0011, 0x000a }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, + { 0x0012, 0x000e }, + { 0x0012, 0x000f }, + { 0x0011, 0x000b }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec5[10][16] = -{ - {0x0001ffff, 0x00000007, 0x00010001, 0x00010001, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x0000000e, 0x00010008, 0x00010008, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x0003ffff, 0x0000000f, 0x00010009, 0x00010009, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x0004ffff, 0x0005ffff, 0x00010004, 0x00010004, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, - {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, +const uint32_t c_aauiCQMFHuffDec5[10][16] = { + { + 0x0001ffff, + 0x00000007, + 0x00010001, + 0x00010001, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x0000000e, + 0x00010008, + 0x00010008, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + }, + { + 0x0003ffff, + 0x0000000f, + 0x00010009, + 0x00010009, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x0004ffff, + 0x0005ffff, + 0x00010004, + 0x00010004, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + }, + { + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + }, + { + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + }, }; #endif @@ -354,27 +1510,187 @@ const uint32_t c_aauiCQMFHuffEnc6[49][2] = #else const uint16_t c_aauiCQMFHuffEnc6[49][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x0003}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0002, 0x0001}, - {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x0010, 0x0004}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0006, 0x0002}, {0x0006, 0x0003}, - {0x0008, 0x0001}, {0x000d, 0x0001}, {0x0012, 0x0007}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x000a, 0x0003}, {0x000b, 0x0001}, {0x000c, 0x0001}, - {0x0011, 0x0004}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0010, 0x0005}, {0x000f, 0x0003}, {0x0011, 0x0005}, {0x0014, 0x0009}, - {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0013, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, - {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, - {0x0014, 0x0019}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x0010, 0x0003 }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0002 }, + { 0x0010, 0x0004 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x0012, 0x0007 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x0011, 0x0004 }, + { 0x0014, 0x0006 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0010, 0x0005 }, + { 0x000f, 0x0003 }, + { 0x0011, 0x0005 }, + { 0x0014, 0x0009 }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0013, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec6[7][16] = -{ - {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000010, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0003ffff, 0x00000017, 0x00010016, 0x00010016, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x00000004, 0x0000000b, 0x0000001c, 0x0001001d, 0x0001001d, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00010024, 0x00010024, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00000005, 0x00000006, 0x0000000c, 0x0000000d, 0x00000013, 0x00000014, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000025, 0x00000026, }, +const uint32_t c_aauiCQMFHuffDec6[7][16] = { + { + 0x0001ffff, + 0x00000008, + 0x00010001, + 0x00010001, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x00000010, + 0x00010009, + 0x00010009, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + }, + { + 0x0003ffff, + 0x00000017, + 0x00010016, + 0x00010016, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x0004ffff, + 0x00000004, + 0x0000000b, + 0x0000001c, + 0x0001001d, + 0x0001001d, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x00000027, + 0x00000028, + 0x00000029, + 0x0000002a, + 0x0000002b, + 0x0000002c, + 0x0000002d, + 0x0000002e, + 0x0000002f, + 0x00000030, + 0x00010024, + 0x00010024, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00000005, + 0x00000006, + 0x0000000c, + 0x0000000d, + 0x00000013, + 0x00000014, + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x0000001f, + 0x00000020, + 0x00000021, + 0x00000022, + 0x00000023, + 0x00000025, + 0x00000026, + }, }; #endif @@ -383,45 +1699,525 @@ const uint32_t c_aauiCQMFHuffEnc7[64][2] = #else const uint16_t c_aauiCQMFHuffEnc7[64][2] = #endif -{ - {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0002}, {0x0015, 0x0000}, {0x0015, 0x0001}, {0x0015, 0x0002}, - {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000f, 0x0003}, {0x0014, 0x0011}, {0x0015, 0x0003}, {0x0015, 0x0004}, - {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000b, 0x0001}, {0x0010, 0x0002}, {0x0015, 0x0005}, {0x0015, 0x0006}, {0x0015, 0x0007}, - {0x000a, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0001}, {0x000f, 0x0004}, {0x0012, 0x0006}, {0x0015, 0x0008}, {0x0015, 0x0009}, {0x0015, 0x000a}, - {0x000f, 0x0005}, {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0012, 0x0007}, {0x0014, 0x0012}, {0x0015, 0x000b}, {0x0015, 0x000c}, {0x0015, 0x000d}, - {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0013, 0x000b}, {0x0014, 0x0015}, {0x0015, 0x000e}, {0x0015, 0x000f}, {0x0015, 0x0010}, {0x0015, 0x0011}, - {0x0015, 0x0012}, {0x0015, 0x0013}, {0x0015, 0x0014}, {0x0015, 0x0015}, {0x0015, 0x0016}, {0x0015, 0x0017}, {0x0015, 0x0018}, {0x0015, 0x0019}, - {0x0015, 0x001a}, {0x0015, 0x001b}, {0x0015, 0x001c}, {0x0015, 0x001d}, {0x0015, 0x001e}, {0x0015, 0x001f}, {0x0015, 0x0020}, {0x0015, 0x0021}, -}; + { + { 0x0002, 0x0001 }, + { 0x0002, 0x0002 }, + { 0x0005, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000f, 0x0002 }, + { 0x0015, 0x0000 }, + { 0x0015, 0x0001 }, + { 0x0015, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0009, 0x0002 }, + { 0x000f, 0x0003 }, + { 0x0014, 0x0011 }, + { 0x0015, 0x0003 }, + { 0x0015, 0x0004 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x0010, 0x0002 }, + { 0x0015, 0x0005 }, + { 0x0015, 0x0006 }, + { 0x0015, 0x0007 }, + { 0x000a, 0x0001 }, + { 0x0009, 0x0003 }, + { 0x000c, 0x0001 }, + { 0x000f, 0x0004 }, + { 0x0012, 0x0006 }, + { 0x0015, 0x0008 }, + { 0x0015, 0x0009 }, + { 0x0015, 0x000a }, + { 0x000f, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x0010, 0x0003 }, + { 0x0012, 0x0007 }, + { 0x0014, 0x0012 }, + { 0x0015, 0x000b }, + { 0x0015, 0x000c }, + { 0x0015, 0x000d }, + { 0x0014, 0x0013 }, + { 0x0014, 0x0014 }, + { 0x0013, 0x000b }, + { 0x0014, 0x0015 }, + { 0x0015, 0x000e }, + { 0x0015, 0x000f }, + { 0x0015, 0x0010 }, + { 0x0015, 0x0011 }, + { 0x0015, 0x0012 }, + { 0x0015, 0x0013 }, + { 0x0015, 0x0014 }, + { 0x0015, 0x0015 }, + { 0x0015, 0x0016 }, + { 0x0015, 0x0017 }, + { 0x0015, 0x0018 }, + { 0x0015, 0x0019 }, + { 0x0015, 0x001a }, + { 0x0015, 0x001b }, + { 0x0015, 0x001c }, + { 0x0015, 0x001d }, + { 0x0015, 0x001e }, + { 0x0015, 0x001f }, + { 0x0015, 0x0020 }, + { 0x0015, 0x0021 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec7[25][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x0003ffff, 0x0004ffff, 0x00010012, 0x00010012, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x0005ffff, 0x0000001a, 0x00010013, 0x00010013, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x0007ffff, 0x0006ffff, 0x00000014, 0x00000022, 0x00010004, 0x00010004, 0x0001000c, 0x0001000c, 0x0001001b, 0x0001001b, 0x00010020, 0x00010020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, - {0x0018ffff, 0x0000000d, 0x00000024, 0x00000028, 0x00000029, 0x0000002b, 0x0001002a, 0x0001002a, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x000effff, 0x000affff, 0x000bffff, 0x000cffff, 0x0008ffff, 0x0009ffff, 0x000dffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, +const uint32_t c_aauiCQMFHuffDec7[25][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00010009, + 0x00010009, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + }, + { + 0x0003ffff, + 0x0004ffff, + 0x00010012, + 0x00010012, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x0005ffff, + 0x0000001a, + 0x00010013, + 0x00010013, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x0007ffff, + 0x0006ffff, + 0x00000014, + 0x00000022, + 0x00010004, + 0x00010004, + 0x0001000c, + 0x0001000c, + 0x0001001b, + 0x0001001b, + 0x00010020, + 0x00010020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + }, + { + 0x0018ffff, + 0x0000000d, + 0x00000024, + 0x00000028, + 0x00000029, + 0x0000002b, + 0x0001002a, + 0x0001002a, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + }, + { + 0x000effff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x0008ffff, + 0x0009ffff, + 0x000dffff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + }, + { + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, + { + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + }, + { + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + }, + { + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + }, }; #endif @@ -430,40 +2226,381 @@ const uint32_t c_aauiCQMFHuffEnc8[81][2] = #else const uint16_t c_aauiCQMFHuffEnc8[81][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0001}, {0x000f, 0x0002}, {0x0014, 0x0008}, {0x0017, 0x0000}, {0x0017, 0x0001}, - {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0001}, {0x000f, 0x0003}, {0x0012, 0x0004}, {0x0015, 0x000d}, - {0x0017, 0x0003}, {0x0017, 0x0004}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0001}, {0x000c, 0x0001}, {0x0010, 0x0002}, {0x0013, 0x0005}, - {0x0017, 0x0005}, {0x0017, 0x0006}, {0x0017, 0x0007}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000b, 0x0001}, {0x000f, 0x0004}, {0x0012, 0x0005}, - {0x0016, 0x0015}, {0x0017, 0x0008}, {0x0017, 0x0009}, {0x0017, 0x000a}, {0x000f, 0x0005}, {0x000e, 0x0003}, {0x0010, 0x0003}, {0x0012, 0x0006}, - {0x0014, 0x0009}, {0x0017, 0x000b}, {0x0017, 0x000c}, {0x0017, 0x000d}, {0x0017, 0x000e}, {0x0013, 0x0006}, {0x0012, 0x0007}, {0x0013, 0x0007}, - {0x0015, 0x000e}, {0x0017, 0x000f}, {0x0017, 0x0010}, {0x0017, 0x0011}, {0x0017, 0x0012}, {0x0017, 0x0013}, {0x0016, 0x0016}, {0x0016, 0x0017}, - {0x0015, 0x000f}, {0x0016, 0x0018}, {0x0017, 0x0014}, {0x0017, 0x0015}, {0x0017, 0x0016}, {0x0017, 0x0017}, {0x0017, 0x0018}, {0x0017, 0x0019}, - {0x0017, 0x001a}, {0x0017, 0x001b}, {0x0017, 0x001c}, {0x0017, 0x001d}, {0x0017, 0x001e}, {0x0017, 0x001f}, {0x0017, 0x0020}, {0x0017, 0x0021}, - {0x0017, 0x0022}, {0x0017, 0x0023}, {0x0017, 0x0024}, {0x0017, 0x0025}, {0x0017, 0x0026}, {0x0017, 0x0027}, {0x0017, 0x0028}, {0x0017, 0x0029}, - {0x0016, 0x0019}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000f, 0x0002 }, + { 0x0014, 0x0008 }, + { 0x0017, 0x0000 }, + { 0x0017, 0x0001 }, + { 0x0017, 0x0002 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000f, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0015, 0x000d }, + { 0x0017, 0x0003 }, + { 0x0017, 0x0004 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x0010, 0x0002 }, + { 0x0013, 0x0005 }, + { 0x0017, 0x0005 }, + { 0x0017, 0x0006 }, + { 0x0017, 0x0007 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000b, 0x0001 }, + { 0x000f, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0016, 0x0015 }, + { 0x0017, 0x0008 }, + { 0x0017, 0x0009 }, + { 0x0017, 0x000a }, + { 0x000f, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x0010, 0x0003 }, + { 0x0012, 0x0006 }, + { 0x0014, 0x0009 }, + { 0x0017, 0x000b }, + { 0x0017, 0x000c }, + { 0x0017, 0x000d }, + { 0x0017, 0x000e }, + { 0x0013, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0013, 0x0007 }, + { 0x0015, 0x000e }, + { 0x0017, 0x000f }, + { 0x0017, 0x0010 }, + { 0x0017, 0x0011 }, + { 0x0017, 0x0012 }, + { 0x0017, 0x0013 }, + { 0x0016, 0x0016 }, + { 0x0016, 0x0017 }, + { 0x0015, 0x000f }, + { 0x0016, 0x0018 }, + { 0x0017, 0x0014 }, + { 0x0017, 0x0015 }, + { 0x0017, 0x0016 }, + { 0x0017, 0x0017 }, + { 0x0017, 0x0018 }, + { 0x0017, 0x0019 }, + { 0x0017, 0x001a }, + { 0x0017, 0x001b }, + { 0x0017, 0x001c }, + { 0x0017, 0x001d }, + { 0x0017, 0x001e }, + { 0x0017, 0x001f }, + { 0x0017, 0x0020 }, + { 0x0017, 0x0021 }, + { 0x0017, 0x0022 }, + { 0x0017, 0x0023 }, + { 0x0017, 0x0024 }, + { 0x0017, 0x0025 }, + { 0x0017, 0x0026 }, + { 0x0017, 0x0027 }, + { 0x0017, 0x0028 }, + { 0x0017, 0x0029 }, + { 0x0016, 0x0019 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec8[16][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0004ffff, 0x00010014, 0x00010014, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x0005ffff, 0x00000015, 0x0001001d, 0x0001001d, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0007ffff, 0x0006ffff, 0x00000016, 0x00000026, 0x00010004, 0x00010004, 0x0001000d, 0x0001000d, 0x0001001e, 0x0001001e, 0x00010024, 0x00010024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, - {0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000028, 0x00010017, 0x00010017, 0x0001002d, 0x0001002d, 0x0001002f, 0x0001002f, }, - {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, }, - {0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, }, - {0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x00010031, 0x00010031, }, - {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, - {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, +const uint32_t c_aauiCQMFHuffDec8[16][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00010001, + 0x00010001, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0004ffff, + 0x00010014, + 0x00010014, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x0005ffff, + 0x00000015, + 0x0001001d, + 0x0001001d, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0007ffff, + 0x0006ffff, + 0x00000016, + 0x00000026, + 0x00010004, + 0x00010004, + 0x0001000d, + 0x0001000d, + 0x0001001e, + 0x0001001e, + 0x00010024, + 0x00010024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + }, + { + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + }, + { + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x00000005, + 0x00000028, + 0x00010017, + 0x00010017, + 0x0001002d, + 0x0001002d, + 0x0001002f, + 0x0001002f, + }, + { + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020050, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + }, + { + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + }, + { + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + }, + { + 0x00010021, + 0x00010021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x00010031, + 0x00010031, + }, + { + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + }, + { + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + }, + { + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + }, }; #endif @@ -472,48 +2609,508 @@ const uint32_t c_aauiCQMFHuffEnc9[100][2] = #else const uint16_t c_aauiCQMFHuffEnc9[100][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000d, 0x0002}, {0x0011, 0x0004}, {0x0014, 0x000a}, {0x0017, 0x0000}, - {0x0017, 0x0001}, {0x0017, 0x0002}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, {0x0009, 0x0002}, {0x000d, 0x0003}, {0x0010, 0x0004}, - {0x0013, 0x0007}, {0x0016, 0x0018}, {0x0017, 0x0003}, {0x0017, 0x0004}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, - {0x000e, 0x0002}, {0x0011, 0x0005}, {0x0014, 0x000b}, {0x0016, 0x0019}, {0x0017, 0x0005}, {0x0017, 0x0006}, {0x0009, 0x0003}, {0x0008, 0x0003}, - {0x000b, 0x0003}, {0x000d, 0x0004}, {0x0010, 0x0005}, {0x0012, 0x0006}, {0x0015, 0x000f}, {0x0017, 0x0007}, {0x0017, 0x0008}, {0x0017, 0x0009}, - {0x000d, 0x0005}, {0x000c, 0x0003}, {0x000e, 0x0003}, {0x0010, 0x0006}, {0x0012, 0x0007}, {0x0014, 0x000c}, {0x0017, 0x000a}, {0x0016, 0x001a}, - {0x0017, 0x000b}, {0x0017, 0x000c}, {0x0011, 0x0006}, {0x0010, 0x0007}, {0x0011, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0015, 0x0010}, - {0x0017, 0x000d}, {0x0017, 0x000e}, {0x0017, 0x000f}, {0x0017, 0x0010}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0014, 0x000d}, {0x0015, 0x0011}, - {0x0017, 0x0011}, {0x0016, 0x001b}, {0x0017, 0x0012}, {0x0017, 0x0013}, {0x0017, 0x0014}, {0x0017, 0x0015}, {0x0017, 0x0016}, {0x0015, 0x0012}, - {0x0015, 0x0013}, {0x0017, 0x0017}, {0x0016, 0x001c}, {0x0017, 0x0018}, {0x0017, 0x0019}, {0x0017, 0x001a}, {0x0017, 0x001b}, {0x0017, 0x001c}, - {0x0017, 0x001d}, {0x0017, 0x001e}, {0x0017, 0x001f}, {0x0017, 0x0020}, {0x0017, 0x0021}, {0x0017, 0x0022}, {0x0017, 0x0023}, {0x0017, 0x0024}, - {0x0017, 0x0025}, {0x0017, 0x0026}, {0x0017, 0x0027}, {0x0017, 0x0028}, {0x0017, 0x0029}, {0x0017, 0x002a}, {0x0017, 0x002b}, {0x0017, 0x002c}, - {0x0017, 0x002d}, {0x0017, 0x002e}, {0x0017, 0x002f}, {0x0016, 0x001d}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000d, 0x0002 }, + { 0x0011, 0x0004 }, + { 0x0014, 0x000a }, + { 0x0017, 0x0000 }, + { 0x0017, 0x0001 }, + { 0x0017, 0x0002 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0009, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x0010, 0x0004 }, + { 0x0013, 0x0007 }, + { 0x0016, 0x0018 }, + { 0x0017, 0x0003 }, + { 0x0017, 0x0004 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0008, 0x0002 }, + { 0x000b, 0x0002 }, + { 0x000e, 0x0002 }, + { 0x0011, 0x0005 }, + { 0x0014, 0x000b }, + { 0x0016, 0x0019 }, + { 0x0017, 0x0005 }, + { 0x0017, 0x0006 }, + { 0x0009, 0x0003 }, + { 0x0008, 0x0003 }, + { 0x000b, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0015, 0x000f }, + { 0x0017, 0x0007 }, + { 0x0017, 0x0008 }, + { 0x0017, 0x0009 }, + { 0x000d, 0x0005 }, + { 0x000c, 0x0003 }, + { 0x000e, 0x0003 }, + { 0x0010, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0014, 0x000c }, + { 0x0017, 0x000a }, + { 0x0016, 0x001a }, + { 0x0017, 0x000b }, + { 0x0017, 0x000c }, + { 0x0011, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0011, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0015, 0x0010 }, + { 0x0017, 0x000d }, + { 0x0017, 0x000e }, + { 0x0017, 0x000f }, + { 0x0017, 0x0010 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0014, 0x000d }, + { 0x0015, 0x0011 }, + { 0x0017, 0x0011 }, + { 0x0016, 0x001b }, + { 0x0017, 0x0012 }, + { 0x0017, 0x0013 }, + { 0x0017, 0x0014 }, + { 0x0017, 0x0015 }, + { 0x0017, 0x0016 }, + { 0x0015, 0x0012 }, + { 0x0015, 0x0013 }, + { 0x0017, 0x0017 }, + { 0x0016, 0x001c }, + { 0x0017, 0x0018 }, + { 0x0017, 0x0019 }, + { 0x0017, 0x001a }, + { 0x0017, 0x001b }, + { 0x0017, 0x001c }, + { 0x0017, 0x001d }, + { 0x0017, 0x001e }, + { 0x0017, 0x001f }, + { 0x0017, 0x0020 }, + { 0x0017, 0x0021 }, + { 0x0017, 0x0022 }, + { 0x0017, 0x0023 }, + { 0x0017, 0x0024 }, + { 0x0017, 0x0025 }, + { 0x0017, 0x0026 }, + { 0x0017, 0x0027 }, + { 0x0017, 0x0028 }, + { 0x0017, 0x0029 }, + { 0x0017, 0x002a }, + { 0x0017, 0x002b }, + { 0x0017, 0x002c }, + { 0x0017, 0x002d }, + { 0x0017, 0x002e }, + { 0x0017, 0x002f }, + { 0x0016, 0x001d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec9[22][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0004ffff, 0x00000016, 0x0000001f, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000029, 0x00010017, 0x00010017, 0x00010020, 0x00010020, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x000bffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x0000000f, 0x00000022, 0x0000002b, 0x00000033, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x000fffff, 0x000dffff, 0x000cffff, 0x000effff, 0x00000006, 0x0000001a, 0x0000002d, 0x0000003e, 0x00010010, 0x00010010, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, - {0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, - {0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x00010025, 0x00010025, }, - {0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x0001002e, 0x0001002e, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, - {0x0001003b, 0x0001003b, 0x00010040, 0x00010040, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010049, 0x00010049, }, - {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, - {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, - {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, +const uint32_t c_aauiCQMFHuffDec9[22][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00010001, + 0x00010001, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0004ffff, + 0x00000016, + 0x0000001f, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x00000029, + 0x00010017, + 0x00010017, + 0x00010020, + 0x00010020, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x000bffff, + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x0000000f, + 0x00000022, + 0x0000002b, + 0x00000033, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + }, + { + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + }, + { + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x000fffff, + 0x000dffff, + 0x000cffff, + 0x000effff, + 0x00000006, + 0x0000001a, + 0x0000002d, + 0x0000003e, + 0x00010010, + 0x00010010, + }, + { + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + }, + { + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + }, + { + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + }, + { + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x00010025, + 0x00010025, + }, + { + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x0001002e, + 0x0001002e, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + }, + { + 0x0001003b, + 0x0001003b, + 0x00010040, + 0x00010040, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010049, + 0x00010049, + }, + { + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + }, + { + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + }, + { + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + }, }; #endif @@ -522,80 +3119,991 @@ const uint32_t c_aauiCQMFHuffEnc10[169][2] = #else const uint16_t c_aauiCQMFHuffEnc10[169][2] = #endif -{ - {0x0001, 0x0001}, {0x0004, 0x0002}, {0x0005, 0x0002}, {0x0007, 0x0002}, {0x000a, 0x0002}, {0x000e, 0x0004}, {0x0011, 0x0007}, {0x0013, 0x0012}, - {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0003}, {0x0003, 0x0003}, {0x0004, 0x0004}, - {0x0007, 0x0003}, {0x000a, 0x0003}, {0x000d, 0x0004}, {0x0010, 0x0007}, {0x0013, 0x0013}, {0x0015, 0x0035}, {0x0016, 0x0005}, {0x0016, 0x0006}, - {0x0016, 0x0007}, {0x0016, 0x0008}, {0x0005, 0x0003}, {0x0004, 0x0005}, {0x0006, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000e, 0x0005}, - {0x0010, 0x0008}, {0x0013, 0x0014}, {0x0014, 0x001d}, {0x0016, 0x0009}, {0x0016, 0x000a}, {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0007, 0x0004}, - {0x0007, 0x0005}, {0x0008, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0005}, {0x000f, 0x0005}, {0x0011, 0x0008}, {0x0014, 0x001e}, {0x0014, 0x001f}, - {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, {0x000a, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0006}, - {0x000f, 0x0006}, {0x0011, 0x0009}, {0x0013, 0x0015}, {0x0014, 0x0020}, {0x0016, 0x0011}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0016, 0x0014}, - {0x0016, 0x0015}, {0x000e, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x000f, 0x0007}, {0x0011, 0x000a}, {0x0012, 0x000c}, {0x0016, 0x0016}, - {0x0016, 0x0017}, {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0016, 0x001a}, {0x0016, 0x001b}, {0x0016, 0x001c}, {0x0011, 0x000b}, {0x0010, 0x0009}, - {0x0011, 0x000c}, {0x0011, 0x000d}, {0x0013, 0x0016}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, {0x0016, 0x0021}, - {0x0016, 0x0022}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0012, 0x000d}, {0x0013, 0x0017}, {0x0016, 0x0025}, - {0x0016, 0x0026}, {0x0016, 0x0027}, {0x0016, 0x0028}, {0x0016, 0x0029}, {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, {0x0016, 0x002d}, - {0x0015, 0x0036}, {0x0015, 0x0037}, {0x0014, 0x0023}, {0x0015, 0x0038}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0016, 0x0031}, - {0x0016, 0x0032}, {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, - {0x0016, 0x003a}, {0x0016, 0x003b}, {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, - {0x0016, 0x0042}, {0x0016, 0x0043}, {0x0016, 0x0044}, {0x0016, 0x0045}, {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, - {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, - {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, - {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, - {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, - {0x0015, 0x0039}, + { + { 0x0001, 0x0001 }, + { 0x0004, 0x0002 }, + { 0x0005, 0x0002 }, + { 0x0007, 0x0002 }, + { 0x000a, 0x0002 }, + { 0x000e, 0x0004 }, + { 0x0011, 0x0007 }, + { 0x0013, 0x0012 }, + { 0x0016, 0x0000 }, + { 0x0016, 0x0001 }, + { 0x0016, 0x0002 }, + { 0x0016, 0x0003 }, + { 0x0016, 0x0004 }, + { 0x0004, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0004 }, + { 0x0007, 0x0003 }, + { 0x000a, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x0010, 0x0007 }, + { 0x0013, 0x0013 }, + { 0x0015, 0x0035 }, + { 0x0016, 0x0005 }, + { 0x0016, 0x0006 }, + { 0x0016, 0x0007 }, + { 0x0016, 0x0008 }, + { 0x0005, 0x0003 }, + { 0x0004, 0x0005 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0002 }, + { 0x000b, 0x0002 }, + { 0x000e, 0x0005 }, + { 0x0010, 0x0008 }, + { 0x0013, 0x0014 }, + { 0x0014, 0x001d }, + { 0x0016, 0x0009 }, + { 0x0016, 0x000a }, + { 0x0016, 0x000b }, + { 0x0016, 0x000c }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000f, 0x0005 }, + { 0x0011, 0x0008 }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0016, 0x000d }, + { 0x0016, 0x000e }, + { 0x0016, 0x000f }, + { 0x0016, 0x0010 }, + { 0x000a, 0x0005 }, + { 0x0009, 0x0003 }, + { 0x000b, 0x0003 }, + { 0x000d, 0x0006 }, + { 0x000f, 0x0006 }, + { 0x0011, 0x0009 }, + { 0x0013, 0x0015 }, + { 0x0014, 0x0020 }, + { 0x0016, 0x0011 }, + { 0x0016, 0x0012 }, + { 0x0016, 0x0013 }, + { 0x0016, 0x0014 }, + { 0x0016, 0x0015 }, + { 0x000e, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0007 }, + { 0x000f, 0x0007 }, + { 0x0011, 0x000a }, + { 0x0012, 0x000c }, + { 0x0016, 0x0016 }, + { 0x0016, 0x0017 }, + { 0x0016, 0x0018 }, + { 0x0016, 0x0019 }, + { 0x0016, 0x001a }, + { 0x0016, 0x001b }, + { 0x0016, 0x001c }, + { 0x0011, 0x000b }, + { 0x0010, 0x0009 }, + { 0x0011, 0x000c }, + { 0x0011, 0x000d }, + { 0x0013, 0x0016 }, + { 0x0016, 0x001d }, + { 0x0016, 0x001e }, + { 0x0016, 0x001f }, + { 0x0016, 0x0020 }, + { 0x0016, 0x0021 }, + { 0x0016, 0x0022 }, + { 0x0016, 0x0023 }, + { 0x0016, 0x0024 }, + { 0x0014, 0x0021 }, + { 0x0014, 0x0022 }, + { 0x0012, 0x000d }, + { 0x0013, 0x0017 }, + { 0x0016, 0x0025 }, + { 0x0016, 0x0026 }, + { 0x0016, 0x0027 }, + { 0x0016, 0x0028 }, + { 0x0016, 0x0029 }, + { 0x0016, 0x002a }, + { 0x0016, 0x002b }, + { 0x0016, 0x002c }, + { 0x0016, 0x002d }, + { 0x0015, 0x0036 }, + { 0x0015, 0x0037 }, + { 0x0014, 0x0023 }, + { 0x0015, 0x0038 }, + { 0x0016, 0x002e }, + { 0x0016, 0x002f }, + { 0x0016, 0x0030 }, + { 0x0016, 0x0031 }, + { 0x0016, 0x0032 }, + { 0x0016, 0x0033 }, + { 0x0016, 0x0034 }, + { 0x0016, 0x0035 }, + { 0x0016, 0x0036 }, + { 0x0016, 0x0037 }, + { 0x0016, 0x0038 }, + { 0x0016, 0x0039 }, + { 0x0016, 0x003a }, + { 0x0016, 0x003b }, + { 0x0016, 0x003c }, + { 0x0016, 0x003d }, + { 0x0016, 0x003e }, + { 0x0016, 0x003f }, + { 0x0016, 0x0040 }, + { 0x0016, 0x0041 }, + { 0x0016, 0x0042 }, + { 0x0016, 0x0043 }, + { 0x0016, 0x0044 }, + { 0x0016, 0x0045 }, + { 0x0016, 0x0046 }, + { 0x0016, 0x0047 }, + { 0x0016, 0x0048 }, + { 0x0016, 0x0049 }, + { 0x0016, 0x004a }, + { 0x0016, 0x004b }, + { 0x0016, 0x004c }, + { 0x0016, 0x004d }, + { 0x0016, 0x004e }, + { 0x0016, 0x004f }, + { 0x0016, 0x0050 }, + { 0x0016, 0x0051 }, + { 0x0016, 0x0052 }, + { 0x0016, 0x0053 }, + { 0x0016, 0x0054 }, + { 0x0016, 0x0055 }, + { 0x0016, 0x0056 }, + { 0x0016, 0x0057 }, + { 0x0016, 0x0058 }, + { 0x0016, 0x0059 }, + { 0x0016, 0x005a }, + { 0x0016, 0x005b }, + { 0x0016, 0x005c }, + { 0x0016, 0x005d }, + { 0x0016, 0x005e }, + { 0x0016, 0x005f }, + { 0x0016, 0x0060 }, + { 0x0016, 0x0061 }, + { 0x0016, 0x0062 }, + { 0x0016, 0x0063 }, + { 0x0016, 0x0064 }, + { 0x0016, 0x0065 }, + { 0x0016, 0x0066 }, + { 0x0016, 0x0067 }, + { 0x0016, 0x0068 }, + { 0x0016, 0x0069 }, + { 0x0015, 0x0039 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec10[45][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000001, 0x0000000d, 0x0000000f, 0x0000001b, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x0004ffff, 0x0003ffff, 0x0000001d, 0x00000029, 0x00010003, 0x00010003, 0x00010010, 0x00010010, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001001e, 0x0001001e, 0x00010036, 0x00010036, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, - {0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020043, 0x00020043, 0x00020043, 0x00020043, }, - {0x0012ffff, 0x000effff, 0x000dffff, 0x000affff, 0x0009ffff, 0x000bffff, 0x000cffff, 0x00000013, 0x00000020, 0x0000004f, 0x0001002c, 0x0001002c, 0x00010038, 0x00010038, 0x00010044, 0x00010044, }, - {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, - {0x0000003b, 0x0000005b, 0x0000005c, 0x0000006a, 0x00010007, 0x00010007, 0x00010014, 0x00010014, 0x00010021, 0x00010021, 0x0001003a, 0x0001003a, 0x00010052, 0x00010052, 0x0001005e, 0x0001005e, }, - {0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x00000022, 0x0000002e, 0x0000002f, }, - {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, - {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, - {0x0014ffff, 0x0017ffff, 0x0015ffff, 0x0016ffff, 0x001cffff, 0x0013ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, }, - {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, - {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, - {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, - {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, }, - {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, }, - {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x00020055, 0x00020055, 0x00020055, 0x00020055, }, - {0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, }, - {0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, }, - {0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, }, - {0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, - {0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, }, - {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, - {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, }, - {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, }, - {0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, - {0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, - {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, - {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, - {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, - {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, - {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, - {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, }, - {0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, }, - {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, - {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, +const uint32_t c_aauiCQMFHuffDec10[45][16] = { + { + 0x0002ffff, + 0x0001ffff, + 0x00000001, + 0x0000000d, + 0x0000000f, + 0x0000001b, + 0x0001000e, + 0x0001000e, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + }, + { + 0x0004ffff, + 0x0003ffff, + 0x0000001d, + 0x00000029, + 0x00010003, + 0x00010003, + 0x00010010, + 0x00010010, + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, + { + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x0008ffff, + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x0001001e, + 0x0001001e, + 0x00010036, + 0x00010036, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + }, + { + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020043, + 0x00020043, + 0x00020043, + 0x00020043, + }, + { + 0x0012ffff, + 0x000effff, + 0x000dffff, + 0x000affff, + 0x0009ffff, + 0x000bffff, + 0x000cffff, + 0x00000013, + 0x00000020, + 0x0000004f, + 0x0001002c, + 0x0001002c, + 0x00010038, + 0x00010038, + 0x00010044, + 0x00010044, + }, + { + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020046, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + }, + { + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + }, + { + 0x0000003b, + 0x0000005b, + 0x0000005c, + 0x0000006a, + 0x00010007, + 0x00010007, + 0x00010014, + 0x00010014, + 0x00010021, + 0x00010021, + 0x0001003a, + 0x0001003a, + 0x00010052, + 0x00010052, + 0x0001005e, + 0x0001005e, + }, + { + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x00000022, + 0x0000002e, + 0x0000002f, + }, + { + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + }, + { + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + }, + { + 0x0014ffff, + 0x0017ffff, + 0x0015ffff, + 0x0016ffff, + 0x001cffff, + 0x0013ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + }, + { + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + }, + { + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + }, + { + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020032, + }, + { + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + }, + { + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + }, + { + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020054, + 0x00020054, + 0x00020054, + 0x00020054, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + }, + { + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + }, + { + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + }, + { + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + }, + { + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + }, + { + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + }, + { + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + }, + { + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + }, + { + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + }, + { + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007d, + }, + { + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + }, + { + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020085, + }, + { + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020089, + 0x00020089, + 0x00020089, + 0x00020089, + }, + { + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008d, + 0x0002008d, + 0x0002008d, + 0x0002008d, + }, + { + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + }, + { + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020095, + }, + { + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020099, + 0x00020099, + 0x00020099, + 0x00020099, + }, + { + 0x0002009a, + 0x0002009a, + 0x0002009a, + 0x0002009a, + 0x0002009b, + 0x0002009b, + 0x0002009b, + 0x0002009b, + 0x0002009c, + 0x0002009c, + 0x0002009c, + 0x0002009c, + 0x0002009d, + 0x0002009d, + 0x0002009d, + 0x0002009d, + }, + { + 0x0002009e, + 0x0002009e, + 0x0002009e, + 0x0002009e, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a1, + 0x000200a1, + 0x000200a1, + 0x000200a1, + }, + { + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + }, }; #endif @@ -604,88 +4112,1108 @@ const uint32_t c_aauiCQMFHuffEnc11[196][2] = #else const uint16_t c_aauiCQMFHuffEnc11[196][2] = #endif -{ - {0x0001, 0x0001}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x000f, 0x0005}, {0x0012, 0x000d}, - {0x0014, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0004, 0x0004}, {0x0003, 0x0003}, - {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0004}, {0x000e, 0x0005}, {0x0010, 0x0007}, {0x0012, 0x000e}, {0x0014, 0x0020}, - {0x0016, 0x0005}, {0x0016, 0x0006}, {0x0016, 0x0007}, {0x0016, 0x0008}, {0x0005, 0x0005}, {0x0004, 0x0005}, {0x0006, 0x0004}, {0x0007, 0x0003}, - {0x000a, 0x0004}, {0x000c, 0x0005}, {0x000e, 0x0006}, {0x0011, 0x000a}, {0x0012, 0x000f}, {0x0015, 0x003b}, {0x0016, 0x0009}, {0x0016, 0x000a}, - {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0007, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0005}, - {0x000f, 0x0006}, {0x0012, 0x0010}, {0x0014, 0x0021}, {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, {0x0016, 0x0011}, - {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0006}, {0x000f, 0x0007}, {0x0011, 0x000b}, {0x0013, 0x0017}, - {0x0014, 0x0022}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0016, 0x0014}, {0x0016, 0x0015}, {0x0016, 0x0016}, {0x000c, 0x0006}, {0x000b, 0x0007}, - {0x000c, 0x0007}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x0010, 0x0008}, {0x0012, 0x0011}, {0x0014, 0x0023}, {0x0015, 0x003c}, {0x0016, 0x0017}, - {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0016, 0x001a}, {0x0016, 0x001b}, {0x000f, 0x0008}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0009}, - {0x0011, 0x000c}, {0x0013, 0x0018}, {0x0014, 0x0024}, {0x0016, 0x001c}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, - {0x0016, 0x0021}, {0x0016, 0x0022}, {0x0011, 0x000d}, {0x0010, 0x0009}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0014, 0x0025}, {0x0015, 0x003d}, - {0x0014, 0x0026}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0016, 0x0025}, {0x0016, 0x0026}, {0x0016, 0x0027}, {0x0016, 0x0028}, {0x0016, 0x0029}, - {0x0014, 0x0027}, {0x0013, 0x0019}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, - {0x0016, 0x002d}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0016, 0x0031}, {0x0016, 0x0032}, {0x0014, 0x002b}, {0x0014, 0x002c}, - {0x0014, 0x002d}, {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, - {0x0016, 0x003a}, {0x0016, 0x003b}, {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, - {0x0016, 0x0042}, {0x0016, 0x0043}, {0x0016, 0x0044}, {0x0016, 0x0045}, {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, - {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, - {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, - {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, - {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, - {0x0016, 0x006a}, {0x0016, 0x006b}, {0x0016, 0x006c}, {0x0016, 0x006d}, {0x0016, 0x006e}, {0x0016, 0x006f}, {0x0016, 0x0070}, {0x0016, 0x0071}, - {0x0016, 0x0072}, {0x0016, 0x0073}, {0x0016, 0x0074}, {0x0016, 0x0075}, + { + { 0x0001, 0x0001 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x0012, 0x000d }, + { 0x0014, 0x001f }, + { 0x0016, 0x0000 }, + { 0x0016, 0x0001 }, + { 0x0016, 0x0002 }, + { 0x0016, 0x0003 }, + { 0x0016, 0x0004 }, + { 0x0004, 0x0004 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0006, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x000b, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x0010, 0x0007 }, + { 0x0012, 0x000e }, + { 0x0014, 0x0020 }, + { 0x0016, 0x0005 }, + { 0x0016, 0x0006 }, + { 0x0016, 0x0007 }, + { 0x0016, 0x0008 }, + { 0x0005, 0x0005 }, + { 0x0004, 0x0005 }, + { 0x0006, 0x0004 }, + { 0x0007, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000e, 0x0006 }, + { 0x0011, 0x000a }, + { 0x0012, 0x000f }, + { 0x0015, 0x003b }, + { 0x0016, 0x0009 }, + { 0x0016, 0x000a }, + { 0x0016, 0x000b }, + { 0x0016, 0x000c }, + { 0x0007, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0005 }, + { 0x0009, 0x0005 }, + { 0x000b, 0x0005 }, + { 0x000d, 0x0005 }, + { 0x000f, 0x0006 }, + { 0x0012, 0x0010 }, + { 0x0014, 0x0021 }, + { 0x0016, 0x000d }, + { 0x0016, 0x000e }, + { 0x0016, 0x000f }, + { 0x0016, 0x0010 }, + { 0x0016, 0x0011 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000d, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x0011, 0x000b }, + { 0x0013, 0x0017 }, + { 0x0014, 0x0022 }, + { 0x0016, 0x0012 }, + { 0x0016, 0x0013 }, + { 0x0016, 0x0014 }, + { 0x0016, 0x0015 }, + { 0x0016, 0x0016 }, + { 0x000c, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0007 }, + { 0x0010, 0x0008 }, + { 0x0012, 0x0011 }, + { 0x0014, 0x0023 }, + { 0x0015, 0x003c }, + { 0x0016, 0x0017 }, + { 0x0016, 0x0018 }, + { 0x0016, 0x0019 }, + { 0x0016, 0x001a }, + { 0x0016, 0x001b }, + { 0x000f, 0x0008 }, + { 0x000e, 0x0008 }, + { 0x000e, 0x0009 }, + { 0x000f, 0x0009 }, + { 0x0011, 0x000c }, + { 0x0013, 0x0018 }, + { 0x0014, 0x0024 }, + { 0x0016, 0x001c }, + { 0x0016, 0x001d }, + { 0x0016, 0x001e }, + { 0x0016, 0x001f }, + { 0x0016, 0x0020 }, + { 0x0016, 0x0021 }, + { 0x0016, 0x0022 }, + { 0x0011, 0x000d }, + { 0x0010, 0x0009 }, + { 0x0012, 0x0012 }, + { 0x0012, 0x0013 }, + { 0x0014, 0x0025 }, + { 0x0015, 0x003d }, + { 0x0014, 0x0026 }, + { 0x0016, 0x0023 }, + { 0x0016, 0x0024 }, + { 0x0016, 0x0025 }, + { 0x0016, 0x0026 }, + { 0x0016, 0x0027 }, + { 0x0016, 0x0028 }, + { 0x0016, 0x0029 }, + { 0x0014, 0x0027 }, + { 0x0013, 0x0019 }, + { 0x0014, 0x0028 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0016, 0x002a }, + { 0x0016, 0x002b }, + { 0x0016, 0x002c }, + { 0x0016, 0x002d }, + { 0x0016, 0x002e }, + { 0x0016, 0x002f }, + { 0x0016, 0x0030 }, + { 0x0016, 0x0031 }, + { 0x0016, 0x0032 }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0014, 0x002d }, + { 0x0016, 0x0033 }, + { 0x0016, 0x0034 }, + { 0x0016, 0x0035 }, + { 0x0016, 0x0036 }, + { 0x0016, 0x0037 }, + { 0x0016, 0x0038 }, + { 0x0016, 0x0039 }, + { 0x0016, 0x003a }, + { 0x0016, 0x003b }, + { 0x0016, 0x003c }, + { 0x0016, 0x003d }, + { 0x0016, 0x003e }, + { 0x0016, 0x003f }, + { 0x0016, 0x0040 }, + { 0x0016, 0x0041 }, + { 0x0016, 0x0042 }, + { 0x0016, 0x0043 }, + { 0x0016, 0x0044 }, + { 0x0016, 0x0045 }, + { 0x0016, 0x0046 }, + { 0x0016, 0x0047 }, + { 0x0016, 0x0048 }, + { 0x0016, 0x0049 }, + { 0x0016, 0x004a }, + { 0x0016, 0x004b }, + { 0x0016, 0x004c }, + { 0x0016, 0x004d }, + { 0x0016, 0x004e }, + { 0x0016, 0x004f }, + { 0x0016, 0x0050 }, + { 0x0016, 0x0051 }, + { 0x0016, 0x0052 }, + { 0x0016, 0x0053 }, + { 0x0016, 0x0054 }, + { 0x0016, 0x0055 }, + { 0x0016, 0x0056 }, + { 0x0016, 0x0057 }, + { 0x0016, 0x0058 }, + { 0x0016, 0x0059 }, + { 0x0016, 0x005a }, + { 0x0016, 0x005b }, + { 0x0016, 0x005c }, + { 0x0016, 0x005d }, + { 0x0016, 0x005e }, + { 0x0016, 0x005f }, + { 0x0016, 0x0060 }, + { 0x0016, 0x0061 }, + { 0x0016, 0x0062 }, + { 0x0016, 0x0063 }, + { 0x0016, 0x0064 }, + { 0x0016, 0x0065 }, + { 0x0016, 0x0066 }, + { 0x0016, 0x0067 }, + { 0x0016, 0x0068 }, + { 0x0016, 0x0069 }, + { 0x0016, 0x006a }, + { 0x0016, 0x006b }, + { 0x0016, 0x006c }, + { 0x0016, 0x006d }, + { 0x0016, 0x006e }, + { 0x0016, 0x006f }, + { 0x0016, 0x0070 }, + { 0x0016, 0x0071 }, + { 0x0016, 0x0072 }, + { 0x0016, 0x0073 }, + { 0x0016, 0x0074 }, + { 0x0016, 0x0075 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec11[50][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x0000000e, 0x0000001d, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0007ffff, 0x0005ffff, 0x0004ffff, 0x0006ffff, 0x00010003, 0x00010003, 0x0001001f, 0x0001001f, 0x0001002a, 0x0001002a, 0x0001002c, 0x0001002c, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x000bffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000021, 0x00000046, 0x00000048, 0x00010013, 0x00010013, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, - {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x00010054, 0x00010054, 0x00010057, 0x00010057, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, - {0x0014ffff, 0x0011ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x000cffff, 0x000dffff, 0x00000015, 0x0000004b, 0x00000063, 0x00010006, 0x00010006, 0x00010030, 0x00010030, 0x0001003d, 0x0001003d, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, }, - {0x00010059, 0x00010059, 0x00010071, 0x00010071, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, - {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, - {0x00000017, 0x00000032, 0x00000040, 0x0000004d, 0x0000005a, 0x00000066, 0x00000068, 0x00000070, 0x00000072, 0x00000073, 0x00000074, 0x0000007e, 0x0000007f, 0x00000080, 0x0001003f, 0x0001003f, }, - {0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0013ffff, 0x0012ffff, 0x00000008, }, - {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, - {0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x001affff, 0x0019ffff, 0x0015ffff, 0x0018ffff, 0x001dffff, 0x0016ffff, 0x0017ffff, 0x001bffff, 0x001cffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, - {0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, - {0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, - {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, }, - {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, - {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, - {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, - {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, }, - {0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, }, - {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, - {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, - {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, - {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, - {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, - {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, - {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, - {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, - {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, }, - {0x0002009a, 0x0002009a, 0x0002009a, 0x0002009a, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009b, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009c, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, }, - {0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, - {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, - {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, - {0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, }, - {0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, }, - {0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, }, - {0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200b9, }, - {0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, }, - {0x000200be, 0x000200be, 0x000200be, 0x000200be, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, }, +const uint32_t c_aauiCQMFHuffDec11[50][16] = { + { + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000001, + 0x0000000e, + 0x0000001d, + 0x0001000f, + 0x0001000f, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0007ffff, + 0x0005ffff, + 0x0004ffff, + 0x0006ffff, + 0x00010003, + 0x00010003, + 0x0001001f, + 0x0001001f, + 0x0001002a, + 0x0001002a, + 0x0001002c, + 0x0001002c, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x000bffff, + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x00000005, + 0x00000021, + 0x00000046, + 0x00000048, + 0x00010013, + 0x00010013, + 0x0001002e, + 0x0001002e, + 0x0001003b, + 0x0001003b, + 0x00010047, + 0x00010047, + }, + { + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + }, + { + 0x00010054, + 0x00010054, + 0x00010057, + 0x00010057, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + }, + { + 0x0014ffff, + 0x0011ffff, + 0x0010ffff, + 0x000effff, + 0x000fffff, + 0x000cffff, + 0x000dffff, + 0x00000015, + 0x0000004b, + 0x00000063, + 0x00010006, + 0x00010006, + 0x00010030, + 0x00010030, + 0x0001003d, + 0x0001003d, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + }, + { + 0x00010059, + 0x00010059, + 0x00010071, + 0x00010071, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + }, + { + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + }, + { + 0x00000017, + 0x00000032, + 0x00000040, + 0x0000004d, + 0x0000005a, + 0x00000066, + 0x00000068, + 0x00000070, + 0x00000072, + 0x00000073, + 0x00000074, + 0x0000007e, + 0x0000007f, + 0x00000080, + 0x0001003f, + 0x0001003f, + }, + { + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0013ffff, + 0x0012ffff, + 0x00000008, + }, + { + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + }, + { + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + }, + { + 0x001affff, + 0x0019ffff, + 0x0015ffff, + 0x0018ffff, + 0x001dffff, + 0x0016ffff, + 0x0017ffff, + 0x001bffff, + 0x001cffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + }, + { + 0x00020043, + 0x00020043, + 0x00020043, + 0x00020043, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020045, + 0x00020045, + 0x00020045, + 0x00020045, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + }, + { + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + }, + { + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020035, + }, + { + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + }, + { + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + }, + { + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + }, + { + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020042, + }, + { + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + }, + { + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + }, + { + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + }, + { + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + }, + { + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020085, + }, + { + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020089, + 0x00020089, + 0x00020089, + 0x00020089, + }, + { + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008d, + 0x0002008d, + 0x0002008d, + 0x0002008d, + }, + { + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + }, + { + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020095, + }, + { + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020099, + 0x00020099, + 0x00020099, + 0x00020099, + }, + { + 0x0002009a, + 0x0002009a, + 0x0002009a, + 0x0002009a, + 0x0002009b, + 0x0002009b, + 0x0002009b, + 0x0002009b, + 0x0002009c, + 0x0002009c, + 0x0002009c, + 0x0002009c, + 0x0002009d, + 0x0002009d, + 0x0002009d, + 0x0002009d, + }, + { + 0x0002009e, + 0x0002009e, + 0x0002009e, + 0x0002009e, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a1, + 0x000200a1, + 0x000200a1, + 0x000200a1, + }, + { + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + }, + { + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a9, + 0x000200a9, + 0x000200a9, + 0x000200a9, + }, + { + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ad, + 0x000200ad, + 0x000200ad, + 0x000200ad, + }, + { + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b1, + 0x000200b1, + 0x000200b1, + 0x000200b1, + }, + { + 0x000200b2, + 0x000200b2, + 0x000200b2, + 0x000200b2, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b5, + 0x000200b5, + 0x000200b5, + 0x000200b5, + }, + { + 0x000200b6, + 0x000200b6, + 0x000200b6, + 0x000200b6, + 0x000200b7, + 0x000200b7, + 0x000200b7, + 0x000200b7, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200b9, + 0x000200b9, + 0x000200b9, + 0x000200b9, + }, + { + 0x000200ba, + 0x000200ba, + 0x000200ba, + 0x000200ba, + 0x000200bb, + 0x000200bb, + 0x000200bb, + 0x000200bb, + 0x000200bc, + 0x000200bc, + 0x000200bc, + 0x000200bc, + 0x000200bd, + 0x000200bd, + 0x000200bd, + 0x000200bd, + }, + { + 0x000200be, + 0x000200be, + 0x000200be, + 0x000200be, + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x000200c1, + 0x000200c1, + 0x000200c1, + 0x000200c1, + }, }; #endif @@ -694,126 +5222,1669 @@ const uint32_t c_aauiCQMFHuffEnc12[289][2] = #else const uint16_t c_aauiCQMFHuffEnc12[289][2] = #endif -{ - {0x0001, 0x0001}, {0x0004, 0x0004}, {0x0005, 0x0004}, {0x0007, 0x0004}, {0x0008, 0x0002}, {0x000b, 0x0004}, {0x000e, 0x0006}, {0x0010, 0x0009}, - {0x0012, 0x0014}, {0x0013, 0x001f}, {0x0016, 0x0000}, {0x0016, 0x0001}, {0x0016, 0x0002}, {0x0016, 0x0003}, {0x0016, 0x0004}, {0x0016, 0x0005}, - {0x0016, 0x0006}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0005, 0x0005}, {0x0006, 0x0003}, {0x0008, 0x0003}, {0x000a, 0x0004}, {0x000d, 0x0006}, - {0x000f, 0x0008}, {0x0011, 0x000c}, {0x0013, 0x0020}, {0x0016, 0x0007}, {0x0015, 0x0063}, {0x0016, 0x0008}, {0x0016, 0x0009}, {0x0016, 0x000a}, - {0x0016, 0x000b}, {0x0016, 0x000c}, {0x0005, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0007}, {0x0006, 0x0004}, {0x0008, 0x0004}, {0x000b, 0x0005}, - {0x000d, 0x0007}, {0x0010, 0x000a}, {0x0012, 0x0015}, {0x0015, 0x0064}, {0x0016, 0x000d}, {0x0016, 0x000e}, {0x0016, 0x000f}, {0x0016, 0x0010}, - {0x0016, 0x0011}, {0x0016, 0x0012}, {0x0016, 0x0013}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0008, 0x0005}, {0x000a, 0x0005}, - {0x000c, 0x0005}, {0x000e, 0x0007}, {0x0010, 0x000b}, {0x0012, 0x0016}, {0x0014, 0x0037}, {0x0015, 0x0065}, {0x0016, 0x0014}, {0x0016, 0x0015}, - {0x0016, 0x0016}, {0x0016, 0x0017}, {0x0016, 0x0018}, {0x0016, 0x0019}, {0x0008, 0x0006}, {0x0007, 0x0005}, {0x0008, 0x0007}, {0x000a, 0x0006}, - {0x000c, 0x0006}, {0x000e, 0x0008}, {0x0010, 0x000c}, {0x0011, 0x000d}, {0x0013, 0x0021}, {0x0015, 0x0066}, {0x0016, 0x001a}, {0x0016, 0x001b}, - {0x0016, 0x001c}, {0x0016, 0x001d}, {0x0016, 0x001e}, {0x0016, 0x001f}, {0x0016, 0x0020}, {0x000b, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0007}, - {0x000c, 0x0007}, {0x000e, 0x0009}, {0x000f, 0x0009}, {0x0011, 0x000e}, {0x0013, 0x0022}, {0x0015, 0x0067}, {0x0015, 0x0068}, {0x0016, 0x0021}, - {0x0016, 0x0022}, {0x0016, 0x0023}, {0x0016, 0x0024}, {0x0016, 0x0025}, {0x0016, 0x0026}, {0x0016, 0x0027}, {0x000e, 0x000a}, {0x000d, 0x0008}, - {0x000d, 0x0009}, {0x000e, 0x000b}, {0x000f, 0x000a}, {0x0011, 0x000f}, {0x0013, 0x0023}, {0x0014, 0x0038}, {0x0016, 0x0028}, {0x0016, 0x0029}, - {0x0016, 0x002a}, {0x0016, 0x002b}, {0x0016, 0x002c}, {0x0016, 0x002d}, {0x0016, 0x002e}, {0x0016, 0x002f}, {0x0016, 0x0030}, {0x0010, 0x000d}, - {0x000f, 0x000b}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0012, 0x0017}, {0x0013, 0x0024}, {0x0014, 0x0039}, {0x0016, 0x0031}, {0x0016, 0x0032}, - {0x0016, 0x0033}, {0x0016, 0x0034}, {0x0016, 0x0035}, {0x0016, 0x0036}, {0x0016, 0x0037}, {0x0016, 0x0038}, {0x0016, 0x0039}, {0x0016, 0x003a}, - {0x0013, 0x0025}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0016, 0x003b}, - {0x0016, 0x003c}, {0x0016, 0x003d}, {0x0016, 0x003e}, {0x0016, 0x003f}, {0x0016, 0x0040}, {0x0016, 0x0041}, {0x0016, 0x0042}, {0x0016, 0x0043}, - {0x0016, 0x0044}, {0x0015, 0x0069}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0015, 0x006a}, {0x0015, 0x006b}, {0x0015, 0x006c}, {0x0016, 0x0045}, - {0x0016, 0x0046}, {0x0016, 0x0047}, {0x0016, 0x0048}, {0x0016, 0x0049}, {0x0016, 0x004a}, {0x0016, 0x004b}, {0x0016, 0x004c}, {0x0016, 0x004d}, - {0x0016, 0x004e}, {0x0016, 0x004f}, {0x0016, 0x0050}, {0x0016, 0x0051}, {0x0015, 0x006d}, {0x0016, 0x0052}, {0x0016, 0x0053}, {0x0016, 0x0054}, - {0x0016, 0x0055}, {0x0016, 0x0056}, {0x0016, 0x0057}, {0x0016, 0x0058}, {0x0016, 0x0059}, {0x0016, 0x005a}, {0x0016, 0x005b}, {0x0016, 0x005c}, - {0x0016, 0x005d}, {0x0016, 0x005e}, {0x0016, 0x005f}, {0x0016, 0x0060}, {0x0016, 0x0061}, {0x0016, 0x0062}, {0x0016, 0x0063}, {0x0016, 0x0064}, - {0x0016, 0x0065}, {0x0016, 0x0066}, {0x0016, 0x0067}, {0x0016, 0x0068}, {0x0016, 0x0069}, {0x0016, 0x006a}, {0x0016, 0x006b}, {0x0016, 0x006c}, - {0x0016, 0x006d}, {0x0016, 0x006e}, {0x0016, 0x006f}, {0x0016, 0x0070}, {0x0016, 0x0071}, {0x0016, 0x0072}, {0x0016, 0x0073}, {0x0016, 0x0074}, - {0x0016, 0x0075}, {0x0016, 0x0076}, {0x0016, 0x0077}, {0x0016, 0x0078}, {0x0016, 0x0079}, {0x0016, 0x007a}, {0x0016, 0x007b}, {0x0016, 0x007c}, - {0x0016, 0x007d}, {0x0016, 0x007e}, {0x0016, 0x007f}, {0x0016, 0x0080}, {0x0016, 0x0081}, {0x0016, 0x0082}, {0x0016, 0x0083}, {0x0016, 0x0084}, - {0x0016, 0x0085}, {0x0016, 0x0086}, {0x0016, 0x0087}, {0x0016, 0x0088}, {0x0016, 0x0089}, {0x0016, 0x008a}, {0x0016, 0x008b}, {0x0016, 0x008c}, - {0x0016, 0x008d}, {0x0016, 0x008e}, {0x0016, 0x008f}, {0x0016, 0x0090}, {0x0016, 0x0091}, {0x0016, 0x0092}, {0x0016, 0x0093}, {0x0016, 0x0094}, - {0x0016, 0x0095}, {0x0016, 0x0096}, {0x0016, 0x0097}, {0x0016, 0x0098}, {0x0016, 0x0099}, {0x0016, 0x009a}, {0x0016, 0x009b}, {0x0016, 0x009c}, - {0x0016, 0x009d}, {0x0016, 0x009e}, {0x0016, 0x009f}, {0x0016, 0x00a0}, {0x0016, 0x00a1}, {0x0016, 0x00a2}, {0x0016, 0x00a3}, {0x0016, 0x00a4}, - {0x0016, 0x00a5}, {0x0016, 0x00a6}, {0x0016, 0x00a7}, {0x0016, 0x00a8}, {0x0016, 0x00a9}, {0x0016, 0x00aa}, {0x0016, 0x00ab}, {0x0016, 0x00ac}, - {0x0016, 0x00ad}, {0x0016, 0x00ae}, {0x0016, 0x00af}, {0x0016, 0x00b0}, {0x0016, 0x00b1}, {0x0016, 0x00b2}, {0x0016, 0x00b3}, {0x0016, 0x00b4}, - {0x0016, 0x00b5}, {0x0016, 0x00b6}, {0x0016, 0x00b7}, {0x0016, 0x00b8}, {0x0016, 0x00b9}, {0x0016, 0x00ba}, {0x0016, 0x00bb}, {0x0016, 0x00bc}, - {0x0016, 0x00bd}, {0x0016, 0x00be}, {0x0016, 0x00bf}, {0x0016, 0x00c0}, {0x0016, 0x00c1}, {0x0016, 0x00c2}, {0x0016, 0x00c3}, {0x0016, 0x00c4}, - {0x0016, 0x00c5}, + { + { 0x0001, 0x0001 }, + { 0x0004, 0x0004 }, + { 0x0005, 0x0004 }, + { 0x0007, 0x0004 }, + { 0x0008, 0x0002 }, + { 0x000b, 0x0004 }, + { 0x000e, 0x0006 }, + { 0x0010, 0x0009 }, + { 0x0012, 0x0014 }, + { 0x0013, 0x001f }, + { 0x0016, 0x0000 }, + { 0x0016, 0x0001 }, + { 0x0016, 0x0002 }, + { 0x0016, 0x0003 }, + { 0x0016, 0x0004 }, + { 0x0016, 0x0005 }, + { 0x0016, 0x0006 }, + { 0x0004, 0x0005 }, + { 0x0004, 0x0006 }, + { 0x0005, 0x0005 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000d, 0x0006 }, + { 0x000f, 0x0008 }, + { 0x0011, 0x000c }, + { 0x0013, 0x0020 }, + { 0x0016, 0x0007 }, + { 0x0015, 0x0063 }, + { 0x0016, 0x0008 }, + { 0x0016, 0x0009 }, + { 0x0016, 0x000a }, + { 0x0016, 0x000b }, + { 0x0016, 0x000c }, + { 0x0005, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0004 }, + { 0x0008, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000d, 0x0007 }, + { 0x0010, 0x000a }, + { 0x0012, 0x0015 }, + { 0x0015, 0x0064 }, + { 0x0016, 0x000d }, + { 0x0016, 0x000e }, + { 0x0016, 0x000f }, + { 0x0016, 0x0010 }, + { 0x0016, 0x0011 }, + { 0x0016, 0x0012 }, + { 0x0016, 0x0013 }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0008, 0x0005 }, + { 0x000a, 0x0005 }, + { 0x000c, 0x0005 }, + { 0x000e, 0x0007 }, + { 0x0010, 0x000b }, + { 0x0012, 0x0016 }, + { 0x0014, 0x0037 }, + { 0x0015, 0x0065 }, + { 0x0016, 0x0014 }, + { 0x0016, 0x0015 }, + { 0x0016, 0x0016 }, + { 0x0016, 0x0017 }, + { 0x0016, 0x0018 }, + { 0x0016, 0x0019 }, + { 0x0008, 0x0006 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0007 }, + { 0x000a, 0x0006 }, + { 0x000c, 0x0006 }, + { 0x000e, 0x0008 }, + { 0x0010, 0x000c }, + { 0x0011, 0x000d }, + { 0x0013, 0x0021 }, + { 0x0015, 0x0066 }, + { 0x0016, 0x001a }, + { 0x0016, 0x001b }, + { 0x0016, 0x001c }, + { 0x0016, 0x001d }, + { 0x0016, 0x001e }, + { 0x0016, 0x001f }, + { 0x0016, 0x0020 }, + { 0x000b, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0007 }, + { 0x000e, 0x0009 }, + { 0x000f, 0x0009 }, + { 0x0011, 0x000e }, + { 0x0013, 0x0022 }, + { 0x0015, 0x0067 }, + { 0x0015, 0x0068 }, + { 0x0016, 0x0021 }, + { 0x0016, 0x0022 }, + { 0x0016, 0x0023 }, + { 0x0016, 0x0024 }, + { 0x0016, 0x0025 }, + { 0x0016, 0x0026 }, + { 0x0016, 0x0027 }, + { 0x000e, 0x000a }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000e, 0x000b }, + { 0x000f, 0x000a }, + { 0x0011, 0x000f }, + { 0x0013, 0x0023 }, + { 0x0014, 0x0038 }, + { 0x0016, 0x0028 }, + { 0x0016, 0x0029 }, + { 0x0016, 0x002a }, + { 0x0016, 0x002b }, + { 0x0016, 0x002c }, + { 0x0016, 0x002d }, + { 0x0016, 0x002e }, + { 0x0016, 0x002f }, + { 0x0016, 0x0030 }, + { 0x0010, 0x000d }, + { 0x000f, 0x000b }, + { 0x0010, 0x000e }, + { 0x0010, 0x000f }, + { 0x0012, 0x0017 }, + { 0x0013, 0x0024 }, + { 0x0014, 0x0039 }, + { 0x0016, 0x0031 }, + { 0x0016, 0x0032 }, + { 0x0016, 0x0033 }, + { 0x0016, 0x0034 }, + { 0x0016, 0x0035 }, + { 0x0016, 0x0036 }, + { 0x0016, 0x0037 }, + { 0x0016, 0x0038 }, + { 0x0016, 0x0039 }, + { 0x0016, 0x003a }, + { 0x0013, 0x0025 }, + { 0x0011, 0x0010 }, + { 0x0011, 0x0011 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0016, 0x003b }, + { 0x0016, 0x003c }, + { 0x0016, 0x003d }, + { 0x0016, 0x003e }, + { 0x0016, 0x003f }, + { 0x0016, 0x0040 }, + { 0x0016, 0x0041 }, + { 0x0016, 0x0042 }, + { 0x0016, 0x0043 }, + { 0x0016, 0x0044 }, + { 0x0015, 0x0069 }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x0015, 0x006a }, + { 0x0015, 0x006b }, + { 0x0015, 0x006c }, + { 0x0016, 0x0045 }, + { 0x0016, 0x0046 }, + { 0x0016, 0x0047 }, + { 0x0016, 0x0048 }, + { 0x0016, 0x0049 }, + { 0x0016, 0x004a }, + { 0x0016, 0x004b }, + { 0x0016, 0x004c }, + { 0x0016, 0x004d }, + { 0x0016, 0x004e }, + { 0x0016, 0x004f }, + { 0x0016, 0x0050 }, + { 0x0016, 0x0051 }, + { 0x0015, 0x006d }, + { 0x0016, 0x0052 }, + { 0x0016, 0x0053 }, + { 0x0016, 0x0054 }, + { 0x0016, 0x0055 }, + { 0x0016, 0x0056 }, + { 0x0016, 0x0057 }, + { 0x0016, 0x0058 }, + { 0x0016, 0x0059 }, + { 0x0016, 0x005a }, + { 0x0016, 0x005b }, + { 0x0016, 0x005c }, + { 0x0016, 0x005d }, + { 0x0016, 0x005e }, + { 0x0016, 0x005f }, + { 0x0016, 0x0060 }, + { 0x0016, 0x0061 }, + { 0x0016, 0x0062 }, + { 0x0016, 0x0063 }, + { 0x0016, 0x0064 }, + { 0x0016, 0x0065 }, + { 0x0016, 0x0066 }, + { 0x0016, 0x0067 }, + { 0x0016, 0x0068 }, + { 0x0016, 0x0069 }, + { 0x0016, 0x006a }, + { 0x0016, 0x006b }, + { 0x0016, 0x006c }, + { 0x0016, 0x006d }, + { 0x0016, 0x006e }, + { 0x0016, 0x006f }, + { 0x0016, 0x0070 }, + { 0x0016, 0x0071 }, + { 0x0016, 0x0072 }, + { 0x0016, 0x0073 }, + { 0x0016, 0x0074 }, + { 0x0016, 0x0075 }, + { 0x0016, 0x0076 }, + { 0x0016, 0x0077 }, + { 0x0016, 0x0078 }, + { 0x0016, 0x0079 }, + { 0x0016, 0x007a }, + { 0x0016, 0x007b }, + { 0x0016, 0x007c }, + { 0x0016, 0x007d }, + { 0x0016, 0x007e }, + { 0x0016, 0x007f }, + { 0x0016, 0x0080 }, + { 0x0016, 0x0081 }, + { 0x0016, 0x0082 }, + { 0x0016, 0x0083 }, + { 0x0016, 0x0084 }, + { 0x0016, 0x0085 }, + { 0x0016, 0x0086 }, + { 0x0016, 0x0087 }, + { 0x0016, 0x0088 }, + { 0x0016, 0x0089 }, + { 0x0016, 0x008a }, + { 0x0016, 0x008b }, + { 0x0016, 0x008c }, + { 0x0016, 0x008d }, + { 0x0016, 0x008e }, + { 0x0016, 0x008f }, + { 0x0016, 0x0090 }, + { 0x0016, 0x0091 }, + { 0x0016, 0x0092 }, + { 0x0016, 0x0093 }, + { 0x0016, 0x0094 }, + { 0x0016, 0x0095 }, + { 0x0016, 0x0096 }, + { 0x0016, 0x0097 }, + { 0x0016, 0x0098 }, + { 0x0016, 0x0099 }, + { 0x0016, 0x009a }, + { 0x0016, 0x009b }, + { 0x0016, 0x009c }, + { 0x0016, 0x009d }, + { 0x0016, 0x009e }, + { 0x0016, 0x009f }, + { 0x0016, 0x00a0 }, + { 0x0016, 0x00a1 }, + { 0x0016, 0x00a2 }, + { 0x0016, 0x00a3 }, + { 0x0016, 0x00a4 }, + { 0x0016, 0x00a5 }, + { 0x0016, 0x00a6 }, + { 0x0016, 0x00a7 }, + { 0x0016, 0x00a8 }, + { 0x0016, 0x00a9 }, + { 0x0016, 0x00aa }, + { 0x0016, 0x00ab }, + { 0x0016, 0x00ac }, + { 0x0016, 0x00ad }, + { 0x0016, 0x00ae }, + { 0x0016, 0x00af }, + { 0x0016, 0x00b0 }, + { 0x0016, 0x00b1 }, + { 0x0016, 0x00b2 }, + { 0x0016, 0x00b3 }, + { 0x0016, 0x00b4 }, + { 0x0016, 0x00b5 }, + { 0x0016, 0x00b6 }, + { 0x0016, 0x00b7 }, + { 0x0016, 0x00b8 }, + { 0x0016, 0x00b9 }, + { 0x0016, 0x00ba }, + { 0x0016, 0x00bb }, + { 0x0016, 0x00bc }, + { 0x0016, 0x00bd }, + { 0x0016, 0x00be }, + { 0x0016, 0x00bf }, + { 0x0016, 0x00c0 }, + { 0x0016, 0x00c1 }, + { 0x0016, 0x00c2 }, + { 0x0016, 0x00c3 }, + { 0x0016, 0x00c4 }, + { 0x0016, 0x00c5 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec12[76][16] = -{ - {0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000001, 0x00000011, 0x00000012, 0x00000023, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x0006ffff, 0x0005ffff, 0x00000004, 0x00000015, 0x00000026, 0x00000036, 0x00000044, 0x00000046, 0x00010003, 0x00010003, 0x00010045, 0x00010045, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020035, 0x00020035, 0x00020035, 0x00020035, }, - {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x000bffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000038, 0x00000048, 0x00000058, 0x00010005, 0x00010005, 0x00010027, 0x00010027, 0x00010055, 0x00010055, 0x00010057, 0x00010057, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, - {0x00010018, 0x00010018, 0x0001005a, 0x0001005a, 0x0001006a, 0x0001006a, 0x00010078, 0x00010078, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020069, 0x00020069, 0x00020069, 0x00020069, }, - {0x0018ffff, 0x0029ffff, 0x003affff, 0x0010ffff, 0x0011ffff, 0x000fffff, 0x000cffff, 0x000dffff, 0x000effff, 0x00000007, 0x00000029, 0x0000003a, 0x0000004a, 0x00000077, 0x00000079, 0x0000007a, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, - {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, - {0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, - {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, }, - {0x004bffff, 0x0012ffff, 0x0015ffff, 0x0013ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x0000003c, 0x0000006d, 0x0000007d, 0x0000008d, 0x0000008e, 0x0000009a, 0x0000009b, 0x00010009, 0x00010009, }, - {0x0001001a, 0x0001001a, 0x0001004c, 0x0001004c, 0x0001005c, 0x0001005c, 0x0001006c, 0x0001006c, 0x0001007c, 0x0001007c, 0x00010088, 0x00010088, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, }, - {0x0002011f, 0x0002011f, 0x0002011f, 0x0002011f, 0x00020120, 0x00020120, 0x00020120, 0x00020120, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, - {0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, 0x00030099, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, }, - {0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, }, - {0x0025ffff, 0x001fffff, 0x0019ffff, 0x0020ffff, 0x001effff, 0x0021ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, }, - {0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, - {0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, - {0x00020054, 0x00020054, 0x00020054, 0x00020054, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, }, - {0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, }, - {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, - {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, - {0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, }, - {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, }, - {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, - {0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, - {0x00020085, 0x00020085, 0x00020085, 0x00020085, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, }, - {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, }, - {0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, }, - {0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, 0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, }, - {0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x0002009f, 0x0002009f, 0x0002009f, 0x0002009f, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a0, 0x000200a1, 0x000200a1, 0x000200a1, 0x000200a1, }, - {0x000200a2, 0x000200a2, 0x000200a2, 0x000200a2, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, - {0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, - {0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, }, - {0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, }, - {0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, }, - {0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200b9, 0x000200ba, 0x000200ba, 0x000200ba, 0x000200ba, }, - {0x000200bb, 0x000200bb, 0x000200bb, 0x000200bb, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bc, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200bd, 0x000200be, 0x000200be, 0x000200be, 0x000200be, }, - {0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, }, - {0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c6, 0x000200c6, 0x000200c6, 0x000200c6, }, - {0x000200c7, 0x000200c7, 0x000200c7, 0x000200c7, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200ca, 0x000200ca, 0x000200ca, 0x000200ca, }, - {0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x000200cd, 0x000200cd, 0x000200cd, 0x000200cd, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, }, - {0x000200cf, 0x000200cf, 0x000200cf, 0x000200cf, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d0, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d1, 0x000200d2, 0x000200d2, 0x000200d2, 0x000200d2, }, - {0x000200d3, 0x000200d3, 0x000200d3, 0x000200d3, 0x000200d4, 0x000200d4, 0x000200d4, 0x000200d4, 0x000200d5, 0x000200d5, 0x000200d5, 0x000200d5, 0x000200d6, 0x000200d6, 0x000200d6, 0x000200d6, }, - {0x000200d7, 0x000200d7, 0x000200d7, 0x000200d7, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d9, 0x000200d9, 0x000200d9, 0x000200d9, 0x000200da, 0x000200da, 0x000200da, 0x000200da, }, - {0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, }, - {0x000200db, 0x000200db, 0x000200db, 0x000200db, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200de, 0x000200de, 0x000200de, 0x000200de, }, - {0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200e0, 0x000200e0, 0x000200e0, 0x000200e0, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x000200e2, 0x000200e2, 0x000200e2, 0x000200e2, }, - {0x000200e3, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200e6, 0x000200e6, 0x000200e6, 0x000200e6, }, - {0x000200e7, 0x000200e7, 0x000200e7, 0x000200e7, 0x000200e8, 0x000200e8, 0x000200e8, 0x000200e8, 0x000200e9, 0x000200e9, 0x000200e9, 0x000200e9, 0x000200ea, 0x000200ea, 0x000200ea, 0x000200ea, }, - {0x000200eb, 0x000200eb, 0x000200eb, 0x000200eb, 0x000200ec, 0x000200ec, 0x000200ec, 0x000200ec, 0x000200ed, 0x000200ed, 0x000200ed, 0x000200ed, 0x000200ee, 0x000200ee, 0x000200ee, 0x000200ee, }, - {0x000200ef, 0x000200ef, 0x000200ef, 0x000200ef, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f1, 0x000200f1, 0x000200f1, 0x000200f1, 0x000200f2, 0x000200f2, 0x000200f2, 0x000200f2, }, - {0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f6, 0x000200f6, 0x000200f6, 0x000200f6, }, - {0x000200f7, 0x000200f7, 0x000200f7, 0x000200f7, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200fa, 0x000200fa, 0x000200fa, 0x000200fa, }, - {0x000200fb, 0x000200fb, 0x000200fb, 0x000200fb, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fe, 0x000200fe, 0x000200fe, 0x000200fe, }, - {0x000200ff, 0x000200ff, 0x000200ff, 0x000200ff, 0x00020100, 0x00020100, 0x00020100, 0x00020100, 0x00020101, 0x00020101, 0x00020101, 0x00020101, 0x00020102, 0x00020102, 0x00020102, 0x00020102, }, - {0x00020103, 0x00020103, 0x00020103, 0x00020103, 0x00020104, 0x00020104, 0x00020104, 0x00020104, 0x00020105, 0x00020105, 0x00020105, 0x00020105, 0x00020106, 0x00020106, 0x00020106, 0x00020106, }, - {0x00020107, 0x00020107, 0x00020107, 0x00020107, 0x00020108, 0x00020108, 0x00020108, 0x00020108, 0x00020109, 0x00020109, 0x00020109, 0x00020109, 0x0002010a, 0x0002010a, 0x0002010a, 0x0002010a, }, - {0x0002010b, 0x0002010b, 0x0002010b, 0x0002010b, 0x0002010c, 0x0002010c, 0x0002010c, 0x0002010c, 0x0002010d, 0x0002010d, 0x0002010d, 0x0002010d, 0x0002010e, 0x0002010e, 0x0002010e, 0x0002010e, }, - {0x0002010f, 0x0002010f, 0x0002010f, 0x0002010f, 0x00020110, 0x00020110, 0x00020110, 0x00020110, 0x00020111, 0x00020111, 0x00020111, 0x00020111, 0x00020112, 0x00020112, 0x00020112, 0x00020112, }, - {0x00020113, 0x00020113, 0x00020113, 0x00020113, 0x00020114, 0x00020114, 0x00020114, 0x00020114, 0x00020115, 0x00020115, 0x00020115, 0x00020115, 0x00020116, 0x00020116, 0x00020116, 0x00020116, }, - {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020118, 0x00020118, 0x00020118, 0x00020118, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002011a, 0x0002011a, 0x0002011a, 0x0002011a, }, - {0x0002011b, 0x0002011b, 0x0002011b, 0x0002011b, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011c, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011d, 0x0002011e, 0x0002011e, 0x0002011e, 0x0002011e, }, +const uint32_t c_aauiCQMFHuffDec12[76][16] = { + { + 0x0003ffff, + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000001, + 0x00000011, + 0x00000012, + 0x00000023, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x00000004, + 0x00000015, + 0x00000026, + 0x00000036, + 0x00000044, + 0x00000046, + 0x00010003, + 0x00010003, + 0x00010045, + 0x00010045, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + }, + { + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020035, + }, + { + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + }, + { + 0x000bffff, + 0x0009ffff, + 0x000affff, + 0x0007ffff, + 0x0008ffff, + 0x00000038, + 0x00000048, + 0x00000058, + 0x00010005, + 0x00010005, + 0x00010027, + 0x00010027, + 0x00010055, + 0x00010055, + 0x00010057, + 0x00010057, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + }, + { + 0x00010018, + 0x00010018, + 0x0001005a, + 0x0001005a, + 0x0001006a, + 0x0001006a, + 0x00010078, + 0x00010078, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + }, + { + 0x0018ffff, + 0x0029ffff, + 0x003affff, + 0x0010ffff, + 0x0011ffff, + 0x000fffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x00000007, + 0x00000029, + 0x0000003a, + 0x0000004a, + 0x00000077, + 0x00000079, + 0x0000007a, + }, + { + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + }, + { + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + }, + { + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + }, + { + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + }, + { + 0x004bffff, + 0x0012ffff, + 0x0015ffff, + 0x0013ffff, + 0x0014ffff, + 0x0016ffff, + 0x0017ffff, + 0x0000003c, + 0x0000006d, + 0x0000007d, + 0x0000008d, + 0x0000008e, + 0x0000009a, + 0x0000009b, + 0x00010009, + 0x00010009, + }, + { + 0x0001001a, + 0x0001001a, + 0x0001004c, + 0x0001004c, + 0x0001005c, + 0x0001005c, + 0x0001006c, + 0x0001006c, + 0x0001007c, + 0x0001007c, + 0x00010088, + 0x00010088, + 0x0001008b, + 0x0001008b, + 0x0001008c, + 0x0001008c, + }, + { + 0x0002011f, + 0x0002011f, + 0x0002011f, + 0x0002011f, + 0x00020120, + 0x00020120, + 0x00020120, + 0x00020120, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + }, + { + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x00030099, + 0x00030099, + 0x00030099, + 0x00030099, + 0x00030099, + 0x00030099, + 0x00030099, + 0x00030099, + }, + { + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + }, + { + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + }, + { + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + }, + { + 0x0025ffff, + 0x001fffff, + 0x0019ffff, + 0x0020ffff, + 0x001effff, + 0x0021ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + }, + { + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + }, + { + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020043, + 0x00020043, + 0x00020043, + 0x00020043, + 0x0002004e, + 0x0002004e, + 0x0002004e, + 0x0002004e, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + }, + { + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + }, + { + 0x00020054, + 0x00020054, + 0x00020054, + 0x00020054, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + }, + { + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + }, + { + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020032, + }, + { + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + }, + { + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + }, + { + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + }, + { + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + }, + { + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + }, + { + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + }, + { + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + }, + { + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020084, + }, + { + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020087, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x0002008f, + }, + { + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020093, + }, + { + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + 0x0039ffff, + }, + { + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020097, + }, + { + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020098, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x0002009f, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a0, + 0x000200a1, + 0x000200a1, + 0x000200a1, + 0x000200a1, + }, + { + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a2, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + }, + { + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a9, + 0x000200a9, + 0x000200a9, + 0x000200a9, + }, + { + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ad, + 0x000200ad, + 0x000200ad, + 0x000200ad, + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200ae, + }, + { + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b1, + 0x000200b1, + 0x000200b1, + 0x000200b1, + 0x000200b2, + 0x000200b2, + 0x000200b2, + 0x000200b2, + }, + { + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b5, + 0x000200b5, + 0x000200b5, + 0x000200b5, + 0x000200b6, + 0x000200b6, + 0x000200b6, + 0x000200b6, + }, + { + 0x000200b7, + 0x000200b7, + 0x000200b7, + 0x000200b7, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200b9, + 0x000200b9, + 0x000200b9, + 0x000200b9, + 0x000200ba, + 0x000200ba, + 0x000200ba, + 0x000200ba, + }, + { + 0x000200bb, + 0x000200bb, + 0x000200bb, + 0x000200bb, + 0x000200bc, + 0x000200bc, + 0x000200bc, + 0x000200bc, + 0x000200bd, + 0x000200bd, + 0x000200bd, + 0x000200bd, + 0x000200be, + 0x000200be, + 0x000200be, + 0x000200be, + }, + { + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x000200c1, + 0x000200c1, + 0x000200c1, + 0x000200c1, + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200c2, + }, + { + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x000200c4, + 0x000200c4, + 0x000200c4, + 0x000200c4, + 0x000200c5, + 0x000200c5, + 0x000200c5, + 0x000200c5, + 0x000200c6, + 0x000200c6, + 0x000200c6, + 0x000200c6, + }, + { + 0x000200c7, + 0x000200c7, + 0x000200c7, + 0x000200c7, + 0x000200c8, + 0x000200c8, + 0x000200c8, + 0x000200c8, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200ca, + 0x000200ca, + 0x000200ca, + 0x000200ca, + }, + { + 0x000200cb, + 0x000200cb, + 0x000200cb, + 0x000200cb, + 0x000200cc, + 0x000200cc, + 0x000200cc, + 0x000200cc, + 0x000200cd, + 0x000200cd, + 0x000200cd, + 0x000200cd, + 0x000200ce, + 0x000200ce, + 0x000200ce, + 0x000200ce, + }, + { + 0x000200cf, + 0x000200cf, + 0x000200cf, + 0x000200cf, + 0x000200d0, + 0x000200d0, + 0x000200d0, + 0x000200d0, + 0x000200d1, + 0x000200d1, + 0x000200d1, + 0x000200d1, + 0x000200d2, + 0x000200d2, + 0x000200d2, + 0x000200d2, + }, + { + 0x000200d3, + 0x000200d3, + 0x000200d3, + 0x000200d3, + 0x000200d4, + 0x000200d4, + 0x000200d4, + 0x000200d4, + 0x000200d5, + 0x000200d5, + 0x000200d5, + 0x000200d5, + 0x000200d6, + 0x000200d6, + 0x000200d6, + 0x000200d6, + }, + { + 0x000200d7, + 0x000200d7, + 0x000200d7, + 0x000200d7, + 0x000200d8, + 0x000200d8, + 0x000200d8, + 0x000200d8, + 0x000200d9, + 0x000200d9, + 0x000200d9, + 0x000200d9, + 0x000200da, + 0x000200da, + 0x000200da, + 0x000200da, + }, + { + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + 0x003fffff, + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0044ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x0049ffff, + 0x004affff, + }, + { + 0x000200db, + 0x000200db, + 0x000200db, + 0x000200db, + 0x000200dc, + 0x000200dc, + 0x000200dc, + 0x000200dc, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200de, + 0x000200de, + 0x000200de, + 0x000200de, + }, + { + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200e0, + 0x000200e0, + 0x000200e0, + 0x000200e0, + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x000200e2, + 0x000200e2, + 0x000200e2, + 0x000200e2, + }, + { + 0x000200e3, + 0x000200e3, + 0x000200e3, + 0x000200e3, + 0x000200e4, + 0x000200e4, + 0x000200e4, + 0x000200e4, + 0x000200e5, + 0x000200e5, + 0x000200e5, + 0x000200e5, + 0x000200e6, + 0x000200e6, + 0x000200e6, + 0x000200e6, + }, + { + 0x000200e7, + 0x000200e7, + 0x000200e7, + 0x000200e7, + 0x000200e8, + 0x000200e8, + 0x000200e8, + 0x000200e8, + 0x000200e9, + 0x000200e9, + 0x000200e9, + 0x000200e9, + 0x000200ea, + 0x000200ea, + 0x000200ea, + 0x000200ea, + }, + { + 0x000200eb, + 0x000200eb, + 0x000200eb, + 0x000200eb, + 0x000200ec, + 0x000200ec, + 0x000200ec, + 0x000200ec, + 0x000200ed, + 0x000200ed, + 0x000200ed, + 0x000200ed, + 0x000200ee, + 0x000200ee, + 0x000200ee, + 0x000200ee, + }, + { + 0x000200ef, + 0x000200ef, + 0x000200ef, + 0x000200ef, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x000200f1, + 0x000200f1, + 0x000200f1, + 0x000200f1, + 0x000200f2, + 0x000200f2, + 0x000200f2, + 0x000200f2, + }, + { + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f4, + 0x000200f4, + 0x000200f4, + 0x000200f4, + 0x000200f5, + 0x000200f5, + 0x000200f5, + 0x000200f5, + 0x000200f6, + 0x000200f6, + 0x000200f6, + 0x000200f6, + }, + { + 0x000200f7, + 0x000200f7, + 0x000200f7, + 0x000200f7, + 0x000200f8, + 0x000200f8, + 0x000200f8, + 0x000200f8, + 0x000200f9, + 0x000200f9, + 0x000200f9, + 0x000200f9, + 0x000200fa, + 0x000200fa, + 0x000200fa, + 0x000200fa, + }, + { + 0x000200fb, + 0x000200fb, + 0x000200fb, + 0x000200fb, + 0x000200fc, + 0x000200fc, + 0x000200fc, + 0x000200fc, + 0x000200fd, + 0x000200fd, + 0x000200fd, + 0x000200fd, + 0x000200fe, + 0x000200fe, + 0x000200fe, + 0x000200fe, + }, + { + 0x000200ff, + 0x000200ff, + 0x000200ff, + 0x000200ff, + 0x00020100, + 0x00020100, + 0x00020100, + 0x00020100, + 0x00020101, + 0x00020101, + 0x00020101, + 0x00020101, + 0x00020102, + 0x00020102, + 0x00020102, + 0x00020102, + }, + { + 0x00020103, + 0x00020103, + 0x00020103, + 0x00020103, + 0x00020104, + 0x00020104, + 0x00020104, + 0x00020104, + 0x00020105, + 0x00020105, + 0x00020105, + 0x00020105, + 0x00020106, + 0x00020106, + 0x00020106, + 0x00020106, + }, + { + 0x00020107, + 0x00020107, + 0x00020107, + 0x00020107, + 0x00020108, + 0x00020108, + 0x00020108, + 0x00020108, + 0x00020109, + 0x00020109, + 0x00020109, + 0x00020109, + 0x0002010a, + 0x0002010a, + 0x0002010a, + 0x0002010a, + }, + { + 0x0002010b, + 0x0002010b, + 0x0002010b, + 0x0002010b, + 0x0002010c, + 0x0002010c, + 0x0002010c, + 0x0002010c, + 0x0002010d, + 0x0002010d, + 0x0002010d, + 0x0002010d, + 0x0002010e, + 0x0002010e, + 0x0002010e, + 0x0002010e, + }, + { + 0x0002010f, + 0x0002010f, + 0x0002010f, + 0x0002010f, + 0x00020110, + 0x00020110, + 0x00020110, + 0x00020110, + 0x00020111, + 0x00020111, + 0x00020111, + 0x00020111, + 0x00020112, + 0x00020112, + 0x00020112, + 0x00020112, + }, + { + 0x00020113, + 0x00020113, + 0x00020113, + 0x00020113, + 0x00020114, + 0x00020114, + 0x00020114, + 0x00020114, + 0x00020115, + 0x00020115, + 0x00020115, + 0x00020115, + 0x00020116, + 0x00020116, + 0x00020116, + 0x00020116, + }, + { + 0x00020117, + 0x00020117, + 0x00020117, + 0x00020117, + 0x00020118, + 0x00020118, + 0x00020118, + 0x00020118, + 0x00020119, + 0x00020119, + 0x00020119, + 0x00020119, + 0x0002011a, + 0x0002011a, + 0x0002011a, + 0x0002011a, + }, + { + 0x0002011b, + 0x0002011b, + 0x0002011b, + 0x0002011b, + 0x0002011c, + 0x0002011c, + 0x0002011c, + 0x0002011c, + 0x0002011d, + 0x0002011d, + 0x0002011d, + 0x0002011d, + 0x0002011e, + 0x0002011e, + 0x0002011e, + 0x0002011e, + }, }; #endif @@ -822,143 +6893,1938 @@ const uint32_t c_aauiCQMFHuffEnc13[324][2] = #else const uint16_t c_aauiCQMFHuffEnc13[324][2] = #endif -{ - {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0006, 0x0004}, {0x0008, 0x0005}, {0x000a, 0x0005}, {0x000c, 0x0007}, - {0x000e, 0x000b}, {0x0010, 0x0011}, {0x0012, 0x002d}, {0x0015, 0x0000}, {0x0014, 0x0035}, {0x0015, 0x0001}, {0x0015, 0x0002}, {0x0015, 0x0003}, - {0x0015, 0x0004}, {0x0015, 0x0005}, {0x0004, 0x0008}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0006, 0x0005}, {0x0008, 0x0006}, - {0x0009, 0x0006}, {0x000c, 0x0008}, {0x000d, 0x0009}, {0x0010, 0x0012}, {0x0011, 0x001a}, {0x0015, 0x0006}, {0x0015, 0x0007}, {0x0015, 0x0008}, - {0x0015, 0x0009}, {0x0015, 0x000a}, {0x0015, 0x000b}, {0x0015, 0x000c}, {0x0005, 0x0007}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x0008}, - {0x0006, 0x0006}, {0x0008, 0x0007}, {0x000a, 0x0006}, {0x000c, 0x0009}, {0x000e, 0x000c}, {0x0010, 0x0013}, {0x0012, 0x002e}, {0x0015, 0x000d}, - {0x0015, 0x000e}, {0x0015, 0x000f}, {0x0015, 0x0010}, {0x0015, 0x0011}, {0x0015, 0x0012}, {0x0015, 0x0013}, {0x0005, 0x0009}, {0x0004, 0x000d}, - {0x0005, 0x000a}, {0x0006, 0x0007}, {0x0007, 0x0005}, {0x0009, 0x0007}, {0x000b, 0x0008}, {0x000d, 0x000a}, {0x000f, 0x000e}, {0x0010, 0x0014}, - {0x0011, 0x001b}, {0x0014, 0x0036}, {0x0015, 0x0014}, {0x0015, 0x0015}, {0x0015, 0x0016}, {0x0015, 0x0017}, {0x0015, 0x0018}, {0x0015, 0x0019}, - {0x0006, 0x0008}, {0x0005, 0x000b}, {0x0006, 0x0009}, {0x0007, 0x0006}, {0x0009, 0x0008}, {0x000a, 0x0007}, {0x000c, 0x000a}, {0x000e, 0x000d}, - {0x0010, 0x0015}, {0x0011, 0x001c}, {0x0013, 0x0053}, {0x0015, 0x001a}, {0x0015, 0x001b}, {0x0015, 0x001c}, {0x0015, 0x001d}, {0x0015, 0x001e}, - {0x0015, 0x001f}, {0x0015, 0x0020}, {0x0008, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0009}, {0x0009, 0x0009}, {0x000a, 0x0008}, {0x000c, 0x000b}, - {0x000d, 0x000b}, {0x000f, 0x000f}, {0x0010, 0x0016}, {0x0011, 0x001d}, {0x0014, 0x0037}, {0x0015, 0x0021}, {0x0015, 0x0022}, {0x0015, 0x0023}, - {0x0015, 0x0024}, {0x0015, 0x0025}, {0x0015, 0x0026}, {0x0015, 0x0027}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000b, 0x0009}, - {0x000c, 0x000c}, {0x000d, 0x000c}, {0x000f, 0x0010}, {0x0010, 0x0017}, {0x0012, 0x002f}, {0x0015, 0x0028}, {0x0015, 0x0029}, {0x0015, 0x002a}, - {0x0015, 0x002b}, {0x0015, 0x002c}, {0x0015, 0x002d}, {0x0015, 0x002e}, {0x0015, 0x002f}, {0x0015, 0x0030}, {0x000c, 0x000d}, {0x000c, 0x000e}, - {0x000c, 0x000f}, {0x000d, 0x000d}, {0x000e, 0x000e}, {0x000f, 0x0011}, {0x0010, 0x0018}, {0x0011, 0x001e}, {0x0014, 0x0038}, {0x0015, 0x0031}, - {0x0015, 0x0032}, {0x0015, 0x0033}, {0x0015, 0x0034}, {0x0015, 0x0035}, {0x0015, 0x0036}, {0x0015, 0x0037}, {0x0015, 0x0038}, {0x0015, 0x0039}, - {0x000f, 0x0012}, {0x000e, 0x000f}, {0x000e, 0x0010}, {0x000e, 0x0011}, {0x000f, 0x0013}, {0x0010, 0x0019}, {0x0011, 0x001f}, {0x0013, 0x0054}, - {0x0015, 0x003a}, {0x0014, 0x0039}, {0x0015, 0x003b}, {0x0015, 0x003c}, {0x0015, 0x003d}, {0x0015, 0x003e}, {0x0015, 0x003f}, {0x0015, 0x0040}, - {0x0015, 0x0041}, {0x0015, 0x0042}, {0x0010, 0x001a}, {0x000f, 0x0014}, {0x000f, 0x0015}, {0x0010, 0x001b}, {0x0011, 0x0020}, {0x0012, 0x0030}, - {0x0013, 0x0055}, {0x0015, 0x0043}, {0x0015, 0x0044}, {0x0014, 0x003a}, {0x0015, 0x0045}, {0x0015, 0x0046}, {0x0015, 0x0047}, {0x0015, 0x0048}, - {0x0015, 0x0049}, {0x0015, 0x004a}, {0x0015, 0x004b}, {0x0015, 0x004c}, {0x0012, 0x0031}, {0x0011, 0x0021}, {0x0013, 0x0056}, {0x0013, 0x0057}, - {0x0012, 0x0032}, {0x0015, 0x004d}, {0x0015, 0x004e}, {0x0015, 0x004f}, {0x0015, 0x0050}, {0x0015, 0x0051}, {0x0015, 0x0052}, {0x0015, 0x0053}, - {0x0015, 0x0054}, {0x0015, 0x0055}, {0x0015, 0x0056}, {0x0015, 0x0057}, {0x0015, 0x0058}, {0x0015, 0x0059}, {0x0015, 0x005a}, {0x0014, 0x003b}, - {0x0012, 0x0033}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0015, 0x005b}, {0x0015, 0x005c}, {0x0015, 0x005d}, {0x0015, 0x005e}, {0x0015, 0x005f}, - {0x0015, 0x0060}, {0x0015, 0x0061}, {0x0015, 0x0062}, {0x0015, 0x0063}, {0x0015, 0x0064}, {0x0015, 0x0065}, {0x0015, 0x0066}, {0x0015, 0x0067}, - {0x0015, 0x0068}, {0x0015, 0x0069}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, - {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, - {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, - {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, - {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, - {0x0014, 0x0062}, {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, - {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, - {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, - {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, - {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, - {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, - {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, - {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, - {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, + { + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0006, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x000a, 0x0005 }, + { 0x000c, 0x0007 }, + { 0x000e, 0x000b }, + { 0x0010, 0x0011 }, + { 0x0012, 0x002d }, + { 0x0015, 0x0000 }, + { 0x0014, 0x0035 }, + { 0x0015, 0x0001 }, + { 0x0015, 0x0002 }, + { 0x0015, 0x0003 }, + { 0x0015, 0x0004 }, + { 0x0015, 0x0005 }, + { 0x0004, 0x0008 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0006, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0009, 0x0006 }, + { 0x000c, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x0010, 0x0012 }, + { 0x0011, 0x001a }, + { 0x0015, 0x0006 }, + { 0x0015, 0x0007 }, + { 0x0015, 0x0008 }, + { 0x0015, 0x0009 }, + { 0x0015, 0x000a }, + { 0x0015, 0x000b }, + { 0x0015, 0x000c }, + { 0x0005, 0x0007 }, + { 0x0004, 0x000b }, + { 0x0004, 0x000c }, + { 0x0005, 0x0008 }, + { 0x0006, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x000a, 0x0006 }, + { 0x000c, 0x0009 }, + { 0x000e, 0x000c }, + { 0x0010, 0x0013 }, + { 0x0012, 0x002e }, + { 0x0015, 0x000d }, + { 0x0015, 0x000e }, + { 0x0015, 0x000f }, + { 0x0015, 0x0010 }, + { 0x0015, 0x0011 }, + { 0x0015, 0x0012 }, + { 0x0015, 0x0013 }, + { 0x0005, 0x0009 }, + { 0x0004, 0x000d }, + { 0x0005, 0x000a }, + { 0x0006, 0x0007 }, + { 0x0007, 0x0005 }, + { 0x0009, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000d, 0x000a }, + { 0x000f, 0x000e }, + { 0x0010, 0x0014 }, + { 0x0011, 0x001b }, + { 0x0014, 0x0036 }, + { 0x0015, 0x0014 }, + { 0x0015, 0x0015 }, + { 0x0015, 0x0016 }, + { 0x0015, 0x0017 }, + { 0x0015, 0x0018 }, + { 0x0015, 0x0019 }, + { 0x0006, 0x0008 }, + { 0x0005, 0x000b }, + { 0x0006, 0x0009 }, + { 0x0007, 0x0006 }, + { 0x0009, 0x0008 }, + { 0x000a, 0x0007 }, + { 0x000c, 0x000a }, + { 0x000e, 0x000d }, + { 0x0010, 0x0015 }, + { 0x0011, 0x001c }, + { 0x0013, 0x0053 }, + { 0x0015, 0x001a }, + { 0x0015, 0x001b }, + { 0x0015, 0x001c }, + { 0x0015, 0x001d }, + { 0x0015, 0x001e }, + { 0x0015, 0x001f }, + { 0x0015, 0x0020 }, + { 0x0008, 0x0008 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0009 }, + { 0x000a, 0x0008 }, + { 0x000c, 0x000b }, + { 0x000d, 0x000b }, + { 0x000f, 0x000f }, + { 0x0010, 0x0016 }, + { 0x0011, 0x001d }, + { 0x0014, 0x0037 }, + { 0x0015, 0x0021 }, + { 0x0015, 0x0022 }, + { 0x0015, 0x0023 }, + { 0x0015, 0x0024 }, + { 0x0015, 0x0025 }, + { 0x0015, 0x0026 }, + { 0x0015, 0x0027 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000b, 0x0009 }, + { 0x000c, 0x000c }, + { 0x000d, 0x000c }, + { 0x000f, 0x0010 }, + { 0x0010, 0x0017 }, + { 0x0012, 0x002f }, + { 0x0015, 0x0028 }, + { 0x0015, 0x0029 }, + { 0x0015, 0x002a }, + { 0x0015, 0x002b }, + { 0x0015, 0x002c }, + { 0x0015, 0x002d }, + { 0x0015, 0x002e }, + { 0x0015, 0x002f }, + { 0x0015, 0x0030 }, + { 0x000c, 0x000d }, + { 0x000c, 0x000e }, + { 0x000c, 0x000f }, + { 0x000d, 0x000d }, + { 0x000e, 0x000e }, + { 0x000f, 0x0011 }, + { 0x0010, 0x0018 }, + { 0x0011, 0x001e }, + { 0x0014, 0x0038 }, + { 0x0015, 0x0031 }, + { 0x0015, 0x0032 }, + { 0x0015, 0x0033 }, + { 0x0015, 0x0034 }, + { 0x0015, 0x0035 }, + { 0x0015, 0x0036 }, + { 0x0015, 0x0037 }, + { 0x0015, 0x0038 }, + { 0x0015, 0x0039 }, + { 0x000f, 0x0012 }, + { 0x000e, 0x000f }, + { 0x000e, 0x0010 }, + { 0x000e, 0x0011 }, + { 0x000f, 0x0013 }, + { 0x0010, 0x0019 }, + { 0x0011, 0x001f }, + { 0x0013, 0x0054 }, + { 0x0015, 0x003a }, + { 0x0014, 0x0039 }, + { 0x0015, 0x003b }, + { 0x0015, 0x003c }, + { 0x0015, 0x003d }, + { 0x0015, 0x003e }, + { 0x0015, 0x003f }, + { 0x0015, 0x0040 }, + { 0x0015, 0x0041 }, + { 0x0015, 0x0042 }, + { 0x0010, 0x001a }, + { 0x000f, 0x0014 }, + { 0x000f, 0x0015 }, + { 0x0010, 0x001b }, + { 0x0011, 0x0020 }, + { 0x0012, 0x0030 }, + { 0x0013, 0x0055 }, + { 0x0015, 0x0043 }, + { 0x0015, 0x0044 }, + { 0x0014, 0x003a }, + { 0x0015, 0x0045 }, + { 0x0015, 0x0046 }, + { 0x0015, 0x0047 }, + { 0x0015, 0x0048 }, + { 0x0015, 0x0049 }, + { 0x0015, 0x004a }, + { 0x0015, 0x004b }, + { 0x0015, 0x004c }, + { 0x0012, 0x0031 }, + { 0x0011, 0x0021 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0012, 0x0032 }, + { 0x0015, 0x004d }, + { 0x0015, 0x004e }, + { 0x0015, 0x004f }, + { 0x0015, 0x0050 }, + { 0x0015, 0x0051 }, + { 0x0015, 0x0052 }, + { 0x0015, 0x0053 }, + { 0x0015, 0x0054 }, + { 0x0015, 0x0055 }, + { 0x0015, 0x0056 }, + { 0x0015, 0x0057 }, + { 0x0015, 0x0058 }, + { 0x0015, 0x0059 }, + { 0x0015, 0x005a }, + { 0x0014, 0x003b }, + { 0x0012, 0x0033 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0015, 0x005b }, + { 0x0015, 0x005c }, + { 0x0015, 0x005d }, + { 0x0015, 0x005e }, + { 0x0015, 0x005f }, + { 0x0015, 0x0060 }, + { 0x0015, 0x0061 }, + { 0x0015, 0x0062 }, + { 0x0015, 0x0063 }, + { 0x0015, 0x0064 }, + { 0x0015, 0x0065 }, + { 0x0015, 0x0066 }, + { 0x0015, 0x0067 }, + { 0x0015, 0x0068 }, + { 0x0015, 0x0069 }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x0014, 0x003e }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0014, 0x0047 }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0014, 0x0052 }, + { 0x0014, 0x0053 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0014, 0x005e }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x0014, 0x006a }, + { 0x0014, 0x006b }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x0014, 0x006f }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x0014, 0x009d }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec13[89][16] = -{ - {0x0006ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000001, 0x00000012, 0x00000014, 0x00000015, 0x00000025, 0x00000026, 0x00000037, 0x00010013, 0x00010013, }, - {0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x000bffff, 0x0009ffff, 0x000affff, 0x0007ffff, 0x0008ffff, 0x00000005, 0x00000017, 0x00000029, 0x0000005a, 0x0000005c, 0x0001003a, 0x0001003a, 0x0001004b, 0x0001004b, 0x0001005b, 0x0001005b, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, }, - {0x0001003c, 0x0001003c, 0x0001006f, 0x0001006f, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, }, - {0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, - {0x0012ffff, 0x0011ffff, 0x0010ffff, 0x000fffff, 0x000dffff, 0x000cffff, 0x000effff, 0x00000007, 0x00000019, 0x0000002b, 0x0000004e, 0x0000005f, 0x00000070, 0x0000007e, 0x0000007f, 0x00000080, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, - {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, - {0x00010072, 0x00010072, 0x00010083, 0x00010083, 0x00010090, 0x00010090, 0x00010094, 0x00010094, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x00020008, 0x00020008, 0x00020008, 0x00020008, }, - {0x0016ffff, 0x00000009, 0x0000001b, 0x0000002d, 0x0000003f, 0x00000050, 0x00000062, 0x00000073, 0x00000084, 0x00000095, 0x000000a2, 0x000000a5, 0x0001003e, 0x0001003e, 0x00010061, 0x00010061, }, - {0x0021ffff, 0x0024ffff, 0x003dffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0019ffff, 0x0017ffff, 0x0018ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, }, - {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, - {0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030085, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, - {0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300a6, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, 0x000300b5, }, - {0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, - {0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200b8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, }, - {0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00010052, 0x00010052, 0x00010097, 0x00010097, 0x000100a8, 0x000100a8, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, }, - {0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0000000c, 0x00000041, 0x00000064, 0x00000086, 0x00000099, 0x000000ab, 0x000000c7, 0x000000da, 0x000000db, 0x000000dc, 0x000000dd, }, - {0x000000de, 0x000000df, 0x000000e0, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, }, - {0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, }, - {0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, }, - {0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, }, - {0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, 0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, }, - {0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, }, - {0x0026ffff, 0x002dffff, 0x0037ffff, 0x0023ffff, 0x0044ffff, 0x002effff, 0x003affff, 0x0022ffff, 0x002cffff, 0x0035ffff, 0x002fffff, 0x0036ffff, 0x0040ffff, 0x0049ffff, 0x0030ffff, 0x0038ffff, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0041ffff, 0x004affff, 0x0042ffff, 0x0025ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0039ffff, 0x003bffff, 0x003cffff, }, - {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, }, - {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, - {0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, }, - {0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, }, - {0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, - {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, - {0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030088, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, }, - {0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, }, - {0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008c, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, }, - {0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, - {0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, 0x0003009c, }, - {0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009d, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, 0x0003009e, }, - {0x003effff, 0x003fffff, 0x0043ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, }, - {0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, }, - {0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, - {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, 0x00030065, }, - {0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, - {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, 0x000300ac, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, 0x000300ae, }, - {0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, }, - {0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, }, - {0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b3, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, }, - {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, - {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, - {0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, 0x000300bb, }, - {0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bc, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, 0x000300bd, }, - {0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300be, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, 0x000300bf, }, - {0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c0, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, }, - {0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, }, - {0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, 0x000300c5, }, - {0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, 0x000300cb, }, - {0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, }, - {0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300ce, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, 0x000300cf, }, - {0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d0, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, 0x000300d1, }, - {0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d2, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, 0x000300d3, }, - {0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d4, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, 0x000300d5, }, - {0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d6, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, 0x000300d7, }, - {0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, +const uint32_t c_aauiCQMFHuffDec13[89][16] = { + { + 0x0006ffff, + 0x0005ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x00000000, + 0x00000001, + 0x00000012, + 0x00000014, + 0x00000015, + 0x00000025, + 0x00000026, + 0x00000037, + 0x00010013, + 0x00010013, + }, + { + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + }, + { + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + }, + { + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x000bffff, + 0x0009ffff, + 0x000affff, + 0x0007ffff, + 0x0008ffff, + 0x00000005, + 0x00000017, + 0x00000029, + 0x0000005a, + 0x0000005c, + 0x0001003a, + 0x0001003a, + 0x0001004b, + 0x0001004b, + 0x0001005b, + 0x0001005b, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + }, + { + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + }, + { + 0x0001003c, + 0x0001003c, + 0x0001006f, + 0x0001006f, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004d, + }, + { + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + }, + { + 0x0012ffff, + 0x0011ffff, + 0x0010ffff, + 0x000fffff, + 0x000dffff, + 0x000cffff, + 0x000effff, + 0x00000007, + 0x00000019, + 0x0000002b, + 0x0000004e, + 0x0000005f, + 0x00000070, + 0x0000007e, + 0x0000007f, + 0x00000080, + }, + { + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + }, + { + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020093, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + }, + { + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + }, + { + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + }, + { + 0x00010072, + 0x00010072, + 0x00010083, + 0x00010083, + 0x00010090, + 0x00010090, + 0x00010094, + 0x00010094, + 0x000100a3, + 0x000100a3, + 0x000100a4, + 0x000100a4, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + }, + { + 0x0016ffff, + 0x00000009, + 0x0000001b, + 0x0000002d, + 0x0000003f, + 0x00000050, + 0x00000062, + 0x00000073, + 0x00000084, + 0x00000095, + 0x000000a2, + 0x000000a5, + 0x0001003e, + 0x0001003e, + 0x00010061, + 0x00010061, + }, + { + 0x0021ffff, + 0x0024ffff, + 0x003dffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0019ffff, + 0x0017ffff, + 0x0018ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + }, + { + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + }, + { + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + }, + { + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030085, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + }, + { + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300a6, + 0x000300b5, + 0x000300b5, + 0x000300b5, + 0x000300b5, + 0x000300b5, + 0x000300b5, + 0x000300b5, + 0x000300b5, + }, + { + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + }, + { + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200b8, + 0x000200c8, + 0x000200c8, + 0x000200c8, + 0x000200c8, + }, + { + 0x0000013e, + 0x0000013f, + 0x00000140, + 0x00000141, + 0x00000142, + 0x00000143, + 0x00010052, + 0x00010052, + 0x00010097, + 0x00010097, + 0x000100a8, + 0x000100a8, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + }, + { + 0x0054ffff, + 0x0055ffff, + 0x0056ffff, + 0x0057ffff, + 0x0058ffff, + 0x0000000c, + 0x00000041, + 0x00000064, + 0x00000086, + 0x00000099, + 0x000000ab, + 0x000000c7, + 0x000000da, + 0x000000db, + 0x000000dc, + 0x000000dd, + }, + { + 0x000000de, + 0x000000df, + 0x000000e0, + 0x000000e1, + 0x000000e2, + 0x000000e3, + 0x000000e4, + 0x000000e5, + 0x000000e6, + 0x000000e7, + 0x000000e8, + 0x000000e9, + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + }, + { + 0x000000ee, + 0x000000ef, + 0x000000f0, + 0x000000f1, + 0x000000f2, + 0x000000f3, + 0x000000f4, + 0x000000f5, + 0x000000f6, + 0x000000f7, + 0x000000f8, + 0x000000f9, + 0x000000fa, + 0x000000fb, + 0x000000fc, + 0x000000fd, + }, + { + 0x000000fe, + 0x000000ff, + 0x00000100, + 0x00000101, + 0x00000102, + 0x00000103, + 0x00000104, + 0x00000105, + 0x00000106, + 0x00000107, + 0x00000108, + 0x00000109, + 0x0000010a, + 0x0000010b, + 0x0000010c, + 0x0000010d, + }, + { + 0x0000010e, + 0x0000010f, + 0x00000110, + 0x00000111, + 0x00000112, + 0x00000113, + 0x00000114, + 0x00000115, + 0x00000116, + 0x00000117, + 0x00000118, + 0x00000119, + 0x0000011a, + 0x0000011b, + 0x0000011c, + 0x0000011d, + }, + { + 0x0000011e, + 0x0000011f, + 0x00000120, + 0x00000121, + 0x00000122, + 0x00000123, + 0x00000124, + 0x00000125, + 0x00000126, + 0x00000127, + 0x00000128, + 0x00000129, + 0x0000012a, + 0x0000012b, + 0x0000012c, + 0x0000012d, + }, + { + 0x0000012e, + 0x0000012f, + 0x00000130, + 0x00000131, + 0x00000132, + 0x00000133, + 0x00000134, + 0x00000135, + 0x00000136, + 0x00000137, + 0x00000138, + 0x00000139, + 0x0000013a, + 0x0000013b, + 0x0000013c, + 0x0000013d, + }, + { + 0x0026ffff, + 0x002dffff, + 0x0037ffff, + 0x0023ffff, + 0x0044ffff, + 0x002effff, + 0x003affff, + 0x0022ffff, + 0x002cffff, + 0x0035ffff, + 0x002fffff, + 0x0036ffff, + 0x0040ffff, + 0x0049ffff, + 0x0030ffff, + 0x0038ffff, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x0041ffff, + 0x004affff, + 0x0042ffff, + 0x0025ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + 0x0039ffff, + 0x003bffff, + 0x003cffff, + }, + { + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + }, + { + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + }, + { + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + }, + { + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + }, + { + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + }, + { + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + }, + { + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030088, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + }, + { + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + }, + { + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008c, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + }, + { + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + }, + { + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + 0x0003009c, + }, + { + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009d, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + 0x0003009e, + }, + { + 0x003effff, + 0x003fffff, + 0x0043ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + 0x0050ffff, + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + }, + { + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + }, + { + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + }, + { + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + }, + { + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030065, + 0x00030065, + 0x00030065, + 0x00030065, + 0x00030065, + 0x00030065, + 0x00030065, + 0x00030065, + }, + { + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + }, + { + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + 0x000300ac, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + }, + { + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ae, + 0x000300ae, + 0x000300ae, + 0x000300ae, + 0x000300ae, + 0x000300ae, + 0x000300ae, + 0x000300ae, + }, + { + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + }, + { + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + }, + { + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b3, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + }, + { + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + }, + { + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + }, + { + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300bb, + 0x000300bb, + 0x000300bb, + 0x000300bb, + 0x000300bb, + 0x000300bb, + 0x000300bb, + 0x000300bb, + }, + { + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bc, + 0x000300bd, + 0x000300bd, + 0x000300bd, + 0x000300bd, + 0x000300bd, + 0x000300bd, + 0x000300bd, + 0x000300bd, + }, + { + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300be, + 0x000300bf, + 0x000300bf, + 0x000300bf, + 0x000300bf, + 0x000300bf, + 0x000300bf, + 0x000300bf, + 0x000300bf, + }, + { + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c0, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + }, + { + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + }, + { + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c5, + 0x000300c5, + 0x000300c5, + 0x000300c5, + 0x000300c5, + 0x000300c5, + 0x000300c5, + 0x000300c5, + }, + { + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300cb, + 0x000300cb, + 0x000300cb, + 0x000300cb, + 0x000300cb, + 0x000300cb, + 0x000300cb, + 0x000300cb, + }, + { + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + }, + { + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300ce, + 0x000300cf, + 0x000300cf, + 0x000300cf, + 0x000300cf, + 0x000300cf, + 0x000300cf, + 0x000300cf, + 0x000300cf, + }, + { + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d0, + 0x000300d1, + 0x000300d1, + 0x000300d1, + 0x000300d1, + 0x000300d1, + 0x000300d1, + 0x000300d1, + 0x000300d1, + }, + { + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d2, + 0x000300d3, + 0x000300d3, + 0x000300d3, + 0x000300d3, + 0x000300d3, + 0x000300d3, + 0x000300d3, + 0x000300d3, + }, + { + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d4, + 0x000300d5, + 0x000300d5, + 0x000300d5, + 0x000300d5, + 0x000300d5, + 0x000300d5, + 0x000300d5, + 0x000300d5, + }, + { + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d6, + 0x000300d7, + 0x000300d7, + 0x000300d7, + 0x000300d7, + 0x000300d7, + 0x000300d7, + 0x000300d7, + 0x000300d7, + }, + { + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + }, }; #endif @@ -967,115 +8833,1365 @@ const uint32_t c_aauiCQMFHuffEnc14[400][2] = #else const uint16_t c_aauiCQMFHuffEnc14[400][2] = #endif -{ - {0x0005, 0x0007}, {0x0004, 0x0009}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0006}, {0x0007, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x0008}, - {0x000d, 0x000c}, {0x000f, 0x0013}, {0x0010, 0x001b}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, - {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0005, 0x000a}, - {0x0005, 0x000b}, {0x0006, 0x0007}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000a}, {0x000e, 0x000e}, {0x000f, 0x0014}, {0x0011, 0x002a}, - {0x0012, 0x004a}, {0x0013, 0x0084}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, - {0x0005, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x000d}, {0x0006, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0007}, {0x000a, 0x0008}, - {0x000c, 0x000b}, {0x000e, 0x000f}, {0x000f, 0x0015}, {0x0012, 0x004b}, {0x0013, 0x0085}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, - {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0005, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x000f}, {0x0005, 0x0010}, - {0x0006, 0x0009}, {0x0008, 0x0008}, {0x0009, 0x0008}, {0x000b, 0x0009}, {0x000d, 0x000d}, {0x000e, 0x0010}, {0x0010, 0x001c}, {0x0011, 0x002b}, - {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, - {0x0006, 0x000a}, {0x0005, 0x0011}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x000a, 0x0009}, {0x000c, 0x000c}, - {0x000e, 0x0011}, {0x000f, 0x0016}, {0x0010, 0x001d}, {0x0012, 0x004c}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, - {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0007, 0x0009}, {0x0006, 0x000d}, {0x0007, 0x000a}, {0x0007, 0x000b}, - {0x0009, 0x0009}, {0x000a, 0x000a}, {0x000b, 0x000a}, {0x000d, 0x000e}, {0x000f, 0x0017}, {0x0011, 0x002c}, {0x0010, 0x001e}, {0x0014, 0x0024}, - {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, - {0x0009, 0x000a}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000b}, {0x000d, 0x000f}, {0x000e, 0x0012}, - {0x000f, 0x0018}, {0x0011, 0x002d}, {0x0011, 0x002e}, {0x0013, 0x0086}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, - {0x0014, 0x0031}, {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x000b, 0x000c}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x000d}, - {0x000c, 0x000d}, {0x000d, 0x0010}, {0x000e, 0x0013}, {0x000f, 0x0019}, {0x0010, 0x001f}, {0x0013, 0x0087}, {0x0014, 0x0035}, {0x0014, 0x0036}, - {0x0013, 0x0088}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, - {0x000d, 0x0011}, {0x000c, 0x000e}, {0x000c, 0x000f}, {0x000d, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0014}, {0x0010, 0x0020}, {0x0010, 0x0021}, - {0x0012, 0x004d}, {0x0011, 0x002f}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, - {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, {0x000f, 0x001a}, {0x000e, 0x0015}, {0x000e, 0x0016}, {0x000e, 0x0017}, - {0x000f, 0x001b}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0014, 0x0048}, {0x0014, 0x0049}, - {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, - {0x0010, 0x0022}, {0x0010, 0x0023}, {0x0010, 0x0024}, {0x0010, 0x0025}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0012, 0x004e}, {0x0012, 0x004f}, - {0x0014, 0x0052}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, - {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0011, 0x0034}, {0x0011, 0x0035}, {0x0012, 0x0050}, {0x0012, 0x0051}, - {0x0013, 0x008e}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, - {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, - {0x0012, 0x0052}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0014, 0x006b}, {0x0013, 0x0091}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, - {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, - {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0013, 0x0092}, {0x0012, 0x0053}, - {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, - {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, - {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0013, 0x0093}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, - {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, - {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, - {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, - {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, - {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, - {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, - {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, - {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, - {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, - {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, - {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, - {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, - {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, - {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, -}; + { + { 0x0005, 0x0007 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0006, 0x0006 }, + { 0x0007, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000d, 0x000c }, + { 0x000f, 0x0013 }, + { 0x0010, 0x001b }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0014, 0x0006 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0004, 0x000c }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0006, 0x0007 }, + { 0x0008, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000c, 0x000a }, + { 0x000e, 0x000e }, + { 0x000f, 0x0014 }, + { 0x0011, 0x002a }, + { 0x0012, 0x004a }, + { 0x0013, 0x0084 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0005, 0x000c }, + { 0x0004, 0x000d }, + { 0x0004, 0x000e }, + { 0x0005, 0x000d }, + { 0x0006, 0x0008 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000c, 0x000b }, + { 0x000e, 0x000f }, + { 0x000f, 0x0015 }, + { 0x0012, 0x004b }, + { 0x0013, 0x0085 }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0005, 0x000e }, + { 0x0004, 0x000f }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0006, 0x0009 }, + { 0x0008, 0x0008 }, + { 0x0009, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000d, 0x000d }, + { 0x000e, 0x0010 }, + { 0x0010, 0x001c }, + { 0x0011, 0x002b }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0006, 0x000a }, + { 0x0005, 0x0011 }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0007, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x000a, 0x0009 }, + { 0x000c, 0x000c }, + { 0x000e, 0x0011 }, + { 0x000f, 0x0016 }, + { 0x0010, 0x001d }, + { 0x0012, 0x004c }, + { 0x0014, 0x001c }, + { 0x0014, 0x001d }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0014, 0x0020 }, + { 0x0014, 0x0021 }, + { 0x0014, 0x0022 }, + { 0x0014, 0x0023 }, + { 0x0007, 0x0009 }, + { 0x0006, 0x000d }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0009, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000b, 0x000a }, + { 0x000d, 0x000e }, + { 0x000f, 0x0017 }, + { 0x0011, 0x002c }, + { 0x0010, 0x001e }, + { 0x0014, 0x0024 }, + { 0x0014, 0x0025 }, + { 0x0014, 0x0026 }, + { 0x0014, 0x0027 }, + { 0x0014, 0x0028 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0009, 0x000a }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0009, 0x000b }, + { 0x000a, 0x000b }, + { 0x000b, 0x000b }, + { 0x000d, 0x000f }, + { 0x000e, 0x0012 }, + { 0x000f, 0x0018 }, + { 0x0011, 0x002d }, + { 0x0011, 0x002e }, + { 0x0013, 0x0086 }, + { 0x0014, 0x002d }, + { 0x0014, 0x002e }, + { 0x0014, 0x002f }, + { 0x0014, 0x0030 }, + { 0x0014, 0x0031 }, + { 0x0014, 0x0032 }, + { 0x0014, 0x0033 }, + { 0x0014, 0x0034 }, + { 0x000b, 0x000c }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000b, 0x000d }, + { 0x000c, 0x000d }, + { 0x000d, 0x0010 }, + { 0x000e, 0x0013 }, + { 0x000f, 0x0019 }, + { 0x0010, 0x001f }, + { 0x0013, 0x0087 }, + { 0x0014, 0x0035 }, + { 0x0014, 0x0036 }, + { 0x0013, 0x0088 }, + { 0x0014, 0x0037 }, + { 0x0014, 0x0038 }, + { 0x0014, 0x0039 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x000d, 0x0011 }, + { 0x000c, 0x000e }, + { 0x000c, 0x000f }, + { 0x000d, 0x0012 }, + { 0x000d, 0x0013 }, + { 0x000e, 0x0014 }, + { 0x0010, 0x0020 }, + { 0x0010, 0x0021 }, + { 0x0012, 0x004d }, + { 0x0011, 0x002f }, + { 0x0014, 0x003e }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0014, 0x0047 }, + { 0x000f, 0x001a }, + { 0x000e, 0x0015 }, + { 0x000e, 0x0016 }, + { 0x000e, 0x0017 }, + { 0x000f, 0x001b }, + { 0x0011, 0x0030 }, + { 0x0011, 0x0031 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0013, 0x008b }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0010, 0x0022 }, + { 0x0010, 0x0023 }, + { 0x0010, 0x0024 }, + { 0x0010, 0x0025 }, + { 0x0011, 0x0032 }, + { 0x0011, 0x0033 }, + { 0x0012, 0x004e }, + { 0x0012, 0x004f }, + { 0x0014, 0x0052 }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0014, 0x0053 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0011, 0x0034 }, + { 0x0011, 0x0035 }, + { 0x0012, 0x0050 }, + { 0x0012, 0x0051 }, + { 0x0013, 0x008e }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0014, 0x005e }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x0014, 0x006a }, + { 0x0012, 0x0052 }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0014, 0x006b }, + { 0x0013, 0x0091 }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x0014, 0x006f }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x0013, 0x0092 }, + { 0x0012, 0x0053 }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0013, 0x0093 }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x0014, 0x009d }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, + { 0x0014, 0x00a6 }, + { 0x0014, 0x00a7 }, + { 0x0014, 0x00a8 }, + { 0x0014, 0x00a9 }, + { 0x0014, 0x00aa }, + { 0x0014, 0x00ab }, + { 0x0014, 0x00ac }, + { 0x0014, 0x00ad }, + { 0x0014, 0x00ae }, + { 0x0014, 0x00af }, + { 0x0014, 0x00b0 }, + { 0x0014, 0x00b1 }, + { 0x0014, 0x00b2 }, + { 0x0014, 0x00b3 }, + { 0x0014, 0x00b4 }, + { 0x0014, 0x00b5 }, + { 0x0014, 0x00b6 }, + { 0x0014, 0x00b7 }, + { 0x0014, 0x00b8 }, + { 0x0014, 0x00b9 }, + { 0x0014, 0x00ba }, + { 0x0014, 0x00bb }, + { 0x0014, 0x00bc }, + { 0x0014, 0x00bd }, + { 0x0014, 0x00be }, + { 0x0014, 0x00bf }, + { 0x0014, 0x00c0 }, + { 0x0014, 0x00c1 }, + { 0x0014, 0x00c2 }, + { 0x0014, 0x00c3 }, + { 0x0014, 0x00c4 }, + { 0x0014, 0x00c5 }, + { 0x0014, 0x00c6 }, + { 0x0014, 0x00c7 }, + { 0x0014, 0x00c8 }, + { 0x0014, 0x00c9 }, + { 0x0014, 0x00ca }, + { 0x0014, 0x00cb }, + { 0x0014, 0x00cc }, + { 0x0014, 0x00cd }, + { 0x0014, 0x00ce }, + { 0x0014, 0x00cf }, + { 0x0014, 0x00d0 }, + { 0x0014, 0x00d1 }, + { 0x0014, 0x00d2 }, + { 0x0014, 0x00d3 }, + { 0x0014, 0x00d4 }, + { 0x0014, 0x00d5 }, + { 0x0014, 0x00d6 }, + { 0x0014, 0x00d7 }, + { 0x0014, 0x00d8 }, + { 0x0014, 0x00d9 }, + { 0x0014, 0x00da }, + { 0x0014, 0x00db }, + { 0x0014, 0x00dc }, + { 0x0014, 0x00dd }, + { 0x0014, 0x00de }, + { 0x0014, 0x00df }, + { 0x0014, 0x00e0 }, + { 0x0014, 0x00e1 }, + { 0x0014, 0x00e2 }, + { 0x0014, 0x00e3 }, + { 0x0014, 0x00e4 }, + { 0x0014, 0x00e5 }, + { 0x0014, 0x00e6 }, + { 0x0014, 0x00e7 }, + { 0x0014, 0x00e8 }, + { 0x0014, 0x00e9 }, + { 0x0014, 0x00ea }, + { 0x0014, 0x00eb }, + { 0x0014, 0x00ec }, + { 0x0014, 0x00ed }, + { 0x0014, 0x00ee }, + { 0x0014, 0x00ef }, + { 0x0014, 0x00f0 }, + { 0x0014, 0x00f1 }, + { 0x0014, 0x00f2 }, + { 0x0014, 0x00f3 }, + { 0x0014, 0x00f4 }, + { 0x0014, 0x00f5 }, + { 0x0014, 0x00f6 }, + { 0x0014, 0x00f7 }, + { 0x0014, 0x00f8 }, + { 0x0014, 0x00f9 }, + { 0x0014, 0x00fa }, + { 0x0014, 0x00fb }, + { 0x0014, 0x00fc }, + { 0x0014, 0x00fd }, + { 0x0014, 0x00fe }, + { 0x0014, 0x00ff }, + { 0x0014, 0x0100 }, + { 0x0014, 0x0101 }, + { 0x0014, 0x0102 }, + { 0x0014, 0x0103 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec14[53][16] = -{ - {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x00000001, 0x00000014, 0x00000015, 0x00000016, 0x00000029, 0x0000002a, 0x0000003d, }, - {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, - {0x00010054, 0x00010054, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, - {0x000fffff, 0x000dffff, 0x000effff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000001a, 0x0000002e, 0x00000041, 0x00000055, 0x00000079, 0x0000007a, 0x00010005, 0x00010005, 0x0001002d, 0x0001002d, }, - {0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, - {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, - {0x00010007, 0x00010007, 0x00010043, 0x00010043, 0x0001006a, 0x0001006a, 0x0001007d, 0x0001007d, 0x0001008c, 0x0001008c, 0x0001008f, 0x0001008f, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, }, - {0x0024ffff, 0x0018ffff, 0x0017ffff, 0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000001c, 0x00000030, 0x00000057, 0x00000090, 0x000000a1, 0x000000a2, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, - {0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003006b, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, }, - {0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, }, - {0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, }, - {0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020092, 0x00020092, 0x00020092, 0x00020092, }, - {0x00010080, 0x00010080, 0x00010093, 0x00010093, 0x000100b4, 0x000100b4, 0x000100b8, 0x000100b8, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x00020031, 0x00020031, 0x00020031, 0x00020031, }, - {0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b5, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b6, 0x000200b7, 0x000200b7, 0x000200b7, 0x000200b7, }, - {0x000000a6, 0x000000a7, 0x000000c8, 0x000000c9, 0x000000ca, 0x000000cb, 0x00010009, 0x00010009, 0x0001001e, 0x0001001e, 0x00010032, 0x00010032, 0x00010059, 0x00010059, 0x0001006c, 0x0001006c, }, - {0x0022ffff, 0x0023ffff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x0000000a, 0x00000046, 0x0000005a, 0x0000006e, 0x00000094, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, 0x00030081, }, - {0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x00030082, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, - {0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300b9, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, 0x000300ba, }, - {0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cc, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, 0x000300cd, }, - {0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, }, - {0x000100f2, 0x000100f2, 0x000100f4, 0x000100f4, 0x00010106, 0x00010106, 0x0001011a, 0x0001011a, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, - {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200ce, 0x000200cf, 0x000200cf, 0x000200cf, 0x000200cf, }, - {0x000200de, 0x000200de, 0x000200de, 0x000200de, 0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x00020107, 0x00020107, 0x00020107, 0x00020107, }, - {0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x00010021, 0x00010021, 0x00010034, 0x00010034, 0x00010083, 0x00010083, 0x00010095, 0x00010095, }, - {0x00010098, 0x00010098, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100e0, 0x000100e0, 0x000100f1, 0x000100f1, }, - {0x0025ffff, 0x0026ffff, 0x0028ffff, 0x0027ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, }, - {0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000035, 0x00000036, 0x00000037, }, - {0x00000038, 0x00000039, 0x0000003a, 0x0000003b, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, }, - {0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x00000096, 0x00000097, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000aa, 0x000000ab, }, - {0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000084, 0x00000085, 0x00000086, }, - {0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, }, - {0x000000c6, 0x000000c7, 0x000000d0, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, 0x000000d9, 0x000000da, 0x000000db, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, }, - {0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f3, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, }, - {0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000108, 0x00000109, 0x0000010a, }, - {0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011b, }, - {0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000129, 0x0000012a, 0x0000012b, }, - {0x0000012c, 0x0000012d, 0x0000012e, 0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, }, - {0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, 0x0000014a, 0x0000014b, }, - {0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, }, - {0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, 0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, 0x0000016a, 0x0000016b, }, - {0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, }, - {0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, }, +const uint32_t c_aauiCQMFHuffDec14[53][16] = { + { + 0x0009ffff, + 0x0007ffff, + 0x0008ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x00000001, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000029, + 0x0000002a, + 0x0000003d, + }, + { + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + }, + { + 0x00010054, + 0x00010054, + 0x00010064, + 0x00010064, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + }, + { + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + }, + { + 0x000fffff, + 0x000dffff, + 0x000effff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x0000001a, + 0x0000002e, + 0x00000041, + 0x00000055, + 0x00000079, + 0x0000007a, + 0x00010005, + 0x00010005, + 0x0001002d, + 0x0001002d, + }, + { + 0x0002008d, + 0x0002008d, + 0x0002008d, + 0x0002008d, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + }, + { + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + }, + { + 0x00010007, + 0x00010007, + 0x00010043, + 0x00010043, + 0x0001006a, + 0x0001006a, + 0x0001007d, + 0x0001007d, + 0x0001008c, + 0x0001008c, + 0x0001008f, + 0x0001008f, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + }, + { + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + }, + { + 0x0024ffff, + 0x0018ffff, + 0x0017ffff, + 0x0015ffff, + 0x0014ffff, + 0x0016ffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0000001c, + 0x00000030, + 0x00000057, + 0x00000090, + 0x000000a1, + 0x000000a2, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + }, + { + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003006b, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + }, + { + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + }, + { + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + }, + { + 0x00020045, + 0x00020045, + 0x00020045, + 0x00020045, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020058, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + }, + { + 0x00010080, + 0x00010080, + 0x00010093, + 0x00010093, + 0x000100b4, + 0x000100b4, + 0x000100b8, + 0x000100b8, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + }, + { + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200b5, + 0x000200b5, + 0x000200b5, + 0x000200b5, + 0x000200b6, + 0x000200b6, + 0x000200b6, + 0x000200b6, + 0x000200b7, + 0x000200b7, + 0x000200b7, + 0x000200b7, + }, + { + 0x000000a6, + 0x000000a7, + 0x000000c8, + 0x000000c9, + 0x000000ca, + 0x000000cb, + 0x00010009, + 0x00010009, + 0x0001001e, + 0x0001001e, + 0x00010032, + 0x00010032, + 0x00010059, + 0x00010059, + 0x0001006c, + 0x0001006c, + }, + { + 0x0022ffff, + 0x0023ffff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x0000000a, + 0x00000046, + 0x0000005a, + 0x0000006e, + 0x00000094, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + }, + { + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + 0x00030081, + }, + { + 0x00030082, + 0x00030082, + 0x00030082, + 0x00030082, + 0x00030082, + 0x00030082, + 0x00030082, + 0x00030082, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + }, + { + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300b9, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + 0x000300ba, + }, + { + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cc, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + 0x000300cd, + }, + { + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + }, + { + 0x000100f2, + 0x000100f2, + 0x000100f4, + 0x000100f4, + 0x00010106, + 0x00010106, + 0x0001011a, + 0x0001011a, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + }, + { + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200ce, + 0x000200ce, + 0x000200ce, + 0x000200ce, + 0x000200cf, + 0x000200cf, + 0x000200cf, + 0x000200cf, + }, + { + 0x000200de, + 0x000200de, + 0x000200de, + 0x000200de, + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x00020107, + 0x00020107, + 0x00020107, + 0x00020107, + }, + { + 0x0000018c, + 0x0000018d, + 0x0000018e, + 0x0000018f, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x00010021, + 0x00010021, + 0x00010034, + 0x00010034, + 0x00010083, + 0x00010083, + 0x00010095, + 0x00010095, + }, + { + 0x00010098, + 0x00010098, + 0x000100bb, + 0x000100bb, + 0x000100bc, + 0x000100bc, + 0x000100bd, + 0x000100bd, + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100e0, + 0x000100e0, + 0x000100f1, + 0x000100f1, + }, + { + 0x0025ffff, + 0x0026ffff, + 0x0028ffff, + 0x0027ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + }, + { + 0x0000000d, + 0x0000000e, + 0x0000000f, + 0x00000010, + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000022, + 0x00000023, + 0x00000024, + 0x00000025, + 0x00000026, + 0x00000027, + 0x00000035, + 0x00000036, + 0x00000037, + }, + { + 0x00000038, + 0x00000039, + 0x0000003a, + 0x0000003b, + 0x00000048, + 0x00000049, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x0000004d, + 0x0000004e, + 0x0000004f, + 0x0000005c, + 0x0000005d, + 0x0000005e, + 0x0000005f, + }, + { + 0x00000087, + 0x00000088, + 0x00000089, + 0x0000008a, + 0x0000008b, + 0x00000096, + 0x00000097, + 0x00000099, + 0x0000009a, + 0x0000009b, + 0x0000009c, + 0x0000009d, + 0x0000009e, + 0x0000009f, + 0x000000aa, + 0x000000ab, + }, + { + 0x00000060, + 0x00000061, + 0x00000062, + 0x00000063, + 0x0000006f, + 0x00000070, + 0x00000071, + 0x00000072, + 0x00000073, + 0x00000074, + 0x00000075, + 0x00000076, + 0x00000077, + 0x00000084, + 0x00000085, + 0x00000086, + }, + { + 0x000000ac, + 0x000000ad, + 0x000000ae, + 0x000000af, + 0x000000b0, + 0x000000b1, + 0x000000b2, + 0x000000b3, + 0x000000be, + 0x000000bf, + 0x000000c0, + 0x000000c1, + 0x000000c2, + 0x000000c3, + 0x000000c4, + 0x000000c5, + }, + { + 0x000000c6, + 0x000000c7, + 0x000000d0, + 0x000000d3, + 0x000000d4, + 0x000000d5, + 0x000000d6, + 0x000000d7, + 0x000000d8, + 0x000000d9, + 0x000000da, + 0x000000db, + 0x000000e1, + 0x000000e2, + 0x000000e3, + 0x000000e4, + }, + { + 0x000000e5, + 0x000000e6, + 0x000000e7, + 0x000000e8, + 0x000000e9, + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + 0x000000ee, + 0x000000ef, + 0x000000f3, + 0x000000f5, + 0x000000f6, + 0x000000f7, + 0x000000f8, + }, + { + 0x000000f9, + 0x000000fa, + 0x000000fb, + 0x000000fc, + 0x000000fd, + 0x000000fe, + 0x000000ff, + 0x00000100, + 0x00000101, + 0x00000102, + 0x00000103, + 0x00000104, + 0x00000105, + 0x00000108, + 0x00000109, + 0x0000010a, + }, + { + 0x0000010b, + 0x0000010c, + 0x0000010d, + 0x0000010e, + 0x0000010f, + 0x00000110, + 0x00000111, + 0x00000112, + 0x00000113, + 0x00000114, + 0x00000115, + 0x00000116, + 0x00000117, + 0x00000118, + 0x00000119, + 0x0000011b, + }, + { + 0x0000011c, + 0x0000011d, + 0x0000011e, + 0x0000011f, + 0x00000120, + 0x00000121, + 0x00000122, + 0x00000123, + 0x00000124, + 0x00000125, + 0x00000126, + 0x00000127, + 0x00000128, + 0x00000129, + 0x0000012a, + 0x0000012b, + }, + { + 0x0000012c, + 0x0000012d, + 0x0000012e, + 0x0000012f, + 0x00000130, + 0x00000131, + 0x00000132, + 0x00000133, + 0x00000134, + 0x00000135, + 0x00000136, + 0x00000137, + 0x00000138, + 0x00000139, + 0x0000013a, + 0x0000013b, + }, + { + 0x0000013c, + 0x0000013d, + 0x0000013e, + 0x0000013f, + 0x00000140, + 0x00000141, + 0x00000142, + 0x00000143, + 0x00000144, + 0x00000145, + 0x00000146, + 0x00000147, + 0x00000148, + 0x00000149, + 0x0000014a, + 0x0000014b, + }, + { + 0x0000014c, + 0x0000014d, + 0x0000014e, + 0x0000014f, + 0x00000150, + 0x00000151, + 0x00000152, + 0x00000153, + 0x00000154, + 0x00000155, + 0x00000156, + 0x00000157, + 0x00000158, + 0x00000159, + 0x0000015a, + 0x0000015b, + }, + { + 0x0000015c, + 0x0000015d, + 0x0000015e, + 0x0000015f, + 0x00000160, + 0x00000161, + 0x00000162, + 0x00000163, + 0x00000164, + 0x00000165, + 0x00000166, + 0x00000167, + 0x00000168, + 0x00000169, + 0x0000016a, + 0x0000016b, + }, + { + 0x0000016c, + 0x0000016d, + 0x0000016e, + 0x0000016f, + 0x00000170, + 0x00000171, + 0x00000172, + 0x00000173, + 0x00000174, + 0x00000175, + 0x00000176, + 0x00000177, + 0x00000178, + 0x00000179, + 0x0000017a, + 0x0000017b, + }, + { + 0x0000017c, + 0x0000017d, + 0x0000017e, + 0x0000017f, + 0x00000180, + 0x00000181, + 0x00000182, + 0x00000183, + 0x00000184, + 0x00000185, + 0x00000186, + 0x00000187, + 0x00000188, + 0x00000189, + 0x0000018a, + 0x0000018b, + }, }; #endif @@ -1084,157 +10200,1901 @@ const uint32_t c_aauiCQMFHuffEnc15[576][2] = #else const uint16_t c_aauiCQMFHuffEnc15[576][2] = #endif -{ - {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0007, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0008}, - {0x000b, 0x000b}, {0x000d, 0x000e}, {0x000e, 0x0011}, {0x000f, 0x001a}, {0x0012, 0x006e}, {0x0014, 0x0000}, {0x0013, 0x00cc}, {0x0014, 0x0001}, - {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, - {0x0005, 0x000d}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x000b}, {0x0007, 0x0009}, {0x0008, 0x000a}, - {0x000a, 0x000a}, {0x000c, 0x000c}, {0x000d, 0x000f}, {0x000f, 0x001b}, {0x0011, 0x003d}, {0x0011, 0x003e}, {0x0013, 0x00cd}, {0x0014, 0x000a}, - {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, - {0x0005, 0x0010}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0006, 0x000c}, {0x0007, 0x000a}, {0x0009, 0x0009}, - {0x000a, 0x000b}, {0x000c, 0x000d}, {0x000e, 0x0012}, {0x0010, 0x0027}, {0x0011, 0x003f}, {0x0012, 0x006f}, {0x0014, 0x0013}, {0x0014, 0x0014}, - {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, - {0x0006, 0x000d}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0006, 0x000e}, {0x0007, 0x000b}, {0x0008, 0x000b}, {0x0009, 0x000a}, - {0x000b, 0x000c}, {0x000c, 0x000e}, {0x000e, 0x0013}, {0x000f, 0x001c}, {0x0011, 0x0040}, {0x0012, 0x0070}, {0x0014, 0x001d}, {0x0014, 0x001e}, - {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, - {0x0006, 0x000f}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0007, 0x000c}, {0x0009, 0x000b}, {0x000a, 0x000c}, - {0x000b, 0x000d}, {0x000d, 0x0010}, {0x000e, 0x0014}, {0x0010, 0x0028}, {0x0011, 0x0041}, {0x0013, 0x00ce}, {0x0014, 0x0027}, {0x0014, 0x0028}, - {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, - {0x0007, 0x000d}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x000c}, {0x0009, 0x000c}, {0x000b, 0x000e}, - {0x000c, 0x000f}, {0x000e, 0x0015}, {0x0010, 0x0029}, {0x0011, 0x0042}, {0x0014, 0x0031}, {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, - {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, - {0x0008, 0x000d}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000e}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x000b, 0x000f}, {0x000c, 0x0010}, - {0x000d, 0x0011}, {0x000f, 0x001d}, {0x0010, 0x002a}, {0x0011, 0x0043}, {0x0014, 0x003d}, {0x0013, 0x00cf}, {0x0014, 0x003e}, {0x0014, 0x003f}, - {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0014, 0x0047}, - {0x0009, 0x000f}, {0x0008, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x000d}, {0x000b, 0x0010}, {0x000c, 0x0011}, {0x000d, 0x0012}, - {0x000e, 0x0016}, {0x0010, 0x002b}, {0x0011, 0x0044}, {0x0012, 0x0071}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, - {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, - {0x000b, 0x0011}, {0x000a, 0x000e}, {0x000a, 0x000f}, {0x000b, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0017}, - {0x0010, 0x002c}, {0x0012, 0x0072}, {0x0011, 0x0045}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, - {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, - {0x000c, 0x0013}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000e, 0x0018}, {0x000f, 0x001e}, {0x0010, 0x002d}, - {0x0011, 0x0046}, {0x0011, 0x0047}, {0x0011, 0x0048}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, - {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, - {0x000e, 0x0019}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000e, 0x001a}, {0x000e, 0x001b}, {0x000f, 0x001f}, {0x0010, 0x002e}, {0x0011, 0x0049}, - {0x0012, 0x0073}, {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, - {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, - {0x0010, 0x002f}, {0x000f, 0x0020}, {0x0010, 0x0030}, {0x000f, 0x0021}, {0x0010, 0x0031}, {0x0011, 0x004a}, {0x0011, 0x004b}, {0x0012, 0x0074}, - {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0013, 0x00d2}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, - {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, - {0x0012, 0x0075}, {0x0010, 0x0032}, {0x0010, 0x0033}, {0x0011, 0x004c}, {0x0011, 0x004d}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0012, 0x0076}, - {0x0013, 0x00d5}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, - {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, - {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0012, 0x0077}, {0x0012, 0x0078}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0013, 0x00d8}, {0x0014, 0x009b}, - {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, - {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, - {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0012, 0x0079}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, - {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, - {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, - {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, - {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, - {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, - {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, - {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, - {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, - {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, - {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, - {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, - {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, - {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, - {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, - {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, - {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, - {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, - {0x0014, 0x0139}, {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, - {0x0014, 0x0141}, {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, - {0x0014, 0x0149}, {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, - {0x0014, 0x0151}, {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, - {0x0014, 0x0159}, {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, - {0x0014, 0x0161}, {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, - {0x0014, 0x0169}, {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, - {0x0014, 0x0171}, {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, - {0x0014, 0x0179}, {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, - {0x0014, 0x0181}, {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, - {0x0014, 0x0189}, {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, - {0x0014, 0x0191}, {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0013, 0x00db}, -}; + { + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0007, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0008 }, + { 0x000b, 0x000b }, + { 0x000d, 0x000e }, + { 0x000e, 0x0011 }, + { 0x000f, 0x001a }, + { 0x0012, 0x006e }, + { 0x0014, 0x0000 }, + { 0x0013, 0x00cc }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0014, 0x0006 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0005, 0x000d }, + { 0x0004, 0x000c }, + { 0x0004, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0006, 0x000b }, + { 0x0007, 0x0009 }, + { 0x0008, 0x000a }, + { 0x000a, 0x000a }, + { 0x000c, 0x000c }, + { 0x000d, 0x000f }, + { 0x000f, 0x001b }, + { 0x0011, 0x003d }, + { 0x0011, 0x003e }, + { 0x0013, 0x00cd }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0005, 0x0010 }, + { 0x0004, 0x000e }, + { 0x0004, 0x000f }, + { 0x0005, 0x0011 }, + { 0x0005, 0x0012 }, + { 0x0006, 0x000c }, + { 0x0007, 0x000a }, + { 0x0009, 0x0009 }, + { 0x000a, 0x000b }, + { 0x000c, 0x000d }, + { 0x000e, 0x0012 }, + { 0x0010, 0x0027 }, + { 0x0011, 0x003f }, + { 0x0012, 0x006f }, + { 0x0014, 0x0013 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0014, 0x001c }, + { 0x0006, 0x000d }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0005, 0x0015 }, + { 0x0006, 0x000e }, + { 0x0007, 0x000b }, + { 0x0008, 0x000b }, + { 0x0009, 0x000a }, + { 0x000b, 0x000c }, + { 0x000c, 0x000e }, + { 0x000e, 0x0013 }, + { 0x000f, 0x001c }, + { 0x0011, 0x0040 }, + { 0x0012, 0x0070 }, + { 0x0014, 0x001d }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0014, 0x0020 }, + { 0x0014, 0x0021 }, + { 0x0014, 0x0022 }, + { 0x0014, 0x0023 }, + { 0x0014, 0x0024 }, + { 0x0014, 0x0025 }, + { 0x0014, 0x0026 }, + { 0x0006, 0x000f }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0007, 0x000c }, + { 0x0009, 0x000b }, + { 0x000a, 0x000c }, + { 0x000b, 0x000d }, + { 0x000d, 0x0010 }, + { 0x000e, 0x0014 }, + { 0x0010, 0x0028 }, + { 0x0011, 0x0041 }, + { 0x0013, 0x00ce }, + { 0x0014, 0x0027 }, + { 0x0014, 0x0028 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0014, 0x002d }, + { 0x0014, 0x002e }, + { 0x0014, 0x002f }, + { 0x0014, 0x0030 }, + { 0x0007, 0x000d }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0008, 0x000c }, + { 0x0009, 0x000c }, + { 0x000b, 0x000e }, + { 0x000c, 0x000f }, + { 0x000e, 0x0015 }, + { 0x0010, 0x0029 }, + { 0x0011, 0x0042 }, + { 0x0014, 0x0031 }, + { 0x0014, 0x0032 }, + { 0x0014, 0x0033 }, + { 0x0014, 0x0034 }, + { 0x0014, 0x0035 }, + { 0x0014, 0x0036 }, + { 0x0014, 0x0037 }, + { 0x0014, 0x0038 }, + { 0x0014, 0x0039 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0014, 0x003c }, + { 0x0008, 0x000d }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0008, 0x000e }, + { 0x0009, 0x000d }, + { 0x0009, 0x000e }, + { 0x000b, 0x000f }, + { 0x000c, 0x0010 }, + { 0x000d, 0x0011 }, + { 0x000f, 0x001d }, + { 0x0010, 0x002a }, + { 0x0011, 0x0043 }, + { 0x0014, 0x003d }, + { 0x0013, 0x00cf }, + { 0x0014, 0x003e }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0014, 0x0047 }, + { 0x0009, 0x000f }, + { 0x0008, 0x000f }, + { 0x0009, 0x0010 }, + { 0x0009, 0x0011 }, + { 0x000a, 0x000d }, + { 0x000b, 0x0010 }, + { 0x000c, 0x0011 }, + { 0x000d, 0x0012 }, + { 0x000e, 0x0016 }, + { 0x0010, 0x002b }, + { 0x0011, 0x0044 }, + { 0x0012, 0x0071 }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0014, 0x0052 }, + { 0x0014, 0x0053 }, + { 0x000b, 0x0011 }, + { 0x000a, 0x000e }, + { 0x000a, 0x000f }, + { 0x000b, 0x0012 }, + { 0x000b, 0x0013 }, + { 0x000c, 0x0012 }, + { 0x000d, 0x0013 }, + { 0x000e, 0x0017 }, + { 0x0010, 0x002c }, + { 0x0012, 0x0072 }, + { 0x0011, 0x0045 }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0014, 0x005e }, + { 0x000c, 0x0013 }, + { 0x000c, 0x0014 }, + { 0x000c, 0x0015 }, + { 0x000d, 0x0014 }, + { 0x000d, 0x0015 }, + { 0x000e, 0x0018 }, + { 0x000f, 0x001e }, + { 0x0010, 0x002d }, + { 0x0011, 0x0046 }, + { 0x0011, 0x0047 }, + { 0x0011, 0x0048 }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x0014, 0x006a }, + { 0x0014, 0x006b }, + { 0x000e, 0x0019 }, + { 0x000d, 0x0016 }, + { 0x000d, 0x0017 }, + { 0x000e, 0x001a }, + { 0x000e, 0x001b }, + { 0x000f, 0x001f }, + { 0x0010, 0x002e }, + { 0x0011, 0x0049 }, + { 0x0012, 0x0073 }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x0014, 0x006f }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0010, 0x002f }, + { 0x000f, 0x0020 }, + { 0x0010, 0x0030 }, + { 0x000f, 0x0021 }, + { 0x0010, 0x0031 }, + { 0x0011, 0x004a }, + { 0x0011, 0x004b }, + { 0x0012, 0x0074 }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x0013, 0x00d2 }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0012, 0x0075 }, + { 0x0010, 0x0032 }, + { 0x0010, 0x0033 }, + { 0x0011, 0x004c }, + { 0x0011, 0x004d }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0012, 0x0076 }, + { 0x0013, 0x00d5 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0012, 0x0077 }, + { 0x0012, 0x0078 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0013, 0x00d8 }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x0014, 0x009d }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, + { 0x0014, 0x00a6 }, + { 0x0014, 0x00a7 }, + { 0x0014, 0x00a8 }, + { 0x0014, 0x00a9 }, + { 0x0014, 0x00aa }, + { 0x0014, 0x00ab }, + { 0x0014, 0x00ac }, + { 0x0014, 0x00ad }, + { 0x0014, 0x00ae }, + { 0x0014, 0x00af }, + { 0x0012, 0x0079 }, + { 0x0014, 0x00b0 }, + { 0x0014, 0x00b1 }, + { 0x0014, 0x00b2 }, + { 0x0014, 0x00b3 }, + { 0x0014, 0x00b4 }, + { 0x0014, 0x00b5 }, + { 0x0014, 0x00b6 }, + { 0x0014, 0x00b7 }, + { 0x0014, 0x00b8 }, + { 0x0014, 0x00b9 }, + { 0x0014, 0x00ba }, + { 0x0014, 0x00bb }, + { 0x0014, 0x00bc }, + { 0x0014, 0x00bd }, + { 0x0014, 0x00be }, + { 0x0014, 0x00bf }, + { 0x0014, 0x00c0 }, + { 0x0014, 0x00c1 }, + { 0x0014, 0x00c2 }, + { 0x0014, 0x00c3 }, + { 0x0014, 0x00c4 }, + { 0x0014, 0x00c5 }, + { 0x0014, 0x00c6 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0014, 0x00c7 }, + { 0x0014, 0x00c8 }, + { 0x0014, 0x00c9 }, + { 0x0014, 0x00ca }, + { 0x0014, 0x00cb }, + { 0x0014, 0x00cc }, + { 0x0014, 0x00cd }, + { 0x0014, 0x00ce }, + { 0x0014, 0x00cf }, + { 0x0014, 0x00d0 }, + { 0x0014, 0x00d1 }, + { 0x0014, 0x00d2 }, + { 0x0014, 0x00d3 }, + { 0x0014, 0x00d4 }, + { 0x0014, 0x00d5 }, + { 0x0014, 0x00d6 }, + { 0x0014, 0x00d7 }, + { 0x0014, 0x00d8 }, + { 0x0014, 0x00d9 }, + { 0x0014, 0x00da }, + { 0x0014, 0x00db }, + { 0x0014, 0x00dc }, + { 0x0014, 0x00dd }, + { 0x0014, 0x00de }, + { 0x0014, 0x00df }, + { 0x0014, 0x00e0 }, + { 0x0014, 0x00e1 }, + { 0x0014, 0x00e2 }, + { 0x0014, 0x00e3 }, + { 0x0014, 0x00e4 }, + { 0x0014, 0x00e5 }, + { 0x0014, 0x00e6 }, + { 0x0014, 0x00e7 }, + { 0x0014, 0x00e8 }, + { 0x0014, 0x00e9 }, + { 0x0014, 0x00ea }, + { 0x0014, 0x00eb }, + { 0x0014, 0x00ec }, + { 0x0014, 0x00ed }, + { 0x0014, 0x00ee }, + { 0x0014, 0x00ef }, + { 0x0014, 0x00f0 }, + { 0x0014, 0x00f1 }, + { 0x0014, 0x00f2 }, + { 0x0014, 0x00f3 }, + { 0x0014, 0x00f4 }, + { 0x0014, 0x00f5 }, + { 0x0014, 0x00f6 }, + { 0x0014, 0x00f7 }, + { 0x0014, 0x00f8 }, + { 0x0014, 0x00f9 }, + { 0x0014, 0x00fa }, + { 0x0014, 0x00fb }, + { 0x0014, 0x00fc }, + { 0x0014, 0x00fd }, + { 0x0014, 0x00fe }, + { 0x0014, 0x00ff }, + { 0x0014, 0x0100 }, + { 0x0014, 0x0101 }, + { 0x0014, 0x0102 }, + { 0x0014, 0x0103 }, + { 0x0014, 0x0104 }, + { 0x0014, 0x0105 }, + { 0x0014, 0x0106 }, + { 0x0014, 0x0107 }, + { 0x0014, 0x0108 }, + { 0x0014, 0x0109 }, + { 0x0014, 0x010a }, + { 0x0014, 0x010b }, + { 0x0014, 0x010c }, + { 0x0014, 0x010d }, + { 0x0014, 0x010e }, + { 0x0014, 0x010f }, + { 0x0014, 0x0110 }, + { 0x0014, 0x0111 }, + { 0x0014, 0x0112 }, + { 0x0014, 0x0113 }, + { 0x0014, 0x0114 }, + { 0x0014, 0x0115 }, + { 0x0014, 0x0116 }, + { 0x0014, 0x0117 }, + { 0x0014, 0x0118 }, + { 0x0014, 0x0119 }, + { 0x0014, 0x011a }, + { 0x0014, 0x011b }, + { 0x0014, 0x011c }, + { 0x0014, 0x011d }, + { 0x0014, 0x011e }, + { 0x0014, 0x011f }, + { 0x0014, 0x0120 }, + { 0x0014, 0x0121 }, + { 0x0014, 0x0122 }, + { 0x0014, 0x0123 }, + { 0x0014, 0x0124 }, + { 0x0014, 0x0125 }, + { 0x0014, 0x0126 }, + { 0x0014, 0x0127 }, + { 0x0014, 0x0128 }, + { 0x0014, 0x0129 }, + { 0x0014, 0x012a }, + { 0x0014, 0x012b }, + { 0x0014, 0x012c }, + { 0x0014, 0x012d }, + { 0x0014, 0x012e }, + { 0x0014, 0x012f }, + { 0x0014, 0x0130 }, + { 0x0014, 0x0131 }, + { 0x0014, 0x0132 }, + { 0x0014, 0x0133 }, + { 0x0014, 0x0134 }, + { 0x0014, 0x0135 }, + { 0x0014, 0x0136 }, + { 0x0014, 0x0137 }, + { 0x0014, 0x0138 }, + { 0x0014, 0x0139 }, + { 0x0014, 0x013a }, + { 0x0014, 0x013b }, + { 0x0014, 0x013c }, + { 0x0014, 0x013d }, + { 0x0014, 0x013e }, + { 0x0014, 0x013f }, + { 0x0014, 0x0140 }, + { 0x0014, 0x0141 }, + { 0x0014, 0x0142 }, + { 0x0014, 0x0143 }, + { 0x0014, 0x0144 }, + { 0x0014, 0x0145 }, + { 0x0014, 0x0146 }, + { 0x0014, 0x0147 }, + { 0x0014, 0x0148 }, + { 0x0014, 0x0149 }, + { 0x0014, 0x014a }, + { 0x0014, 0x014b }, + { 0x0014, 0x014c }, + { 0x0014, 0x014d }, + { 0x0014, 0x014e }, + { 0x0014, 0x014f }, + { 0x0014, 0x0150 }, + { 0x0014, 0x0151 }, + { 0x0014, 0x0152 }, + { 0x0014, 0x0153 }, + { 0x0014, 0x0154 }, + { 0x0014, 0x0155 }, + { 0x0014, 0x0156 }, + { 0x0014, 0x0157 }, + { 0x0014, 0x0158 }, + { 0x0014, 0x0159 }, + { 0x0014, 0x015a }, + { 0x0014, 0x015b }, + { 0x0014, 0x015c }, + { 0x0014, 0x015d }, + { 0x0014, 0x015e }, + { 0x0014, 0x015f }, + { 0x0014, 0x0160 }, + { 0x0014, 0x0161 }, + { 0x0014, 0x0162 }, + { 0x0014, 0x0163 }, + { 0x0014, 0x0164 }, + { 0x0014, 0x0165 }, + { 0x0014, 0x0166 }, + { 0x0014, 0x0167 }, + { 0x0014, 0x0168 }, + { 0x0014, 0x0169 }, + { 0x0014, 0x016a }, + { 0x0014, 0x016b }, + { 0x0014, 0x016c }, + { 0x0014, 0x016d }, + { 0x0014, 0x016e }, + { 0x0014, 0x016f }, + { 0x0014, 0x0170 }, + { 0x0014, 0x0171 }, + { 0x0014, 0x0172 }, + { 0x0014, 0x0173 }, + { 0x0014, 0x0174 }, + { 0x0014, 0x0175 }, + { 0x0014, 0x0176 }, + { 0x0014, 0x0177 }, + { 0x0014, 0x0178 }, + { 0x0014, 0x0179 }, + { 0x0014, 0x017a }, + { 0x0014, 0x017b }, + { 0x0014, 0x017c }, + { 0x0014, 0x017d }, + { 0x0014, 0x017e }, + { 0x0014, 0x017f }, + { 0x0014, 0x0180 }, + { 0x0014, 0x0181 }, + { 0x0014, 0x0182 }, + { 0x0014, 0x0183 }, + { 0x0014, 0x0184 }, + { 0x0014, 0x0185 }, + { 0x0014, 0x0186 }, + { 0x0014, 0x0187 }, + { 0x0014, 0x0188 }, + { 0x0014, 0x0189 }, + { 0x0014, 0x018a }, + { 0x0014, 0x018b }, + { 0x0014, 0x018c }, + { 0x0014, 0x018d }, + { 0x0014, 0x018e }, + { 0x0014, 0x018f }, + { 0x0014, 0x0190 }, + { 0x0014, 0x0191 }, + { 0x0014, 0x0192 }, + { 0x0014, 0x0193 }, + { 0x0014, 0x0194 }, + { 0x0014, 0x0195 }, + { 0x0014, 0x0196 }, + { 0x0014, 0x0197 }, + { 0x0013, 0x00db }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec15[73][16] = -{ - {0x000cffff, 0x000bffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000019, 0x0000001a, 0x00000031, 0x00000032, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, }, - {0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, 0x00030062, }, - {0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x00020060, 0x00020060, 0x00020060, 0x00020060, }, - {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, - {0x00010005, 0x00010005, 0x0001001e, 0x0001001e, 0x00010036, 0x00010036, 0x0001004d, 0x0001004d, 0x00010065, 0x00010065, 0x00010078, 0x00010078, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, }, - {0x0015ffff, 0x0014ffff, 0x0012ffff, 0x0013ffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x00000006, 0x0000001f, 0x0000004e, 0x0000007d, 0x00000090, 0x00000093, 0x000000a9, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, }, - {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, }, - {0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, - {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, }, - {0x000100ad, 0x000100ad, 0x000100c0, 0x000100c0, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020038, 0x00020038, 0x00020038, 0x00020038, }, - {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c1, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, }, - {0x00000097, 0x000000ae, 0x000000c5, 0x000000d8, 0x000000d9, 0x000000da, 0x00010008, 0x00010008, 0x00010050, 0x00010050, 0x00010068, 0x00010068, 0x0001007f, 0x0001007f, 0x00010096, 0x00010096, }, - {0x002fffff, 0x0020ffff, 0x001fffff, 0x001effff, 0x001bffff, 0x001cffff, 0x001dffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000021, 0x00000039, 0x00000051, 0x00000080, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, - {0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, 0x000300c6, }, - {0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, 0x000300dc, }, - {0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f1, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, 0x000300f2, }, - {0x00010109, 0x00010109, 0x0001010b, 0x0001010b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, - {0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200c7, 0x000200c7, 0x000200c7, 0x000200c7, }, - {0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f0, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, }, - {0x0000010a, 0x0000010c, 0x00000121, 0x00000122, 0x0001000b, 0x0001000b, 0x00010023, 0x00010023, 0x00010053, 0x00010053, 0x00010099, 0x00010099, 0x000100de, 0x000100de, 0x000100f5, 0x000100f5, }, - {0x0024ffff, 0x0022ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x0000003b, 0x0000006b, 0x00000082, 0x0000009a, 0x000000b1, 0x000000c8, 0x000000df, 0x000000f6, 0x00000108, }, - {0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x002dffff, 0x002effff, 0x002affff, 0x002bffff, 0x002cffff, 0x0021ffff, 0x0023ffff, }, - {0x0002013b, 0x0002013b, 0x0002013b, 0x0002013b, 0x00020154, 0x00020154, 0x00020154, 0x00020154, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x00030083, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, 0x0003006c, }, - {0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300b2, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, 0x000300ca, }, - {0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, }, - {0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, }, - {0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010d, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, 0x0003010e, }, - {0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030123, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, 0x00030124, }, - {0x0001013e, 0x0001013e, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001023f, 0x0001023f, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, - {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, }, - {0x0002010f, 0x0002010f, 0x0002010f, 0x0002010f, 0x00020120, 0x00020120, 0x00020120, 0x00020120, 0x00020127, 0x00020127, 0x00020127, 0x00020127, 0x0002013a, 0x0002013a, 0x0002013a, 0x0002013a, }, - {0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, 0x0000023e, 0x0001000e, 0x0001000e, 0x00010026, 0x00010026, 0x0001006d, 0x0001006d, 0x0001009d, 0x0001009d, }, - {0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x00010112, 0x00010112, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010128, 0x00010128, 0x00010138, 0x00010138, 0x00010139, 0x00010139, }, - {0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, }, - {0x0000000d, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, }, - {0x0000002d, 0x0000002e, 0x0000002f, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000047, 0x00000056, 0x00000057, 0x00000058, }, - {0x00000059, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, }, - {0x00000077, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x0000008f, 0x0000009c, 0x0000009e, 0x0000009f, }, - {0x000000a0, 0x000000a1, 0x000000a2, 0x000000a3, 0x000000a4, 0x000000a5, 0x000000a6, 0x000000a7, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, 0x000000ba, 0x000000bb, }, - {0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000e3, }, - {0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f9, 0x000000fa, 0x000000fb, 0x000000fc, }, - {0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000110, 0x00000111, 0x00000113, 0x00000114, 0x00000115, }, - {0x00000116, 0x00000117, 0x00000118, 0x00000119, 0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000129, 0x0000012a, 0x0000012b, 0x0000012c, 0x0000012d, 0x0000012e, }, - {0x0000012f, 0x00000130, 0x00000131, 0x00000132, 0x00000133, 0x00000134, 0x00000135, 0x00000136, 0x00000137, 0x0000013c, 0x0000013d, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, }, - {0x00000144, 0x00000145, 0x00000146, 0x00000147, 0x00000148, 0x00000149, 0x0000014a, 0x0000014b, 0x0000014c, 0x0000014d, 0x0000014e, 0x0000014f, 0x00000150, 0x00000151, 0x00000152, 0x00000153, }, - {0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x0000015f, 0x00000160, 0x00000161, 0x00000162, 0x00000163, 0x00000164, }, - {0x00000165, 0x00000166, 0x00000167, 0x00000168, 0x00000169, 0x0000016a, 0x0000016b, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, }, - {0x00000177, 0x00000178, 0x00000179, 0x0000017a, 0x0000017b, 0x0000017c, 0x0000017d, 0x0000017e, 0x0000017f, 0x00000180, 0x00000181, 0x00000182, 0x00000183, 0x00000184, 0x00000185, 0x00000186, }, - {0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00000190, 0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x00000195, 0x00000196, }, - {0x00000197, 0x00000198, 0x00000199, 0x0000019a, 0x0000019b, 0x0000019c, 0x0000019d, 0x0000019e, 0x0000019f, 0x000001a0, 0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, }, - {0x000001a7, 0x000001a8, 0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b0, 0x000001b1, 0x000001b2, 0x000001b3, 0x000001b4, 0x000001b5, 0x000001b6, }, - {0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, 0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, 0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, }, - {0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cc, 0x000001cd, 0x000001ce, 0x000001cf, 0x000001d0, 0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, }, - {0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, 0x000001de, 0x000001df, 0x000001e0, 0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, }, - {0x000001e7, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, 0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, 0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, }, - {0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, 0x000001fe, 0x000001ff, 0x00000200, 0x00000201, 0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, }, - {0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, 0x0000020e, 0x0000020f, 0x00000210, 0x00000211, 0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, }, - {0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, }, - {0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, }, +const uint32_t c_aauiCQMFHuffDec15[73][16] = { + { + 0x000cffff, + 0x000bffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x0002ffff, + 0x0001ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x00000019, + 0x0000001a, + 0x00000031, + 0x00000032, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + }, + { + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + }, + { + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + }, + { + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + 0x00030062, + }, + { + 0x00010091, + 0x00010091, + 0x00010092, + 0x00010092, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + }, + { + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + }, + { + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + }, + { + 0x00010005, + 0x00010005, + 0x0001001e, + 0x0001001e, + 0x00010036, + 0x00010036, + 0x0001004d, + 0x0001004d, + 0x00010065, + 0x00010065, + 0x00010078, + 0x00010078, + 0x0001007b, + 0x0001007b, + 0x0001007c, + 0x0001007c, + }, + { + 0x0015ffff, + 0x0014ffff, + 0x0012ffff, + 0x0013ffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x00000006, + 0x0000001f, + 0x0000004e, + 0x0000007d, + 0x00000090, + 0x00000093, + 0x000000a9, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + }, + { + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + }, + { + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + }, + { + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + }, + { + 0x000100ad, + 0x000100ad, + 0x000100c0, + 0x000100c0, + 0x000100c3, + 0x000100c3, + 0x000100c4, + 0x000100c4, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020038, + }, + { + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200c1, + 0x000200c1, + 0x000200c1, + 0x000200c1, + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200c2, + }, + { + 0x00000097, + 0x000000ae, + 0x000000c5, + 0x000000d8, + 0x000000d9, + 0x000000da, + 0x00010008, + 0x00010008, + 0x00010050, + 0x00010050, + 0x00010068, + 0x00010068, + 0x0001007f, + 0x0001007f, + 0x00010096, + 0x00010096, + }, + { + 0x002fffff, + 0x0020ffff, + 0x001fffff, + 0x001effff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x00000021, + 0x00000039, + 0x00000051, + 0x00000080, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + }, + { + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + 0x000300c6, + }, + { + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + 0x000300dc, + }, + { + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f1, + 0x000300f2, + 0x000300f2, + 0x000300f2, + 0x000300f2, + 0x000300f2, + 0x000300f2, + 0x000300f2, + 0x000300f2, + }, + { + 0x00010109, + 0x00010109, + 0x0001010b, + 0x0001010b, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + }, + { + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200c7, + 0x000200c7, + 0x000200c7, + 0x000200c7, + }, + { + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x000200f0, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f4, + 0x000200f4, + 0x000200f4, + 0x000200f4, + }, + { + 0x0000010a, + 0x0000010c, + 0x00000121, + 0x00000122, + 0x0001000b, + 0x0001000b, + 0x00010023, + 0x00010023, + 0x00010053, + 0x00010053, + 0x00010099, + 0x00010099, + 0x000100de, + 0x000100de, + 0x000100f5, + 0x000100f5, + }, + { + 0x0024ffff, + 0x0022ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x0000003b, + 0x0000006b, + 0x00000082, + 0x0000009a, + 0x000000b1, + 0x000000c8, + 0x000000df, + 0x000000f6, + 0x00000108, + }, + { + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0044ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x002dffff, + 0x002effff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x0021ffff, + 0x0023ffff, + }, + { + 0x0002013b, + 0x0002013b, + 0x0002013b, + 0x0002013b, + 0x00020154, + 0x00020154, + 0x00020154, + 0x00020154, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030083, + 0x00030083, + 0x00030083, + 0x00030083, + 0x00030083, + 0x00030083, + 0x00030083, + 0x00030083, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + }, + { + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x0003006c, + 0x0003006c, + 0x0003006c, + 0x0003006c, + 0x0003006c, + 0x0003006c, + 0x0003006c, + 0x0003006c, + }, + { + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300b2, + 0x000300ca, + 0x000300ca, + 0x000300ca, + 0x000300ca, + 0x000300ca, + 0x000300ca, + 0x000300ca, + 0x000300ca, + }, + { + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + }, + { + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + }, + { + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010d, + 0x0003010e, + 0x0003010e, + 0x0003010e, + 0x0003010e, + 0x0003010e, + 0x0003010e, + 0x0003010e, + 0x0003010e, + }, + { + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030123, + 0x00030124, + 0x00030124, + 0x00030124, + 0x00030124, + 0x00030124, + 0x00030124, + 0x00030124, + 0x00030124, + }, + { + 0x0001013e, + 0x0001013e, + 0x0001016c, + 0x0001016c, + 0x0001016d, + 0x0001016d, + 0x0001023f, + 0x0001023f, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + }, + { + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200f8, + 0x000200f8, + 0x000200f8, + 0x000200f8, + }, + { + 0x0002010f, + 0x0002010f, + 0x0002010f, + 0x0002010f, + 0x00020120, + 0x00020120, + 0x00020120, + 0x00020120, + 0x00020127, + 0x00020127, + 0x00020127, + 0x00020127, + 0x0002013a, + 0x0002013a, + 0x0002013a, + 0x0002013a, + }, + { + 0x00000237, + 0x00000238, + 0x00000239, + 0x0000023a, + 0x0000023b, + 0x0000023c, + 0x0000023d, + 0x0000023e, + 0x0001000e, + 0x0001000e, + 0x00010026, + 0x00010026, + 0x0001006d, + 0x0001006d, + 0x0001009d, + 0x0001009d, + }, + { + 0x000100cb, + 0x000100cb, + 0x000100cc, + 0x000100cc, + 0x00010112, + 0x00010112, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010128, + 0x00010128, + 0x00010138, + 0x00010138, + 0x00010139, + 0x00010139, + }, + { + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + 0x0039ffff, + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + 0x003fffff, + }, + { + 0x0000000d, + 0x0000000f, + 0x00000010, + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000027, + 0x00000028, + 0x00000029, + 0x0000002a, + 0x0000002b, + 0x0000002c, + }, + { + 0x0000002d, + 0x0000002e, + 0x0000002f, + 0x0000003e, + 0x0000003f, + 0x00000040, + 0x00000041, + 0x00000042, + 0x00000043, + 0x00000044, + 0x00000045, + 0x00000046, + 0x00000047, + 0x00000056, + 0x00000057, + 0x00000058, + }, + { + 0x00000059, + 0x0000005a, + 0x0000005b, + 0x0000005c, + 0x0000005d, + 0x0000005e, + 0x0000005f, + 0x0000006e, + 0x0000006f, + 0x00000070, + 0x00000071, + 0x00000072, + 0x00000073, + 0x00000074, + 0x00000075, + 0x00000076, + }, + { + 0x00000077, + 0x00000084, + 0x00000085, + 0x00000086, + 0x00000087, + 0x00000088, + 0x00000089, + 0x0000008a, + 0x0000008b, + 0x0000008c, + 0x0000008d, + 0x0000008e, + 0x0000008f, + 0x0000009c, + 0x0000009e, + 0x0000009f, + }, + { + 0x000000a0, + 0x000000a1, + 0x000000a2, + 0x000000a3, + 0x000000a4, + 0x000000a5, + 0x000000a6, + 0x000000a7, + 0x000000b4, + 0x000000b5, + 0x000000b6, + 0x000000b7, + 0x000000b8, + 0x000000b9, + 0x000000ba, + 0x000000bb, + }, + { + 0x000000bc, + 0x000000bd, + 0x000000be, + 0x000000bf, + 0x000000cd, + 0x000000ce, + 0x000000cf, + 0x000000d0, + 0x000000d1, + 0x000000d2, + 0x000000d3, + 0x000000d4, + 0x000000d5, + 0x000000d6, + 0x000000d7, + 0x000000e3, + }, + { + 0x000000e4, + 0x000000e5, + 0x000000e6, + 0x000000e7, + 0x000000e8, + 0x000000e9, + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + 0x000000ee, + 0x000000ef, + 0x000000f9, + 0x000000fa, + 0x000000fb, + 0x000000fc, + }, + { + 0x000000fd, + 0x000000fe, + 0x000000ff, + 0x00000100, + 0x00000101, + 0x00000102, + 0x00000103, + 0x00000104, + 0x00000105, + 0x00000106, + 0x00000107, + 0x00000110, + 0x00000111, + 0x00000113, + 0x00000114, + 0x00000115, + }, + { + 0x00000116, + 0x00000117, + 0x00000118, + 0x00000119, + 0x0000011a, + 0x0000011b, + 0x0000011c, + 0x0000011d, + 0x0000011e, + 0x0000011f, + 0x00000129, + 0x0000012a, + 0x0000012b, + 0x0000012c, + 0x0000012d, + 0x0000012e, + }, + { + 0x0000012f, + 0x00000130, + 0x00000131, + 0x00000132, + 0x00000133, + 0x00000134, + 0x00000135, + 0x00000136, + 0x00000137, + 0x0000013c, + 0x0000013d, + 0x0000013f, + 0x00000140, + 0x00000141, + 0x00000142, + 0x00000143, + }, + { + 0x00000144, + 0x00000145, + 0x00000146, + 0x00000147, + 0x00000148, + 0x00000149, + 0x0000014a, + 0x0000014b, + 0x0000014c, + 0x0000014d, + 0x0000014e, + 0x0000014f, + 0x00000150, + 0x00000151, + 0x00000152, + 0x00000153, + }, + { + 0x00000155, + 0x00000156, + 0x00000157, + 0x00000158, + 0x00000159, + 0x0000015a, + 0x0000015b, + 0x0000015c, + 0x0000015d, + 0x0000015e, + 0x0000015f, + 0x00000160, + 0x00000161, + 0x00000162, + 0x00000163, + 0x00000164, + }, + { + 0x00000165, + 0x00000166, + 0x00000167, + 0x00000168, + 0x00000169, + 0x0000016a, + 0x0000016b, + 0x0000016e, + 0x0000016f, + 0x00000170, + 0x00000171, + 0x00000172, + 0x00000173, + 0x00000174, + 0x00000175, + 0x00000176, + }, + { + 0x00000177, + 0x00000178, + 0x00000179, + 0x0000017a, + 0x0000017b, + 0x0000017c, + 0x0000017d, + 0x0000017e, + 0x0000017f, + 0x00000180, + 0x00000181, + 0x00000182, + 0x00000183, + 0x00000184, + 0x00000185, + 0x00000186, + }, + { + 0x00000187, + 0x00000188, + 0x00000189, + 0x0000018a, + 0x0000018b, + 0x0000018c, + 0x0000018d, + 0x0000018e, + 0x0000018f, + 0x00000190, + 0x00000191, + 0x00000192, + 0x00000193, + 0x00000194, + 0x00000195, + 0x00000196, + }, + { + 0x00000197, + 0x00000198, + 0x00000199, + 0x0000019a, + 0x0000019b, + 0x0000019c, + 0x0000019d, + 0x0000019e, + 0x0000019f, + 0x000001a0, + 0x000001a1, + 0x000001a2, + 0x000001a3, + 0x000001a4, + 0x000001a5, + 0x000001a6, + }, + { + 0x000001a7, + 0x000001a8, + 0x000001a9, + 0x000001aa, + 0x000001ab, + 0x000001ac, + 0x000001ad, + 0x000001ae, + 0x000001af, + 0x000001b0, + 0x000001b1, + 0x000001b2, + 0x000001b3, + 0x000001b4, + 0x000001b5, + 0x000001b6, + }, + { + 0x000001b7, + 0x000001b8, + 0x000001b9, + 0x000001ba, + 0x000001bb, + 0x000001bc, + 0x000001bd, + 0x000001be, + 0x000001bf, + 0x000001c0, + 0x000001c1, + 0x000001c2, + 0x000001c3, + 0x000001c4, + 0x000001c5, + 0x000001c6, + }, + { + 0x000001c7, + 0x000001c8, + 0x000001c9, + 0x000001ca, + 0x000001cb, + 0x000001cc, + 0x000001cd, + 0x000001ce, + 0x000001cf, + 0x000001d0, + 0x000001d1, + 0x000001d2, + 0x000001d3, + 0x000001d4, + 0x000001d5, + 0x000001d6, + }, + { + 0x000001d7, + 0x000001d8, + 0x000001d9, + 0x000001da, + 0x000001db, + 0x000001dc, + 0x000001dd, + 0x000001de, + 0x000001df, + 0x000001e0, + 0x000001e1, + 0x000001e2, + 0x000001e3, + 0x000001e4, + 0x000001e5, + 0x000001e6, + }, + { + 0x000001e7, + 0x000001e8, + 0x000001e9, + 0x000001ea, + 0x000001eb, + 0x000001ec, + 0x000001ed, + 0x000001ee, + 0x000001ef, + 0x000001f0, + 0x000001f1, + 0x000001f2, + 0x000001f3, + 0x000001f4, + 0x000001f5, + 0x000001f6, + }, + { + 0x000001f7, + 0x000001f8, + 0x000001f9, + 0x000001fa, + 0x000001fb, + 0x000001fc, + 0x000001fd, + 0x000001fe, + 0x000001ff, + 0x00000200, + 0x00000201, + 0x00000202, + 0x00000203, + 0x00000204, + 0x00000205, + 0x00000206, + }, + { + 0x00000207, + 0x00000208, + 0x00000209, + 0x0000020a, + 0x0000020b, + 0x0000020c, + 0x0000020d, + 0x0000020e, + 0x0000020f, + 0x00000210, + 0x00000211, + 0x00000212, + 0x00000213, + 0x00000214, + 0x00000215, + 0x00000216, + }, + { + 0x00000217, + 0x00000218, + 0x00000219, + 0x0000021a, + 0x0000021b, + 0x0000021c, + 0x0000021d, + 0x0000021e, + 0x0000021f, + 0x00000220, + 0x00000221, + 0x00000222, + 0x00000223, + 0x00000224, + 0x00000225, + 0x00000226, + }, + { + 0x00000227, + 0x00000228, + 0x00000229, + 0x0000022a, + 0x0000022b, + 0x0000022c, + 0x0000022d, + 0x0000022e, + 0x0000022f, + 0x00000230, + 0x00000231, + 0x00000232, + 0x00000233, + 0x00000234, + 0x00000235, + 0x00000236, + }, }; #endif @@ -1243,190 +12103,2271 @@ const uint32_t c_aauiCQMFHuffEnc16[729][2] = #else const uint16_t c_aauiCQMFHuffEnc16[729][2] = #endif -{ - {0x0006, 0x000d}, {0x0005, 0x0010}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x000a}, - {0x0009, 0x000b}, {0x000b, 0x000d}, {0x000c, 0x000e}, {0x000e, 0x0016}, {0x0010, 0x002d}, {0x0011, 0x0051}, {0x0012, 0x008c}, {0x0014, 0x0000}, - {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, - {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0005, 0x0011}, {0x0004, 0x000f}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, - {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0007, 0x000c}, {0x0008, 0x000b}, {0x000a, 0x000c}, {0x000b, 0x000e}, {0x000d, 0x0010}, {0x000e, 0x0017}, - {0x000f, 0x001c}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, - {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0006, 0x0013}, {0x0005, 0x0015}, - {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0006, 0x0014}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0009, 0x000c}, {0x000a, 0x000d}, - {0x000c, 0x000f}, {0x000d, 0x0011}, {0x000f, 0x001d}, {0x0011, 0x0052}, {0x0012, 0x008d}, {0x0012, 0x008e}, {0x0014, 0x0017}, {0x0014, 0x0018}, - {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, - {0x0014, 0x0021}, {0x0006, 0x0015}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0007, 0x000f}, - {0x0008, 0x000c}, {0x0009, 0x000d}, {0x000b, 0x000f}, {0x000c, 0x0010}, {0x000d, 0x0012}, {0x000f, 0x001e}, {0x0012, 0x008f}, {0x0014, 0x0022}, - {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, {0x0014, 0x002a}, - {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0006, 0x0018}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0006, 0x0019}, - {0x0006, 0x001a}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000d}, {0x000a, 0x000e}, {0x000b, 0x0010}, {0x000c, 0x0011}, {0x000e, 0x0018}, - {0x0010, 0x002e}, {0x0012, 0x0090}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, - {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, {0x0007, 0x0012}, - {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0008, 0x000e}, {0x0009, 0x000e}, {0x000b, 0x0011}, - {0x000c, 0x0012}, {0x000d, 0x0013}, {0x000e, 0x0019}, {0x0010, 0x002f}, {0x0012, 0x0091}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, - {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, - {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0007, 0x0015}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0007, 0x0016}, {0x0007, 0x0017}, {0x0008, 0x000f}, - {0x0009, 0x000f}, {0x000a, 0x000f}, {0x000b, 0x0012}, {0x000d, 0x0014}, {0x000e, 0x001a}, {0x000f, 0x001f}, {0x0013, 0x010f}, {0x0011, 0x0053}, - {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, - {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0008, 0x0010}, {0x0007, 0x0018}, {0x0007, 0x0019}, - {0x0008, 0x0011}, {0x0008, 0x0012}, {0x0009, 0x0010}, {0x000a, 0x0010}, {0x000b, 0x0013}, {0x000c, 0x0013}, {0x000e, 0x001b}, {0x000f, 0x0020}, - {0x0010, 0x0030}, {0x0012, 0x0092}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, - {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, - {0x0009, 0x0011}, {0x0008, 0x0013}, {0x0009, 0x0012}, {0x0009, 0x0013}, {0x000a, 0x0011}, {0x000a, 0x0012}, {0x000b, 0x0014}, {0x000c, 0x0014}, - {0x000d, 0x0015}, {0x000e, 0x001c}, {0x000f, 0x0021}, {0x0013, 0x0110}, {0x0012, 0x0093}, {0x0012, 0x0094}, {0x0014, 0x0062}, {0x0014, 0x0063}, - {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, - {0x0014, 0x006c}, {0x0014, 0x006d}, {0x0014, 0x006e}, {0x000b, 0x0015}, {0x000a, 0x0013}, {0x000a, 0x0014}, {0x000a, 0x0015}, {0x000b, 0x0016}, - {0x000c, 0x0015}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000f, 0x0022}, {0x0010, 0x0031}, {0x0012, 0x0095}, {0x0012, 0x0096}, {0x0014, 0x006f}, - {0x0013, 0x0111}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, {0x0014, 0x0076}, - {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x000c, 0x0016}, {0x000b, 0x0017}, - {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000d, 0x0018}, {0x000e, 0x001d}, {0x000f, 0x0023}, {0x000f, 0x0024}, {0x0011, 0x0054}, - {0x0012, 0x0097}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, - {0x0014, 0x0084}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, - {0x0014, 0x008c}, {0x000e, 0x001e}, {0x000d, 0x0019}, {0x000d, 0x001a}, {0x000d, 0x001b}, {0x000e, 0x001f}, {0x000f, 0x0025}, {0x000f, 0x0026}, - {0x0010, 0x0032}, {0x0010, 0x0033}, {0x0012, 0x0098}, {0x0013, 0x0112}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, - {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, - {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x000f, 0x0027}, {0x000f, 0x0028}, {0x000f, 0x0029}, {0x000f, 0x002a}, - {0x0010, 0x0034}, {0x000f, 0x002b}, {0x0011, 0x0055}, {0x0012, 0x0099}, {0x0012, 0x009a}, {0x0012, 0x009b}, {0x0014, 0x009d}, {0x0013, 0x0113}, - {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, - {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0011, 0x0056}, - {0x0010, 0x0035}, {0x0010, 0x0036}, {0x0010, 0x0037}, {0x0011, 0x0057}, {0x0012, 0x009c}, {0x0012, 0x009d}, {0x0012, 0x009e}, {0x0014, 0x00ad}, - {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, - {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, - {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0012, 0x009f}, {0x0011, 0x0058}, {0x0012, 0x00a0}, {0x0014, 0x00c0}, {0x0011, 0x0059}, {0x0013, 0x0114}, - {0x0012, 0x00a1}, {0x0014, 0x00c1}, {0x0013, 0x0115}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, - {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, - {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, - {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, - {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, - {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, - {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, - {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, - {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, - {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, - {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, - {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, - {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0013, 0x0116}, - {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, - {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, - {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, {0x0014, 0x0139}, {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, - {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, {0x0014, 0x0141}, {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, - {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, {0x0014, 0x0149}, {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, - {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, {0x0014, 0x0151}, {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, - {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, {0x0014, 0x0159}, {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, - {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, {0x0014, 0x0161}, {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, - {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, {0x0014, 0x0169}, {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, - {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, {0x0014, 0x0171}, {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, - {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, {0x0014, 0x0179}, {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, - {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, {0x0014, 0x0181}, {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, - {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, {0x0014, 0x0189}, {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, - {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, {0x0014, 0x0191}, {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, - {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0014, 0x0198}, {0x0014, 0x0199}, {0x0014, 0x019a}, {0x0014, 0x019b}, {0x0014, 0x019c}, {0x0014, 0x019d}, - {0x0014, 0x019e}, {0x0014, 0x019f}, {0x0014, 0x01a0}, {0x0014, 0x01a1}, {0x0014, 0x01a2}, {0x0014, 0x01a3}, {0x0014, 0x01a4}, {0x0014, 0x01a5}, - {0x0014, 0x01a6}, {0x0014, 0x01a7}, {0x0014, 0x01a8}, {0x0014, 0x01a9}, {0x0014, 0x01aa}, {0x0014, 0x01ab}, {0x0014, 0x01ac}, {0x0014, 0x01ad}, - {0x0014, 0x01ae}, {0x0014, 0x01af}, {0x0014, 0x01b0}, {0x0014, 0x01b1}, {0x0014, 0x01b2}, {0x0014, 0x01b3}, {0x0014, 0x01b4}, {0x0014, 0x01b5}, - {0x0014, 0x01b6}, {0x0014, 0x01b7}, {0x0014, 0x01b8}, {0x0014, 0x01b9}, {0x0014, 0x01ba}, {0x0014, 0x01bb}, {0x0014, 0x01bc}, {0x0014, 0x01bd}, - {0x0014, 0x01be}, {0x0014, 0x01bf}, {0x0014, 0x01c0}, {0x0014, 0x01c1}, {0x0014, 0x01c2}, {0x0014, 0x01c3}, {0x0014, 0x01c4}, {0x0014, 0x01c5}, - {0x0014, 0x01c6}, {0x0014, 0x01c7}, {0x0014, 0x01c8}, {0x0014, 0x01c9}, {0x0014, 0x01ca}, {0x0014, 0x01cb}, {0x0014, 0x01cc}, {0x0014, 0x01cd}, - {0x0014, 0x01ce}, {0x0014, 0x01cf}, {0x0014, 0x01d0}, {0x0014, 0x01d1}, {0x0014, 0x01d2}, {0x0014, 0x01d3}, {0x0014, 0x01d4}, {0x0014, 0x01d5}, - {0x0014, 0x01d6}, {0x0014, 0x01d7}, {0x0014, 0x01d8}, {0x0014, 0x01d9}, {0x0014, 0x01da}, {0x0014, 0x01db}, {0x0014, 0x01dc}, {0x0014, 0x01dd}, - {0x0014, 0x01de}, {0x0014, 0x01df}, {0x0014, 0x01e0}, {0x0014, 0x01e1}, {0x0014, 0x01e2}, {0x0014, 0x01e3}, {0x0014, 0x01e4}, {0x0014, 0x01e5}, - {0x0014, 0x01e6}, {0x0014, 0x01e7}, {0x0014, 0x01e8}, {0x0014, 0x01e9}, {0x0014, 0x01ea}, {0x0014, 0x01eb}, {0x0014, 0x01ec}, {0x0014, 0x01ed}, - {0x0014, 0x01ee}, {0x0014, 0x01ef}, {0x0014, 0x01f0}, {0x0014, 0x01f1}, {0x0014, 0x01f2}, {0x0014, 0x01f3}, {0x0014, 0x01f4}, {0x0014, 0x01f5}, - {0x0014, 0x01f6}, {0x0014, 0x01f7}, {0x0014, 0x01f8}, {0x0014, 0x01f9}, {0x0014, 0x01fa}, {0x0014, 0x01fb}, {0x0014, 0x01fc}, {0x0014, 0x01fd}, - {0x0014, 0x01fe}, {0x0014, 0x01ff}, {0x0014, 0x0200}, {0x0014, 0x0201}, {0x0014, 0x0202}, {0x0014, 0x0203}, {0x0014, 0x0204}, {0x0014, 0x0205}, - {0x0014, 0x0206}, {0x0014, 0x0207}, {0x0014, 0x0208}, {0x0014, 0x0209}, {0x0014, 0x020a}, {0x0014, 0x020b}, {0x0014, 0x020c}, {0x0014, 0x020d}, - {0x0014, 0x020e}, {0x0014, 0x020f}, {0x0014, 0x0210}, {0x0014, 0x0211}, {0x0014, 0x0212}, {0x0014, 0x0213}, {0x0014, 0x0214}, {0x0014, 0x0215}, - {0x0013, 0x0117}, + { + { 0x0006, 0x000d }, + { 0x0005, 0x0010 }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0008, 0x000a }, + { 0x0009, 0x000b }, + { 0x000b, 0x000d }, + { 0x000c, 0x000e }, + { 0x000e, 0x0016 }, + { 0x0010, 0x002d }, + { 0x0011, 0x0051 }, + { 0x0012, 0x008c }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0014, 0x0006 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0005, 0x0011 }, + { 0x0004, 0x000f }, + { 0x0005, 0x0012 }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0007, 0x000c }, + { 0x0008, 0x000b }, + { 0x000a, 0x000c }, + { 0x000b, 0x000e }, + { 0x000d, 0x0010 }, + { 0x000e, 0x0017 }, + { 0x000f, 0x001c }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0006, 0x0013 }, + { 0x0005, 0x0015 }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0005, 0x0018 }, + { 0x0006, 0x0014 }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0009, 0x000c }, + { 0x000a, 0x000d }, + { 0x000c, 0x000f }, + { 0x000d, 0x0011 }, + { 0x000f, 0x001d }, + { 0x0011, 0x0052 }, + { 0x0012, 0x008d }, + { 0x0012, 0x008e }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0014, 0x001c }, + { 0x0014, 0x001d }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0014, 0x0020 }, + { 0x0014, 0x0021 }, + { 0x0006, 0x0015 }, + { 0x0005, 0x0019 }, + { 0x0005, 0x001a }, + { 0x0005, 0x001b }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0007, 0x000f }, + { 0x0008, 0x000c }, + { 0x0009, 0x000d }, + { 0x000b, 0x000f }, + { 0x000c, 0x0010 }, + { 0x000d, 0x0012 }, + { 0x000f, 0x001e }, + { 0x0012, 0x008f }, + { 0x0014, 0x0022 }, + { 0x0014, 0x0023 }, + { 0x0014, 0x0024 }, + { 0x0014, 0x0025 }, + { 0x0014, 0x0026 }, + { 0x0014, 0x0027 }, + { 0x0014, 0x0028 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0014, 0x002d }, + { 0x0014, 0x002e }, + { 0x0006, 0x0018 }, + { 0x0005, 0x001c }, + { 0x0005, 0x001d }, + { 0x0006, 0x0019 }, + { 0x0006, 0x001a }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0008, 0x000d }, + { 0x000a, 0x000e }, + { 0x000b, 0x0010 }, + { 0x000c, 0x0011 }, + { 0x000e, 0x0018 }, + { 0x0010, 0x002e }, + { 0x0012, 0x0090 }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0014, 0x002f }, + { 0x0014, 0x0030 }, + { 0x0014, 0x0031 }, + { 0x0014, 0x0032 }, + { 0x0014, 0x0033 }, + { 0x0014, 0x0034 }, + { 0x0014, 0x0035 }, + { 0x0014, 0x0036 }, + { 0x0014, 0x0037 }, + { 0x0014, 0x0038 }, + { 0x0014, 0x0039 }, + { 0x0007, 0x0012 }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0007, 0x0013 }, + { 0x0007, 0x0014 }, + { 0x0008, 0x000e }, + { 0x0009, 0x000e }, + { 0x000b, 0x0011 }, + { 0x000c, 0x0012 }, + { 0x000d, 0x0013 }, + { 0x000e, 0x0019 }, + { 0x0010, 0x002f }, + { 0x0012, 0x0091 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x0014, 0x003e }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0007, 0x0015 }, + { 0x0006, 0x001e }, + { 0x0006, 0x001f }, + { 0x0007, 0x0016 }, + { 0x0007, 0x0017 }, + { 0x0008, 0x000f }, + { 0x0009, 0x000f }, + { 0x000a, 0x000f }, + { 0x000b, 0x0012 }, + { 0x000d, 0x0014 }, + { 0x000e, 0x001a }, + { 0x000f, 0x001f }, + { 0x0013, 0x010f }, + { 0x0011, 0x0053 }, + { 0x0014, 0x0047 }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0014, 0x0052 }, + { 0x0014, 0x0053 }, + { 0x0008, 0x0010 }, + { 0x0007, 0x0018 }, + { 0x0007, 0x0019 }, + { 0x0008, 0x0011 }, + { 0x0008, 0x0012 }, + { 0x0009, 0x0010 }, + { 0x000a, 0x0010 }, + { 0x000b, 0x0013 }, + { 0x000c, 0x0013 }, + { 0x000e, 0x001b }, + { 0x000f, 0x0020 }, + { 0x0010, 0x0030 }, + { 0x0012, 0x0092 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0014, 0x005e }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0009, 0x0011 }, + { 0x0008, 0x0013 }, + { 0x0009, 0x0012 }, + { 0x0009, 0x0013 }, + { 0x000a, 0x0011 }, + { 0x000a, 0x0012 }, + { 0x000b, 0x0014 }, + { 0x000c, 0x0014 }, + { 0x000d, 0x0015 }, + { 0x000e, 0x001c }, + { 0x000f, 0x0021 }, + { 0x0013, 0x0110 }, + { 0x0012, 0x0093 }, + { 0x0012, 0x0094 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x0014, 0x006a }, + { 0x0014, 0x006b }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x000b, 0x0015 }, + { 0x000a, 0x0013 }, + { 0x000a, 0x0014 }, + { 0x000a, 0x0015 }, + { 0x000b, 0x0016 }, + { 0x000c, 0x0015 }, + { 0x000d, 0x0016 }, + { 0x000d, 0x0017 }, + { 0x000f, 0x0022 }, + { 0x0010, 0x0031 }, + { 0x0012, 0x0095 }, + { 0x0012, 0x0096 }, + { 0x0014, 0x006f }, + { 0x0013, 0x0111 }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x000c, 0x0016 }, + { 0x000b, 0x0017 }, + { 0x000c, 0x0017 }, + { 0x000c, 0x0018 }, + { 0x000c, 0x0019 }, + { 0x000d, 0x0018 }, + { 0x000e, 0x001d }, + { 0x000f, 0x0023 }, + { 0x000f, 0x0024 }, + { 0x0011, 0x0054 }, + { 0x0012, 0x0097 }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x000e, 0x001e }, + { 0x000d, 0x0019 }, + { 0x000d, 0x001a }, + { 0x000d, 0x001b }, + { 0x000e, 0x001f }, + { 0x000f, 0x0025 }, + { 0x000f, 0x0026 }, + { 0x0010, 0x0032 }, + { 0x0010, 0x0033 }, + { 0x0012, 0x0098 }, + { 0x0013, 0x0112 }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x000f, 0x0027 }, + { 0x000f, 0x0028 }, + { 0x000f, 0x0029 }, + { 0x000f, 0x002a }, + { 0x0010, 0x0034 }, + { 0x000f, 0x002b }, + { 0x0011, 0x0055 }, + { 0x0012, 0x0099 }, + { 0x0012, 0x009a }, + { 0x0012, 0x009b }, + { 0x0014, 0x009d }, + { 0x0013, 0x0113 }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, + { 0x0014, 0x00a6 }, + { 0x0014, 0x00a7 }, + { 0x0014, 0x00a8 }, + { 0x0014, 0x00a9 }, + { 0x0014, 0x00aa }, + { 0x0014, 0x00ab }, + { 0x0014, 0x00ac }, + { 0x0011, 0x0056 }, + { 0x0010, 0x0035 }, + { 0x0010, 0x0036 }, + { 0x0010, 0x0037 }, + { 0x0011, 0x0057 }, + { 0x0012, 0x009c }, + { 0x0012, 0x009d }, + { 0x0012, 0x009e }, + { 0x0014, 0x00ad }, + { 0x0014, 0x00ae }, + { 0x0014, 0x00af }, + { 0x0014, 0x00b0 }, + { 0x0014, 0x00b1 }, + { 0x0014, 0x00b2 }, + { 0x0014, 0x00b3 }, + { 0x0014, 0x00b4 }, + { 0x0014, 0x00b5 }, + { 0x0014, 0x00b6 }, + { 0x0014, 0x00b7 }, + { 0x0014, 0x00b8 }, + { 0x0014, 0x00b9 }, + { 0x0014, 0x00ba }, + { 0x0014, 0x00bb }, + { 0x0014, 0x00bc }, + { 0x0014, 0x00bd }, + { 0x0014, 0x00be }, + { 0x0014, 0x00bf }, + { 0x0012, 0x009f }, + { 0x0011, 0x0058 }, + { 0x0012, 0x00a0 }, + { 0x0014, 0x00c0 }, + { 0x0011, 0x0059 }, + { 0x0013, 0x0114 }, + { 0x0012, 0x00a1 }, + { 0x0014, 0x00c1 }, + { 0x0013, 0x0115 }, + { 0x0014, 0x00c2 }, + { 0x0014, 0x00c3 }, + { 0x0014, 0x00c4 }, + { 0x0014, 0x00c5 }, + { 0x0014, 0x00c6 }, + { 0x0014, 0x00c7 }, + { 0x0014, 0x00c8 }, + { 0x0014, 0x00c9 }, + { 0x0014, 0x00ca }, + { 0x0014, 0x00cb }, + { 0x0014, 0x00cc }, + { 0x0014, 0x00cd }, + { 0x0014, 0x00ce }, + { 0x0014, 0x00cf }, + { 0x0014, 0x00d0 }, + { 0x0014, 0x00d1 }, + { 0x0014, 0x00d2 }, + { 0x0014, 0x00d3 }, + { 0x0014, 0x00d4 }, + { 0x0014, 0x00d5 }, + { 0x0014, 0x00d6 }, + { 0x0014, 0x00d7 }, + { 0x0014, 0x00d8 }, + { 0x0014, 0x00d9 }, + { 0x0014, 0x00da }, + { 0x0014, 0x00db }, + { 0x0014, 0x00dc }, + { 0x0014, 0x00dd }, + { 0x0014, 0x00de }, + { 0x0014, 0x00df }, + { 0x0014, 0x00e0 }, + { 0x0014, 0x00e1 }, + { 0x0014, 0x00e2 }, + { 0x0014, 0x00e3 }, + { 0x0014, 0x00e4 }, + { 0x0014, 0x00e5 }, + { 0x0014, 0x00e6 }, + { 0x0014, 0x00e7 }, + { 0x0014, 0x00e8 }, + { 0x0014, 0x00e9 }, + { 0x0014, 0x00ea }, + { 0x0014, 0x00eb }, + { 0x0014, 0x00ec }, + { 0x0014, 0x00ed }, + { 0x0014, 0x00ee }, + { 0x0014, 0x00ef }, + { 0x0014, 0x00f0 }, + { 0x0014, 0x00f1 }, + { 0x0014, 0x00f2 }, + { 0x0014, 0x00f3 }, + { 0x0014, 0x00f4 }, + { 0x0014, 0x00f5 }, + { 0x0014, 0x00f6 }, + { 0x0014, 0x00f7 }, + { 0x0014, 0x00f8 }, + { 0x0014, 0x00f9 }, + { 0x0014, 0x00fa }, + { 0x0014, 0x00fb }, + { 0x0014, 0x00fc }, + { 0x0014, 0x00fd }, + { 0x0014, 0x00fe }, + { 0x0014, 0x00ff }, + { 0x0014, 0x0100 }, + { 0x0014, 0x0101 }, + { 0x0014, 0x0102 }, + { 0x0014, 0x0103 }, + { 0x0014, 0x0104 }, + { 0x0014, 0x0105 }, + { 0x0014, 0x0106 }, + { 0x0014, 0x0107 }, + { 0x0014, 0x0108 }, + { 0x0014, 0x0109 }, + { 0x0014, 0x010a }, + { 0x0014, 0x010b }, + { 0x0014, 0x010c }, + { 0x0014, 0x010d }, + { 0x0014, 0x010e }, + { 0x0014, 0x010f }, + { 0x0014, 0x0110 }, + { 0x0014, 0x0111 }, + { 0x0014, 0x0112 }, + { 0x0014, 0x0113 }, + { 0x0014, 0x0114 }, + { 0x0014, 0x0115 }, + { 0x0014, 0x0116 }, + { 0x0014, 0x0117 }, + { 0x0014, 0x0118 }, + { 0x0014, 0x0119 }, + { 0x0014, 0x011a }, + { 0x0014, 0x011b }, + { 0x0014, 0x011c }, + { 0x0014, 0x011d }, + { 0x0014, 0x011e }, + { 0x0014, 0x011f }, + { 0x0014, 0x0120 }, + { 0x0014, 0x0121 }, + { 0x0014, 0x0122 }, + { 0x0014, 0x0123 }, + { 0x0014, 0x0124 }, + { 0x0014, 0x0125 }, + { 0x0013, 0x0116 }, + { 0x0014, 0x0126 }, + { 0x0014, 0x0127 }, + { 0x0014, 0x0128 }, + { 0x0014, 0x0129 }, + { 0x0014, 0x012a }, + { 0x0014, 0x012b }, + { 0x0014, 0x012c }, + { 0x0014, 0x012d }, + { 0x0014, 0x012e }, + { 0x0014, 0x012f }, + { 0x0014, 0x0130 }, + { 0x0014, 0x0131 }, + { 0x0014, 0x0132 }, + { 0x0014, 0x0133 }, + { 0x0014, 0x0134 }, + { 0x0014, 0x0135 }, + { 0x0014, 0x0136 }, + { 0x0014, 0x0137 }, + { 0x0014, 0x0138 }, + { 0x0014, 0x0139 }, + { 0x0014, 0x013a }, + { 0x0014, 0x013b }, + { 0x0014, 0x013c }, + { 0x0014, 0x013d }, + { 0x0014, 0x013e }, + { 0x0014, 0x013f }, + { 0x0014, 0x0140 }, + { 0x0014, 0x0141 }, + { 0x0014, 0x0142 }, + { 0x0014, 0x0143 }, + { 0x0014, 0x0144 }, + { 0x0014, 0x0145 }, + { 0x0014, 0x0146 }, + { 0x0014, 0x0147 }, + { 0x0014, 0x0148 }, + { 0x0014, 0x0149 }, + { 0x0014, 0x014a }, + { 0x0014, 0x014b }, + { 0x0014, 0x014c }, + { 0x0014, 0x014d }, + { 0x0014, 0x014e }, + { 0x0014, 0x014f }, + { 0x0014, 0x0150 }, + { 0x0014, 0x0151 }, + { 0x0014, 0x0152 }, + { 0x0014, 0x0153 }, + { 0x0014, 0x0154 }, + { 0x0014, 0x0155 }, + { 0x0014, 0x0156 }, + { 0x0014, 0x0157 }, + { 0x0014, 0x0158 }, + { 0x0014, 0x0159 }, + { 0x0014, 0x015a }, + { 0x0014, 0x015b }, + { 0x0014, 0x015c }, + { 0x0014, 0x015d }, + { 0x0014, 0x015e }, + { 0x0014, 0x015f }, + { 0x0014, 0x0160 }, + { 0x0014, 0x0161 }, + { 0x0014, 0x0162 }, + { 0x0014, 0x0163 }, + { 0x0014, 0x0164 }, + { 0x0014, 0x0165 }, + { 0x0014, 0x0166 }, + { 0x0014, 0x0167 }, + { 0x0014, 0x0168 }, + { 0x0014, 0x0169 }, + { 0x0014, 0x016a }, + { 0x0014, 0x016b }, + { 0x0014, 0x016c }, + { 0x0014, 0x016d }, + { 0x0014, 0x016e }, + { 0x0014, 0x016f }, + { 0x0014, 0x0170 }, + { 0x0014, 0x0171 }, + { 0x0014, 0x0172 }, + { 0x0014, 0x0173 }, + { 0x0014, 0x0174 }, + { 0x0014, 0x0175 }, + { 0x0014, 0x0176 }, + { 0x0014, 0x0177 }, + { 0x0014, 0x0178 }, + { 0x0014, 0x0179 }, + { 0x0014, 0x017a }, + { 0x0014, 0x017b }, + { 0x0014, 0x017c }, + { 0x0014, 0x017d }, + { 0x0014, 0x017e }, + { 0x0014, 0x017f }, + { 0x0014, 0x0180 }, + { 0x0014, 0x0181 }, + { 0x0014, 0x0182 }, + { 0x0014, 0x0183 }, + { 0x0014, 0x0184 }, + { 0x0014, 0x0185 }, + { 0x0014, 0x0186 }, + { 0x0014, 0x0187 }, + { 0x0014, 0x0188 }, + { 0x0014, 0x0189 }, + { 0x0014, 0x018a }, + { 0x0014, 0x018b }, + { 0x0014, 0x018c }, + { 0x0014, 0x018d }, + { 0x0014, 0x018e }, + { 0x0014, 0x018f }, + { 0x0014, 0x0190 }, + { 0x0014, 0x0191 }, + { 0x0014, 0x0192 }, + { 0x0014, 0x0193 }, + { 0x0014, 0x0194 }, + { 0x0014, 0x0195 }, + { 0x0014, 0x0196 }, + { 0x0014, 0x0197 }, + { 0x0014, 0x0198 }, + { 0x0014, 0x0199 }, + { 0x0014, 0x019a }, + { 0x0014, 0x019b }, + { 0x0014, 0x019c }, + { 0x0014, 0x019d }, + { 0x0014, 0x019e }, + { 0x0014, 0x019f }, + { 0x0014, 0x01a0 }, + { 0x0014, 0x01a1 }, + { 0x0014, 0x01a2 }, + { 0x0014, 0x01a3 }, + { 0x0014, 0x01a4 }, + { 0x0014, 0x01a5 }, + { 0x0014, 0x01a6 }, + { 0x0014, 0x01a7 }, + { 0x0014, 0x01a8 }, + { 0x0014, 0x01a9 }, + { 0x0014, 0x01aa }, + { 0x0014, 0x01ab }, + { 0x0014, 0x01ac }, + { 0x0014, 0x01ad }, + { 0x0014, 0x01ae }, + { 0x0014, 0x01af }, + { 0x0014, 0x01b0 }, + { 0x0014, 0x01b1 }, + { 0x0014, 0x01b2 }, + { 0x0014, 0x01b3 }, + { 0x0014, 0x01b4 }, + { 0x0014, 0x01b5 }, + { 0x0014, 0x01b6 }, + { 0x0014, 0x01b7 }, + { 0x0014, 0x01b8 }, + { 0x0014, 0x01b9 }, + { 0x0014, 0x01ba }, + { 0x0014, 0x01bb }, + { 0x0014, 0x01bc }, + { 0x0014, 0x01bd }, + { 0x0014, 0x01be }, + { 0x0014, 0x01bf }, + { 0x0014, 0x01c0 }, + { 0x0014, 0x01c1 }, + { 0x0014, 0x01c2 }, + { 0x0014, 0x01c3 }, + { 0x0014, 0x01c4 }, + { 0x0014, 0x01c5 }, + { 0x0014, 0x01c6 }, + { 0x0014, 0x01c7 }, + { 0x0014, 0x01c8 }, + { 0x0014, 0x01c9 }, + { 0x0014, 0x01ca }, + { 0x0014, 0x01cb }, + { 0x0014, 0x01cc }, + { 0x0014, 0x01cd }, + { 0x0014, 0x01ce }, + { 0x0014, 0x01cf }, + { 0x0014, 0x01d0 }, + { 0x0014, 0x01d1 }, + { 0x0014, 0x01d2 }, + { 0x0014, 0x01d3 }, + { 0x0014, 0x01d4 }, + { 0x0014, 0x01d5 }, + { 0x0014, 0x01d6 }, + { 0x0014, 0x01d7 }, + { 0x0014, 0x01d8 }, + { 0x0014, 0x01d9 }, + { 0x0014, 0x01da }, + { 0x0014, 0x01db }, + { 0x0014, 0x01dc }, + { 0x0014, 0x01dd }, + { 0x0014, 0x01de }, + { 0x0014, 0x01df }, + { 0x0014, 0x01e0 }, + { 0x0014, 0x01e1 }, + { 0x0014, 0x01e2 }, + { 0x0014, 0x01e3 }, + { 0x0014, 0x01e4 }, + { 0x0014, 0x01e5 }, + { 0x0014, 0x01e6 }, + { 0x0014, 0x01e7 }, + { 0x0014, 0x01e8 }, + { 0x0014, 0x01e9 }, + { 0x0014, 0x01ea }, + { 0x0014, 0x01eb }, + { 0x0014, 0x01ec }, + { 0x0014, 0x01ed }, + { 0x0014, 0x01ee }, + { 0x0014, 0x01ef }, + { 0x0014, 0x01f0 }, + { 0x0014, 0x01f1 }, + { 0x0014, 0x01f2 }, + { 0x0014, 0x01f3 }, + { 0x0014, 0x01f4 }, + { 0x0014, 0x01f5 }, + { 0x0014, 0x01f6 }, + { 0x0014, 0x01f7 }, + { 0x0014, 0x01f8 }, + { 0x0014, 0x01f9 }, + { 0x0014, 0x01fa }, + { 0x0014, 0x01fb }, + { 0x0014, 0x01fc }, + { 0x0014, 0x01fd }, + { 0x0014, 0x01fe }, + { 0x0014, 0x01ff }, + { 0x0014, 0x0200 }, + { 0x0014, 0x0201 }, + { 0x0014, 0x0202 }, + { 0x0014, 0x0203 }, + { 0x0014, 0x0204 }, + { 0x0014, 0x0205 }, + { 0x0014, 0x0206 }, + { 0x0014, 0x0207 }, + { 0x0014, 0x0208 }, + { 0x0014, 0x0209 }, + { 0x0014, 0x020a }, + { 0x0014, 0x020b }, + { 0x0014, 0x020c }, + { 0x0014, 0x020d }, + { 0x0014, 0x020e }, + { 0x0014, 0x020f }, + { 0x0014, 0x0210 }, + { 0x0014, 0x0211 }, + { 0x0014, 0x0212 }, + { 0x0014, 0x0213 }, + { 0x0014, 0x0214 }, + { 0x0014, 0x0215 }, + { 0x0013, 0x0117 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec16[85][16] = -{ - {0x000fffff, 0x000dffff, 0x000effff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0000001c, }, - {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, - {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, - {0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, 0x0003006e, }, - {0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, }, - {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, - {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020088, 0x00020088, 0x00020088, 0x00020088, }, - {0x00020089, 0x00020089, 0x00020089, 0x00020089, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, }, - {0x000000bd, 0x000000c0, 0x000000c1, 0x000000d9, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010022, 0x00010022, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x00010057, 0x00010057, }, - {0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010087, 0x00010087, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x000100a2, 0x000100a2, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, }, - {0x0019ffff, 0x0017ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0012ffff, 0x0010ffff, 0x0011ffff, 0x0013ffff, 0x0014ffff, 0x00000007, 0x00000023, 0x00000058, 0x00000073, 0x0000008d, 0x000000a7, }, - {0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, }, - {0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, 0x000300a8, }, - {0x000200f5, 0x000200f5, 0x000200f5, 0x000200f5, 0x000200f6, 0x000200f6, 0x000200f6, 0x000200f6, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300c2, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, 0x000300d8, }, - {0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300da, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, }, - {0x000200c3, 0x000200c3, 0x000200c3, 0x000200c3, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dc, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200f4, 0x000200f4, 0x000200f4, 0x000200f4, }, - {0x0000005b, 0x00000076, 0x00000090, 0x000000c5, 0x000000df, 0x000000f8, 0x0000010e, 0x00000110, 0x00000111, 0x00000112, 0x00010009, 0x00010009, 0x00010025, 0x00010025, 0x0001005a, 0x0001005a, }, - {0x00010075, 0x00010075, 0x0001008f, 0x0001008f, 0x000100aa, 0x000100aa, 0x000100c4, 0x000100c4, 0x000100de, 0x000100de, 0x000100f3, 0x000100f3, 0x000100f7, 0x000100f7, 0x0001010f, 0x0001010f, }, - {0x0032ffff, 0x0043ffff, 0x0025ffff, 0x0023ffff, 0x0024ffff, 0x0021ffff, 0x0020ffff, 0x0022ffff, 0x001cffff, 0x001affff, 0x001bffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0000000a, 0x00000040, }, - {0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, - {0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, }, - {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, }, - {0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300f9, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, }, - {0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x00030113, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, }, - {0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012b, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, }, - {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c6, 0x000200c6, 0x000200c6, 0x000200c6, }, - {0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010149, 0x00010149, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, - {0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x00020114, 0x00020114, 0x00020114, 0x00020114, 0x00020129, 0x00020129, 0x00020129, 0x00020129, 0x0002012d, 0x0002012d, 0x0002012d, 0x0002012d, }, - {0x000000c8, 0x000000fc, 0x00000130, 0x00000131, 0x00000148, 0x00000160, 0x00000161, 0x00000162, 0x00010028, 0x00010028, 0x00010042, 0x00010042, 0x0001005d, 0x0001005d, 0x000100ad, 0x000100ad, }, - {0x000100c7, 0x000100c7, 0x000100e2, 0x000100e2, 0x000100fb, 0x000100fb, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010144, 0x00010144, }, - {0x0054ffff, 0x0031ffff, 0x0030ffff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0027ffff, 0x0026ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0000000c, 0x00000078, 0x00000093, }, - {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, 0x000300af, }, - {0x0002017c, 0x0002017c, 0x0002017c, 0x0002017c, 0x00020180, 0x00020180, 0x00020180, 0x00020180, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x00030117, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, 0x0003014a, }, - {0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x0003015f, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, 0x00030163, }, - {0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017b, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, 0x0003017e, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020045, 0x00020045, 0x00020045, 0x00020045, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, - {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200e4, 0x000200e4, 0x000200e4, 0x000200e4, }, - {0x000200e5, 0x000200e5, 0x000200e5, 0x000200e5, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fe, 0x000200fe, 0x000200fe, 0x000200fe, 0x00020118, 0x00020118, 0x00020118, 0x00020118, }, - {0x00020132, 0x00020132, 0x00020132, 0x00020132, 0x0002014b, 0x0002014b, 0x0002014b, 0x0002014b, 0x0002014c, 0x0002014c, 0x0002014c, 0x0002014c, 0x0002014d, 0x0002014d, 0x0002014d, 0x0002014d, }, - {0x00020164, 0x00020164, 0x00020164, 0x00020164, 0x00020165, 0x00020165, 0x00020165, 0x00020165, 0x00020166, 0x00020166, 0x00020166, 0x00020166, 0x0002017a, 0x0002017a, 0x0002017a, 0x0002017a, }, - {0x000100e3, 0x000100e3, 0x00010100, 0x00010100, 0x00010133, 0x00010133, 0x0001014f, 0x0001014f, 0x0001017f, 0x0001017f, 0x00010182, 0x00010182, 0x000101e7, 0x000101e7, 0x000102d8, 0x000102d8, }, - {0x000002d2, 0x000002d3, 0x000002d4, 0x000002d5, 0x000002d6, 0x000002d7, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x000100ae, 0x000100ae, }, - {0x0034ffff, 0x0033ffff, 0x0035ffff, 0x0036ffff, 0x0039ffff, 0x0037ffff, 0x0038ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, }, - {0x0000002f, 0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, }, - {0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, }, - {0x0000004f, 0x00000050, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000007c, }, - {0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, }, - {0x000000b9, 0x000000ba, 0x000000bb, 0x000000bc, 0x000000ca, 0x000000cb, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, }, - {0x000000d6, 0x000000d7, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000ff, }, - {0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, }, - {0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x00000119, 0x0000011a, 0x0000011b, }, - {0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, 0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000134, 0x00000135, 0x00000136, }, - {0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, 0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x0000014e, 0x00000150, 0x00000151, }, - {0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, 0x0000015c, 0x0000015d, 0x0000015e, 0x00000167, 0x00000168, 0x00000169, }, - {0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, 0x00000176, 0x00000177, 0x00000178, 0x00000179, }, - {0x0000017d, 0x00000181, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, 0x0000018f, 0x00000190, }, - {0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x00000195, 0x00000196, 0x00000197, 0x00000198, 0x00000199, 0x0000019a, 0x0000019b, 0x0000019c, 0x0000019d, 0x0000019e, 0x0000019f, 0x000001a0, }, - {0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, 0x000001a7, 0x000001a8, 0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b0, }, - {0x000001b1, 0x000001b2, 0x000001b3, 0x000001b4, 0x000001b5, 0x000001b6, 0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, 0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, }, - {0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, }, - {0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, 0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cc, 0x000001cd, 0x000001ce, 0x000001cf, 0x000001d0, }, - {0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, 0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, 0x000001de, 0x000001df, 0x000001e0, }, - {0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, 0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, }, - {0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, 0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, 0x000001fe, 0x000001ff, 0x00000200, 0x00000201, }, - {0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, 0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, 0x0000020e, 0x0000020f, 0x00000210, 0x00000211, }, - {0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, 0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, 0x0000021e, 0x0000021f, 0x00000220, 0x00000221, }, - {0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, 0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, 0x0000022e, 0x0000022f, 0x00000230, 0x00000231, }, - {0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, 0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, 0x0000023e, 0x0000023f, 0x00000240, 0x00000241, }, - {0x00000242, 0x00000243, 0x00000244, 0x00000245, 0x00000246, 0x00000247, 0x00000248, 0x00000249, 0x0000024a, 0x0000024b, 0x0000024c, 0x0000024d, 0x0000024e, 0x0000024f, 0x00000250, 0x00000251, }, - {0x00000252, 0x00000253, 0x00000254, 0x00000255, 0x00000256, 0x00000257, 0x00000258, 0x00000259, 0x0000025a, 0x0000025b, 0x0000025c, 0x0000025d, 0x0000025e, 0x0000025f, 0x00000260, 0x00000261, }, - {0x00000262, 0x00000263, 0x00000264, 0x00000265, 0x00000266, 0x00000267, 0x00000268, 0x00000269, 0x0000026a, 0x0000026b, 0x0000026c, 0x0000026d, 0x0000026e, 0x0000026f, 0x00000270, 0x00000271, }, - {0x00000272, 0x00000273, 0x00000274, 0x00000275, 0x00000276, 0x00000277, 0x00000278, 0x00000279, 0x0000027a, 0x0000027b, 0x0000027c, 0x0000027d, 0x0000027e, 0x0000027f, 0x00000280, 0x00000281, }, - {0x00000282, 0x00000283, 0x00000284, 0x00000285, 0x00000286, 0x00000287, 0x00000288, 0x00000289, 0x0000028a, 0x0000028b, 0x0000028c, 0x0000028d, 0x0000028e, 0x0000028f, 0x00000290, 0x00000291, }, - {0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, 0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, }, - {0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, 0x000002ae, 0x000002af, 0x000002b0, 0x000002b1, }, - {0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x000002b6, 0x000002b7, 0x000002b8, 0x000002b9, 0x000002ba, 0x000002bb, 0x000002bc, 0x000002bd, 0x000002be, 0x000002bf, 0x000002c0, 0x000002c1, }, - {0x000002c2, 0x000002c3, 0x000002c4, 0x000002c5, 0x000002c6, 0x000002c7, 0x000002c8, 0x000002c9, 0x000002ca, 0x000002cb, 0x000002cc, 0x000002cd, 0x000002ce, 0x000002cf, 0x000002d0, 0x000002d1, }, +const uint32_t c_aauiCQMFHuffDec16[85][16] = { + { + 0x000fffff, + 0x000dffff, + 0x000effff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0000001c, + }, + { + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + }, + { + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + }, + { + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006e, + 0x0003006e, + 0x0003006e, + 0x0003006e, + 0x0003006e, + 0x0003006e, + 0x0003006e, + 0x0003006e, + }, + { + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + }, + { + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + }, + { + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + }, + { + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + }, + { + 0x00020089, + 0x00020089, + 0x00020089, + 0x00020089, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + }, + { + 0x000000bd, + 0x000000c0, + 0x000000c1, + 0x000000d9, + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + 0x00010022, + 0x00010022, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x00010057, + 0x00010057, + }, + { + 0x00010071, + 0x00010071, + 0x00010072, + 0x00010072, + 0x00010087, + 0x00010087, + 0x0001008b, + 0x0001008b, + 0x0001008c, + 0x0001008c, + 0x000100a2, + 0x000100a2, + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + }, + { + 0x0019ffff, + 0x0017ffff, + 0x0018ffff, + 0x0015ffff, + 0x0016ffff, + 0x0012ffff, + 0x0010ffff, + 0x0011ffff, + 0x0013ffff, + 0x0014ffff, + 0x00000007, + 0x00000023, + 0x00000058, + 0x00000073, + 0x0000008d, + 0x000000a7, + }, + { + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + }, + { + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + 0x000300a8, + }, + { + 0x000200f5, + 0x000200f5, + 0x000200f5, + 0x000200f5, + 0x000200f6, + 0x000200f6, + 0x000200f6, + 0x000200f6, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300c2, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + 0x000300d8, + }, + { + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300da, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + }, + { + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + 0x000200a9, + 0x000200a9, + 0x000200a9, + 0x000200a9, + }, + { + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x000200c3, + 0x000200dc, + 0x000200dc, + 0x000200dc, + 0x000200dc, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200f4, + 0x000200f4, + 0x000200f4, + 0x000200f4, + }, + { + 0x0000005b, + 0x00000076, + 0x00000090, + 0x000000c5, + 0x000000df, + 0x000000f8, + 0x0000010e, + 0x00000110, + 0x00000111, + 0x00000112, + 0x00010009, + 0x00010009, + 0x00010025, + 0x00010025, + 0x0001005a, + 0x0001005a, + }, + { + 0x00010075, + 0x00010075, + 0x0001008f, + 0x0001008f, + 0x000100aa, + 0x000100aa, + 0x000100c4, + 0x000100c4, + 0x000100de, + 0x000100de, + 0x000100f3, + 0x000100f3, + 0x000100f7, + 0x000100f7, + 0x0001010f, + 0x0001010f, + }, + { + 0x0032ffff, + 0x0043ffff, + 0x0025ffff, + 0x0023ffff, + 0x0024ffff, + 0x0021ffff, + 0x0020ffff, + 0x0022ffff, + 0x001cffff, + 0x001affff, + 0x001bffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0000000a, + 0x00000040, + }, + { + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + }, + { + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + }, + { + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + }, + { + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300f9, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + }, + { + 0x00030113, + 0x00030113, + 0x00030113, + 0x00030113, + 0x00030113, + 0x00030113, + 0x00030113, + 0x00030113, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + }, + { + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012b, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + }, + { + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200c6, + 0x000200c6, + 0x000200c6, + 0x000200c6, + }, + { + 0x00010145, + 0x00010145, + 0x00010146, + 0x00010146, + 0x00010147, + 0x00010147, + 0x00010149, + 0x00010149, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + }, + { + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x00020114, + 0x00020114, + 0x00020114, + 0x00020114, + 0x00020129, + 0x00020129, + 0x00020129, + 0x00020129, + 0x0002012d, + 0x0002012d, + 0x0002012d, + 0x0002012d, + }, + { + 0x000000c8, + 0x000000fc, + 0x00000130, + 0x00000131, + 0x00000148, + 0x00000160, + 0x00000161, + 0x00000162, + 0x00010028, + 0x00010028, + 0x00010042, + 0x00010042, + 0x0001005d, + 0x0001005d, + 0x000100ad, + 0x000100ad, + }, + { + 0x000100c7, + 0x000100c7, + 0x000100e2, + 0x000100e2, + 0x000100fb, + 0x000100fb, + 0x00010115, + 0x00010115, + 0x00010116, + 0x00010116, + 0x0001012e, + 0x0001012e, + 0x0001012f, + 0x0001012f, + 0x00010144, + 0x00010144, + }, + { + 0x0054ffff, + 0x0031ffff, + 0x0030ffff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0027ffff, + 0x0026ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x0000000c, + 0x00000078, + 0x00000093, + }, + { + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + 0x000300af, + }, + { + 0x0002017c, + 0x0002017c, + 0x0002017c, + 0x0002017c, + 0x00020180, + 0x00020180, + 0x00020180, + 0x00020180, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x00030117, + 0x00030117, + 0x00030117, + 0x00030117, + 0x00030117, + 0x00030117, + 0x00030117, + 0x00030117, + 0x0003014a, + 0x0003014a, + 0x0003014a, + 0x0003014a, + 0x0003014a, + 0x0003014a, + 0x0003014a, + 0x0003014a, + }, + { + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x0003015f, + 0x00030163, + 0x00030163, + 0x00030163, + 0x00030163, + 0x00030163, + 0x00030163, + 0x00030163, + 0x00030163, + }, + { + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017b, + 0x0003017e, + 0x0003017e, + 0x0003017e, + 0x0003017e, + 0x0003017e, + 0x0003017e, + 0x0003017e, + 0x0003017e, + }, + { + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020045, + 0x00020045, + 0x00020045, + 0x00020045, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + }, + { + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200e4, + 0x000200e4, + 0x000200e4, + 0x000200e4, + }, + { + 0x000200e5, + 0x000200e5, + 0x000200e5, + 0x000200e5, + 0x000200fd, + 0x000200fd, + 0x000200fd, + 0x000200fd, + 0x000200fe, + 0x000200fe, + 0x000200fe, + 0x000200fe, + 0x00020118, + 0x00020118, + 0x00020118, + 0x00020118, + }, + { + 0x00020132, + 0x00020132, + 0x00020132, + 0x00020132, + 0x0002014b, + 0x0002014b, + 0x0002014b, + 0x0002014b, + 0x0002014c, + 0x0002014c, + 0x0002014c, + 0x0002014c, + 0x0002014d, + 0x0002014d, + 0x0002014d, + 0x0002014d, + }, + { + 0x00020164, + 0x00020164, + 0x00020164, + 0x00020164, + 0x00020165, + 0x00020165, + 0x00020165, + 0x00020165, + 0x00020166, + 0x00020166, + 0x00020166, + 0x00020166, + 0x0002017a, + 0x0002017a, + 0x0002017a, + 0x0002017a, + }, + { + 0x000100e3, + 0x000100e3, + 0x00010100, + 0x00010100, + 0x00010133, + 0x00010133, + 0x0001014f, + 0x0001014f, + 0x0001017f, + 0x0001017f, + 0x00010182, + 0x00010182, + 0x000101e7, + 0x000101e7, + 0x000102d8, + 0x000102d8, + }, + { + 0x000002d2, + 0x000002d3, + 0x000002d4, + 0x000002d5, + 0x000002d6, + 0x000002d7, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + 0x000100ae, + 0x000100ae, + }, + { + 0x0034ffff, + 0x0033ffff, + 0x0035ffff, + 0x0036ffff, + 0x0039ffff, + 0x0037ffff, + 0x0038ffff, + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + 0x003fffff, + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + }, + { + 0x0000002f, + 0x00000030, + 0x00000031, + 0x00000032, + 0x00000033, + 0x00000034, + 0x00000035, + 0x00000046, + 0x00000047, + 0x00000048, + 0x00000049, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x0000004d, + 0x0000004e, + }, + { + 0x0000000f, + 0x00000010, + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000018, + 0x00000019, + 0x0000001a, + 0x0000002b, + 0x0000002c, + 0x0000002d, + 0x0000002e, + }, + { + 0x0000004f, + 0x00000050, + 0x0000005f, + 0x00000060, + 0x00000061, + 0x00000062, + 0x00000063, + 0x00000064, + 0x00000065, + 0x00000066, + 0x00000067, + 0x00000068, + 0x00000069, + 0x0000006a, + 0x0000006b, + 0x0000007c, + }, + { + 0x0000007d, + 0x0000007e, + 0x0000007f, + 0x00000080, + 0x00000081, + 0x00000082, + 0x00000083, + 0x00000084, + 0x00000085, + 0x00000086, + 0x00000095, + 0x00000096, + 0x00000097, + 0x00000098, + 0x00000099, + 0x0000009a, + }, + { + 0x000000b9, + 0x000000ba, + 0x000000bb, + 0x000000bc, + 0x000000ca, + 0x000000cb, + 0x000000cc, + 0x000000cd, + 0x000000ce, + 0x000000cf, + 0x000000d0, + 0x000000d1, + 0x000000d2, + 0x000000d3, + 0x000000d4, + 0x000000d5, + }, + { + 0x000000d6, + 0x000000d7, + 0x000000e6, + 0x000000e7, + 0x000000e8, + 0x000000e9, + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + 0x000000ee, + 0x000000ef, + 0x000000f0, + 0x000000f1, + 0x000000f2, + 0x000000ff, + }, + { + 0x0000009b, + 0x0000009c, + 0x0000009d, + 0x0000009e, + 0x0000009f, + 0x000000a0, + 0x000000a1, + 0x000000b0, + 0x000000b1, + 0x000000b2, + 0x000000b3, + 0x000000b4, + 0x000000b5, + 0x000000b6, + 0x000000b7, + 0x000000b8, + }, + { + 0x00000101, + 0x00000102, + 0x00000103, + 0x00000104, + 0x00000105, + 0x00000106, + 0x00000107, + 0x00000108, + 0x00000109, + 0x0000010a, + 0x0000010b, + 0x0000010c, + 0x0000010d, + 0x00000119, + 0x0000011a, + 0x0000011b, + }, + { + 0x0000011c, + 0x0000011d, + 0x0000011e, + 0x0000011f, + 0x00000120, + 0x00000121, + 0x00000122, + 0x00000123, + 0x00000124, + 0x00000125, + 0x00000126, + 0x00000127, + 0x00000128, + 0x00000134, + 0x00000135, + 0x00000136, + }, + { + 0x00000137, + 0x00000138, + 0x00000139, + 0x0000013a, + 0x0000013b, + 0x0000013c, + 0x0000013d, + 0x0000013e, + 0x0000013f, + 0x00000140, + 0x00000141, + 0x00000142, + 0x00000143, + 0x0000014e, + 0x00000150, + 0x00000151, + }, + { + 0x00000152, + 0x00000153, + 0x00000154, + 0x00000155, + 0x00000156, + 0x00000157, + 0x00000158, + 0x00000159, + 0x0000015a, + 0x0000015b, + 0x0000015c, + 0x0000015d, + 0x0000015e, + 0x00000167, + 0x00000168, + 0x00000169, + }, + { + 0x0000016a, + 0x0000016b, + 0x0000016c, + 0x0000016d, + 0x0000016e, + 0x0000016f, + 0x00000170, + 0x00000171, + 0x00000172, + 0x00000173, + 0x00000174, + 0x00000175, + 0x00000176, + 0x00000177, + 0x00000178, + 0x00000179, + }, + { + 0x0000017d, + 0x00000181, + 0x00000183, + 0x00000184, + 0x00000185, + 0x00000186, + 0x00000187, + 0x00000188, + 0x00000189, + 0x0000018a, + 0x0000018b, + 0x0000018c, + 0x0000018d, + 0x0000018e, + 0x0000018f, + 0x00000190, + }, + { + 0x00000191, + 0x00000192, + 0x00000193, + 0x00000194, + 0x00000195, + 0x00000196, + 0x00000197, + 0x00000198, + 0x00000199, + 0x0000019a, + 0x0000019b, + 0x0000019c, + 0x0000019d, + 0x0000019e, + 0x0000019f, + 0x000001a0, + }, + { + 0x000001a1, + 0x000001a2, + 0x000001a3, + 0x000001a4, + 0x000001a5, + 0x000001a6, + 0x000001a7, + 0x000001a8, + 0x000001a9, + 0x000001aa, + 0x000001ab, + 0x000001ac, + 0x000001ad, + 0x000001ae, + 0x000001af, + 0x000001b0, + }, + { + 0x000001b1, + 0x000001b2, + 0x000001b3, + 0x000001b4, + 0x000001b5, + 0x000001b6, + 0x000001b7, + 0x000001b8, + 0x000001b9, + 0x000001ba, + 0x000001bb, + 0x000001bc, + 0x000001bd, + 0x000001be, + 0x000001bf, + 0x000001c0, + }, + { + 0x0044ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x0049ffff, + 0x004affff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + 0x0050ffff, + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + }, + { + 0x000001c1, + 0x000001c2, + 0x000001c3, + 0x000001c4, + 0x000001c5, + 0x000001c6, + 0x000001c7, + 0x000001c8, + 0x000001c9, + 0x000001ca, + 0x000001cb, + 0x000001cc, + 0x000001cd, + 0x000001ce, + 0x000001cf, + 0x000001d0, + }, + { + 0x000001d1, + 0x000001d2, + 0x000001d3, + 0x000001d4, + 0x000001d5, + 0x000001d6, + 0x000001d7, + 0x000001d8, + 0x000001d9, + 0x000001da, + 0x000001db, + 0x000001dc, + 0x000001dd, + 0x000001de, + 0x000001df, + 0x000001e0, + }, + { + 0x000001e1, + 0x000001e2, + 0x000001e3, + 0x000001e4, + 0x000001e5, + 0x000001e6, + 0x000001e8, + 0x000001e9, + 0x000001ea, + 0x000001eb, + 0x000001ec, + 0x000001ed, + 0x000001ee, + 0x000001ef, + 0x000001f0, + 0x000001f1, + }, + { + 0x000001f2, + 0x000001f3, + 0x000001f4, + 0x000001f5, + 0x000001f6, + 0x000001f7, + 0x000001f8, + 0x000001f9, + 0x000001fa, + 0x000001fb, + 0x000001fc, + 0x000001fd, + 0x000001fe, + 0x000001ff, + 0x00000200, + 0x00000201, + }, + { + 0x00000202, + 0x00000203, + 0x00000204, + 0x00000205, + 0x00000206, + 0x00000207, + 0x00000208, + 0x00000209, + 0x0000020a, + 0x0000020b, + 0x0000020c, + 0x0000020d, + 0x0000020e, + 0x0000020f, + 0x00000210, + 0x00000211, + }, + { + 0x00000212, + 0x00000213, + 0x00000214, + 0x00000215, + 0x00000216, + 0x00000217, + 0x00000218, + 0x00000219, + 0x0000021a, + 0x0000021b, + 0x0000021c, + 0x0000021d, + 0x0000021e, + 0x0000021f, + 0x00000220, + 0x00000221, + }, + { + 0x00000222, + 0x00000223, + 0x00000224, + 0x00000225, + 0x00000226, + 0x00000227, + 0x00000228, + 0x00000229, + 0x0000022a, + 0x0000022b, + 0x0000022c, + 0x0000022d, + 0x0000022e, + 0x0000022f, + 0x00000230, + 0x00000231, + }, + { + 0x00000232, + 0x00000233, + 0x00000234, + 0x00000235, + 0x00000236, + 0x00000237, + 0x00000238, + 0x00000239, + 0x0000023a, + 0x0000023b, + 0x0000023c, + 0x0000023d, + 0x0000023e, + 0x0000023f, + 0x00000240, + 0x00000241, + }, + { + 0x00000242, + 0x00000243, + 0x00000244, + 0x00000245, + 0x00000246, + 0x00000247, + 0x00000248, + 0x00000249, + 0x0000024a, + 0x0000024b, + 0x0000024c, + 0x0000024d, + 0x0000024e, + 0x0000024f, + 0x00000250, + 0x00000251, + }, + { + 0x00000252, + 0x00000253, + 0x00000254, + 0x00000255, + 0x00000256, + 0x00000257, + 0x00000258, + 0x00000259, + 0x0000025a, + 0x0000025b, + 0x0000025c, + 0x0000025d, + 0x0000025e, + 0x0000025f, + 0x00000260, + 0x00000261, + }, + { + 0x00000262, + 0x00000263, + 0x00000264, + 0x00000265, + 0x00000266, + 0x00000267, + 0x00000268, + 0x00000269, + 0x0000026a, + 0x0000026b, + 0x0000026c, + 0x0000026d, + 0x0000026e, + 0x0000026f, + 0x00000270, + 0x00000271, + }, + { + 0x00000272, + 0x00000273, + 0x00000274, + 0x00000275, + 0x00000276, + 0x00000277, + 0x00000278, + 0x00000279, + 0x0000027a, + 0x0000027b, + 0x0000027c, + 0x0000027d, + 0x0000027e, + 0x0000027f, + 0x00000280, + 0x00000281, + }, + { + 0x00000282, + 0x00000283, + 0x00000284, + 0x00000285, + 0x00000286, + 0x00000287, + 0x00000288, + 0x00000289, + 0x0000028a, + 0x0000028b, + 0x0000028c, + 0x0000028d, + 0x0000028e, + 0x0000028f, + 0x00000290, + 0x00000291, + }, + { + 0x00000292, + 0x00000293, + 0x00000294, + 0x00000295, + 0x00000296, + 0x00000297, + 0x00000298, + 0x00000299, + 0x0000029a, + 0x0000029b, + 0x0000029c, + 0x0000029d, + 0x0000029e, + 0x0000029f, + 0x000002a0, + 0x000002a1, + }, + { + 0x000002a2, + 0x000002a3, + 0x000002a4, + 0x000002a5, + 0x000002a6, + 0x000002a7, + 0x000002a8, + 0x000002a9, + 0x000002aa, + 0x000002ab, + 0x000002ac, + 0x000002ad, + 0x000002ae, + 0x000002af, + 0x000002b0, + 0x000002b1, + }, + { + 0x000002b2, + 0x000002b3, + 0x000002b4, + 0x000002b5, + 0x000002b6, + 0x000002b7, + 0x000002b8, + 0x000002b9, + 0x000002ba, + 0x000002bb, + 0x000002bc, + 0x000002bd, + 0x000002be, + 0x000002bf, + 0x000002c0, + 0x000002c1, + }, + { + 0x000002c2, + 0x000002c3, + 0x000002c4, + 0x000002c5, + 0x000002c6, + 0x000002c7, + 0x000002c8, + 0x000002c9, + 0x000002ca, + 0x000002cb, + 0x000002cc, + 0x000002cd, + 0x000002ce, + 0x000002cf, + 0x000002d0, + 0x000002d1, + }, }; #endif @@ -1435,198 +14376,2415 @@ const uint32_t c_aauiCQMFHuffEnc17[729][2] = #else const uint16_t c_aauiCQMFHuffEnc17[729][2] = #endif -{ - {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x000e}, - {0x0008, 0x000f}, {0x0009, 0x000f}, {0x000a, 0x000f}, {0x000c, 0x0011}, {0x000d, 0x0014}, {0x000e, 0x0017}, {0x0010, 0x002d}, {0x0011, 0x004c}, - {0x0012, 0x008a}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, - {0x0014, 0x0007}, {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0006, 0x0016}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0006, 0x0017}, - {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0008, 0x0010}, {0x000a, 0x0010}, {0x000b, 0x0011}, {0x000c, 0x0012}, - {0x000e, 0x0018}, {0x000f, 0x0020}, {0x0011, 0x004d}, {0x0013, 0x00e4}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, - {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0006, 0x001a}, {0x0005, 0x001b}, - {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0007, 0x0014}, {0x0008, 0x0011}, {0x0009, 0x0010}, - {0x000a, 0x0011}, {0x000b, 0x0012}, {0x000c, 0x0013}, {0x000e, 0x0019}, {0x000f, 0x0021}, {0x0010, 0x002e}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, - {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, - {0x0014, 0x001c}, {0x0006, 0x001e}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, - {0x0007, 0x0015}, {0x0008, 0x0012}, {0x0009, 0x0011}, {0x000a, 0x0012}, {0x000b, 0x0013}, {0x000c, 0x0014}, {0x000e, 0x001a}, {0x000f, 0x0022}, - {0x0010, 0x002f}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0014, 0x001d}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, - {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, {0x0014, 0x0025}, {0x0006, 0x0023}, {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, - {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0007, 0x0016}, {0x0007, 0x0017}, {0x0008, 0x0013}, {0x0009, 0x0012}, {0x000a, 0x0013}, {0x000c, 0x0015}, - {0x000d, 0x0015}, {0x000f, 0x0023}, {0x0010, 0x0030}, {0x0011, 0x004e}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x0014, 0x0029}, - {0x0014, 0x002a}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0007, 0x0018}, - {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0008, 0x0014}, {0x0009, 0x0013}, - {0x000a, 0x0014}, {0x000b, 0x0014}, {0x000c, 0x0016}, {0x000d, 0x0016}, {0x000f, 0x0024}, {0x0010, 0x0031}, {0x0011, 0x004f}, {0x0014, 0x0031}, - {0x0014, 0x0032}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, {0x0014, 0x0039}, - {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0007, 0x001b}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0007, 0x001c}, {0x0007, 0x001d}, - {0x0008, 0x0015}, {0x0009, 0x0014}, {0x000a, 0x0015}, {0x000a, 0x0016}, {0x000c, 0x0017}, {0x000d, 0x0017}, {0x000e, 0x001b}, {0x000f, 0x0025}, - {0x0011, 0x0050}, {0x0011, 0x0051}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, - {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, {0x0014, 0x0046}, {0x0008, 0x0016}, {0x0007, 0x001e}, {0x0007, 0x001f}, - {0x0007, 0x0020}, {0x0007, 0x0021}, {0x0008, 0x0017}, {0x0008, 0x0018}, {0x0009, 0x0015}, {0x000a, 0x0017}, {0x000b, 0x0015}, {0x000c, 0x0018}, - {0x000e, 0x001c}, {0x000e, 0x001d}, {0x0010, 0x0032}, {0x0012, 0x008b}, {0x0012, 0x008c}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, - {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, - {0x0008, 0x0019}, {0x0007, 0x0022}, {0x0007, 0x0023}, {0x0008, 0x001a}, {0x0008, 0x001b}, {0x0009, 0x0016}, {0x0009, 0x0017}, {0x000a, 0x0018}, - {0x000b, 0x0016}, {0x000c, 0x0019}, {0x000d, 0x0018}, {0x000e, 0x001e}, {0x0010, 0x0033}, {0x0011, 0x0052}, {0x0014, 0x0052}, {0x0013, 0x00e9}, - {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, - {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, {0x0009, 0x0018}, {0x0008, 0x001c}, {0x0008, 0x001d}, {0x0009, 0x0019}, {0x0009, 0x001a}, - {0x000a, 0x0019}, {0x000a, 0x001a}, {0x000b, 0x0017}, {0x000c, 0x001a}, {0x000d, 0x0019}, {0x000e, 0x001f}, {0x000f, 0x0026}, {0x0010, 0x0034}, - {0x0012, 0x008d}, {0x0013, 0x00ea}, {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, - {0x0014, 0x0064}, {0x0014, 0x0065}, {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x000b, 0x0018}, {0x0009, 0x001b}, - {0x000a, 0x001b}, {0x000a, 0x001c}, {0x000a, 0x001d}, {0x000b, 0x0019}, {0x000b, 0x001a}, {0x000c, 0x001b}, {0x000d, 0x001a}, {0x000e, 0x0020}, - {0x000f, 0x0027}, {0x0012, 0x008e}, {0x0011, 0x0053}, {0x0013, 0x00eb}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, - {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, - {0x0014, 0x0076}, {0x000c, 0x001c}, {0x000b, 0x001b}, {0x000b, 0x001c}, {0x000b, 0x001d}, {0x000c, 0x001d}, {0x000c, 0x001e}, {0x000d, 0x001b}, - {0x000d, 0x001c}, {0x000e, 0x0021}, {0x0010, 0x0035}, {0x0010, 0x0036}, {0x0011, 0x0054}, {0x0013, 0x00ec}, {0x0014, 0x0077}, {0x0014, 0x0078}, - {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, - {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x000d, 0x001d}, {0x000c, 0x001f}, {0x000c, 0x0020}, {0x000c, 0x0021}, - {0x000d, 0x001e}, {0x000d, 0x001f}, {0x000e, 0x0022}, {0x000f, 0x0028}, {0x0010, 0x0037}, {0x0010, 0x0038}, {0x0010, 0x0039}, {0x0012, 0x008f}, - {0x0013, 0x00ed}, {0x0014, 0x0085}, {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, - {0x0014, 0x008c}, {0x0014, 0x008d}, {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x000e, 0x0023}, - {0x000d, 0x0020}, {0x000d, 0x0021}, {0x000e, 0x0024}, {0x000e, 0x0025}, {0x000e, 0x0026}, {0x000f, 0x0029}, {0x0010, 0x003a}, {0x0010, 0x003b}, - {0x0012, 0x0090}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, - {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, - {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x000f, 0x002a}, {0x000e, 0x0027}, {0x000f, 0x002b}, {0x000f, 0x002c}, {0x000f, 0x002d}, {0x0010, 0x003c}, - {0x0010, 0x003d}, {0x0011, 0x0055}, {0x0011, 0x0056}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, - {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, - {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, {0x0012, 0x0091}, {0x0010, 0x003e}, {0x0010, 0x003f}, - {0x0011, 0x0057}, {0x0011, 0x0058}, {0x0011, 0x0059}, {0x0012, 0x0092}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0012, 0x0093}, {0x0014, 0x00b6}, - {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, {0x0014, 0x00be}, - {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, {0x0014, 0x00c6}, - {0x0013, 0x00f0}, {0x0012, 0x0094}, {0x0012, 0x0095}, {0x0012, 0x0096}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, - {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, - {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, - {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, {0x0014, 0x00de}, {0x0012, 0x0097}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, - {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, - {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, - {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, {0x0014, 0x00f6}, {0x0014, 0x00f7}, {0x0014, 0x00f8}, {0x0014, 0x00f9}, - {0x0014, 0x00fa}, {0x0014, 0x00fb}, {0x0014, 0x00fc}, {0x0014, 0x00fd}, {0x0014, 0x00fe}, {0x0014, 0x00ff}, {0x0014, 0x0100}, {0x0014, 0x0101}, - {0x0014, 0x0102}, {0x0014, 0x0103}, {0x0014, 0x0104}, {0x0014, 0x0105}, {0x0014, 0x0106}, {0x0014, 0x0107}, {0x0014, 0x0108}, {0x0014, 0x0109}, - {0x0014, 0x010a}, {0x0014, 0x010b}, {0x0014, 0x010c}, {0x0014, 0x010d}, {0x0014, 0x010e}, {0x0014, 0x010f}, {0x0014, 0x0110}, {0x0014, 0x0111}, - {0x0014, 0x0112}, {0x0014, 0x0113}, {0x0014, 0x0114}, {0x0014, 0x0115}, {0x0014, 0x0116}, {0x0014, 0x0117}, {0x0014, 0x0118}, {0x0014, 0x0119}, - {0x0014, 0x011a}, {0x0014, 0x011b}, {0x0014, 0x011c}, {0x0014, 0x011d}, {0x0014, 0x011e}, {0x0014, 0x011f}, {0x0014, 0x0120}, {0x0014, 0x0121}, - {0x0014, 0x0122}, {0x0014, 0x0123}, {0x0014, 0x0124}, {0x0014, 0x0125}, {0x0014, 0x0126}, {0x0014, 0x0127}, {0x0014, 0x0128}, {0x0014, 0x0129}, - {0x0014, 0x012a}, {0x0014, 0x012b}, {0x0014, 0x012c}, {0x0014, 0x012d}, {0x0014, 0x012e}, {0x0014, 0x012f}, {0x0014, 0x0130}, {0x0014, 0x0131}, - {0x0014, 0x0132}, {0x0014, 0x0133}, {0x0014, 0x0134}, {0x0014, 0x0135}, {0x0014, 0x0136}, {0x0014, 0x0137}, {0x0014, 0x0138}, {0x0014, 0x0139}, - {0x0014, 0x013a}, {0x0014, 0x013b}, {0x0014, 0x013c}, {0x0014, 0x013d}, {0x0014, 0x013e}, {0x0014, 0x013f}, {0x0014, 0x0140}, {0x0014, 0x0141}, - {0x0014, 0x0142}, {0x0014, 0x0143}, {0x0014, 0x0144}, {0x0014, 0x0145}, {0x0014, 0x0146}, {0x0014, 0x0147}, {0x0014, 0x0148}, {0x0014, 0x0149}, - {0x0014, 0x014a}, {0x0014, 0x014b}, {0x0014, 0x014c}, {0x0014, 0x014d}, {0x0014, 0x014e}, {0x0014, 0x014f}, {0x0014, 0x0150}, {0x0014, 0x0151}, - {0x0014, 0x0152}, {0x0014, 0x0153}, {0x0014, 0x0154}, {0x0014, 0x0155}, {0x0014, 0x0156}, {0x0014, 0x0157}, {0x0014, 0x0158}, {0x0014, 0x0159}, - {0x0014, 0x015a}, {0x0014, 0x015b}, {0x0014, 0x015c}, {0x0014, 0x015d}, {0x0014, 0x015e}, {0x0014, 0x015f}, {0x0014, 0x0160}, {0x0014, 0x0161}, - {0x0014, 0x0162}, {0x0014, 0x0163}, {0x0014, 0x0164}, {0x0014, 0x0165}, {0x0014, 0x0166}, {0x0014, 0x0167}, {0x0014, 0x0168}, {0x0014, 0x0169}, - {0x0014, 0x016a}, {0x0014, 0x016b}, {0x0014, 0x016c}, {0x0014, 0x016d}, {0x0014, 0x016e}, {0x0014, 0x016f}, {0x0014, 0x0170}, {0x0014, 0x0171}, - {0x0014, 0x0172}, {0x0014, 0x0173}, {0x0014, 0x0174}, {0x0014, 0x0175}, {0x0014, 0x0176}, {0x0014, 0x0177}, {0x0014, 0x0178}, {0x0014, 0x0179}, - {0x0014, 0x017a}, {0x0014, 0x017b}, {0x0014, 0x017c}, {0x0014, 0x017d}, {0x0014, 0x017e}, {0x0014, 0x017f}, {0x0014, 0x0180}, {0x0014, 0x0181}, - {0x0014, 0x0182}, {0x0014, 0x0183}, {0x0014, 0x0184}, {0x0014, 0x0185}, {0x0014, 0x0186}, {0x0014, 0x0187}, {0x0014, 0x0188}, {0x0014, 0x0189}, - {0x0014, 0x018a}, {0x0014, 0x018b}, {0x0014, 0x018c}, {0x0014, 0x018d}, {0x0014, 0x018e}, {0x0014, 0x018f}, {0x0014, 0x0190}, {0x0014, 0x0191}, - {0x0014, 0x0192}, {0x0014, 0x0193}, {0x0014, 0x0194}, {0x0014, 0x0195}, {0x0014, 0x0196}, {0x0014, 0x0197}, {0x0014, 0x0198}, {0x0014, 0x0199}, - {0x0014, 0x019a}, {0x0014, 0x019b}, {0x0014, 0x019c}, {0x0014, 0x019d}, {0x0014, 0x019e}, {0x0014, 0x019f}, {0x0014, 0x01a0}, {0x0014, 0x01a1}, - {0x0014, 0x01a2}, {0x0014, 0x01a3}, {0x0014, 0x01a4}, {0x0014, 0x01a5}, {0x0014, 0x01a6}, {0x0014, 0x01a7}, {0x0014, 0x01a8}, {0x0014, 0x01a9}, - {0x0014, 0x01aa}, {0x0014, 0x01ab}, {0x0014, 0x01ac}, {0x0014, 0x01ad}, {0x0014, 0x01ae}, {0x0014, 0x01af}, {0x0014, 0x01b0}, {0x0014, 0x01b1}, - {0x0014, 0x01b2}, {0x0014, 0x01b3}, {0x0014, 0x01b4}, {0x0014, 0x01b5}, {0x0014, 0x01b6}, {0x0014, 0x01b7}, {0x0014, 0x01b8}, {0x0014, 0x01b9}, - {0x0014, 0x01ba}, {0x0014, 0x01bb}, {0x0014, 0x01bc}, {0x0014, 0x01bd}, {0x0014, 0x01be}, {0x0014, 0x01bf}, {0x0014, 0x01c0}, {0x0014, 0x01c1}, - {0x0014, 0x01c2}, {0x0014, 0x01c3}, {0x0014, 0x01c4}, {0x0014, 0x01c5}, {0x0014, 0x01c6}, {0x0014, 0x01c7}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, - {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, - {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, - {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, - {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, - {0x0013, 0x0113}, + { + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0009, 0x000f }, + { 0x000a, 0x000f }, + { 0x000c, 0x0011 }, + { 0x000d, 0x0014 }, + { 0x000e, 0x0017 }, + { 0x0010, 0x002d }, + { 0x0011, 0x004c }, + { 0x0012, 0x008a }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0014, 0x0006 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0006, 0x0016 }, + { 0x0005, 0x0018 }, + { 0x0005, 0x0019 }, + { 0x0005, 0x001a }, + { 0x0006, 0x0017 }, + { 0x0006, 0x0018 }, + { 0x0006, 0x0019 }, + { 0x0007, 0x0012 }, + { 0x0007, 0x0013 }, + { 0x0008, 0x0010 }, + { 0x000a, 0x0010 }, + { 0x000b, 0x0011 }, + { 0x000c, 0x0012 }, + { 0x000e, 0x0018 }, + { 0x000f, 0x0020 }, + { 0x0011, 0x004d }, + { 0x0013, 0x00e4 }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0006, 0x001a }, + { 0x0005, 0x001b }, + { 0x0005, 0x001c }, + { 0x0005, 0x001d }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0007, 0x0014 }, + { 0x0008, 0x0011 }, + { 0x0009, 0x0010 }, + { 0x000a, 0x0011 }, + { 0x000b, 0x0012 }, + { 0x000c, 0x0013 }, + { 0x000e, 0x0019 }, + { 0x000f, 0x0021 }, + { 0x0010, 0x002e }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0014, 0x001c }, + { 0x0006, 0x001e }, + { 0x0005, 0x001e }, + { 0x0005, 0x001f }, + { 0x0006, 0x001f }, + { 0x0006, 0x0020 }, + { 0x0006, 0x0021 }, + { 0x0006, 0x0022 }, + { 0x0007, 0x0015 }, + { 0x0008, 0x0012 }, + { 0x0009, 0x0011 }, + { 0x000a, 0x0012 }, + { 0x000b, 0x0013 }, + { 0x000c, 0x0014 }, + { 0x000e, 0x001a }, + { 0x000f, 0x0022 }, + { 0x0010, 0x002f }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0014, 0x001d }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0014, 0x0020 }, + { 0x0014, 0x0021 }, + { 0x0014, 0x0022 }, + { 0x0014, 0x0023 }, + { 0x0014, 0x0024 }, + { 0x0014, 0x0025 }, + { 0x0006, 0x0023 }, + { 0x0006, 0x0024 }, + { 0x0006, 0x0025 }, + { 0x0006, 0x0026 }, + { 0x0006, 0x0027 }, + { 0x0006, 0x0028 }, + { 0x0007, 0x0016 }, + { 0x0007, 0x0017 }, + { 0x0008, 0x0013 }, + { 0x0009, 0x0012 }, + { 0x000a, 0x0013 }, + { 0x000c, 0x0015 }, + { 0x000d, 0x0015 }, + { 0x000f, 0x0023 }, + { 0x0010, 0x0030 }, + { 0x0011, 0x004e }, + { 0x0014, 0x0026 }, + { 0x0014, 0x0027 }, + { 0x0014, 0x0028 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0014, 0x002d }, + { 0x0014, 0x002e }, + { 0x0014, 0x002f }, + { 0x0014, 0x0030 }, + { 0x0007, 0x0018 }, + { 0x0006, 0x0029 }, + { 0x0006, 0x002a }, + { 0x0006, 0x002b }, + { 0x0006, 0x002c }, + { 0x0007, 0x0019 }, + { 0x0007, 0x001a }, + { 0x0008, 0x0014 }, + { 0x0009, 0x0013 }, + { 0x000a, 0x0014 }, + { 0x000b, 0x0014 }, + { 0x000c, 0x0016 }, + { 0x000d, 0x0016 }, + { 0x000f, 0x0024 }, + { 0x0010, 0x0031 }, + { 0x0011, 0x004f }, + { 0x0014, 0x0031 }, + { 0x0014, 0x0032 }, + { 0x0014, 0x0033 }, + { 0x0014, 0x0034 }, + { 0x0014, 0x0035 }, + { 0x0014, 0x0036 }, + { 0x0014, 0x0037 }, + { 0x0014, 0x0038 }, + { 0x0014, 0x0039 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0007, 0x001b }, + { 0x0006, 0x002d }, + { 0x0006, 0x002e }, + { 0x0006, 0x002f }, + { 0x0007, 0x001c }, + { 0x0007, 0x001d }, + { 0x0008, 0x0015 }, + { 0x0009, 0x0014 }, + { 0x000a, 0x0015 }, + { 0x000a, 0x0016 }, + { 0x000c, 0x0017 }, + { 0x000d, 0x0017 }, + { 0x000e, 0x001b }, + { 0x000f, 0x0025 }, + { 0x0011, 0x0050 }, + { 0x0011, 0x0051 }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x0014, 0x003e }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0008, 0x0016 }, + { 0x0007, 0x001e }, + { 0x0007, 0x001f }, + { 0x0007, 0x0020 }, + { 0x0007, 0x0021 }, + { 0x0008, 0x0017 }, + { 0x0008, 0x0018 }, + { 0x0009, 0x0015 }, + { 0x000a, 0x0017 }, + { 0x000b, 0x0015 }, + { 0x000c, 0x0018 }, + { 0x000e, 0x001c }, + { 0x000e, 0x001d }, + { 0x0010, 0x0032 }, + { 0x0012, 0x008b }, + { 0x0012, 0x008c }, + { 0x0014, 0x0047 }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0008, 0x0019 }, + { 0x0007, 0x0022 }, + { 0x0007, 0x0023 }, + { 0x0008, 0x001a }, + { 0x0008, 0x001b }, + { 0x0009, 0x0016 }, + { 0x0009, 0x0017 }, + { 0x000a, 0x0018 }, + { 0x000b, 0x0016 }, + { 0x000c, 0x0019 }, + { 0x000d, 0x0018 }, + { 0x000e, 0x001e }, + { 0x0010, 0x0033 }, + { 0x0011, 0x0052 }, + { 0x0014, 0x0052 }, + { 0x0013, 0x00e9 }, + { 0x0014, 0x0053 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0009, 0x0018 }, + { 0x0008, 0x001c }, + { 0x0008, 0x001d }, + { 0x0009, 0x0019 }, + { 0x0009, 0x001a }, + { 0x000a, 0x0019 }, + { 0x000a, 0x001a }, + { 0x000b, 0x0017 }, + { 0x000c, 0x001a }, + { 0x000d, 0x0019 }, + { 0x000e, 0x001f }, + { 0x000f, 0x0026 }, + { 0x0010, 0x0034 }, + { 0x0012, 0x008d }, + { 0x0013, 0x00ea }, + { 0x0014, 0x005e }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x000b, 0x0018 }, + { 0x0009, 0x001b }, + { 0x000a, 0x001b }, + { 0x000a, 0x001c }, + { 0x000a, 0x001d }, + { 0x000b, 0x0019 }, + { 0x000b, 0x001a }, + { 0x000c, 0x001b }, + { 0x000d, 0x001a }, + { 0x000e, 0x0020 }, + { 0x000f, 0x0027 }, + { 0x0012, 0x008e }, + { 0x0011, 0x0053 }, + { 0x0013, 0x00eb }, + { 0x0014, 0x006a }, + { 0x0014, 0x006b }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x0014, 0x006f }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x000c, 0x001c }, + { 0x000b, 0x001b }, + { 0x000b, 0x001c }, + { 0x000b, 0x001d }, + { 0x000c, 0x001d }, + { 0x000c, 0x001e }, + { 0x000d, 0x001b }, + { 0x000d, 0x001c }, + { 0x000e, 0x0021 }, + { 0x0010, 0x0035 }, + { 0x0010, 0x0036 }, + { 0x0011, 0x0054 }, + { 0x0013, 0x00ec }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x000d, 0x001d }, + { 0x000c, 0x001f }, + { 0x000c, 0x0020 }, + { 0x000c, 0x0021 }, + { 0x000d, 0x001e }, + { 0x000d, 0x001f }, + { 0x000e, 0x0022 }, + { 0x000f, 0x0028 }, + { 0x0010, 0x0037 }, + { 0x0010, 0x0038 }, + { 0x0010, 0x0039 }, + { 0x0012, 0x008f }, + { 0x0013, 0x00ed }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x000e, 0x0023 }, + { 0x000d, 0x0020 }, + { 0x000d, 0x0021 }, + { 0x000e, 0x0024 }, + { 0x000e, 0x0025 }, + { 0x000e, 0x0026 }, + { 0x000f, 0x0029 }, + { 0x0010, 0x003a }, + { 0x0010, 0x003b }, + { 0x0012, 0x0090 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x0014, 0x009d }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x000f, 0x002a }, + { 0x000e, 0x0027 }, + { 0x000f, 0x002b }, + { 0x000f, 0x002c }, + { 0x000f, 0x002d }, + { 0x0010, 0x003c }, + { 0x0010, 0x003d }, + { 0x0011, 0x0055 }, + { 0x0011, 0x0056 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, + { 0x0014, 0x00a6 }, + { 0x0014, 0x00a7 }, + { 0x0014, 0x00a8 }, + { 0x0014, 0x00a9 }, + { 0x0014, 0x00aa }, + { 0x0014, 0x00ab }, + { 0x0014, 0x00ac }, + { 0x0014, 0x00ad }, + { 0x0014, 0x00ae }, + { 0x0014, 0x00af }, + { 0x0014, 0x00b0 }, + { 0x0014, 0x00b1 }, + { 0x0014, 0x00b2 }, + { 0x0014, 0x00b3 }, + { 0x0014, 0x00b4 }, + { 0x0014, 0x00b5 }, + { 0x0012, 0x0091 }, + { 0x0010, 0x003e }, + { 0x0010, 0x003f }, + { 0x0011, 0x0057 }, + { 0x0011, 0x0058 }, + { 0x0011, 0x0059 }, + { 0x0012, 0x0092 }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0012, 0x0093 }, + { 0x0014, 0x00b6 }, + { 0x0014, 0x00b7 }, + { 0x0014, 0x00b8 }, + { 0x0014, 0x00b9 }, + { 0x0014, 0x00ba }, + { 0x0014, 0x00bb }, + { 0x0014, 0x00bc }, + { 0x0014, 0x00bd }, + { 0x0014, 0x00be }, + { 0x0014, 0x00bf }, + { 0x0014, 0x00c0 }, + { 0x0014, 0x00c1 }, + { 0x0014, 0x00c2 }, + { 0x0014, 0x00c3 }, + { 0x0014, 0x00c4 }, + { 0x0014, 0x00c5 }, + { 0x0014, 0x00c6 }, + { 0x0013, 0x00f0 }, + { 0x0012, 0x0094 }, + { 0x0012, 0x0095 }, + { 0x0012, 0x0096 }, + { 0x0014, 0x00c7 }, + { 0x0014, 0x00c8 }, + { 0x0014, 0x00c9 }, + { 0x0014, 0x00ca }, + { 0x0014, 0x00cb }, + { 0x0014, 0x00cc }, + { 0x0014, 0x00cd }, + { 0x0014, 0x00ce }, + { 0x0014, 0x00cf }, + { 0x0014, 0x00d0 }, + { 0x0014, 0x00d1 }, + { 0x0014, 0x00d2 }, + { 0x0014, 0x00d3 }, + { 0x0014, 0x00d4 }, + { 0x0014, 0x00d5 }, + { 0x0014, 0x00d6 }, + { 0x0014, 0x00d7 }, + { 0x0014, 0x00d8 }, + { 0x0014, 0x00d9 }, + { 0x0014, 0x00da }, + { 0x0014, 0x00db }, + { 0x0014, 0x00dc }, + { 0x0014, 0x00dd }, + { 0x0014, 0x00de }, + { 0x0012, 0x0097 }, + { 0x0014, 0x00df }, + { 0x0014, 0x00e0 }, + { 0x0014, 0x00e1 }, + { 0x0014, 0x00e2 }, + { 0x0014, 0x00e3 }, + { 0x0014, 0x00e4 }, + { 0x0014, 0x00e5 }, + { 0x0014, 0x00e6 }, + { 0x0014, 0x00e7 }, + { 0x0014, 0x00e8 }, + { 0x0014, 0x00e9 }, + { 0x0014, 0x00ea }, + { 0x0014, 0x00eb }, + { 0x0014, 0x00ec }, + { 0x0014, 0x00ed }, + { 0x0014, 0x00ee }, + { 0x0014, 0x00ef }, + { 0x0014, 0x00f0 }, + { 0x0014, 0x00f1 }, + { 0x0014, 0x00f2 }, + { 0x0014, 0x00f3 }, + { 0x0014, 0x00f4 }, + { 0x0014, 0x00f5 }, + { 0x0014, 0x00f6 }, + { 0x0014, 0x00f7 }, + { 0x0014, 0x00f8 }, + { 0x0014, 0x00f9 }, + { 0x0014, 0x00fa }, + { 0x0014, 0x00fb }, + { 0x0014, 0x00fc }, + { 0x0014, 0x00fd }, + { 0x0014, 0x00fe }, + { 0x0014, 0x00ff }, + { 0x0014, 0x0100 }, + { 0x0014, 0x0101 }, + { 0x0014, 0x0102 }, + { 0x0014, 0x0103 }, + { 0x0014, 0x0104 }, + { 0x0014, 0x0105 }, + { 0x0014, 0x0106 }, + { 0x0014, 0x0107 }, + { 0x0014, 0x0108 }, + { 0x0014, 0x0109 }, + { 0x0014, 0x010a }, + { 0x0014, 0x010b }, + { 0x0014, 0x010c }, + { 0x0014, 0x010d }, + { 0x0014, 0x010e }, + { 0x0014, 0x010f }, + { 0x0014, 0x0110 }, + { 0x0014, 0x0111 }, + { 0x0014, 0x0112 }, + { 0x0014, 0x0113 }, + { 0x0014, 0x0114 }, + { 0x0014, 0x0115 }, + { 0x0014, 0x0116 }, + { 0x0014, 0x0117 }, + { 0x0014, 0x0118 }, + { 0x0014, 0x0119 }, + { 0x0014, 0x011a }, + { 0x0014, 0x011b }, + { 0x0014, 0x011c }, + { 0x0014, 0x011d }, + { 0x0014, 0x011e }, + { 0x0014, 0x011f }, + { 0x0014, 0x0120 }, + { 0x0014, 0x0121 }, + { 0x0014, 0x0122 }, + { 0x0014, 0x0123 }, + { 0x0014, 0x0124 }, + { 0x0014, 0x0125 }, + { 0x0014, 0x0126 }, + { 0x0014, 0x0127 }, + { 0x0014, 0x0128 }, + { 0x0014, 0x0129 }, + { 0x0014, 0x012a }, + { 0x0014, 0x012b }, + { 0x0014, 0x012c }, + { 0x0014, 0x012d }, + { 0x0014, 0x012e }, + { 0x0014, 0x012f }, + { 0x0014, 0x0130 }, + { 0x0014, 0x0131 }, + { 0x0014, 0x0132 }, + { 0x0014, 0x0133 }, + { 0x0014, 0x0134 }, + { 0x0014, 0x0135 }, + { 0x0014, 0x0136 }, + { 0x0014, 0x0137 }, + { 0x0014, 0x0138 }, + { 0x0014, 0x0139 }, + { 0x0014, 0x013a }, + { 0x0014, 0x013b }, + { 0x0014, 0x013c }, + { 0x0014, 0x013d }, + { 0x0014, 0x013e }, + { 0x0014, 0x013f }, + { 0x0014, 0x0140 }, + { 0x0014, 0x0141 }, + { 0x0014, 0x0142 }, + { 0x0014, 0x0143 }, + { 0x0014, 0x0144 }, + { 0x0014, 0x0145 }, + { 0x0014, 0x0146 }, + { 0x0014, 0x0147 }, + { 0x0014, 0x0148 }, + { 0x0014, 0x0149 }, + { 0x0014, 0x014a }, + { 0x0014, 0x014b }, + { 0x0014, 0x014c }, + { 0x0014, 0x014d }, + { 0x0014, 0x014e }, + { 0x0014, 0x014f }, + { 0x0014, 0x0150 }, + { 0x0014, 0x0151 }, + { 0x0014, 0x0152 }, + { 0x0014, 0x0153 }, + { 0x0014, 0x0154 }, + { 0x0014, 0x0155 }, + { 0x0014, 0x0156 }, + { 0x0014, 0x0157 }, + { 0x0014, 0x0158 }, + { 0x0014, 0x0159 }, + { 0x0014, 0x015a }, + { 0x0014, 0x015b }, + { 0x0014, 0x015c }, + { 0x0014, 0x015d }, + { 0x0014, 0x015e }, + { 0x0014, 0x015f }, + { 0x0014, 0x0160 }, + { 0x0014, 0x0161 }, + { 0x0014, 0x0162 }, + { 0x0014, 0x0163 }, + { 0x0014, 0x0164 }, + { 0x0014, 0x0165 }, + { 0x0014, 0x0166 }, + { 0x0014, 0x0167 }, + { 0x0014, 0x0168 }, + { 0x0014, 0x0169 }, + { 0x0014, 0x016a }, + { 0x0014, 0x016b }, + { 0x0014, 0x016c }, + { 0x0014, 0x016d }, + { 0x0014, 0x016e }, + { 0x0014, 0x016f }, + { 0x0014, 0x0170 }, + { 0x0014, 0x0171 }, + { 0x0014, 0x0172 }, + { 0x0014, 0x0173 }, + { 0x0014, 0x0174 }, + { 0x0014, 0x0175 }, + { 0x0014, 0x0176 }, + { 0x0014, 0x0177 }, + { 0x0014, 0x0178 }, + { 0x0014, 0x0179 }, + { 0x0014, 0x017a }, + { 0x0014, 0x017b }, + { 0x0014, 0x017c }, + { 0x0014, 0x017d }, + { 0x0014, 0x017e }, + { 0x0014, 0x017f }, + { 0x0014, 0x0180 }, + { 0x0014, 0x0181 }, + { 0x0014, 0x0182 }, + { 0x0014, 0x0183 }, + { 0x0014, 0x0184 }, + { 0x0014, 0x0185 }, + { 0x0014, 0x0186 }, + { 0x0014, 0x0187 }, + { 0x0014, 0x0188 }, + { 0x0014, 0x0189 }, + { 0x0014, 0x018a }, + { 0x0014, 0x018b }, + { 0x0014, 0x018c }, + { 0x0014, 0x018d }, + { 0x0014, 0x018e }, + { 0x0014, 0x018f }, + { 0x0014, 0x0190 }, + { 0x0014, 0x0191 }, + { 0x0014, 0x0192 }, + { 0x0014, 0x0193 }, + { 0x0014, 0x0194 }, + { 0x0014, 0x0195 }, + { 0x0014, 0x0196 }, + { 0x0014, 0x0197 }, + { 0x0014, 0x0198 }, + { 0x0014, 0x0199 }, + { 0x0014, 0x019a }, + { 0x0014, 0x019b }, + { 0x0014, 0x019c }, + { 0x0014, 0x019d }, + { 0x0014, 0x019e }, + { 0x0014, 0x019f }, + { 0x0014, 0x01a0 }, + { 0x0014, 0x01a1 }, + { 0x0014, 0x01a2 }, + { 0x0014, 0x01a3 }, + { 0x0014, 0x01a4 }, + { 0x0014, 0x01a5 }, + { 0x0014, 0x01a6 }, + { 0x0014, 0x01a7 }, + { 0x0014, 0x01a8 }, + { 0x0014, 0x01a9 }, + { 0x0014, 0x01aa }, + { 0x0014, 0x01ab }, + { 0x0014, 0x01ac }, + { 0x0014, 0x01ad }, + { 0x0014, 0x01ae }, + { 0x0014, 0x01af }, + { 0x0014, 0x01b0 }, + { 0x0014, 0x01b1 }, + { 0x0014, 0x01b2 }, + { 0x0014, 0x01b3 }, + { 0x0014, 0x01b4 }, + { 0x0014, 0x01b5 }, + { 0x0014, 0x01b6 }, + { 0x0014, 0x01b7 }, + { 0x0014, 0x01b8 }, + { 0x0014, 0x01b9 }, + { 0x0014, 0x01ba }, + { 0x0014, 0x01bb }, + { 0x0014, 0x01bc }, + { 0x0014, 0x01bd }, + { 0x0014, 0x01be }, + { 0x0014, 0x01bf }, + { 0x0014, 0x01c0 }, + { 0x0014, 0x01c1 }, + { 0x0014, 0x01c2 }, + { 0x0014, 0x01c3 }, + { 0x0014, 0x01c4 }, + { 0x0014, 0x01c5 }, + { 0x0014, 0x01c6 }, + { 0x0014, 0x01c7 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, + { 0x0013, 0x0110 }, + { 0x0013, 0x0111 }, + { 0x0013, 0x0112 }, + { 0x0013, 0x0113 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec17[93][16] = -{ - {0x0010ffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0006ffff, 0x0005ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, - {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, - {0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, }, - {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, - {0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, - {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, }, - {0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, }, - {0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, }, - {0x00000024, 0x0000003e, 0x00000059, 0x00000074, 0x0000008e, 0x000000a8, 0x000000bd, 0x000000c2, 0x000000c3, 0x000000d8, 0x000000db, 0x000000dc, 0x000000f4, 0x000000f5, 0x00010004, 0x00010004, }, - {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0001003d, 0x0001003d, 0x00010058, 0x00010058, 0x00010072, 0x00010072, 0x00010073, 0x00010073, }, - {0x00010087, 0x00010087, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x000100a2, 0x000100a2, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, }, - {0x001effff, 0x001dffff, 0x001cffff, 0x0019ffff, 0x0018ffff, 0x001affff, 0x001bffff, 0x0012ffff, 0x0011ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x00000007, 0x00000008, }, - {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, - {0x00020111, 0x00020111, 0x00020111, 0x00020111, 0x00020112, 0x00020112, 0x00020112, 0x00020112, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, }, - {0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, }, - {0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300dd, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, }, - {0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f3, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, }, - {0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x000300f7, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, 0x0003010f, }, - {0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, - {0x0001010e, 0x0001010e, 0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, - {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200c5, 0x000200c5, 0x000200c5, 0x000200c5, }, - {0x000200df, 0x000200df, 0x000200df, 0x000200df, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f8, 0x000200f9, 0x000200f9, 0x000200f9, 0x000200f9, 0x00020110, 0x00020110, 0x00020110, 0x00020110, }, - {0x00000146, 0x00000147, 0x00010026, 0x00010026, 0x00010041, 0x00010041, 0x0001005c, 0x0001005c, 0x00010091, 0x00010091, 0x000100c6, 0x000100c6, 0x000100e0, 0x000100e0, 0x000100fa, 0x000100fa, }, - {0x0025ffff, 0x0000000b, 0x00000027, 0x00000042, 0x0000005d, 0x00000077, 0x00000092, 0x000000ac, 0x000000c7, 0x000000e1, 0x000000fb, 0x00000115, 0x00000129, 0x0000012d, 0x0000012e, 0x00000145, }, - {0x0040ffff, 0x0039ffff, 0x002dffff, 0x002cffff, 0x002bffff, 0x0028ffff, 0x0026ffff, 0x0027ffff, 0x0029ffff, 0x002affff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, }, - {0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, 0x000300ad, }, - {0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300e2, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, 0x000300fc, }, - {0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x00030116, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, 0x0003012f, }, - {0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030130, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, 0x00030144, }, - {0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030148, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, 0x00030149, }, - {0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030160, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, 0x00030161, }, - {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020043, 0x00020043, 0x00020043, 0x00020043, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, }, - {0x000200c8, 0x000200c8, 0x000200c8, 0x000200c8, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200c9, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200e3, 0x000200fd, 0x000200fd, 0x000200fd, 0x000200fd, }, - {0x0001014b, 0x0001014b, 0x00010165, 0x00010165, 0x0001017a, 0x0001017a, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x00020117, 0x00020117, 0x00020117, 0x00020117, 0x00020131, 0x00020131, 0x00020131, 0x00020131, 0x0002014a, 0x0002014a, 0x0002014a, 0x0002014a, 0x0002015f, 0x0002015f, 0x0002015f, 0x0002015f, }, - {0x00020162, 0x00020162, 0x00020162, 0x00020162, 0x00020163, 0x00020163, 0x00020163, 0x00020163, 0x00020164, 0x00020164, 0x00020164, 0x00020164, 0x0002017b, 0x0002017b, 0x0002017b, 0x0002017b, }, - {0x00010029, 0x00010029, 0x00010044, 0x00010044, 0x0001005f, 0x0001005f, 0x00010079, 0x00010079, 0x00010094, 0x00010094, 0x000100af, 0x000100af, 0x000100fe, 0x000100fe, 0x00010118, 0x00010118, }, - {0x0000007a, 0x00000095, 0x000000ca, 0x000000e4, 0x000000ff, 0x00000132, 0x00000133, 0x0000014c, 0x0000014d, 0x0000014e, 0x00000166, 0x00000167, 0x0000017f, 0x00000180, 0x00000196, 0x00000197, }, - {0x003effff, 0x003fffff, 0x0036ffff, 0x0035ffff, 0x0037ffff, 0x0038ffff, 0x0031ffff, 0x002effff, 0x0032ffff, 0x002fffff, 0x0030ffff, 0x0033ffff, 0x0034ffff, 0x0000000e, 0x00000045, 0x00000060, }, - {0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, }, - {0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x000300e5, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, 0x0003011a, }, - {0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030134, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, 0x00030181, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b0, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, 0x000300b1, }, - {0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030182, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, 0x00030198, }, - {0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x00030199, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, 0x0003019a, }, - {0x000200cc, 0x000200cc, 0x000200cc, 0x000200cc, 0x00020100, 0x00020100, 0x00020100, 0x00020100, 0x00020119, 0x00020119, 0x00020119, 0x00020119, 0x0002014f, 0x0002014f, 0x0002014f, 0x0002014f, }, - {0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x000102d8, 0x000102d8, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x000200cb, 0x000200cb, 0x000200cb, 0x000200cb, }, - {0x00020168, 0x00020168, 0x00020168, 0x00020168, 0x00020195, 0x00020195, 0x00020195, 0x00020195, 0x0002019b, 0x0002019b, 0x0002019b, 0x0002019b, 0x0002019e, 0x0002019e, 0x0002019e, 0x0002019e, }, - {0x000201b1, 0x000201b1, 0x000201b1, 0x000201b1, 0x000201b2, 0x000201b2, 0x000201b2, 0x000201b2, 0x000201b3, 0x000201b3, 0x000201b3, 0x000201b3, 0x000201cc, 0x000201cc, 0x000201cc, 0x000201cc, }, - {0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x003bffff, 0x003affff, 0x003cffff, 0x003dffff, }, - {0x00010062, 0x00010062, 0x000100e7, 0x000100e7, 0x00010101, 0x00010101, 0x0001011b, 0x0001011b, 0x00010135, 0x00010135, 0x00010150, 0x00010150, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, }, - {0x000002ae, 0x000002af, 0x000002b0, 0x000002b1, 0x000002b2, 0x000002b3, 0x000002b4, 0x000002b5, 0x0001002b, 0x0001002b, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010061, 0x00010061, }, - {0x000101b0, 0x000101b0, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, 0x000102bc, 0x000102bc, }, - {0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, 0x000102c4, 0x000102c4, }, - {0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, 0x000102cc, 0x000102cc, }, - {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, - {0x0044ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0045ffff, 0x0048ffff, 0x0046ffff, 0x0047ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, }, - {0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000063, 0x00000064, 0x00000065, }, - {0x00000066, 0x00000067, 0x00000068, 0x00000069, 0x0000006a, 0x0000006b, 0x0000007c, 0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, }, - {0x00000086, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, }, - {0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, }, - {0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, 0x000000ba, 0x000000bb, 0x000000bc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, }, - {0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x00000120, 0x00000121, }, - {0x00000122, 0x00000123, 0x00000124, 0x00000125, 0x00000126, 0x00000127, 0x00000128, 0x00000136, 0x00000137, 0x00000138, 0x00000139, 0x0000013a, 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013e, }, - {0x000000d6, 0x000000d7, 0x000000e6, 0x000000e8, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x00000102, 0x00000103, }, - {0x0000013f, 0x00000140, 0x00000141, 0x00000142, 0x00000143, 0x00000151, 0x00000152, 0x00000153, 0x00000154, 0x00000155, 0x00000156, 0x00000157, 0x00000158, 0x00000159, 0x0000015a, 0x0000015b, }, - {0x0000015c, 0x0000015d, 0x0000015e, 0x00000169, 0x0000016a, 0x0000016b, 0x0000016c, 0x0000016d, 0x0000016e, 0x0000016f, 0x00000170, 0x00000171, 0x00000172, 0x00000173, 0x00000174, 0x00000175, }, - {0x00000176, 0x00000177, 0x00000178, 0x00000179, 0x00000183, 0x00000184, 0x00000185, 0x00000186, 0x00000187, 0x00000188, 0x00000189, 0x0000018a, 0x0000018b, 0x0000018c, 0x0000018d, 0x0000018e, }, - {0x0000018f, 0x00000190, 0x00000191, 0x00000192, 0x00000193, 0x00000194, 0x0000019f, 0x000001a0, 0x000001a1, 0x000001a2, 0x000001a3, 0x000001a4, 0x000001a5, 0x000001a6, 0x000001a7, 0x000001a8, }, - {0x000001a9, 0x000001aa, 0x000001ab, 0x000001ac, 0x000001ad, 0x000001ae, 0x000001af, 0x000001b4, 0x000001b5, 0x000001b6, 0x000001b7, 0x000001b8, 0x000001b9, 0x000001ba, 0x000001bb, 0x000001bc, }, - {0x000001bd, 0x000001be, 0x000001bf, 0x000001c0, 0x000001c1, 0x000001c2, 0x000001c3, 0x000001c4, 0x000001c5, 0x000001c6, 0x000001c7, 0x000001c8, 0x000001c9, 0x000001ca, 0x000001cb, 0x000001cd, }, - {0x000001ce, 0x000001cf, 0x000001d0, 0x000001d1, 0x000001d2, 0x000001d3, 0x000001d4, 0x000001d5, 0x000001d6, 0x000001d7, 0x000001d8, 0x000001d9, 0x000001da, 0x000001db, 0x000001dc, 0x000001dd, }, - {0x000001de, 0x000001df, 0x000001e0, 0x000001e1, 0x000001e2, 0x000001e3, 0x000001e4, 0x000001e5, 0x000001e6, 0x000001e7, 0x000001e8, 0x000001e9, 0x000001ea, 0x000001eb, 0x000001ec, 0x000001ed, }, - {0x000001ee, 0x000001ef, 0x000001f0, 0x000001f1, 0x000001f2, 0x000001f3, 0x000001f4, 0x000001f5, 0x000001f6, 0x000001f7, 0x000001f8, 0x000001f9, 0x000001fa, 0x000001fb, 0x000001fc, 0x000001fd, }, - {0x000001fe, 0x000001ff, 0x00000200, 0x00000201, 0x00000202, 0x00000203, 0x00000204, 0x00000205, 0x00000206, 0x00000207, 0x00000208, 0x00000209, 0x0000020a, 0x0000020b, 0x0000020c, 0x0000020d, }, - {0x0000020e, 0x0000020f, 0x00000210, 0x00000211, 0x00000212, 0x00000213, 0x00000214, 0x00000215, 0x00000216, 0x00000217, 0x00000218, 0x00000219, 0x0000021a, 0x0000021b, 0x0000021c, 0x0000021d, }, - {0x0000021e, 0x0000021f, 0x00000220, 0x00000221, 0x00000222, 0x00000223, 0x00000224, 0x00000225, 0x00000226, 0x00000227, 0x00000228, 0x00000229, 0x0000022a, 0x0000022b, 0x0000022c, 0x0000022d, }, - {0x0000022e, 0x0000022f, 0x00000230, 0x00000231, 0x00000232, 0x00000233, 0x00000234, 0x00000235, 0x00000236, 0x00000237, 0x00000238, 0x00000239, 0x0000023a, 0x0000023b, 0x0000023c, 0x0000023d, }, - {0x0000023e, 0x0000023f, 0x00000240, 0x00000241, 0x00000242, 0x00000243, 0x00000244, 0x00000245, 0x00000246, 0x00000247, 0x00000248, 0x00000249, 0x0000024a, 0x0000024b, 0x0000024c, 0x0000024d, }, - {0x0000024e, 0x0000024f, 0x00000250, 0x00000251, 0x00000252, 0x00000253, 0x00000254, 0x00000255, 0x00000256, 0x00000257, 0x00000258, 0x00000259, 0x0000025a, 0x0000025b, 0x0000025c, 0x0000025d, }, - {0x0000025e, 0x0000025f, 0x00000260, 0x00000261, 0x00000262, 0x00000263, 0x00000264, 0x00000265, 0x00000266, 0x00000267, 0x00000268, 0x00000269, 0x0000026a, 0x0000026b, 0x0000026c, 0x0000026d, }, - {0x0000026e, 0x0000026f, 0x00000270, 0x00000271, 0x00000272, 0x00000273, 0x00000274, 0x00000275, 0x00000276, 0x00000277, 0x00000278, 0x00000279, 0x0000027a, 0x0000027b, 0x0000027c, 0x0000027d, }, - {0x0000027e, 0x0000027f, 0x00000280, 0x00000281, 0x00000282, 0x00000283, 0x00000284, 0x00000285, 0x00000286, 0x00000287, 0x00000288, 0x00000289, 0x0000028a, 0x0000028b, 0x0000028c, 0x0000028d, }, - {0x0000028e, 0x0000028f, 0x00000290, 0x00000291, 0x00000292, 0x00000293, 0x00000294, 0x00000295, 0x00000296, 0x00000297, 0x00000298, 0x00000299, 0x0000029a, 0x0000029b, 0x0000029c, 0x0000029d, }, - {0x0000029e, 0x0000029f, 0x000002a0, 0x000002a1, 0x000002a2, 0x000002a3, 0x000002a4, 0x000002a5, 0x000002a6, 0x000002a7, 0x000002a8, 0x000002a9, 0x000002aa, 0x000002ab, 0x000002ac, 0x000002ad, }, +const uint32_t c_aauiCQMFHuffDec17[93][16] = { + { + 0x0010ffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0006ffff, + 0x0005ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + }, + { + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + }, + { + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + }, + { + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x000100c0, + 0x000100c0, + 0x000100c1, + 0x000100c1, + 0x000100d9, + 0x000100d9, + 0x000100da, + 0x000100da, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + }, + { + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020054, + 0x00020054, + 0x00020054, + 0x00020054, + }, + { + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020057, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + }, + { + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + }, + { + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020089, + 0x00020089, + 0x00020089, + 0x00020089, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008a, + }, + { + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + }, + { + 0x00000024, + 0x0000003e, + 0x00000059, + 0x00000074, + 0x0000008e, + 0x000000a8, + 0x000000bd, + 0x000000c2, + 0x000000c3, + 0x000000d8, + 0x000000db, + 0x000000dc, + 0x000000f4, + 0x000000f5, + 0x00010004, + 0x00010004, + }, + { + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x0001003d, + 0x0001003d, + 0x00010058, + 0x00010058, + 0x00010072, + 0x00010072, + 0x00010073, + 0x00010073, + }, + { + 0x00010087, + 0x00010087, + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + 0x000100a2, + 0x000100a2, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + }, + { + 0x001effff, + 0x001dffff, + 0x001cffff, + 0x0019ffff, + 0x0018ffff, + 0x001affff, + 0x001bffff, + 0x0012ffff, + 0x0011ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x00000007, + 0x00000008, + }, + { + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + }, + { + 0x00020111, + 0x00020111, + 0x00020111, + 0x00020111, + 0x00020112, + 0x00020112, + 0x00020112, + 0x00020112, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + }, + { + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + }, + { + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300dd, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + }, + { + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f3, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + }, + { + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x000300f7, + 0x0003010f, + 0x0003010f, + 0x0003010f, + 0x0003010f, + 0x0003010f, + 0x0003010f, + 0x0003010f, + 0x0003010f, + }, + { + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + }, + { + 0x0001010e, + 0x0001010e, + 0x00010113, + 0x00010113, + 0x00010114, + 0x00010114, + 0x0001012a, + 0x0001012a, + 0x0001012b, + 0x0001012b, + 0x0001012c, + 0x0001012c, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + }, + { + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200c5, + 0x000200c5, + 0x000200c5, + 0x000200c5, + }, + { + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200df, + 0x000200f8, + 0x000200f8, + 0x000200f8, + 0x000200f8, + 0x000200f9, + 0x000200f9, + 0x000200f9, + 0x000200f9, + 0x00020110, + 0x00020110, + 0x00020110, + 0x00020110, + }, + { + 0x00000146, + 0x00000147, + 0x00010026, + 0x00010026, + 0x00010041, + 0x00010041, + 0x0001005c, + 0x0001005c, + 0x00010091, + 0x00010091, + 0x000100c6, + 0x000100c6, + 0x000100e0, + 0x000100e0, + 0x000100fa, + 0x000100fa, + }, + { + 0x0025ffff, + 0x0000000b, + 0x00000027, + 0x00000042, + 0x0000005d, + 0x00000077, + 0x00000092, + 0x000000ac, + 0x000000c7, + 0x000000e1, + 0x000000fb, + 0x00000115, + 0x00000129, + 0x0000012d, + 0x0000012e, + 0x00000145, + }, + { + 0x0040ffff, + 0x0039ffff, + 0x002dffff, + 0x002cffff, + 0x002bffff, + 0x0028ffff, + 0x0026ffff, + 0x0027ffff, + 0x0029ffff, + 0x002affff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + }, + { + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + 0x000300ad, + }, + { + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300e2, + 0x000300fc, + 0x000300fc, + 0x000300fc, + 0x000300fc, + 0x000300fc, + 0x000300fc, + 0x000300fc, + 0x000300fc, + }, + { + 0x00030116, + 0x00030116, + 0x00030116, + 0x00030116, + 0x00030116, + 0x00030116, + 0x00030116, + 0x00030116, + 0x0003012f, + 0x0003012f, + 0x0003012f, + 0x0003012f, + 0x0003012f, + 0x0003012f, + 0x0003012f, + 0x0003012f, + }, + { + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030130, + 0x00030144, + 0x00030144, + 0x00030144, + 0x00030144, + 0x00030144, + 0x00030144, + 0x00030144, + 0x00030144, + }, + { + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030148, + 0x00030149, + 0x00030149, + 0x00030149, + 0x00030149, + 0x00030149, + 0x00030149, + 0x00030149, + 0x00030149, + }, + { + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030160, + 0x00030161, + 0x00030161, + 0x00030161, + 0x00030161, + 0x00030161, + 0x00030161, + 0x00030161, + 0x00030161, + }, + { + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020043, + 0x00020043, + 0x00020043, + 0x00020043, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200ae, + }, + { + 0x000200c8, + 0x000200c8, + 0x000200c8, + 0x000200c8, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200c9, + 0x000200e3, + 0x000200e3, + 0x000200e3, + 0x000200e3, + 0x000200fd, + 0x000200fd, + 0x000200fd, + 0x000200fd, + }, + { + 0x0001014b, + 0x0001014b, + 0x00010165, + 0x00010165, + 0x0001017a, + 0x0001017a, + 0x0001017c, + 0x0001017c, + 0x0001017d, + 0x0001017d, + 0x0001017e, + 0x0001017e, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + }, + { + 0x00020117, + 0x00020117, + 0x00020117, + 0x00020117, + 0x00020131, + 0x00020131, + 0x00020131, + 0x00020131, + 0x0002014a, + 0x0002014a, + 0x0002014a, + 0x0002014a, + 0x0002015f, + 0x0002015f, + 0x0002015f, + 0x0002015f, + }, + { + 0x00020162, + 0x00020162, + 0x00020162, + 0x00020162, + 0x00020163, + 0x00020163, + 0x00020163, + 0x00020163, + 0x00020164, + 0x00020164, + 0x00020164, + 0x00020164, + 0x0002017b, + 0x0002017b, + 0x0002017b, + 0x0002017b, + }, + { + 0x00010029, + 0x00010029, + 0x00010044, + 0x00010044, + 0x0001005f, + 0x0001005f, + 0x00010079, + 0x00010079, + 0x00010094, + 0x00010094, + 0x000100af, + 0x000100af, + 0x000100fe, + 0x000100fe, + 0x00010118, + 0x00010118, + }, + { + 0x0000007a, + 0x00000095, + 0x000000ca, + 0x000000e4, + 0x000000ff, + 0x00000132, + 0x00000133, + 0x0000014c, + 0x0000014d, + 0x0000014e, + 0x00000166, + 0x00000167, + 0x0000017f, + 0x00000180, + 0x00000196, + 0x00000197, + }, + { + 0x003effff, + 0x003fffff, + 0x0036ffff, + 0x0035ffff, + 0x0037ffff, + 0x0038ffff, + 0x0031ffff, + 0x002effff, + 0x0032ffff, + 0x002fffff, + 0x0030ffff, + 0x0033ffff, + 0x0034ffff, + 0x0000000e, + 0x00000045, + 0x00000060, + }, + { + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + }, + { + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x000300e5, + 0x0003011a, + 0x0003011a, + 0x0003011a, + 0x0003011a, + 0x0003011a, + 0x0003011a, + 0x0003011a, + 0x0003011a, + }, + { + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030134, + 0x00030181, + 0x00030181, + 0x00030181, + 0x00030181, + 0x00030181, + 0x00030181, + 0x00030181, + 0x00030181, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b0, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + 0x000300b1, + }, + { + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030182, + 0x00030198, + 0x00030198, + 0x00030198, + 0x00030198, + 0x00030198, + 0x00030198, + 0x00030198, + 0x00030198, + }, + { + 0x00030199, + 0x00030199, + 0x00030199, + 0x00030199, + 0x00030199, + 0x00030199, + 0x00030199, + 0x00030199, + 0x0003019a, + 0x0003019a, + 0x0003019a, + 0x0003019a, + 0x0003019a, + 0x0003019a, + 0x0003019a, + 0x0003019a, + }, + { + 0x000200cc, + 0x000200cc, + 0x000200cc, + 0x000200cc, + 0x00020100, + 0x00020100, + 0x00020100, + 0x00020100, + 0x00020119, + 0x00020119, + 0x00020119, + 0x00020119, + 0x0002014f, + 0x0002014f, + 0x0002014f, + 0x0002014f, + }, + { + 0x000102d5, + 0x000102d5, + 0x000102d6, + 0x000102d6, + 0x000102d7, + 0x000102d7, + 0x000102d8, + 0x000102d8, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x000200cb, + 0x000200cb, + 0x000200cb, + 0x000200cb, + }, + { + 0x00020168, + 0x00020168, + 0x00020168, + 0x00020168, + 0x00020195, + 0x00020195, + 0x00020195, + 0x00020195, + 0x0002019b, + 0x0002019b, + 0x0002019b, + 0x0002019b, + 0x0002019e, + 0x0002019e, + 0x0002019e, + 0x0002019e, + }, + { + 0x000201b1, + 0x000201b1, + 0x000201b1, + 0x000201b1, + 0x000201b2, + 0x000201b2, + 0x000201b2, + 0x000201b2, + 0x000201b3, + 0x000201b3, + 0x000201b3, + 0x000201b3, + 0x000201cc, + 0x000201cc, + 0x000201cc, + 0x000201cc, + }, + { + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + 0x0054ffff, + 0x0055ffff, + 0x0056ffff, + 0x0057ffff, + 0x0058ffff, + 0x0059ffff, + 0x005affff, + 0x005bffff, + 0x005cffff, + 0x003bffff, + 0x003affff, + 0x003cffff, + 0x003dffff, + }, + { + 0x00010062, + 0x00010062, + 0x000100e7, + 0x000100e7, + 0x00010101, + 0x00010101, + 0x0001011b, + 0x0001011b, + 0x00010135, + 0x00010135, + 0x00010150, + 0x00010150, + 0x0001019c, + 0x0001019c, + 0x0001019d, + 0x0001019d, + }, + { + 0x000002ae, + 0x000002af, + 0x000002b0, + 0x000002b1, + 0x000002b2, + 0x000002b3, + 0x000002b4, + 0x000002b5, + 0x0001002b, + 0x0001002b, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010061, + 0x00010061, + }, + { + 0x000101b0, + 0x000101b0, + 0x000102b6, + 0x000102b6, + 0x000102b7, + 0x000102b7, + 0x000102b8, + 0x000102b8, + 0x000102b9, + 0x000102b9, + 0x000102ba, + 0x000102ba, + 0x000102bb, + 0x000102bb, + 0x000102bc, + 0x000102bc, + }, + { + 0x000102bd, + 0x000102bd, + 0x000102be, + 0x000102be, + 0x000102bf, + 0x000102bf, + 0x000102c0, + 0x000102c0, + 0x000102c1, + 0x000102c1, + 0x000102c2, + 0x000102c2, + 0x000102c3, + 0x000102c3, + 0x000102c4, + 0x000102c4, + }, + { + 0x000102c5, + 0x000102c5, + 0x000102c6, + 0x000102c6, + 0x000102c7, + 0x000102c7, + 0x000102c8, + 0x000102c8, + 0x000102c9, + 0x000102c9, + 0x000102ca, + 0x000102ca, + 0x000102cb, + 0x000102cb, + 0x000102cc, + 0x000102cc, + }, + { + 0x000102cd, + 0x000102cd, + 0x000102ce, + 0x000102ce, + 0x000102cf, + 0x000102cf, + 0x000102d0, + 0x000102d0, + 0x000102d1, + 0x000102d1, + 0x000102d2, + 0x000102d2, + 0x000102d3, + 0x000102d3, + 0x000102d4, + 0x000102d4, + }, + { + 0x0044ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0045ffff, + 0x0048ffff, + 0x0046ffff, + 0x0047ffff, + 0x0049ffff, + 0x004affff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + 0x0050ffff, + }, + { + 0x00000032, + 0x00000033, + 0x00000034, + 0x00000035, + 0x00000048, + 0x00000049, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x0000004d, + 0x0000004e, + 0x0000004f, + 0x00000050, + 0x00000063, + 0x00000064, + 0x00000065, + }, + { + 0x00000066, + 0x00000067, + 0x00000068, + 0x00000069, + 0x0000006a, + 0x0000006b, + 0x0000007c, + 0x0000007d, + 0x0000007e, + 0x0000007f, + 0x00000080, + 0x00000081, + 0x00000082, + 0x00000083, + 0x00000084, + 0x00000085, + }, + { + 0x00000086, + 0x00000097, + 0x00000098, + 0x00000099, + 0x0000009a, + 0x0000009b, + 0x0000009c, + 0x0000009d, + 0x0000009e, + 0x0000009f, + 0x000000a0, + 0x000000a1, + 0x000000b2, + 0x000000b3, + 0x000000b4, + 0x000000b5, + }, + { + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000018, + 0x00000019, + 0x0000001a, + 0x0000002c, + 0x0000002d, + 0x0000002e, + 0x0000002f, + 0x00000030, + 0x00000031, + }, + { + 0x000000b6, + 0x000000b7, + 0x000000b8, + 0x000000b9, + 0x000000ba, + 0x000000bb, + 0x000000bc, + 0x000000cd, + 0x000000ce, + 0x000000cf, + 0x000000d0, + 0x000000d1, + 0x000000d2, + 0x000000d3, + 0x000000d4, + 0x000000d5, + }, + { + 0x00000104, + 0x00000105, + 0x00000106, + 0x00000107, + 0x00000108, + 0x00000109, + 0x0000010a, + 0x0000010b, + 0x0000010c, + 0x0000010d, + 0x0000011c, + 0x0000011d, + 0x0000011e, + 0x0000011f, + 0x00000120, + 0x00000121, + }, + { + 0x00000122, + 0x00000123, + 0x00000124, + 0x00000125, + 0x00000126, + 0x00000127, + 0x00000128, + 0x00000136, + 0x00000137, + 0x00000138, + 0x00000139, + 0x0000013a, + 0x0000013b, + 0x0000013c, + 0x0000013d, + 0x0000013e, + }, + { + 0x000000d6, + 0x000000d7, + 0x000000e6, + 0x000000e8, + 0x000000e9, + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + 0x000000ee, + 0x000000ef, + 0x000000f0, + 0x000000f1, + 0x000000f2, + 0x00000102, + 0x00000103, + }, + { + 0x0000013f, + 0x00000140, + 0x00000141, + 0x00000142, + 0x00000143, + 0x00000151, + 0x00000152, + 0x00000153, + 0x00000154, + 0x00000155, + 0x00000156, + 0x00000157, + 0x00000158, + 0x00000159, + 0x0000015a, + 0x0000015b, + }, + { + 0x0000015c, + 0x0000015d, + 0x0000015e, + 0x00000169, + 0x0000016a, + 0x0000016b, + 0x0000016c, + 0x0000016d, + 0x0000016e, + 0x0000016f, + 0x00000170, + 0x00000171, + 0x00000172, + 0x00000173, + 0x00000174, + 0x00000175, + }, + { + 0x00000176, + 0x00000177, + 0x00000178, + 0x00000179, + 0x00000183, + 0x00000184, + 0x00000185, + 0x00000186, + 0x00000187, + 0x00000188, + 0x00000189, + 0x0000018a, + 0x0000018b, + 0x0000018c, + 0x0000018d, + 0x0000018e, + }, + { + 0x0000018f, + 0x00000190, + 0x00000191, + 0x00000192, + 0x00000193, + 0x00000194, + 0x0000019f, + 0x000001a0, + 0x000001a1, + 0x000001a2, + 0x000001a3, + 0x000001a4, + 0x000001a5, + 0x000001a6, + 0x000001a7, + 0x000001a8, + }, + { + 0x000001a9, + 0x000001aa, + 0x000001ab, + 0x000001ac, + 0x000001ad, + 0x000001ae, + 0x000001af, + 0x000001b4, + 0x000001b5, + 0x000001b6, + 0x000001b7, + 0x000001b8, + 0x000001b9, + 0x000001ba, + 0x000001bb, + 0x000001bc, + }, + { + 0x000001bd, + 0x000001be, + 0x000001bf, + 0x000001c0, + 0x000001c1, + 0x000001c2, + 0x000001c3, + 0x000001c4, + 0x000001c5, + 0x000001c6, + 0x000001c7, + 0x000001c8, + 0x000001c9, + 0x000001ca, + 0x000001cb, + 0x000001cd, + }, + { + 0x000001ce, + 0x000001cf, + 0x000001d0, + 0x000001d1, + 0x000001d2, + 0x000001d3, + 0x000001d4, + 0x000001d5, + 0x000001d6, + 0x000001d7, + 0x000001d8, + 0x000001d9, + 0x000001da, + 0x000001db, + 0x000001dc, + 0x000001dd, + }, + { + 0x000001de, + 0x000001df, + 0x000001e0, + 0x000001e1, + 0x000001e2, + 0x000001e3, + 0x000001e4, + 0x000001e5, + 0x000001e6, + 0x000001e7, + 0x000001e8, + 0x000001e9, + 0x000001ea, + 0x000001eb, + 0x000001ec, + 0x000001ed, + }, + { + 0x000001ee, + 0x000001ef, + 0x000001f0, + 0x000001f1, + 0x000001f2, + 0x000001f3, + 0x000001f4, + 0x000001f5, + 0x000001f6, + 0x000001f7, + 0x000001f8, + 0x000001f9, + 0x000001fa, + 0x000001fb, + 0x000001fc, + 0x000001fd, + }, + { + 0x000001fe, + 0x000001ff, + 0x00000200, + 0x00000201, + 0x00000202, + 0x00000203, + 0x00000204, + 0x00000205, + 0x00000206, + 0x00000207, + 0x00000208, + 0x00000209, + 0x0000020a, + 0x0000020b, + 0x0000020c, + 0x0000020d, + }, + { + 0x0000020e, + 0x0000020f, + 0x00000210, + 0x00000211, + 0x00000212, + 0x00000213, + 0x00000214, + 0x00000215, + 0x00000216, + 0x00000217, + 0x00000218, + 0x00000219, + 0x0000021a, + 0x0000021b, + 0x0000021c, + 0x0000021d, + }, + { + 0x0000021e, + 0x0000021f, + 0x00000220, + 0x00000221, + 0x00000222, + 0x00000223, + 0x00000224, + 0x00000225, + 0x00000226, + 0x00000227, + 0x00000228, + 0x00000229, + 0x0000022a, + 0x0000022b, + 0x0000022c, + 0x0000022d, + }, + { + 0x0000022e, + 0x0000022f, + 0x00000230, + 0x00000231, + 0x00000232, + 0x00000233, + 0x00000234, + 0x00000235, + 0x00000236, + 0x00000237, + 0x00000238, + 0x00000239, + 0x0000023a, + 0x0000023b, + 0x0000023c, + 0x0000023d, + }, + { + 0x0000023e, + 0x0000023f, + 0x00000240, + 0x00000241, + 0x00000242, + 0x00000243, + 0x00000244, + 0x00000245, + 0x00000246, + 0x00000247, + 0x00000248, + 0x00000249, + 0x0000024a, + 0x0000024b, + 0x0000024c, + 0x0000024d, + }, + { + 0x0000024e, + 0x0000024f, + 0x00000250, + 0x00000251, + 0x00000252, + 0x00000253, + 0x00000254, + 0x00000255, + 0x00000256, + 0x00000257, + 0x00000258, + 0x00000259, + 0x0000025a, + 0x0000025b, + 0x0000025c, + 0x0000025d, + }, + { + 0x0000025e, + 0x0000025f, + 0x00000260, + 0x00000261, + 0x00000262, + 0x00000263, + 0x00000264, + 0x00000265, + 0x00000266, + 0x00000267, + 0x00000268, + 0x00000269, + 0x0000026a, + 0x0000026b, + 0x0000026c, + 0x0000026d, + }, + { + 0x0000026e, + 0x0000026f, + 0x00000270, + 0x00000271, + 0x00000272, + 0x00000273, + 0x00000274, + 0x00000275, + 0x00000276, + 0x00000277, + 0x00000278, + 0x00000279, + 0x0000027a, + 0x0000027b, + 0x0000027c, + 0x0000027d, + }, + { + 0x0000027e, + 0x0000027f, + 0x00000280, + 0x00000281, + 0x00000282, + 0x00000283, + 0x00000284, + 0x00000285, + 0x00000286, + 0x00000287, + 0x00000288, + 0x00000289, + 0x0000028a, + 0x0000028b, + 0x0000028c, + 0x0000028d, + }, + { + 0x0000028e, + 0x0000028f, + 0x00000290, + 0x00000291, + 0x00000292, + 0x00000293, + 0x00000294, + 0x00000295, + 0x00000296, + 0x00000297, + 0x00000298, + 0x00000299, + 0x0000029a, + 0x0000029b, + 0x0000029c, + 0x0000029d, + }, + { + 0x0000029e, + 0x0000029f, + 0x000002a0, + 0x000002a1, + 0x000002a2, + 0x000002a3, + 0x000002a4, + 0x000002a5, + 0x000002a6, + 0x000002a7, + 0x000002a8, + 0x000002a9, + 0x000002aa, + 0x000002ab, + 0x000002ac, + 0x000002ad, + }, }; #endif @@ -1635,23 +16793,148 @@ const uint32_t c_aauiCQMFHuffEnc18[28][2] = #else const uint16_t c_aauiCQMFHuffEnc18[28][2] = #endif -{ - {0x0004, 0x0001}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0002}, - {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, - {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0011, 0x0003}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, - {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0004}, {0x0012, 0x0005}, + { + { 0x0004, 0x0001 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0002 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000f, 0x0001 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec18[6][16] = -{ - {0x0001ffff, 0x00000000, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, }, - {0x0002ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003ffff, 0x00000010, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0005ffff, 0x0004ffff, 0x00010013, 0x00010013, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, +const uint32_t c_aauiCQMFHuffDec18[6][16] = { + { + 0x0001ffff, + 0x00000000, + 0x00000007, + 0x00000008, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00010004, + 0x00010004, + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + }, + { + 0x0002ffff, + 0x0000000c, + 0x0001000b, + 0x0001000b, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003ffff, + 0x00000010, + 0x0001000f, + 0x0001000f, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0005ffff, + 0x0004ffff, + 0x00010013, + 0x00010013, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + }, }; #endif @@ -1660,23 +16943,149 @@ const uint32_t c_aauiCQMFHuffEnc19[29][2] = #else const uint16_t c_aauiCQMFHuffEnc19[29][2] = #endif -{ - {0x0004, 0x0002}, {0x0003, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, - {0x0004, 0x0005}, {0x0005, 0x0001}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, - {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0012, 0x0002}, - {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0012, 0x0003}, + { + { 0x0004, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0003 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0005, 0x0001 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0006, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000f, 0x0001 }, + { 0x0010, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0012, 0x0003 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec19[6][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00000000, 0x00000006, 0x00000007, 0x00000008, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, }, - {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0004ffff, 0x00000012, 0x00010011, 0x00010011, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x0005ffff, 0x00000016, 0x00010015, 0x00010015, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, +const uint32_t c_aauiCQMFHuffDec19[6][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00000000, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00010004, + 0x00010004, + 0x00010005, + 0x00010005, + }, + { + 0x0003ffff, + 0x0000000e, + 0x0001000d, + 0x0001000d, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0004ffff, + 0x00000012, + 0x00010011, + 0x00010011, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x0005ffff, + 0x00000016, + 0x00010015, + 0x00010015, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, }; #endif @@ -1685,22 +17094,151 @@ const uint32_t c_aauiCQMFHuffEnc20[32][2] = #else const uint16_t c_aauiCQMFHuffEnc20[32][2] = #endif -{ - {0x0004, 0x0002}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, - {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0006, 0x0002}, {0x0006, 0x0003}, - {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, - {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0011, 0x0001}, {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, -}; + { + { 0x0004, 0x0002 }, + { 0x0003, 0x0005 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0003 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0006, 0x0001 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000f, 0x0001 }, + { 0x0010, 0x0001 }, + { 0x0011, 0x0001 }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec20[6][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003ffff, 0x00000011, 0x00010010, 0x00010010, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0004ffff, 0x00000015, 0x00010014, 0x00010014, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x0005ffff, 0x00000019, 0x00010018, 0x00010018, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x0000001b, 0x0000001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, +const uint32_t c_aauiCQMFHuffDec20[6][16] = { + { + 0x0002ffff, + 0x0001ffff, + 0x00000000, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003ffff, + 0x00000011, + 0x00010010, + 0x00010010, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + }, + { + 0x0004ffff, + 0x00000015, + 0x00010014, + 0x00010014, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x0005ffff, + 0x00000019, + 0x00010018, + 0x00010018, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + }, + { + 0x0000001b, + 0x0000001c, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + }, }; #endif @@ -1709,25 +17247,175 @@ const uint32_t c_aauiCQMFHuffEnc21[37][2] = #else const uint16_t c_aauiCQMFHuffEnc21[37][2] = #endif -{ - {0x0005, 0x0002}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, - {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0002}, - {0x0006, 0x0003}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0001}, {0x000b, 0x0001}, - {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0011, 0x0001}, - {0x0014, 0x0000}, {0x0014, 0x0001}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + { + { 0x0005, 0x0002 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0003 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0005, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0009, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000f, 0x0001 }, + { 0x0010, 0x0001 }, + { 0x0011, 0x0001 }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec21[7][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0004ffff, 0x00000013, 0x00000014, 0x00000015, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, - {0x0005ffff, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x0006ffff, 0x0000001e, 0x0001001d, 0x0001001d, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x00000020, 0x00000021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, +const uint32_t c_aauiCQMFHuffDec21[7][16] = { + { + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + }, + { + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0004ffff, + 0x00000013, + 0x00000014, + 0x00000015, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + }, + { + 0x0005ffff, + 0x0000001a, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + }, + { + 0x0006ffff, + 0x0000001e, + 0x0001001d, + 0x0001001d, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + }, + { + 0x00000020, + 0x00000021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + }, }; #endif @@ -1736,27 +17424,213 @@ const uint32_t c_aauiCQMFHuffEnc22[39][2] = #else const uint16_t c_aauiCQMFHuffEnc22[39][2] = #endif -{ - {0x0005, 0x0002}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, - {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, - {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0002}, {0x0008, 0x0003}, - {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0001}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x000c, 0x0003}, - {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000f, 0x0001}, {0x000e, 0x0003}, {0x0011, 0x0000}, {0x0010, 0x0001}, {0x0011, 0x0001}, + { + { 0x0005, 0x0002 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0004, 0x000c }, + { 0x0004, 0x000d }, + { 0x0004, 0x000e }, + { 0x0004, 0x000f }, + { 0x0005, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000a, 0x0001 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000c, 0x0001 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000e, 0x0001 }, + { 0x000e, 0x0002 }, + { 0x000f, 0x0001 }, + { 0x000e, 0x0003 }, + { 0x0011, 0x0000 }, + { 0x0010, 0x0001 }, + { 0x0011, 0x0001 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec22[9][16] = -{ - {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x0006ffff, 0x0005ffff, 0x00000016, 0x00000017, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x0007ffff, 0x0000001d, 0x0000001e, 0x0000001f, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x0008ffff, 0x00000025, 0x00010022, 0x00010022, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, +const uint32_t c_aauiCQMFHuffDec22[9][16] = { + { + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00000001, + 0x00000002, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x0000000c, + }, + { + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x00000016, + 0x00000017, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x0007ffff, + 0x0000001d, + 0x0000001e, + 0x0000001f, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, + { + 0x0008ffff, + 0x00000025, + 0x00010022, + 0x00010022, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + }, + { + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + }, }; #endif @@ -1765,31 +17639,274 @@ const uint32_t c_aauiCQMFHuffEnc23[46][2] = #else const uint16_t c_aauiCQMFHuffEnc23[46][2] = #endif -{ - {0x0005, 0x0003}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, - {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, - {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, - {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, - {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0001}, {0x000e, 0x0002}, - {0x000e, 0x0003}, {0x000f, 0x0001}, {0x0010, 0x0001}, {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x0001}, + { + { 0x0005, 0x0003 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0004, 0x000c }, + { 0x0004, 0x000d }, + { 0x0004, 0x000e }, + { 0x0004, 0x000f }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000e, 0x0001 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0001 }, + { 0x0010, 0x0001 }, + { 0x0012, 0x0000 }, + { 0x0012, 0x0001 }, + { 0x0011, 0x0001 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec23[12][16] = -{ - {0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x0008ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x000affff, 0x0009ffff, 0x00000022, 0x00000023, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x000bffff, 0x0000002a, 0x00010029, 0x00010029, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, - {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, +const uint32_t c_aauiCQMFHuffDec23[12][16] = { + { + 0x0006ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x00000001, + 0x00000002, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + }, + { + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x0008ffff, + 0x0007ffff, + 0x0000001a, + 0x0000001b, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + }, + { + 0x000affff, + 0x0009ffff, + 0x00000022, + 0x00000023, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + }, + { + 0x000bffff, + 0x0000002a, + 0x00010029, + 0x00010029, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + }, + { + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, }; #endif @@ -1798,37 +17915,373 @@ const uint32_t c_aauiCQMFHuffEnc24[55][2] = #else const uint16_t c_aauiCQMFHuffEnc24[55][2] = #endif -{ - {0x0005, 0x0004}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0004, 0x000f}, - {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, - {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, - {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, - {0x0009, 0x0002}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, - {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0001}, - {0x000f, 0x0002}, {0x000f, 0x0003}, {0x0010, 0x0001}, {0x0011, 0x0001}, {0x0013, 0x0000}, {0x0012, 0x0001}, {0x0013, 0x0001}, + { + { 0x0005, 0x0004 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0004, 0x000c }, + { 0x0004, 0x000d }, + { 0x0004, 0x000e }, + { 0x0004, 0x000f }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0003 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0001 }, + { 0x000f, 0x0002 }, + { 0x000f, 0x0003 }, + { 0x0010, 0x0001 }, + { 0x0011, 0x0001 }, + { 0x0013, 0x0000 }, + { 0x0012, 0x0001 }, + { 0x0013, 0x0001 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec24[17][16] = -{ - {0x0008ffff, 0x0009ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007, }, - {0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x000cffff, 0x000affff, 0x000bffff, 0x0000001d, 0x0000001e, 0x0000001f, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, }, - {0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, - {0x000fffff, 0x000dffff, 0x000effff, 0x00000028, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, - {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x0010ffff, 0x00000032, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, - {0x00010034, 0x00010034, 0x00010036, 0x00010036, 0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, +const uint32_t c_aauiCQMFHuffDec24[17][16] = { + { + 0x0008ffff, + 0x0009ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x00000001, + 0x00000002, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + }, + { + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x000cffff, + 0x000affff, + 0x000bffff, + 0x0000001d, + 0x0000001e, + 0x0000001f, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + }, + { + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + }, + { + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + }, + { + 0x000fffff, + 0x000dffff, + 0x000effff, + 0x00000028, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + }, + { + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + }, + { + 0x0010ffff, + 0x00000032, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + }, + { + 0x00010034, + 0x00010034, + 0x00010036, + 0x00010036, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, }; #endif @@ -1837,41 +18290,419 @@ const uint32_t c_aauiCQMFHuffEnc25[65][2] = #else const uint16_t c_aauiCQMFHuffEnc25[65][2] = #endif -{ - {0x0005, 0x0005}, {0x0004, 0x000c}, {0x0004, 0x000d}, {0x0004, 0x000e}, {0x0005, 0x0006}, {0x0004, 0x000f}, {0x0005, 0x0007}, {0x0005, 0x0008}, - {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, - {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0006, 0x0004}, - {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0003}, {0x0007, 0x0004}, {0x0007, 0x0005}, - {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, - {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0002}, {0x000c, 0x0003}, - {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0003}, {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000f, 0x0003}, {0x000e, 0x0005}, {0x000f, 0x0004}, - {0x0010, 0x0001}, {0x000f, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0011, 0x0001}, {0x0012, 0x0000}, - {0x0012, 0x0001}, + { + { 0x0005, 0x0005 }, + { 0x0004, 0x000c }, + { 0x0004, 0x000d }, + { 0x0004, 0x000e }, + { 0x0005, 0x0006 }, + { 0x0004, 0x000f }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0005, 0x0012 }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0005, 0x0015 }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000d, 0x0003 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000f, 0x0003 }, + { 0x000e, 0x0005 }, + { 0x000f, 0x0004 }, + { 0x0010, 0x0001 }, + { 0x000f, 0x0005 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0011, 0x0001 }, + { 0x0012, 0x0000 }, + { 0x0012, 0x0001 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec25[19][16] = -{ - {0x000cffff, 0x000bffff, 0x0002ffff, 0x0001ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x00000001, 0x00000002, 0x00000003, 0x00000005, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x000fffff, 0x000dffff, 0x000effff, 0x00000022, 0x00000023, 0x00000024, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, - {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, - {0x0011ffff, 0x0010ffff, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020028, 0x00020028, 0x00020028, 0x00020028, }, - {0x00020034, 0x00020034, 0x00020034, 0x00020034, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x0012ffff, 0x00000038, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010037, 0x00010037, 0x00010039, 0x00010039, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, - {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, +const uint32_t c_aauiCQMFHuffDec25[19][16] = { + { + 0x000cffff, + 0x000bffff, + 0x0002ffff, + 0x0001ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x00000001, + 0x00000002, + 0x00000003, + 0x00000005, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + }, + { + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x000fffff, + 0x000dffff, + 0x000effff, + 0x00000022, + 0x00000023, + 0x00000024, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + }, + { + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + }, + { + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + }, + { + 0x0011ffff, + 0x0010ffff, + 0x0000002e, + 0x0000002f, + 0x00000030, + 0x00000031, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + }, + { + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + }, + { + 0x0012ffff, + 0x00000038, + 0x0000003a, + 0x0000003b, + 0x0000003c, + 0x0000003d, + 0x00010035, + 0x00010035, + 0x00010037, + 0x00010037, + 0x00010039, + 0x00010039, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + }, + { + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, }; #endif @@ -1880,49 +18711,557 @@ const uint32_t c_aauiCQMFHuffEnc26[77][2] = #else const uint16_t c_aauiCQMFHuffEnc26[77][2] = #endif -{ - {0x0006, 0x0004}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, - {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, - {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, - {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, - {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0004}, - {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, - {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, - {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000e, 0x0002}, {0x000d, 0x0005}, {0x000e, 0x0003}, {0x000e, 0x0004}, - {0x000f, 0x0003}, {0x000e, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0011, 0x0002}, {0x0012, 0x0001}, {0x0010, 0x0005}, - {0x0012, 0x0002}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, + { + { 0x0006, 0x0004 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0005, 0x0012 }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0005, 0x0015 }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0005, 0x0018 }, + { 0x0005, 0x0019 }, + { 0x0005, 0x001a }, + { 0x0005, 0x001b }, + { 0x0005, 0x001c }, + { 0x0005, 0x001d }, + { 0x0005, 0x001e }, + { 0x0005, 0x001f }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000a, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x000e, 0x0002 }, + { 0x000d, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000f, 0x0003 }, + { 0x000e, 0x0005 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0010, 0x0004 }, + { 0x0011, 0x0002 }, + { 0x0012, 0x0001 }, + { 0x0010, 0x0005 }, + { 0x0012, 0x0002 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0003 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec26[26][16] = -{ - {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, - {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x0017ffff, 0x0015ffff, 0x0016ffff, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00000039, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, - {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, }, - {0x0019ffff, 0x0018ffff, 0x00000042, 0x00000043, 0x00000044, 0x00000047, 0x00010040, 0x00010040, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, }, - {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, +const uint32_t c_aauiCQMFHuffDec26[26][16] = { + { + 0x0010ffff, + 0x000effff, + 0x000fffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + }, + { + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, + { + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + }, + { + 0x0014ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x00000027, + 0x00000028, + 0x00000029, + 0x0000002a, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + }, + { + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020032, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, + { + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x0017ffff, + 0x0015ffff, + 0x0016ffff, + 0x00000035, + 0x00000036, + 0x00000037, + 0x00000038, + 0x00000039, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + }, + { + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + }, + { + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + }, + { + 0x0019ffff, + 0x0018ffff, + 0x00000042, + 0x00000043, + 0x00000044, + 0x00000047, + 0x00010040, + 0x00010040, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + }, + { + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + }, + { + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + }, }; #endif @@ -1931,53 +19270,607 @@ const uint32_t c_aauiCQMFHuffEnc27[91][2] = #else const uint16_t c_aauiCQMFHuffEnc27[91][2] = #endif -{ - {0x0006, 0x0006}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, - {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, - {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, {0x0005, 0x001f}, {0x0006, 0x0007}, {0x0006, 0x0008}, - {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, - {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, - {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, - {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0004}, {0x000a, 0x0005}, - {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, - {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0003}, {0x000e, 0x0004}, - {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000f, 0x0003}, {0x000f, 0x0004}, {0x0010, 0x0003}, {0x000f, 0x0005}, {0x0012, 0x0000}, - {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0011, 0x0004}, {0x0011, 0x0005}, {0x0012, 0x0003}, {0x0012, 0x0004}, - {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + { + { 0x0006, 0x0006 }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0005, 0x0012 }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0005, 0x0015 }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0005, 0x0018 }, + { 0x0005, 0x0019 }, + { 0x0005, 0x001a }, + { 0x0005, 0x001b }, + { 0x0005, 0x001c }, + { 0x0005, 0x001d }, + { 0x0005, 0x001e }, + { 0x0005, 0x001f }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000e, 0x0006 }, + { 0x000e, 0x0007 }, + { 0x000f, 0x0003 }, + { 0x000f, 0x0004 }, + { 0x0010, 0x0003 }, + { 0x000f, 0x0005 }, + { 0x0012, 0x0000 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0011, 0x0004 }, + { 0x0011, 0x0005 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec27[28][16] = -{ - {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, - {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, - {0x0014ffff, 0x0013ffff, 0x0011ffff, 0x0012ffff, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x0017ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, - {0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, }, - {0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x001affff, 0x001bffff, 0x0019ffff, 0x0000004d, 0x00000050, 0x00000051, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004e, 0x0001004e, 0x00020046, 0x00020046, 0x00020046, 0x00020046, }, - {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, - {0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, +const uint32_t c_aauiCQMFHuffDec27[28][16] = { + { + 0x0010ffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + }, + { + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + }, + { + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + }, + { + 0x0014ffff, + 0x0013ffff, + 0x0011ffff, + 0x0012ffff, + 0x0000002c, + 0x0000002d, + 0x0000002e, + 0x0000002f, + 0x00000030, + 0x00000031, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x0017ffff, + 0x0018ffff, + 0x0015ffff, + 0x0016ffff, + 0x0000003e, + 0x0000003f, + 0x00000040, + 0x00000041, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + }, + { + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + }, + { + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + }, + { + 0x001affff, + 0x001bffff, + 0x0019ffff, + 0x0000004d, + 0x00000050, + 0x00000051, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004e, + 0x0001004e, + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020046, + }, + { + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + }, + { + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + }, + { + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + }, + { + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + }, }; #endif @@ -1986,57 +19879,661 @@ const uint32_t c_aauiCQMFHuffEnc28[109][2] = #else const uint16_t c_aauiCQMFHuffEnc28[109][2] = #endif -{ - {0x0006, 0x0008}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0005, 0x0012}, {0x0005, 0x0013}, {0x0005, 0x0014}, {0x0005, 0x0015}, {0x0005, 0x0016}, - {0x0005, 0x0017}, {0x0005, 0x0018}, {0x0005, 0x0019}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0005, 0x001d}, {0x0005, 0x001e}, - {0x0006, 0x0009}, {0x0005, 0x001f}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, - {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, - {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, - {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, - {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x000a, 0x0005}, - {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0004}, - {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, - {0x000d, 0x0007}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x0010, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0005}, - {0x000f, 0x0006}, {0x000f, 0x0007}, {0x0010, 0x0006}, {0x0011, 0x0006}, {0x0010, 0x0007}, {0x0013, 0x0000}, {0x0010, 0x0008}, {0x0010, 0x0009}, - {0x0013, 0x0001}, {0x0011, 0x0007}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, - {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, + { + { 0x0006, 0x0008 }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0005, 0x0012 }, + { 0x0005, 0x0013 }, + { 0x0005, 0x0014 }, + { 0x0005, 0x0015 }, + { 0x0005, 0x0016 }, + { 0x0005, 0x0017 }, + { 0x0005, 0x0018 }, + { 0x0005, 0x0019 }, + { 0x0005, 0x001a }, + { 0x0005, 0x001b }, + { 0x0005, 0x001c }, + { 0x0005, 0x001d }, + { 0x0005, 0x001e }, + { 0x0006, 0x0009 }, + { 0x0005, 0x001f }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0006, 0x0018 }, + { 0x0006, 0x0019 }, + { 0x0006, 0x001a }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0006, 0x001e }, + { 0x0006, 0x001f }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000e, 0x0006 }, + { 0x000e, 0x0007 }, + { 0x0010, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x0010, 0x0005 }, + { 0x000f, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x0010, 0x0006 }, + { 0x0011, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0013, 0x0000 }, + { 0x0010, 0x0008 }, + { 0x0010, 0x0009 }, + { 0x0013, 0x0001 }, + { 0x0011, 0x0007 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec28[30][16] = -{ - {0x000fffff, 0x0010ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, }, - {0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, - {0x0015ffff, 0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x00000032, 0x00000033, 0x00000034, 0x00000035, 0x00000036, 0x00000037, 0x00000038, 0x00010028, 0x00010028, 0x00010029, 0x00010029, }, - {0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, - {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, - {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, }, - {0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, - {0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004d, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, - {0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020054, 0x00020054, 0x00020054, 0x00020054, }, - {0x001bffff, 0x001cffff, 0x001dffff, 0x001affff, 0x00000055, 0x00000057, 0x0000005a, 0x0000005c, 0x0000005e, 0x0000005f, 0x00010056, 0x00010056, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, - {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, 0x00030061, }, - {0x0001005d, 0x0001005d, 0x00010060, 0x00010060, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, - {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, - {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, +const uint32_t c_aauiCQMFHuffDec28[30][16] = { + { + 0x000fffff, + 0x0010ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + }, + { + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + }, + { + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + }, + { + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + }, + { + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + }, + { + 0x0015ffff, + 0x0014ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x00000032, + 0x00000033, + 0x00000034, + 0x00000035, + 0x00000036, + 0x00000037, + 0x00000038, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + }, + { + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + }, + { + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + }, + { + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + }, + { + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + }, + { + 0x0019ffff, + 0x0018ffff, + 0x0016ffff, + 0x0017ffff, + 0x00000047, + 0x00000048, + 0x00000049, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + }, + { + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004d, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + }, + { + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + }, + { + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020054, + 0x00020054, + 0x00020054, + 0x00020054, + }, + { + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001affff, + 0x00000055, + 0x00000057, + 0x0000005a, + 0x0000005c, + 0x0000005e, + 0x0000005f, + 0x00010056, + 0x00010056, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + }, + { + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + 0x00030061, + }, + { + 0x0001005d, + 0x0001005d, + 0x00010060, + 0x00010060, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + }, + { + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020068, + 0x00020068, + 0x00020068, + 0x00020068, + }, + { + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + }, }; #endif @@ -2045,64 +20542,753 @@ const uint32_t c_aauiCQMFHuffEnc29[129][2] = #else const uint16_t c_aauiCQMFHuffEnc29[129][2] = #endif -{ - {0x0006, 0x0009}, {0x0005, 0x0019}, {0x0006, 0x000a}, {0x0005, 0x001a}, {0x0005, 0x001b}, {0x0005, 0x001c}, {0x0006, 0x000b}, {0x0005, 0x001d}, - {0x0005, 0x001e}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0005, 0x001f}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, - {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, - {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, - {0x0006, 0x0022}, {0x0006, 0x0023}, {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, - {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, - {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, - {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, - {0x0009, 0x000b}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, - {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, - {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, - {0x000d, 0x000b}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, - {0x000f, 0x0007}, {0x0011, 0x0007}, {0x000f, 0x0008}, {0x0012, 0x0000}, {0x000f, 0x0009}, {0x0010, 0x0005}, {0x000f, 0x000a}, {0x000f, 0x000b}, - {0x0012, 0x0001}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, - {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0011, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, - {0x0011, 0x0009}, + { + { 0x0006, 0x0009 }, + { 0x0005, 0x0019 }, + { 0x0006, 0x000a }, + { 0x0005, 0x001a }, + { 0x0005, 0x001b }, + { 0x0005, 0x001c }, + { 0x0006, 0x000b }, + { 0x0005, 0x001d }, + { 0x0005, 0x001e }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0005, 0x001f }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0006, 0x0018 }, + { 0x0006, 0x0019 }, + { 0x0006, 0x001a }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0006, 0x001e }, + { 0x0006, 0x001f }, + { 0x0006, 0x0020 }, + { 0x0006, 0x0021 }, + { 0x0006, 0x0022 }, + { 0x0006, 0x0023 }, + { 0x0006, 0x0024 }, + { 0x0006, 0x0025 }, + { 0x0006, 0x0026 }, + { 0x0006, 0x0027 }, + { 0x0006, 0x0028 }, + { 0x0006, 0x0029 }, + { 0x0006, 0x002a }, + { 0x0006, 0x002b }, + { 0x0006, 0x002c }, + { 0x0006, 0x002d }, + { 0x0006, 0x002e }, + { 0x0006, 0x002f }, + { 0x0006, 0x0030 }, + { 0x0006, 0x0031 }, + { 0x0007, 0x0007 }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000e, 0x0006 }, + { 0x000e, 0x0007 }, + { 0x000e, 0x0008 }, + { 0x000e, 0x0009 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x000f, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x0011, 0x0007 }, + { 0x000f, 0x0008 }, + { 0x0012, 0x0000 }, + { 0x000f, 0x0009 }, + { 0x0010, 0x0005 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x0012, 0x0001 }, + { 0x0010, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0011, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, + { 0x0011, 0x0009 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec29[34][16] = -{ - {0x000fffff, 0x0010ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, }, - {0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, 0x00030001, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020006, 0x00020006, 0x00020006, 0x00020006, }, - {0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, }, - {0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, }, - {0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, }, - {0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, - {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, }, - {0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, }, - {0x0016ffff, 0x0014ffff, 0x0015ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0000003b, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00010030, 0x00010030, }, - {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, }, - {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, - {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, - {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, }, - {0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004e, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, - {0x001cffff, 0x001bffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x00000054, 0x00000055, 0x00000056, 0x00000057, 0x00000058, 0x00000059, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, - {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, - {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, - {0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, }, - {0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, - {0x0001006a, 0x0001006a, 0x0001006c, 0x0001006c, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, - {0x001fffff, 0x0020ffff, 0x0021ffff, 0x001dffff, 0x001effff, 0x0000006d, 0x00000071, 0x00000072, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, }, - {0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, - {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, }, - {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, - {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, - {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, }, +const uint32_t c_aauiCQMFHuffDec29[34][16] = { + { + 0x000fffff, + 0x0010ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + }, + { + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + 0x00030001, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + }, + { + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + }, + { + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + }, + { + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + }, + { + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + }, + { + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + }, + { + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + }, + { + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + }, + { + 0x0016ffff, + 0x0014ffff, + 0x0015ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0000003b, + 0x0000003c, + 0x0000003d, + 0x0000003e, + 0x0000003f, + 0x00000040, + 0x00000041, + 0x00000042, + 0x00010030, + 0x00010030, + }, + { + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + }, + { + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + }, + { + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + }, + { + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + }, + { + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004b, + }, + { + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004e, + 0x0002004e, + 0x0002004e, + 0x0002004e, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + }, + { + 0x001cffff, + 0x001bffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x00000054, + 0x00000055, + 0x00000056, + 0x00000057, + 0x00000058, + 0x00000059, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + }, + { + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + }, + { + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + }, + { + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + }, + { + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + }, + { + 0x0001006a, + 0x0001006a, + 0x0001006c, + 0x0001006c, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + }, + { + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x001dffff, + 0x001effff, + 0x0000006d, + 0x00000071, + 0x00000072, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + }, + { + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + }, + { + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + }, + { + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + }, + { + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + }, + { + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007d, + }, }; #endif @@ -2111,72 +21297,867 @@ const uint32_t c_aauiCQMFHuffEnc30[153][2] = #else const uint16_t c_aauiCQMFHuffEnc30[153][2] = #endif -{ - {0x0007, 0x0009}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0006, 0x0014}, - {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, {0x0006, 0x001c}, - {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, {0x0006, 0x0023}, {0x0006, 0x0024}, - {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, {0x0006, 0x002c}, - {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, {0x0006, 0x0032}, {0x0006, 0x0033}, {0x0006, 0x0034}, - {0x0006, 0x0035}, {0x0006, 0x0036}, {0x0006, 0x0037}, {0x0006, 0x0038}, {0x0006, 0x0039}, {0x0006, 0x003a}, {0x0006, 0x003b}, {0x0006, 0x003c}, - {0x0006, 0x003d}, {0x0006, 0x003e}, {0x0006, 0x003f}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, - {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, - {0x0007, 0x0017}, {0x0007, 0x0018}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0007, 0x001b}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0009, 0x0007}, - {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x000a, 0x0008}, - {0x0009, 0x000f}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x0007}, {0x000b, 0x0008}, - {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x0008}, {0x000b, 0x000e}, {0x000b, 0x000f}, - {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000d, 0x0008}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000d, 0x0009}, {0x000c, 0x000d}, {0x000d, 0x000a}, - {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000e, 0x0008}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000e, 0x0009}, {0x000e, 0x000a}, - {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000f, 0x0006}, {0x000f, 0x0007}, {0x000f, 0x0008}, {0x0010, 0x0006}, {0x000e, 0x000d}, {0x000e, 0x000e}, - {0x000e, 0x000f}, {0x0010, 0x0007}, {0x000f, 0x0009}, {0x0010, 0x0008}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, - {0x0010, 0x0009}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, {0x000f, 0x000e}, {0x0010, 0x000a}, {0x0011, 0x0003}, {0x0011, 0x0004}, - {0x0011, 0x0005}, {0x000f, 0x000f}, {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0011, 0x000a}, {0x0011, 0x000b}, - {0x0010, 0x000b}, + { + { 0x0007, 0x0009 }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0006, 0x0018 }, + { 0x0006, 0x0019 }, + { 0x0006, 0x001a }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0006, 0x001e }, + { 0x0006, 0x001f }, + { 0x0006, 0x0020 }, + { 0x0006, 0x0021 }, + { 0x0006, 0x0022 }, + { 0x0006, 0x0023 }, + { 0x0006, 0x0024 }, + { 0x0006, 0x0025 }, + { 0x0006, 0x0026 }, + { 0x0006, 0x0027 }, + { 0x0006, 0x0028 }, + { 0x0006, 0x0029 }, + { 0x0006, 0x002a }, + { 0x0006, 0x002b }, + { 0x0006, 0x002c }, + { 0x0006, 0x002d }, + { 0x0006, 0x002e }, + { 0x0006, 0x002f }, + { 0x0006, 0x0030 }, + { 0x0006, 0x0031 }, + { 0x0006, 0x0032 }, + { 0x0006, 0x0033 }, + { 0x0006, 0x0034 }, + { 0x0006, 0x0035 }, + { 0x0006, 0x0036 }, + { 0x0006, 0x0037 }, + { 0x0006, 0x0038 }, + { 0x0006, 0x0039 }, + { 0x0006, 0x003a }, + { 0x0006, 0x003b }, + { 0x0006, 0x003c }, + { 0x0006, 0x003d }, + { 0x0006, 0x003e }, + { 0x0006, 0x003f }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0007, 0x0012 }, + { 0x0007, 0x0013 }, + { 0x0007, 0x0014 }, + { 0x0007, 0x0015 }, + { 0x0007, 0x0016 }, + { 0x0007, 0x0017 }, + { 0x0007, 0x0018 }, + { 0x0007, 0x0019 }, + { 0x0007, 0x001a }, + { 0x0007, 0x001b }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0008, 0x0010 }, + { 0x0008, 0x0011 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x0009, 0x000c }, + { 0x0009, 0x000d }, + { 0x0009, 0x000e }, + { 0x000a, 0x0008 }, + { 0x0009, 0x000f }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000b, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000b, 0x000a }, + { 0x000b, 0x000b }, + { 0x000b, 0x000c }, + { 0x000b, 0x000d }, + { 0x000c, 0x0008 }, + { 0x000b, 0x000e }, + { 0x000b, 0x000f }, + { 0x000c, 0x0009 }, + { 0x000c, 0x000a }, + { 0x000d, 0x0008 }, + { 0x000c, 0x000b }, + { 0x000c, 0x000c }, + { 0x000d, 0x0009 }, + { 0x000c, 0x000d }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, + { 0x000e, 0x0008 }, + { 0x000d, 0x000e }, + { 0x000d, 0x000f }, + { 0x000e, 0x0009 }, + { 0x000e, 0x000a }, + { 0x000e, 0x000b }, + { 0x000e, 0x000c }, + { 0x000f, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x000f, 0x0008 }, + { 0x0010, 0x0006 }, + { 0x000e, 0x000d }, + { 0x000e, 0x000e }, + { 0x000e, 0x000f }, + { 0x0010, 0x0007 }, + { 0x000f, 0x0009 }, + { 0x0010, 0x0008 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x000f, 0x000c }, + { 0x000f, 0x000d }, + { 0x0010, 0x0009 }, + { 0x0011, 0x0000 }, + { 0x0011, 0x0001 }, + { 0x0011, 0x0002 }, + { 0x000f, 0x000e }, + { 0x0010, 0x000a }, + { 0x0011, 0x0003 }, + { 0x0011, 0x0004 }, + { 0x0011, 0x0005 }, + { 0x000f, 0x000f }, + { 0x0011, 0x0006 }, + { 0x0011, 0x0007 }, + { 0x0011, 0x0008 }, + { 0x0011, 0x0009 }, + { 0x0011, 0x000a }, + { 0x0011, 0x000b }, + { 0x0010, 0x000b }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec30[39][16] = -{ - {0x0010ffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, }, - {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, - {0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, }, - {0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, - {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, - {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, - {0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, - {0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, }, - {0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, 0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, }, - {0x0000004d, 0x0000004e, 0x00010000, 0x00010000, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, }, - {0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, }, - {0x0017ffff, 0x0018ffff, 0x0016ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x00000045, 0x00000046, 0x00000047, 0x00000048, 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, }, - {0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, - {0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, }, - {0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, - {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, - {0x00020057, 0x00020057, 0x00020057, 0x00020057, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, - {0x001fffff, 0x0020ffff, 0x001dffff, 0x001effff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x00000065, 0x00000068, 0x00000069, 0x0000006b, 0x0000006c, 0x0000006e, 0x0001005e, 0x0001005e, }, - {0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, }, - {0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006a, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, 0x0003006d, }, - {0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, - {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, }, - {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, 0x00030075, }, - {0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, - {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, - {0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0000007d, 0x00000081, 0x00000083, 0x00000088, 0x0000008d, 0x00000098, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, }, - {0x0001007c, 0x0001007c, 0x00010082, 0x00010082, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x0001008c, 0x0001008c, 0x00010091, 0x00010091, }, - {0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x00030089, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, - {0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, 0x0003008e, }, - {0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x0003008f, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, }, - {0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, 0x00030093, }, - {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, 0x00030095, }, - {0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030096, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, 0x00030097, }, +const uint32_t c_aauiCQMFHuffDec30[39][16] = { + { + 0x0010ffff, + 0x000effff, + 0x000fffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + }, + { + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + }, + { + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + }, + { + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + }, + { + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + }, + { + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + }, + { + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + }, + { + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + }, + { + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + }, + { + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + }, + { + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020032, + }, + { + 0x0000004d, + 0x0000004e, + 0x00010000, + 0x00010000, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + }, + { + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + }, + { + 0x0017ffff, + 0x0018ffff, + 0x0016ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x00000045, + 0x00000046, + 0x00000047, + 0x00000048, + 0x00000049, + 0x0000004a, + 0x0000004b, + 0x0000004c, + }, + { + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + }, + { + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + }, + { + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + }, + { + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + }, + { + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + }, + { + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020057, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + }, + { + 0x001fffff, + 0x0020ffff, + 0x001dffff, + 0x001effff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x00000065, + 0x00000068, + 0x00000069, + 0x0000006b, + 0x0000006c, + 0x0000006e, + 0x0001005e, + 0x0001005e, + }, + { + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + 0x00010064, + 0x00010064, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + }, + { + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006a, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + 0x0003006d, + }, + { + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + }, + { + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + }, + { + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + 0x00030075, + }, + { + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + }, + { + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + }, + { + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0000007d, + 0x00000081, + 0x00000083, + 0x00000088, + 0x0000008d, + 0x00000098, + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + }, + { + 0x0001007c, + 0x0001007c, + 0x00010082, + 0x00010082, + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + 0x0001008c, + 0x0001008c, + 0x00010091, + 0x00010091, + }, + { + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x00030089, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + }, + { + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + 0x0003008e, + }, + { + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x0003008f, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + }, + { + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + 0x00030093, + }, + { + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + 0x00030095, + }, + { + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030096, + 0x00030097, + 0x00030097, + 0x00030097, + 0x00030097, + 0x00030097, + 0x00030097, + 0x00030097, + 0x00030097, + }, }; #endif @@ -2185,79 +22166,967 @@ const uint32_t c_aauiCQMFHuffEnc31[181][2] = #else const uint16_t c_aauiCQMFHuffEnc31[181][2] = #endif -{ - {0x0007, 0x000b}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0006, 0x0018}, {0x0006, 0x0019}, {0x0006, 0x001a}, {0x0006, 0x001b}, - {0x0006, 0x001c}, {0x0006, 0x001d}, {0x0006, 0x001e}, {0x0006, 0x001f}, {0x0006, 0x0020}, {0x0006, 0x0021}, {0x0006, 0x0022}, {0x0006, 0x0023}, - {0x0006, 0x0024}, {0x0006, 0x0025}, {0x0006, 0x0026}, {0x0006, 0x0027}, {0x0006, 0x0028}, {0x0006, 0x0029}, {0x0006, 0x002a}, {0x0006, 0x002b}, - {0x0006, 0x002c}, {0x0006, 0x002d}, {0x0006, 0x002e}, {0x0006, 0x002f}, {0x0006, 0x0030}, {0x0006, 0x0031}, {0x0006, 0x0032}, {0x0006, 0x0033}, - {0x0006, 0x0034}, {0x0006, 0x0035}, {0x0006, 0x0036}, {0x0006, 0x0037}, {0x0006, 0x0038}, {0x0006, 0x0039}, {0x0006, 0x003a}, {0x0006, 0x003b}, - {0x0006, 0x003c}, {0x0006, 0x003d}, {0x0006, 0x003e}, {0x0007, 0x000c}, {0x0006, 0x003f}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, - {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, {0x0007, 0x0017}, - {0x0007, 0x0018}, {0x0007, 0x0019}, {0x0007, 0x001a}, {0x0007, 0x001b}, {0x0007, 0x001c}, {0x0007, 0x001d}, {0x0007, 0x001e}, {0x0007, 0x001f}, - {0x0007, 0x0020}, {0x0007, 0x0021}, {0x0007, 0x0022}, {0x0007, 0x0023}, {0x0007, 0x0024}, {0x0007, 0x0025}, {0x0007, 0x0026}, {0x0007, 0x0027}, - {0x0007, 0x0028}, {0x0007, 0x0029}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, - {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0008, 0x0012}, {0x0008, 0x0013}, {0x0008, 0x0014}, {0x0008, 0x0015}, {0x0009, 0x0008}, - {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, - {0x0009, 0x0011}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, - {0x000a, 0x000f}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000b, 0x000e}, - {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000b, 0x000f}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000d, 0x0008}, - {0x000c, 0x000e}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000c, 0x000f}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, - {0x000d, 0x000f}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000e, 0x000d}, {0x000e, 0x000e}, - {0x000e, 0x000f}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x0010, 0x0009}, {0x000f, 0x000d}, {0x000f, 0x000e}, - {0x0010, 0x000a}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0011, 0x000a}, {0x0010, 0x000e}, {0x000f, 0x000f}, {0x0010, 0x000f}, - {0x0012, 0x0000}, {0x0012, 0x0001}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x0010, 0x0010}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0011, 0x000d}, - {0x0011, 0x000e}, {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0010, 0x0011}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, - {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, - {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, + { + { 0x0007, 0x000b }, + { 0x0006, 0x0015 }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0006, 0x0018 }, + { 0x0006, 0x0019 }, + { 0x0006, 0x001a }, + { 0x0006, 0x001b }, + { 0x0006, 0x001c }, + { 0x0006, 0x001d }, + { 0x0006, 0x001e }, + { 0x0006, 0x001f }, + { 0x0006, 0x0020 }, + { 0x0006, 0x0021 }, + { 0x0006, 0x0022 }, + { 0x0006, 0x0023 }, + { 0x0006, 0x0024 }, + { 0x0006, 0x0025 }, + { 0x0006, 0x0026 }, + { 0x0006, 0x0027 }, + { 0x0006, 0x0028 }, + { 0x0006, 0x0029 }, + { 0x0006, 0x002a }, + { 0x0006, 0x002b }, + { 0x0006, 0x002c }, + { 0x0006, 0x002d }, + { 0x0006, 0x002e }, + { 0x0006, 0x002f }, + { 0x0006, 0x0030 }, + { 0x0006, 0x0031 }, + { 0x0006, 0x0032 }, + { 0x0006, 0x0033 }, + { 0x0006, 0x0034 }, + { 0x0006, 0x0035 }, + { 0x0006, 0x0036 }, + { 0x0006, 0x0037 }, + { 0x0006, 0x0038 }, + { 0x0006, 0x0039 }, + { 0x0006, 0x003a }, + { 0x0006, 0x003b }, + { 0x0006, 0x003c }, + { 0x0006, 0x003d }, + { 0x0006, 0x003e }, + { 0x0007, 0x000c }, + { 0x0006, 0x003f }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0007, 0x0012 }, + { 0x0007, 0x0013 }, + { 0x0007, 0x0014 }, + { 0x0007, 0x0015 }, + { 0x0007, 0x0016 }, + { 0x0007, 0x0017 }, + { 0x0007, 0x0018 }, + { 0x0007, 0x0019 }, + { 0x0007, 0x001a }, + { 0x0007, 0x001b }, + { 0x0007, 0x001c }, + { 0x0007, 0x001d }, + { 0x0007, 0x001e }, + { 0x0007, 0x001f }, + { 0x0007, 0x0020 }, + { 0x0007, 0x0021 }, + { 0x0007, 0x0022 }, + { 0x0007, 0x0023 }, + { 0x0007, 0x0024 }, + { 0x0007, 0x0025 }, + { 0x0007, 0x0026 }, + { 0x0007, 0x0027 }, + { 0x0007, 0x0028 }, + { 0x0007, 0x0029 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0008, 0x0010 }, + { 0x0008, 0x0011 }, + { 0x0008, 0x0012 }, + { 0x0008, 0x0013 }, + { 0x0008, 0x0014 }, + { 0x0008, 0x0015 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x0009, 0x000c }, + { 0x0009, 0x000d }, + { 0x0009, 0x000e }, + { 0x0009, 0x000f }, + { 0x0009, 0x0010 }, + { 0x0009, 0x0011 }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000a, 0x000e }, + { 0x000a, 0x000f }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000b, 0x000a }, + { 0x000b, 0x000b }, + { 0x000b, 0x000c }, + { 0x000b, 0x000d }, + { 0x000b, 0x000e }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000b, 0x000f }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000c, 0x000c }, + { 0x000c, 0x000d }, + { 0x000d, 0x0008 }, + { 0x000c, 0x000e }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000c, 0x000f }, + { 0x000d, 0x000b }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, + { 0x000d, 0x000e }, + { 0x000d, 0x000f }, + { 0x000e, 0x0008 }, + { 0x000e, 0x0009 }, + { 0x000e, 0x000a }, + { 0x000e, 0x000b }, + { 0x000e, 0x000c }, + { 0x000e, 0x000d }, + { 0x000e, 0x000e }, + { 0x000e, 0x000f }, + { 0x000f, 0x0009 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x000f, 0x000c }, + { 0x0010, 0x0009 }, + { 0x000f, 0x000d }, + { 0x000f, 0x000e }, + { 0x0010, 0x000a }, + { 0x0010, 0x000b }, + { 0x0010, 0x000c }, + { 0x0010, 0x000d }, + { 0x0011, 0x000a }, + { 0x0010, 0x000e }, + { 0x000f, 0x000f }, + { 0x0010, 0x000f }, + { 0x0012, 0x0000 }, + { 0x0012, 0x0001 }, + { 0x0011, 0x000b }, + { 0x0011, 0x000c }, + { 0x0010, 0x0010 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0011, 0x000d }, + { 0x0011, 0x000e }, + { 0x0011, 0x000f }, + { 0x0011, 0x0010 }, + { 0x0011, 0x0011 }, + { 0x0010, 0x0011 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, + { 0x0012, 0x000e }, + { 0x0012, 0x000f }, + { 0x0012, 0x0010 }, + { 0x0012, 0x0011 }, + { 0x0012, 0x0012 }, + { 0x0012, 0x0013 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec31[43][16] = -{ - {0x0010ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, }, - {0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020003, 0x00020003, 0x00020003, 0x00020003, }, - {0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00020007, 0x00020007, 0x00020007, 0x00020007, }, - {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, }, - {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x00000051, 0x00000052, 0x00000053, 0x00000054, 0x00000055, 0x00000056, 0x00010000, 0x00010000, 0x0001002b, 0x0001002b, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, }, - {0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, }, - {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, }, - {0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, - {0x0019ffff, 0x0018ffff, 0x0016ffff, 0x0017ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, }, - {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, - {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, - {0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, - {0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005d, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, 0x0003005e, }, - {0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x0003005f, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, 0x00030060, }, - {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, }, - {0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, - {0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010072, 0x00010072, }, - {0x0021ffff, 0x0020ffff, 0x001effff, 0x001fffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x00000070, 0x00000071, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000078, 0x0000007b, }, - {0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, }, - {0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, 0x0003007c, }, - {0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, }, - {0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x0003007f, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, 0x00030080, }, - {0x00020081, 0x00020081, 0x00020081, 0x00020081, 0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, }, - {0x00020085, 0x00020085, 0x00020085, 0x00020085, 0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, }, - {0x0000009c, 0x000000a4, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010096, 0x00010096, }, - {0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0000008d, 0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000095, 0x00000097, }, - {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, 0x0003009a, }, - {0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009b, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, 0x0003009f, }, - {0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a0, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, 0x000300a1, }, - {0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, - {0x00020098, 0x00020098, 0x00020098, 0x00020098, 0x00020099, 0x00020099, 0x00020099, 0x00020099, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009d, 0x0002009e, 0x0002009e, 0x0002009e, 0x0002009e, }, - {0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, }, - {0x000200a9, 0x000200a9, 0x000200a9, 0x000200a9, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ab, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, }, - {0x000200ad, 0x000200ad, 0x000200ad, 0x000200ad, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200ae, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200b0, 0x000200b0, 0x000200b0, 0x000200b0, }, - {0x000200b1, 0x000200b1, 0x000200b1, 0x000200b1, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b2, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b3, 0x000200b4, 0x000200b4, 0x000200b4, 0x000200b4, }, +const uint32_t c_aauiCQMFHuffDec31[43][16] = { + { + 0x0010ffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + }, + { + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + }, + { + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + }, + { + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + }, + { + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + }, + { + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + }, + { + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + }, + { + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + }, + { + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + }, + { + 0x00000051, + 0x00000052, + 0x00000053, + 0x00000054, + 0x00000055, + 0x00000056, + 0x00010000, + 0x00010000, + 0x0001002b, + 0x0001002b, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + }, + { + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + }, + { + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + }, + { + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + }, + { + 0x0019ffff, + 0x0018ffff, + 0x0016ffff, + 0x0017ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x0000004d, + 0x0000004e, + 0x0000004f, + 0x00000050, + }, + { + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + }, + { + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + }, + { + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + }, + { + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005d, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + 0x0003005e, + }, + { + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x0003005f, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + 0x00030060, + }, + { + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + }, + { + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020068, + 0x00020068, + 0x00020068, + 0x00020068, + }, + { + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + 0x0001006c, + 0x0001006c, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010072, + 0x00010072, + }, + { + 0x0021ffff, + 0x0020ffff, + 0x001effff, + 0x001fffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x00000070, + 0x00000071, + 0x00000073, + 0x00000074, + 0x00000075, + 0x00000076, + 0x00000078, + 0x0000007b, + }, + { + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + }, + { + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + 0x0003007c, + }, + { + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + }, + { + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x0003007f, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + 0x00030080, + }, + { + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020084, + }, + { + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + }, + { + 0x0000009c, + 0x000000a4, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + 0x0001008b, + 0x0001008b, + 0x0001008c, + 0x0001008c, + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x00010096, + 0x00010096, + }, + { + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0000008d, + 0x00000090, + 0x00000091, + 0x00000092, + 0x00000093, + 0x00000095, + 0x00000097, + }, + { + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + 0x0003009a, + }, + { + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009b, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + 0x0003009f, + }, + { + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a0, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + 0x000300a1, + }, + { + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + }, + { + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020098, + 0x00020099, + 0x00020099, + 0x00020099, + 0x00020099, + 0x0002009d, + 0x0002009d, + 0x0002009d, + 0x0002009d, + 0x0002009e, + 0x0002009e, + 0x0002009e, + 0x0002009e, + }, + { + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + }, + { + 0x000200a9, + 0x000200a9, + 0x000200a9, + 0x000200a9, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ab, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ac, + }, + { + 0x000200ad, + 0x000200ad, + 0x000200ad, + 0x000200ad, + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200ae, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200b0, + 0x000200b0, + 0x000200b0, + 0x000200b0, + }, + { + 0x000200b1, + 0x000200b1, + 0x000200b1, + 0x000200b1, + 0x000200b2, + 0x000200b2, + 0x000200b2, + 0x000200b2, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b3, + 0x000200b4, + 0x000200b4, + 0x000200b4, + 0x000200b4, + }, }; #endif @@ -2266,16 +23135,63 @@ const uint32_t c_aauiCQMFHuffEnc33[16][2] = #else const uint16_t c_aauiCQMFHuffEnc33[16][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, - {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, -}; + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0008, 0x0000 }, + { 0x0008, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec33[2][16] = -{ - {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +const uint32_t c_aauiCQMFHuffDec33[2][16] = { + { + 0x0001ffff, + 0x00000005, + 0x00010001, + 0x00010001, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00000002, + 0x00000003, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, }; #endif @@ -2284,16 +23200,63 @@ const uint32_t c_aauiCQMFHuffEnc34[16][2] = #else const uint16_t c_aauiCQMFHuffEnc34[16][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0008, 0x0000}, {0x0008, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0008, 0x0002}, {0x0008, 0x0003}, - {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, -}; + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0008, 0x0000 }, + { 0x0008, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec34[2][16] = -{ - {0x0001ffff, 0x00000005, 0x00010001, 0x00010001, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00000002, 0x00000003, 0x00000006, 0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +const uint32_t c_aauiCQMFHuffDec34[2][16] = { + { + 0x0001ffff, + 0x00000005, + 0x00010001, + 0x00010001, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00000002, + 0x00000003, + 0x00000006, + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, }; #endif @@ -2302,26 +23265,199 @@ const uint32_t c_aauiCQMFHuffEnc35[25][2] = #else const uint16_t c_aauiCQMFHuffEnc35[25][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0007, 0x0006}, {0x0009, 0x0000}, {0x0009, 0x0001}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0009, 0x0002}, - {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0007, 0x0007}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, - {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0007, 0x0006 }, + { 0x0009, 0x0000 }, + { 0x0009, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0007, 0x0007 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x0009, 0x000c }, + { 0x0009, 0x000d }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec35[9][16] = -{ - {0x0001ffff, 0x00000006, 0x00010001, 0x00010001, 0x00020005, 0x00020005, 0x00020005, 0x00020005, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0007ffff, 0x0008ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0006ffff, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, 0x00010002, 0x00010002, 0x0001000a, 0x0001000a, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, +const uint32_t c_aauiCQMFHuffDec35[9][16] = { + { + 0x0001ffff, + 0x00000006, + 0x00010001, + 0x00010001, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0007ffff, + 0x0008ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0006ffff, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000018, + 0x00010002, + 0x00010002, + 0x0001000a, + 0x0001000a, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, }; #endif @@ -2330,25 +23466,174 @@ const uint32_t c_aauiCQMFHuffEnc36[36][2] = #else const uint16_t c_aauiCQMFHuffEnc36[36][2] = #endif -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0002}, {0x000b, 0x0000}, {0x000b, 0x0001}, {0x000b, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, - {0x0008, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0003}, {0x000b, 0x0006}, {0x000b, 0x0007}, - {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000b, 0x000e}, {0x000b, 0x000f}, - {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, {0x000a, 0x000f}, - {0x000a, 0x0010}, {0x000a, 0x0011}, {0x000a, 0x0012}, {0x000a, 0x0013}, + { + { 0x0001, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0006, 0x0002 }, + { 0x000b, 0x0000 }, + { 0x000b, 0x0001 }, + { 0x000b, 0x0002 }, + { 0x0003, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0008, 0x0005 }, + { 0x000b, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0003 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000b, 0x000a }, + { 0x000b, 0x000b }, + { 0x000b, 0x000c }, + { 0x000b, 0x000d }, + { 0x000b, 0x000e }, + { 0x000b, 0x000f }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000a, 0x000e }, + { 0x000a, 0x000f }, + { 0x000a, 0x0010 }, + { 0x000a, 0x0011 }, + { 0x000a, 0x0012 }, + { 0x000a, 0x0013 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec36[7][16] = -{ - {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0006ffff, 0x0005ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000008, 0x0001000d, 0x0001000d, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, - {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, }, - {0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, }, - {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, }, - {0x00010003, 0x00010003, 0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, +const uint32_t c_aauiCQMFHuffDec36[7][16] = { + { + 0x0001ffff, + 0x00000007, + 0x00010006, + 0x00010006, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x00000008, + 0x0001000d, + 0x0001000d, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + }, + { + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + }, + { + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + }, + { + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + }, + { + 0x00010003, + 0x00010003, + 0x00010004, + 0x00010004, + 0x00010005, + 0x00010005, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, }; #endif @@ -2357,22 +23642,120 @@ const uint32_t c_aauiCQMFHuffEnc37[36][2] = #else const uint16_t c_aauiCQMFHuffEnc37[36][2] = #endif -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0000}, {0x000c, 0x0001}, {0x000c, 0x0002}, {0x0003, 0x0001}, {0x0004, 0x0001}, - {0x0006, 0x0002}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x000a, 0x0007}, {0x000c, 0x0006}, - {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000c, 0x000e}, - {0x000c, 0x000f}, {0x000c, 0x0010}, {0x000c, 0x0011}, {0x000c, 0x0012}, {0x000c, 0x0013}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000c, 0x0016}, - {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000b, 0x000d}, + { + { 0x0001, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000c, 0x0000 }, + { 0x000c, 0x0001 }, + { 0x000c, 0x0002 }, + { 0x0003, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0006, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0007 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000c, 0x000c }, + { 0x000c, 0x000d }, + { 0x000c, 0x000e }, + { 0x000c, 0x000f }, + { 0x000c, 0x0010 }, + { 0x000c, 0x0011 }, + { 0x000c, 0x0012 }, + { 0x000c, 0x0013 }, + { 0x000c, 0x0014 }, + { 0x000c, 0x0015 }, + { 0x000c, 0x0016 }, + { 0x000c, 0x0017 }, + { 0x000c, 0x0018 }, + { 0x000c, 0x0019 }, + { 0x000b, 0x000d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec37[4][16] = -{ - {0x0001ffff, 0x00000007, 0x00010006, 0x00010006, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x0001000d, 0x0001000d, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, - {0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00010023, 0x00010023, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x00000003, 0x00000004, 0x00000005, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000f, 0x00000010, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x00000015, 0x00000016, 0x00000017, 0x00000018, }, +const uint32_t c_aauiCQMFHuffDec37[4][16] = { + { + 0x0001ffff, + 0x00000007, + 0x00010006, + 0x00010006, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0002ffff, + 0x0001000d, + 0x0001000d, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + }, + { + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x0000001d, + 0x0000001e, + 0x0000001f, + 0x00000020, + 0x00000021, + 0x00000022, + 0x00010023, + 0x00010023, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + }, + { + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x0000000f, + 0x00000010, + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000014, + 0x00000015, + 0x00000016, + 0x00000017, + 0x00000018, + }, }; #endif @@ -2381,42 +23764,457 @@ const uint32_t c_aauiCQMFHuffEnc38[49][2] = #else const uint16_t c_aauiCQMFHuffEnc38[49][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000c, 0x0012}, {0x000d, 0x0000}, {0x000d, 0x0001}, {0x000d, 0x0002}, {0x0002, 0x0001}, - {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000b, 0x000a}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x0006, 0x0002}, {0x0006, 0x0003}, - {0x0009, 0x0003}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000c, 0x0013}, {0x000b, 0x000b}, {0x000d, 0x000a}, - {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, {0x000d, 0x000f}, {0x000d, 0x0010}, {0x000d, 0x0011}, {0x000d, 0x0012}, - {0x000d, 0x0013}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000d, 0x0016}, {0x000d, 0x0017}, {0x000d, 0x0018}, {0x000d, 0x0019}, {0x000d, 0x001a}, - {0x000d, 0x001b}, {0x000d, 0x001c}, {0x000d, 0x001d}, {0x000d, 0x001e}, {0x000d, 0x001f}, {0x000d, 0x0020}, {0x000d, 0x0021}, {0x000d, 0x0022}, - {0x000d, 0x0023}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000c, 0x0012 }, + { 0x000d, 0x0000 }, + { 0x000d, 0x0001 }, + { 0x000d, 0x0002 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000b, 0x000a }, + { 0x000d, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0009, 0x0003 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000c, 0x0013 }, + { 0x000b, 0x000b }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, + { 0x000d, 0x000e }, + { 0x000d, 0x000f }, + { 0x000d, 0x0010 }, + { 0x000d, 0x0011 }, + { 0x000d, 0x0012 }, + { 0x000d, 0x0013 }, + { 0x000d, 0x0014 }, + { 0x000d, 0x0015 }, + { 0x000d, 0x0016 }, + { 0x000d, 0x0017 }, + { 0x000d, 0x0018 }, + { 0x000d, 0x0019 }, + { 0x000d, 0x001a }, + { 0x000d, 0x001b }, + { 0x000d, 0x001c }, + { 0x000d, 0x001d }, + { 0x000d, 0x001e }, + { 0x000d, 0x001f }, + { 0x000d, 0x0020 }, + { 0x000d, 0x0021 }, + { 0x000d, 0x0022 }, + { 0x000d, 0x0023 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec38[22][16] = -{ - {0x0001ffff, 0x00000008, 0x00010001, 0x00010001, 0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x00010009, 0x00010009, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x0014ffff, 0x0015ffff, 0x00000003, 0x00000015, 0x0001000a, 0x0001000a, 0x00010016, 0x00010016, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x0005ffff, 0x0006ffff, 0x0004ffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, - {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, +const uint32_t c_aauiCQMFHuffDec38[22][16] = { + { + 0x0001ffff, + 0x00000008, + 0x00010001, + 0x00010001, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0002ffff, + 0x00010009, + 0x00010009, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + }, + { + 0x0014ffff, + 0x0015ffff, + 0x00000003, + 0x00000015, + 0x0001000a, + 0x0001000a, + 0x00010016, + 0x00010016, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x0005ffff, + 0x0006ffff, + 0x0004ffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + }, + { + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + }, + { + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + }, + { + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + }, + { + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + }, }; #endif @@ -2425,32 +24223,291 @@ const uint32_t c_aauiCQMFHuffEnc39[64][2] = #else const uint16_t c_aauiCQMFHuffEnc39[64][2] = #endif -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000a, 0x0002}, {0x000f, 0x0000}, {0x000f, 0x0001}, {0x000f, 0x0002}, {0x000f, 0x0003}, - {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, {0x000f, 0x0007}, - {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0009, 0x0003}, {0x000d, 0x000e}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, - {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000d, 0x000f}, {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x000f, 0x000f}, {0x000f, 0x0010}, - {0x000f, 0x0011}, {0x000f, 0x0012}, {0x000f, 0x0013}, {0x000f, 0x0014}, {0x000f, 0x0015}, {0x000f, 0x0016}, {0x000f, 0x0017}, {0x000f, 0x0018}, - {0x000f, 0x0019}, {0x000f, 0x001a}, {0x000f, 0x001b}, {0x000f, 0x001c}, {0x000f, 0x001d}, {0x000f, 0x001e}, {0x000f, 0x001f}, {0x000f, 0x0020}, - {0x000f, 0x0021}, {0x000f, 0x0022}, {0x000f, 0x0023}, {0x000f, 0x0024}, {0x000f, 0x0025}, {0x000f, 0x0026}, {0x000f, 0x0027}, {0x000f, 0x0028}, - {0x000f, 0x0029}, {0x000e, 0x0015}, {0x000e, 0x0016}, {0x000e, 0x0017}, {0x000e, 0x0018}, {0x000e, 0x0019}, {0x000e, 0x001a}, {0x000e, 0x001b}, -}; + { + { 0x0001, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000a, 0x0002 }, + { 0x000f, 0x0000 }, + { 0x000f, 0x0001 }, + { 0x000f, 0x0002 }, + { 0x000f, 0x0003 }, + { 0x0003, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0003 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x000f, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0009, 0x0003 }, + { 0x000d, 0x000e }, + { 0x000f, 0x0008 }, + { 0x000f, 0x0009 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000d, 0x000f }, + { 0x000f, 0x000c }, + { 0x000f, 0x000d }, + { 0x000f, 0x000e }, + { 0x000f, 0x000f }, + { 0x000f, 0x0010 }, + { 0x000f, 0x0011 }, + { 0x000f, 0x0012 }, + { 0x000f, 0x0013 }, + { 0x000f, 0x0014 }, + { 0x000f, 0x0015 }, + { 0x000f, 0x0016 }, + { 0x000f, 0x0017 }, + { 0x000f, 0x0018 }, + { 0x000f, 0x0019 }, + { 0x000f, 0x001a }, + { 0x000f, 0x001b }, + { 0x000f, 0x001c }, + { 0x000f, 0x001d }, + { 0x000f, 0x001e }, + { 0x000f, 0x001f }, + { 0x000f, 0x0020 }, + { 0x000f, 0x0021 }, + { 0x000f, 0x0022 }, + { 0x000f, 0x0023 }, + { 0x000f, 0x0024 }, + { 0x000f, 0x0025 }, + { 0x000f, 0x0026 }, + { 0x000f, 0x0027 }, + { 0x000f, 0x0028 }, + { 0x000f, 0x0029 }, + { 0x000e, 0x0015 }, + { 0x000e, 0x0016 }, + { 0x000e, 0x0017 }, + { 0x000e, 0x0018 }, + { 0x000e, 0x0019 }, + { 0x000e, 0x001a }, + { 0x000e, 0x001b }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec39[12][16] = -{ - {0x0001ffff, 0x00000009, 0x00010008, 0x00010008, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0002ffff, 0x0001000a, 0x0001000a, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020018, 0x00020018, 0x00020018, 0x00020018, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, 0x00030012, }, - {0x0008ffff, 0x0007ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0005ffff, 0x0006ffff, 0x0004ffff, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, }, - {0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, }, - {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, - {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, }, - {0x00010004, 0x00010004, 0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, - {0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, }, - {0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, - {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, }, +const uint32_t c_aauiCQMFHuffDec39[12][16] = { + { + 0x0001ffff, + 0x00000009, + 0x00010008, + 0x00010008, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0002ffff, + 0x0001000a, + 0x0001000a, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + 0x00030012, + }, + { + 0x0008ffff, + 0x0007ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x0005ffff, + 0x0006ffff, + 0x0004ffff, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + }, + { + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + }, + { + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + }, + { + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + }, + { + 0x00010004, + 0x00010004, + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, + { + 0x0001001f, + 0x0001001f, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + }, + { + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + }, + { + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + }, }; #endif @@ -2459,60 +24516,741 @@ const uint32_t c_aauiCQMFHuffEnc40[81][2] = #else const uint16_t c_aauiCQMFHuffEnc40[81][2] = #endif -{ - {0x0001, 0x0001}, {0x0002, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0002}, {0x000f, 0x0011}, {0x0011, 0x0000}, {0x0011, 0x0001}, {0x0011, 0x0002}, - {0x0011, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0002}, {0x000e, 0x0009}, {0x0011, 0x0004}, {0x0011, 0x0005}, - {0x0011, 0x0006}, {0x0011, 0x0007}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0005}, {0x0011, 0x0008}, {0x0011, 0x0009}, - {0x0011, 0x000a}, {0x0011, 0x000b}, {0x0011, 0x000c}, {0x000b, 0x0003}, {0x000a, 0x0003}, {0x000c, 0x0003}, {0x0011, 0x000d}, {0x0011, 0x000e}, - {0x0011, 0x000f}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0011, 0x0012}, {0x0011, 0x0013}, {0x0011, 0x0014}, {0x0011, 0x0015}, {0x0011, 0x0016}, - {0x0011, 0x0017}, {0x0011, 0x0018}, {0x0011, 0x0019}, {0x0011, 0x001a}, {0x0011, 0x001b}, {0x0011, 0x001c}, {0x0011, 0x001d}, {0x0011, 0x001e}, - {0x0011, 0x001f}, {0x0011, 0x0020}, {0x0011, 0x0021}, {0x0011, 0x0022}, {0x0011, 0x0023}, {0x0011, 0x0024}, {0x0011, 0x0025}, {0x0011, 0x0026}, - {0x0011, 0x0027}, {0x0011, 0x0028}, {0x0011, 0x0029}, {0x0011, 0x002a}, {0x0011, 0x002b}, {0x0011, 0x002c}, {0x0011, 0x002d}, {0x0011, 0x002e}, - {0x0011, 0x002f}, {0x0011, 0x0030}, {0x0011, 0x0031}, {0x0011, 0x0032}, {0x0011, 0x0033}, {0x0011, 0x0034}, {0x0011, 0x0035}, {0x0011, 0x0036}, - {0x0011, 0x0037}, {0x0011, 0x0038}, {0x0011, 0x0039}, {0x0011, 0x003a}, {0x0011, 0x003b}, {0x0010, 0x001e}, {0x0010, 0x001f}, {0x0010, 0x0020}, - {0x0010, 0x0021}, + { + { 0x0001, 0x0001 }, + { 0x0002, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000b, 0x0002 }, + { 0x000f, 0x0011 }, + { 0x0011, 0x0000 }, + { 0x0011, 0x0001 }, + { 0x0011, 0x0002 }, + { 0x0011, 0x0003 }, + { 0x0003, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0002 }, + { 0x000e, 0x0009 }, + { 0x0011, 0x0004 }, + { 0x0011, 0x0005 }, + { 0x0011, 0x0006 }, + { 0x0011, 0x0007 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000d, 0x0005 }, + { 0x0011, 0x0008 }, + { 0x0011, 0x0009 }, + { 0x0011, 0x000a }, + { 0x0011, 0x000b }, + { 0x0011, 0x000c }, + { 0x000b, 0x0003 }, + { 0x000a, 0x0003 }, + { 0x000c, 0x0003 }, + { 0x0011, 0x000d }, + { 0x0011, 0x000e }, + { 0x0011, 0x000f }, + { 0x0011, 0x0010 }, + { 0x0011, 0x0011 }, + { 0x0011, 0x0012 }, + { 0x0011, 0x0013 }, + { 0x0011, 0x0014 }, + { 0x0011, 0x0015 }, + { 0x0011, 0x0016 }, + { 0x0011, 0x0017 }, + { 0x0011, 0x0018 }, + { 0x0011, 0x0019 }, + { 0x0011, 0x001a }, + { 0x0011, 0x001b }, + { 0x0011, 0x001c }, + { 0x0011, 0x001d }, + { 0x0011, 0x001e }, + { 0x0011, 0x001f }, + { 0x0011, 0x0020 }, + { 0x0011, 0x0021 }, + { 0x0011, 0x0022 }, + { 0x0011, 0x0023 }, + { 0x0011, 0x0024 }, + { 0x0011, 0x0025 }, + { 0x0011, 0x0026 }, + { 0x0011, 0x0027 }, + { 0x0011, 0x0028 }, + { 0x0011, 0x0029 }, + { 0x0011, 0x002a }, + { 0x0011, 0x002b }, + { 0x0011, 0x002c }, + { 0x0011, 0x002d }, + { 0x0011, 0x002e }, + { 0x0011, 0x002f }, + { 0x0011, 0x0030 }, + { 0x0011, 0x0031 }, + { 0x0011, 0x0032 }, + { 0x0011, 0x0033 }, + { 0x0011, 0x0034 }, + { 0x0011, 0x0035 }, + { 0x0011, 0x0036 }, + { 0x0011, 0x0037 }, + { 0x0011, 0x0038 }, + { 0x0011, 0x0039 }, + { 0x0011, 0x003a }, + { 0x0011, 0x003b }, + { 0x0010, 0x001e }, + { 0x0010, 0x001f }, + { 0x0010, 0x0020 }, + { 0x0010, 0x0021 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec40[36][16] = -{ - {0x0001ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000014, 0x0001000b, 0x0001000b, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x0005ffff, 0x0004ffff, 0x0003ffff, 0x0000001d, 0x00010003, 0x00010003, 0x0001001b, 0x0001001b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x0000004f, 0x00000050, 0x00010004, 0x00010004, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0000004d, 0x0000004e, }, - {0x0023ffff, 0x000affff, 0x0006ffff, 0x000bffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, }, - {0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, - {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, - {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, - {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, 0x00030044, }, - {0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, }, - {0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, - {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, +const uint32_t c_aauiCQMFHuffDec40[36][16] = { + { + 0x0001ffff, + 0x0000000a, + 0x00010009, + 0x00010009, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x00000014, + 0x0001000b, + 0x0001000b, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x0005ffff, + 0x0004ffff, + 0x0003ffff, + 0x0000001d, + 0x00010003, + 0x00010003, + 0x0001001b, + 0x0001001b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, + { + 0x0000004f, + 0x00000050, + 0x00010004, + 0x00010004, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0000004d, + 0x0000004e, + }, + { + 0x0023ffff, + 0x000affff, + 0x0006ffff, + 0x000bffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + }, + { + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + }, + { + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + }, + { + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + }, + { + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + }, + { + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + }, + { + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + }, + { + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + }, + { + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + }, + { + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + }, + { + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + }, + { + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + }, + { + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + }, + { + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + 0x00030044, + }, + { + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + }, + { + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + }, + { + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + }, + { + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, }; #endif @@ -2521,42 +25259,400 @@ const uint32_t c_aauiCQMFHuffEnc41[100][2] = #else const uint16_t c_aauiCQMFHuffEnc41[100][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x000b, 0x0001}, {0x0011, 0x0014}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0002, 0x0001}, {0x0004, 0x0001}, {0x0007, 0x0001}, {0x000a, 0x0001}, {0x0010, 0x000b}, {0x0013, 0x0005}, - {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0008, 0x0001}, {0x000d, 0x0002}, - {0x0011, 0x0015}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x000a, 0x0002}, {0x000a, 0x0003}, - {0x000d, 0x0003}, {0x0010, 0x000c}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, - {0x0010, 0x000d}, {0x000f, 0x0007}, {0x0012, 0x0027}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, - {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, - {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, - {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, - {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, - {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, - {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, - {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x0011, 0x0014 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0002, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x0010, 0x000b }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x000d, 0x0002 }, + { 0x0011, 0x0015 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000d, 0x0003 }, + { 0x0010, 0x000c }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0010, 0x000d }, + { 0x000f, 0x0007 }, + { 0x0012, 0x0027 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec41[16][16] = -{ - {0x0001ffff, 0x0000000b, 0x00010001, 0x00010001, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0002ffff, 0x00000016, 0x0001000c, 0x0001000c, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x0004ffff, 0x0003ffff, 0x00010003, 0x00010003, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0006ffff, 0x0005ffff, 0x0000000e, 0x00000021, 0x00000028, 0x00010029, 0x00010029, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, }, - {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, }, - {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x00010022, 0x00010022, }, - {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, - {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, - {0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, - {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, }, - {0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, - {0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, }, +const uint32_t c_aauiCQMFHuffDec41[16][16] = { + { + 0x0001ffff, + 0x0000000b, + 0x00010001, + 0x00010001, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0002ffff, + 0x00000016, + 0x0001000c, + 0x0001000c, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x0004ffff, + 0x0003ffff, + 0x00010003, + 0x00010003, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + }, + { + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0006ffff, + 0x0005ffff, + 0x0000000e, + 0x00000021, + 0x00000028, + 0x00010029, + 0x00010029, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + }, + { + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + }, + { + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x00010022, + 0x00010022, + }, + { + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + }, + { + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + }, + { + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + }, + { + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + }, + { + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + }, + { + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + }, + { + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + }, }; #endif @@ -2565,63 +25661,685 @@ const uint32_t c_aauiCQMFHuffEnc42[169][2] = #else const uint16_t c_aauiCQMFHuffEnc42[169][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0001}, {0x000e, 0x0006}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0001}, - {0x0009, 0x0002}, {0x000d, 0x0004}, {0x0010, 0x0013}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, - {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000b}, {0x0011, 0x0025}, - {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0009, 0x0003}, - {0x0008, 0x0003}, {0x000b, 0x0003}, {0x000d, 0x0005}, {0x0010, 0x0014}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, - {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0007}, {0x0010, 0x0015}, - {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, - {0x0013, 0x0026}, {0x0012, 0x0045}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, - {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, - {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, - {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, - {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, - {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, - {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, - {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, - {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, - {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, - {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, - {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, - {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0012, 0x0046}, {0x0012, 0x0047}, {0x0012, 0x0048}, - {0x0012, 0x0049}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000e, 0x0006 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0009, 0x0002 }, + { 0x000d, 0x0004 }, + { 0x0010, 0x0013 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0008, 0x0002 }, + { 0x000b, 0x0002 }, + { 0x000f, 0x000b }, + { 0x0011, 0x0025 }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0009, 0x0003 }, + { 0x0008, 0x0003 }, + { 0x000b, 0x0003 }, + { 0x000d, 0x0005 }, + { 0x0010, 0x0014 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0007 }, + { 0x0010, 0x0015 }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0012, 0x0045 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0012, 0x0046 }, + { 0x0012, 0x0047 }, + { 0x0012, 0x0048 }, + { 0x0012, 0x0049 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec42[28][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0003ffff, 0x0004ffff, 0x0000001c, 0x00000028, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001a, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x000affff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001001d, 0x0001001d, 0x00010029, 0x00010029, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, }, - {0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, }, - {0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x001bffff, 0x0009ffff, 0x0008ffff, 0x00000012, 0x0000002b, 0x00000037, 0x0001001e, 0x0001001e, 0x00020004, 0x00020004, 0x00020004, 0x00020004, 0x00020036, 0x00020036, 0x00020036, 0x00020036, }, - {0x000200a7, 0x000200a7, 0x000200a7, 0x000200a7, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, - {0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a5, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, }, - {0x000dffff, 0x000bffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, }, - {0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00010020, 0x00010020, }, - {0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, - {0x00010005, 0x00010005, 0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, }, - {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, - {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010042, 0x00010042, }, - {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, - {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, - {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, - {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, - {0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, }, - {0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, }, - {0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, }, - {0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, }, - {0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, - {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, }, - {0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, }, - {0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, }, +const uint32_t c_aauiCQMFHuffDec42[28][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00010001, + 0x00010001, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0003ffff, + 0x0004ffff, + 0x0000001c, + 0x00000028, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001a, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + }, + { + 0x000affff, + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x0001001d, + 0x0001001d, + 0x00010029, + 0x00010029, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + }, + { + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + }, + { + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x001bffff, + 0x0009ffff, + 0x0008ffff, + 0x00000012, + 0x0000002b, + 0x00000037, + 0x0001001e, + 0x0001001e, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020004, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + }, + { + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a7, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + }, + { + 0x000100a3, + 0x000100a3, + 0x000100a4, + 0x000100a4, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a5, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + }, + { + 0x000dffff, + 0x000bffff, + 0x000cffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + }, + { + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x00010020, + 0x00010020, + }, + { + 0x00010021, + 0x00010021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + }, + { + 0x00010005, + 0x00010005, + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + }, + { + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + }, + { + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00010042, + 0x00010042, + }, + { + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + }, + { + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + }, + { + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + }, + { + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + }, + { + 0x00010063, + 0x00010063, + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + }, + { + 0x0001006b, + 0x0001006b, + 0x0001006c, + 0x0001006c, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010070, + 0x00010070, + 0x00010071, + 0x00010071, + 0x00010072, + 0x00010072, + }, + { + 0x00010073, + 0x00010073, + 0x00010074, + 0x00010074, + 0x00010075, + 0x00010075, + 0x00010076, + 0x00010076, + 0x00010077, + 0x00010077, + 0x00010078, + 0x00010078, + 0x00010079, + 0x00010079, + 0x0001007a, + 0x0001007a, + }, + { + 0x0001007b, + 0x0001007b, + 0x0001007c, + 0x0001007c, + 0x0001007d, + 0x0001007d, + 0x0001007e, + 0x0001007e, + 0x0001007f, + 0x0001007f, + 0x00010080, + 0x00010080, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + }, + { + 0x00010083, + 0x00010083, + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + 0x00010088, + 0x00010088, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + }, + { + 0x0001008b, + 0x0001008b, + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x00010090, + 0x00010090, + 0x00010091, + 0x00010091, + 0x00010092, + 0x00010092, + }, + { + 0x00010093, + 0x00010093, + 0x00010094, + 0x00010094, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + 0x0001009a, + 0x0001009a, + }, + { + 0x0001009b, + 0x0001009b, + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a1, + 0x000100a1, + 0x000100a2, + 0x000100a2, + }, }; #endif @@ -2630,70 +26348,784 @@ const uint32_t c_aauiCQMFHuffEnc43[196][2] = #else const uint16_t c_aauiCQMFHuffEnc43[196][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0001}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x0010, 0x0017}, {0x0013, 0x0000}, {0x0013, 0x0001}, - {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0003, 0x0002}, {0x0003, 0x0003}, - {0x0005, 0x0001}, {0x0009, 0x0003}, {0x000c, 0x0004}, {0x0010, 0x0018}, {0x0012, 0x0050}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, - {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0005, 0x0002}, {0x0005, 0x0003}, {0x0008, 0x0003}, {0x000a, 0x0002}, - {0x000d, 0x0004}, {0x0011, 0x002a}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, - {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000c, 0x0005}, {0x000f, 0x000d}, {0x0012, 0x0051}, - {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, - {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0005}, {0x000f, 0x000e}, {0x0011, 0x002b}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, - {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0011, 0x002c}, {0x000f, 0x000f}, - {0x0010, 0x0019}, {0x0012, 0x0052}, {0x0012, 0x0053}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, - {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0011, 0x002d}, {0x0013, 0x0032}, {0x0013, 0x0033}, - {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, - {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, - {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, - {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, - {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, - {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, - {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, - {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, - {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, - {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, - {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, - {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, - {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, - {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0009, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x0010, 0x0017 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0009, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x0010, 0x0018 }, + { 0x0012, 0x0050 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0008, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000d, 0x0004 }, + { 0x0011, 0x002a }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0003 }, + { 0x000c, 0x0005 }, + { 0x000f, 0x000d }, + { 0x0012, 0x0051 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0005 }, + { 0x000f, 0x000e }, + { 0x0011, 0x002b }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0011, 0x002c }, + { 0x000f, 0x000f }, + { 0x0010, 0x0019 }, + { 0x0012, 0x0052 }, + { 0x0012, 0x0053 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0011, 0x002d }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0013, 0x008b }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0013, 0x0095 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0013, 0x009c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec43[32][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00010001, 0x00010001, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x0005ffff, 0x0003ffff, 0x0004ffff, 0x0000001e, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030003, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, 0x00030011, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x000bffff, 0x0007ffff, 0x0006ffff, 0x00000004, 0x00000012, 0x0000002d, 0x00000038, 0x00000039, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, }, - {0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x00000013, 0x00000048, 0x0001002e, 0x0001002e, 0x0001003b, 0x0001003b, 0x00010047, 0x00010047, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, }, - {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, }, - {0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, - {0x000dffff, 0x000effff, 0x000cffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, }, - {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x00010030, 0x00010030, }, - {0x00010006, 0x00010006, 0x00010007, 0x00010007, 0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, }, - {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00010022, 0x00010022, }, - {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x0001003d, 0x0001003d, }, - {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, }, - {0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, }, - {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, }, - {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, - {0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, 0x00010072, 0x00010072, 0x00010073, 0x00010073, }, - {0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, }, - {0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, }, - {0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, }, - {0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, }, - {0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, }, - {0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, }, - {0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, }, - {0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, - {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, - {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, +const uint32_t c_aauiCQMFHuffDec43[32][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00010001, + 0x00010001, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x0005ffff, + 0x0003ffff, + 0x0004ffff, + 0x0000001e, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + }, + { + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030003, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + 0x00030011, + }, + { + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x000bffff, + 0x0007ffff, + 0x0006ffff, + 0x00000004, + 0x00000012, + 0x0000002d, + 0x00000038, + 0x00000039, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + }, + { + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + }, + { + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x00000005, + 0x00000013, + 0x00000048, + 0x0001002e, + 0x0001002e, + 0x0001003b, + 0x0001003b, + 0x00010047, + 0x00010047, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + }, + { + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + }, + { + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + }, + { + 0x000dffff, + 0x000effff, + 0x000cffff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + }, + { + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x00010030, + 0x00010030, + }, + { + 0x00010006, + 0x00010006, + 0x00010007, + 0x00010007, + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + }, + { + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x00010022, + 0x00010022, + }, + { + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x0001003d, + 0x0001003d, + }, + { + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + }, + { + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + }, + { + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + 0x0001005b, + 0x0001005b, + }, + { + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + }, + { + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + }, + { + 0x0001006c, + 0x0001006c, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010070, + 0x00010070, + 0x00010071, + 0x00010071, + 0x00010072, + 0x00010072, + 0x00010073, + 0x00010073, + }, + { + 0x00010074, + 0x00010074, + 0x00010075, + 0x00010075, + 0x00010076, + 0x00010076, + 0x00010077, + 0x00010077, + 0x00010078, + 0x00010078, + 0x00010079, + 0x00010079, + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + }, + { + 0x0001007c, + 0x0001007c, + 0x0001007d, + 0x0001007d, + 0x0001007e, + 0x0001007e, + 0x0001007f, + 0x0001007f, + 0x00010080, + 0x00010080, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + 0x00010083, + 0x00010083, + }, + { + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + 0x00010088, + 0x00010088, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + 0x0001008b, + 0x0001008b, + }, + { + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x00010090, + 0x00010090, + 0x00010091, + 0x00010091, + 0x00010092, + 0x00010092, + 0x00010093, + 0x00010093, + }, + { + 0x00010094, + 0x00010094, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + }, + { + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a1, + 0x000100a1, + 0x000100a2, + 0x000100a2, + 0x000100a3, + 0x000100a3, + }, + { + 0x000100a4, + 0x000100a4, + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100a8, + 0x000100a8, + 0x000100a9, + 0x000100a9, + 0x000100aa, + 0x000100aa, + 0x000100ab, + 0x000100ab, + }, + { + 0x000100ac, + 0x000100ac, + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + }, + { + 0x000100b4, + 0x000100b4, + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + }, + { + 0x000100bc, + 0x000100bc, + 0x000100bd, + 0x000100bd, + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + 0x000100c0, + 0x000100c0, + 0x000100c1, + 0x000100c1, + 0x000100c2, + 0x000100c2, + 0x000100c3, + 0x000100c3, + }, }; #endif @@ -2702,77 +27134,787 @@ const uint32_t c_aauiCQMFHuffEnc44[289][2] = #else const uint16_t c_aauiCQMFHuffEnc44[289][2] = #endif -{ - {0x0001, 0x0001}, {0x0003, 0x0001}, {0x0006, 0x0002}, {0x0008, 0x0002}, {0x000b, 0x0002}, {0x000f, 0x000a}, {0x0011, 0x0022}, {0x0014, 0x0000}, - {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0014, 0x0006}, {0x0014, 0x0007}, {0x0014, 0x0008}, - {0x0014, 0x0009}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0005, 0x0002}, {0x0008, 0x0003}, {0x000b, 0x0003}, {0x000e, 0x0007}, {0x0012, 0x003f}, - {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, - {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0006, 0x0003}, {0x0005, 0x0003}, {0x0007, 0x0003}, {0x0009, 0x0002}, {0x000c, 0x0003}, {0x000f, 0x000b}, - {0x0012, 0x0040}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, - {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, {0x000b, 0x0004}, {0x000d, 0x0005}, - {0x0010, 0x0013}, {0x0014, 0x001e}, {0x0014, 0x001f}, {0x0014, 0x0020}, {0x0014, 0x0021}, {0x0014, 0x0022}, {0x0014, 0x0023}, {0x0014, 0x0024}, - {0x0014, 0x0025}, {0x0014, 0x0026}, {0x0014, 0x0027}, {0x0014, 0x0028}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000e, 0x0008}, - {0x0011, 0x0023}, {0x0012, 0x0041}, {0x0014, 0x0029}, {0x0014, 0x002a}, {0x0013, 0x007b}, {0x0014, 0x002b}, {0x0014, 0x002c}, {0x0014, 0x002d}, - {0x0014, 0x002e}, {0x0014, 0x002f}, {0x0014, 0x0030}, {0x0014, 0x0031}, {0x0014, 0x0032}, {0x000f, 0x000c}, {0x000e, 0x0009}, {0x000f, 0x000d}, - {0x0011, 0x0024}, {0x0012, 0x0042}, {0x0014, 0x0033}, {0x0014, 0x0034}, {0x0014, 0x0035}, {0x0014, 0x0036}, {0x0014, 0x0037}, {0x0014, 0x0038}, - {0x0014, 0x0039}, {0x0014, 0x003a}, {0x0014, 0x003b}, {0x0014, 0x003c}, {0x0014, 0x003d}, {0x0014, 0x003e}, {0x0013, 0x007c}, {0x0011, 0x0025}, - {0x0012, 0x0043}, {0x0014, 0x003f}, {0x0014, 0x0040}, {0x0014, 0x0041}, {0x0014, 0x0042}, {0x0014, 0x0043}, {0x0014, 0x0044}, {0x0014, 0x0045}, - {0x0014, 0x0046}, {0x0014, 0x0047}, {0x0014, 0x0048}, {0x0014, 0x0049}, {0x0014, 0x004a}, {0x0014, 0x004b}, {0x0014, 0x004c}, {0x0014, 0x004d}, - {0x0014, 0x004e}, {0x0014, 0x004f}, {0x0014, 0x0050}, {0x0014, 0x0051}, {0x0014, 0x0052}, {0x0014, 0x0053}, {0x0014, 0x0054}, {0x0014, 0x0055}, - {0x0014, 0x0056}, {0x0014, 0x0057}, {0x0014, 0x0058}, {0x0014, 0x0059}, {0x0014, 0x005a}, {0x0014, 0x005b}, {0x0014, 0x005c}, {0x0014, 0x005d}, - {0x0014, 0x005e}, {0x0014, 0x005f}, {0x0014, 0x0060}, {0x0014, 0x0061}, {0x0014, 0x0062}, {0x0014, 0x0063}, {0x0014, 0x0064}, {0x0014, 0x0065}, - {0x0014, 0x0066}, {0x0014, 0x0067}, {0x0014, 0x0068}, {0x0014, 0x0069}, {0x0014, 0x006a}, {0x0014, 0x006b}, {0x0014, 0x006c}, {0x0014, 0x006d}, - {0x0014, 0x006e}, {0x0014, 0x006f}, {0x0014, 0x0070}, {0x0014, 0x0071}, {0x0014, 0x0072}, {0x0014, 0x0073}, {0x0014, 0x0074}, {0x0014, 0x0075}, - {0x0014, 0x0076}, {0x0014, 0x0077}, {0x0014, 0x0078}, {0x0014, 0x0079}, {0x0014, 0x007a}, {0x0014, 0x007b}, {0x0014, 0x007c}, {0x0014, 0x007d}, - {0x0014, 0x007e}, {0x0014, 0x007f}, {0x0014, 0x0080}, {0x0014, 0x0081}, {0x0014, 0x0082}, {0x0014, 0x0083}, {0x0014, 0x0084}, {0x0014, 0x0085}, - {0x0014, 0x0086}, {0x0014, 0x0087}, {0x0014, 0x0088}, {0x0014, 0x0089}, {0x0014, 0x008a}, {0x0014, 0x008b}, {0x0014, 0x008c}, {0x0014, 0x008d}, - {0x0014, 0x008e}, {0x0014, 0x008f}, {0x0014, 0x0090}, {0x0014, 0x0091}, {0x0014, 0x0092}, {0x0014, 0x0093}, {0x0014, 0x0094}, {0x0014, 0x0095}, - {0x0014, 0x0096}, {0x0014, 0x0097}, {0x0014, 0x0098}, {0x0014, 0x0099}, {0x0014, 0x009a}, {0x0014, 0x009b}, {0x0014, 0x009c}, {0x0014, 0x009d}, - {0x0014, 0x009e}, {0x0014, 0x009f}, {0x0014, 0x00a0}, {0x0014, 0x00a1}, {0x0014, 0x00a2}, {0x0014, 0x00a3}, {0x0014, 0x00a4}, {0x0014, 0x00a5}, - {0x0014, 0x00a6}, {0x0014, 0x00a7}, {0x0014, 0x00a8}, {0x0014, 0x00a9}, {0x0014, 0x00aa}, {0x0014, 0x00ab}, {0x0014, 0x00ac}, {0x0014, 0x00ad}, - {0x0014, 0x00ae}, {0x0014, 0x00af}, {0x0014, 0x00b0}, {0x0014, 0x00b1}, {0x0014, 0x00b2}, {0x0014, 0x00b3}, {0x0014, 0x00b4}, {0x0014, 0x00b5}, - {0x0014, 0x00b6}, {0x0014, 0x00b7}, {0x0014, 0x00b8}, {0x0014, 0x00b9}, {0x0014, 0x00ba}, {0x0014, 0x00bb}, {0x0014, 0x00bc}, {0x0014, 0x00bd}, - {0x0014, 0x00be}, {0x0014, 0x00bf}, {0x0014, 0x00c0}, {0x0014, 0x00c1}, {0x0014, 0x00c2}, {0x0014, 0x00c3}, {0x0014, 0x00c4}, {0x0014, 0x00c5}, - {0x0014, 0x00c6}, {0x0014, 0x00c7}, {0x0014, 0x00c8}, {0x0014, 0x00c9}, {0x0014, 0x00ca}, {0x0014, 0x00cb}, {0x0014, 0x00cc}, {0x0014, 0x00cd}, - {0x0014, 0x00ce}, {0x0014, 0x00cf}, {0x0014, 0x00d0}, {0x0014, 0x00d1}, {0x0014, 0x00d2}, {0x0014, 0x00d3}, {0x0014, 0x00d4}, {0x0014, 0x00d5}, - {0x0014, 0x00d6}, {0x0014, 0x00d7}, {0x0014, 0x00d8}, {0x0014, 0x00d9}, {0x0014, 0x00da}, {0x0014, 0x00db}, {0x0014, 0x00dc}, {0x0014, 0x00dd}, - {0x0014, 0x00de}, {0x0014, 0x00df}, {0x0014, 0x00e0}, {0x0014, 0x00e1}, {0x0014, 0x00e2}, {0x0014, 0x00e3}, {0x0014, 0x00e4}, {0x0014, 0x00e5}, - {0x0014, 0x00e6}, {0x0014, 0x00e7}, {0x0014, 0x00e8}, {0x0014, 0x00e9}, {0x0014, 0x00ea}, {0x0014, 0x00eb}, {0x0014, 0x00ec}, {0x0014, 0x00ed}, - {0x0014, 0x00ee}, {0x0014, 0x00ef}, {0x0014, 0x00f0}, {0x0014, 0x00f1}, {0x0014, 0x00f2}, {0x0014, 0x00f3}, {0x0014, 0x00f4}, {0x0014, 0x00f5}, - {0x0013, 0x007d}, + { + { 0x0001, 0x0001 }, + { 0x0003, 0x0001 }, + { 0x0006, 0x0002 }, + { 0x0008, 0x0002 }, + { 0x000b, 0x0002 }, + { 0x000f, 0x000a }, + { 0x0011, 0x0022 }, + { 0x0014, 0x0000 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0014, 0x0006 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x000b, 0x0003 }, + { 0x000e, 0x0007 }, + { 0x0012, 0x003f }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0006, 0x0003 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0003 }, + { 0x0009, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000f, 0x000b }, + { 0x0012, 0x0040 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0014, 0x001c }, + { 0x0014, 0x001d }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0009, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x0010, 0x0013 }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0014, 0x0020 }, + { 0x0014, 0x0021 }, + { 0x0014, 0x0022 }, + { 0x0014, 0x0023 }, + { 0x0014, 0x0024 }, + { 0x0014, 0x0025 }, + { 0x0014, 0x0026 }, + { 0x0014, 0x0027 }, + { 0x0014, 0x0028 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000e, 0x0008 }, + { 0x0011, 0x0023 }, + { 0x0012, 0x0041 }, + { 0x0014, 0x0029 }, + { 0x0014, 0x002a }, + { 0x0013, 0x007b }, + { 0x0014, 0x002b }, + { 0x0014, 0x002c }, + { 0x0014, 0x002d }, + { 0x0014, 0x002e }, + { 0x0014, 0x002f }, + { 0x0014, 0x0030 }, + { 0x0014, 0x0031 }, + { 0x0014, 0x0032 }, + { 0x000f, 0x000c }, + { 0x000e, 0x0009 }, + { 0x000f, 0x000d }, + { 0x0011, 0x0024 }, + { 0x0012, 0x0042 }, + { 0x0014, 0x0033 }, + { 0x0014, 0x0034 }, + { 0x0014, 0x0035 }, + { 0x0014, 0x0036 }, + { 0x0014, 0x0037 }, + { 0x0014, 0x0038 }, + { 0x0014, 0x0039 }, + { 0x0014, 0x003a }, + { 0x0014, 0x003b }, + { 0x0014, 0x003c }, + { 0x0014, 0x003d }, + { 0x0014, 0x003e }, + { 0x0013, 0x007c }, + { 0x0011, 0x0025 }, + { 0x0012, 0x0043 }, + { 0x0014, 0x003f }, + { 0x0014, 0x0040 }, + { 0x0014, 0x0041 }, + { 0x0014, 0x0042 }, + { 0x0014, 0x0043 }, + { 0x0014, 0x0044 }, + { 0x0014, 0x0045 }, + { 0x0014, 0x0046 }, + { 0x0014, 0x0047 }, + { 0x0014, 0x0048 }, + { 0x0014, 0x0049 }, + { 0x0014, 0x004a }, + { 0x0014, 0x004b }, + { 0x0014, 0x004c }, + { 0x0014, 0x004d }, + { 0x0014, 0x004e }, + { 0x0014, 0x004f }, + { 0x0014, 0x0050 }, + { 0x0014, 0x0051 }, + { 0x0014, 0x0052 }, + { 0x0014, 0x0053 }, + { 0x0014, 0x0054 }, + { 0x0014, 0x0055 }, + { 0x0014, 0x0056 }, + { 0x0014, 0x0057 }, + { 0x0014, 0x0058 }, + { 0x0014, 0x0059 }, + { 0x0014, 0x005a }, + { 0x0014, 0x005b }, + { 0x0014, 0x005c }, + { 0x0014, 0x005d }, + { 0x0014, 0x005e }, + { 0x0014, 0x005f }, + { 0x0014, 0x0060 }, + { 0x0014, 0x0061 }, + { 0x0014, 0x0062 }, + { 0x0014, 0x0063 }, + { 0x0014, 0x0064 }, + { 0x0014, 0x0065 }, + { 0x0014, 0x0066 }, + { 0x0014, 0x0067 }, + { 0x0014, 0x0068 }, + { 0x0014, 0x0069 }, + { 0x0014, 0x006a }, + { 0x0014, 0x006b }, + { 0x0014, 0x006c }, + { 0x0014, 0x006d }, + { 0x0014, 0x006e }, + { 0x0014, 0x006f }, + { 0x0014, 0x0070 }, + { 0x0014, 0x0071 }, + { 0x0014, 0x0072 }, + { 0x0014, 0x0073 }, + { 0x0014, 0x0074 }, + { 0x0014, 0x0075 }, + { 0x0014, 0x0076 }, + { 0x0014, 0x0077 }, + { 0x0014, 0x0078 }, + { 0x0014, 0x0079 }, + { 0x0014, 0x007a }, + { 0x0014, 0x007b }, + { 0x0014, 0x007c }, + { 0x0014, 0x007d }, + { 0x0014, 0x007e }, + { 0x0014, 0x007f }, + { 0x0014, 0x0080 }, + { 0x0014, 0x0081 }, + { 0x0014, 0x0082 }, + { 0x0014, 0x0083 }, + { 0x0014, 0x0084 }, + { 0x0014, 0x0085 }, + { 0x0014, 0x0086 }, + { 0x0014, 0x0087 }, + { 0x0014, 0x0088 }, + { 0x0014, 0x0089 }, + { 0x0014, 0x008a }, + { 0x0014, 0x008b }, + { 0x0014, 0x008c }, + { 0x0014, 0x008d }, + { 0x0014, 0x008e }, + { 0x0014, 0x008f }, + { 0x0014, 0x0090 }, + { 0x0014, 0x0091 }, + { 0x0014, 0x0092 }, + { 0x0014, 0x0093 }, + { 0x0014, 0x0094 }, + { 0x0014, 0x0095 }, + { 0x0014, 0x0096 }, + { 0x0014, 0x0097 }, + { 0x0014, 0x0098 }, + { 0x0014, 0x0099 }, + { 0x0014, 0x009a }, + { 0x0014, 0x009b }, + { 0x0014, 0x009c }, + { 0x0014, 0x009d }, + { 0x0014, 0x009e }, + { 0x0014, 0x009f }, + { 0x0014, 0x00a0 }, + { 0x0014, 0x00a1 }, + { 0x0014, 0x00a2 }, + { 0x0014, 0x00a3 }, + { 0x0014, 0x00a4 }, + { 0x0014, 0x00a5 }, + { 0x0014, 0x00a6 }, + { 0x0014, 0x00a7 }, + { 0x0014, 0x00a8 }, + { 0x0014, 0x00a9 }, + { 0x0014, 0x00aa }, + { 0x0014, 0x00ab }, + { 0x0014, 0x00ac }, + { 0x0014, 0x00ad }, + { 0x0014, 0x00ae }, + { 0x0014, 0x00af }, + { 0x0014, 0x00b0 }, + { 0x0014, 0x00b1 }, + { 0x0014, 0x00b2 }, + { 0x0014, 0x00b3 }, + { 0x0014, 0x00b4 }, + { 0x0014, 0x00b5 }, + { 0x0014, 0x00b6 }, + { 0x0014, 0x00b7 }, + { 0x0014, 0x00b8 }, + { 0x0014, 0x00b9 }, + { 0x0014, 0x00ba }, + { 0x0014, 0x00bb }, + { 0x0014, 0x00bc }, + { 0x0014, 0x00bd }, + { 0x0014, 0x00be }, + { 0x0014, 0x00bf }, + { 0x0014, 0x00c0 }, + { 0x0014, 0x00c1 }, + { 0x0014, 0x00c2 }, + { 0x0014, 0x00c3 }, + { 0x0014, 0x00c4 }, + { 0x0014, 0x00c5 }, + { 0x0014, 0x00c6 }, + { 0x0014, 0x00c7 }, + { 0x0014, 0x00c8 }, + { 0x0014, 0x00c9 }, + { 0x0014, 0x00ca }, + { 0x0014, 0x00cb }, + { 0x0014, 0x00cc }, + { 0x0014, 0x00cd }, + { 0x0014, 0x00ce }, + { 0x0014, 0x00cf }, + { 0x0014, 0x00d0 }, + { 0x0014, 0x00d1 }, + { 0x0014, 0x00d2 }, + { 0x0014, 0x00d3 }, + { 0x0014, 0x00d4 }, + { 0x0014, 0x00d5 }, + { 0x0014, 0x00d6 }, + { 0x0014, 0x00d7 }, + { 0x0014, 0x00d8 }, + { 0x0014, 0x00d9 }, + { 0x0014, 0x00da }, + { 0x0014, 0x00db }, + { 0x0014, 0x00dc }, + { 0x0014, 0x00dd }, + { 0x0014, 0x00de }, + { 0x0014, 0x00df }, + { 0x0014, 0x00e0 }, + { 0x0014, 0x00e1 }, + { 0x0014, 0x00e2 }, + { 0x0014, 0x00e3 }, + { 0x0014, 0x00e4 }, + { 0x0014, 0x00e5 }, + { 0x0014, 0x00e6 }, + { 0x0014, 0x00e7 }, + { 0x0014, 0x00e8 }, + { 0x0014, 0x00e9 }, + { 0x0014, 0x00ea }, + { 0x0014, 0x00eb }, + { 0x0014, 0x00ec }, + { 0x0014, 0x00ed }, + { 0x0014, 0x00ee }, + { 0x0014, 0x00ef }, + { 0x0014, 0x00f0 }, + { 0x0014, 0x00f1 }, + { 0x0014, 0x00f2 }, + { 0x0014, 0x00f3 }, + { 0x0014, 0x00f4 }, + { 0x0014, 0x00f5 }, + { 0x0013, 0x007d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec44[27][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00010001, 0x00010001, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, }, - {0x0004ffff, 0x0003ffff, 0x00000003, 0x00000014, 0x00000033, 0x00000034, 0x00010024, 0x00010024, 0x00020002, 0x00020002, 0x00020002, 0x00020002, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x000affff, 0x0006ffff, 0x0005ffff, 0x00000026, 0x00010004, 0x00010004, 0x00010015, 0x00010015, 0x00010036, 0x00010036, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, }, - {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020056, 0x00020056, 0x00020056, 0x00020056, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x00000038, 0x00010005, 0x00010005, 0x00010027, 0x00010027, 0x00010055, 0x00010055, 0x00010057, 0x00010057, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, 0x00030067, }, - {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x00020068, 0x00020068, 0x00020068, 0x00020068, }, - {0x000dffff, 0x000cffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x000bffff, }, - {0x0000011a, 0x0000011b, 0x0000011c, 0x0000011d, 0x0000011e, 0x0000011f, 0x0001004c, 0x0001004c, 0x00010066, 0x00010066, 0x00010120, 0x00010120, 0x00020017, 0x00020017, 0x00020017, 0x00020017, }, - {0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x0000002f, 0x00000030, 0x00000031, 0x00000032, 0x00000039, 0x0000003a, }, - {0x00000007, 0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c, 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, }, - {0x0000003b, 0x0000003c, 0x0000003d, 0x0000003e, 0x0000003f, 0x00000040, 0x00000041, 0x00000042, 0x00000043, 0x0000004a, 0x0000004b, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, 0x00000051, }, - {0x00000052, 0x00000053, 0x00000054, 0x0000005a, 0x0000005b, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000061, 0x00000062, 0x00000063, 0x00000064, 0x00000065, 0x00000069, }, - {0x0000006a, 0x0000006b, 0x0000006c, 0x0000006d, 0x0000006e, 0x0000006f, 0x00000070, 0x00000071, 0x00000072, 0x00000073, 0x00000074, 0x00000075, 0x00000076, 0x00000077, 0x00000078, 0x00000079, }, - {0x0000007a, 0x0000007b, 0x0000007c, 0x0000007d, 0x0000007e, 0x0000007f, 0x00000080, 0x00000081, 0x00000082, 0x00000083, 0x00000084, 0x00000085, 0x00000086, 0x00000087, 0x00000088, 0x00000089, }, - {0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x0000008f, 0x00000090, 0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, }, - {0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, 0x000000a1, 0x000000a2, 0x000000a3, 0x000000a4, 0x000000a5, 0x000000a6, 0x000000a7, 0x000000a8, 0x000000a9, }, - {0x000000aa, 0x000000ab, 0x000000ac, 0x000000ad, 0x000000ae, 0x000000af, 0x000000b0, 0x000000b1, 0x000000b2, 0x000000b3, 0x000000b4, 0x000000b5, 0x000000b6, 0x000000b7, 0x000000b8, 0x000000b9, }, - {0x000000ba, 0x000000bb, 0x000000bc, 0x000000bd, 0x000000be, 0x000000bf, 0x000000c0, 0x000000c1, 0x000000c2, 0x000000c3, 0x000000c4, 0x000000c5, 0x000000c6, 0x000000c7, 0x000000c8, 0x000000c9, }, - {0x000000ca, 0x000000cb, 0x000000cc, 0x000000cd, 0x000000ce, 0x000000cf, 0x000000d0, 0x000000d1, 0x000000d2, 0x000000d3, 0x000000d4, 0x000000d5, 0x000000d6, 0x000000d7, 0x000000d8, 0x000000d9, }, - {0x000000da, 0x000000db, 0x000000dc, 0x000000dd, 0x000000de, 0x000000df, 0x000000e0, 0x000000e1, 0x000000e2, 0x000000e3, 0x000000e4, 0x000000e5, 0x000000e6, 0x000000e7, 0x000000e8, 0x000000e9, }, - {0x000000ea, 0x000000eb, 0x000000ec, 0x000000ed, 0x000000ee, 0x000000ef, 0x000000f0, 0x000000f1, 0x000000f2, 0x000000f3, 0x000000f4, 0x000000f5, 0x000000f6, 0x000000f7, 0x000000f8, 0x000000f9, }, - {0x000000fa, 0x000000fb, 0x000000fc, 0x000000fd, 0x000000fe, 0x000000ff, 0x00000100, 0x00000101, 0x00000102, 0x00000103, 0x00000104, 0x00000105, 0x00000106, 0x00000107, 0x00000108, 0x00000109, }, - {0x0000010a, 0x0000010b, 0x0000010c, 0x0000010d, 0x0000010e, 0x0000010f, 0x00000110, 0x00000111, 0x00000112, 0x00000113, 0x00000114, 0x00000115, 0x00000116, 0x00000117, 0x00000118, 0x00000119, }, +const uint32_t c_aauiCQMFHuffDec44[27][16] = { + { + 0x0002ffff, + 0x0001ffff, + 0x00010001, + 0x00010001, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + 0x00030000, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + }, + { + 0x0004ffff, + 0x0003ffff, + 0x00000003, + 0x00000014, + 0x00000033, + 0x00000034, + 0x00010024, + 0x00010024, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x000affff, + 0x0006ffff, + 0x0005ffff, + 0x00000026, + 0x00010004, + 0x00010004, + 0x00010015, + 0x00010015, + 0x00010036, + 0x00010036, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + }, + { + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x0009ffff, + 0x0007ffff, + 0x0008ffff, + 0x00000038, + 0x00010005, + 0x00010005, + 0x00010027, + 0x00010027, + 0x00010055, + 0x00010055, + 0x00010057, + 0x00010057, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + }, + { + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + 0x00030067, + }, + { + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020068, + 0x00020068, + 0x00020068, + 0x00020068, + }, + { + 0x000dffff, + 0x000cffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x000bffff, + }, + { + 0x0000011a, + 0x0000011b, + 0x0000011c, + 0x0000011d, + 0x0000011e, + 0x0000011f, + 0x0001004c, + 0x0001004c, + 0x00010066, + 0x00010066, + 0x00010120, + 0x00010120, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + }, + { + 0x0000001e, + 0x0000001f, + 0x00000020, + 0x00000021, + 0x00000029, + 0x0000002a, + 0x0000002b, + 0x0000002c, + 0x0000002d, + 0x0000002e, + 0x0000002f, + 0x00000030, + 0x00000031, + 0x00000032, + 0x00000039, + 0x0000003a, + }, + { + 0x00000007, + 0x00000008, + 0x00000009, + 0x0000000a, + 0x0000000b, + 0x0000000c, + 0x0000000d, + 0x0000000e, + 0x0000000f, + 0x00000010, + 0x00000018, + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x0000001d, + }, + { + 0x0000003b, + 0x0000003c, + 0x0000003d, + 0x0000003e, + 0x0000003f, + 0x00000040, + 0x00000041, + 0x00000042, + 0x00000043, + 0x0000004a, + 0x0000004b, + 0x0000004d, + 0x0000004e, + 0x0000004f, + 0x00000050, + 0x00000051, + }, + { + 0x00000052, + 0x00000053, + 0x00000054, + 0x0000005a, + 0x0000005b, + 0x0000005c, + 0x0000005d, + 0x0000005e, + 0x0000005f, + 0x00000060, + 0x00000061, + 0x00000062, + 0x00000063, + 0x00000064, + 0x00000065, + 0x00000069, + }, + { + 0x0000006a, + 0x0000006b, + 0x0000006c, + 0x0000006d, + 0x0000006e, + 0x0000006f, + 0x00000070, + 0x00000071, + 0x00000072, + 0x00000073, + 0x00000074, + 0x00000075, + 0x00000076, + 0x00000077, + 0x00000078, + 0x00000079, + }, + { + 0x0000007a, + 0x0000007b, + 0x0000007c, + 0x0000007d, + 0x0000007e, + 0x0000007f, + 0x00000080, + 0x00000081, + 0x00000082, + 0x00000083, + 0x00000084, + 0x00000085, + 0x00000086, + 0x00000087, + 0x00000088, + 0x00000089, + }, + { + 0x0000008a, + 0x0000008b, + 0x0000008c, + 0x0000008d, + 0x0000008e, + 0x0000008f, + 0x00000090, + 0x00000091, + 0x00000092, + 0x00000093, + 0x00000094, + 0x00000095, + 0x00000096, + 0x00000097, + 0x00000098, + 0x00000099, + }, + { + 0x0000009a, + 0x0000009b, + 0x0000009c, + 0x0000009d, + 0x0000009e, + 0x0000009f, + 0x000000a0, + 0x000000a1, + 0x000000a2, + 0x000000a3, + 0x000000a4, + 0x000000a5, + 0x000000a6, + 0x000000a7, + 0x000000a8, + 0x000000a9, + }, + { + 0x000000aa, + 0x000000ab, + 0x000000ac, + 0x000000ad, + 0x000000ae, + 0x000000af, + 0x000000b0, + 0x000000b1, + 0x000000b2, + 0x000000b3, + 0x000000b4, + 0x000000b5, + 0x000000b6, + 0x000000b7, + 0x000000b8, + 0x000000b9, + }, + { + 0x000000ba, + 0x000000bb, + 0x000000bc, + 0x000000bd, + 0x000000be, + 0x000000bf, + 0x000000c0, + 0x000000c1, + 0x000000c2, + 0x000000c3, + 0x000000c4, + 0x000000c5, + 0x000000c6, + 0x000000c7, + 0x000000c8, + 0x000000c9, + }, + { + 0x000000ca, + 0x000000cb, + 0x000000cc, + 0x000000cd, + 0x000000ce, + 0x000000cf, + 0x000000d0, + 0x000000d1, + 0x000000d2, + 0x000000d3, + 0x000000d4, + 0x000000d5, + 0x000000d6, + 0x000000d7, + 0x000000d8, + 0x000000d9, + }, + { + 0x000000da, + 0x000000db, + 0x000000dc, + 0x000000dd, + 0x000000de, + 0x000000df, + 0x000000e0, + 0x000000e1, + 0x000000e2, + 0x000000e3, + 0x000000e4, + 0x000000e5, + 0x000000e6, + 0x000000e7, + 0x000000e8, + 0x000000e9, + }, + { + 0x000000ea, + 0x000000eb, + 0x000000ec, + 0x000000ed, + 0x000000ee, + 0x000000ef, + 0x000000f0, + 0x000000f1, + 0x000000f2, + 0x000000f3, + 0x000000f4, + 0x000000f5, + 0x000000f6, + 0x000000f7, + 0x000000f8, + 0x000000f9, + }, + { + 0x000000fa, + 0x000000fb, + 0x000000fc, + 0x000000fd, + 0x000000fe, + 0x000000ff, + 0x00000100, + 0x00000101, + 0x00000102, + 0x00000103, + 0x00000104, + 0x00000105, + 0x00000106, + 0x00000107, + 0x00000108, + 0x00000109, + }, + { + 0x0000010a, + 0x0000010b, + 0x0000010c, + 0x0000010d, + 0x0000010e, + 0x0000010f, + 0x00000110, + 0x00000111, + 0x00000112, + 0x00000113, + 0x00000114, + 0x00000115, + 0x00000116, + 0x00000117, + 0x00000118, + 0x00000119, + }, }; #endif @@ -2781,104 +27923,1236 @@ const uint32_t c_aauiCQMFHuffEnc45[324][2] = #else const uint16_t c_aauiCQMFHuffEnc45[324][2] = #endif -{ - {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0002}, {0x0009, 0x0003}, {0x000c, 0x0005}, {0x0010, 0x0025}, {0x0012, 0x0088}, - {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, - {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0004}, {0x0006, 0x0003}, {0x0009, 0x0004}, {0x000b, 0x0004}, - {0x000f, 0x0014}, {0x0011, 0x0048}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, - {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0005, 0x0005}, {0x0004, 0x0003}, {0x0006, 0x0004}, {0x0007, 0x0003}, - {0x000a, 0x0004}, {0x000d, 0x0007}, {0x000f, 0x0015}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, - {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0007, 0x0004}, {0x0006, 0x0005}, - {0x0007, 0x0005}, {0x0009, 0x0005}, {0x000b, 0x0005}, {0x000d, 0x0008}, {0x0010, 0x0026}, {0x0012, 0x0089}, {0x0012, 0x008a}, {0x0013, 0x001f}, - {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, - {0x0009, 0x0006}, {0x0009, 0x0007}, {0x000a, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x0009}, {0x000f, 0x0016}, {0x0011, 0x0049}, {0x0013, 0x0028}, - {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, - {0x0013, 0x0031}, {0x0013, 0x0032}, {0x000c, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000e, 0x000d}, {0x0010, 0x0027}, {0x0012, 0x008b}, - {0x0012, 0x008c}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, - {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x000f, 0x0017}, {0x000f, 0x0018}, {0x000f, 0x0019}, {0x0012, 0x008d}, - {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, - {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0012, 0x008e}, - {0x0012, 0x008f}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, - {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, - {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, - {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, - {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, - {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, - {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, - {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, - {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, - {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, - {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, - {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, - {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, - {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, - {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, - {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, - {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, - {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, - {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, - {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, - {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, - {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, - {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, - {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, - {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, + { + { 0x0002, 0x0002 }, + { 0x0003, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000c, 0x0005 }, + { 0x0010, 0x0025 }, + { 0x0012, 0x0088 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0006, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x000b, 0x0004 }, + { 0x000f, 0x0014 }, + { 0x0011, 0x0048 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0005, 0x0005 }, + { 0x0004, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0007, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000d, 0x0007 }, + { 0x000f, 0x0015 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0007, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0005 }, + { 0x0009, 0x0005 }, + { 0x000b, 0x0005 }, + { 0x000d, 0x0008 }, + { 0x0010, 0x0026 }, + { 0x0012, 0x0089 }, + { 0x0012, 0x008a }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000d, 0x0009 }, + { 0x000f, 0x0016 }, + { 0x0011, 0x0049 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x000c, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0007 }, + { 0x000e, 0x000d }, + { 0x0010, 0x0027 }, + { 0x0012, 0x008b }, + { 0x0012, 0x008c }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x000f, 0x0017 }, + { 0x000f, 0x0018 }, + { 0x000f, 0x0019 }, + { 0x0012, 0x008d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0012, 0x008e }, + { 0x0012, 0x008f }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0013, 0x008b }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0013, 0x0095 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0013, 0x009c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, + { 0x0013, 0x00a0 }, + { 0x0013, 0x00a1 }, + { 0x0013, 0x00a2 }, + { 0x0013, 0x00a3 }, + { 0x0013, 0x00a4 }, + { 0x0013, 0x00a5 }, + { 0x0013, 0x00a6 }, + { 0x0013, 0x00a7 }, + { 0x0013, 0x00a8 }, + { 0x0013, 0x00a9 }, + { 0x0013, 0x00aa }, + { 0x0013, 0x00ab }, + { 0x0013, 0x00ac }, + { 0x0013, 0x00ad }, + { 0x0013, 0x00ae }, + { 0x0013, 0x00af }, + { 0x0013, 0x00b0 }, + { 0x0013, 0x00b1 }, + { 0x0013, 0x00b2 }, + { 0x0013, 0x00b3 }, + { 0x0013, 0x00b4 }, + { 0x0013, 0x00b5 }, + { 0x0013, 0x00b6 }, + { 0x0013, 0x00b7 }, + { 0x0013, 0x00b8 }, + { 0x0013, 0x00b9 }, + { 0x0013, 0x00ba }, + { 0x0013, 0x00bb }, + { 0x0013, 0x00bc }, + { 0x0013, 0x00bd }, + { 0x0013, 0x00be }, + { 0x0013, 0x00bf }, + { 0x0013, 0x00c0 }, + { 0x0013, 0x00c1 }, + { 0x0013, 0x00c2 }, + { 0x0013, 0x00c3 }, + { 0x0013, 0x00c4 }, + { 0x0013, 0x00c5 }, + { 0x0013, 0x00c6 }, + { 0x0013, 0x00c7 }, + { 0x0013, 0x00c8 }, + { 0x0013, 0x00c9 }, + { 0x0013, 0x00ca }, + { 0x0013, 0x00cb }, + { 0x0013, 0x00cc }, + { 0x0013, 0x00cd }, + { 0x0013, 0x00ce }, + { 0x0013, 0x00cf }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0013, 0x00d2 }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0013, 0x00d5 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0013, 0x00d8 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0013, 0x00db }, + { 0x0013, 0x00dc }, + { 0x0013, 0x00dd }, + { 0x0013, 0x00de }, + { 0x0013, 0x00df }, + { 0x0013, 0x00e0 }, + { 0x0013, 0x00e1 }, + { 0x0013, 0x00e2 }, + { 0x0013, 0x00e3 }, + { 0x0013, 0x00e4 }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0013, 0x00e9 }, + { 0x0013, 0x00ea }, + { 0x0013, 0x00eb }, + { 0x0013, 0x00ec }, + { 0x0013, 0x00ed }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0013, 0x00f0 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec45[50][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000025, 0x00010001, 0x00010001, 0x00010013, 0x00010013, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x0007ffff, 0x0005ffff, 0x0004ffff, 0x0006ffff, 0x00010003, 0x00010003, 0x00010027, 0x00010027, 0x00010036, 0x00010036, 0x00010038, 0x00010038, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, 0x00030039, }, - {0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, }, - {0x000effff, 0x001fffff, 0x000affff, 0x0008ffff, 0x0009ffff, 0x00000005, 0x0000005a, 0x0000005c, 0x00010017, 0x00010017, 0x0001003a, 0x0001003a, 0x0001004b, 0x0001004b, 0x0001005b, 0x0001005b, }, - {0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, - {0x0030ffff, 0x0031ffff, 0x000cffff, 0x000dffff, 0x000bffff, 0x00000006, 0x0000003c, 0x0000005e, 0x00010018, 0x00010018, 0x0001002a, 0x0001002a, 0x0001004d, 0x0001004d, 0x0001006c, 0x0001006c, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x00020007, 0x00020007, 0x00020007, 0x00020007, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, }, - {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, - {0x0010ffff, 0x0011ffff, 0x0012ffff, 0x000fffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, }, - {0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x0001003f, 0x0001003f, }, - {0x00010008, 0x00010008, 0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, }, - {0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, }, - {0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, }, - {0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, - {0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, }, - {0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, }, - {0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, - {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, }, - {0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, }, - {0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, }, - {0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00010093, 0x00010093, }, - {0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, }, - {0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, }, - {0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, }, - {0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, - {0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, }, - {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, - {0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, }, - {0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, }, - {0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, }, - {0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, }, - {0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, }, - {0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, }, - {0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, }, - {0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, }, - {0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, }, - {0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, }, - {0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010113, 0x00010113, }, - {0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, }, - {0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, }, - {0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, }, - {0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, }, - {0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, }, - {0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, }, +const uint32_t c_aauiCQMFHuffDec45[50][16] = { + { + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000025, + 0x00010001, + 0x00010001, + 0x00010013, + 0x00010013, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x0007ffff, + 0x0005ffff, + 0x0004ffff, + 0x0006ffff, + 0x00010003, + 0x00010003, + 0x00010027, + 0x00010027, + 0x00010036, + 0x00010036, + 0x00010038, + 0x00010038, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + 0x00030039, + }, + { + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + }, + { + 0x000effff, + 0x001fffff, + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x00000005, + 0x0000005a, + 0x0000005c, + 0x00010017, + 0x00010017, + 0x0001003a, + 0x0001003a, + 0x0001004b, + 0x0001004b, + 0x0001005b, + 0x0001005b, + }, + { + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + }, + { + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + }, + { + 0x0030ffff, + 0x0031ffff, + 0x000cffff, + 0x000dffff, + 0x000bffff, + 0x00000006, + 0x0000003c, + 0x0000005e, + 0x00010018, + 0x00010018, + 0x0001002a, + 0x0001002a, + 0x0001004d, + 0x0001004d, + 0x0001006c, + 0x0001006c, + }, + { + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + }, + { + 0x00020007, + 0x00020007, + 0x00020007, + 0x00020007, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + }, + { + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + }, + { + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x000fffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + }, + { + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x0001003f, + 0x0001003f, + }, + { + 0x00010008, + 0x00010008, + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + }, + { + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + }, + { + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + }, + { + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + }, + { + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + }, + { + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + }, + { + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + 0x00010070, + 0x00010070, + 0x00010071, + 0x00010071, + }, + { + 0x00010072, + 0x00010072, + 0x00010073, + 0x00010073, + 0x00010074, + 0x00010074, + 0x00010075, + 0x00010075, + 0x00010076, + 0x00010076, + 0x00010077, + 0x00010077, + 0x00010078, + 0x00010078, + 0x00010079, + 0x00010079, + }, + { + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + 0x0001007c, + 0x0001007c, + 0x0001007d, + 0x0001007d, + 0x0001007e, + 0x0001007e, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + 0x00010083, + 0x00010083, + }, + { + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + 0x00010088, + 0x00010088, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + 0x0001008b, + 0x0001008b, + }, + { + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x00010090, + 0x00010090, + 0x00010091, + 0x00010091, + 0x00010092, + 0x00010092, + 0x00010093, + 0x00010093, + }, + { + 0x00010094, + 0x00010094, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + }, + { + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a1, + 0x000100a1, + 0x000100a2, + 0x000100a2, + 0x000100a3, + 0x000100a3, + }, + { + 0x000100a4, + 0x000100a4, + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100a8, + 0x000100a8, + 0x000100a9, + 0x000100a9, + 0x000100aa, + 0x000100aa, + 0x000100ab, + 0x000100ab, + }, + { + 0x000100ac, + 0x000100ac, + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + }, + { + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + }, + { + 0x000100b4, + 0x000100b4, + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + }, + { + 0x000100bc, + 0x000100bc, + 0x000100bd, + 0x000100bd, + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + 0x000100c0, + 0x000100c0, + 0x000100c1, + 0x000100c1, + 0x000100c2, + 0x000100c2, + 0x000100c3, + 0x000100c3, + }, + { + 0x000100c4, + 0x000100c4, + 0x000100c5, + 0x000100c5, + 0x000100c6, + 0x000100c6, + 0x000100c7, + 0x000100c7, + 0x000100c8, + 0x000100c8, + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x000100cb, + 0x000100cb, + }, + { + 0x000100cc, + 0x000100cc, + 0x000100cd, + 0x000100cd, + 0x000100ce, + 0x000100ce, + 0x000100cf, + 0x000100cf, + 0x000100d0, + 0x000100d0, + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100d3, + 0x000100d3, + }, + { + 0x000100d4, + 0x000100d4, + 0x000100d5, + 0x000100d5, + 0x000100d6, + 0x000100d6, + 0x000100d7, + 0x000100d7, + 0x000100d8, + 0x000100d8, + 0x000100d9, + 0x000100d9, + 0x000100da, + 0x000100da, + 0x000100db, + 0x000100db, + }, + { + 0x000100dc, + 0x000100dc, + 0x000100dd, + 0x000100dd, + 0x000100de, + 0x000100de, + 0x000100df, + 0x000100df, + 0x000100e0, + 0x000100e0, + 0x000100e1, + 0x000100e1, + 0x000100e2, + 0x000100e2, + 0x000100e3, + 0x000100e3, + }, + { + 0x000100e4, + 0x000100e4, + 0x000100e5, + 0x000100e5, + 0x000100e6, + 0x000100e6, + 0x000100e7, + 0x000100e7, + 0x000100e8, + 0x000100e8, + 0x000100e9, + 0x000100e9, + 0x000100ea, + 0x000100ea, + 0x000100eb, + 0x000100eb, + }, + { + 0x000100ec, + 0x000100ec, + 0x000100ed, + 0x000100ed, + 0x000100ee, + 0x000100ee, + 0x000100ef, + 0x000100ef, + 0x000100f0, + 0x000100f0, + 0x000100f1, + 0x000100f1, + 0x000100f2, + 0x000100f2, + 0x000100f3, + 0x000100f3, + }, + { + 0x000100f4, + 0x000100f4, + 0x000100f5, + 0x000100f5, + 0x000100f6, + 0x000100f6, + 0x000100f7, + 0x000100f7, + 0x000100f8, + 0x000100f8, + 0x000100f9, + 0x000100f9, + 0x000100fa, + 0x000100fa, + 0x000100fb, + 0x000100fb, + }, + { + 0x000100fc, + 0x000100fc, + 0x000100fd, + 0x000100fd, + 0x000100fe, + 0x000100fe, + 0x000100ff, + 0x000100ff, + 0x00010100, + 0x00010100, + 0x00010101, + 0x00010101, + 0x00010102, + 0x00010102, + 0x00010103, + 0x00010103, + }, + { + 0x00010104, + 0x00010104, + 0x00010105, + 0x00010105, + 0x00010106, + 0x00010106, + 0x00010107, + 0x00010107, + 0x00010108, + 0x00010108, + 0x00010109, + 0x00010109, + 0x0001010a, + 0x0001010a, + 0x0001010b, + 0x0001010b, + }, + { + 0x0001010c, + 0x0001010c, + 0x0001010d, + 0x0001010d, + 0x0001010e, + 0x0001010e, + 0x0001010f, + 0x0001010f, + 0x00010110, + 0x00010110, + 0x00010111, + 0x00010111, + 0x00010112, + 0x00010112, + 0x00010113, + 0x00010113, + }, + { + 0x00010114, + 0x00010114, + 0x00010115, + 0x00010115, + 0x00010116, + 0x00010116, + 0x00010117, + 0x00010117, + 0x00010118, + 0x00010118, + 0x00010119, + 0x00010119, + 0x0001011a, + 0x0001011a, + 0x0001011b, + 0x0001011b, + }, + { + 0x0001011c, + 0x0001011c, + 0x0001011d, + 0x0001011d, + 0x0001011e, + 0x0001011e, + 0x0001011f, + 0x0001011f, + 0x00010120, + 0x00010120, + 0x00010121, + 0x00010121, + 0x00010122, + 0x00010122, + 0x00010123, + 0x00010123, + }, + { + 0x00010124, + 0x00010124, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010127, + 0x00010127, + 0x00010128, + 0x00010128, + 0x00010129, + 0x00010129, + 0x0001012a, + 0x0001012a, + 0x0001012b, + 0x0001012b, + }, + { + 0x0001012c, + 0x0001012c, + 0x0001012d, + 0x0001012d, + 0x0001012e, + 0x0001012e, + 0x0001012f, + 0x0001012f, + 0x00010130, + 0x00010130, + 0x00010131, + 0x00010131, + 0x00010132, + 0x00010132, + 0x00010133, + 0x00010133, + }, + { + 0x00010134, + 0x00010134, + 0x00010135, + 0x00010135, + 0x00010136, + 0x00010136, + 0x00010137, + 0x00010137, + 0x00010138, + 0x00010138, + 0x00010139, + 0x00010139, + 0x0001013a, + 0x0001013a, + 0x0001013b, + 0x0001013b, + }, + { + 0x0001013c, + 0x0001013c, + 0x0001013d, + 0x0001013d, + 0x0001013e, + 0x0001013e, + 0x0001013f, + 0x0001013f, + 0x00010140, + 0x00010140, + 0x00010141, + 0x00010141, + 0x00010142, + 0x00010142, + 0x00010143, + 0x00010143, + }, }; #endif @@ -2887,123 +29161,1509 @@ const uint32_t c_aauiCQMFHuffEnc46[400][2] = #else const uint16_t c_aauiCQMFHuffEnc46[400][2] = #endif -{ - {0x0002, 0x0002}, {0x0003, 0x0002}, {0x0005, 0x0003}, {0x0007, 0x0004}, {0x0009, 0x0005}, {0x000b, 0x0006}, {0x000d, 0x000a}, {0x000f, 0x0018}, - {0x0012, 0x00a6}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, - {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0004}, {0x0006, 0x0004}, - {0x0008, 0x0004}, {0x000a, 0x0006}, {0x000c, 0x0008}, {0x000e, 0x0011}, {0x0012, 0x00a7}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, - {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0007, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0007}, {0x000d, 0x000b}, {0x000f, 0x0019}, - {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, - {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0007, 0x0006}, {0x0006, 0x0005}, {0x0007, 0x0007}, {0x0008, 0x0005}, - {0x000a, 0x0007}, {0x000c, 0x0009}, {0x000e, 0x0012}, {0x000f, 0x001a}, {0x0012, 0x00a8}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, - {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, - {0x0009, 0x0007}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x000a, 0x0008}, {0x000b, 0x0008}, {0x000d, 0x000c}, {0x000e, 0x0013}, {0x0010, 0x002c}, - {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, - {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x000b, 0x0009}, {0x000a, 0x0009}, {0x000b, 0x000a}, {0x000b, 0x000b}, - {0x000d, 0x000d}, {0x000f, 0x001b}, {0x0010, 0x002d}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, - {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, - {0x000d, 0x000e}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000d, 0x000f}, {0x000f, 0x001c}, {0x000f, 0x001d}, {0x0013, 0x0046}, {0x0013, 0x0047}, - {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, - {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x000f, 0x001e}, {0x000f, 0x001f}, {0x000f, 0x0020}, {0x000f, 0x0021}, - {0x0010, 0x002e}, {0x0012, 0x00a9}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0012, 0x00aa}, {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, - {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, - {0x0013, 0x0061}, {0x0010, 0x002f}, {0x0013, 0x0062}, {0x0011, 0x0057}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, - {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, - {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, - {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, - {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, - {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, - {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, {0x0013, 0x0096}, - {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, - {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, - {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, - {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, - {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, - {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, - {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, - {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, - {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, - {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, - {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, - {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, - {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, - {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, - {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, - {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, - {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, - {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, - {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, - {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, - {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, - {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, - {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0012, 0x00ab}, {0x0012, 0x00ac}, {0x0012, 0x00ad}, -}; + { + { 0x0002, 0x0002 }, + { 0x0003, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000d, 0x000a }, + { 0x000f, 0x0018 }, + { 0x0012, 0x00a6 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0006, 0x0004 }, + { 0x0008, 0x0004 }, + { 0x000a, 0x0006 }, + { 0x000c, 0x0008 }, + { 0x000e, 0x0011 }, + { 0x0012, 0x00a7 }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0007, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000d, 0x000b }, + { 0x000f, 0x0019 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0007, 0x0006 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0005 }, + { 0x000a, 0x0007 }, + { 0x000c, 0x0009 }, + { 0x000e, 0x0012 }, + { 0x000f, 0x001a }, + { 0x0012, 0x00a8 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0009, 0x0007 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000b, 0x0008 }, + { 0x000d, 0x000c }, + { 0x000e, 0x0013 }, + { 0x0010, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x000b, 0x0009 }, + { 0x000a, 0x0009 }, + { 0x000b, 0x000a }, + { 0x000b, 0x000b }, + { 0x000d, 0x000d }, + { 0x000f, 0x001b }, + { 0x0010, 0x002d }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x000d, 0x000e }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000d, 0x000f }, + { 0x000f, 0x001c }, + { 0x000f, 0x001d }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x000f, 0x001e }, + { 0x000f, 0x001f }, + { 0x000f, 0x0020 }, + { 0x000f, 0x0021 }, + { 0x0010, 0x002e }, + { 0x0012, 0x00a9 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0012, 0x00aa }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0010, 0x002f }, + { 0x0013, 0x0062 }, + { 0x0011, 0x0057 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0013, 0x008b }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0013, 0x0095 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0013, 0x009c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, + { 0x0013, 0x00a0 }, + { 0x0013, 0x00a1 }, + { 0x0013, 0x00a2 }, + { 0x0013, 0x00a3 }, + { 0x0013, 0x00a4 }, + { 0x0013, 0x00a5 }, + { 0x0013, 0x00a6 }, + { 0x0013, 0x00a7 }, + { 0x0013, 0x00a8 }, + { 0x0013, 0x00a9 }, + { 0x0013, 0x00aa }, + { 0x0013, 0x00ab }, + { 0x0013, 0x00ac }, + { 0x0013, 0x00ad }, + { 0x0013, 0x00ae }, + { 0x0013, 0x00af }, + { 0x0013, 0x00b0 }, + { 0x0013, 0x00b1 }, + { 0x0013, 0x00b2 }, + { 0x0013, 0x00b3 }, + { 0x0013, 0x00b4 }, + { 0x0013, 0x00b5 }, + { 0x0013, 0x00b6 }, + { 0x0013, 0x00b7 }, + { 0x0013, 0x00b8 }, + { 0x0013, 0x00b9 }, + { 0x0013, 0x00ba }, + { 0x0013, 0x00bb }, + { 0x0013, 0x00bc }, + { 0x0013, 0x00bd }, + { 0x0013, 0x00be }, + { 0x0013, 0x00bf }, + { 0x0013, 0x00c0 }, + { 0x0013, 0x00c1 }, + { 0x0013, 0x00c2 }, + { 0x0013, 0x00c3 }, + { 0x0013, 0x00c4 }, + { 0x0013, 0x00c5 }, + { 0x0013, 0x00c6 }, + { 0x0013, 0x00c7 }, + { 0x0013, 0x00c8 }, + { 0x0013, 0x00c9 }, + { 0x0013, 0x00ca }, + { 0x0013, 0x00cb }, + { 0x0013, 0x00cc }, + { 0x0013, 0x00cd }, + { 0x0013, 0x00ce }, + { 0x0013, 0x00cf }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0013, 0x00d2 }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0013, 0x00d5 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0013, 0x00d8 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0013, 0x00db }, + { 0x0013, 0x00dc }, + { 0x0013, 0x00dd }, + { 0x0013, 0x00de }, + { 0x0013, 0x00df }, + { 0x0013, 0x00e0 }, + { 0x0013, 0x00e1 }, + { 0x0013, 0x00e2 }, + { 0x0013, 0x00e3 }, + { 0x0013, 0x00e4 }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0013, 0x00e9 }, + { 0x0013, 0x00ea }, + { 0x0013, 0x00eb }, + { 0x0013, 0x00ec }, + { 0x0013, 0x00ed }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0013, 0x00f0 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, + { 0x0013, 0x0110 }, + { 0x0013, 0x0111 }, + { 0x0013, 0x0112 }, + { 0x0013, 0x0113 }, + { 0x0013, 0x0114 }, + { 0x0013, 0x0115 }, + { 0x0013, 0x0116 }, + { 0x0013, 0x0117 }, + { 0x0013, 0x0118 }, + { 0x0013, 0x0119 }, + { 0x0013, 0x011a }, + { 0x0013, 0x011b }, + { 0x0013, 0x011c }, + { 0x0013, 0x011d }, + { 0x0013, 0x011e }, + { 0x0013, 0x011f }, + { 0x0013, 0x0120 }, + { 0x0013, 0x0121 }, + { 0x0013, 0x0122 }, + { 0x0013, 0x0123 }, + { 0x0013, 0x0124 }, + { 0x0013, 0x0125 }, + { 0x0013, 0x0126 }, + { 0x0013, 0x0127 }, + { 0x0013, 0x0128 }, + { 0x0013, 0x0129 }, + { 0x0013, 0x012a }, + { 0x0013, 0x012b }, + { 0x0013, 0x012c }, + { 0x0013, 0x012d }, + { 0x0013, 0x012e }, + { 0x0013, 0x012f }, + { 0x0013, 0x0130 }, + { 0x0013, 0x0131 }, + { 0x0013, 0x0132 }, + { 0x0013, 0x0133 }, + { 0x0013, 0x0134 }, + { 0x0013, 0x0135 }, + { 0x0013, 0x0136 }, + { 0x0013, 0x0137 }, + { 0x0013, 0x0138 }, + { 0x0013, 0x0139 }, + { 0x0013, 0x013a }, + { 0x0013, 0x013b }, + { 0x0013, 0x013c }, + { 0x0013, 0x013d }, + { 0x0013, 0x013e }, + { 0x0013, 0x013f }, + { 0x0013, 0x0140 }, + { 0x0013, 0x0141 }, + { 0x0013, 0x0142 }, + { 0x0013, 0x0143 }, + { 0x0013, 0x0144 }, + { 0x0013, 0x0145 }, + { 0x0013, 0x0146 }, + { 0x0013, 0x0147 }, + { 0x0013, 0x0148 }, + { 0x0013, 0x0149 }, + { 0x0013, 0x014a }, + { 0x0013, 0x014b }, + { 0x0012, 0x00ab }, + { 0x0012, 0x00ac }, + { 0x0012, 0x00ad }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec46[61][16] = -{ - {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x00010015, 0x00010015, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, - {0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, }, - {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000018, 0x0000003f, 0x00000051, 0x00000052, 0x00010003, 0x00010003, 0x0001002b, 0x0001002b, 0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, }, - {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, 0x00030050, }, - {0x00010054, 0x00010054, 0x00010064, 0x00010064, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, - {0x0012ffff, 0x0023ffff, 0x000effff, 0x000dffff, 0x000cffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001a, 0x00000041, 0x00000079, 0x0000007a, 0x00010005, 0x00010005, 0x0001002d, 0x0001002d, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, - {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, - {0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x00030078, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, 0x0003007b, }, - {0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020056, 0x00020056, 0x00020056, 0x00020056, }, - {0x00010007, 0x00010007, 0x0001002f, 0x0001002f, 0x00010043, 0x00010043, 0x00010069, 0x00010069, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, }, - {0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x0010ffff, 0x0011ffff, 0x000fffff, 0x00000057, 0x0000006a, 0x00000090, 0x000000a1, }, - {0x0002018e, 0x0002018e, 0x0002018e, 0x0002018e, 0x0002018f, 0x0002018f, 0x0002018f, 0x0002018f, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, - {0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, - {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020091, 0x00020091, 0x00020091, 0x00020091, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x0002018d, 0x0002018d, 0x0002018d, 0x0002018d, }, - {0x0013ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0014ffff, 0x0015ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, }, - {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, }, - {0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, }, - {0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, }, - {0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, }, - {0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010030, 0x00010030, 0x00010031, 0x00010031, }, - {0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, }, - {0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, }, - {0x00010063, 0x00010063, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, - {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, }, - {0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, }, - {0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, 0x0001008b, 0x0001008b, 0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010095, 0x00010095, 0x00010096, 0x00010096, }, - {0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, }, - {0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a2, 0x000100a2, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, }, - {0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, }, - {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, - {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c0, 0x000100c0, }, - {0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, }, - {0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x000100c3, 0x000100c3, 0x000100c4, 0x000100c4, 0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, }, - {0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, }, - {0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, }, - {0x000100d9, 0x000100d9, 0x000100da, 0x000100da, 0x000100db, 0x000100db, 0x000100dc, 0x000100dc, 0x000100dd, 0x000100dd, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, }, - {0x000100e1, 0x000100e1, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, }, - {0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, }, - {0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f3, 0x000100f3, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, }, - {0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, }, - {0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, }, - {0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, }, - {0x00010111, 0x00010111, 0x00010112, 0x00010112, 0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, - {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, - {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, - {0x00010129, 0x00010129, 0x0001012a, 0x0001012a, 0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, }, - {0x00010131, 0x00010131, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, - {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, - {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, }, - {0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, }, - {0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, }, - {0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, }, - {0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, }, - {0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, }, - {0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, }, - {0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, }, - {0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, }, +const uint32_t c_aauiCQMFHuffDec46[61][16] = { + { + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00010001, + 0x00010001, + 0x00010015, + 0x00010015, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + }, + { + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + }, + { + 0x0008ffff, + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x00000018, + 0x0000003f, + 0x00000051, + 0x00000052, + 0x00010003, + 0x00010003, + 0x0001002b, + 0x0001002b, + 0x0001003c, + 0x0001003c, + 0x0001003e, + 0x0001003e, + }, + { + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + }, + { + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + 0x00030050, + }, + { + 0x00010054, + 0x00010054, + 0x00010064, + 0x00010064, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + }, + { + 0x0012ffff, + 0x0023ffff, + 0x000effff, + 0x000dffff, + 0x000cffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x0000001a, + 0x00000041, + 0x00000079, + 0x0000007a, + 0x00010005, + 0x00010005, + 0x0001002d, + 0x0001002d, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + }, + { + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + }, + { + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x00030078, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + 0x0003007b, + }, + { + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020056, + 0x00020056, + 0x00020056, + 0x00020056, + }, + { + 0x00010007, + 0x00010007, + 0x0001002f, + 0x0001002f, + 0x00010043, + 0x00010043, + 0x00010069, + 0x00010069, + 0x0001007c, + 0x0001007c, + 0x0001007d, + 0x0001007d, + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + }, + { + 0x0034ffff, + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + 0x0039ffff, + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x0010ffff, + 0x0011ffff, + 0x000fffff, + 0x00000057, + 0x0000006a, + 0x00000090, + 0x000000a1, + }, + { + 0x0002018e, + 0x0002018e, + 0x0002018e, + 0x0002018e, + 0x0002018f, + 0x0002018f, + 0x0002018f, + 0x0002018f, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + }, + { + 0x00010189, + 0x00010189, + 0x0001018a, + 0x0001018a, + 0x0001018b, + 0x0001018b, + 0x0001018c, + 0x0001018c, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, + { + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x0002018d, + 0x0002018d, + 0x0002018d, + 0x0002018d, + }, + { + 0x0013ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0014ffff, + 0x0015ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + }, + { + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + }, + { + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + }, + { + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + }, + { + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + }, + { + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + }, + { + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + }, + { + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + }, + { + 0x00010063, + 0x00010063, + 0x0001006b, + 0x0001006b, + 0x0001006c, + 0x0001006c, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010070, + 0x00010070, + 0x00010071, + 0x00010071, + }, + { + 0x00010072, + 0x00010072, + 0x00010073, + 0x00010073, + 0x00010074, + 0x00010074, + 0x00010075, + 0x00010075, + 0x00010076, + 0x00010076, + 0x00010077, + 0x00010077, + 0x0001007e, + 0x0001007e, + 0x0001007f, + 0x0001007f, + }, + { + 0x00010080, + 0x00010080, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + 0x00010083, + 0x00010083, + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + }, + { + 0x00010088, + 0x00010088, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + 0x0001008b, + 0x0001008b, + 0x00010092, + 0x00010092, + 0x00010093, + 0x00010093, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + }, + { + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + }, + { + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a2, + 0x000100a2, + 0x000100a4, + 0x000100a4, + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100a8, + 0x000100a8, + }, + { + 0x000100a9, + 0x000100a9, + 0x000100aa, + 0x000100aa, + 0x000100ab, + 0x000100ab, + 0x000100ac, + 0x000100ac, + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + }, + { + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + 0x000100b4, + 0x000100b4, + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + }, + { + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + 0x000100bc, + 0x000100bc, + 0x000100bd, + 0x000100bd, + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + 0x000100c0, + 0x000100c0, + }, + { + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + }, + { + 0x000100c1, + 0x000100c1, + 0x000100c2, + 0x000100c2, + 0x000100c3, + 0x000100c3, + 0x000100c4, + 0x000100c4, + 0x000100c5, + 0x000100c5, + 0x000100c6, + 0x000100c6, + 0x000100c7, + 0x000100c7, + 0x000100c8, + 0x000100c8, + }, + { + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x000100cb, + 0x000100cb, + 0x000100cc, + 0x000100cc, + 0x000100cd, + 0x000100cd, + 0x000100ce, + 0x000100ce, + 0x000100cf, + 0x000100cf, + 0x000100d0, + 0x000100d0, + }, + { + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100d3, + 0x000100d3, + 0x000100d4, + 0x000100d4, + 0x000100d5, + 0x000100d5, + 0x000100d6, + 0x000100d6, + 0x000100d7, + 0x000100d7, + 0x000100d8, + 0x000100d8, + }, + { + 0x000100d9, + 0x000100d9, + 0x000100da, + 0x000100da, + 0x000100db, + 0x000100db, + 0x000100dc, + 0x000100dc, + 0x000100dd, + 0x000100dd, + 0x000100de, + 0x000100de, + 0x000100df, + 0x000100df, + 0x000100e0, + 0x000100e0, + }, + { + 0x000100e1, + 0x000100e1, + 0x000100e2, + 0x000100e2, + 0x000100e3, + 0x000100e3, + 0x000100e4, + 0x000100e4, + 0x000100e5, + 0x000100e5, + 0x000100e6, + 0x000100e6, + 0x000100e7, + 0x000100e7, + 0x000100e8, + 0x000100e8, + }, + { + 0x000100e9, + 0x000100e9, + 0x000100ea, + 0x000100ea, + 0x000100eb, + 0x000100eb, + 0x000100ec, + 0x000100ec, + 0x000100ed, + 0x000100ed, + 0x000100ee, + 0x000100ee, + 0x000100ef, + 0x000100ef, + 0x000100f0, + 0x000100f0, + }, + { + 0x000100f1, + 0x000100f1, + 0x000100f2, + 0x000100f2, + 0x000100f3, + 0x000100f3, + 0x000100f4, + 0x000100f4, + 0x000100f5, + 0x000100f5, + 0x000100f6, + 0x000100f6, + 0x000100f7, + 0x000100f7, + 0x000100f8, + 0x000100f8, + }, + { + 0x000100f9, + 0x000100f9, + 0x000100fa, + 0x000100fa, + 0x000100fb, + 0x000100fb, + 0x000100fc, + 0x000100fc, + 0x000100fd, + 0x000100fd, + 0x000100fe, + 0x000100fe, + 0x000100ff, + 0x000100ff, + 0x00010100, + 0x00010100, + }, + { + 0x00010101, + 0x00010101, + 0x00010102, + 0x00010102, + 0x00010103, + 0x00010103, + 0x00010104, + 0x00010104, + 0x00010105, + 0x00010105, + 0x00010106, + 0x00010106, + 0x00010107, + 0x00010107, + 0x00010108, + 0x00010108, + }, + { + 0x00010109, + 0x00010109, + 0x0001010a, + 0x0001010a, + 0x0001010b, + 0x0001010b, + 0x0001010c, + 0x0001010c, + 0x0001010d, + 0x0001010d, + 0x0001010e, + 0x0001010e, + 0x0001010f, + 0x0001010f, + 0x00010110, + 0x00010110, + }, + { + 0x00010111, + 0x00010111, + 0x00010112, + 0x00010112, + 0x00010113, + 0x00010113, + 0x00010114, + 0x00010114, + 0x00010115, + 0x00010115, + 0x00010116, + 0x00010116, + 0x00010117, + 0x00010117, + 0x00010118, + 0x00010118, + }, + { + 0x00010119, + 0x00010119, + 0x0001011a, + 0x0001011a, + 0x0001011b, + 0x0001011b, + 0x0001011c, + 0x0001011c, + 0x0001011d, + 0x0001011d, + 0x0001011e, + 0x0001011e, + 0x0001011f, + 0x0001011f, + 0x00010120, + 0x00010120, + }, + { + 0x00010121, + 0x00010121, + 0x00010122, + 0x00010122, + 0x00010123, + 0x00010123, + 0x00010124, + 0x00010124, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010127, + 0x00010127, + 0x00010128, + 0x00010128, + }, + { + 0x00010129, + 0x00010129, + 0x0001012a, + 0x0001012a, + 0x0001012b, + 0x0001012b, + 0x0001012c, + 0x0001012c, + 0x0001012d, + 0x0001012d, + 0x0001012e, + 0x0001012e, + 0x0001012f, + 0x0001012f, + 0x00010130, + 0x00010130, + }, + { + 0x00010131, + 0x00010131, + 0x00010132, + 0x00010132, + 0x00010133, + 0x00010133, + 0x00010134, + 0x00010134, + 0x00010135, + 0x00010135, + 0x00010136, + 0x00010136, + 0x00010137, + 0x00010137, + 0x00010138, + 0x00010138, + }, + { + 0x00010139, + 0x00010139, + 0x0001013a, + 0x0001013a, + 0x0001013b, + 0x0001013b, + 0x0001013c, + 0x0001013c, + 0x0001013d, + 0x0001013d, + 0x0001013e, + 0x0001013e, + 0x0001013f, + 0x0001013f, + 0x00010140, + 0x00010140, + }, + { + 0x00010141, + 0x00010141, + 0x00010142, + 0x00010142, + 0x00010143, + 0x00010143, + 0x00010144, + 0x00010144, + 0x00010145, + 0x00010145, + 0x00010146, + 0x00010146, + 0x00010147, + 0x00010147, + 0x00010148, + 0x00010148, + }, + { + 0x00010149, + 0x00010149, + 0x0001014a, + 0x0001014a, + 0x0001014b, + 0x0001014b, + 0x0001014c, + 0x0001014c, + 0x0001014d, + 0x0001014d, + 0x0001014e, + 0x0001014e, + 0x0001014f, + 0x0001014f, + 0x00010150, + 0x00010150, + }, + { + 0x00010151, + 0x00010151, + 0x00010152, + 0x00010152, + 0x00010153, + 0x00010153, + 0x00010154, + 0x00010154, + 0x00010155, + 0x00010155, + 0x00010156, + 0x00010156, + 0x00010157, + 0x00010157, + 0x00010158, + 0x00010158, + }, + { + 0x00010159, + 0x00010159, + 0x0001015a, + 0x0001015a, + 0x0001015b, + 0x0001015b, + 0x0001015c, + 0x0001015c, + 0x0001015d, + 0x0001015d, + 0x0001015e, + 0x0001015e, + 0x0001015f, + 0x0001015f, + 0x00010160, + 0x00010160, + }, + { + 0x00010161, + 0x00010161, + 0x00010162, + 0x00010162, + 0x00010163, + 0x00010163, + 0x00010164, + 0x00010164, + 0x00010165, + 0x00010165, + 0x00010166, + 0x00010166, + 0x00010167, + 0x00010167, + 0x00010168, + 0x00010168, + }, + { + 0x00010169, + 0x00010169, + 0x0001016a, + 0x0001016a, + 0x0001016b, + 0x0001016b, + 0x0001016c, + 0x0001016c, + 0x0001016d, + 0x0001016d, + 0x0001016e, + 0x0001016e, + 0x0001016f, + 0x0001016f, + 0x00010170, + 0x00010170, + }, + { + 0x00010171, + 0x00010171, + 0x00010172, + 0x00010172, + 0x00010173, + 0x00010173, + 0x00010174, + 0x00010174, + 0x00010175, + 0x00010175, + 0x00010176, + 0x00010176, + 0x00010177, + 0x00010177, + 0x00010178, + 0x00010178, + }, + { + 0x00010179, + 0x00010179, + 0x0001017a, + 0x0001017a, + 0x0001017b, + 0x0001017b, + 0x0001017c, + 0x0001017c, + 0x0001017d, + 0x0001017d, + 0x0001017e, + 0x0001017e, + 0x0001017f, + 0x0001017f, + 0x00010180, + 0x00010180, + }, + { + 0x00010181, + 0x00010181, + 0x00010182, + 0x00010182, + 0x00010183, + 0x00010183, + 0x00010184, + 0x00010184, + 0x00010185, + 0x00010185, + 0x00010186, + 0x00010186, + 0x00010187, + 0x00010187, + 0x00010188, + 0x00010188, + }, }; #endif @@ -3012,171 +30672,2153 @@ const uint32_t c_aauiCQMFHuffEnc47[576][2] = #else const uint16_t c_aauiCQMFHuffEnc47[576][2] = #endif -{ - {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0005}, {0x0006, 0x0004}, {0x0008, 0x0006}, {0x000a, 0x0007}, {0x000c, 0x000b}, {0x000d, 0x000d}, - {0x0010, 0x0041}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, - {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, - {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0005}, {0x0009, 0x0006}, {0x000b, 0x0007}, {0x000d, 0x000e}, - {0x000f, 0x0025}, {0x000f, 0x0026}, {0x0012, 0x00f6}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, - {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, - {0x0005, 0x0006}, {0x0004, 0x0005}, {0x0005, 0x0007}, {0x0006, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0007}, {0x000b, 0x0008}, {0x000d, 0x000f}, - {0x000f, 0x0027}, {0x0012, 0x00f7}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, - {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, - {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0006}, {0x0009, 0x0008}, {0x000a, 0x0008}, {0x000c, 0x000c}, {0x000e, 0x0017}, - {0x0010, 0x0042}, {0x0012, 0x00f8}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, {0x0013, 0x002f}, - {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, - {0x0008, 0x0008}, {0x0007, 0x0007}, {0x0008, 0x0009}, {0x0009, 0x0009}, {0x000a, 0x0009}, {0x000b, 0x0009}, {0x000d, 0x0010}, {0x000f, 0x0028}, - {0x000f, 0x0029}, {0x0011, 0x007f}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, - {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, - {0x000a, 0x000a}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000b, 0x000a}, {0x000d, 0x0011}, {0x000f, 0x002a}, {0x0010, 0x0043}, - {0x0012, 0x00f9}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, - {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, - {0x000b, 0x000b}, {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x000d}, {0x000d, 0x0012}, {0x000e, 0x0018}, {0x0010, 0x0044}, {0x0013, 0x0055}, - {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, - {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, - {0x000e, 0x0019}, {0x000d, 0x0013}, {0x000d, 0x0014}, {0x000d, 0x0015}, {0x000f, 0x002b}, {0x0010, 0x0045}, {0x0013, 0x0066}, {0x0012, 0x00fa}, - {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, - {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, - {0x0010, 0x0046}, {0x000f, 0x002c}, {0x000f, 0x002d}, {0x0010, 0x0047}, {0x0011, 0x0080}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, - {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, - {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, - {0x0013, 0x008a}, {0x0010, 0x0048}, {0x0010, 0x0049}, {0x0011, 0x0081}, {0x0013, 0x008b}, {0x0012, 0x00fb}, {0x0013, 0x008c}, {0x0013, 0x008d}, - {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, - {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, - {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0012, 0x00fc}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, - {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, - {0x0013, 0x00ad}, {0x0013, 0x00ae}, {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, - {0x0013, 0x00b5}, {0x0013, 0x00b6}, {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, - {0x0013, 0x00bd}, {0x0013, 0x00be}, {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, - {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, - {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, - {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, {0x0013, 0x00dc}, - {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, {0x0013, 0x00e4}, - {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, {0x0013, 0x00ec}, - {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, {0x0013, 0x00f4}, - {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, {0x0013, 0x00fc}, - {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, {0x0013, 0x0104}, - {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, {0x0013, 0x010c}, - {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, {0x0013, 0x0114}, - {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, {0x0013, 0x011c}, - {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, {0x0013, 0x0124}, - {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, {0x0013, 0x012c}, - {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, {0x0013, 0x0134}, - {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, {0x0013, 0x013c}, - {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, {0x0013, 0x0144}, - {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, {0x0013, 0x014c}, - {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, {0x0013, 0x0154}, - {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, {0x0013, 0x015c}, - {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, {0x0013, 0x0164}, - {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, {0x0013, 0x016c}, - {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, {0x0013, 0x0174}, - {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, {0x0013, 0x017c}, - {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, {0x0013, 0x0184}, - {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, {0x0013, 0x018c}, - {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, {0x0013, 0x0194}, - {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, {0x0013, 0x019c}, - {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, {0x0013, 0x01a4}, - {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, {0x0013, 0x01ac}, - {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, {0x0013, 0x01b4}, - {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, {0x0013, 0x01bc}, - {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, {0x0013, 0x01c4}, - {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, {0x0013, 0x01cc}, - {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, {0x0013, 0x01d4}, - {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, {0x0013, 0x01dc}, - {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, {0x0013, 0x01e4}, - {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, {0x0012, 0x00fd}, -}; + { + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0005 }, + { 0x0006, 0x0004 }, + { 0x0008, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000c, 0x000b }, + { 0x000d, 0x000d }, + { 0x0010, 0x0041 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0004, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000d, 0x000e }, + { 0x000f, 0x0025 }, + { 0x000f, 0x0026 }, + { 0x0012, 0x00f6 }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0005, 0x0006 }, + { 0x0004, 0x0005 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0009, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000d, 0x000f }, + { 0x000f, 0x0027 }, + { 0x0012, 0x00f7 }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0007, 0x0006 }, + { 0x0009, 0x0008 }, + { 0x000a, 0x0008 }, + { 0x000c, 0x000c }, + { 0x000e, 0x0017 }, + { 0x0010, 0x0042 }, + { 0x0012, 0x00f8 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0008, 0x0008 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0009 }, + { 0x000a, 0x0009 }, + { 0x000b, 0x0009 }, + { 0x000d, 0x0010 }, + { 0x000f, 0x0028 }, + { 0x000f, 0x0029 }, + { 0x0011, 0x007f }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x000a, 0x000a }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x000a, 0x000b }, + { 0x000b, 0x000a }, + { 0x000d, 0x0011 }, + { 0x000f, 0x002a }, + { 0x0010, 0x0043 }, + { 0x0012, 0x00f9 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x000b, 0x000b }, + { 0x000b, 0x000c }, + { 0x000b, 0x000d }, + { 0x000c, 0x000d }, + { 0x000d, 0x0012 }, + { 0x000e, 0x0018 }, + { 0x0010, 0x0044 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x000e, 0x0019 }, + { 0x000d, 0x0013 }, + { 0x000d, 0x0014 }, + { 0x000d, 0x0015 }, + { 0x000f, 0x002b }, + { 0x0010, 0x0045 }, + { 0x0013, 0x0066 }, + { 0x0012, 0x00fa }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0010, 0x0046 }, + { 0x000f, 0x002c }, + { 0x000f, 0x002d }, + { 0x0010, 0x0047 }, + { 0x0011, 0x0080 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0010, 0x0048 }, + { 0x0010, 0x0049 }, + { 0x0011, 0x0081 }, + { 0x0013, 0x008b }, + { 0x0012, 0x00fb }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0013, 0x0095 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0013, 0x009c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, + { 0x0013, 0x00a0 }, + { 0x0012, 0x00fc }, + { 0x0013, 0x00a1 }, + { 0x0013, 0x00a2 }, + { 0x0013, 0x00a3 }, + { 0x0013, 0x00a4 }, + { 0x0013, 0x00a5 }, + { 0x0013, 0x00a6 }, + { 0x0013, 0x00a7 }, + { 0x0013, 0x00a8 }, + { 0x0013, 0x00a9 }, + { 0x0013, 0x00aa }, + { 0x0013, 0x00ab }, + { 0x0013, 0x00ac }, + { 0x0013, 0x00ad }, + { 0x0013, 0x00ae }, + { 0x0013, 0x00af }, + { 0x0013, 0x00b0 }, + { 0x0013, 0x00b1 }, + { 0x0013, 0x00b2 }, + { 0x0013, 0x00b3 }, + { 0x0013, 0x00b4 }, + { 0x0013, 0x00b5 }, + { 0x0013, 0x00b6 }, + { 0x0013, 0x00b7 }, + { 0x0013, 0x00b8 }, + { 0x0013, 0x00b9 }, + { 0x0013, 0x00ba }, + { 0x0013, 0x00bb }, + { 0x0013, 0x00bc }, + { 0x0013, 0x00bd }, + { 0x0013, 0x00be }, + { 0x0013, 0x00bf }, + { 0x0013, 0x00c0 }, + { 0x0013, 0x00c1 }, + { 0x0013, 0x00c2 }, + { 0x0013, 0x00c3 }, + { 0x0013, 0x00c4 }, + { 0x0013, 0x00c5 }, + { 0x0013, 0x00c6 }, + { 0x0013, 0x00c7 }, + { 0x0013, 0x00c8 }, + { 0x0013, 0x00c9 }, + { 0x0013, 0x00ca }, + { 0x0013, 0x00cb }, + { 0x0013, 0x00cc }, + { 0x0013, 0x00cd }, + { 0x0013, 0x00ce }, + { 0x0013, 0x00cf }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0013, 0x00d2 }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0013, 0x00d5 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0013, 0x00d8 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0013, 0x00db }, + { 0x0013, 0x00dc }, + { 0x0013, 0x00dd }, + { 0x0013, 0x00de }, + { 0x0013, 0x00df }, + { 0x0013, 0x00e0 }, + { 0x0013, 0x00e1 }, + { 0x0013, 0x00e2 }, + { 0x0013, 0x00e3 }, + { 0x0013, 0x00e4 }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0013, 0x00e9 }, + { 0x0013, 0x00ea }, + { 0x0013, 0x00eb }, + { 0x0013, 0x00ec }, + { 0x0013, 0x00ed }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0013, 0x00f0 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, + { 0x0013, 0x0110 }, + { 0x0013, 0x0111 }, + { 0x0013, 0x0112 }, + { 0x0013, 0x0113 }, + { 0x0013, 0x0114 }, + { 0x0013, 0x0115 }, + { 0x0013, 0x0116 }, + { 0x0013, 0x0117 }, + { 0x0013, 0x0118 }, + { 0x0013, 0x0119 }, + { 0x0013, 0x011a }, + { 0x0013, 0x011b }, + { 0x0013, 0x011c }, + { 0x0013, 0x011d }, + { 0x0013, 0x011e }, + { 0x0013, 0x011f }, + { 0x0013, 0x0120 }, + { 0x0013, 0x0121 }, + { 0x0013, 0x0122 }, + { 0x0013, 0x0123 }, + { 0x0013, 0x0124 }, + { 0x0013, 0x0125 }, + { 0x0013, 0x0126 }, + { 0x0013, 0x0127 }, + { 0x0013, 0x0128 }, + { 0x0013, 0x0129 }, + { 0x0013, 0x012a }, + { 0x0013, 0x012b }, + { 0x0013, 0x012c }, + { 0x0013, 0x012d }, + { 0x0013, 0x012e }, + { 0x0013, 0x012f }, + { 0x0013, 0x0130 }, + { 0x0013, 0x0131 }, + { 0x0013, 0x0132 }, + { 0x0013, 0x0133 }, + { 0x0013, 0x0134 }, + { 0x0013, 0x0135 }, + { 0x0013, 0x0136 }, + { 0x0013, 0x0137 }, + { 0x0013, 0x0138 }, + { 0x0013, 0x0139 }, + { 0x0013, 0x013a }, + { 0x0013, 0x013b }, + { 0x0013, 0x013c }, + { 0x0013, 0x013d }, + { 0x0013, 0x013e }, + { 0x0013, 0x013f }, + { 0x0013, 0x0140 }, + { 0x0013, 0x0141 }, + { 0x0013, 0x0142 }, + { 0x0013, 0x0143 }, + { 0x0013, 0x0144 }, + { 0x0013, 0x0145 }, + { 0x0013, 0x0146 }, + { 0x0013, 0x0147 }, + { 0x0013, 0x0148 }, + { 0x0013, 0x0149 }, + { 0x0013, 0x014a }, + { 0x0013, 0x014b }, + { 0x0013, 0x014c }, + { 0x0013, 0x014d }, + { 0x0013, 0x014e }, + { 0x0013, 0x014f }, + { 0x0013, 0x0150 }, + { 0x0013, 0x0151 }, + { 0x0013, 0x0152 }, + { 0x0013, 0x0153 }, + { 0x0013, 0x0154 }, + { 0x0013, 0x0155 }, + { 0x0013, 0x0156 }, + { 0x0013, 0x0157 }, + { 0x0013, 0x0158 }, + { 0x0013, 0x0159 }, + { 0x0013, 0x015a }, + { 0x0013, 0x015b }, + { 0x0013, 0x015c }, + { 0x0013, 0x015d }, + { 0x0013, 0x015e }, + { 0x0013, 0x015f }, + { 0x0013, 0x0160 }, + { 0x0013, 0x0161 }, + { 0x0013, 0x0162 }, + { 0x0013, 0x0163 }, + { 0x0013, 0x0164 }, + { 0x0013, 0x0165 }, + { 0x0013, 0x0166 }, + { 0x0013, 0x0167 }, + { 0x0013, 0x0168 }, + { 0x0013, 0x0169 }, + { 0x0013, 0x016a }, + { 0x0013, 0x016b }, + { 0x0013, 0x016c }, + { 0x0013, 0x016d }, + { 0x0013, 0x016e }, + { 0x0013, 0x016f }, + { 0x0013, 0x0170 }, + { 0x0013, 0x0171 }, + { 0x0013, 0x0172 }, + { 0x0013, 0x0173 }, + { 0x0013, 0x0174 }, + { 0x0013, 0x0175 }, + { 0x0013, 0x0176 }, + { 0x0013, 0x0177 }, + { 0x0013, 0x0178 }, + { 0x0013, 0x0179 }, + { 0x0013, 0x017a }, + { 0x0013, 0x017b }, + { 0x0013, 0x017c }, + { 0x0013, 0x017d }, + { 0x0013, 0x017e }, + { 0x0013, 0x017f }, + { 0x0013, 0x0180 }, + { 0x0013, 0x0181 }, + { 0x0013, 0x0182 }, + { 0x0013, 0x0183 }, + { 0x0013, 0x0184 }, + { 0x0013, 0x0185 }, + { 0x0013, 0x0186 }, + { 0x0013, 0x0187 }, + { 0x0013, 0x0188 }, + { 0x0013, 0x0189 }, + { 0x0013, 0x018a }, + { 0x0013, 0x018b }, + { 0x0013, 0x018c }, + { 0x0013, 0x018d }, + { 0x0013, 0x018e }, + { 0x0013, 0x018f }, + { 0x0013, 0x0190 }, + { 0x0013, 0x0191 }, + { 0x0013, 0x0192 }, + { 0x0013, 0x0193 }, + { 0x0013, 0x0194 }, + { 0x0013, 0x0195 }, + { 0x0013, 0x0196 }, + { 0x0013, 0x0197 }, + { 0x0013, 0x0198 }, + { 0x0013, 0x0199 }, + { 0x0013, 0x019a }, + { 0x0013, 0x019b }, + { 0x0013, 0x019c }, + { 0x0013, 0x019d }, + { 0x0013, 0x019e }, + { 0x0013, 0x019f }, + { 0x0013, 0x01a0 }, + { 0x0013, 0x01a1 }, + { 0x0013, 0x01a2 }, + { 0x0013, 0x01a3 }, + { 0x0013, 0x01a4 }, + { 0x0013, 0x01a5 }, + { 0x0013, 0x01a6 }, + { 0x0013, 0x01a7 }, + { 0x0013, 0x01a8 }, + { 0x0013, 0x01a9 }, + { 0x0013, 0x01aa }, + { 0x0013, 0x01ab }, + { 0x0013, 0x01ac }, + { 0x0013, 0x01ad }, + { 0x0013, 0x01ae }, + { 0x0013, 0x01af }, + { 0x0013, 0x01b0 }, + { 0x0013, 0x01b1 }, + { 0x0013, 0x01b2 }, + { 0x0013, 0x01b3 }, + { 0x0013, 0x01b4 }, + { 0x0013, 0x01b5 }, + { 0x0013, 0x01b6 }, + { 0x0013, 0x01b7 }, + { 0x0013, 0x01b8 }, + { 0x0013, 0x01b9 }, + { 0x0013, 0x01ba }, + { 0x0013, 0x01bb }, + { 0x0013, 0x01bc }, + { 0x0013, 0x01bd }, + { 0x0013, 0x01be }, + { 0x0013, 0x01bf }, + { 0x0013, 0x01c0 }, + { 0x0013, 0x01c1 }, + { 0x0013, 0x01c2 }, + { 0x0013, 0x01c3 }, + { 0x0013, 0x01c4 }, + { 0x0013, 0x01c5 }, + { 0x0013, 0x01c6 }, + { 0x0013, 0x01c7 }, + { 0x0013, 0x01c8 }, + { 0x0013, 0x01c9 }, + { 0x0013, 0x01ca }, + { 0x0013, 0x01cb }, + { 0x0013, 0x01cc }, + { 0x0013, 0x01cd }, + { 0x0013, 0x01ce }, + { 0x0013, 0x01cf }, + { 0x0013, 0x01d0 }, + { 0x0013, 0x01d1 }, + { 0x0013, 0x01d2 }, + { 0x0013, 0x01d3 }, + { 0x0013, 0x01d4 }, + { 0x0013, 0x01d5 }, + { 0x0013, 0x01d6 }, + { 0x0013, 0x01d7 }, + { 0x0013, 0x01d8 }, + { 0x0013, 0x01d9 }, + { 0x0013, 0x01da }, + { 0x0013, 0x01db }, + { 0x0013, 0x01dc }, + { 0x0013, 0x01dd }, + { 0x0013, 0x01de }, + { 0x0013, 0x01df }, + { 0x0013, 0x01e0 }, + { 0x0013, 0x01e1 }, + { 0x0013, 0x01e2 }, + { 0x0013, 0x01e3 }, + { 0x0013, 0x01e4 }, + { 0x0013, 0x01e5 }, + { 0x0013, 0x01e6 }, + { 0x0013, 0x01e7 }, + { 0x0013, 0x01e8 }, + { 0x0013, 0x01e9 }, + { 0x0013, 0x01ea }, + { 0x0013, 0x01eb }, + { 0x0012, 0x00fd }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec47[87][16] = -{ - {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x0000001a, 0x00000031, 0x00010001, 0x00010001, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, - {0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020048, 0x00020048, 0x00020048, 0x00020048, }, - {0x000affff, 0x0008ffff, 0x0009ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x00000004, 0x00000034, 0x00000060, 0x00000062, 0x0001001c, 0x0001001c, 0x0001004b, 0x0001004b, 0x00010061, 0x00010061, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, }, - {0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x00030079, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, 0x0003007a, }, - {0x00010036, 0x00010036, 0x00010065, 0x00010065, 0x0001007c, 0x0001007c, 0x00010090, 0x00010090, 0x00010091, 0x00010091, 0x00010092, 0x00010092, 0x00020005, 0x00020005, 0x00020005, 0x00020005, }, - {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, }, - {0x0017ffff, 0x0028ffff, 0x0039ffff, 0x0012ffff, 0x0011ffff, 0x0010ffff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000006, 0x0000004e, 0x00000093, 0x0001001e, 0x0001001e, }, - {0x00020095, 0x00020095, 0x00020095, 0x00020095, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, }, - {0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x00030066, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, 0x0003007d, }, - {0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x00030094, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, - {0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300aa, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, }, - {0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x0001007e, 0x0001007e, 0x000100ac, 0x000100ac, 0x000100c1, 0x000100c1, 0x000100c2, 0x000100c2, 0x0002004f, 0x0002004f, 0x0002004f, 0x0002004f, }, - {0x0014ffff, 0x00000008, 0x00000050, 0x0000007f, 0x00000096, 0x000000ad, 0x000000c0, 0x000000c3, 0x000000d9, 0x000000da, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x00010038, 0x00010038, }, - {0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0016ffff, 0x0015ffff, 0x0013ffff, }, - {0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x0002023f, 0x0002023f, 0x0002023f, 0x0002023f, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, 0x00030069, }, - {0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300c4, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, 0x000300db, }, - {0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x000200af, 0x000200af, 0x000200af, 0x000200af, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, }, - {0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x001bffff, 0x001affff, 0x001dffff, 0x001cffff, 0x0020ffff, 0x0018ffff, 0x0019ffff, 0x001effff, 0x001fffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, }, - {0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, - {0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, }, - {0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010023, 0x00010023, }, - {0x00010009, 0x00010009, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, }, - {0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x0001003a, 0x0001003a, 0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, }, - {0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, }, - {0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0001006c, 0x0001006c, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010070, 0x00010070, 0x00010071, 0x00010071, }, - {0x00010072, 0x00010072, 0x00010073, 0x00010073, 0x00010074, 0x00010074, 0x00010075, 0x00010075, 0x00010076, 0x00010076, 0x00010077, 0x00010077, 0x00010081, 0x00010081, 0x00010082, 0x00010082, }, - {0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, }, - {0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010087, 0x00010087, 0x00010088, 0x00010088, 0x00010089, 0x00010089, 0x0001008a, 0x0001008a, }, - {0x0001008b, 0x0001008b, 0x0001008c, 0x0001008c, 0x0001008d, 0x0001008d, 0x0001008e, 0x0001008e, 0x0001008f, 0x0001008f, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, }, - {0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, }, - {0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, 0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100ae, 0x000100ae, 0x000100b0, 0x000100b0, }, - {0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, }, - {0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, 0x000100bd, 0x000100bd, 0x000100be, 0x000100be, 0x000100bf, 0x000100bf, 0x000100c5, 0x000100c5, }, - {0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, }, - {0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, 0x002effff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, }, - {0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, - {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100d8, 0x000100d8, 0x000100dc, 0x000100dc, 0x000100de, 0x000100de, 0x000100df, 0x000100df, 0x000100e0, 0x000100e0, 0x000100e1, 0x000100e1, }, - {0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, }, - {0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, }, - {0x000100f2, 0x000100f2, 0x000100f4, 0x000100f4, 0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x000100f7, 0x000100f7, 0x000100f8, 0x000100f8, 0x000100f9, 0x000100f9, 0x000100fa, 0x000100fa, }, - {0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, }, - {0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, }, - {0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x0001010e, 0x0001010e, 0x0001010f, 0x0001010f, 0x00010110, 0x00010110, 0x00010111, 0x00010111, 0x00010112, 0x00010112, }, - {0x00010113, 0x00010113, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, 0x0001011a, 0x0001011a, }, - {0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, 0x00010122, 0x00010122, }, - {0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x00010129, 0x00010129, 0x0001012a, 0x0001012a, }, - {0x0001012b, 0x0001012b, 0x0001012c, 0x0001012c, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, }, - {0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, }, - {0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, }, - {0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010146, 0x00010146, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, }, - {0x0001014b, 0x0001014b, 0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, }, - {0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, }, - {0x00010153, 0x00010153, 0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, }, - {0x0001015b, 0x0001015b, 0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, }, - {0x00010163, 0x00010163, 0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, }, - {0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, }, - {0x00010173, 0x00010173, 0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, }, - {0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, }, - {0x00010183, 0x00010183, 0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, }, - {0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, }, - {0x00010193, 0x00010193, 0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, }, - {0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, }, - {0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, }, - {0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, }, - {0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, }, - {0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, }, - {0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, }, - {0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, }, - {0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, }, - {0x000101db, 0x000101db, 0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, }, - {0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, }, - {0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, }, - {0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, }, - {0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, }, - {0x00010203, 0x00010203, 0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, }, - {0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, }, - {0x00010213, 0x00010213, 0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, }, - {0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, }, - {0x00010223, 0x00010223, 0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, }, - {0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, }, - {0x00010233, 0x00010233, 0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, }, +const uint32_t c_aauiCQMFHuffDec47[87][16] = { + { + 0x0004ffff, + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x0000001a, + 0x00000031, + 0x00010001, + 0x00010001, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + }, + { + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + }, + { + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + }, + { + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x00000004, + 0x00000034, + 0x00000060, + 0x00000062, + 0x0001001c, + 0x0001001c, + 0x0001004b, + 0x0001004b, + 0x00010061, + 0x00010061, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + }, + { + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x00030079, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + 0x0003007a, + }, + { + 0x00010036, + 0x00010036, + 0x00010065, + 0x00010065, + 0x0001007c, + 0x0001007c, + 0x00010090, + 0x00010090, + 0x00010091, + 0x00010091, + 0x00010092, + 0x00010092, + 0x00020005, + 0x00020005, + 0x00020005, + 0x00020005, + }, + { + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + }, + { + 0x0017ffff, + 0x0028ffff, + 0x0039ffff, + 0x0012ffff, + 0x0011ffff, + 0x0010ffff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x00000006, + 0x0000004e, + 0x00000093, + 0x0001001e, + 0x0001001e, + }, + { + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020095, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + }, + { + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x00030066, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + 0x0003007d, + }, + { + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x00030094, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + }, + { + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300aa, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + }, + { + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x0001007e, + 0x0001007e, + 0x000100ac, + 0x000100ac, + 0x000100c1, + 0x000100c1, + 0x000100c2, + 0x000100c2, + 0x0002004f, + 0x0002004f, + 0x0002004f, + 0x0002004f, + }, + { + 0x0014ffff, + 0x00000008, + 0x00000050, + 0x0000007f, + 0x00000096, + 0x000000ad, + 0x000000c0, + 0x000000c3, + 0x000000d9, + 0x000000da, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + 0x00010038, + 0x00010038, + }, + { + 0x004affff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + 0x0050ffff, + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + 0x0054ffff, + 0x0055ffff, + 0x0056ffff, + 0x0016ffff, + 0x0015ffff, + 0x0013ffff, + }, + { + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x0002023f, + 0x0002023f, + 0x0002023f, + 0x0002023f, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + 0x00030069, + }, + { + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300c4, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + 0x000300db, + }, + { + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200af, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200dd, + }, + { + 0x0001023b, + 0x0001023b, + 0x0001023c, + 0x0001023c, + 0x0001023d, + 0x0001023d, + 0x0001023e, + 0x0001023e, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x001bffff, + 0x001affff, + 0x001dffff, + 0x001cffff, + 0x0020ffff, + 0x0018ffff, + 0x0019ffff, + 0x001effff, + 0x001fffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + }, + { + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + }, + { + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x0001005a, + 0x0001005a, + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + }, + { + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010023, + 0x00010023, + }, + { + 0x00010009, + 0x00010009, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + }, + { + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x0001003a, + 0x0001003a, + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + }, + { + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + }, + { + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + 0x0001006c, + 0x0001006c, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010070, + 0x00010070, + 0x00010071, + 0x00010071, + }, + { + 0x00010072, + 0x00010072, + 0x00010073, + 0x00010073, + 0x00010074, + 0x00010074, + 0x00010075, + 0x00010075, + 0x00010076, + 0x00010076, + 0x00010077, + 0x00010077, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + }, + { + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + }, + { + 0x00010083, + 0x00010083, + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010087, + 0x00010087, + 0x00010088, + 0x00010088, + 0x00010089, + 0x00010089, + 0x0001008a, + 0x0001008a, + }, + { + 0x0001008b, + 0x0001008b, + 0x0001008c, + 0x0001008c, + 0x0001008d, + 0x0001008d, + 0x0001008e, + 0x0001008e, + 0x0001008f, + 0x0001008f, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + }, + { + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a1, + 0x000100a1, + }, + { + 0x000100a2, + 0x000100a2, + 0x000100a3, + 0x000100a3, + 0x000100a4, + 0x000100a4, + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100ae, + 0x000100ae, + 0x000100b0, + 0x000100b0, + }, + { + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + 0x000100b4, + 0x000100b4, + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + }, + { + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + 0x000100bc, + 0x000100bc, + 0x000100bd, + 0x000100bd, + 0x000100be, + 0x000100be, + 0x000100bf, + 0x000100bf, + 0x000100c5, + 0x000100c5, + }, + { + 0x000100c6, + 0x000100c6, + 0x000100c7, + 0x000100c7, + 0x000100c8, + 0x000100c8, + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x000100cb, + 0x000100cb, + 0x000100cc, + 0x000100cc, + 0x000100cd, + 0x000100cd, + }, + { + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + 0x002effff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + }, + { + 0x000100ce, + 0x000100ce, + 0x000100cf, + 0x000100cf, + 0x000100d0, + 0x000100d0, + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100d3, + 0x000100d3, + 0x000100d4, + 0x000100d4, + 0x000100d5, + 0x000100d5, + }, + { + 0x000100d6, + 0x000100d6, + 0x000100d7, + 0x000100d7, + 0x000100d8, + 0x000100d8, + 0x000100dc, + 0x000100dc, + 0x000100de, + 0x000100de, + 0x000100df, + 0x000100df, + 0x000100e0, + 0x000100e0, + 0x000100e1, + 0x000100e1, + }, + { + 0x000100e2, + 0x000100e2, + 0x000100e3, + 0x000100e3, + 0x000100e4, + 0x000100e4, + 0x000100e5, + 0x000100e5, + 0x000100e6, + 0x000100e6, + 0x000100e7, + 0x000100e7, + 0x000100e8, + 0x000100e8, + 0x000100e9, + 0x000100e9, + }, + { + 0x000100ea, + 0x000100ea, + 0x000100eb, + 0x000100eb, + 0x000100ec, + 0x000100ec, + 0x000100ed, + 0x000100ed, + 0x000100ee, + 0x000100ee, + 0x000100ef, + 0x000100ef, + 0x000100f0, + 0x000100f0, + 0x000100f1, + 0x000100f1, + }, + { + 0x000100f2, + 0x000100f2, + 0x000100f4, + 0x000100f4, + 0x000100f5, + 0x000100f5, + 0x000100f6, + 0x000100f6, + 0x000100f7, + 0x000100f7, + 0x000100f8, + 0x000100f8, + 0x000100f9, + 0x000100f9, + 0x000100fa, + 0x000100fa, + }, + { + 0x000100fb, + 0x000100fb, + 0x000100fc, + 0x000100fc, + 0x000100fd, + 0x000100fd, + 0x000100fe, + 0x000100fe, + 0x000100ff, + 0x000100ff, + 0x00010100, + 0x00010100, + 0x00010101, + 0x00010101, + 0x00010102, + 0x00010102, + }, + { + 0x00010103, + 0x00010103, + 0x00010104, + 0x00010104, + 0x00010105, + 0x00010105, + 0x00010106, + 0x00010106, + 0x00010107, + 0x00010107, + 0x00010108, + 0x00010108, + 0x00010109, + 0x00010109, + 0x0001010a, + 0x0001010a, + }, + { + 0x0001010b, + 0x0001010b, + 0x0001010c, + 0x0001010c, + 0x0001010d, + 0x0001010d, + 0x0001010e, + 0x0001010e, + 0x0001010f, + 0x0001010f, + 0x00010110, + 0x00010110, + 0x00010111, + 0x00010111, + 0x00010112, + 0x00010112, + }, + { + 0x00010113, + 0x00010113, + 0x00010114, + 0x00010114, + 0x00010115, + 0x00010115, + 0x00010116, + 0x00010116, + 0x00010117, + 0x00010117, + 0x00010118, + 0x00010118, + 0x00010119, + 0x00010119, + 0x0001011a, + 0x0001011a, + }, + { + 0x0001011b, + 0x0001011b, + 0x0001011c, + 0x0001011c, + 0x0001011d, + 0x0001011d, + 0x0001011e, + 0x0001011e, + 0x0001011f, + 0x0001011f, + 0x00010120, + 0x00010120, + 0x00010121, + 0x00010121, + 0x00010122, + 0x00010122, + }, + { + 0x00010123, + 0x00010123, + 0x00010124, + 0x00010124, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010127, + 0x00010127, + 0x00010128, + 0x00010128, + 0x00010129, + 0x00010129, + 0x0001012a, + 0x0001012a, + }, + { + 0x0001012b, + 0x0001012b, + 0x0001012c, + 0x0001012c, + 0x0001012d, + 0x0001012d, + 0x0001012e, + 0x0001012e, + 0x0001012f, + 0x0001012f, + 0x00010130, + 0x00010130, + 0x00010131, + 0x00010131, + 0x00010132, + 0x00010132, + }, + { + 0x00010133, + 0x00010133, + 0x00010134, + 0x00010134, + 0x00010135, + 0x00010135, + 0x00010136, + 0x00010136, + 0x00010137, + 0x00010137, + 0x00010138, + 0x00010138, + 0x00010139, + 0x00010139, + 0x0001013a, + 0x0001013a, + }, + { + 0x0001013b, + 0x0001013b, + 0x0001013c, + 0x0001013c, + 0x0001013d, + 0x0001013d, + 0x0001013e, + 0x0001013e, + 0x0001013f, + 0x0001013f, + 0x00010140, + 0x00010140, + 0x00010141, + 0x00010141, + 0x00010142, + 0x00010142, + }, + { + 0x00010143, + 0x00010143, + 0x00010144, + 0x00010144, + 0x00010145, + 0x00010145, + 0x00010146, + 0x00010146, + 0x00010147, + 0x00010147, + 0x00010148, + 0x00010148, + 0x00010149, + 0x00010149, + 0x0001014a, + 0x0001014a, + }, + { + 0x0001014b, + 0x0001014b, + 0x0001014c, + 0x0001014c, + 0x0001014d, + 0x0001014d, + 0x0001014e, + 0x0001014e, + 0x0001014f, + 0x0001014f, + 0x00010150, + 0x00010150, + 0x00010151, + 0x00010151, + 0x00010152, + 0x00010152, + }, + { + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + 0x003fffff, + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0044ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x0049ffff, + }, + { + 0x00010153, + 0x00010153, + 0x00010154, + 0x00010154, + 0x00010155, + 0x00010155, + 0x00010156, + 0x00010156, + 0x00010157, + 0x00010157, + 0x00010158, + 0x00010158, + 0x00010159, + 0x00010159, + 0x0001015a, + 0x0001015a, + }, + { + 0x0001015b, + 0x0001015b, + 0x0001015c, + 0x0001015c, + 0x0001015d, + 0x0001015d, + 0x0001015e, + 0x0001015e, + 0x0001015f, + 0x0001015f, + 0x00010160, + 0x00010160, + 0x00010161, + 0x00010161, + 0x00010162, + 0x00010162, + }, + { + 0x00010163, + 0x00010163, + 0x00010164, + 0x00010164, + 0x00010165, + 0x00010165, + 0x00010166, + 0x00010166, + 0x00010167, + 0x00010167, + 0x00010168, + 0x00010168, + 0x00010169, + 0x00010169, + 0x0001016a, + 0x0001016a, + }, + { + 0x0001016b, + 0x0001016b, + 0x0001016c, + 0x0001016c, + 0x0001016d, + 0x0001016d, + 0x0001016e, + 0x0001016e, + 0x0001016f, + 0x0001016f, + 0x00010170, + 0x00010170, + 0x00010171, + 0x00010171, + 0x00010172, + 0x00010172, + }, + { + 0x00010173, + 0x00010173, + 0x00010174, + 0x00010174, + 0x00010175, + 0x00010175, + 0x00010176, + 0x00010176, + 0x00010177, + 0x00010177, + 0x00010178, + 0x00010178, + 0x00010179, + 0x00010179, + 0x0001017a, + 0x0001017a, + }, + { + 0x0001017b, + 0x0001017b, + 0x0001017c, + 0x0001017c, + 0x0001017d, + 0x0001017d, + 0x0001017e, + 0x0001017e, + 0x0001017f, + 0x0001017f, + 0x00010180, + 0x00010180, + 0x00010181, + 0x00010181, + 0x00010182, + 0x00010182, + }, + { + 0x00010183, + 0x00010183, + 0x00010184, + 0x00010184, + 0x00010185, + 0x00010185, + 0x00010186, + 0x00010186, + 0x00010187, + 0x00010187, + 0x00010188, + 0x00010188, + 0x00010189, + 0x00010189, + 0x0001018a, + 0x0001018a, + }, + { + 0x0001018b, + 0x0001018b, + 0x0001018c, + 0x0001018c, + 0x0001018d, + 0x0001018d, + 0x0001018e, + 0x0001018e, + 0x0001018f, + 0x0001018f, + 0x00010190, + 0x00010190, + 0x00010191, + 0x00010191, + 0x00010192, + 0x00010192, + }, + { + 0x00010193, + 0x00010193, + 0x00010194, + 0x00010194, + 0x00010195, + 0x00010195, + 0x00010196, + 0x00010196, + 0x00010197, + 0x00010197, + 0x00010198, + 0x00010198, + 0x00010199, + 0x00010199, + 0x0001019a, + 0x0001019a, + }, + { + 0x0001019b, + 0x0001019b, + 0x0001019c, + 0x0001019c, + 0x0001019d, + 0x0001019d, + 0x0001019e, + 0x0001019e, + 0x0001019f, + 0x0001019f, + 0x000101a0, + 0x000101a0, + 0x000101a1, + 0x000101a1, + 0x000101a2, + 0x000101a2, + }, + { + 0x000101a3, + 0x000101a3, + 0x000101a4, + 0x000101a4, + 0x000101a5, + 0x000101a5, + 0x000101a6, + 0x000101a6, + 0x000101a7, + 0x000101a7, + 0x000101a8, + 0x000101a8, + 0x000101a9, + 0x000101a9, + 0x000101aa, + 0x000101aa, + }, + { + 0x000101ab, + 0x000101ab, + 0x000101ac, + 0x000101ac, + 0x000101ad, + 0x000101ad, + 0x000101ae, + 0x000101ae, + 0x000101af, + 0x000101af, + 0x000101b0, + 0x000101b0, + 0x000101b1, + 0x000101b1, + 0x000101b2, + 0x000101b2, + }, + { + 0x000101b3, + 0x000101b3, + 0x000101b4, + 0x000101b4, + 0x000101b5, + 0x000101b5, + 0x000101b6, + 0x000101b6, + 0x000101b7, + 0x000101b7, + 0x000101b8, + 0x000101b8, + 0x000101b9, + 0x000101b9, + 0x000101ba, + 0x000101ba, + }, + { + 0x000101bb, + 0x000101bb, + 0x000101bc, + 0x000101bc, + 0x000101bd, + 0x000101bd, + 0x000101be, + 0x000101be, + 0x000101bf, + 0x000101bf, + 0x000101c0, + 0x000101c0, + 0x000101c1, + 0x000101c1, + 0x000101c2, + 0x000101c2, + }, + { + 0x000101c3, + 0x000101c3, + 0x000101c4, + 0x000101c4, + 0x000101c5, + 0x000101c5, + 0x000101c6, + 0x000101c6, + 0x000101c7, + 0x000101c7, + 0x000101c8, + 0x000101c8, + 0x000101c9, + 0x000101c9, + 0x000101ca, + 0x000101ca, + }, + { + 0x000101cb, + 0x000101cb, + 0x000101cc, + 0x000101cc, + 0x000101cd, + 0x000101cd, + 0x000101ce, + 0x000101ce, + 0x000101cf, + 0x000101cf, + 0x000101d0, + 0x000101d0, + 0x000101d1, + 0x000101d1, + 0x000101d2, + 0x000101d2, + }, + { + 0x000101d3, + 0x000101d3, + 0x000101d4, + 0x000101d4, + 0x000101d5, + 0x000101d5, + 0x000101d6, + 0x000101d6, + 0x000101d7, + 0x000101d7, + 0x000101d8, + 0x000101d8, + 0x000101d9, + 0x000101d9, + 0x000101da, + 0x000101da, + }, + { + 0x000101db, + 0x000101db, + 0x000101dc, + 0x000101dc, + 0x000101dd, + 0x000101dd, + 0x000101de, + 0x000101de, + 0x000101df, + 0x000101df, + 0x000101e0, + 0x000101e0, + 0x000101e1, + 0x000101e1, + 0x000101e2, + 0x000101e2, + }, + { + 0x000101e3, + 0x000101e3, + 0x000101e4, + 0x000101e4, + 0x000101e5, + 0x000101e5, + 0x000101e6, + 0x000101e6, + 0x000101e7, + 0x000101e7, + 0x000101e8, + 0x000101e8, + 0x000101e9, + 0x000101e9, + 0x000101ea, + 0x000101ea, + }, + { + 0x000101eb, + 0x000101eb, + 0x000101ec, + 0x000101ec, + 0x000101ed, + 0x000101ed, + 0x000101ee, + 0x000101ee, + 0x000101ef, + 0x000101ef, + 0x000101f0, + 0x000101f0, + 0x000101f1, + 0x000101f1, + 0x000101f2, + 0x000101f2, + }, + { + 0x000101f3, + 0x000101f3, + 0x000101f4, + 0x000101f4, + 0x000101f5, + 0x000101f5, + 0x000101f6, + 0x000101f6, + 0x000101f7, + 0x000101f7, + 0x000101f8, + 0x000101f8, + 0x000101f9, + 0x000101f9, + 0x000101fa, + 0x000101fa, + }, + { + 0x000101fb, + 0x000101fb, + 0x000101fc, + 0x000101fc, + 0x000101fd, + 0x000101fd, + 0x000101fe, + 0x000101fe, + 0x000101ff, + 0x000101ff, + 0x00010200, + 0x00010200, + 0x00010201, + 0x00010201, + 0x00010202, + 0x00010202, + }, + { + 0x00010203, + 0x00010203, + 0x00010204, + 0x00010204, + 0x00010205, + 0x00010205, + 0x00010206, + 0x00010206, + 0x00010207, + 0x00010207, + 0x00010208, + 0x00010208, + 0x00010209, + 0x00010209, + 0x0001020a, + 0x0001020a, + }, + { + 0x0001020b, + 0x0001020b, + 0x0001020c, + 0x0001020c, + 0x0001020d, + 0x0001020d, + 0x0001020e, + 0x0001020e, + 0x0001020f, + 0x0001020f, + 0x00010210, + 0x00010210, + 0x00010211, + 0x00010211, + 0x00010212, + 0x00010212, + }, + { + 0x00010213, + 0x00010213, + 0x00010214, + 0x00010214, + 0x00010215, + 0x00010215, + 0x00010216, + 0x00010216, + 0x00010217, + 0x00010217, + 0x00010218, + 0x00010218, + 0x00010219, + 0x00010219, + 0x0001021a, + 0x0001021a, + }, + { + 0x0001021b, + 0x0001021b, + 0x0001021c, + 0x0001021c, + 0x0001021d, + 0x0001021d, + 0x0001021e, + 0x0001021e, + 0x0001021f, + 0x0001021f, + 0x00010220, + 0x00010220, + 0x00010221, + 0x00010221, + 0x00010222, + 0x00010222, + }, + { + 0x00010223, + 0x00010223, + 0x00010224, + 0x00010224, + 0x00010225, + 0x00010225, + 0x00010226, + 0x00010226, + 0x00010227, + 0x00010227, + 0x00010228, + 0x00010228, + 0x00010229, + 0x00010229, + 0x0001022a, + 0x0001022a, + }, + { + 0x0001022b, + 0x0001022b, + 0x0001022c, + 0x0001022c, + 0x0001022d, + 0x0001022d, + 0x0001022e, + 0x0001022e, + 0x0001022f, + 0x0001022f, + 0x00010230, + 0x00010230, + 0x00010231, + 0x00010231, + 0x00010232, + 0x00010232, + }, + { + 0x00010233, + 0x00010233, + 0x00010234, + 0x00010234, + 0x00010235, + 0x00010235, + 0x00010236, + 0x00010236, + 0x00010237, + 0x00010237, + 0x00010238, + 0x00010238, + 0x00010239, + 0x00010239, + 0x0001023a, + 0x0001023a, + }, }; #endif @@ -3185,215 +32827,2721 @@ const uint32_t c_aauiCQMFHuffEnc48[729][2] = #else const uint16_t c_aauiCQMFHuffEnc48[729][2] = #endif -{ - {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0006}, {0x0006, 0x0006}, {0x0008, 0x0006}, {0x0009, 0x0007}, {0x000b, 0x000b}, {0x000c, 0x000d}, - {0x000f, 0x0030}, {0x0010, 0x0055}, {0x0012, 0x0136}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, - {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, - {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0005, 0x0007}, {0x0006, 0x0007}, {0x0007, 0x0007}, - {0x0008, 0x0007}, {0x000a, 0x0008}, {0x000c, 0x000e}, {0x000d, 0x0012}, {0x000f, 0x0031}, {0x0011, 0x00a0}, {0x0013, 0x0010}, {0x0013, 0x0011}, - {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, - {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0005, 0x0008}, {0x0004, 0x0005}, - {0x0005, 0x0009}, {0x0006, 0x0008}, {0x0007, 0x0008}, {0x0008, 0x0008}, {0x000a, 0x0009}, {0x000c, 0x000f}, {0x000d, 0x0013}, {0x000f, 0x0032}, - {0x0011, 0x00a1}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, - {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, {0x0013, 0x002b}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, - {0x0013, 0x002f}, {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0009}, {0x0008, 0x0009}, {0x0009, 0x0008}, {0x000b, 0x000c}, - {0x000d, 0x0014}, {0x000e, 0x001d}, {0x000f, 0x0033}, {0x0012, 0x0137}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, - {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0013, 0x003b}, - {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0008, 0x000a}, {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x000b}, - {0x0009, 0x0009}, {0x000a, 0x000a}, {0x000c, 0x0010}, {0x000d, 0x0015}, {0x000f, 0x0034}, {0x0010, 0x0056}, {0x0012, 0x0138}, {0x0013, 0x0040}, - {0x0013, 0x0041}, {0x0013, 0x0042}, {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, - {0x0013, 0x0049}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, {0x0013, 0x004f}, {0x0009, 0x000a}, - {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x000b}, {0x000a, 0x000b}, {0x000c, 0x0011}, {0x000d, 0x0016}, {0x000e, 0x001e}, {0x0010, 0x0057}, - {0x0011, 0x00a2}, {0x0011, 0x00a3}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, - {0x0013, 0x0056}, {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, {0x0013, 0x005c}, {0x0013, 0x005d}, - {0x0013, 0x005e}, {0x0013, 0x005f}, {0x000b, 0x000d}, {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000b, 0x000e}, {0x000c, 0x0012}, {0x000d, 0x0017}, - {0x000e, 0x001f}, {0x0010, 0x0058}, {0x0012, 0x0139}, {0x0011, 0x00a4}, {0x0012, 0x013a}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, - {0x0013, 0x0063}, {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x0013, 0x0069}, {0x0013, 0x006a}, - {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x000c, 0x0013}, {0x000b, 0x000f}, {0x000c, 0x0014}, - {0x000c, 0x0015}, {0x000d, 0x0018}, {0x000e, 0x0020}, {0x000f, 0x0035}, {0x0012, 0x013b}, {0x0013, 0x0070}, {0x0013, 0x0071}, {0x0013, 0x0072}, - {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, {0x0013, 0x007a}, - {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, - {0x000e, 0x0021}, {0x000d, 0x0019}, {0x000e, 0x0022}, {0x000e, 0x0023}, {0x000f, 0x0036}, {0x0010, 0x0059}, {0x0011, 0x00a5}, {0x0013, 0x0083}, - {0x0011, 0x00a6}, {0x0012, 0x013c}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, {0x0013, 0x0088}, {0x0013, 0x0089}, - {0x0013, 0x008a}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, - {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0010, 0x005a}, {0x000f, 0x0037}, {0x000f, 0x0038}, {0x000f, 0x0039}, {0x0010, 0x005b}, - {0x0010, 0x005c}, {0x0013, 0x0095}, {0x0011, 0x00a7}, {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, - {0x0013, 0x009b}, {0x0013, 0x009c}, {0x0013, 0x009d}, {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, - {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0010, 0x005d}, {0x0010, 0x005e}, - {0x0013, 0x00a9}, {0x0010, 0x005f}, {0x0013, 0x00aa}, {0x0012, 0x013d}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, {0x0013, 0x00ae}, - {0x0013, 0x00af}, {0x0013, 0x00b0}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, - {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, - {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0011, 0x00a8}, {0x0013, 0x00c1}, {0x0011, 0x00a9}, {0x0013, 0x00c2}, {0x0013, 0x00c3}, {0x0013, 0x00c4}, - {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, {0x0013, 0x00cc}, - {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, {0x0013, 0x00d4}, - {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0012, 0x013e}, {0x0013, 0x00db}, - {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, {0x0013, 0x00e3}, - {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, {0x0013, 0x00eb}, - {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, {0x0013, 0x00f3}, - {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, {0x0013, 0x00fb}, - {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, {0x0013, 0x0103}, - {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, {0x0013, 0x010b}, - {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, {0x0013, 0x0113}, - {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, {0x0013, 0x011b}, - {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, {0x0013, 0x0123}, - {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, {0x0013, 0x012b}, - {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, {0x0013, 0x0133}, - {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, {0x0013, 0x013b}, - {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, {0x0013, 0x0143}, - {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, {0x0013, 0x014b}, - {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, {0x0013, 0x0153}, - {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, {0x0013, 0x015b}, - {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, {0x0013, 0x0163}, - {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, {0x0013, 0x016b}, - {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, {0x0013, 0x0173}, - {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, {0x0013, 0x017b}, - {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, {0x0013, 0x0183}, - {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, {0x0013, 0x018b}, - {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, {0x0013, 0x0193}, - {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, {0x0013, 0x019b}, - {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, {0x0013, 0x01a3}, - {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, {0x0013, 0x01ab}, - {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, {0x0013, 0x01b3}, - {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, {0x0013, 0x01bb}, - {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, {0x0013, 0x01c3}, - {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, {0x0013, 0x01cb}, - {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, {0x0013, 0x01d3}, - {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, {0x0013, 0x01db}, - {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, {0x0013, 0x01e3}, - {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, {0x0013, 0x01eb}, - {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, {0x0013, 0x01f3}, - {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, {0x0013, 0x01fb}, - {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, {0x0013, 0x01ff}, {0x0013, 0x0200}, {0x0013, 0x0201}, {0x0013, 0x0202}, {0x0013, 0x0203}, - {0x0013, 0x0204}, {0x0013, 0x0205}, {0x0013, 0x0206}, {0x0013, 0x0207}, {0x0013, 0x0208}, {0x0013, 0x0209}, {0x0013, 0x020a}, {0x0013, 0x020b}, - {0x0013, 0x020c}, {0x0013, 0x020d}, {0x0013, 0x020e}, {0x0013, 0x020f}, {0x0013, 0x0210}, {0x0013, 0x0211}, {0x0013, 0x0212}, {0x0013, 0x0213}, - {0x0013, 0x0214}, {0x0013, 0x0215}, {0x0013, 0x0216}, {0x0013, 0x0217}, {0x0013, 0x0218}, {0x0013, 0x0219}, {0x0013, 0x021a}, {0x0013, 0x021b}, - {0x0013, 0x021c}, {0x0013, 0x021d}, {0x0013, 0x021e}, {0x0013, 0x021f}, {0x0013, 0x0220}, {0x0013, 0x0221}, {0x0013, 0x0222}, {0x0013, 0x0223}, - {0x0013, 0x0224}, {0x0013, 0x0225}, {0x0013, 0x0226}, {0x0013, 0x0227}, {0x0013, 0x0228}, {0x0013, 0x0229}, {0x0013, 0x022a}, {0x0013, 0x022b}, - {0x0013, 0x022c}, {0x0013, 0x022d}, {0x0013, 0x022e}, {0x0013, 0x022f}, {0x0013, 0x0230}, {0x0013, 0x0231}, {0x0013, 0x0232}, {0x0013, 0x0233}, - {0x0013, 0x0234}, {0x0013, 0x0235}, {0x0013, 0x0236}, {0x0013, 0x0237}, {0x0013, 0x0238}, {0x0013, 0x0239}, {0x0013, 0x023a}, {0x0013, 0x023b}, - {0x0013, 0x023c}, {0x0013, 0x023d}, {0x0013, 0x023e}, {0x0013, 0x023f}, {0x0013, 0x0240}, {0x0013, 0x0241}, {0x0013, 0x0242}, {0x0013, 0x0243}, - {0x0013, 0x0244}, {0x0013, 0x0245}, {0x0013, 0x0246}, {0x0013, 0x0247}, {0x0013, 0x0248}, {0x0013, 0x0249}, {0x0013, 0x024a}, {0x0013, 0x024b}, - {0x0013, 0x024c}, {0x0013, 0x024d}, {0x0013, 0x024e}, {0x0013, 0x024f}, {0x0013, 0x0250}, {0x0013, 0x0251}, {0x0013, 0x0252}, {0x0013, 0x0253}, - {0x0013, 0x0254}, {0x0013, 0x0255}, {0x0013, 0x0256}, {0x0013, 0x0257}, {0x0013, 0x0258}, {0x0013, 0x0259}, {0x0013, 0x025a}, {0x0013, 0x025b}, - {0x0013, 0x025c}, {0x0013, 0x025d}, {0x0013, 0x025e}, {0x0013, 0x025f}, {0x0013, 0x0260}, {0x0013, 0x0261}, {0x0013, 0x0262}, {0x0013, 0x0263}, - {0x0013, 0x0264}, {0x0013, 0x0265}, {0x0013, 0x0266}, {0x0013, 0x0267}, {0x0013, 0x0268}, {0x0013, 0x0269}, {0x0013, 0x026a}, {0x0013, 0x026b}, - {0x0012, 0x013f}, + { + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0006 }, + { 0x0006, 0x0006 }, + { 0x0008, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x000b, 0x000b }, + { 0x000c, 0x000d }, + { 0x000f, 0x0030 }, + { 0x0010, 0x0055 }, + { 0x0012, 0x0136 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0007 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000c, 0x000e }, + { 0x000d, 0x0012 }, + { 0x000f, 0x0031 }, + { 0x0011, 0x00a0 }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0005, 0x0008 }, + { 0x0004, 0x0005 }, + { 0x0005, 0x0009 }, + { 0x0006, 0x0008 }, + { 0x0007, 0x0008 }, + { 0x0008, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000c, 0x000f }, + { 0x000d, 0x0013 }, + { 0x000f, 0x0032 }, + { 0x0011, 0x00a1 }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0007, 0x0009 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0008 }, + { 0x000b, 0x000c }, + { 0x000d, 0x0014 }, + { 0x000e, 0x001d }, + { 0x000f, 0x0033 }, + { 0x0012, 0x0137 }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0008, 0x000a }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0008, 0x000b }, + { 0x0009, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000c, 0x0010 }, + { 0x000d, 0x0015 }, + { 0x000f, 0x0034 }, + { 0x0010, 0x0056 }, + { 0x0012, 0x0138 }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0009, 0x000a }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0009, 0x000b }, + { 0x000a, 0x000b }, + { 0x000c, 0x0011 }, + { 0x000d, 0x0016 }, + { 0x000e, 0x001e }, + { 0x0010, 0x0057 }, + { 0x0011, 0x00a2 }, + { 0x0011, 0x00a3 }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x000b, 0x000d }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000b, 0x000e }, + { 0x000c, 0x0012 }, + { 0x000d, 0x0017 }, + { 0x000e, 0x001f }, + { 0x0010, 0x0058 }, + { 0x0012, 0x0139 }, + { 0x0011, 0x00a4 }, + { 0x0012, 0x013a }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x000c, 0x0013 }, + { 0x000b, 0x000f }, + { 0x000c, 0x0014 }, + { 0x000c, 0x0015 }, + { 0x000d, 0x0018 }, + { 0x000e, 0x0020 }, + { 0x000f, 0x0035 }, + { 0x0012, 0x013b }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x000e, 0x0021 }, + { 0x000d, 0x0019 }, + { 0x000e, 0x0022 }, + { 0x000e, 0x0023 }, + { 0x000f, 0x0036 }, + { 0x0010, 0x0059 }, + { 0x0011, 0x00a5 }, + { 0x0013, 0x0083 }, + { 0x0011, 0x00a6 }, + { 0x0012, 0x013c }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x0013, 0x008b }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0010, 0x005a }, + { 0x000f, 0x0037 }, + { 0x000f, 0x0038 }, + { 0x000f, 0x0039 }, + { 0x0010, 0x005b }, + { 0x0010, 0x005c }, + { 0x0013, 0x0095 }, + { 0x0011, 0x00a7 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0013, 0x009c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, + { 0x0013, 0x00a0 }, + { 0x0013, 0x00a1 }, + { 0x0013, 0x00a2 }, + { 0x0013, 0x00a3 }, + { 0x0013, 0x00a4 }, + { 0x0013, 0x00a5 }, + { 0x0013, 0x00a6 }, + { 0x0013, 0x00a7 }, + { 0x0013, 0x00a8 }, + { 0x0010, 0x005d }, + { 0x0010, 0x005e }, + { 0x0013, 0x00a9 }, + { 0x0010, 0x005f }, + { 0x0013, 0x00aa }, + { 0x0012, 0x013d }, + { 0x0013, 0x00ab }, + { 0x0013, 0x00ac }, + { 0x0013, 0x00ad }, + { 0x0013, 0x00ae }, + { 0x0013, 0x00af }, + { 0x0013, 0x00b0 }, + { 0x0013, 0x00b1 }, + { 0x0013, 0x00b2 }, + { 0x0013, 0x00b3 }, + { 0x0013, 0x00b4 }, + { 0x0013, 0x00b5 }, + { 0x0013, 0x00b6 }, + { 0x0013, 0x00b7 }, + { 0x0013, 0x00b8 }, + { 0x0013, 0x00b9 }, + { 0x0013, 0x00ba }, + { 0x0013, 0x00bb }, + { 0x0013, 0x00bc }, + { 0x0013, 0x00bd }, + { 0x0013, 0x00be }, + { 0x0013, 0x00bf }, + { 0x0013, 0x00c0 }, + { 0x0011, 0x00a8 }, + { 0x0013, 0x00c1 }, + { 0x0011, 0x00a9 }, + { 0x0013, 0x00c2 }, + { 0x0013, 0x00c3 }, + { 0x0013, 0x00c4 }, + { 0x0013, 0x00c5 }, + { 0x0013, 0x00c6 }, + { 0x0013, 0x00c7 }, + { 0x0013, 0x00c8 }, + { 0x0013, 0x00c9 }, + { 0x0013, 0x00ca }, + { 0x0013, 0x00cb }, + { 0x0013, 0x00cc }, + { 0x0013, 0x00cd }, + { 0x0013, 0x00ce }, + { 0x0013, 0x00cf }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0013, 0x00d2 }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0013, 0x00d5 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0013, 0x00d8 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0012, 0x013e }, + { 0x0013, 0x00db }, + { 0x0013, 0x00dc }, + { 0x0013, 0x00dd }, + { 0x0013, 0x00de }, + { 0x0013, 0x00df }, + { 0x0013, 0x00e0 }, + { 0x0013, 0x00e1 }, + { 0x0013, 0x00e2 }, + { 0x0013, 0x00e3 }, + { 0x0013, 0x00e4 }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0013, 0x00e9 }, + { 0x0013, 0x00ea }, + { 0x0013, 0x00eb }, + { 0x0013, 0x00ec }, + { 0x0013, 0x00ed }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0013, 0x00f0 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, + { 0x0013, 0x0110 }, + { 0x0013, 0x0111 }, + { 0x0013, 0x0112 }, + { 0x0013, 0x0113 }, + { 0x0013, 0x0114 }, + { 0x0013, 0x0115 }, + { 0x0013, 0x0116 }, + { 0x0013, 0x0117 }, + { 0x0013, 0x0118 }, + { 0x0013, 0x0119 }, + { 0x0013, 0x011a }, + { 0x0013, 0x011b }, + { 0x0013, 0x011c }, + { 0x0013, 0x011d }, + { 0x0013, 0x011e }, + { 0x0013, 0x011f }, + { 0x0013, 0x0120 }, + { 0x0013, 0x0121 }, + { 0x0013, 0x0122 }, + { 0x0013, 0x0123 }, + { 0x0013, 0x0124 }, + { 0x0013, 0x0125 }, + { 0x0013, 0x0126 }, + { 0x0013, 0x0127 }, + { 0x0013, 0x0128 }, + { 0x0013, 0x0129 }, + { 0x0013, 0x012a }, + { 0x0013, 0x012b }, + { 0x0013, 0x012c }, + { 0x0013, 0x012d }, + { 0x0013, 0x012e }, + { 0x0013, 0x012f }, + { 0x0013, 0x0130 }, + { 0x0013, 0x0131 }, + { 0x0013, 0x0132 }, + { 0x0013, 0x0133 }, + { 0x0013, 0x0134 }, + { 0x0013, 0x0135 }, + { 0x0013, 0x0136 }, + { 0x0013, 0x0137 }, + { 0x0013, 0x0138 }, + { 0x0013, 0x0139 }, + { 0x0013, 0x013a }, + { 0x0013, 0x013b }, + { 0x0013, 0x013c }, + { 0x0013, 0x013d }, + { 0x0013, 0x013e }, + { 0x0013, 0x013f }, + { 0x0013, 0x0140 }, + { 0x0013, 0x0141 }, + { 0x0013, 0x0142 }, + { 0x0013, 0x0143 }, + { 0x0013, 0x0144 }, + { 0x0013, 0x0145 }, + { 0x0013, 0x0146 }, + { 0x0013, 0x0147 }, + { 0x0013, 0x0148 }, + { 0x0013, 0x0149 }, + { 0x0013, 0x014a }, + { 0x0013, 0x014b }, + { 0x0013, 0x014c }, + { 0x0013, 0x014d }, + { 0x0013, 0x014e }, + { 0x0013, 0x014f }, + { 0x0013, 0x0150 }, + { 0x0013, 0x0151 }, + { 0x0013, 0x0152 }, + { 0x0013, 0x0153 }, + { 0x0013, 0x0154 }, + { 0x0013, 0x0155 }, + { 0x0013, 0x0156 }, + { 0x0013, 0x0157 }, + { 0x0013, 0x0158 }, + { 0x0013, 0x0159 }, + { 0x0013, 0x015a }, + { 0x0013, 0x015b }, + { 0x0013, 0x015c }, + { 0x0013, 0x015d }, + { 0x0013, 0x015e }, + { 0x0013, 0x015f }, + { 0x0013, 0x0160 }, + { 0x0013, 0x0161 }, + { 0x0013, 0x0162 }, + { 0x0013, 0x0163 }, + { 0x0013, 0x0164 }, + { 0x0013, 0x0165 }, + { 0x0013, 0x0166 }, + { 0x0013, 0x0167 }, + { 0x0013, 0x0168 }, + { 0x0013, 0x0169 }, + { 0x0013, 0x016a }, + { 0x0013, 0x016b }, + { 0x0013, 0x016c }, + { 0x0013, 0x016d }, + { 0x0013, 0x016e }, + { 0x0013, 0x016f }, + { 0x0013, 0x0170 }, + { 0x0013, 0x0171 }, + { 0x0013, 0x0172 }, + { 0x0013, 0x0173 }, + { 0x0013, 0x0174 }, + { 0x0013, 0x0175 }, + { 0x0013, 0x0176 }, + { 0x0013, 0x0177 }, + { 0x0013, 0x0178 }, + { 0x0013, 0x0179 }, + { 0x0013, 0x017a }, + { 0x0013, 0x017b }, + { 0x0013, 0x017c }, + { 0x0013, 0x017d }, + { 0x0013, 0x017e }, + { 0x0013, 0x017f }, + { 0x0013, 0x0180 }, + { 0x0013, 0x0181 }, + { 0x0013, 0x0182 }, + { 0x0013, 0x0183 }, + { 0x0013, 0x0184 }, + { 0x0013, 0x0185 }, + { 0x0013, 0x0186 }, + { 0x0013, 0x0187 }, + { 0x0013, 0x0188 }, + { 0x0013, 0x0189 }, + { 0x0013, 0x018a }, + { 0x0013, 0x018b }, + { 0x0013, 0x018c }, + { 0x0013, 0x018d }, + { 0x0013, 0x018e }, + { 0x0013, 0x018f }, + { 0x0013, 0x0190 }, + { 0x0013, 0x0191 }, + { 0x0013, 0x0192 }, + { 0x0013, 0x0193 }, + { 0x0013, 0x0194 }, + { 0x0013, 0x0195 }, + { 0x0013, 0x0196 }, + { 0x0013, 0x0197 }, + { 0x0013, 0x0198 }, + { 0x0013, 0x0199 }, + { 0x0013, 0x019a }, + { 0x0013, 0x019b }, + { 0x0013, 0x019c }, + { 0x0013, 0x019d }, + { 0x0013, 0x019e }, + { 0x0013, 0x019f }, + { 0x0013, 0x01a0 }, + { 0x0013, 0x01a1 }, + { 0x0013, 0x01a2 }, + { 0x0013, 0x01a3 }, + { 0x0013, 0x01a4 }, + { 0x0013, 0x01a5 }, + { 0x0013, 0x01a6 }, + { 0x0013, 0x01a7 }, + { 0x0013, 0x01a8 }, + { 0x0013, 0x01a9 }, + { 0x0013, 0x01aa }, + { 0x0013, 0x01ab }, + { 0x0013, 0x01ac }, + { 0x0013, 0x01ad }, + { 0x0013, 0x01ae }, + { 0x0013, 0x01af }, + { 0x0013, 0x01b0 }, + { 0x0013, 0x01b1 }, + { 0x0013, 0x01b2 }, + { 0x0013, 0x01b3 }, + { 0x0013, 0x01b4 }, + { 0x0013, 0x01b5 }, + { 0x0013, 0x01b6 }, + { 0x0013, 0x01b7 }, + { 0x0013, 0x01b8 }, + { 0x0013, 0x01b9 }, + { 0x0013, 0x01ba }, + { 0x0013, 0x01bb }, + { 0x0013, 0x01bc }, + { 0x0013, 0x01bd }, + { 0x0013, 0x01be }, + { 0x0013, 0x01bf }, + { 0x0013, 0x01c0 }, + { 0x0013, 0x01c1 }, + { 0x0013, 0x01c2 }, + { 0x0013, 0x01c3 }, + { 0x0013, 0x01c4 }, + { 0x0013, 0x01c5 }, + { 0x0013, 0x01c6 }, + { 0x0013, 0x01c7 }, + { 0x0013, 0x01c8 }, + { 0x0013, 0x01c9 }, + { 0x0013, 0x01ca }, + { 0x0013, 0x01cb }, + { 0x0013, 0x01cc }, + { 0x0013, 0x01cd }, + { 0x0013, 0x01ce }, + { 0x0013, 0x01cf }, + { 0x0013, 0x01d0 }, + { 0x0013, 0x01d1 }, + { 0x0013, 0x01d2 }, + { 0x0013, 0x01d3 }, + { 0x0013, 0x01d4 }, + { 0x0013, 0x01d5 }, + { 0x0013, 0x01d6 }, + { 0x0013, 0x01d7 }, + { 0x0013, 0x01d8 }, + { 0x0013, 0x01d9 }, + { 0x0013, 0x01da }, + { 0x0013, 0x01db }, + { 0x0013, 0x01dc }, + { 0x0013, 0x01dd }, + { 0x0013, 0x01de }, + { 0x0013, 0x01df }, + { 0x0013, 0x01e0 }, + { 0x0013, 0x01e1 }, + { 0x0013, 0x01e2 }, + { 0x0013, 0x01e3 }, + { 0x0013, 0x01e4 }, + { 0x0013, 0x01e5 }, + { 0x0013, 0x01e6 }, + { 0x0013, 0x01e7 }, + { 0x0013, 0x01e8 }, + { 0x0013, 0x01e9 }, + { 0x0013, 0x01ea }, + { 0x0013, 0x01eb }, + { 0x0013, 0x01ec }, + { 0x0013, 0x01ed }, + { 0x0013, 0x01ee }, + { 0x0013, 0x01ef }, + { 0x0013, 0x01f0 }, + { 0x0013, 0x01f1 }, + { 0x0013, 0x01f2 }, + { 0x0013, 0x01f3 }, + { 0x0013, 0x01f4 }, + { 0x0013, 0x01f5 }, + { 0x0013, 0x01f6 }, + { 0x0013, 0x01f7 }, + { 0x0013, 0x01f8 }, + { 0x0013, 0x01f9 }, + { 0x0013, 0x01fa }, + { 0x0013, 0x01fb }, + { 0x0013, 0x01fc }, + { 0x0013, 0x01fd }, + { 0x0013, 0x01fe }, + { 0x0013, 0x01ff }, + { 0x0013, 0x0200 }, + { 0x0013, 0x0201 }, + { 0x0013, 0x0202 }, + { 0x0013, 0x0203 }, + { 0x0013, 0x0204 }, + { 0x0013, 0x0205 }, + { 0x0013, 0x0206 }, + { 0x0013, 0x0207 }, + { 0x0013, 0x0208 }, + { 0x0013, 0x0209 }, + { 0x0013, 0x020a }, + { 0x0013, 0x020b }, + { 0x0013, 0x020c }, + { 0x0013, 0x020d }, + { 0x0013, 0x020e }, + { 0x0013, 0x020f }, + { 0x0013, 0x0210 }, + { 0x0013, 0x0211 }, + { 0x0013, 0x0212 }, + { 0x0013, 0x0213 }, + { 0x0013, 0x0214 }, + { 0x0013, 0x0215 }, + { 0x0013, 0x0216 }, + { 0x0013, 0x0217 }, + { 0x0013, 0x0218 }, + { 0x0013, 0x0219 }, + { 0x0013, 0x021a }, + { 0x0013, 0x021b }, + { 0x0013, 0x021c }, + { 0x0013, 0x021d }, + { 0x0013, 0x021e }, + { 0x0013, 0x021f }, + { 0x0013, 0x0220 }, + { 0x0013, 0x0221 }, + { 0x0013, 0x0222 }, + { 0x0013, 0x0223 }, + { 0x0013, 0x0224 }, + { 0x0013, 0x0225 }, + { 0x0013, 0x0226 }, + { 0x0013, 0x0227 }, + { 0x0013, 0x0228 }, + { 0x0013, 0x0229 }, + { 0x0013, 0x022a }, + { 0x0013, 0x022b }, + { 0x0013, 0x022c }, + { 0x0013, 0x022d }, + { 0x0013, 0x022e }, + { 0x0013, 0x022f }, + { 0x0013, 0x0230 }, + { 0x0013, 0x0231 }, + { 0x0013, 0x0232 }, + { 0x0013, 0x0233 }, + { 0x0013, 0x0234 }, + { 0x0013, 0x0235 }, + { 0x0013, 0x0236 }, + { 0x0013, 0x0237 }, + { 0x0013, 0x0238 }, + { 0x0013, 0x0239 }, + { 0x0013, 0x023a }, + { 0x0013, 0x023b }, + { 0x0013, 0x023c }, + { 0x0013, 0x023d }, + { 0x0013, 0x023e }, + { 0x0013, 0x023f }, + { 0x0013, 0x0240 }, + { 0x0013, 0x0241 }, + { 0x0013, 0x0242 }, + { 0x0013, 0x0243 }, + { 0x0013, 0x0244 }, + { 0x0013, 0x0245 }, + { 0x0013, 0x0246 }, + { 0x0013, 0x0247 }, + { 0x0013, 0x0248 }, + { 0x0013, 0x0249 }, + { 0x0013, 0x024a }, + { 0x0013, 0x024b }, + { 0x0013, 0x024c }, + { 0x0013, 0x024d }, + { 0x0013, 0x024e }, + { 0x0013, 0x024f }, + { 0x0013, 0x0250 }, + { 0x0013, 0x0251 }, + { 0x0013, 0x0252 }, + { 0x0013, 0x0253 }, + { 0x0013, 0x0254 }, + { 0x0013, 0x0255 }, + { 0x0013, 0x0256 }, + { 0x0013, 0x0257 }, + { 0x0013, 0x0258 }, + { 0x0013, 0x0259 }, + { 0x0013, 0x025a }, + { 0x0013, 0x025b }, + { 0x0013, 0x025c }, + { 0x0013, 0x025d }, + { 0x0013, 0x025e }, + { 0x0013, 0x025f }, + { 0x0013, 0x0260 }, + { 0x0013, 0x0261 }, + { 0x0013, 0x0262 }, + { 0x0013, 0x0263 }, + { 0x0013, 0x0264 }, + { 0x0013, 0x0265 }, + { 0x0013, 0x0266 }, + { 0x0013, 0x0267 }, + { 0x0013, 0x0268 }, + { 0x0013, 0x0269 }, + { 0x0013, 0x026a }, + { 0x0013, 0x026b }, + { 0x0012, 0x013f }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec48[110][16] = -{ - {0x0005ffff, 0x0003ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x00000037, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, - {0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x0001003a, 0x0001003a, 0x00010054, 0x00010054, 0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x00020003, 0x00020003, 0x00020003, 0x00020003, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, }, - {0x000bffff, 0x000affff, 0x0009ffff, 0x0008ffff, 0x0006ffff, 0x0007ffff, 0x00000004, 0x00000020, 0x0000003b, 0x00000055, 0x0000006c, 0x0000006f, 0x00000088, 0x00000089, 0x0001001f, 0x0001001f, }, - {0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, - {0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x00030087, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, 0x0003008a, }, - {0x000200a3, 0x000200a3, 0x000200a3, 0x000200a3, 0x000200a4, 0x000200a4, 0x000200a4, 0x000200a4, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, }, - {0x00000072, 0x0000008c, 0x000000a6, 0x000000bd, 0x000000bf, 0x000000c0, 0x00010006, 0x00010006, 0x00010057, 0x00010057, 0x000100a2, 0x000100a2, 0x000100a5, 0x000100a5, 0x000100be, 0x000100be, }, - {0x001dffff, 0x002effff, 0x003fffff, 0x0050ffff, 0x0019ffff, 0x0013ffff, 0x0012ffff, 0x0010ffff, 0x0011ffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000007, 0x00000022, 0x0000003d, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, - {0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x0003008d, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, 0x000300a7, }, - {0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300c1, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, 0x000300d9, }, - {0x000100f5, 0x000100f5, 0x000100f6, 0x000100f6, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x000200a8, 0x000200a8, 0x000200a8, 0x000200a8, }, - {0x000200c2, 0x000200c2, 0x000200c2, 0x000200c2, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200d8, 0x000200da, 0x000200da, 0x000200da, 0x000200da, 0x000200db, 0x000200db, 0x000200db, 0x000200db, }, - {0x00010008, 0x00010008, 0x00010024, 0x00010024, 0x0001003f, 0x0001003f, 0x0001005a, 0x0001005a, 0x00010074, 0x00010074, 0x000100c3, 0x000100c3, 0x000100dc, 0x000100dc, 0x000100f4, 0x000100f4, }, - {0x0015ffff, 0x0014ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x00000009, 0x00000075, 0x0000008f, 0x000000a9, 0x000000dd, 0x000000f3, 0x000000f7, 0x000000f8, 0x0000010e, 0x0000010f, 0x00000111, }, - {0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030090, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, 0x00030091, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300ab, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, 0x000300de, }, - {0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300e0, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, }, - {0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012a, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, 0x0003012c, }, - {0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, 0x0067ffff, 0x0068ffff, 0x0069ffff, 0x006affff, 0x006bffff, 0x006cffff, 0x006dffff, 0x001bffff, 0x001affff, 0x001cffff, }, - {0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200ac, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, }, - {0x000102d4, 0x000102d4, 0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, - {0x000200e1, 0x000200e1, 0x000200e1, 0x000200e1, 0x00020113, 0x00020113, 0x00020113, 0x00020113, 0x00020146, 0x00020146, 0x00020146, 0x00020146, 0x000202d8, 0x000202d8, 0x000202d8, 0x000202d8, }, - {0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0027ffff, 0x0025ffff, 0x0026ffff, 0x0028ffff, 0x0029ffff, 0x002affff, 0x002bffff, 0x002cffff, 0x002dffff, }, - {0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, }, - {0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, }, - {0x00010026, 0x00010026, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, }, - {0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, }, - {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, }, - {0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, }, - {0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, }, - {0x00010077, 0x00010077, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, 0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, }, - {0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, 0x00010085, 0x00010085, 0x00010086, 0x00010086, }, - {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, }, - {0x00010092, 0x00010092, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, 0x00010099, 0x00010099, }, - {0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, 0x000100a1, 0x000100a1, }, - {0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, }, - {0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, 0x000100bc, 0x000100bc, }, - {0x000100c5, 0x000100c5, 0x000100c6, 0x000100c6, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, }, - {0x000100cd, 0x000100cd, 0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, }, - {0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, 0x0033ffff, 0x0034ffff, 0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, }, - {0x000100d5, 0x000100d5, 0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100df, 0x000100df, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, }, - {0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, 0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, }, - {0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, 0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100f9, 0x000100f9, 0x000100fb, 0x000100fb, 0x000100fc, 0x000100fc, }, - {0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, 0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, }, - {0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, 0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, }, - {0x0001010d, 0x0001010d, 0x00010110, 0x00010110, 0x00010112, 0x00010112, 0x00010114, 0x00010114, 0x00010115, 0x00010115, 0x00010116, 0x00010116, 0x00010117, 0x00010117, 0x00010118, 0x00010118, }, - {0x00010119, 0x00010119, 0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, }, - {0x00010121, 0x00010121, 0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, }, - {0x00010129, 0x00010129, 0x0001012b, 0x0001012b, 0x0001012d, 0x0001012d, 0x0001012e, 0x0001012e, 0x0001012f, 0x0001012f, 0x00010130, 0x00010130, 0x00010131, 0x00010131, 0x00010132, 0x00010132, }, - {0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, 0x00010139, 0x00010139, 0x0001013a, 0x0001013a, }, - {0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, 0x00010141, 0x00010141, 0x00010142, 0x00010142, }, - {0x00010143, 0x00010143, 0x00010144, 0x00010144, 0x00010145, 0x00010145, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, }, - {0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, }, - {0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, }, - {0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, }, - {0x00010164, 0x00010164, 0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, }, - {0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, 0x0045ffff, 0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, }, - {0x0001016c, 0x0001016c, 0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, }, - {0x00010174, 0x00010174, 0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, }, - {0x0001017c, 0x0001017c, 0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, }, - {0x00010184, 0x00010184, 0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, }, - {0x0001018c, 0x0001018c, 0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, }, - {0x00010194, 0x00010194, 0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, }, - {0x0001019c, 0x0001019c, 0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, }, - {0x000101a4, 0x000101a4, 0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, }, - {0x000101ac, 0x000101ac, 0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, }, - {0x000101b4, 0x000101b4, 0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, }, - {0x000101bc, 0x000101bc, 0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, }, - {0x000101c4, 0x000101c4, 0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, }, - {0x000101cc, 0x000101cc, 0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, }, - {0x000101d4, 0x000101d4, 0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, }, - {0x000101dc, 0x000101dc, 0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, }, - {0x000101e4, 0x000101e4, 0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, }, - {0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, 0x0056ffff, 0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, }, - {0x000101ec, 0x000101ec, 0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, }, - {0x000101f4, 0x000101f4, 0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, }, - {0x000101fc, 0x000101fc, 0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, }, - {0x00010204, 0x00010204, 0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, }, - {0x0001020c, 0x0001020c, 0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, }, - {0x00010214, 0x00010214, 0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, }, - {0x0001021c, 0x0001021c, 0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, }, - {0x00010224, 0x00010224, 0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, }, - {0x0001022c, 0x0001022c, 0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, }, - {0x00010234, 0x00010234, 0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, }, - {0x0001023c, 0x0001023c, 0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, }, - {0x00010244, 0x00010244, 0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, }, - {0x0001024c, 0x0001024c, 0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, }, - {0x00010254, 0x00010254, 0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, }, - {0x0001025c, 0x0001025c, 0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, }, - {0x00010264, 0x00010264, 0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, }, - {0x0001026c, 0x0001026c, 0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, 0x00010271, 0x00010271, 0x00010272, 0x00010272, 0x00010273, 0x00010273, }, - {0x00010274, 0x00010274, 0x00010275, 0x00010275, 0x00010276, 0x00010276, 0x00010277, 0x00010277, 0x00010278, 0x00010278, 0x00010279, 0x00010279, 0x0001027a, 0x0001027a, 0x0001027b, 0x0001027b, }, - {0x0001027c, 0x0001027c, 0x0001027d, 0x0001027d, 0x0001027e, 0x0001027e, 0x0001027f, 0x0001027f, 0x00010280, 0x00010280, 0x00010281, 0x00010281, 0x00010282, 0x00010282, 0x00010283, 0x00010283, }, - {0x00010284, 0x00010284, 0x00010285, 0x00010285, 0x00010286, 0x00010286, 0x00010287, 0x00010287, 0x00010288, 0x00010288, 0x00010289, 0x00010289, 0x0001028a, 0x0001028a, 0x0001028b, 0x0001028b, }, - {0x0001028c, 0x0001028c, 0x0001028d, 0x0001028d, 0x0001028e, 0x0001028e, 0x0001028f, 0x0001028f, 0x00010290, 0x00010290, 0x00010291, 0x00010291, 0x00010292, 0x00010292, 0x00010293, 0x00010293, }, - {0x00010294, 0x00010294, 0x00010295, 0x00010295, 0x00010296, 0x00010296, 0x00010297, 0x00010297, 0x00010298, 0x00010298, 0x00010299, 0x00010299, 0x0001029a, 0x0001029a, 0x0001029b, 0x0001029b, }, - {0x0001029c, 0x0001029c, 0x0001029d, 0x0001029d, 0x0001029e, 0x0001029e, 0x0001029f, 0x0001029f, 0x000102a0, 0x000102a0, 0x000102a1, 0x000102a1, 0x000102a2, 0x000102a2, 0x000102a3, 0x000102a3, }, - {0x000102a4, 0x000102a4, 0x000102a5, 0x000102a5, 0x000102a6, 0x000102a6, 0x000102a7, 0x000102a7, 0x000102a8, 0x000102a8, 0x000102a9, 0x000102a9, 0x000102aa, 0x000102aa, 0x000102ab, 0x000102ab, }, - {0x000102ac, 0x000102ac, 0x000102ad, 0x000102ad, 0x000102ae, 0x000102ae, 0x000102af, 0x000102af, 0x000102b0, 0x000102b0, 0x000102b1, 0x000102b1, 0x000102b2, 0x000102b2, 0x000102b3, 0x000102b3, }, - {0x000102b4, 0x000102b4, 0x000102b5, 0x000102b5, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, }, - {0x000102bc, 0x000102bc, 0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, }, - {0x000102c4, 0x000102c4, 0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, }, - {0x000102cc, 0x000102cc, 0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, }, +const uint32_t c_aauiCQMFHuffDec48[110][16] = { + { + 0x0005ffff, + 0x0003ffff, + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000037, + 0x00010001, + 0x00010001, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + }, + { + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + }, + { + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + }, + { + 0x0001003a, + 0x0001003a, + 0x00010054, + 0x00010054, + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x00020003, + 0x00020003, + 0x00020003, + 0x00020003, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + }, + { + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + }, + { + 0x000bffff, + 0x000affff, + 0x0009ffff, + 0x0008ffff, + 0x0006ffff, + 0x0007ffff, + 0x00000004, + 0x00000020, + 0x0000003b, + 0x00000055, + 0x0000006c, + 0x0000006f, + 0x00000088, + 0x00000089, + 0x0001001f, + 0x0001001f, + }, + { + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + }, + { + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x00030087, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + 0x0003008a, + }, + { + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a3, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x000200a4, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008b, + }, + { + 0x00000072, + 0x0000008c, + 0x000000a6, + 0x000000bd, + 0x000000bf, + 0x000000c0, + 0x00010006, + 0x00010006, + 0x00010057, + 0x00010057, + 0x000100a2, + 0x000100a2, + 0x000100a5, + 0x000100a5, + 0x000100be, + 0x000100be, + }, + { + 0x001dffff, + 0x002effff, + 0x003fffff, + 0x0050ffff, + 0x0019ffff, + 0x0013ffff, + 0x0012ffff, + 0x0010ffff, + 0x0011ffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x00000007, + 0x00000022, + 0x0000003d, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + }, + { + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x0003008d, + 0x000300a7, + 0x000300a7, + 0x000300a7, + 0x000300a7, + 0x000300a7, + 0x000300a7, + 0x000300a7, + 0x000300a7, + }, + { + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300c1, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + 0x000300d9, + }, + { + 0x000100f5, + 0x000100f5, + 0x000100f6, + 0x000100f6, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x000200a8, + 0x000200a8, + 0x000200a8, + 0x000200a8, + }, + { + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200c2, + 0x000200d8, + 0x000200d8, + 0x000200d8, + 0x000200d8, + 0x000200da, + 0x000200da, + 0x000200da, + 0x000200da, + 0x000200db, + 0x000200db, + 0x000200db, + 0x000200db, + }, + { + 0x00010008, + 0x00010008, + 0x00010024, + 0x00010024, + 0x0001003f, + 0x0001003f, + 0x0001005a, + 0x0001005a, + 0x00010074, + 0x00010074, + 0x000100c3, + 0x000100c3, + 0x000100dc, + 0x000100dc, + 0x000100f4, + 0x000100f4, + }, + { + 0x0015ffff, + 0x0014ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x00000009, + 0x00000075, + 0x0000008f, + 0x000000a9, + 0x000000dd, + 0x000000f3, + 0x000000f7, + 0x000000f8, + 0x0000010e, + 0x0000010f, + 0x00000111, + }, + { + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030090, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + 0x00030091, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + }, + { + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300ab, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + 0x000300de, + }, + { + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300e0, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + }, + { + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012a, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + 0x0003012c, + }, + { + 0x0061ffff, + 0x0062ffff, + 0x0063ffff, + 0x0064ffff, + 0x0065ffff, + 0x0066ffff, + 0x0067ffff, + 0x0068ffff, + 0x0069ffff, + 0x006affff, + 0x006bffff, + 0x006cffff, + 0x006dffff, + 0x001bffff, + 0x001affff, + 0x001cffff, + }, + { + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200ac, + 0x000200c4, + 0x000200c4, + 0x000200c4, + 0x000200c4, + }, + { + 0x000102d4, + 0x000102d4, + 0x000102d5, + 0x000102d5, + 0x000102d6, + 0x000102d6, + 0x000102d7, + 0x000102d7, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + }, + { + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x000200e1, + 0x00020113, + 0x00020113, + 0x00020113, + 0x00020113, + 0x00020146, + 0x00020146, + 0x00020146, + 0x00020146, + 0x000202d8, + 0x000202d8, + 0x000202d8, + 0x000202d8, + }, + { + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0027ffff, + 0x0025ffff, + 0x0026ffff, + 0x0028ffff, + 0x0029ffff, + 0x002affff, + 0x002bffff, + 0x002cffff, + 0x002dffff, + }, + { + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + }, + { + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + }, + { + 0x00010026, + 0x00010026, + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + }, + { + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + }, + { + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + }, + { + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + }, + { + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + }, + { + 0x00010077, + 0x00010077, + 0x00010078, + 0x00010078, + 0x00010079, + 0x00010079, + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + 0x0001007c, + 0x0001007c, + 0x0001007d, + 0x0001007d, + 0x0001007e, + 0x0001007e, + }, + { + 0x0001007f, + 0x0001007f, + 0x00010080, + 0x00010080, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + 0x00010083, + 0x00010083, + 0x00010084, + 0x00010084, + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + }, + { + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + }, + { + 0x00010092, + 0x00010092, + 0x00010093, + 0x00010093, + 0x00010094, + 0x00010094, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + 0x00010099, + 0x00010099, + }, + { + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + 0x000100a1, + 0x000100a1, + }, + { + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + 0x000100b4, + 0x000100b4, + }, + { + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + 0x000100bc, + 0x000100bc, + }, + { + 0x000100c5, + 0x000100c5, + 0x000100c6, + 0x000100c6, + 0x000100c7, + 0x000100c7, + 0x000100c8, + 0x000100c8, + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x000100cb, + 0x000100cb, + 0x000100cc, + 0x000100cc, + }, + { + 0x000100cd, + 0x000100cd, + 0x000100ce, + 0x000100ce, + 0x000100cf, + 0x000100cf, + 0x000100d0, + 0x000100d0, + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100d3, + 0x000100d3, + 0x000100d4, + 0x000100d4, + }, + { + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + 0x0033ffff, + 0x0034ffff, + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + 0x0039ffff, + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + }, + { + 0x000100d5, + 0x000100d5, + 0x000100d6, + 0x000100d6, + 0x000100d7, + 0x000100d7, + 0x000100df, + 0x000100df, + 0x000100e2, + 0x000100e2, + 0x000100e3, + 0x000100e3, + 0x000100e4, + 0x000100e4, + 0x000100e5, + 0x000100e5, + }, + { + 0x000100e6, + 0x000100e6, + 0x000100e7, + 0x000100e7, + 0x000100e8, + 0x000100e8, + 0x000100e9, + 0x000100e9, + 0x000100ea, + 0x000100ea, + 0x000100eb, + 0x000100eb, + 0x000100ec, + 0x000100ec, + 0x000100ed, + 0x000100ed, + }, + { + 0x000100ee, + 0x000100ee, + 0x000100ef, + 0x000100ef, + 0x000100f0, + 0x000100f0, + 0x000100f1, + 0x000100f1, + 0x000100f2, + 0x000100f2, + 0x000100f9, + 0x000100f9, + 0x000100fb, + 0x000100fb, + 0x000100fc, + 0x000100fc, + }, + { + 0x000100fd, + 0x000100fd, + 0x000100fe, + 0x000100fe, + 0x000100ff, + 0x000100ff, + 0x00010100, + 0x00010100, + 0x00010101, + 0x00010101, + 0x00010102, + 0x00010102, + 0x00010103, + 0x00010103, + 0x00010104, + 0x00010104, + }, + { + 0x00010105, + 0x00010105, + 0x00010106, + 0x00010106, + 0x00010107, + 0x00010107, + 0x00010108, + 0x00010108, + 0x00010109, + 0x00010109, + 0x0001010a, + 0x0001010a, + 0x0001010b, + 0x0001010b, + 0x0001010c, + 0x0001010c, + }, + { + 0x0001010d, + 0x0001010d, + 0x00010110, + 0x00010110, + 0x00010112, + 0x00010112, + 0x00010114, + 0x00010114, + 0x00010115, + 0x00010115, + 0x00010116, + 0x00010116, + 0x00010117, + 0x00010117, + 0x00010118, + 0x00010118, + }, + { + 0x00010119, + 0x00010119, + 0x0001011a, + 0x0001011a, + 0x0001011b, + 0x0001011b, + 0x0001011c, + 0x0001011c, + 0x0001011d, + 0x0001011d, + 0x0001011e, + 0x0001011e, + 0x0001011f, + 0x0001011f, + 0x00010120, + 0x00010120, + }, + { + 0x00010121, + 0x00010121, + 0x00010122, + 0x00010122, + 0x00010123, + 0x00010123, + 0x00010124, + 0x00010124, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010127, + 0x00010127, + 0x00010128, + 0x00010128, + }, + { + 0x00010129, + 0x00010129, + 0x0001012b, + 0x0001012b, + 0x0001012d, + 0x0001012d, + 0x0001012e, + 0x0001012e, + 0x0001012f, + 0x0001012f, + 0x00010130, + 0x00010130, + 0x00010131, + 0x00010131, + 0x00010132, + 0x00010132, + }, + { + 0x00010133, + 0x00010133, + 0x00010134, + 0x00010134, + 0x00010135, + 0x00010135, + 0x00010136, + 0x00010136, + 0x00010137, + 0x00010137, + 0x00010138, + 0x00010138, + 0x00010139, + 0x00010139, + 0x0001013a, + 0x0001013a, + }, + { + 0x0001013b, + 0x0001013b, + 0x0001013c, + 0x0001013c, + 0x0001013d, + 0x0001013d, + 0x0001013e, + 0x0001013e, + 0x0001013f, + 0x0001013f, + 0x00010140, + 0x00010140, + 0x00010141, + 0x00010141, + 0x00010142, + 0x00010142, + }, + { + 0x00010143, + 0x00010143, + 0x00010144, + 0x00010144, + 0x00010145, + 0x00010145, + 0x00010147, + 0x00010147, + 0x00010148, + 0x00010148, + 0x00010149, + 0x00010149, + 0x0001014a, + 0x0001014a, + 0x0001014b, + 0x0001014b, + }, + { + 0x0001014c, + 0x0001014c, + 0x0001014d, + 0x0001014d, + 0x0001014e, + 0x0001014e, + 0x0001014f, + 0x0001014f, + 0x00010150, + 0x00010150, + 0x00010151, + 0x00010151, + 0x00010152, + 0x00010152, + 0x00010153, + 0x00010153, + }, + { + 0x00010154, + 0x00010154, + 0x00010155, + 0x00010155, + 0x00010156, + 0x00010156, + 0x00010157, + 0x00010157, + 0x00010158, + 0x00010158, + 0x00010159, + 0x00010159, + 0x0001015a, + 0x0001015a, + 0x0001015b, + 0x0001015b, + }, + { + 0x0001015c, + 0x0001015c, + 0x0001015d, + 0x0001015d, + 0x0001015e, + 0x0001015e, + 0x0001015f, + 0x0001015f, + 0x00010160, + 0x00010160, + 0x00010161, + 0x00010161, + 0x00010162, + 0x00010162, + 0x00010163, + 0x00010163, + }, + { + 0x00010164, + 0x00010164, + 0x00010165, + 0x00010165, + 0x00010166, + 0x00010166, + 0x00010167, + 0x00010167, + 0x00010168, + 0x00010168, + 0x00010169, + 0x00010169, + 0x0001016a, + 0x0001016a, + 0x0001016b, + 0x0001016b, + }, + { + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0044ffff, + 0x0045ffff, + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x0049ffff, + 0x004affff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + }, + { + 0x0001016c, + 0x0001016c, + 0x0001016d, + 0x0001016d, + 0x0001016e, + 0x0001016e, + 0x0001016f, + 0x0001016f, + 0x00010170, + 0x00010170, + 0x00010171, + 0x00010171, + 0x00010172, + 0x00010172, + 0x00010173, + 0x00010173, + }, + { + 0x00010174, + 0x00010174, + 0x00010175, + 0x00010175, + 0x00010176, + 0x00010176, + 0x00010177, + 0x00010177, + 0x00010178, + 0x00010178, + 0x00010179, + 0x00010179, + 0x0001017a, + 0x0001017a, + 0x0001017b, + 0x0001017b, + }, + { + 0x0001017c, + 0x0001017c, + 0x0001017d, + 0x0001017d, + 0x0001017e, + 0x0001017e, + 0x0001017f, + 0x0001017f, + 0x00010180, + 0x00010180, + 0x00010181, + 0x00010181, + 0x00010182, + 0x00010182, + 0x00010183, + 0x00010183, + }, + { + 0x00010184, + 0x00010184, + 0x00010185, + 0x00010185, + 0x00010186, + 0x00010186, + 0x00010187, + 0x00010187, + 0x00010188, + 0x00010188, + 0x00010189, + 0x00010189, + 0x0001018a, + 0x0001018a, + 0x0001018b, + 0x0001018b, + }, + { + 0x0001018c, + 0x0001018c, + 0x0001018d, + 0x0001018d, + 0x0001018e, + 0x0001018e, + 0x0001018f, + 0x0001018f, + 0x00010190, + 0x00010190, + 0x00010191, + 0x00010191, + 0x00010192, + 0x00010192, + 0x00010193, + 0x00010193, + }, + { + 0x00010194, + 0x00010194, + 0x00010195, + 0x00010195, + 0x00010196, + 0x00010196, + 0x00010197, + 0x00010197, + 0x00010198, + 0x00010198, + 0x00010199, + 0x00010199, + 0x0001019a, + 0x0001019a, + 0x0001019b, + 0x0001019b, + }, + { + 0x0001019c, + 0x0001019c, + 0x0001019d, + 0x0001019d, + 0x0001019e, + 0x0001019e, + 0x0001019f, + 0x0001019f, + 0x000101a0, + 0x000101a0, + 0x000101a1, + 0x000101a1, + 0x000101a2, + 0x000101a2, + 0x000101a3, + 0x000101a3, + }, + { + 0x000101a4, + 0x000101a4, + 0x000101a5, + 0x000101a5, + 0x000101a6, + 0x000101a6, + 0x000101a7, + 0x000101a7, + 0x000101a8, + 0x000101a8, + 0x000101a9, + 0x000101a9, + 0x000101aa, + 0x000101aa, + 0x000101ab, + 0x000101ab, + }, + { + 0x000101ac, + 0x000101ac, + 0x000101ad, + 0x000101ad, + 0x000101ae, + 0x000101ae, + 0x000101af, + 0x000101af, + 0x000101b0, + 0x000101b0, + 0x000101b1, + 0x000101b1, + 0x000101b2, + 0x000101b2, + 0x000101b3, + 0x000101b3, + }, + { + 0x000101b4, + 0x000101b4, + 0x000101b5, + 0x000101b5, + 0x000101b6, + 0x000101b6, + 0x000101b7, + 0x000101b7, + 0x000101b8, + 0x000101b8, + 0x000101b9, + 0x000101b9, + 0x000101ba, + 0x000101ba, + 0x000101bb, + 0x000101bb, + }, + { + 0x000101bc, + 0x000101bc, + 0x000101bd, + 0x000101bd, + 0x000101be, + 0x000101be, + 0x000101bf, + 0x000101bf, + 0x000101c0, + 0x000101c0, + 0x000101c1, + 0x000101c1, + 0x000101c2, + 0x000101c2, + 0x000101c3, + 0x000101c3, + }, + { + 0x000101c4, + 0x000101c4, + 0x000101c5, + 0x000101c5, + 0x000101c6, + 0x000101c6, + 0x000101c7, + 0x000101c7, + 0x000101c8, + 0x000101c8, + 0x000101c9, + 0x000101c9, + 0x000101ca, + 0x000101ca, + 0x000101cb, + 0x000101cb, + }, + { + 0x000101cc, + 0x000101cc, + 0x000101cd, + 0x000101cd, + 0x000101ce, + 0x000101ce, + 0x000101cf, + 0x000101cf, + 0x000101d0, + 0x000101d0, + 0x000101d1, + 0x000101d1, + 0x000101d2, + 0x000101d2, + 0x000101d3, + 0x000101d3, + }, + { + 0x000101d4, + 0x000101d4, + 0x000101d5, + 0x000101d5, + 0x000101d6, + 0x000101d6, + 0x000101d7, + 0x000101d7, + 0x000101d8, + 0x000101d8, + 0x000101d9, + 0x000101d9, + 0x000101da, + 0x000101da, + 0x000101db, + 0x000101db, + }, + { + 0x000101dc, + 0x000101dc, + 0x000101dd, + 0x000101dd, + 0x000101de, + 0x000101de, + 0x000101df, + 0x000101df, + 0x000101e0, + 0x000101e0, + 0x000101e1, + 0x000101e1, + 0x000101e2, + 0x000101e2, + 0x000101e3, + 0x000101e3, + }, + { + 0x000101e4, + 0x000101e4, + 0x000101e5, + 0x000101e5, + 0x000101e6, + 0x000101e6, + 0x000101e7, + 0x000101e7, + 0x000101e8, + 0x000101e8, + 0x000101e9, + 0x000101e9, + 0x000101ea, + 0x000101ea, + 0x000101eb, + 0x000101eb, + }, + { + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + 0x0054ffff, + 0x0055ffff, + 0x0056ffff, + 0x0057ffff, + 0x0058ffff, + 0x0059ffff, + 0x005affff, + 0x005bffff, + 0x005cffff, + 0x005dffff, + 0x005effff, + 0x005fffff, + 0x0060ffff, + }, + { + 0x000101ec, + 0x000101ec, + 0x000101ed, + 0x000101ed, + 0x000101ee, + 0x000101ee, + 0x000101ef, + 0x000101ef, + 0x000101f0, + 0x000101f0, + 0x000101f1, + 0x000101f1, + 0x000101f2, + 0x000101f2, + 0x000101f3, + 0x000101f3, + }, + { + 0x000101f4, + 0x000101f4, + 0x000101f5, + 0x000101f5, + 0x000101f6, + 0x000101f6, + 0x000101f7, + 0x000101f7, + 0x000101f8, + 0x000101f8, + 0x000101f9, + 0x000101f9, + 0x000101fa, + 0x000101fa, + 0x000101fb, + 0x000101fb, + }, + { + 0x000101fc, + 0x000101fc, + 0x000101fd, + 0x000101fd, + 0x000101fe, + 0x000101fe, + 0x000101ff, + 0x000101ff, + 0x00010200, + 0x00010200, + 0x00010201, + 0x00010201, + 0x00010202, + 0x00010202, + 0x00010203, + 0x00010203, + }, + { + 0x00010204, + 0x00010204, + 0x00010205, + 0x00010205, + 0x00010206, + 0x00010206, + 0x00010207, + 0x00010207, + 0x00010208, + 0x00010208, + 0x00010209, + 0x00010209, + 0x0001020a, + 0x0001020a, + 0x0001020b, + 0x0001020b, + }, + { + 0x0001020c, + 0x0001020c, + 0x0001020d, + 0x0001020d, + 0x0001020e, + 0x0001020e, + 0x0001020f, + 0x0001020f, + 0x00010210, + 0x00010210, + 0x00010211, + 0x00010211, + 0x00010212, + 0x00010212, + 0x00010213, + 0x00010213, + }, + { + 0x00010214, + 0x00010214, + 0x00010215, + 0x00010215, + 0x00010216, + 0x00010216, + 0x00010217, + 0x00010217, + 0x00010218, + 0x00010218, + 0x00010219, + 0x00010219, + 0x0001021a, + 0x0001021a, + 0x0001021b, + 0x0001021b, + }, + { + 0x0001021c, + 0x0001021c, + 0x0001021d, + 0x0001021d, + 0x0001021e, + 0x0001021e, + 0x0001021f, + 0x0001021f, + 0x00010220, + 0x00010220, + 0x00010221, + 0x00010221, + 0x00010222, + 0x00010222, + 0x00010223, + 0x00010223, + }, + { + 0x00010224, + 0x00010224, + 0x00010225, + 0x00010225, + 0x00010226, + 0x00010226, + 0x00010227, + 0x00010227, + 0x00010228, + 0x00010228, + 0x00010229, + 0x00010229, + 0x0001022a, + 0x0001022a, + 0x0001022b, + 0x0001022b, + }, + { + 0x0001022c, + 0x0001022c, + 0x0001022d, + 0x0001022d, + 0x0001022e, + 0x0001022e, + 0x0001022f, + 0x0001022f, + 0x00010230, + 0x00010230, + 0x00010231, + 0x00010231, + 0x00010232, + 0x00010232, + 0x00010233, + 0x00010233, + }, + { + 0x00010234, + 0x00010234, + 0x00010235, + 0x00010235, + 0x00010236, + 0x00010236, + 0x00010237, + 0x00010237, + 0x00010238, + 0x00010238, + 0x00010239, + 0x00010239, + 0x0001023a, + 0x0001023a, + 0x0001023b, + 0x0001023b, + }, + { + 0x0001023c, + 0x0001023c, + 0x0001023d, + 0x0001023d, + 0x0001023e, + 0x0001023e, + 0x0001023f, + 0x0001023f, + 0x00010240, + 0x00010240, + 0x00010241, + 0x00010241, + 0x00010242, + 0x00010242, + 0x00010243, + 0x00010243, + }, + { + 0x00010244, + 0x00010244, + 0x00010245, + 0x00010245, + 0x00010246, + 0x00010246, + 0x00010247, + 0x00010247, + 0x00010248, + 0x00010248, + 0x00010249, + 0x00010249, + 0x0001024a, + 0x0001024a, + 0x0001024b, + 0x0001024b, + }, + { + 0x0001024c, + 0x0001024c, + 0x0001024d, + 0x0001024d, + 0x0001024e, + 0x0001024e, + 0x0001024f, + 0x0001024f, + 0x00010250, + 0x00010250, + 0x00010251, + 0x00010251, + 0x00010252, + 0x00010252, + 0x00010253, + 0x00010253, + }, + { + 0x00010254, + 0x00010254, + 0x00010255, + 0x00010255, + 0x00010256, + 0x00010256, + 0x00010257, + 0x00010257, + 0x00010258, + 0x00010258, + 0x00010259, + 0x00010259, + 0x0001025a, + 0x0001025a, + 0x0001025b, + 0x0001025b, + }, + { + 0x0001025c, + 0x0001025c, + 0x0001025d, + 0x0001025d, + 0x0001025e, + 0x0001025e, + 0x0001025f, + 0x0001025f, + 0x00010260, + 0x00010260, + 0x00010261, + 0x00010261, + 0x00010262, + 0x00010262, + 0x00010263, + 0x00010263, + }, + { + 0x00010264, + 0x00010264, + 0x00010265, + 0x00010265, + 0x00010266, + 0x00010266, + 0x00010267, + 0x00010267, + 0x00010268, + 0x00010268, + 0x00010269, + 0x00010269, + 0x0001026a, + 0x0001026a, + 0x0001026b, + 0x0001026b, + }, + { + 0x0001026c, + 0x0001026c, + 0x0001026d, + 0x0001026d, + 0x0001026e, + 0x0001026e, + 0x0001026f, + 0x0001026f, + 0x00010270, + 0x00010270, + 0x00010271, + 0x00010271, + 0x00010272, + 0x00010272, + 0x00010273, + 0x00010273, + }, + { + 0x00010274, + 0x00010274, + 0x00010275, + 0x00010275, + 0x00010276, + 0x00010276, + 0x00010277, + 0x00010277, + 0x00010278, + 0x00010278, + 0x00010279, + 0x00010279, + 0x0001027a, + 0x0001027a, + 0x0001027b, + 0x0001027b, + }, + { + 0x0001027c, + 0x0001027c, + 0x0001027d, + 0x0001027d, + 0x0001027e, + 0x0001027e, + 0x0001027f, + 0x0001027f, + 0x00010280, + 0x00010280, + 0x00010281, + 0x00010281, + 0x00010282, + 0x00010282, + 0x00010283, + 0x00010283, + }, + { + 0x00010284, + 0x00010284, + 0x00010285, + 0x00010285, + 0x00010286, + 0x00010286, + 0x00010287, + 0x00010287, + 0x00010288, + 0x00010288, + 0x00010289, + 0x00010289, + 0x0001028a, + 0x0001028a, + 0x0001028b, + 0x0001028b, + }, + { + 0x0001028c, + 0x0001028c, + 0x0001028d, + 0x0001028d, + 0x0001028e, + 0x0001028e, + 0x0001028f, + 0x0001028f, + 0x00010290, + 0x00010290, + 0x00010291, + 0x00010291, + 0x00010292, + 0x00010292, + 0x00010293, + 0x00010293, + }, + { + 0x00010294, + 0x00010294, + 0x00010295, + 0x00010295, + 0x00010296, + 0x00010296, + 0x00010297, + 0x00010297, + 0x00010298, + 0x00010298, + 0x00010299, + 0x00010299, + 0x0001029a, + 0x0001029a, + 0x0001029b, + 0x0001029b, + }, + { + 0x0001029c, + 0x0001029c, + 0x0001029d, + 0x0001029d, + 0x0001029e, + 0x0001029e, + 0x0001029f, + 0x0001029f, + 0x000102a0, + 0x000102a0, + 0x000102a1, + 0x000102a1, + 0x000102a2, + 0x000102a2, + 0x000102a3, + 0x000102a3, + }, + { + 0x000102a4, + 0x000102a4, + 0x000102a5, + 0x000102a5, + 0x000102a6, + 0x000102a6, + 0x000102a7, + 0x000102a7, + 0x000102a8, + 0x000102a8, + 0x000102a9, + 0x000102a9, + 0x000102aa, + 0x000102aa, + 0x000102ab, + 0x000102ab, + }, + { + 0x000102ac, + 0x000102ac, + 0x000102ad, + 0x000102ad, + 0x000102ae, + 0x000102ae, + 0x000102af, + 0x000102af, + 0x000102b0, + 0x000102b0, + 0x000102b1, + 0x000102b1, + 0x000102b2, + 0x000102b2, + 0x000102b3, + 0x000102b3, + }, + { + 0x000102b4, + 0x000102b4, + 0x000102b5, + 0x000102b5, + 0x000102b6, + 0x000102b6, + 0x000102b7, + 0x000102b7, + 0x000102b8, + 0x000102b8, + 0x000102b9, + 0x000102b9, + 0x000102ba, + 0x000102ba, + 0x000102bb, + 0x000102bb, + }, + { + 0x000102bc, + 0x000102bc, + 0x000102bd, + 0x000102bd, + 0x000102be, + 0x000102be, + 0x000102bf, + 0x000102bf, + 0x000102c0, + 0x000102c0, + 0x000102c1, + 0x000102c1, + 0x000102c2, + 0x000102c2, + 0x000102c3, + 0x000102c3, + }, + { + 0x000102c4, + 0x000102c4, + 0x000102c5, + 0x000102c5, + 0x000102c6, + 0x000102c6, + 0x000102c7, + 0x000102c7, + 0x000102c8, + 0x000102c8, + 0x000102c9, + 0x000102c9, + 0x000102ca, + 0x000102ca, + 0x000102cb, + 0x000102cb, + }, + { + 0x000102cc, + 0x000102cc, + 0x000102cd, + 0x000102cd, + 0x000102ce, + 0x000102ce, + 0x000102cf, + 0x000102cf, + 0x000102d0, + 0x000102d0, + 0x000102d1, + 0x000102d1, + 0x000102d2, + 0x000102d2, + 0x000102d3, + 0x000102d3, + }, }; #endif @@ -3402,217 +35550,2774 @@ const uint32_t c_aauiCQMFHuffEnc49[729][2] = #else const uint16_t c_aauiCQMFHuffEnc49[729][2] = #endif -{ - {0x0002, 0x0003}, {0x0003, 0x0003}, {0x0005, 0x0007}, {0x0007, 0x000a}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0009, 0x0009}, {0x000b, 0x000d}, - {0x000d, 0x0014}, {0x000d, 0x0015}, {0x0010, 0x0052}, {0x0011, 0x0098}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, - {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, - {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0005, 0x0008}, {0x0006, 0x000a}, {0x0007, 0x000b}, - {0x0008, 0x000b}, {0x0008, 0x000c}, {0x000a, 0x000a}, {0x000b, 0x000e}, {0x000d, 0x0016}, {0x000f, 0x0031}, {0x0010, 0x0053}, {0x0012, 0x012a}, - {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, - {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0005, 0x0009}, {0x0005, 0x000a}, - {0x0005, 0x000b}, {0x0006, 0x000b}, {0x0007, 0x000c}, {0x0008, 0x000d}, {0x0009, 0x000a}, {0x000a, 0x000b}, {0x000c, 0x000f}, {0x000d, 0x0017}, - {0x000f, 0x0032}, {0x0010, 0x0054}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, - {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, {0x0013, 0x0028}, {0x0013, 0x0029}, {0x0013, 0x002a}, - {0x0013, 0x002b}, {0x0007, 0x000d}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x000e}, {0x0009, 0x000b}, - {0x000b, 0x000f}, {0x000c, 0x0010}, {0x000e, 0x001d}, {0x000f, 0x0033}, {0x0011, 0x0099}, {0x0013, 0x002c}, {0x0013, 0x002d}, {0x0013, 0x002e}, - {0x0013, 0x002f}, {0x0013, 0x0030}, {0x0013, 0x0031}, {0x0013, 0x0032}, {0x0013, 0x0033}, {0x0013, 0x0034}, {0x0013, 0x0035}, {0x0013, 0x0036}, - {0x0013, 0x0037}, {0x0013, 0x0038}, {0x0013, 0x0039}, {0x0013, 0x003a}, {0x0008, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, - {0x0008, 0x0010}, {0x0009, 0x000c}, {0x000a, 0x000c}, {0x000c, 0x0011}, {0x000d, 0x0018}, {0x000e, 0x001e}, {0x0011, 0x009a}, {0x0011, 0x009b}, - {0x0013, 0x003b}, {0x0013, 0x003c}, {0x0013, 0x003d}, {0x0013, 0x003e}, {0x0013, 0x003f}, {0x0013, 0x0040}, {0x0013, 0x0041}, {0x0013, 0x0042}, - {0x0013, 0x0043}, {0x0013, 0x0044}, {0x0013, 0x0045}, {0x0013, 0x0046}, {0x0013, 0x0047}, {0x0013, 0x0048}, {0x0013, 0x0049}, {0x0008, 0x0011}, - {0x0007, 0x0013}, {0x0008, 0x0012}, {0x0008, 0x0013}, {0x0009, 0x000d}, {0x000a, 0x000d}, {0x000b, 0x0010}, {0x000c, 0x0012}, {0x000e, 0x001f}, - {0x000e, 0x0020}, {0x0010, 0x0055}, {0x0011, 0x009c}, {0x0013, 0x004a}, {0x0013, 0x004b}, {0x0013, 0x004c}, {0x0013, 0x004d}, {0x0013, 0x004e}, - {0x0013, 0x004f}, {0x0013, 0x0050}, {0x0013, 0x0051}, {0x0013, 0x0052}, {0x0013, 0x0053}, {0x0013, 0x0054}, {0x0013, 0x0055}, {0x0013, 0x0056}, - {0x0013, 0x0057}, {0x0013, 0x0058}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x000e}, {0x000b, 0x0011}, - {0x000c, 0x0013}, {0x000d, 0x0019}, {0x000e, 0x0021}, {0x0010, 0x0056}, {0x0010, 0x0057}, {0x0013, 0x0059}, {0x0013, 0x005a}, {0x0013, 0x005b}, - {0x0013, 0x005c}, {0x0013, 0x005d}, {0x0013, 0x005e}, {0x0013, 0x005f}, {0x0013, 0x0060}, {0x0013, 0x0061}, {0x0013, 0x0062}, {0x0013, 0x0063}, - {0x0013, 0x0064}, {0x0013, 0x0065}, {0x0013, 0x0066}, {0x0013, 0x0067}, {0x0013, 0x0068}, {0x000b, 0x0012}, {0x000a, 0x000f}, {0x000a, 0x0010}, - {0x000a, 0x0011}, {0x000c, 0x0014}, {0x000c, 0x0015}, {0x000d, 0x001a}, {0x000e, 0x0022}, {0x0010, 0x0058}, {0x0010, 0x0059}, {0x0013, 0x0069}, - {0x0013, 0x006a}, {0x0013, 0x006b}, {0x0013, 0x006c}, {0x0013, 0x006d}, {0x0013, 0x006e}, {0x0013, 0x006f}, {0x0013, 0x0070}, {0x0013, 0x0071}, - {0x0013, 0x0072}, {0x0013, 0x0073}, {0x0013, 0x0074}, {0x0013, 0x0075}, {0x0013, 0x0076}, {0x0013, 0x0077}, {0x0013, 0x0078}, {0x0013, 0x0079}, - {0x000c, 0x0016}, {0x000b, 0x0013}, {0x000c, 0x0017}, {0x000c, 0x0018}, {0x000c, 0x0019}, {0x000e, 0x0023}, {0x000e, 0x0024}, {0x000f, 0x0034}, - {0x0010, 0x005a}, {0x0011, 0x009d}, {0x0013, 0x007a}, {0x0013, 0x007b}, {0x0013, 0x007c}, {0x0013, 0x007d}, {0x0013, 0x007e}, {0x0013, 0x007f}, - {0x0013, 0x0080}, {0x0013, 0x0081}, {0x0013, 0x0082}, {0x0013, 0x0083}, {0x0013, 0x0084}, {0x0013, 0x0085}, {0x0013, 0x0086}, {0x0013, 0x0087}, - {0x0013, 0x0088}, {0x0013, 0x0089}, {0x0013, 0x008a}, {0x000e, 0x0025}, {0x000d, 0x001b}, {0x000d, 0x001c}, {0x000d, 0x001d}, {0x000e, 0x0026}, - {0x000f, 0x0035}, {0x0010, 0x005b}, {0x0011, 0x009e}, {0x0011, 0x009f}, {0x0012, 0x012b}, {0x0013, 0x008b}, {0x0013, 0x008c}, {0x0013, 0x008d}, - {0x0013, 0x008e}, {0x0013, 0x008f}, {0x0013, 0x0090}, {0x0013, 0x0091}, {0x0013, 0x0092}, {0x0013, 0x0093}, {0x0013, 0x0094}, {0x0013, 0x0095}, - {0x0013, 0x0096}, {0x0013, 0x0097}, {0x0013, 0x0098}, {0x0013, 0x0099}, {0x0013, 0x009a}, {0x0013, 0x009b}, {0x0010, 0x005c}, {0x000f, 0x0036}, - {0x000e, 0x0027}, {0x000f, 0x0037}, {0x000f, 0x0038}, {0x0010, 0x005d}, {0x0011, 0x00a0}, {0x0013, 0x009c}, {0x0012, 0x012c}, {0x0013, 0x009d}, - {0x0013, 0x009e}, {0x0013, 0x009f}, {0x0013, 0x00a0}, {0x0013, 0x00a1}, {0x0013, 0x00a2}, {0x0013, 0x00a3}, {0x0013, 0x00a4}, {0x0013, 0x00a5}, - {0x0013, 0x00a6}, {0x0013, 0x00a7}, {0x0013, 0x00a8}, {0x0013, 0x00a9}, {0x0013, 0x00aa}, {0x0013, 0x00ab}, {0x0013, 0x00ac}, {0x0013, 0x00ad}, - {0x0013, 0x00ae}, {0x0010, 0x005e}, {0x000f, 0x0039}, {0x0010, 0x005f}, {0x0010, 0x0060}, {0x0011, 0x00a1}, {0x0010, 0x0061}, {0x0013, 0x00af}, - {0x0013, 0x00b0}, {0x0012, 0x012d}, {0x0013, 0x00b1}, {0x0013, 0x00b2}, {0x0013, 0x00b3}, {0x0013, 0x00b4}, {0x0013, 0x00b5}, {0x0013, 0x00b6}, - {0x0013, 0x00b7}, {0x0013, 0x00b8}, {0x0013, 0x00b9}, {0x0013, 0x00ba}, {0x0013, 0x00bb}, {0x0013, 0x00bc}, {0x0013, 0x00bd}, {0x0013, 0x00be}, - {0x0013, 0x00bf}, {0x0013, 0x00c0}, {0x0013, 0x00c1}, {0x0013, 0x00c2}, {0x0012, 0x012e}, {0x0011, 0x00a2}, {0x0011, 0x00a3}, {0x0013, 0x00c3}, - {0x0013, 0x00c4}, {0x0013, 0x00c5}, {0x0013, 0x00c6}, {0x0013, 0x00c7}, {0x0013, 0x00c8}, {0x0013, 0x00c9}, {0x0013, 0x00ca}, {0x0013, 0x00cb}, - {0x0013, 0x00cc}, {0x0013, 0x00cd}, {0x0013, 0x00ce}, {0x0013, 0x00cf}, {0x0013, 0x00d0}, {0x0013, 0x00d1}, {0x0013, 0x00d2}, {0x0013, 0x00d3}, - {0x0013, 0x00d4}, {0x0013, 0x00d5}, {0x0013, 0x00d6}, {0x0013, 0x00d7}, {0x0013, 0x00d8}, {0x0013, 0x00d9}, {0x0013, 0x00da}, {0x0013, 0x00db}, - {0x0013, 0x00dc}, {0x0013, 0x00dd}, {0x0013, 0x00de}, {0x0013, 0x00df}, {0x0012, 0x012f}, {0x0013, 0x00e0}, {0x0013, 0x00e1}, {0x0013, 0x00e2}, - {0x0013, 0x00e3}, {0x0013, 0x00e4}, {0x0013, 0x00e5}, {0x0013, 0x00e6}, {0x0013, 0x00e7}, {0x0013, 0x00e8}, {0x0013, 0x00e9}, {0x0013, 0x00ea}, - {0x0013, 0x00eb}, {0x0013, 0x00ec}, {0x0013, 0x00ed}, {0x0013, 0x00ee}, {0x0013, 0x00ef}, {0x0013, 0x00f0}, {0x0013, 0x00f1}, {0x0013, 0x00f2}, - {0x0013, 0x00f3}, {0x0013, 0x00f4}, {0x0013, 0x00f5}, {0x0013, 0x00f6}, {0x0013, 0x00f7}, {0x0013, 0x00f8}, {0x0013, 0x00f9}, {0x0013, 0x00fa}, - {0x0013, 0x00fb}, {0x0013, 0x00fc}, {0x0013, 0x00fd}, {0x0013, 0x00fe}, {0x0013, 0x00ff}, {0x0013, 0x0100}, {0x0013, 0x0101}, {0x0013, 0x0102}, - {0x0013, 0x0103}, {0x0013, 0x0104}, {0x0013, 0x0105}, {0x0013, 0x0106}, {0x0013, 0x0107}, {0x0013, 0x0108}, {0x0013, 0x0109}, {0x0013, 0x010a}, - {0x0013, 0x010b}, {0x0013, 0x010c}, {0x0013, 0x010d}, {0x0013, 0x010e}, {0x0013, 0x010f}, {0x0013, 0x0110}, {0x0013, 0x0111}, {0x0013, 0x0112}, - {0x0013, 0x0113}, {0x0013, 0x0114}, {0x0013, 0x0115}, {0x0013, 0x0116}, {0x0013, 0x0117}, {0x0013, 0x0118}, {0x0013, 0x0119}, {0x0013, 0x011a}, - {0x0013, 0x011b}, {0x0013, 0x011c}, {0x0013, 0x011d}, {0x0013, 0x011e}, {0x0013, 0x011f}, {0x0013, 0x0120}, {0x0013, 0x0121}, {0x0013, 0x0122}, - {0x0013, 0x0123}, {0x0013, 0x0124}, {0x0013, 0x0125}, {0x0013, 0x0126}, {0x0013, 0x0127}, {0x0013, 0x0128}, {0x0013, 0x0129}, {0x0013, 0x012a}, - {0x0013, 0x012b}, {0x0013, 0x012c}, {0x0013, 0x012d}, {0x0013, 0x012e}, {0x0013, 0x012f}, {0x0013, 0x0130}, {0x0013, 0x0131}, {0x0013, 0x0132}, - {0x0013, 0x0133}, {0x0013, 0x0134}, {0x0013, 0x0135}, {0x0013, 0x0136}, {0x0013, 0x0137}, {0x0013, 0x0138}, {0x0013, 0x0139}, {0x0013, 0x013a}, - {0x0013, 0x013b}, {0x0013, 0x013c}, {0x0013, 0x013d}, {0x0013, 0x013e}, {0x0013, 0x013f}, {0x0013, 0x0140}, {0x0013, 0x0141}, {0x0013, 0x0142}, - {0x0013, 0x0143}, {0x0013, 0x0144}, {0x0013, 0x0145}, {0x0013, 0x0146}, {0x0013, 0x0147}, {0x0013, 0x0148}, {0x0013, 0x0149}, {0x0013, 0x014a}, - {0x0013, 0x014b}, {0x0013, 0x014c}, {0x0013, 0x014d}, {0x0013, 0x014e}, {0x0013, 0x014f}, {0x0013, 0x0150}, {0x0013, 0x0151}, {0x0013, 0x0152}, - {0x0013, 0x0153}, {0x0013, 0x0154}, {0x0013, 0x0155}, {0x0013, 0x0156}, {0x0013, 0x0157}, {0x0013, 0x0158}, {0x0013, 0x0159}, {0x0013, 0x015a}, - {0x0013, 0x015b}, {0x0013, 0x015c}, {0x0013, 0x015d}, {0x0013, 0x015e}, {0x0013, 0x015f}, {0x0013, 0x0160}, {0x0013, 0x0161}, {0x0013, 0x0162}, - {0x0013, 0x0163}, {0x0013, 0x0164}, {0x0013, 0x0165}, {0x0013, 0x0166}, {0x0013, 0x0167}, {0x0013, 0x0168}, {0x0013, 0x0169}, {0x0013, 0x016a}, - {0x0013, 0x016b}, {0x0013, 0x016c}, {0x0013, 0x016d}, {0x0013, 0x016e}, {0x0013, 0x016f}, {0x0013, 0x0170}, {0x0013, 0x0171}, {0x0013, 0x0172}, - {0x0013, 0x0173}, {0x0013, 0x0174}, {0x0013, 0x0175}, {0x0013, 0x0176}, {0x0013, 0x0177}, {0x0013, 0x0178}, {0x0013, 0x0179}, {0x0013, 0x017a}, - {0x0013, 0x017b}, {0x0013, 0x017c}, {0x0013, 0x017d}, {0x0013, 0x017e}, {0x0013, 0x017f}, {0x0013, 0x0180}, {0x0013, 0x0181}, {0x0013, 0x0182}, - {0x0013, 0x0183}, {0x0013, 0x0184}, {0x0013, 0x0185}, {0x0013, 0x0186}, {0x0013, 0x0187}, {0x0013, 0x0188}, {0x0013, 0x0189}, {0x0013, 0x018a}, - {0x0013, 0x018b}, {0x0013, 0x018c}, {0x0013, 0x018d}, {0x0013, 0x018e}, {0x0013, 0x018f}, {0x0013, 0x0190}, {0x0013, 0x0191}, {0x0013, 0x0192}, - {0x0013, 0x0193}, {0x0013, 0x0194}, {0x0013, 0x0195}, {0x0013, 0x0196}, {0x0013, 0x0197}, {0x0013, 0x0198}, {0x0013, 0x0199}, {0x0013, 0x019a}, - {0x0013, 0x019b}, {0x0013, 0x019c}, {0x0013, 0x019d}, {0x0013, 0x019e}, {0x0013, 0x019f}, {0x0013, 0x01a0}, {0x0013, 0x01a1}, {0x0013, 0x01a2}, - {0x0013, 0x01a3}, {0x0013, 0x01a4}, {0x0013, 0x01a5}, {0x0013, 0x01a6}, {0x0013, 0x01a7}, {0x0013, 0x01a8}, {0x0013, 0x01a9}, {0x0013, 0x01aa}, - {0x0013, 0x01ab}, {0x0013, 0x01ac}, {0x0013, 0x01ad}, {0x0013, 0x01ae}, {0x0013, 0x01af}, {0x0013, 0x01b0}, {0x0013, 0x01b1}, {0x0013, 0x01b2}, - {0x0013, 0x01b3}, {0x0013, 0x01b4}, {0x0013, 0x01b5}, {0x0013, 0x01b6}, {0x0013, 0x01b7}, {0x0013, 0x01b8}, {0x0013, 0x01b9}, {0x0013, 0x01ba}, - {0x0013, 0x01bb}, {0x0013, 0x01bc}, {0x0013, 0x01bd}, {0x0013, 0x01be}, {0x0013, 0x01bf}, {0x0013, 0x01c0}, {0x0013, 0x01c1}, {0x0013, 0x01c2}, - {0x0013, 0x01c3}, {0x0013, 0x01c4}, {0x0013, 0x01c5}, {0x0013, 0x01c6}, {0x0013, 0x01c7}, {0x0013, 0x01c8}, {0x0013, 0x01c9}, {0x0013, 0x01ca}, - {0x0013, 0x01cb}, {0x0013, 0x01cc}, {0x0013, 0x01cd}, {0x0013, 0x01ce}, {0x0013, 0x01cf}, {0x0013, 0x01d0}, {0x0013, 0x01d1}, {0x0013, 0x01d2}, - {0x0013, 0x01d3}, {0x0013, 0x01d4}, {0x0013, 0x01d5}, {0x0013, 0x01d6}, {0x0013, 0x01d7}, {0x0013, 0x01d8}, {0x0013, 0x01d9}, {0x0013, 0x01da}, - {0x0013, 0x01db}, {0x0013, 0x01dc}, {0x0013, 0x01dd}, {0x0013, 0x01de}, {0x0013, 0x01df}, {0x0013, 0x01e0}, {0x0013, 0x01e1}, {0x0013, 0x01e2}, - {0x0013, 0x01e3}, {0x0013, 0x01e4}, {0x0013, 0x01e5}, {0x0013, 0x01e6}, {0x0013, 0x01e7}, {0x0013, 0x01e8}, {0x0013, 0x01e9}, {0x0013, 0x01ea}, - {0x0013, 0x01eb}, {0x0013, 0x01ec}, {0x0013, 0x01ed}, {0x0013, 0x01ee}, {0x0013, 0x01ef}, {0x0013, 0x01f0}, {0x0013, 0x01f1}, {0x0013, 0x01f2}, - {0x0013, 0x01f3}, {0x0013, 0x01f4}, {0x0013, 0x01f5}, {0x0013, 0x01f6}, {0x0013, 0x01f7}, {0x0013, 0x01f8}, {0x0013, 0x01f9}, {0x0013, 0x01fa}, - {0x0013, 0x01fb}, {0x0013, 0x01fc}, {0x0013, 0x01fd}, {0x0013, 0x01fe}, {0x0013, 0x01ff}, {0x0013, 0x0200}, {0x0013, 0x0201}, {0x0013, 0x0202}, - {0x0013, 0x0203}, {0x0013, 0x0204}, {0x0013, 0x0205}, {0x0013, 0x0206}, {0x0013, 0x0207}, {0x0013, 0x0208}, {0x0013, 0x0209}, {0x0013, 0x020a}, - {0x0013, 0x020b}, {0x0013, 0x020c}, {0x0013, 0x020d}, {0x0013, 0x020e}, {0x0013, 0x020f}, {0x0013, 0x0210}, {0x0013, 0x0211}, {0x0013, 0x0212}, - {0x0013, 0x0213}, {0x0013, 0x0214}, {0x0013, 0x0215}, {0x0013, 0x0216}, {0x0013, 0x0217}, {0x0013, 0x0218}, {0x0013, 0x0219}, {0x0013, 0x021a}, - {0x0013, 0x021b}, {0x0013, 0x021c}, {0x0013, 0x021d}, {0x0013, 0x021e}, {0x0013, 0x021f}, {0x0013, 0x0220}, {0x0013, 0x0221}, {0x0013, 0x0222}, - {0x0013, 0x0223}, {0x0013, 0x0224}, {0x0013, 0x0225}, {0x0013, 0x0226}, {0x0013, 0x0227}, {0x0013, 0x0228}, {0x0013, 0x0229}, {0x0013, 0x022a}, - {0x0013, 0x022b}, {0x0013, 0x022c}, {0x0013, 0x022d}, {0x0013, 0x022e}, {0x0013, 0x022f}, {0x0013, 0x0230}, {0x0013, 0x0231}, {0x0013, 0x0232}, - {0x0013, 0x0233}, {0x0013, 0x0234}, {0x0013, 0x0235}, {0x0013, 0x0236}, {0x0013, 0x0237}, {0x0013, 0x0238}, {0x0013, 0x0239}, {0x0013, 0x023a}, - {0x0013, 0x023b}, {0x0013, 0x023c}, {0x0013, 0x023d}, {0x0013, 0x023e}, {0x0013, 0x023f}, {0x0013, 0x0240}, {0x0013, 0x0241}, {0x0013, 0x0242}, - {0x0013, 0x0243}, {0x0013, 0x0244}, {0x0013, 0x0245}, {0x0013, 0x0246}, {0x0013, 0x0247}, {0x0013, 0x0248}, {0x0013, 0x0249}, {0x0013, 0x024a}, - {0x0013, 0x024b}, {0x0013, 0x024c}, {0x0013, 0x024d}, {0x0013, 0x024e}, {0x0013, 0x024f}, {0x0013, 0x0250}, {0x0013, 0x0251}, {0x0013, 0x0252}, - {0x0013, 0x0253}, + { + { 0x0002, 0x0003 }, + { 0x0003, 0x0003 }, + { 0x0005, 0x0007 }, + { 0x0007, 0x000a }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0009, 0x0009 }, + { 0x000b, 0x000d }, + { 0x000d, 0x0014 }, + { 0x000d, 0x0015 }, + { 0x0010, 0x0052 }, + { 0x0011, 0x0098 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0005, 0x0008 }, + { 0x0006, 0x000a }, + { 0x0007, 0x000b }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x000a, 0x000a }, + { 0x000b, 0x000e }, + { 0x000d, 0x0016 }, + { 0x000f, 0x0031 }, + { 0x0010, 0x0053 }, + { 0x0012, 0x012a }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0006, 0x000b }, + { 0x0007, 0x000c }, + { 0x0008, 0x000d }, + { 0x0009, 0x000a }, + { 0x000a, 0x000b }, + { 0x000c, 0x000f }, + { 0x000d, 0x0017 }, + { 0x000f, 0x0032 }, + { 0x0010, 0x0054 }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, + { 0x0013, 0x0028 }, + { 0x0013, 0x0029 }, + { 0x0013, 0x002a }, + { 0x0013, 0x002b }, + { 0x0007, 0x000d }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0008, 0x000e }, + { 0x0009, 0x000b }, + { 0x000b, 0x000f }, + { 0x000c, 0x0010 }, + { 0x000e, 0x001d }, + { 0x000f, 0x0033 }, + { 0x0011, 0x0099 }, + { 0x0013, 0x002c }, + { 0x0013, 0x002d }, + { 0x0013, 0x002e }, + { 0x0013, 0x002f }, + { 0x0013, 0x0030 }, + { 0x0013, 0x0031 }, + { 0x0013, 0x0032 }, + { 0x0013, 0x0033 }, + { 0x0013, 0x0034 }, + { 0x0013, 0x0035 }, + { 0x0013, 0x0036 }, + { 0x0013, 0x0037 }, + { 0x0013, 0x0038 }, + { 0x0013, 0x0039 }, + { 0x0013, 0x003a }, + { 0x0008, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0007, 0x0012 }, + { 0x0008, 0x0010 }, + { 0x0009, 0x000c }, + { 0x000a, 0x000c }, + { 0x000c, 0x0011 }, + { 0x000d, 0x0018 }, + { 0x000e, 0x001e }, + { 0x0011, 0x009a }, + { 0x0011, 0x009b }, + { 0x0013, 0x003b }, + { 0x0013, 0x003c }, + { 0x0013, 0x003d }, + { 0x0013, 0x003e }, + { 0x0013, 0x003f }, + { 0x0013, 0x0040 }, + { 0x0013, 0x0041 }, + { 0x0013, 0x0042 }, + { 0x0013, 0x0043 }, + { 0x0013, 0x0044 }, + { 0x0013, 0x0045 }, + { 0x0013, 0x0046 }, + { 0x0013, 0x0047 }, + { 0x0013, 0x0048 }, + { 0x0013, 0x0049 }, + { 0x0008, 0x0011 }, + { 0x0007, 0x0013 }, + { 0x0008, 0x0012 }, + { 0x0008, 0x0013 }, + { 0x0009, 0x000d }, + { 0x000a, 0x000d }, + { 0x000b, 0x0010 }, + { 0x000c, 0x0012 }, + { 0x000e, 0x001f }, + { 0x000e, 0x0020 }, + { 0x0010, 0x0055 }, + { 0x0011, 0x009c }, + { 0x0013, 0x004a }, + { 0x0013, 0x004b }, + { 0x0013, 0x004c }, + { 0x0013, 0x004d }, + { 0x0013, 0x004e }, + { 0x0013, 0x004f }, + { 0x0013, 0x0050 }, + { 0x0013, 0x0051 }, + { 0x0013, 0x0052 }, + { 0x0013, 0x0053 }, + { 0x0013, 0x0054 }, + { 0x0013, 0x0055 }, + { 0x0013, 0x0056 }, + { 0x0013, 0x0057 }, + { 0x0013, 0x0058 }, + { 0x0009, 0x000e }, + { 0x0009, 0x000f }, + { 0x0009, 0x0010 }, + { 0x0009, 0x0011 }, + { 0x000a, 0x000e }, + { 0x000b, 0x0011 }, + { 0x000c, 0x0013 }, + { 0x000d, 0x0019 }, + { 0x000e, 0x0021 }, + { 0x0010, 0x0056 }, + { 0x0010, 0x0057 }, + { 0x0013, 0x0059 }, + { 0x0013, 0x005a }, + { 0x0013, 0x005b }, + { 0x0013, 0x005c }, + { 0x0013, 0x005d }, + { 0x0013, 0x005e }, + { 0x0013, 0x005f }, + { 0x0013, 0x0060 }, + { 0x0013, 0x0061 }, + { 0x0013, 0x0062 }, + { 0x0013, 0x0063 }, + { 0x0013, 0x0064 }, + { 0x0013, 0x0065 }, + { 0x0013, 0x0066 }, + { 0x0013, 0x0067 }, + { 0x0013, 0x0068 }, + { 0x000b, 0x0012 }, + { 0x000a, 0x000f }, + { 0x000a, 0x0010 }, + { 0x000a, 0x0011 }, + { 0x000c, 0x0014 }, + { 0x000c, 0x0015 }, + { 0x000d, 0x001a }, + { 0x000e, 0x0022 }, + { 0x0010, 0x0058 }, + { 0x0010, 0x0059 }, + { 0x0013, 0x0069 }, + { 0x0013, 0x006a }, + { 0x0013, 0x006b }, + { 0x0013, 0x006c }, + { 0x0013, 0x006d }, + { 0x0013, 0x006e }, + { 0x0013, 0x006f }, + { 0x0013, 0x0070 }, + { 0x0013, 0x0071 }, + { 0x0013, 0x0072 }, + { 0x0013, 0x0073 }, + { 0x0013, 0x0074 }, + { 0x0013, 0x0075 }, + { 0x0013, 0x0076 }, + { 0x0013, 0x0077 }, + { 0x0013, 0x0078 }, + { 0x0013, 0x0079 }, + { 0x000c, 0x0016 }, + { 0x000b, 0x0013 }, + { 0x000c, 0x0017 }, + { 0x000c, 0x0018 }, + { 0x000c, 0x0019 }, + { 0x000e, 0x0023 }, + { 0x000e, 0x0024 }, + { 0x000f, 0x0034 }, + { 0x0010, 0x005a }, + { 0x0011, 0x009d }, + { 0x0013, 0x007a }, + { 0x0013, 0x007b }, + { 0x0013, 0x007c }, + { 0x0013, 0x007d }, + { 0x0013, 0x007e }, + { 0x0013, 0x007f }, + { 0x0013, 0x0080 }, + { 0x0013, 0x0081 }, + { 0x0013, 0x0082 }, + { 0x0013, 0x0083 }, + { 0x0013, 0x0084 }, + { 0x0013, 0x0085 }, + { 0x0013, 0x0086 }, + { 0x0013, 0x0087 }, + { 0x0013, 0x0088 }, + { 0x0013, 0x0089 }, + { 0x0013, 0x008a }, + { 0x000e, 0x0025 }, + { 0x000d, 0x001b }, + { 0x000d, 0x001c }, + { 0x000d, 0x001d }, + { 0x000e, 0x0026 }, + { 0x000f, 0x0035 }, + { 0x0010, 0x005b }, + { 0x0011, 0x009e }, + { 0x0011, 0x009f }, + { 0x0012, 0x012b }, + { 0x0013, 0x008b }, + { 0x0013, 0x008c }, + { 0x0013, 0x008d }, + { 0x0013, 0x008e }, + { 0x0013, 0x008f }, + { 0x0013, 0x0090 }, + { 0x0013, 0x0091 }, + { 0x0013, 0x0092 }, + { 0x0013, 0x0093 }, + { 0x0013, 0x0094 }, + { 0x0013, 0x0095 }, + { 0x0013, 0x0096 }, + { 0x0013, 0x0097 }, + { 0x0013, 0x0098 }, + { 0x0013, 0x0099 }, + { 0x0013, 0x009a }, + { 0x0013, 0x009b }, + { 0x0010, 0x005c }, + { 0x000f, 0x0036 }, + { 0x000e, 0x0027 }, + { 0x000f, 0x0037 }, + { 0x000f, 0x0038 }, + { 0x0010, 0x005d }, + { 0x0011, 0x00a0 }, + { 0x0013, 0x009c }, + { 0x0012, 0x012c }, + { 0x0013, 0x009d }, + { 0x0013, 0x009e }, + { 0x0013, 0x009f }, + { 0x0013, 0x00a0 }, + { 0x0013, 0x00a1 }, + { 0x0013, 0x00a2 }, + { 0x0013, 0x00a3 }, + { 0x0013, 0x00a4 }, + { 0x0013, 0x00a5 }, + { 0x0013, 0x00a6 }, + { 0x0013, 0x00a7 }, + { 0x0013, 0x00a8 }, + { 0x0013, 0x00a9 }, + { 0x0013, 0x00aa }, + { 0x0013, 0x00ab }, + { 0x0013, 0x00ac }, + { 0x0013, 0x00ad }, + { 0x0013, 0x00ae }, + { 0x0010, 0x005e }, + { 0x000f, 0x0039 }, + { 0x0010, 0x005f }, + { 0x0010, 0x0060 }, + { 0x0011, 0x00a1 }, + { 0x0010, 0x0061 }, + { 0x0013, 0x00af }, + { 0x0013, 0x00b0 }, + { 0x0012, 0x012d }, + { 0x0013, 0x00b1 }, + { 0x0013, 0x00b2 }, + { 0x0013, 0x00b3 }, + { 0x0013, 0x00b4 }, + { 0x0013, 0x00b5 }, + { 0x0013, 0x00b6 }, + { 0x0013, 0x00b7 }, + { 0x0013, 0x00b8 }, + { 0x0013, 0x00b9 }, + { 0x0013, 0x00ba }, + { 0x0013, 0x00bb }, + { 0x0013, 0x00bc }, + { 0x0013, 0x00bd }, + { 0x0013, 0x00be }, + { 0x0013, 0x00bf }, + { 0x0013, 0x00c0 }, + { 0x0013, 0x00c1 }, + { 0x0013, 0x00c2 }, + { 0x0012, 0x012e }, + { 0x0011, 0x00a2 }, + { 0x0011, 0x00a3 }, + { 0x0013, 0x00c3 }, + { 0x0013, 0x00c4 }, + { 0x0013, 0x00c5 }, + { 0x0013, 0x00c6 }, + { 0x0013, 0x00c7 }, + { 0x0013, 0x00c8 }, + { 0x0013, 0x00c9 }, + { 0x0013, 0x00ca }, + { 0x0013, 0x00cb }, + { 0x0013, 0x00cc }, + { 0x0013, 0x00cd }, + { 0x0013, 0x00ce }, + { 0x0013, 0x00cf }, + { 0x0013, 0x00d0 }, + { 0x0013, 0x00d1 }, + { 0x0013, 0x00d2 }, + { 0x0013, 0x00d3 }, + { 0x0013, 0x00d4 }, + { 0x0013, 0x00d5 }, + { 0x0013, 0x00d6 }, + { 0x0013, 0x00d7 }, + { 0x0013, 0x00d8 }, + { 0x0013, 0x00d9 }, + { 0x0013, 0x00da }, + { 0x0013, 0x00db }, + { 0x0013, 0x00dc }, + { 0x0013, 0x00dd }, + { 0x0013, 0x00de }, + { 0x0013, 0x00df }, + { 0x0012, 0x012f }, + { 0x0013, 0x00e0 }, + { 0x0013, 0x00e1 }, + { 0x0013, 0x00e2 }, + { 0x0013, 0x00e3 }, + { 0x0013, 0x00e4 }, + { 0x0013, 0x00e5 }, + { 0x0013, 0x00e6 }, + { 0x0013, 0x00e7 }, + { 0x0013, 0x00e8 }, + { 0x0013, 0x00e9 }, + { 0x0013, 0x00ea }, + { 0x0013, 0x00eb }, + { 0x0013, 0x00ec }, + { 0x0013, 0x00ed }, + { 0x0013, 0x00ee }, + { 0x0013, 0x00ef }, + { 0x0013, 0x00f0 }, + { 0x0013, 0x00f1 }, + { 0x0013, 0x00f2 }, + { 0x0013, 0x00f3 }, + { 0x0013, 0x00f4 }, + { 0x0013, 0x00f5 }, + { 0x0013, 0x00f6 }, + { 0x0013, 0x00f7 }, + { 0x0013, 0x00f8 }, + { 0x0013, 0x00f9 }, + { 0x0013, 0x00fa }, + { 0x0013, 0x00fb }, + { 0x0013, 0x00fc }, + { 0x0013, 0x00fd }, + { 0x0013, 0x00fe }, + { 0x0013, 0x00ff }, + { 0x0013, 0x0100 }, + { 0x0013, 0x0101 }, + { 0x0013, 0x0102 }, + { 0x0013, 0x0103 }, + { 0x0013, 0x0104 }, + { 0x0013, 0x0105 }, + { 0x0013, 0x0106 }, + { 0x0013, 0x0107 }, + { 0x0013, 0x0108 }, + { 0x0013, 0x0109 }, + { 0x0013, 0x010a }, + { 0x0013, 0x010b }, + { 0x0013, 0x010c }, + { 0x0013, 0x010d }, + { 0x0013, 0x010e }, + { 0x0013, 0x010f }, + { 0x0013, 0x0110 }, + { 0x0013, 0x0111 }, + { 0x0013, 0x0112 }, + { 0x0013, 0x0113 }, + { 0x0013, 0x0114 }, + { 0x0013, 0x0115 }, + { 0x0013, 0x0116 }, + { 0x0013, 0x0117 }, + { 0x0013, 0x0118 }, + { 0x0013, 0x0119 }, + { 0x0013, 0x011a }, + { 0x0013, 0x011b }, + { 0x0013, 0x011c }, + { 0x0013, 0x011d }, + { 0x0013, 0x011e }, + { 0x0013, 0x011f }, + { 0x0013, 0x0120 }, + { 0x0013, 0x0121 }, + { 0x0013, 0x0122 }, + { 0x0013, 0x0123 }, + { 0x0013, 0x0124 }, + { 0x0013, 0x0125 }, + { 0x0013, 0x0126 }, + { 0x0013, 0x0127 }, + { 0x0013, 0x0128 }, + { 0x0013, 0x0129 }, + { 0x0013, 0x012a }, + { 0x0013, 0x012b }, + { 0x0013, 0x012c }, + { 0x0013, 0x012d }, + { 0x0013, 0x012e }, + { 0x0013, 0x012f }, + { 0x0013, 0x0130 }, + { 0x0013, 0x0131 }, + { 0x0013, 0x0132 }, + { 0x0013, 0x0133 }, + { 0x0013, 0x0134 }, + { 0x0013, 0x0135 }, + { 0x0013, 0x0136 }, + { 0x0013, 0x0137 }, + { 0x0013, 0x0138 }, + { 0x0013, 0x0139 }, + { 0x0013, 0x013a }, + { 0x0013, 0x013b }, + { 0x0013, 0x013c }, + { 0x0013, 0x013d }, + { 0x0013, 0x013e }, + { 0x0013, 0x013f }, + { 0x0013, 0x0140 }, + { 0x0013, 0x0141 }, + { 0x0013, 0x0142 }, + { 0x0013, 0x0143 }, + { 0x0013, 0x0144 }, + { 0x0013, 0x0145 }, + { 0x0013, 0x0146 }, + { 0x0013, 0x0147 }, + { 0x0013, 0x0148 }, + { 0x0013, 0x0149 }, + { 0x0013, 0x014a }, + { 0x0013, 0x014b }, + { 0x0013, 0x014c }, + { 0x0013, 0x014d }, + { 0x0013, 0x014e }, + { 0x0013, 0x014f }, + { 0x0013, 0x0150 }, + { 0x0013, 0x0151 }, + { 0x0013, 0x0152 }, + { 0x0013, 0x0153 }, + { 0x0013, 0x0154 }, + { 0x0013, 0x0155 }, + { 0x0013, 0x0156 }, + { 0x0013, 0x0157 }, + { 0x0013, 0x0158 }, + { 0x0013, 0x0159 }, + { 0x0013, 0x015a }, + { 0x0013, 0x015b }, + { 0x0013, 0x015c }, + { 0x0013, 0x015d }, + { 0x0013, 0x015e }, + { 0x0013, 0x015f }, + { 0x0013, 0x0160 }, + { 0x0013, 0x0161 }, + { 0x0013, 0x0162 }, + { 0x0013, 0x0163 }, + { 0x0013, 0x0164 }, + { 0x0013, 0x0165 }, + { 0x0013, 0x0166 }, + { 0x0013, 0x0167 }, + { 0x0013, 0x0168 }, + { 0x0013, 0x0169 }, + { 0x0013, 0x016a }, + { 0x0013, 0x016b }, + { 0x0013, 0x016c }, + { 0x0013, 0x016d }, + { 0x0013, 0x016e }, + { 0x0013, 0x016f }, + { 0x0013, 0x0170 }, + { 0x0013, 0x0171 }, + { 0x0013, 0x0172 }, + { 0x0013, 0x0173 }, + { 0x0013, 0x0174 }, + { 0x0013, 0x0175 }, + { 0x0013, 0x0176 }, + { 0x0013, 0x0177 }, + { 0x0013, 0x0178 }, + { 0x0013, 0x0179 }, + { 0x0013, 0x017a }, + { 0x0013, 0x017b }, + { 0x0013, 0x017c }, + { 0x0013, 0x017d }, + { 0x0013, 0x017e }, + { 0x0013, 0x017f }, + { 0x0013, 0x0180 }, + { 0x0013, 0x0181 }, + { 0x0013, 0x0182 }, + { 0x0013, 0x0183 }, + { 0x0013, 0x0184 }, + { 0x0013, 0x0185 }, + { 0x0013, 0x0186 }, + { 0x0013, 0x0187 }, + { 0x0013, 0x0188 }, + { 0x0013, 0x0189 }, + { 0x0013, 0x018a }, + { 0x0013, 0x018b }, + { 0x0013, 0x018c }, + { 0x0013, 0x018d }, + { 0x0013, 0x018e }, + { 0x0013, 0x018f }, + { 0x0013, 0x0190 }, + { 0x0013, 0x0191 }, + { 0x0013, 0x0192 }, + { 0x0013, 0x0193 }, + { 0x0013, 0x0194 }, + { 0x0013, 0x0195 }, + { 0x0013, 0x0196 }, + { 0x0013, 0x0197 }, + { 0x0013, 0x0198 }, + { 0x0013, 0x0199 }, + { 0x0013, 0x019a }, + { 0x0013, 0x019b }, + { 0x0013, 0x019c }, + { 0x0013, 0x019d }, + { 0x0013, 0x019e }, + { 0x0013, 0x019f }, + { 0x0013, 0x01a0 }, + { 0x0013, 0x01a1 }, + { 0x0013, 0x01a2 }, + { 0x0013, 0x01a3 }, + { 0x0013, 0x01a4 }, + { 0x0013, 0x01a5 }, + { 0x0013, 0x01a6 }, + { 0x0013, 0x01a7 }, + { 0x0013, 0x01a8 }, + { 0x0013, 0x01a9 }, + { 0x0013, 0x01aa }, + { 0x0013, 0x01ab }, + { 0x0013, 0x01ac }, + { 0x0013, 0x01ad }, + { 0x0013, 0x01ae }, + { 0x0013, 0x01af }, + { 0x0013, 0x01b0 }, + { 0x0013, 0x01b1 }, + { 0x0013, 0x01b2 }, + { 0x0013, 0x01b3 }, + { 0x0013, 0x01b4 }, + { 0x0013, 0x01b5 }, + { 0x0013, 0x01b6 }, + { 0x0013, 0x01b7 }, + { 0x0013, 0x01b8 }, + { 0x0013, 0x01b9 }, + { 0x0013, 0x01ba }, + { 0x0013, 0x01bb }, + { 0x0013, 0x01bc }, + { 0x0013, 0x01bd }, + { 0x0013, 0x01be }, + { 0x0013, 0x01bf }, + { 0x0013, 0x01c0 }, + { 0x0013, 0x01c1 }, + { 0x0013, 0x01c2 }, + { 0x0013, 0x01c3 }, + { 0x0013, 0x01c4 }, + { 0x0013, 0x01c5 }, + { 0x0013, 0x01c6 }, + { 0x0013, 0x01c7 }, + { 0x0013, 0x01c8 }, + { 0x0013, 0x01c9 }, + { 0x0013, 0x01ca }, + { 0x0013, 0x01cb }, + { 0x0013, 0x01cc }, + { 0x0013, 0x01cd }, + { 0x0013, 0x01ce }, + { 0x0013, 0x01cf }, + { 0x0013, 0x01d0 }, + { 0x0013, 0x01d1 }, + { 0x0013, 0x01d2 }, + { 0x0013, 0x01d3 }, + { 0x0013, 0x01d4 }, + { 0x0013, 0x01d5 }, + { 0x0013, 0x01d6 }, + { 0x0013, 0x01d7 }, + { 0x0013, 0x01d8 }, + { 0x0013, 0x01d9 }, + { 0x0013, 0x01da }, + { 0x0013, 0x01db }, + { 0x0013, 0x01dc }, + { 0x0013, 0x01dd }, + { 0x0013, 0x01de }, + { 0x0013, 0x01df }, + { 0x0013, 0x01e0 }, + { 0x0013, 0x01e1 }, + { 0x0013, 0x01e2 }, + { 0x0013, 0x01e3 }, + { 0x0013, 0x01e4 }, + { 0x0013, 0x01e5 }, + { 0x0013, 0x01e6 }, + { 0x0013, 0x01e7 }, + { 0x0013, 0x01e8 }, + { 0x0013, 0x01e9 }, + { 0x0013, 0x01ea }, + { 0x0013, 0x01eb }, + { 0x0013, 0x01ec }, + { 0x0013, 0x01ed }, + { 0x0013, 0x01ee }, + { 0x0013, 0x01ef }, + { 0x0013, 0x01f0 }, + { 0x0013, 0x01f1 }, + { 0x0013, 0x01f2 }, + { 0x0013, 0x01f3 }, + { 0x0013, 0x01f4 }, + { 0x0013, 0x01f5 }, + { 0x0013, 0x01f6 }, + { 0x0013, 0x01f7 }, + { 0x0013, 0x01f8 }, + { 0x0013, 0x01f9 }, + { 0x0013, 0x01fa }, + { 0x0013, 0x01fb }, + { 0x0013, 0x01fc }, + { 0x0013, 0x01fd }, + { 0x0013, 0x01fe }, + { 0x0013, 0x01ff }, + { 0x0013, 0x0200 }, + { 0x0013, 0x0201 }, + { 0x0013, 0x0202 }, + { 0x0013, 0x0203 }, + { 0x0013, 0x0204 }, + { 0x0013, 0x0205 }, + { 0x0013, 0x0206 }, + { 0x0013, 0x0207 }, + { 0x0013, 0x0208 }, + { 0x0013, 0x0209 }, + { 0x0013, 0x020a }, + { 0x0013, 0x020b }, + { 0x0013, 0x020c }, + { 0x0013, 0x020d }, + { 0x0013, 0x020e }, + { 0x0013, 0x020f }, + { 0x0013, 0x0210 }, + { 0x0013, 0x0211 }, + { 0x0013, 0x0212 }, + { 0x0013, 0x0213 }, + { 0x0013, 0x0214 }, + { 0x0013, 0x0215 }, + { 0x0013, 0x0216 }, + { 0x0013, 0x0217 }, + { 0x0013, 0x0218 }, + { 0x0013, 0x0219 }, + { 0x0013, 0x021a }, + { 0x0013, 0x021b }, + { 0x0013, 0x021c }, + { 0x0013, 0x021d }, + { 0x0013, 0x021e }, + { 0x0013, 0x021f }, + { 0x0013, 0x0220 }, + { 0x0013, 0x0221 }, + { 0x0013, 0x0222 }, + { 0x0013, 0x0223 }, + { 0x0013, 0x0224 }, + { 0x0013, 0x0225 }, + { 0x0013, 0x0226 }, + { 0x0013, 0x0227 }, + { 0x0013, 0x0228 }, + { 0x0013, 0x0229 }, + { 0x0013, 0x022a }, + { 0x0013, 0x022b }, + { 0x0013, 0x022c }, + { 0x0013, 0x022d }, + { 0x0013, 0x022e }, + { 0x0013, 0x022f }, + { 0x0013, 0x0230 }, + { 0x0013, 0x0231 }, + { 0x0013, 0x0232 }, + { 0x0013, 0x0233 }, + { 0x0013, 0x0234 }, + { 0x0013, 0x0235 }, + { 0x0013, 0x0236 }, + { 0x0013, 0x0237 }, + { 0x0013, 0x0238 }, + { 0x0013, 0x0239 }, + { 0x0013, 0x023a }, + { 0x0013, 0x023b }, + { 0x0013, 0x023c }, + { 0x0013, 0x023d }, + { 0x0013, 0x023e }, + { 0x0013, 0x023f }, + { 0x0013, 0x0240 }, + { 0x0013, 0x0241 }, + { 0x0013, 0x0242 }, + { 0x0013, 0x0243 }, + { 0x0013, 0x0244 }, + { 0x0013, 0x0245 }, + { 0x0013, 0x0246 }, + { 0x0013, 0x0247 }, + { 0x0013, 0x0248 }, + { 0x0013, 0x0249 }, + { 0x0013, 0x024a }, + { 0x0013, 0x024b }, + { 0x0013, 0x024c }, + { 0x0013, 0x024d }, + { 0x0013, 0x024e }, + { 0x0013, 0x024f }, + { 0x0013, 0x0250 }, + { 0x0013, 0x0251 }, + { 0x0013, 0x0252 }, + { 0x0013, 0x0253 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec49[113][16] = -{ - {0x0006ffff, 0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00010001, 0x00010001, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020000, 0x00020000, 0x00020000, 0x00020000, }, - {0x00020052, 0x00020052, 0x00020052, 0x00020052, 0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, 0x00030002, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x0001006d, 0x0001006d, 0x0001006e, 0x0001006e, 0x0001006f, 0x0001006f, 0x00010088, 0x00010088, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x00000070, 0x00000087, 0x00000089, 0x0000008a, 0x00010003, 0x00010003, 0x0001001f, 0x0001001f, 0x0001003a, 0x0001003a, 0x00010051, 0x00010051, 0x00010054, 0x00010054, 0x00010055, 0x00010055, }, - {0x000fffff, 0x000effff, 0x000cffff, 0x000dffff, 0x0007ffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x00000004, 0x00000005, 0x00000020, 0x00000021, 0x0000003b, 0x00000056, 0x0000006c, }, - {0x000200bf, 0x000200bf, 0x000200bf, 0x000200bf, 0x000200c0, 0x000200c0, 0x000200c0, 0x000200c0, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x0003003c, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, - {0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x00030071, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, 0x0003008b, }, - {0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a2, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, 0x000300a3, }, - {0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a4, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, 0x000300a5, }, - {0x0001008d, 0x0001008d, 0x000100a7, 0x000100a7, 0x000100bd, 0x000100bd, 0x000100d9, 0x000100d9, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, - {0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200a6, 0x000200be, 0x000200be, 0x000200be, 0x000200be, }, - {0x00000059, 0x00000073, 0x0000008e, 0x000000a8, 0x000000c1, 0x000000c2, 0x000000d8, 0x000000da, 0x000000db, 0x000000dc, 0x00010007, 0x00010007, 0x00010023, 0x00010023, 0x00010058, 0x00010058, }, - {0x0023ffff, 0x0034ffff, 0x0045ffff, 0x0056ffff, 0x001affff, 0x0019ffff, 0x0018ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0011ffff, 0x0010ffff, 0x0012ffff, 0x0013ffff, 0x0014ffff, 0x0000003e, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x00030074, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, 0x000300a9, }, - {0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300c3, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, 0x000300f4, }, - {0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f5, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, 0x000300f6, }, - {0x00010112, 0x00010112, 0x0001012a, 0x0001012a, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, }, - {0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200aa, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200c4, 0x000200dd, 0x000200dd, 0x000200dd, 0x000200dd, }, - {0x000200de, 0x000200de, 0x000200de, 0x000200de, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f3, 0x000200f7, 0x000200f7, 0x000200f7, 0x000200f7, 0x00020110, 0x00020110, 0x00020110, 0x00020110, }, - {0x0000012c, 0x0000012e, 0x00010025, 0x00010025, 0x00010040, 0x00010040, 0x0001005b, 0x0001005b, 0x000100df, 0x000100df, 0x000100f8, 0x000100f8, 0x0001010f, 0x0001010f, 0x00010111, 0x00010111, }, - {0x001fffff, 0x0020ffff, 0x0000000a, 0x00000026, 0x00000041, 0x00000091, 0x000000ab, 0x000000ac, 0x000000c5, 0x000000c6, 0x000000e0, 0x000000f9, 0x0000010e, 0x00000113, 0x00000129, 0x0000012b, }, - {0x0067ffff, 0x0068ffff, 0x0069ffff, 0x006affff, 0x006bffff, 0x006cffff, 0x006dffff, 0x006effff, 0x006fffff, 0x0070ffff, 0x0021ffff, 0x0022ffff, 0x001cffff, 0x001bffff, 0x001dffff, 0x001effff, }, - {0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030076, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, 0x00030077, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, 0x0003005c, }, - {0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x00030092, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, 0x000300e1, }, - {0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fa, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, 0x000300fb, }, - {0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x00030114, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, 0x0003012d, }, - {0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030145, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, 0x00030146, }, - {0x000102d5, 0x000102d5, 0x000102d6, 0x000102d6, 0x000102d7, 0x000102d7, 0x000102d8, 0x000102d8, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x000200fc, 0x000200fc, 0x000200fc, 0x000200fc, }, - {0x00020116, 0x00020116, 0x00020116, 0x00020116, 0x00020131, 0x00020131, 0x00020131, 0x00020131, 0x00020144, 0x00020144, 0x00020144, 0x00020144, 0x00020164, 0x00020164, 0x00020164, 0x00020164, }, - {0x0025ffff, 0x0026ffff, 0x0028ffff, 0x002affff, 0x002effff, 0x0029ffff, 0x0027ffff, 0x0033ffff, 0x002dffff, 0x0024ffff, 0x002bffff, 0x002cffff, 0x002fffff, 0x0030ffff, 0x0031ffff, 0x0032ffff, }, - {0x00010085, 0x00010085, 0x00010086, 0x00010086, 0x00010093, 0x00010093, 0x00010094, 0x00010094, 0x00010095, 0x00010095, 0x00010096, 0x00010096, 0x00010097, 0x00010097, 0x00010098, 0x00010098, }, - {0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, - {0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x00010028, 0x00010028, }, - {0x00010061, 0x00010061, 0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, }, - {0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, }, - {0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, }, - {0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, }, - {0x00010099, 0x00010099, 0x0001009a, 0x0001009a, 0x0001009b, 0x0001009b, 0x0001009c, 0x0001009c, 0x0001009d, 0x0001009d, 0x0001009e, 0x0001009e, 0x0001009f, 0x0001009f, 0x000100a0, 0x000100a0, }, - {0x000100a1, 0x000100a1, 0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, }, - {0x0001007d, 0x0001007d, 0x0001007e, 0x0001007e, 0x0001007f, 0x0001007f, 0x00010080, 0x00010080, 0x00010081, 0x00010081, 0x00010082, 0x00010082, 0x00010083, 0x00010083, 0x00010084, 0x00010084, }, - {0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, }, - {0x000100b4, 0x000100b4, 0x000100b5, 0x000100b5, 0x000100b6, 0x000100b6, 0x000100b7, 0x000100b7, 0x000100b8, 0x000100b8, 0x000100b9, 0x000100b9, 0x000100ba, 0x000100ba, 0x000100bb, 0x000100bb, }, - {0x000100bc, 0x000100bc, 0x000100c7, 0x000100c7, 0x000100c8, 0x000100c8, 0x000100c9, 0x000100c9, 0x000100ca, 0x000100ca, 0x000100cb, 0x000100cb, 0x000100cc, 0x000100cc, 0x000100cd, 0x000100cd, }, - {0x000100ce, 0x000100ce, 0x000100cf, 0x000100cf, 0x000100d0, 0x000100d0, 0x000100d1, 0x000100d1, 0x000100d2, 0x000100d2, 0x000100d3, 0x000100d3, 0x000100d4, 0x000100d4, 0x000100d5, 0x000100d5, }, - {0x000100d6, 0x000100d6, 0x000100d7, 0x000100d7, 0x000100e2, 0x000100e2, 0x000100e3, 0x000100e3, 0x000100e4, 0x000100e4, 0x000100e5, 0x000100e5, 0x000100e6, 0x000100e6, 0x000100e7, 0x000100e7, }, - {0x00010069, 0x00010069, 0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x00010078, 0x00010078, 0x00010079, 0x00010079, 0x0001007a, 0x0001007a, 0x0001007b, 0x0001007b, 0x0001007c, 0x0001007c, }, - {0x0035ffff, 0x0036ffff, 0x0037ffff, 0x0038ffff, 0x0039ffff, 0x003affff, 0x003bffff, 0x003cffff, 0x003dffff, 0x003effff, 0x003fffff, 0x0040ffff, 0x0041ffff, 0x0042ffff, 0x0043ffff, 0x0044ffff, }, - {0x000100e8, 0x000100e8, 0x000100e9, 0x000100e9, 0x000100ea, 0x000100ea, 0x000100eb, 0x000100eb, 0x000100ec, 0x000100ec, 0x000100ed, 0x000100ed, 0x000100ee, 0x000100ee, 0x000100ef, 0x000100ef, }, - {0x000100f0, 0x000100f0, 0x000100f1, 0x000100f1, 0x000100f2, 0x000100f2, 0x000100fd, 0x000100fd, 0x000100fe, 0x000100fe, 0x000100ff, 0x000100ff, 0x00010100, 0x00010100, 0x00010101, 0x00010101, }, - {0x00010102, 0x00010102, 0x00010103, 0x00010103, 0x00010104, 0x00010104, 0x00010105, 0x00010105, 0x00010106, 0x00010106, 0x00010107, 0x00010107, 0x00010108, 0x00010108, 0x00010109, 0x00010109, }, - {0x0001010a, 0x0001010a, 0x0001010b, 0x0001010b, 0x0001010c, 0x0001010c, 0x0001010d, 0x0001010d, 0x00010115, 0x00010115, 0x00010117, 0x00010117, 0x00010118, 0x00010118, 0x00010119, 0x00010119, }, - {0x0001011a, 0x0001011a, 0x0001011b, 0x0001011b, 0x0001011c, 0x0001011c, 0x0001011d, 0x0001011d, 0x0001011e, 0x0001011e, 0x0001011f, 0x0001011f, 0x00010120, 0x00010120, 0x00010121, 0x00010121, }, - {0x00010122, 0x00010122, 0x00010123, 0x00010123, 0x00010124, 0x00010124, 0x00010125, 0x00010125, 0x00010126, 0x00010126, 0x00010127, 0x00010127, 0x00010128, 0x00010128, 0x0001012f, 0x0001012f, }, - {0x00010130, 0x00010130, 0x00010132, 0x00010132, 0x00010133, 0x00010133, 0x00010134, 0x00010134, 0x00010135, 0x00010135, 0x00010136, 0x00010136, 0x00010137, 0x00010137, 0x00010138, 0x00010138, }, - {0x00010139, 0x00010139, 0x0001013a, 0x0001013a, 0x0001013b, 0x0001013b, 0x0001013c, 0x0001013c, 0x0001013d, 0x0001013d, 0x0001013e, 0x0001013e, 0x0001013f, 0x0001013f, 0x00010140, 0x00010140, }, - {0x00010141, 0x00010141, 0x00010142, 0x00010142, 0x00010143, 0x00010143, 0x00010147, 0x00010147, 0x00010148, 0x00010148, 0x00010149, 0x00010149, 0x0001014a, 0x0001014a, 0x0001014b, 0x0001014b, }, - {0x0001014c, 0x0001014c, 0x0001014d, 0x0001014d, 0x0001014e, 0x0001014e, 0x0001014f, 0x0001014f, 0x00010150, 0x00010150, 0x00010151, 0x00010151, 0x00010152, 0x00010152, 0x00010153, 0x00010153, }, - {0x00010154, 0x00010154, 0x00010155, 0x00010155, 0x00010156, 0x00010156, 0x00010157, 0x00010157, 0x00010158, 0x00010158, 0x00010159, 0x00010159, 0x0001015a, 0x0001015a, 0x0001015b, 0x0001015b, }, - {0x0001015c, 0x0001015c, 0x0001015d, 0x0001015d, 0x0001015e, 0x0001015e, 0x0001015f, 0x0001015f, 0x00010160, 0x00010160, 0x00010161, 0x00010161, 0x00010162, 0x00010162, 0x00010163, 0x00010163, }, - {0x00010165, 0x00010165, 0x00010166, 0x00010166, 0x00010167, 0x00010167, 0x00010168, 0x00010168, 0x00010169, 0x00010169, 0x0001016a, 0x0001016a, 0x0001016b, 0x0001016b, 0x0001016c, 0x0001016c, }, - {0x0001016d, 0x0001016d, 0x0001016e, 0x0001016e, 0x0001016f, 0x0001016f, 0x00010170, 0x00010170, 0x00010171, 0x00010171, 0x00010172, 0x00010172, 0x00010173, 0x00010173, 0x00010174, 0x00010174, }, - {0x00010175, 0x00010175, 0x00010176, 0x00010176, 0x00010177, 0x00010177, 0x00010178, 0x00010178, 0x00010179, 0x00010179, 0x0001017a, 0x0001017a, 0x0001017b, 0x0001017b, 0x0001017c, 0x0001017c, }, - {0x0001017d, 0x0001017d, 0x0001017e, 0x0001017e, 0x0001017f, 0x0001017f, 0x00010180, 0x00010180, 0x00010181, 0x00010181, 0x00010182, 0x00010182, 0x00010183, 0x00010183, 0x00010184, 0x00010184, }, - {0x0046ffff, 0x0047ffff, 0x0048ffff, 0x0049ffff, 0x004affff, 0x004bffff, 0x004cffff, 0x004dffff, 0x004effff, 0x004fffff, 0x0050ffff, 0x0051ffff, 0x0052ffff, 0x0053ffff, 0x0054ffff, 0x0055ffff, }, - {0x00010185, 0x00010185, 0x00010186, 0x00010186, 0x00010187, 0x00010187, 0x00010188, 0x00010188, 0x00010189, 0x00010189, 0x0001018a, 0x0001018a, 0x0001018b, 0x0001018b, 0x0001018c, 0x0001018c, }, - {0x0001018d, 0x0001018d, 0x0001018e, 0x0001018e, 0x0001018f, 0x0001018f, 0x00010190, 0x00010190, 0x00010191, 0x00010191, 0x00010192, 0x00010192, 0x00010193, 0x00010193, 0x00010194, 0x00010194, }, - {0x00010195, 0x00010195, 0x00010196, 0x00010196, 0x00010197, 0x00010197, 0x00010198, 0x00010198, 0x00010199, 0x00010199, 0x0001019a, 0x0001019a, 0x0001019b, 0x0001019b, 0x0001019c, 0x0001019c, }, - {0x0001019d, 0x0001019d, 0x0001019e, 0x0001019e, 0x0001019f, 0x0001019f, 0x000101a0, 0x000101a0, 0x000101a1, 0x000101a1, 0x000101a2, 0x000101a2, 0x000101a3, 0x000101a3, 0x000101a4, 0x000101a4, }, - {0x000101a5, 0x000101a5, 0x000101a6, 0x000101a6, 0x000101a7, 0x000101a7, 0x000101a8, 0x000101a8, 0x000101a9, 0x000101a9, 0x000101aa, 0x000101aa, 0x000101ab, 0x000101ab, 0x000101ac, 0x000101ac, }, - {0x000101ad, 0x000101ad, 0x000101ae, 0x000101ae, 0x000101af, 0x000101af, 0x000101b0, 0x000101b0, 0x000101b1, 0x000101b1, 0x000101b2, 0x000101b2, 0x000101b3, 0x000101b3, 0x000101b4, 0x000101b4, }, - {0x000101b5, 0x000101b5, 0x000101b6, 0x000101b6, 0x000101b7, 0x000101b7, 0x000101b8, 0x000101b8, 0x000101b9, 0x000101b9, 0x000101ba, 0x000101ba, 0x000101bb, 0x000101bb, 0x000101bc, 0x000101bc, }, - {0x000101bd, 0x000101bd, 0x000101be, 0x000101be, 0x000101bf, 0x000101bf, 0x000101c0, 0x000101c0, 0x000101c1, 0x000101c1, 0x000101c2, 0x000101c2, 0x000101c3, 0x000101c3, 0x000101c4, 0x000101c4, }, - {0x000101c5, 0x000101c5, 0x000101c6, 0x000101c6, 0x000101c7, 0x000101c7, 0x000101c8, 0x000101c8, 0x000101c9, 0x000101c9, 0x000101ca, 0x000101ca, 0x000101cb, 0x000101cb, 0x000101cc, 0x000101cc, }, - {0x000101cd, 0x000101cd, 0x000101ce, 0x000101ce, 0x000101cf, 0x000101cf, 0x000101d0, 0x000101d0, 0x000101d1, 0x000101d1, 0x000101d2, 0x000101d2, 0x000101d3, 0x000101d3, 0x000101d4, 0x000101d4, }, - {0x000101d5, 0x000101d5, 0x000101d6, 0x000101d6, 0x000101d7, 0x000101d7, 0x000101d8, 0x000101d8, 0x000101d9, 0x000101d9, 0x000101da, 0x000101da, 0x000101db, 0x000101db, 0x000101dc, 0x000101dc, }, - {0x000101dd, 0x000101dd, 0x000101de, 0x000101de, 0x000101df, 0x000101df, 0x000101e0, 0x000101e0, 0x000101e1, 0x000101e1, 0x000101e2, 0x000101e2, 0x000101e3, 0x000101e3, 0x000101e4, 0x000101e4, }, - {0x000101e5, 0x000101e5, 0x000101e6, 0x000101e6, 0x000101e7, 0x000101e7, 0x000101e8, 0x000101e8, 0x000101e9, 0x000101e9, 0x000101ea, 0x000101ea, 0x000101eb, 0x000101eb, 0x000101ec, 0x000101ec, }, - {0x000101ed, 0x000101ed, 0x000101ee, 0x000101ee, 0x000101ef, 0x000101ef, 0x000101f0, 0x000101f0, 0x000101f1, 0x000101f1, 0x000101f2, 0x000101f2, 0x000101f3, 0x000101f3, 0x000101f4, 0x000101f4, }, - {0x000101f5, 0x000101f5, 0x000101f6, 0x000101f6, 0x000101f7, 0x000101f7, 0x000101f8, 0x000101f8, 0x000101f9, 0x000101f9, 0x000101fa, 0x000101fa, 0x000101fb, 0x000101fb, 0x000101fc, 0x000101fc, }, - {0x000101fd, 0x000101fd, 0x000101fe, 0x000101fe, 0x000101ff, 0x000101ff, 0x00010200, 0x00010200, 0x00010201, 0x00010201, 0x00010202, 0x00010202, 0x00010203, 0x00010203, 0x00010204, 0x00010204, }, - {0x0057ffff, 0x0058ffff, 0x0059ffff, 0x005affff, 0x005bffff, 0x005cffff, 0x005dffff, 0x005effff, 0x005fffff, 0x0060ffff, 0x0061ffff, 0x0062ffff, 0x0063ffff, 0x0064ffff, 0x0065ffff, 0x0066ffff, }, - {0x00010205, 0x00010205, 0x00010206, 0x00010206, 0x00010207, 0x00010207, 0x00010208, 0x00010208, 0x00010209, 0x00010209, 0x0001020a, 0x0001020a, 0x0001020b, 0x0001020b, 0x0001020c, 0x0001020c, }, - {0x0001020d, 0x0001020d, 0x0001020e, 0x0001020e, 0x0001020f, 0x0001020f, 0x00010210, 0x00010210, 0x00010211, 0x00010211, 0x00010212, 0x00010212, 0x00010213, 0x00010213, 0x00010214, 0x00010214, }, - {0x00010215, 0x00010215, 0x00010216, 0x00010216, 0x00010217, 0x00010217, 0x00010218, 0x00010218, 0x00010219, 0x00010219, 0x0001021a, 0x0001021a, 0x0001021b, 0x0001021b, 0x0001021c, 0x0001021c, }, - {0x0001021d, 0x0001021d, 0x0001021e, 0x0001021e, 0x0001021f, 0x0001021f, 0x00010220, 0x00010220, 0x00010221, 0x00010221, 0x00010222, 0x00010222, 0x00010223, 0x00010223, 0x00010224, 0x00010224, }, - {0x00010225, 0x00010225, 0x00010226, 0x00010226, 0x00010227, 0x00010227, 0x00010228, 0x00010228, 0x00010229, 0x00010229, 0x0001022a, 0x0001022a, 0x0001022b, 0x0001022b, 0x0001022c, 0x0001022c, }, - {0x0001022d, 0x0001022d, 0x0001022e, 0x0001022e, 0x0001022f, 0x0001022f, 0x00010230, 0x00010230, 0x00010231, 0x00010231, 0x00010232, 0x00010232, 0x00010233, 0x00010233, 0x00010234, 0x00010234, }, - {0x00010235, 0x00010235, 0x00010236, 0x00010236, 0x00010237, 0x00010237, 0x00010238, 0x00010238, 0x00010239, 0x00010239, 0x0001023a, 0x0001023a, 0x0001023b, 0x0001023b, 0x0001023c, 0x0001023c, }, - {0x0001023d, 0x0001023d, 0x0001023e, 0x0001023e, 0x0001023f, 0x0001023f, 0x00010240, 0x00010240, 0x00010241, 0x00010241, 0x00010242, 0x00010242, 0x00010243, 0x00010243, 0x00010244, 0x00010244, }, - {0x00010245, 0x00010245, 0x00010246, 0x00010246, 0x00010247, 0x00010247, 0x00010248, 0x00010248, 0x00010249, 0x00010249, 0x0001024a, 0x0001024a, 0x0001024b, 0x0001024b, 0x0001024c, 0x0001024c, }, - {0x0001024d, 0x0001024d, 0x0001024e, 0x0001024e, 0x0001024f, 0x0001024f, 0x00010250, 0x00010250, 0x00010251, 0x00010251, 0x00010252, 0x00010252, 0x00010253, 0x00010253, 0x00010254, 0x00010254, }, - {0x00010255, 0x00010255, 0x00010256, 0x00010256, 0x00010257, 0x00010257, 0x00010258, 0x00010258, 0x00010259, 0x00010259, 0x0001025a, 0x0001025a, 0x0001025b, 0x0001025b, 0x0001025c, 0x0001025c, }, - {0x0001025d, 0x0001025d, 0x0001025e, 0x0001025e, 0x0001025f, 0x0001025f, 0x00010260, 0x00010260, 0x00010261, 0x00010261, 0x00010262, 0x00010262, 0x00010263, 0x00010263, 0x00010264, 0x00010264, }, - {0x00010265, 0x00010265, 0x00010266, 0x00010266, 0x00010267, 0x00010267, 0x00010268, 0x00010268, 0x00010269, 0x00010269, 0x0001026a, 0x0001026a, 0x0001026b, 0x0001026b, 0x0001026c, 0x0001026c, }, - {0x0001026d, 0x0001026d, 0x0001026e, 0x0001026e, 0x0001026f, 0x0001026f, 0x00010270, 0x00010270, 0x00010271, 0x00010271, 0x00010272, 0x00010272, 0x00010273, 0x00010273, 0x00010274, 0x00010274, }, - {0x00010275, 0x00010275, 0x00010276, 0x00010276, 0x00010277, 0x00010277, 0x00010278, 0x00010278, 0x00010279, 0x00010279, 0x0001027a, 0x0001027a, 0x0001027b, 0x0001027b, 0x0001027c, 0x0001027c, }, - {0x0001027d, 0x0001027d, 0x0001027e, 0x0001027e, 0x0001027f, 0x0001027f, 0x00010280, 0x00010280, 0x00010281, 0x00010281, 0x00010282, 0x00010282, 0x00010283, 0x00010283, 0x00010284, 0x00010284, }, - {0x00010285, 0x00010285, 0x00010286, 0x00010286, 0x00010287, 0x00010287, 0x00010288, 0x00010288, 0x00010289, 0x00010289, 0x0001028a, 0x0001028a, 0x0001028b, 0x0001028b, 0x0001028c, 0x0001028c, }, - {0x0001028d, 0x0001028d, 0x0001028e, 0x0001028e, 0x0001028f, 0x0001028f, 0x00010290, 0x00010290, 0x00010291, 0x00010291, 0x00010292, 0x00010292, 0x00010293, 0x00010293, 0x00010294, 0x00010294, }, - {0x00010295, 0x00010295, 0x00010296, 0x00010296, 0x00010297, 0x00010297, 0x00010298, 0x00010298, 0x00010299, 0x00010299, 0x0001029a, 0x0001029a, 0x0001029b, 0x0001029b, 0x0001029c, 0x0001029c, }, - {0x0001029d, 0x0001029d, 0x0001029e, 0x0001029e, 0x0001029f, 0x0001029f, 0x000102a0, 0x000102a0, 0x000102a1, 0x000102a1, 0x000102a2, 0x000102a2, 0x000102a3, 0x000102a3, 0x000102a4, 0x000102a4, }, - {0x000102a5, 0x000102a5, 0x000102a6, 0x000102a6, 0x000102a7, 0x000102a7, 0x000102a8, 0x000102a8, 0x000102a9, 0x000102a9, 0x000102aa, 0x000102aa, 0x000102ab, 0x000102ab, 0x000102ac, 0x000102ac, }, - {0x000102ad, 0x000102ad, 0x000102ae, 0x000102ae, 0x000102af, 0x000102af, 0x000102b0, 0x000102b0, 0x000102b1, 0x000102b1, 0x000102b2, 0x000102b2, 0x000102b3, 0x000102b3, 0x000102b4, 0x000102b4, }, - {0x000102b5, 0x000102b5, 0x000102b6, 0x000102b6, 0x000102b7, 0x000102b7, 0x000102b8, 0x000102b8, 0x000102b9, 0x000102b9, 0x000102ba, 0x000102ba, 0x000102bb, 0x000102bb, 0x000102bc, 0x000102bc, }, - {0x000102bd, 0x000102bd, 0x000102be, 0x000102be, 0x000102bf, 0x000102bf, 0x000102c0, 0x000102c0, 0x000102c1, 0x000102c1, 0x000102c2, 0x000102c2, 0x000102c3, 0x000102c3, 0x000102c4, 0x000102c4, }, - {0x000102c5, 0x000102c5, 0x000102c6, 0x000102c6, 0x000102c7, 0x000102c7, 0x000102c8, 0x000102c8, 0x000102c9, 0x000102c9, 0x000102ca, 0x000102ca, 0x000102cb, 0x000102cb, 0x000102cc, 0x000102cc, }, - {0x000102cd, 0x000102cd, 0x000102ce, 0x000102ce, 0x000102cf, 0x000102cf, 0x000102d0, 0x000102d0, 0x000102d1, 0x000102d1, 0x000102d2, 0x000102d2, 0x000102d3, 0x000102d3, 0x000102d4, 0x000102d4, }, +const uint32_t c_aauiCQMFHuffDec49[113][16] = { + { + 0x0006ffff, + 0x0005ffff, + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00010001, + 0x00010001, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + }, + { + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + 0x00030002, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + }, + { + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + }, + { + 0x0001006d, + 0x0001006d, + 0x0001006e, + 0x0001006e, + 0x0001006f, + 0x0001006f, + 0x00010088, + 0x00010088, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x00000070, + 0x00000087, + 0x00000089, + 0x0000008a, + 0x00010003, + 0x00010003, + 0x0001001f, + 0x0001001f, + 0x0001003a, + 0x0001003a, + 0x00010051, + 0x00010051, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + }, + { + 0x000fffff, + 0x000effff, + 0x000cffff, + 0x000dffff, + 0x0007ffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x00000004, + 0x00000005, + 0x00000020, + 0x00000021, + 0x0000003b, + 0x00000056, + 0x0000006c, + }, + { + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200bf, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x000200c0, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x0003003c, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + }, + { + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x00030071, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + 0x0003008b, + }, + { + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a2, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + 0x000300a3, + }, + { + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a4, + 0x000300a5, + 0x000300a5, + 0x000300a5, + 0x000300a5, + 0x000300a5, + 0x000300a5, + 0x000300a5, + 0x000300a5, + }, + { + 0x0001008d, + 0x0001008d, + 0x000100a7, + 0x000100a7, + 0x000100bd, + 0x000100bd, + 0x000100d9, + 0x000100d9, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + }, + { + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020072, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200a6, + 0x000200be, + 0x000200be, + 0x000200be, + 0x000200be, + }, + { + 0x00000059, + 0x00000073, + 0x0000008e, + 0x000000a8, + 0x000000c1, + 0x000000c2, + 0x000000d8, + 0x000000da, + 0x000000db, + 0x000000dc, + 0x00010007, + 0x00010007, + 0x00010023, + 0x00010023, + 0x00010058, + 0x00010058, + }, + { + 0x0023ffff, + 0x0034ffff, + 0x0045ffff, + 0x0056ffff, + 0x001affff, + 0x0019ffff, + 0x0018ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0011ffff, + 0x0010ffff, + 0x0012ffff, + 0x0013ffff, + 0x0014ffff, + 0x0000003e, + }, + { + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x00030074, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + 0x000300a9, + }, + { + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300c3, + 0x000300f4, + 0x000300f4, + 0x000300f4, + 0x000300f4, + 0x000300f4, + 0x000300f4, + 0x000300f4, + 0x000300f4, + }, + { + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f5, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + 0x000300f6, + }, + { + 0x00010112, + 0x00010112, + 0x0001012a, + 0x0001012a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x0002008f, + }, + { + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200aa, + 0x000200c4, + 0x000200c4, + 0x000200c4, + 0x000200c4, + 0x000200dd, + 0x000200dd, + 0x000200dd, + 0x000200dd, + }, + { + 0x000200de, + 0x000200de, + 0x000200de, + 0x000200de, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f3, + 0x000200f7, + 0x000200f7, + 0x000200f7, + 0x000200f7, + 0x00020110, + 0x00020110, + 0x00020110, + 0x00020110, + }, + { + 0x0000012c, + 0x0000012e, + 0x00010025, + 0x00010025, + 0x00010040, + 0x00010040, + 0x0001005b, + 0x0001005b, + 0x000100df, + 0x000100df, + 0x000100f8, + 0x000100f8, + 0x0001010f, + 0x0001010f, + 0x00010111, + 0x00010111, + }, + { + 0x001fffff, + 0x0020ffff, + 0x0000000a, + 0x00000026, + 0x00000041, + 0x00000091, + 0x000000ab, + 0x000000ac, + 0x000000c5, + 0x000000c6, + 0x000000e0, + 0x000000f9, + 0x0000010e, + 0x00000113, + 0x00000129, + 0x0000012b, + }, + { + 0x0067ffff, + 0x0068ffff, + 0x0069ffff, + 0x006affff, + 0x006bffff, + 0x006cffff, + 0x006dffff, + 0x006effff, + 0x006fffff, + 0x0070ffff, + 0x0021ffff, + 0x0022ffff, + 0x001cffff, + 0x001bffff, + 0x001dffff, + 0x001effff, + }, + { + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030076, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + 0x00030077, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + 0x0003005c, + }, + { + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x00030092, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + 0x000300e1, + }, + { + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fa, + 0x000300fb, + 0x000300fb, + 0x000300fb, + 0x000300fb, + 0x000300fb, + 0x000300fb, + 0x000300fb, + 0x000300fb, + }, + { + 0x00030114, + 0x00030114, + 0x00030114, + 0x00030114, + 0x00030114, + 0x00030114, + 0x00030114, + 0x00030114, + 0x0003012d, + 0x0003012d, + 0x0003012d, + 0x0003012d, + 0x0003012d, + 0x0003012d, + 0x0003012d, + 0x0003012d, + }, + { + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030145, + 0x00030146, + 0x00030146, + 0x00030146, + 0x00030146, + 0x00030146, + 0x00030146, + 0x00030146, + 0x00030146, + }, + { + 0x000102d5, + 0x000102d5, + 0x000102d6, + 0x000102d6, + 0x000102d7, + 0x000102d7, + 0x000102d8, + 0x000102d8, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x000200fc, + 0x000200fc, + 0x000200fc, + 0x000200fc, + }, + { + 0x00020116, + 0x00020116, + 0x00020116, + 0x00020116, + 0x00020131, + 0x00020131, + 0x00020131, + 0x00020131, + 0x00020144, + 0x00020144, + 0x00020144, + 0x00020144, + 0x00020164, + 0x00020164, + 0x00020164, + 0x00020164, + }, + { + 0x0025ffff, + 0x0026ffff, + 0x0028ffff, + 0x002affff, + 0x002effff, + 0x0029ffff, + 0x0027ffff, + 0x0033ffff, + 0x002dffff, + 0x0024ffff, + 0x002bffff, + 0x002cffff, + 0x002fffff, + 0x0030ffff, + 0x0031ffff, + 0x0032ffff, + }, + { + 0x00010085, + 0x00010085, + 0x00010086, + 0x00010086, + 0x00010093, + 0x00010093, + 0x00010094, + 0x00010094, + 0x00010095, + 0x00010095, + 0x00010096, + 0x00010096, + 0x00010097, + 0x00010097, + 0x00010098, + 0x00010098, + }, + { + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + }, + { + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x00010028, + 0x00010028, + }, + { + 0x00010061, + 0x00010061, + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + }, + { + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + }, + { + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + }, + { + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + }, + { + 0x00010099, + 0x00010099, + 0x0001009a, + 0x0001009a, + 0x0001009b, + 0x0001009b, + 0x0001009c, + 0x0001009c, + 0x0001009d, + 0x0001009d, + 0x0001009e, + 0x0001009e, + 0x0001009f, + 0x0001009f, + 0x000100a0, + 0x000100a0, + }, + { + 0x000100a1, + 0x000100a1, + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + }, + { + 0x0001007d, + 0x0001007d, + 0x0001007e, + 0x0001007e, + 0x0001007f, + 0x0001007f, + 0x00010080, + 0x00010080, + 0x00010081, + 0x00010081, + 0x00010082, + 0x00010082, + 0x00010083, + 0x00010083, + 0x00010084, + 0x00010084, + }, + { + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + }, + { + 0x000100b4, + 0x000100b4, + 0x000100b5, + 0x000100b5, + 0x000100b6, + 0x000100b6, + 0x000100b7, + 0x000100b7, + 0x000100b8, + 0x000100b8, + 0x000100b9, + 0x000100b9, + 0x000100ba, + 0x000100ba, + 0x000100bb, + 0x000100bb, + }, + { + 0x000100bc, + 0x000100bc, + 0x000100c7, + 0x000100c7, + 0x000100c8, + 0x000100c8, + 0x000100c9, + 0x000100c9, + 0x000100ca, + 0x000100ca, + 0x000100cb, + 0x000100cb, + 0x000100cc, + 0x000100cc, + 0x000100cd, + 0x000100cd, + }, + { + 0x000100ce, + 0x000100ce, + 0x000100cf, + 0x000100cf, + 0x000100d0, + 0x000100d0, + 0x000100d1, + 0x000100d1, + 0x000100d2, + 0x000100d2, + 0x000100d3, + 0x000100d3, + 0x000100d4, + 0x000100d4, + 0x000100d5, + 0x000100d5, + }, + { + 0x000100d6, + 0x000100d6, + 0x000100d7, + 0x000100d7, + 0x000100e2, + 0x000100e2, + 0x000100e3, + 0x000100e3, + 0x000100e4, + 0x000100e4, + 0x000100e5, + 0x000100e5, + 0x000100e6, + 0x000100e6, + 0x000100e7, + 0x000100e7, + }, + { + 0x00010069, + 0x00010069, + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + 0x00010078, + 0x00010078, + 0x00010079, + 0x00010079, + 0x0001007a, + 0x0001007a, + 0x0001007b, + 0x0001007b, + 0x0001007c, + 0x0001007c, + }, + { + 0x0035ffff, + 0x0036ffff, + 0x0037ffff, + 0x0038ffff, + 0x0039ffff, + 0x003affff, + 0x003bffff, + 0x003cffff, + 0x003dffff, + 0x003effff, + 0x003fffff, + 0x0040ffff, + 0x0041ffff, + 0x0042ffff, + 0x0043ffff, + 0x0044ffff, + }, + { + 0x000100e8, + 0x000100e8, + 0x000100e9, + 0x000100e9, + 0x000100ea, + 0x000100ea, + 0x000100eb, + 0x000100eb, + 0x000100ec, + 0x000100ec, + 0x000100ed, + 0x000100ed, + 0x000100ee, + 0x000100ee, + 0x000100ef, + 0x000100ef, + }, + { + 0x000100f0, + 0x000100f0, + 0x000100f1, + 0x000100f1, + 0x000100f2, + 0x000100f2, + 0x000100fd, + 0x000100fd, + 0x000100fe, + 0x000100fe, + 0x000100ff, + 0x000100ff, + 0x00010100, + 0x00010100, + 0x00010101, + 0x00010101, + }, + { + 0x00010102, + 0x00010102, + 0x00010103, + 0x00010103, + 0x00010104, + 0x00010104, + 0x00010105, + 0x00010105, + 0x00010106, + 0x00010106, + 0x00010107, + 0x00010107, + 0x00010108, + 0x00010108, + 0x00010109, + 0x00010109, + }, + { + 0x0001010a, + 0x0001010a, + 0x0001010b, + 0x0001010b, + 0x0001010c, + 0x0001010c, + 0x0001010d, + 0x0001010d, + 0x00010115, + 0x00010115, + 0x00010117, + 0x00010117, + 0x00010118, + 0x00010118, + 0x00010119, + 0x00010119, + }, + { + 0x0001011a, + 0x0001011a, + 0x0001011b, + 0x0001011b, + 0x0001011c, + 0x0001011c, + 0x0001011d, + 0x0001011d, + 0x0001011e, + 0x0001011e, + 0x0001011f, + 0x0001011f, + 0x00010120, + 0x00010120, + 0x00010121, + 0x00010121, + }, + { + 0x00010122, + 0x00010122, + 0x00010123, + 0x00010123, + 0x00010124, + 0x00010124, + 0x00010125, + 0x00010125, + 0x00010126, + 0x00010126, + 0x00010127, + 0x00010127, + 0x00010128, + 0x00010128, + 0x0001012f, + 0x0001012f, + }, + { + 0x00010130, + 0x00010130, + 0x00010132, + 0x00010132, + 0x00010133, + 0x00010133, + 0x00010134, + 0x00010134, + 0x00010135, + 0x00010135, + 0x00010136, + 0x00010136, + 0x00010137, + 0x00010137, + 0x00010138, + 0x00010138, + }, + { + 0x00010139, + 0x00010139, + 0x0001013a, + 0x0001013a, + 0x0001013b, + 0x0001013b, + 0x0001013c, + 0x0001013c, + 0x0001013d, + 0x0001013d, + 0x0001013e, + 0x0001013e, + 0x0001013f, + 0x0001013f, + 0x00010140, + 0x00010140, + }, + { + 0x00010141, + 0x00010141, + 0x00010142, + 0x00010142, + 0x00010143, + 0x00010143, + 0x00010147, + 0x00010147, + 0x00010148, + 0x00010148, + 0x00010149, + 0x00010149, + 0x0001014a, + 0x0001014a, + 0x0001014b, + 0x0001014b, + }, + { + 0x0001014c, + 0x0001014c, + 0x0001014d, + 0x0001014d, + 0x0001014e, + 0x0001014e, + 0x0001014f, + 0x0001014f, + 0x00010150, + 0x00010150, + 0x00010151, + 0x00010151, + 0x00010152, + 0x00010152, + 0x00010153, + 0x00010153, + }, + { + 0x00010154, + 0x00010154, + 0x00010155, + 0x00010155, + 0x00010156, + 0x00010156, + 0x00010157, + 0x00010157, + 0x00010158, + 0x00010158, + 0x00010159, + 0x00010159, + 0x0001015a, + 0x0001015a, + 0x0001015b, + 0x0001015b, + }, + { + 0x0001015c, + 0x0001015c, + 0x0001015d, + 0x0001015d, + 0x0001015e, + 0x0001015e, + 0x0001015f, + 0x0001015f, + 0x00010160, + 0x00010160, + 0x00010161, + 0x00010161, + 0x00010162, + 0x00010162, + 0x00010163, + 0x00010163, + }, + { + 0x00010165, + 0x00010165, + 0x00010166, + 0x00010166, + 0x00010167, + 0x00010167, + 0x00010168, + 0x00010168, + 0x00010169, + 0x00010169, + 0x0001016a, + 0x0001016a, + 0x0001016b, + 0x0001016b, + 0x0001016c, + 0x0001016c, + }, + { + 0x0001016d, + 0x0001016d, + 0x0001016e, + 0x0001016e, + 0x0001016f, + 0x0001016f, + 0x00010170, + 0x00010170, + 0x00010171, + 0x00010171, + 0x00010172, + 0x00010172, + 0x00010173, + 0x00010173, + 0x00010174, + 0x00010174, + }, + { + 0x00010175, + 0x00010175, + 0x00010176, + 0x00010176, + 0x00010177, + 0x00010177, + 0x00010178, + 0x00010178, + 0x00010179, + 0x00010179, + 0x0001017a, + 0x0001017a, + 0x0001017b, + 0x0001017b, + 0x0001017c, + 0x0001017c, + }, + { + 0x0001017d, + 0x0001017d, + 0x0001017e, + 0x0001017e, + 0x0001017f, + 0x0001017f, + 0x00010180, + 0x00010180, + 0x00010181, + 0x00010181, + 0x00010182, + 0x00010182, + 0x00010183, + 0x00010183, + 0x00010184, + 0x00010184, + }, + { + 0x0046ffff, + 0x0047ffff, + 0x0048ffff, + 0x0049ffff, + 0x004affff, + 0x004bffff, + 0x004cffff, + 0x004dffff, + 0x004effff, + 0x004fffff, + 0x0050ffff, + 0x0051ffff, + 0x0052ffff, + 0x0053ffff, + 0x0054ffff, + 0x0055ffff, + }, + { + 0x00010185, + 0x00010185, + 0x00010186, + 0x00010186, + 0x00010187, + 0x00010187, + 0x00010188, + 0x00010188, + 0x00010189, + 0x00010189, + 0x0001018a, + 0x0001018a, + 0x0001018b, + 0x0001018b, + 0x0001018c, + 0x0001018c, + }, + { + 0x0001018d, + 0x0001018d, + 0x0001018e, + 0x0001018e, + 0x0001018f, + 0x0001018f, + 0x00010190, + 0x00010190, + 0x00010191, + 0x00010191, + 0x00010192, + 0x00010192, + 0x00010193, + 0x00010193, + 0x00010194, + 0x00010194, + }, + { + 0x00010195, + 0x00010195, + 0x00010196, + 0x00010196, + 0x00010197, + 0x00010197, + 0x00010198, + 0x00010198, + 0x00010199, + 0x00010199, + 0x0001019a, + 0x0001019a, + 0x0001019b, + 0x0001019b, + 0x0001019c, + 0x0001019c, + }, + { + 0x0001019d, + 0x0001019d, + 0x0001019e, + 0x0001019e, + 0x0001019f, + 0x0001019f, + 0x000101a0, + 0x000101a0, + 0x000101a1, + 0x000101a1, + 0x000101a2, + 0x000101a2, + 0x000101a3, + 0x000101a3, + 0x000101a4, + 0x000101a4, + }, + { + 0x000101a5, + 0x000101a5, + 0x000101a6, + 0x000101a6, + 0x000101a7, + 0x000101a7, + 0x000101a8, + 0x000101a8, + 0x000101a9, + 0x000101a9, + 0x000101aa, + 0x000101aa, + 0x000101ab, + 0x000101ab, + 0x000101ac, + 0x000101ac, + }, + { + 0x000101ad, + 0x000101ad, + 0x000101ae, + 0x000101ae, + 0x000101af, + 0x000101af, + 0x000101b0, + 0x000101b0, + 0x000101b1, + 0x000101b1, + 0x000101b2, + 0x000101b2, + 0x000101b3, + 0x000101b3, + 0x000101b4, + 0x000101b4, + }, + { + 0x000101b5, + 0x000101b5, + 0x000101b6, + 0x000101b6, + 0x000101b7, + 0x000101b7, + 0x000101b8, + 0x000101b8, + 0x000101b9, + 0x000101b9, + 0x000101ba, + 0x000101ba, + 0x000101bb, + 0x000101bb, + 0x000101bc, + 0x000101bc, + }, + { + 0x000101bd, + 0x000101bd, + 0x000101be, + 0x000101be, + 0x000101bf, + 0x000101bf, + 0x000101c0, + 0x000101c0, + 0x000101c1, + 0x000101c1, + 0x000101c2, + 0x000101c2, + 0x000101c3, + 0x000101c3, + 0x000101c4, + 0x000101c4, + }, + { + 0x000101c5, + 0x000101c5, + 0x000101c6, + 0x000101c6, + 0x000101c7, + 0x000101c7, + 0x000101c8, + 0x000101c8, + 0x000101c9, + 0x000101c9, + 0x000101ca, + 0x000101ca, + 0x000101cb, + 0x000101cb, + 0x000101cc, + 0x000101cc, + }, + { + 0x000101cd, + 0x000101cd, + 0x000101ce, + 0x000101ce, + 0x000101cf, + 0x000101cf, + 0x000101d0, + 0x000101d0, + 0x000101d1, + 0x000101d1, + 0x000101d2, + 0x000101d2, + 0x000101d3, + 0x000101d3, + 0x000101d4, + 0x000101d4, + }, + { + 0x000101d5, + 0x000101d5, + 0x000101d6, + 0x000101d6, + 0x000101d7, + 0x000101d7, + 0x000101d8, + 0x000101d8, + 0x000101d9, + 0x000101d9, + 0x000101da, + 0x000101da, + 0x000101db, + 0x000101db, + 0x000101dc, + 0x000101dc, + }, + { + 0x000101dd, + 0x000101dd, + 0x000101de, + 0x000101de, + 0x000101df, + 0x000101df, + 0x000101e0, + 0x000101e0, + 0x000101e1, + 0x000101e1, + 0x000101e2, + 0x000101e2, + 0x000101e3, + 0x000101e3, + 0x000101e4, + 0x000101e4, + }, + { + 0x000101e5, + 0x000101e5, + 0x000101e6, + 0x000101e6, + 0x000101e7, + 0x000101e7, + 0x000101e8, + 0x000101e8, + 0x000101e9, + 0x000101e9, + 0x000101ea, + 0x000101ea, + 0x000101eb, + 0x000101eb, + 0x000101ec, + 0x000101ec, + }, + { + 0x000101ed, + 0x000101ed, + 0x000101ee, + 0x000101ee, + 0x000101ef, + 0x000101ef, + 0x000101f0, + 0x000101f0, + 0x000101f1, + 0x000101f1, + 0x000101f2, + 0x000101f2, + 0x000101f3, + 0x000101f3, + 0x000101f4, + 0x000101f4, + }, + { + 0x000101f5, + 0x000101f5, + 0x000101f6, + 0x000101f6, + 0x000101f7, + 0x000101f7, + 0x000101f8, + 0x000101f8, + 0x000101f9, + 0x000101f9, + 0x000101fa, + 0x000101fa, + 0x000101fb, + 0x000101fb, + 0x000101fc, + 0x000101fc, + }, + { + 0x000101fd, + 0x000101fd, + 0x000101fe, + 0x000101fe, + 0x000101ff, + 0x000101ff, + 0x00010200, + 0x00010200, + 0x00010201, + 0x00010201, + 0x00010202, + 0x00010202, + 0x00010203, + 0x00010203, + 0x00010204, + 0x00010204, + }, + { + 0x0057ffff, + 0x0058ffff, + 0x0059ffff, + 0x005affff, + 0x005bffff, + 0x005cffff, + 0x005dffff, + 0x005effff, + 0x005fffff, + 0x0060ffff, + 0x0061ffff, + 0x0062ffff, + 0x0063ffff, + 0x0064ffff, + 0x0065ffff, + 0x0066ffff, + }, + { + 0x00010205, + 0x00010205, + 0x00010206, + 0x00010206, + 0x00010207, + 0x00010207, + 0x00010208, + 0x00010208, + 0x00010209, + 0x00010209, + 0x0001020a, + 0x0001020a, + 0x0001020b, + 0x0001020b, + 0x0001020c, + 0x0001020c, + }, + { + 0x0001020d, + 0x0001020d, + 0x0001020e, + 0x0001020e, + 0x0001020f, + 0x0001020f, + 0x00010210, + 0x00010210, + 0x00010211, + 0x00010211, + 0x00010212, + 0x00010212, + 0x00010213, + 0x00010213, + 0x00010214, + 0x00010214, + }, + { + 0x00010215, + 0x00010215, + 0x00010216, + 0x00010216, + 0x00010217, + 0x00010217, + 0x00010218, + 0x00010218, + 0x00010219, + 0x00010219, + 0x0001021a, + 0x0001021a, + 0x0001021b, + 0x0001021b, + 0x0001021c, + 0x0001021c, + }, + { + 0x0001021d, + 0x0001021d, + 0x0001021e, + 0x0001021e, + 0x0001021f, + 0x0001021f, + 0x00010220, + 0x00010220, + 0x00010221, + 0x00010221, + 0x00010222, + 0x00010222, + 0x00010223, + 0x00010223, + 0x00010224, + 0x00010224, + }, + { + 0x00010225, + 0x00010225, + 0x00010226, + 0x00010226, + 0x00010227, + 0x00010227, + 0x00010228, + 0x00010228, + 0x00010229, + 0x00010229, + 0x0001022a, + 0x0001022a, + 0x0001022b, + 0x0001022b, + 0x0001022c, + 0x0001022c, + }, + { + 0x0001022d, + 0x0001022d, + 0x0001022e, + 0x0001022e, + 0x0001022f, + 0x0001022f, + 0x00010230, + 0x00010230, + 0x00010231, + 0x00010231, + 0x00010232, + 0x00010232, + 0x00010233, + 0x00010233, + 0x00010234, + 0x00010234, + }, + { + 0x00010235, + 0x00010235, + 0x00010236, + 0x00010236, + 0x00010237, + 0x00010237, + 0x00010238, + 0x00010238, + 0x00010239, + 0x00010239, + 0x0001023a, + 0x0001023a, + 0x0001023b, + 0x0001023b, + 0x0001023c, + 0x0001023c, + }, + { + 0x0001023d, + 0x0001023d, + 0x0001023e, + 0x0001023e, + 0x0001023f, + 0x0001023f, + 0x00010240, + 0x00010240, + 0x00010241, + 0x00010241, + 0x00010242, + 0x00010242, + 0x00010243, + 0x00010243, + 0x00010244, + 0x00010244, + }, + { + 0x00010245, + 0x00010245, + 0x00010246, + 0x00010246, + 0x00010247, + 0x00010247, + 0x00010248, + 0x00010248, + 0x00010249, + 0x00010249, + 0x0001024a, + 0x0001024a, + 0x0001024b, + 0x0001024b, + 0x0001024c, + 0x0001024c, + }, + { + 0x0001024d, + 0x0001024d, + 0x0001024e, + 0x0001024e, + 0x0001024f, + 0x0001024f, + 0x00010250, + 0x00010250, + 0x00010251, + 0x00010251, + 0x00010252, + 0x00010252, + 0x00010253, + 0x00010253, + 0x00010254, + 0x00010254, + }, + { + 0x00010255, + 0x00010255, + 0x00010256, + 0x00010256, + 0x00010257, + 0x00010257, + 0x00010258, + 0x00010258, + 0x00010259, + 0x00010259, + 0x0001025a, + 0x0001025a, + 0x0001025b, + 0x0001025b, + 0x0001025c, + 0x0001025c, + }, + { + 0x0001025d, + 0x0001025d, + 0x0001025e, + 0x0001025e, + 0x0001025f, + 0x0001025f, + 0x00010260, + 0x00010260, + 0x00010261, + 0x00010261, + 0x00010262, + 0x00010262, + 0x00010263, + 0x00010263, + 0x00010264, + 0x00010264, + }, + { + 0x00010265, + 0x00010265, + 0x00010266, + 0x00010266, + 0x00010267, + 0x00010267, + 0x00010268, + 0x00010268, + 0x00010269, + 0x00010269, + 0x0001026a, + 0x0001026a, + 0x0001026b, + 0x0001026b, + 0x0001026c, + 0x0001026c, + }, + { + 0x0001026d, + 0x0001026d, + 0x0001026e, + 0x0001026e, + 0x0001026f, + 0x0001026f, + 0x00010270, + 0x00010270, + 0x00010271, + 0x00010271, + 0x00010272, + 0x00010272, + 0x00010273, + 0x00010273, + 0x00010274, + 0x00010274, + }, + { + 0x00010275, + 0x00010275, + 0x00010276, + 0x00010276, + 0x00010277, + 0x00010277, + 0x00010278, + 0x00010278, + 0x00010279, + 0x00010279, + 0x0001027a, + 0x0001027a, + 0x0001027b, + 0x0001027b, + 0x0001027c, + 0x0001027c, + }, + { + 0x0001027d, + 0x0001027d, + 0x0001027e, + 0x0001027e, + 0x0001027f, + 0x0001027f, + 0x00010280, + 0x00010280, + 0x00010281, + 0x00010281, + 0x00010282, + 0x00010282, + 0x00010283, + 0x00010283, + 0x00010284, + 0x00010284, + }, + { + 0x00010285, + 0x00010285, + 0x00010286, + 0x00010286, + 0x00010287, + 0x00010287, + 0x00010288, + 0x00010288, + 0x00010289, + 0x00010289, + 0x0001028a, + 0x0001028a, + 0x0001028b, + 0x0001028b, + 0x0001028c, + 0x0001028c, + }, + { + 0x0001028d, + 0x0001028d, + 0x0001028e, + 0x0001028e, + 0x0001028f, + 0x0001028f, + 0x00010290, + 0x00010290, + 0x00010291, + 0x00010291, + 0x00010292, + 0x00010292, + 0x00010293, + 0x00010293, + 0x00010294, + 0x00010294, + }, + { + 0x00010295, + 0x00010295, + 0x00010296, + 0x00010296, + 0x00010297, + 0x00010297, + 0x00010298, + 0x00010298, + 0x00010299, + 0x00010299, + 0x0001029a, + 0x0001029a, + 0x0001029b, + 0x0001029b, + 0x0001029c, + 0x0001029c, + }, + { + 0x0001029d, + 0x0001029d, + 0x0001029e, + 0x0001029e, + 0x0001029f, + 0x0001029f, + 0x000102a0, + 0x000102a0, + 0x000102a1, + 0x000102a1, + 0x000102a2, + 0x000102a2, + 0x000102a3, + 0x000102a3, + 0x000102a4, + 0x000102a4, + }, + { + 0x000102a5, + 0x000102a5, + 0x000102a6, + 0x000102a6, + 0x000102a7, + 0x000102a7, + 0x000102a8, + 0x000102a8, + 0x000102a9, + 0x000102a9, + 0x000102aa, + 0x000102aa, + 0x000102ab, + 0x000102ab, + 0x000102ac, + 0x000102ac, + }, + { + 0x000102ad, + 0x000102ad, + 0x000102ae, + 0x000102ae, + 0x000102af, + 0x000102af, + 0x000102b0, + 0x000102b0, + 0x000102b1, + 0x000102b1, + 0x000102b2, + 0x000102b2, + 0x000102b3, + 0x000102b3, + 0x000102b4, + 0x000102b4, + }, + { + 0x000102b5, + 0x000102b5, + 0x000102b6, + 0x000102b6, + 0x000102b7, + 0x000102b7, + 0x000102b8, + 0x000102b8, + 0x000102b9, + 0x000102b9, + 0x000102ba, + 0x000102ba, + 0x000102bb, + 0x000102bb, + 0x000102bc, + 0x000102bc, + }, + { + 0x000102bd, + 0x000102bd, + 0x000102be, + 0x000102be, + 0x000102bf, + 0x000102bf, + 0x000102c0, + 0x000102c0, + 0x000102c1, + 0x000102c1, + 0x000102c2, + 0x000102c2, + 0x000102c3, + 0x000102c3, + 0x000102c4, + 0x000102c4, + }, + { + 0x000102c5, + 0x000102c5, + 0x000102c6, + 0x000102c6, + 0x000102c7, + 0x000102c7, + 0x000102c8, + 0x000102c8, + 0x000102c9, + 0x000102c9, + 0x000102ca, + 0x000102ca, + 0x000102cb, + 0x000102cb, + 0x000102cc, + 0x000102cc, + }, + { + 0x000102cd, + 0x000102cd, + 0x000102ce, + 0x000102ce, + 0x000102cf, + 0x000102cf, + 0x000102d0, + 0x000102d0, + 0x000102d1, + 0x000102d1, + 0x000102d2, + 0x000102d2, + 0x000102d3, + 0x000102d3, + 0x000102d4, + 0x000102d4, + }, }; #endif #ifndef ROM_TO_RAM @@ -3620,22 +38325,147 @@ const uint32_t c_aauiCQMFHuffEnc50[28][2] = #else const uint16_t c_aauiCQMFHuffEnc50[28][2] = #endif -{ - {0x0002, 0x0001}, {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0001}, {0x0004, 0x0001}, {0x0005, 0x0001}, {0x0006, 0x0001}, {0x0007, 0x0001}, - {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, {0x000e, 0x0001}, {0x000f, 0x0001}, - {0x0011, 0x0003}, {0x0012, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, - {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, + { + { 0x0002, 0x0001 }, + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0001 }, + { 0x0004, 0x0001 }, + { 0x0005, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000f, 0x0001 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0005 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec50[6][16] = -{ - {0x0001ffff, 0x00000004, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, - {0x0002ffff, 0x00000008, 0x00010007, 0x00010007, 0x00020006, 0x00020006, 0x00020006, 0x00020006, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x0003ffff, 0x0000000c, 0x0001000b, 0x0001000b, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0005ffff, 0x0004ffff, 0x0001000f, 0x0001000f, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, 0x00030010, }, - {0x00010012, 0x00010012, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, }, +const uint32_t c_aauiCQMFHuffDec50[6][16] = { + { + 0x0001ffff, + 0x00000004, + 0x00010003, + 0x00010003, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + }, + { + 0x0002ffff, + 0x00000008, + 0x00010007, + 0x00010007, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00020006, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x0003ffff, + 0x0000000c, + 0x0001000b, + 0x0001000b, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0005ffff, + 0x0004ffff, + 0x0001000f, + 0x0001000f, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + 0x00030010, + }, + { + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + }, }; #endif #ifndef ROM_TO_RAM @@ -3643,22 +38473,148 @@ const uint32_t c_aauiCQMFHuffEnc51[29][2] = #else const uint16_t c_aauiCQMFHuffEnc51[29][2] = #endif -{ - {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0001}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, - {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, {0x000d, 0x0001}, - {0x000e, 0x0001}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0013, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + { + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0001 }, + { 0x0004, 0x0002 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0006, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000d, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec51[6][16] = -{ - {0x0001ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0002ffff, 0x0000000a, 0x00010009, 0x00010009, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x0003ffff, 0x0000000e, 0x0001000d, 0x0001000d, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0004ffff, 0x0005ffff, 0x00000011, 0x00000012, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, 0x0003000f, }, - {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, }, - {0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, }, +const uint32_t c_aauiCQMFHuffDec51[6][16] = { + { + 0x0001ffff, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x0002ffff, + 0x0000000a, + 0x00010009, + 0x00010009, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x0003ffff, + 0x0000000e, + 0x0001000d, + 0x0001000d, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0004ffff, + 0x0005ffff, + 0x00000011, + 0x00000012, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + 0x0003000f, + }, + { + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + }, + { + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + }, }; #endif #ifndef ROM_TO_RAM @@ -3666,22 +38622,168 @@ const uint32_t c_aauiCQMFHuffEnc52[32][2] = #else const uint16_t c_aauiCQMFHuffEnc52[32][2] = #endif -{ - {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0001}, {0x0005, 0x0002}, - {0x0005, 0x0003}, {0x0006, 0x0001}, {0x0007, 0x0001}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000a, 0x0001}, {0x000b, 0x0001}, {0x000c, 0x0001}, - {0x000e, 0x0001}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0001}, {0x0011, 0x0002}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0014, 0x0000}, - {0x0013, 0x0003}, {0x0014, 0x0001}, {0x0014, 0x0002}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0004}, {0x0013, 0x0005}, -}; + { + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0002 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0001 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0006, 0x0001 }, + { 0x0007, 0x0001 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000a, 0x0001 }, + { 0x000b, 0x0001 }, + { 0x000c, 0x0001 }, + { 0x000e, 0x0001 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0001 }, + { 0x0011, 0x0002 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0003 }, + { 0x0014, 0x0000 }, + { 0x0013, 0x0003 }, + { 0x0014, 0x0001 }, + { 0x0014, 0x0002 }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec52[7][16] = -{ - {0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0003ffff, 0x0000000b, 0x0001000a, 0x0001000a, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x0004ffff, 0x0000000f, 0x0001000e, 0x0001000e, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0006ffff, 0x0005ffff, 0x00010013, 0x00010013, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, }, - {0x00000017, 0x00000019, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x00010018, 0x00010018, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, +const uint32_t c_aauiCQMFHuffDec52[7][16] = { + { + 0x0001ffff, + 0x0002ffff, + 0x00000004, + 0x00000005, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x0003ffff, + 0x0000000b, + 0x0001000a, + 0x0001000a, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x0004ffff, + 0x0000000f, + 0x0001000e, + 0x0001000e, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x00010013, + 0x00010013, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + }, + { + 0x00000017, + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x0000001d, + 0x00010018, + 0x00010018, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, }; #endif #ifndef ROM_TO_RAM @@ -3689,26 +38791,210 @@ const uint32_t c_aauiCQMFHuffEnc53[37][2] = #else const uint16_t c_aauiCQMFHuffEnc53[37][2] = #endif -{ - {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0002}, {0x0004, 0x0003}, {0x0005, 0x0002}, {0x0005, 0x0003}, - {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0007, 0x0001}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0009, 0x0001}, {0x000b, 0x0002}, - {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0002}, - {0x000f, 0x0003}, {0x0011, 0x0004}, {0x0010, 0x0003}, {0x0011, 0x0005}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0001}, {0x0012, 0x0002}, - {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, + { + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0002 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0002 }, + { 0x0005, 0x0003 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0007, 0x0001 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x0009, 0x0001 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0002 }, + { 0x000f, 0x0003 }, + { 0x0011, 0x0004 }, + { 0x0010, 0x0003 }, + { 0x0011, 0x0005 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec53[9][16] = -{ - {0x0002ffff, 0x0001ffff, 0x00000004, 0x00000005, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x0003ffff, 0x0000000d, 0x0001000a, 0x0001000a, 0x0001000b, 0x0001000b, 0x0001000c, 0x0001000c, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, - {0x0005ffff, 0x0004ffff, 0x00000011, 0x00000012, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, 0x0003000e, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x0007ffff, 0x0008ffff, 0x0006ffff, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, }, - {0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, }, +const uint32_t c_aauiCQMFHuffDec53[9][16] = { + { + 0x0002ffff, + 0x0001ffff, + 0x00000004, + 0x00000005, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x0003ffff, + 0x0000000d, + 0x0001000a, + 0x0001000a, + 0x0001000b, + 0x0001000b, + 0x0001000c, + 0x0001000c, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + }, + { + 0x0005ffff, + 0x0004ffff, + 0x00000011, + 0x00000012, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + 0x0003000e, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x0007ffff, + 0x0008ffff, + 0x0006ffff, + 0x0000001a, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + }, + { + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + }, + { + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + }, }; #endif #ifndef ROM_TO_RAM @@ -3716,26 +39002,212 @@ const uint32_t c_aauiCQMFHuffEnc54[39][2] = #else const uint16_t c_aauiCQMFHuffEnc54[39][2] = #endif -{ - {0x0002, 0x0002}, {0x0002, 0x0003}, {0x0003, 0x0002}, {0x0003, 0x0003}, {0x0004, 0x0003}, {0x0005, 0x0003}, {0x0005, 0x0004}, {0x0005, 0x0005}, - {0x0006, 0x0002}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0008, 0x0001}, {0x0008, 0x0002}, - {0x0008, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, - {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0002}, {0x000f, 0x0003}, {0x0011, 0x0002}, {0x0010, 0x0002}, {0x0010, 0x0003}, - {0x0011, 0x0003}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, + { + { 0x0002, 0x0002 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0002 }, + { 0x0003, 0x0003 }, + { 0x0004, 0x0003 }, + { 0x0005, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0006, 0x0002 }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0008, 0x0001 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0002 }, + { 0x000f, 0x0003 }, + { 0x0011, 0x0002 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec54[9][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x0004ffff, 0x0000000e, 0x0000000f, 0x00000010, 0x0001000c, 0x0001000c, 0x0001000d, 0x0001000d, 0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, }, - {0x0006ffff, 0x0005ffff, 0x00000015, 0x00000016, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, }, - {0x0008ffff, 0x0007ffff, 0x0000001e, 0x0000001f, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x00020019, 0x00020019, 0x00020019, 0x00020019, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, 0x00030020, }, - {0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00010025, 0x00010025, 0x00010026, 0x00010026, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, }, +const uint32_t c_aauiCQMFHuffDec54[9][16] = { + { + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000004, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020000, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x0004ffff, + 0x0000000e, + 0x0000000f, + 0x00000010, + 0x0001000c, + 0x0001000c, + 0x0001000d, + 0x0001000d, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x00000015, + 0x00000016, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + }, + { + 0x0008ffff, + 0x0007ffff, + 0x0000001e, + 0x0000001f, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x00020019, + 0x00020019, + 0x00020019, + 0x00020019, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + 0x00030020, + }, + { + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00010025, + 0x00010025, + 0x00010026, + 0x00010026, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + }, }; #endif #ifndef ROM_TO_RAM @@ -3743,28 +39215,237 @@ const uint32_t c_aauiCQMFHuffEnc55[46][2] = #else const uint16_t c_aauiCQMFHuffEnc55[46][2] = #endif -{ - {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0003}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, - {0x0005, 0x0004}, {0x0005, 0x0005}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0002}, {0x0007, 0x0003}, {0x0007, 0x0004}, - {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, {0x000a, 0x0003}, {0x000b, 0x0002}, - {0x000b, 0x0003}, {0x000c, 0x0002}, {0x000c, 0x0003}, {0x000d, 0x0002}, {0x000d, 0x0003}, {0x000e, 0x0002}, {0x000e, 0x0003}, {0x000f, 0x0003}, - {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0011, 0x0003}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, - {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, + { + { 0x0003, 0x0003 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0004, 0x0003 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0005, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0002 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0002 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0002 }, + { 0x000c, 0x0003 }, + { 0x000d, 0x0002 }, + { 0x000d, 0x0003 }, + { 0x000e, 0x0002 }, + { 0x000e, 0x0003 }, + { 0x000f, 0x0003 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec55[10][16] = -{ - {0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0005ffff, 0x0004ffff, 0x00000011, 0x00000012, 0x0001000d, 0x0001000d, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, }, - {0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030013, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, 0x00030014, }, - {0x0007ffff, 0x0006ffff, 0x00000019, 0x0000001a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001b, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0009ffff, 0x0008ffff, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x0001001f, 0x0001001f, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001d, 0x0002001e, 0x0002001e, 0x0002001e, 0x0002001e, }, - {0x00020026, 0x00020026, 0x00020026, 0x00020026, 0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x0001002d, 0x0001002d, 0x00020025, 0x00020025, 0x00020025, 0x00020025, }, +const uint32_t c_aauiCQMFHuffDec55[10][16] = { + { + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00010000, + 0x00010000, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0005ffff, + 0x0004ffff, + 0x00000011, + 0x00000012, + 0x0001000d, + 0x0001000d, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + }, + { + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030013, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + 0x00030014, + }, + { + 0x0007ffff, + 0x0006ffff, + 0x00000019, + 0x0000001a, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001b, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0009ffff, + 0x0008ffff, + 0x00000020, + 0x00000021, + 0x00000022, + 0x00000023, + 0x0001001f, + 0x0001001f, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001d, + 0x0002001e, + 0x0002001e, + 0x0002001e, + 0x0002001e, + }, + { + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x0001002d, + 0x0001002d, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + }, }; #endif #ifndef ROM_TO_RAM @@ -3772,31 +39453,282 @@ const uint32_t c_aauiCQMFHuffEnc56[55][2] = #else const uint16_t c_aauiCQMFHuffEnc56[55][2] = #endif -{ - {0x0003, 0x0003}, {0x0002, 0x0003}, {0x0003, 0x0004}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0005, 0x0003}, {0x0005, 0x0004}, - {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0003}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0007, 0x0003}, {0x0007, 0x0004}, - {0x0007, 0x0005}, {0x0008, 0x0002}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0002}, {0x0009, 0x0003}, {0x000a, 0x0002}, - {0x000a, 0x0003}, {0x000b, 0x0003}, {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000d, 0x0003}, {0x000d, 0x0004}, {0x000d, 0x0005}, - {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0002}, {0x0010, 0x0003}, {0x0010, 0x0004}, - {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, {0x0013, 0x0000}, {0x0011, 0x0003}, {0x0012, 0x0005}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, + { + { 0x0003, 0x0003 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0004 }, + { 0x0003, 0x0005 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0005, 0x0003 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0003 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0008, 0x0002 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0009, 0x0002 }, + { 0x0009, 0x0003 }, + { 0x000a, 0x0002 }, + { 0x000a, 0x0003 }, + { 0x000b, 0x0003 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000d, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x0010, 0x0002 }, + { 0x0010, 0x0003 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0010, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0013, 0x0000 }, + { 0x0011, 0x0003 }, + { 0x0012, 0x0005 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec56[12][16] = -{ - {0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000004, 0x00000005, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00010003, 0x00010003, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0006ffff, 0x0005ffff, 0x00000011, 0x00000012, 0x00000013, 0x00000014, 0x0001000e, 0x0001000e, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030015, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, 0x00030016, }, - {0x0009ffff, 0x0007ffff, 0x0008ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x00010019, 0x00010019, 0x00020017, 0x00020017, 0x00020017, 0x00020017, 0x00020018, 0x00020018, 0x00020018, 0x00020018, }, - {0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x00020022, 0x00020022, 0x00020022, 0x00020022, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, }, - {0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, 0x0003001f, }, - {0x000bffff, 0x000affff, 0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010023, 0x00010023, 0x00010024, 0x00010024, 0x00020020, 0x00020020, 0x00020020, 0x00020020, }, - {0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x0001002b, 0x0001002b, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010033, 0x00010033, 0x00010034, 0x00010034, }, +const uint32_t c_aauiCQMFHuffDec56[12][16] = { + { + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00000004, + 0x00000005, + 0x00010000, + 0x00010000, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0006ffff, + 0x0005ffff, + 0x00000011, + 0x00000012, + 0x00000013, + 0x00000014, + 0x0001000e, + 0x0001000e, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030015, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + 0x00030016, + }, + { + 0x0009ffff, + 0x0007ffff, + 0x0008ffff, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x00010019, + 0x00010019, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020017, + 0x00020018, + 0x00020018, + 0x00020018, + 0x00020018, + }, + { + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020022, + 0x00020022, + 0x00020022, + 0x00020022, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + }, + { + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + 0x0003001f, + }, + { + 0x000bffff, + 0x000affff, + 0x00000025, + 0x00000026, + 0x00000027, + 0x00000028, + 0x00000029, + 0x0000002a, + 0x00010023, + 0x00010023, + 0x00010024, + 0x00010024, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + }, + { + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + }, + { + 0x0001002b, + 0x0001002b, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010033, + 0x00010033, + 0x00010034, + 0x00010034, + }, }; #endif #ifndef ROM_TO_RAM @@ -3804,35 +39736,328 @@ const uint32_t c_aauiCQMFHuffEnc57[65][2] = #else const uint16_t c_aauiCQMFHuffEnc57[65][2] = #endif -{ - {0x0003, 0x0004}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0004}, {0x0004, 0x0005}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0005, 0x0004}, - {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0007, 0x0003}, - {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0009, 0x0003}, - {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0003}, {0x000b, 0x0004}, {0x000b, 0x0005}, - {0x000c, 0x0003}, {0x000c, 0x0004}, {0x000d, 0x0003}, {0x000c, 0x0005}, {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000e, 0x0003}, {0x000e, 0x0004}, - {0x000e, 0x0005}, {0x000f, 0x0003}, {0x0010, 0x0003}, {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0010, 0x0004}, {0x0010, 0x0005}, {0x0013, 0x0000}, - {0x0011, 0x0005}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0012, 0x0007}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0012, 0x0008}, {0x0012, 0x0009}, - {0x0013, 0x0005}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, - {0x0013, 0x000d}, + { + { 0x0003, 0x0004 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0005 }, + { 0x0004, 0x0004 }, + { 0x0004, 0x0005 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0005, 0x0004 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0007, 0x0003 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0003 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000c, 0x0003 }, + { 0x000c, 0x0004 }, + { 0x000d, 0x0003 }, + { 0x000c, 0x0005 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000f, 0x0003 }, + { 0x0010, 0x0003 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x0010, 0x0004 }, + { 0x0010, 0x0005 }, + { 0x0013, 0x0000 }, + { 0x0011, 0x0005 }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0012, 0x0007 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec57[14][16] = -{ - {0x0004ffff, 0x0003ffff, 0x0001ffff, 0x0002ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x00000014, 0x00000015, 0x00000016, 0x0001000f, 0x0001000f, 0x00010010, 0x00010010, 0x00010011, 0x00010011, 0x00010012, 0x00010012, 0x00010013, 0x00010013, }, - {0x0002001b, 0x0002001b, 0x0002001b, 0x0002001b, 0x0002001c, 0x0002001c, 0x0002001c, 0x0002001c, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, 0x00030017, }, - {0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030018, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, 0x00030019, }, - {0x000affff, 0x0008ffff, 0x0009ffff, 0x00000020, 0x00000021, 0x00000023, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x0002001a, 0x0002001a, 0x0002001a, 0x0002001a, }, - {0x00020027, 0x00020027, 0x00020027, 0x00020027, 0x00020028, 0x00020028, 0x00020028, 0x00020028, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, }, - {0x000dffff, 0x000cffff, 0x000bffff, 0x0000002a, 0x0000002d, 0x0000002e, 0x00010029, 0x00010029, 0x0001002b, 0x0001002b, 0x0001002c, 0x0001002c, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, - {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x0001003b, 0x0001003b, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010040, 0x00010040, 0x00020033, 0x00020033, 0x00020033, 0x00020033, }, - {0x0001002f, 0x0001002f, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, 0x00010035, 0x00010035, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003a, 0x0001003a, }, +const uint32_t c_aauiCQMFHuffDec57[14][16] = { + { + 0x0004ffff, + 0x0003ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00010000, + 0x00010000, + 0x00010002, + 0x00010002, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + }, + { + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x00000014, + 0x00000015, + 0x00000016, + 0x0001000f, + 0x0001000f, + 0x00010010, + 0x00010010, + 0x00010011, + 0x00010011, + 0x00010012, + 0x00010012, + 0x00010013, + 0x00010013, + }, + { + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001b, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x0002001c, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + 0x00030017, + }, + { + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030018, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + 0x00030019, + }, + { + 0x000affff, + 0x0008ffff, + 0x0009ffff, + 0x00000020, + 0x00000021, + 0x00000023, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x0002001a, + 0x0002001a, + 0x0002001a, + 0x0002001a, + }, + { + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020027, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00020028, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + }, + { + 0x000dffff, + 0x000cffff, + 0x000bffff, + 0x0000002a, + 0x0000002d, + 0x0000002e, + 0x00010029, + 0x00010029, + 0x0001002b, + 0x0001002b, + 0x0001002c, + 0x0001002c, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + }, + { + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + }, + { + 0x0001003b, + 0x0001003b, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010040, + 0x00010040, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + }, + { + 0x0001002f, + 0x0001002f, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010034, + 0x00010034, + 0x00010035, + 0x00010035, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0001003a, + 0x0001003a, + }, }; #endif #ifndef ROM_TO_RAM @@ -3840,39 +40065,394 @@ const uint32_t c_aauiCQMFHuffEnc58[77][2] = #else const uint16_t c_aauiCQMFHuffEnc58[77][2] = #endif -{ - {0x0004, 0x0005}, {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, - {0x0005, 0x0005}, {0x0005, 0x0006}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0006, 0x0004}, {0x0006, 0x0005}, {0x0006, 0x0006}, - {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0007, 0x0004}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0008, 0x0003}, - {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0009, 0x0003}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0003}, - {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, - {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, - {0x000f, 0x0004}, {0x000f, 0x0005}, {0x000f, 0x0006}, {0x0010, 0x0004}, {0x000f, 0x0007}, {0x0010, 0x0005}, {0x0010, 0x0006}, {0x0010, 0x0007}, - {0x0013, 0x0000}, {0x0013, 0x0001}, {0x0012, 0x0006}, {0x0011, 0x0007}, {0x0013, 0x0002}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, - {0x0012, 0x0007}, {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0012, 0x0008}, - {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, + { + { 0x0004, 0x0005 }, + { 0x0003, 0x0005 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x0005 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0006, 0x0004 }, + { 0x0006, 0x0005 }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0007, 0x0004 }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0009, 0x0003 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0003 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000e, 0x0006 }, + { 0x000e, 0x0007 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x000f, 0x0006 }, + { 0x0010, 0x0004 }, + { 0x000f, 0x0007 }, + { 0x0010, 0x0005 }, + { 0x0010, 0x0006 }, + { 0x0010, 0x0007 }, + { 0x0013, 0x0000 }, + { 0x0013, 0x0001 }, + { 0x0012, 0x0006 }, + { 0x0011, 0x0007 }, + { 0x0013, 0x0002 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0012, 0x0007 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec58[17][16] = -{ - {0x0005ffff, 0x0004ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000000, 0x00000004, 0x00000005, 0x00000006, 0x00000007, 0x00010001, 0x00010001, 0x00010002, 0x00010002, 0x00010003, 0x00010003, }, - {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, - {0x0008ffff, 0x0006ffff, 0x0007ffff, 0x00000017, 0x00000018, 0x00000019, 0x0000001a, 0x0000001b, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, }, - {0x00020020, 0x00020020, 0x00020020, 0x00020020, 0x00020021, 0x00020021, 0x00020021, 0x00020021, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, 0x0003001c, }, - {0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001d, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, 0x0003001e, }, - {0x000cffff, 0x000bffff, 0x0009ffff, 0x000affff, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00010022, 0x00010022, 0x00010023, 0x00010023, 0x0002001f, 0x0002001f, 0x0002001f, 0x0002001f, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002d, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, }, - {0x0010ffff, 0x000effff, 0x000fffff, 0x000dffff, 0x00000033, 0x00000035, 0x00000036, 0x00000037, 0x00010030, 0x00010030, 0x00010031, 0x00010031, 0x00010032, 0x00010032, 0x00010034, 0x00010034, }, - {0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010046, 0x00010046, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x00020040, 0x00020040, 0x00020040, 0x00020040, }, - {0x00020047, 0x00020047, 0x00020047, 0x00020047, 0x00020048, 0x00020048, 0x00020048, 0x00020048, 0x00020049, 0x00020049, 0x00020049, 0x00020049, 0x0002004a, 0x0002004a, 0x0002004a, 0x0002004a, }, - {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0001003c, 0x0001003c, 0x0001003d, 0x0001003d, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010041, 0x00010041, 0x00010042, 0x00010042, }, +const uint32_t c_aauiCQMFHuffDec58[17][16] = { + { + 0x0005ffff, + 0x0004ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00000000, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00000007, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + 0x00010003, + 0x00010003, + }, + { + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + }, + { + 0x0008ffff, + 0x0006ffff, + 0x0007ffff, + 0x00000017, + 0x00000018, + 0x00000019, + 0x0000001a, + 0x0000001b, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + }, + { + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020020, + 0x00020021, + 0x00020021, + 0x00020021, + 0x00020021, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + 0x0003001c, + }, + { + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001d, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + 0x0003001e, + }, + { + 0x000cffff, + 0x000bffff, + 0x0009ffff, + 0x000affff, + 0x00000024, + 0x00000025, + 0x00000026, + 0x00000027, + 0x00010022, + 0x00010022, + 0x00010023, + 0x00010023, + 0x0002001f, + 0x0002001f, + 0x0002001f, + 0x0002001f, + }, + { + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + }, + { + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002d, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + }, + { + 0x0010ffff, + 0x000effff, + 0x000fffff, + 0x000dffff, + 0x00000033, + 0x00000035, + 0x00000036, + 0x00000037, + 0x00010030, + 0x00010030, + 0x00010031, + 0x00010031, + 0x00010032, + 0x00010032, + 0x00010034, + 0x00010034, + }, + { + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + }, + { + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010046, + 0x00010046, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + }, + { + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020047, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020048, + 0x00020049, + 0x00020049, + 0x00020049, + 0x00020049, + 0x0002004a, + 0x0002004a, + 0x0002004a, + 0x0002004a, + }, + { + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0001003c, + 0x0001003c, + 0x0001003d, + 0x0001003d, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + }, }; #endif #ifndef ROM_TO_RAM @@ -3880,44 +40460,462 @@ const uint32_t c_aauiCQMFHuffEnc59[91][2] = #else const uint16_t c_aauiCQMFHuffEnc59[91][2] = #endif -{ - {0x0003, 0x0005}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0006}, {0x0004, 0x0007}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0006}, - {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0006, 0x0006}, {0x0006, 0x0007}, {0x0006, 0x0008}, - {0x0006, 0x0009}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0007, 0x0005}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, - {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0008, 0x0003}, {0x0008, 0x0004}, {0x0008, 0x0005}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, - {0x0008, 0x0009}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, - {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000d, 0x0003}, - {0x000d, 0x0004}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000e, 0x0003}, {0x000e, 0x0004}, {0x000e, 0x0005}, {0x000f, 0x0003}, - {0x000f, 0x0004}, {0x000f, 0x0005}, {0x0011, 0x0008}, {0x0011, 0x0009}, {0x0013, 0x0000}, {0x0011, 0x000a}, {0x0013, 0x0001}, {0x0013, 0x0002}, - {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, {0x0011, 0x000b}, {0x0013, 0x0006}, {0x0013, 0x0007}, - {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, {0x0013, 0x000e}, {0x0013, 0x000f}, - {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, - {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0012, 0x000f}, + { + { 0x0003, 0x0005 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0006 }, + { 0x0004, 0x0007 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x0006 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0006, 0x0006 }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0007, 0x0005 }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0008, 0x0003 }, + { 0x0008, 0x0004 }, + { 0x0008, 0x0005 }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000d, 0x0003 }, + { 0x000d, 0x0004 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000e, 0x0003 }, + { 0x000e, 0x0004 }, + { 0x000e, 0x0005 }, + { 0x000f, 0x0003 }, + { 0x000f, 0x0004 }, + { 0x000f, 0x0005 }, + { 0x0011, 0x0008 }, + { 0x0011, 0x0009 }, + { 0x0013, 0x0000 }, + { 0x0011, 0x000a }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0012, 0x000d }, + { 0x0012, 0x000e }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0011, 0x000b }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0012, 0x000f }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec59[20][16] = -{ - {0x0006ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00010000, 0x00010000, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x0009ffff, 0x0008ffff, 0x0007ffff, 0x0000001a, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00010013, 0x00010013, 0x00010014, 0x00010014, 0x00010015, 0x00010015, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00020023, 0x00020023, 0x00020023, 0x00020023, 0x00020024, 0x00020024, 0x00020024, 0x00020024, 0x00020025, 0x00020025, 0x00020025, 0x00020025, 0x00020026, 0x00020026, 0x00020026, 0x00020026, }, - {0x000dffff, 0x000affff, 0x000bffff, 0x000cffff, 0x0000002b, 0x0000002c, 0x0000002d, 0x0000002e, 0x00010027, 0x00010027, 0x00010028, 0x00010028, 0x00010029, 0x00010029, 0x0001002a, 0x0001002a, }, - {0x00020035, 0x00020035, 0x00020035, 0x00020035, 0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0010ffff, 0x000effff, 0x000fffff, 0x00010037, 0x00010037, 0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x0003003d, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x00010058, 0x00010058, 0x00010059, 0x00010059, 0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, - {0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, 0x0001003f, 0x0001003f, 0x00010042, 0x00010042, 0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010046, 0x00010046, 0x00010047, 0x00010047, }, - {0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, }, - {0x00010050, 0x00010050, 0x00010051, 0x00010051, 0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, }, +const uint32_t c_aauiCQMFHuffDec59[20][16] = { + { + 0x0006ffff, + 0x0004ffff, + 0x0005ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00000006, + 0x00010000, + 0x00010000, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + }, + { + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x0009ffff, + 0x0008ffff, + 0x0007ffff, + 0x0000001a, + 0x0000001b, + 0x0000001c, + 0x0000001d, + 0x0000001e, + 0x0000001f, + 0x00000020, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020023, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020024, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020025, + 0x00020026, + 0x00020026, + 0x00020026, + 0x00020026, + }, + { + 0x000dffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x0000002b, + 0x0000002c, + 0x0000002d, + 0x0000002e, + 0x00010027, + 0x00010027, + 0x00010028, + 0x00010028, + 0x00010029, + 0x00010029, + 0x0001002a, + 0x0001002a, + }, + { + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020035, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0010ffff, + 0x000effff, + 0x000fffff, + 0x00010037, + 0x00010037, + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + }, + { + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + }, + { + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x0003003d, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + }, + { + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + }, + { + 0x0001003c, + 0x0001003c, + 0x0001003e, + 0x0001003e, + 0x0001003f, + 0x0001003f, + 0x00010042, + 0x00010042, + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010046, + 0x00010046, + 0x00010047, + 0x00010047, + }, + { + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + }, + { + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + }, }; #endif #ifndef ROM_TO_RAM @@ -3925,50 +40923,552 @@ const uint32_t c_aauiCQMFHuffEnc60[109][2] = #else const uint16_t c_aauiCQMFHuffEnc60[109][2] = #endif -{ - {0x0004, 0x0007}, {0x0002, 0x0003}, {0x0003, 0x0005}, {0x0004, 0x0008}, {0x0004, 0x0009}, {0x0005, 0x0007}, {0x0005, 0x0008}, {0x0005, 0x0009}, - {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0006, 0x0007}, {0x0006, 0x0008}, {0x0006, 0x0009}, {0x0006, 0x000a}, - {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0007, 0x0006}, {0x0007, 0x0007}, {0x0007, 0x0008}, {0x0007, 0x0009}, {0x0007, 0x000a}, - {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0008, 0x0006}, {0x0008, 0x0007}, {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, - {0x0008, 0x000b}, {0x0009, 0x0004}, {0x0009, 0x0005}, {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, - {0x0009, 0x000b}, {0x000a, 0x0004}, {0x000a, 0x0005}, {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000b, 0x0004}, {0x000b, 0x0005}, {0x000b, 0x0006}, - {0x000b, 0x0007}, {0x000c, 0x0004}, {0x000c, 0x0005}, {0x000c, 0x0006}, {0x000d, 0x0005}, {0x000d, 0x0006}, {0x000d, 0x0007}, {0x000c, 0x0007}, - {0x000e, 0x0005}, {0x000e, 0x0006}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000f, 0x0005}, {0x000e, 0x0009}, {0x000f, 0x0006}, {0x0010, 0x0006}, - {0x000f, 0x0007}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x0010, 0x0007}, {0x0010, 0x0008}, {0x0010, 0x0009}, {0x0011, 0x000a}, {0x0013, 0x0000}, - {0x0011, 0x000b}, {0x0013, 0x0001}, {0x0013, 0x0002}, {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0013, 0x0003}, {0x0013, 0x0004}, {0x0013, 0x0005}, - {0x0013, 0x0006}, {0x0013, 0x0007}, {0x0013, 0x0008}, {0x0013, 0x0009}, {0x0013, 0x000a}, {0x0013, 0x000b}, {0x0013, 0x000c}, {0x0013, 0x000d}, - {0x0013, 0x000e}, {0x0013, 0x000f}, {0x0013, 0x0010}, {0x0013, 0x0011}, {0x0013, 0x0012}, {0x0013, 0x0013}, {0x0013, 0x0014}, {0x0013, 0x0015}, - {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, - {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0012, 0x0013}, + { + { 0x0004, 0x0007 }, + { 0x0002, 0x0003 }, + { 0x0003, 0x0005 }, + { 0x0004, 0x0008 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x0007 }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0006, 0x0007 }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0007, 0x0006 }, + { 0x0007, 0x0007 }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0009, 0x0004 }, + { 0x0009, 0x0005 }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000b, 0x0004 }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0004 }, + { 0x000c, 0x0005 }, + { 0x000c, 0x0006 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000c, 0x0007 }, + { 0x000e, 0x0005 }, + { 0x000e, 0x0006 }, + { 0x000e, 0x0007 }, + { 0x000e, 0x0008 }, + { 0x000f, 0x0005 }, + { 0x000e, 0x0009 }, + { 0x000f, 0x0006 }, + { 0x0010, 0x0006 }, + { 0x000f, 0x0007 }, + { 0x000f, 0x0008 }, + { 0x000f, 0x0009 }, + { 0x0010, 0x0007 }, + { 0x0010, 0x0008 }, + { 0x0010, 0x0009 }, + { 0x0011, 0x000a }, + { 0x0013, 0x0000 }, + { 0x0011, 0x000b }, + { 0x0013, 0x0001 }, + { 0x0013, 0x0002 }, + { 0x0012, 0x0011 }, + { 0x0012, 0x0012 }, + { 0x0013, 0x0003 }, + { 0x0013, 0x0004 }, + { 0x0013, 0x0005 }, + { 0x0013, 0x0006 }, + { 0x0013, 0x0007 }, + { 0x0013, 0x0008 }, + { 0x0013, 0x0009 }, + { 0x0013, 0x000a }, + { 0x0013, 0x000b }, + { 0x0013, 0x000c }, + { 0x0013, 0x000d }, + { 0x0013, 0x000e }, + { 0x0013, 0x000f }, + { 0x0013, 0x0010 }, + { 0x0013, 0x0011 }, + { 0x0013, 0x0012 }, + { 0x0013, 0x0013 }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0012, 0x0013 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec60[24][16] = -{ - {0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010002, 0x00010002, 0x00020001, 0x00020001, 0x00020001, 0x00020001, }, - {0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, }, - {0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, }, - {0x000dffff, 0x000cffff, 0x0008ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001b, 0x0000001c, 0x0000001d, 0x0000001e, 0x0000001f, 0x00000020, 0x00010013, 0x00010013, 0x00010014, 0x00010014, }, - {0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030021, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, 0x00030022, }, - {0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030023, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, 0x00030024, }, - {0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030025, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, 0x00030026, }, - {0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030027, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, }, - {0x00020029, 0x00020029, 0x00020029, 0x00020029, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002a, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002b, 0x0002002c, 0x0002002c, 0x0002002c, 0x0002002c, }, - {0x0011ffff, 0x0010ffff, 0x000fffff, 0x000effff, 0x00000031, 0x00000032, 0x00000033, 0x00000037, 0x0001002d, 0x0001002d, 0x0001002e, 0x0001002e, 0x0001002f, 0x0001002f, 0x00010030, 0x00010030, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00010041, 0x00010041, 0x00010042, 0x00010042, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, }, - {0x0014ffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0013ffff, 0x0012ffff, 0x0000003f, 0x00000043, 0x00000044, 0x00000045, 0x0001003c, 0x0001003c, 0x0001003e, 0x0001003e, 0x00010040, 0x00010040, }, - {0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030046, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, 0x00030048, }, - {0x0001006a, 0x0001006a, 0x0001006b, 0x0001006b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004b, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002004c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, - {0x00010047, 0x00010047, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004d, 0x0001004d, 0x0001004e, 0x0001004e, 0x0001004f, 0x0001004f, 0x00010050, 0x00010050, 0x00010051, 0x00010051, }, - {0x00010052, 0x00010052, 0x00010053, 0x00010053, 0x00010054, 0x00010054, 0x00010055, 0x00010055, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, 0x00010059, 0x00010059, }, - {0x0001005a, 0x0001005a, 0x0001005b, 0x0001005b, 0x0001005c, 0x0001005c, 0x0001005d, 0x0001005d, 0x0001005e, 0x0001005e, 0x0001005f, 0x0001005f, 0x00010060, 0x00010060, 0x00010061, 0x00010061, }, - {0x00010062, 0x00010062, 0x00010063, 0x00010063, 0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x00010069, 0x00010069, }, +const uint32_t c_aauiCQMFHuffDec60[24][16] = { + { + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x00000000, + 0x00000003, + 0x00000004, + 0x00010002, + 0x00010002, + 0x00020001, + 0x00020001, + 0x00020001, + 0x00020001, + }, + { + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + }, + { + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + }, + { + 0x000dffff, + 0x000cffff, + 0x0008ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x0000001b, + 0x0000001c, + 0x0000001d, + 0x0000001e, + 0x0000001f, + 0x00000020, + 0x00010013, + 0x00010013, + 0x00010014, + 0x00010014, + }, + { + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030021, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + 0x00030022, + }, + { + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030023, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + 0x00030024, + }, + { + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030025, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + 0x00030026, + }, + { + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030027, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + }, + { + 0x00020029, + 0x00020029, + 0x00020029, + 0x00020029, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002a, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002b, + 0x0002002c, + 0x0002002c, + 0x0002002c, + 0x0002002c, + }, + { + 0x0011ffff, + 0x0010ffff, + 0x000fffff, + 0x000effff, + 0x00000031, + 0x00000032, + 0x00000033, + 0x00000037, + 0x0001002d, + 0x0001002d, + 0x0001002e, + 0x0001002e, + 0x0001002f, + 0x0001002f, + 0x00010030, + 0x00010030, + }, + { + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + }, + { + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + }, + { + 0x00010041, + 0x00010041, + 0x00010042, + 0x00010042, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + }, + { + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0013ffff, + 0x0012ffff, + 0x0000003f, + 0x00000043, + 0x00000044, + 0x00000045, + 0x0001003c, + 0x0001003c, + 0x0001003e, + 0x0001003e, + 0x00010040, + 0x00010040, + }, + { + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030046, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + 0x00030048, + }, + { + 0x0001006a, + 0x0001006a, + 0x0001006b, + 0x0001006b, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004b, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002004c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + }, + { + 0x00010047, + 0x00010047, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004d, + 0x0001004d, + 0x0001004e, + 0x0001004e, + 0x0001004f, + 0x0001004f, + 0x00010050, + 0x00010050, + 0x00010051, + 0x00010051, + }, + { + 0x00010052, + 0x00010052, + 0x00010053, + 0x00010053, + 0x00010054, + 0x00010054, + 0x00010055, + 0x00010055, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + 0x00010059, + 0x00010059, + }, + { + 0x0001005a, + 0x0001005a, + 0x0001005b, + 0x0001005b, + 0x0001005c, + 0x0001005c, + 0x0001005d, + 0x0001005d, + 0x0001005e, + 0x0001005e, + 0x0001005f, + 0x0001005f, + 0x00010060, + 0x00010060, + 0x00010061, + 0x00010061, + }, + { + 0x00010062, + 0x00010062, + 0x00010063, + 0x00010063, + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x00010069, + 0x00010069, + }, }; #endif #ifndef ROM_TO_RAM @@ -3976,62 +41476,734 @@ const uint32_t c_aauiCQMFHuffEnc61[129][2] = #else const uint16_t c_aauiCQMFHuffEnc61[129][2] = #endif -{ - {0x0004, 0x0008}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x0009}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x0008}, {0x0005, 0x0009}, - {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0006, 0x0008}, {0x0006, 0x0009}, - {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0007, 0x0008}, {0x0007, 0x0009}, - {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0008, 0x0006}, {0x0008, 0x0007}, - {0x0008, 0x0008}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, - {0x0009, 0x0006}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x000a, 0x0005}, {0x000a, 0x0006}, - {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000b, 0x0005}, {0x000b, 0x0006}, {0x000b, 0x0007}, - {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000c, 0x0006}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000d, 0x0005}, {0x000d, 0x0006}, - {0x000d, 0x0007}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000e, 0x0008}, {0x000d, 0x000b}, {0x000e, 0x0009}, {0x000f, 0x0009}, - {0x000f, 0x000a}, {0x000f, 0x000b}, {0x000f, 0x000c}, {0x000f, 0x000d}, {0x000f, 0x000e}, {0x0010, 0x000c}, {0x0011, 0x0015}, {0x0010, 0x000d}, - {0x000f, 0x000f}, {0x0010, 0x000e}, {0x0010, 0x000f}, {0x0012, 0x0000}, {0x0011, 0x0016}, {0x0010, 0x0010}, {0x0010, 0x0011}, {0x0011, 0x0017}, - {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, - {0x0012, 0x0009}, {0x0012, 0x000a}, {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, - {0x0012, 0x0011}, {0x0012, 0x0012}, {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, - {0x0012, 0x0019}, {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, - {0x0012, 0x0021}, {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, - {0x0012, 0x0029}, + { + { 0x0004, 0x0008 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x0009 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0005, 0x0008 }, + { 0x0005, 0x0009 }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0006, 0x0008 }, + { 0x0006, 0x0009 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0007, 0x0008 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0008, 0x0006 }, + { 0x0008, 0x0007 }, + { 0x0008, 0x0008 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0009, 0x0006 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000b, 0x0005 }, + { 0x000b, 0x0006 }, + { 0x000b, 0x0007 }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000c, 0x0006 }, + { 0x000c, 0x0007 }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000d, 0x0005 }, + { 0x000d, 0x0006 }, + { 0x000d, 0x0007 }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000e, 0x0008 }, + { 0x000d, 0x000b }, + { 0x000e, 0x0009 }, + { 0x000f, 0x0009 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x000f, 0x000c }, + { 0x000f, 0x000d }, + { 0x000f, 0x000e }, + { 0x0010, 0x000c }, + { 0x0011, 0x0015 }, + { 0x0010, 0x000d }, + { 0x000f, 0x000f }, + { 0x0010, 0x000e }, + { 0x0010, 0x000f }, + { 0x0012, 0x0000 }, + { 0x0011, 0x0016 }, + { 0x0010, 0x0010 }, + { 0x0010, 0x0011 }, + { 0x0011, 0x0017 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, + { 0x0012, 0x000e }, + { 0x0012, 0x000f }, + { 0x0012, 0x0010 }, + { 0x0012, 0x0011 }, + { 0x0012, 0x0012 }, + { 0x0012, 0x0013 }, + { 0x0012, 0x0014 }, + { 0x0012, 0x0015 }, + { 0x0012, 0x0016 }, + { 0x0012, 0x0017 }, + { 0x0012, 0x0018 }, + { 0x0012, 0x0019 }, + { 0x0012, 0x001a }, + { 0x0012, 0x001b }, + { 0x0012, 0x001c }, + { 0x0012, 0x001d }, + { 0x0012, 0x001e }, + { 0x0012, 0x001f }, + { 0x0012, 0x0020 }, + { 0x0012, 0x0021 }, + { 0x0012, 0x0022 }, + { 0x0012, 0x0023 }, + { 0x0012, 0x0024 }, + { 0x0012, 0x0025 }, + { 0x0012, 0x0026 }, + { 0x0012, 0x0027 }, + { 0x0012, 0x0028 }, + { 0x0012, 0x0029 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec61[33][16] = -{ - {0x0008ffff, 0x0007ffff, 0x0005ffff, 0x0006ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00000005, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, }, - {0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, }, - {0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, 0x0003000d, }, - {0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, }, - {0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, }, - {0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, }, - {0x000effff, 0x000cffff, 0x000dffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x0000001e, 0x0000001f, 0x00000020, 0x00000021, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, }, - {0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030028, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, 0x00030029, }, - {0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002a, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x00010038, 0x00010038, 0x00010039, 0x00010039, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002e, 0x0002002f, 0x0002002f, 0x0002002f, 0x0002002f, 0x00020030, 0x00020030, 0x00020030, 0x00020030, }, - {0x00020031, 0x00020031, 0x00020031, 0x00020031, 0x00020032, 0x00020032, 0x00020032, 0x00020032, 0x00020033, 0x00020033, 0x00020033, 0x00020033, 0x00020034, 0x00020034, 0x00020034, 0x00020034, }, - {0x0014ffff, 0x0013ffff, 0x000fffff, 0x0010ffff, 0x0011ffff, 0x0012ffff, 0x0000003a, 0x0000003b, 0x0000003c, 0x0000003d, 0x00010035, 0x00010035, 0x00010036, 0x00010036, 0x00010037, 0x00010037, }, - {0x00020044, 0x00020044, 0x00020044, 0x00020044, 0x00020046, 0x00020046, 0x00020046, 0x00020046, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, 0x0003003e, }, - {0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x0003003f, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, 0x00030040, }, - {0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030041, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, 0x00030042, }, - {0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030043, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, 0x00030045, }, - {0x00000055, 0x00000056, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x0001004a, 0x0001004a, 0x0001004b, 0x0001004b, 0x0001004c, 0x0001004c, 0x00010050, 0x00010050, }, - {0x0017ffff, 0x0018ffff, 0x0019ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0016ffff, 0x0015ffff, 0x0000004d, 0x0000004f, 0x00000051, 0x00000052, }, - {0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, }, - {0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, }, - {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020058, 0x00020058, 0x00020058, 0x00020058, 0x00020059, 0x00020059, 0x00020059, 0x00020059, 0x0002005a, 0x0002005a, 0x0002005a, 0x0002005a, }, - {0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, }, - {0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, 0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, }, - {0x00020063, 0x00020063, 0x00020063, 0x00020063, 0x00020064, 0x00020064, 0x00020064, 0x00020064, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, }, - {0x00020067, 0x00020067, 0x00020067, 0x00020067, 0x00020068, 0x00020068, 0x00020068, 0x00020068, 0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, }, - {0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, }, - {0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, 0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, }, - {0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, }, - {0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, - {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, }, +const uint32_t c_aauiCQMFHuffDec61[33][16] = { + { + 0x0008ffff, + 0x0007ffff, + 0x0005ffff, + 0x0006ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x00000000, + 0x00000003, + 0x00000004, + 0x00000005, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + }, + { + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + }, + { + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + 0x0003000d, + }, + { + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + }, + { + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + }, + { + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + }, + { + 0x000effff, + 0x000cffff, + 0x000dffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x0000001e, + 0x0000001f, + 0x00000020, + 0x00000021, + 0x00000022, + 0x00000023, + 0x00000024, + 0x00000025, + 0x00000026, + 0x00000027, + }, + { + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030028, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + 0x00030029, + }, + { + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002a, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, + { + 0x00010038, + 0x00010038, + 0x00010039, + 0x00010039, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002e, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x0002002f, + 0x00020030, + 0x00020030, + 0x00020030, + 0x00020030, + }, + { + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020031, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020032, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020033, + 0x00020034, + 0x00020034, + 0x00020034, + 0x00020034, + }, + { + 0x0014ffff, + 0x0013ffff, + 0x000fffff, + 0x0010ffff, + 0x0011ffff, + 0x0012ffff, + 0x0000003a, + 0x0000003b, + 0x0000003c, + 0x0000003d, + 0x00010035, + 0x00010035, + 0x00010036, + 0x00010036, + 0x00010037, + 0x00010037, + }, + { + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020044, + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020046, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + 0x0003003e, + }, + { + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x0003003f, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + 0x00030040, + }, + { + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030041, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + 0x00030042, + }, + { + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030043, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + 0x00030045, + }, + { + 0x00000055, + 0x00000056, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x0001004a, + 0x0001004a, + 0x0001004b, + 0x0001004b, + 0x0001004c, + 0x0001004c, + 0x00010050, + 0x00010050, + }, + { + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0016ffff, + 0x0015ffff, + 0x0000004d, + 0x0000004f, + 0x00000051, + 0x00000052, + }, + { + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + }, + { + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + }, + { + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020058, + 0x00020059, + 0x00020059, + 0x00020059, + 0x00020059, + 0x0002005a, + 0x0002005a, + 0x0002005a, + 0x0002005a, + }, + { + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + }, + { + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + }, + { + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020064, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + }, + { + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020068, + 0x00020068, + 0x00020068, + 0x00020068, + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006a, + }, + { + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + }, + { + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020072, + }, + { + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + }, + { + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + }, + { + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + }, }; #endif #ifndef ROM_TO_RAM @@ -4039,73 +42211,902 @@ const uint32_t c_aauiCQMFHuffEnc62[153][2] = #else const uint16_t c_aauiCQMFHuffEnc62[153][2] = #endif -{ - {0x0004, 0x0009}, {0x0003, 0x0006}, {0x0003, 0x0007}, {0x0004, 0x000a}, {0x0004, 0x000b}, {0x0005, 0x000a}, {0x0005, 0x000b}, {0x0005, 0x000c}, - {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, {0x0005, 0x0010}, {0x0005, 0x0011}, {0x0006, 0x000a}, {0x0006, 0x000b}, {0x0006, 0x000c}, - {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, {0x0007, 0x0009}, - {0x0007, 0x000a}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, - {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0008, 0x0009}, {0x0008, 0x000a}, {0x0008, 0x000b}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, - {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0009, 0x0007}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, - {0x0009, 0x000c}, {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x000a, 0x0004}, {0x000a, 0x0005}, - {0x000a, 0x0006}, {0x000a, 0x0007}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, {0x000a, 0x000c}, {0x000a, 0x000d}, - {0x000b, 0x0007}, {0x000c, 0x0007}, {0x000c, 0x0008}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000d, 0x0007}, - {0x000c, 0x000d}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000e, 0x0008}, {0x000d, 0x000c}, {0x000d, 0x000d}, - {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, {0x000e, 0x000c}, {0x000f, 0x000c}, {0x000e, 0x000d}, {0x000f, 0x000d}, {0x000f, 0x000e}, - {0x000f, 0x000f}, {0x0010, 0x000f}, {0x0010, 0x0010}, {0x0011, 0x0019}, {0x0010, 0x0011}, {0x0010, 0x0012}, {0x0010, 0x0013}, {0x0010, 0x0014}, - {0x0010, 0x0015}, {0x0012, 0x0000}, {0x0010, 0x0016}, {0x0011, 0x001a}, {0x0010, 0x0017}, {0x0012, 0x0001}, {0x0012, 0x0002}, {0x0012, 0x0003}, - {0x0011, 0x001b}, {0x0012, 0x0004}, {0x0012, 0x0005}, {0x0012, 0x0006}, {0x0012, 0x0007}, {0x0012, 0x0008}, {0x0012, 0x0009}, {0x0012, 0x000a}, - {0x0012, 0x000b}, {0x0012, 0x000c}, {0x0012, 0x000d}, {0x0012, 0x000e}, {0x0012, 0x000f}, {0x0012, 0x0010}, {0x0012, 0x0011}, {0x0012, 0x0012}, - {0x0012, 0x0013}, {0x0012, 0x0014}, {0x0012, 0x0015}, {0x0012, 0x0016}, {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0011, 0x001c}, {0x0012, 0x0019}, - {0x0012, 0x001a}, {0x0012, 0x001b}, {0x0012, 0x001c}, {0x0012, 0x001d}, {0x0012, 0x001e}, {0x0012, 0x001f}, {0x0012, 0x0020}, {0x0012, 0x0021}, - {0x0012, 0x0022}, {0x0012, 0x0023}, {0x0012, 0x0024}, {0x0012, 0x0025}, {0x0012, 0x0026}, {0x0012, 0x0027}, {0x0012, 0x0028}, {0x0012, 0x0029}, - {0x0012, 0x002a}, {0x0012, 0x002b}, {0x0012, 0x002c}, {0x0012, 0x002d}, {0x0012, 0x002e}, {0x0012, 0x002f}, {0x0012, 0x0030}, {0x0012, 0x0031}, - {0x0011, 0x001d}, + { + { 0x0004, 0x0009 }, + { 0x0003, 0x0006 }, + { 0x0003, 0x0007 }, + { 0x0004, 0x000a }, + { 0x0004, 0x000b }, + { 0x0005, 0x000a }, + { 0x0005, 0x000b }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0005, 0x0010 }, + { 0x0005, 0x0011 }, + { 0x0006, 0x000a }, + { 0x0006, 0x000b }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0007, 0x0009 }, + { 0x0007, 0x000a }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0007, 0x0012 }, + { 0x0007, 0x0013 }, + { 0x0008, 0x0009 }, + { 0x0008, 0x000a }, + { 0x0008, 0x000b }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0008, 0x0010 }, + { 0x0008, 0x0011 }, + { 0x0009, 0x0007 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x0009, 0x000c }, + { 0x0009, 0x000d }, + { 0x0009, 0x000e }, + { 0x0009, 0x000f }, + { 0x0009, 0x0010 }, + { 0x0009, 0x0011 }, + { 0x000a, 0x0004 }, + { 0x000a, 0x0005 }, + { 0x000a, 0x0006 }, + { 0x000a, 0x0007 }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000b, 0x0007 }, + { 0x000c, 0x0007 }, + { 0x000c, 0x0008 }, + { 0x000c, 0x0009 }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000c, 0x000c }, + { 0x000d, 0x0007 }, + { 0x000c, 0x000d }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000e, 0x0008 }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, + { 0x000e, 0x0009 }, + { 0x000e, 0x000a }, + { 0x000e, 0x000b }, + { 0x000e, 0x000c }, + { 0x000f, 0x000c }, + { 0x000e, 0x000d }, + { 0x000f, 0x000d }, + { 0x000f, 0x000e }, + { 0x000f, 0x000f }, + { 0x0010, 0x000f }, + { 0x0010, 0x0010 }, + { 0x0011, 0x0019 }, + { 0x0010, 0x0011 }, + { 0x0010, 0x0012 }, + { 0x0010, 0x0013 }, + { 0x0010, 0x0014 }, + { 0x0010, 0x0015 }, + { 0x0012, 0x0000 }, + { 0x0010, 0x0016 }, + { 0x0011, 0x001a }, + { 0x0010, 0x0017 }, + { 0x0012, 0x0001 }, + { 0x0012, 0x0002 }, + { 0x0012, 0x0003 }, + { 0x0011, 0x001b }, + { 0x0012, 0x0004 }, + { 0x0012, 0x0005 }, + { 0x0012, 0x0006 }, + { 0x0012, 0x0007 }, + { 0x0012, 0x0008 }, + { 0x0012, 0x0009 }, + { 0x0012, 0x000a }, + { 0x0012, 0x000b }, + { 0x0012, 0x000c }, + { 0x0012, 0x000d }, + { 0x0012, 0x000e }, + { 0x0012, 0x000f }, + { 0x0012, 0x0010 }, + { 0x0012, 0x0011 }, + { 0x0012, 0x0012 }, + { 0x0012, 0x0013 }, + { 0x0012, 0x0014 }, + { 0x0012, 0x0015 }, + { 0x0012, 0x0016 }, + { 0x0012, 0x0017 }, + { 0x0012, 0x0018 }, + { 0x0011, 0x001c }, + { 0x0012, 0x0019 }, + { 0x0012, 0x001a }, + { 0x0012, 0x001b }, + { 0x0012, 0x001c }, + { 0x0012, 0x001d }, + { 0x0012, 0x001e }, + { 0x0012, 0x001f }, + { 0x0012, 0x0020 }, + { 0x0012, 0x0021 }, + { 0x0012, 0x0022 }, + { 0x0012, 0x0023 }, + { 0x0012, 0x0024 }, + { 0x0012, 0x0025 }, + { 0x0012, 0x0026 }, + { 0x0012, 0x0027 }, + { 0x0012, 0x0028 }, + { 0x0012, 0x0029 }, + { 0x0012, 0x002a }, + { 0x0012, 0x002b }, + { 0x0012, 0x002c }, + { 0x0012, 0x002d }, + { 0x0012, 0x002e }, + { 0x0012, 0x002f }, + { 0x0012, 0x0030 }, + { 0x0012, 0x0031 }, + { 0x0011, 0x001d }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec62[41][16] = -{ - {0x0009ffff, 0x0008ffff, 0x0005ffff, 0x0006ffff, 0x0007ffff, 0x0001ffff, 0x0002ffff, 0x0003ffff, 0x0004ffff, 0x00000000, 0x00000003, 0x00000004, 0x00010001, 0x00010001, 0x00010002, 0x00010002, }, - {0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, }, - {0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, 0x00030008, }, - {0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x00030009, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, 0x0003000a, }, - {0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000b, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, 0x0003000c, }, - {0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, 0x00010021, 0x00010021, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, }, - {0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, 0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, }, - {0x00020013, 0x00020013, 0x00020013, 0x00020013, 0x00020014, 0x00020014, 0x00020014, 0x00020014, 0x00020015, 0x00020015, 0x00020015, 0x00020015, 0x00020016, 0x00020016, 0x00020016, 0x00020016, }, - {0x00000029, 0x0000002a, 0x00010017, 0x00010017, 0x00010018, 0x00010018, 0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, }, - {0x0012ffff, 0x0010ffff, 0x0011ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000026, 0x00000027, 0x00000028, }, - {0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, }, - {0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, }, - {0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, }, - {0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, }, - {0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, }, - {0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, }, - {0x00020036, 0x00020036, 0x00020036, 0x00020036, 0x00020037, 0x00020037, 0x00020037, 0x00020037, 0x00020038, 0x00020038, 0x00020038, 0x00020038, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x0002003a, 0x0002003a, 0x0002003a, 0x0002003a, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003b, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, }, - {0x0019ffff, 0x0018ffff, 0x0017ffff, 0x0013ffff, 0x0014ffff, 0x0015ffff, 0x0016ffff, 0x00000041, 0x00000042, 0x00000043, 0x00000044, 0x00000045, 0x00000046, 0x00000048, 0x00010040, 0x00010040, }, - {0x00020053, 0x00020053, 0x00020053, 0x00020053, 0x00020055, 0x00020055, 0x00020055, 0x00020055, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, 0x00030047, }, - {0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x00030049, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, 0x0003004a, }, - {0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004b, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, 0x0003004c, }, - {0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004e, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, 0x0003004f, }, - {0x0002004d, 0x0002004d, 0x0002004d, 0x0002004d, 0x00020050, 0x00020050, 0x00020050, 0x00020050, 0x00020051, 0x00020051, 0x00020051, 0x00020051, 0x00020052, 0x00020052, 0x00020052, 0x00020052, }, - {0x0000005a, 0x0000005c, 0x0000005d, 0x0000005e, 0x0000005f, 0x00000060, 0x00000062, 0x00000064, 0x00010054, 0x00010054, 0x00010056, 0x00010056, 0x00010057, 0x00010057, 0x00010058, 0x00010058, }, - {0x001dffff, 0x001effff, 0x001fffff, 0x0020ffff, 0x0021ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0025ffff, 0x0026ffff, 0x0027ffff, 0x0028ffff, 0x001affff, 0x001bffff, 0x001cffff, 0x00000059, }, - {0x00020096, 0x00020096, 0x00020096, 0x00020096, 0x00020097, 0x00020097, 0x00020097, 0x00020097, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, 0x0003005b, }, - {0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030063, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, 0x00030068, }, - {0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x0003007e, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, 0x00030098, }, - {0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020065, 0x00020065, 0x00020065, 0x00020065, 0x00020066, 0x00020066, 0x00020066, 0x00020066, 0x00020067, 0x00020067, 0x00020067, 0x00020067, }, - {0x00020069, 0x00020069, 0x00020069, 0x00020069, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006a, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006b, 0x0002006c, 0x0002006c, 0x0002006c, 0x0002006c, }, - {0x0002006d, 0x0002006d, 0x0002006d, 0x0002006d, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006e, 0x0002006f, 0x0002006f, 0x0002006f, 0x0002006f, 0x00020070, 0x00020070, 0x00020070, 0x00020070, }, - {0x00020071, 0x00020071, 0x00020071, 0x00020071, 0x00020072, 0x00020072, 0x00020072, 0x00020072, 0x00020073, 0x00020073, 0x00020073, 0x00020073, 0x00020074, 0x00020074, 0x00020074, 0x00020074, }, - {0x00020075, 0x00020075, 0x00020075, 0x00020075, 0x00020076, 0x00020076, 0x00020076, 0x00020076, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, }, - {0x00020079, 0x00020079, 0x00020079, 0x00020079, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, }, - {0x0002007d, 0x0002007d, 0x0002007d, 0x0002007d, 0x0002007f, 0x0002007f, 0x0002007f, 0x0002007f, 0x00020080, 0x00020080, 0x00020080, 0x00020080, 0x00020081, 0x00020081, 0x00020081, 0x00020081, }, - {0x00020082, 0x00020082, 0x00020082, 0x00020082, 0x00020083, 0x00020083, 0x00020083, 0x00020083, 0x00020084, 0x00020084, 0x00020084, 0x00020084, 0x00020085, 0x00020085, 0x00020085, 0x00020085, }, - {0x00020086, 0x00020086, 0x00020086, 0x00020086, 0x00020087, 0x00020087, 0x00020087, 0x00020087, 0x00020088, 0x00020088, 0x00020088, 0x00020088, 0x00020089, 0x00020089, 0x00020089, 0x00020089, }, - {0x0002008a, 0x0002008a, 0x0002008a, 0x0002008a, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008b, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008c, 0x0002008d, 0x0002008d, 0x0002008d, 0x0002008d, }, - {0x0002008e, 0x0002008e, 0x0002008e, 0x0002008e, 0x0002008f, 0x0002008f, 0x0002008f, 0x0002008f, 0x00020090, 0x00020090, 0x00020090, 0x00020090, 0x00020091, 0x00020091, 0x00020091, 0x00020091, }, - {0x00020092, 0x00020092, 0x00020092, 0x00020092, 0x00020093, 0x00020093, 0x00020093, 0x00020093, 0x00020094, 0x00020094, 0x00020094, 0x00020094, 0x00020095, 0x00020095, 0x00020095, 0x00020095, }, +const uint32_t c_aauiCQMFHuffDec62[41][16] = { + { + 0x0009ffff, + 0x0008ffff, + 0x0005ffff, + 0x0006ffff, + 0x0007ffff, + 0x0001ffff, + 0x0002ffff, + 0x0003ffff, + 0x0004ffff, + 0x00000000, + 0x00000003, + 0x00000004, + 0x00010001, + 0x00010001, + 0x00010002, + 0x00010002, + }, + { + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + }, + { + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + 0x00030008, + }, + { + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x00030009, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + 0x0003000a, + }, + { + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000b, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + 0x0003000c, + }, + { + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x00010020, + 0x00010020, + 0x00010021, + 0x00010021, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + }, + { + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + }, + { + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020014, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020015, + 0x00020016, + 0x00020016, + 0x00020016, + 0x00020016, + }, + { + 0x00000029, + 0x0000002a, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + }, + { + 0x0012ffff, + 0x0010ffff, + 0x0011ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x00000022, + 0x00000023, + 0x00000024, + 0x00000025, + 0x00000026, + 0x00000027, + 0x00000028, + }, + { + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + }, + { + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + }, + { + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + }, + { + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + }, + { + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + }, + { + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + }, + { + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020036, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020037, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020038, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003a, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003b, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + }, + { + 0x0019ffff, + 0x0018ffff, + 0x0017ffff, + 0x0013ffff, + 0x0014ffff, + 0x0015ffff, + 0x0016ffff, + 0x00000041, + 0x00000042, + 0x00000043, + 0x00000044, + 0x00000045, + 0x00000046, + 0x00000048, + 0x00010040, + 0x00010040, + }, + { + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020053, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00020055, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + 0x00030047, + }, + { + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x00030049, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + 0x0003004a, + }, + { + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004b, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + 0x0003004c, + }, + { + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004e, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + 0x0003004f, + }, + { + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x0002004d, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020050, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020051, + 0x00020052, + 0x00020052, + 0x00020052, + 0x00020052, + }, + { + 0x0000005a, + 0x0000005c, + 0x0000005d, + 0x0000005e, + 0x0000005f, + 0x00000060, + 0x00000062, + 0x00000064, + 0x00010054, + 0x00010054, + 0x00010056, + 0x00010056, + 0x00010057, + 0x00010057, + 0x00010058, + 0x00010058, + }, + { + 0x001dffff, + 0x001effff, + 0x001fffff, + 0x0020ffff, + 0x0021ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0025ffff, + 0x0026ffff, + 0x0027ffff, + 0x0028ffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x00000059, + }, + { + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020096, + 0x00020097, + 0x00020097, + 0x00020097, + 0x00020097, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + 0x0003005b, + }, + { + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030063, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + 0x00030068, + }, + { + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x0003007e, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + 0x00030098, + }, + { + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020065, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020066, + 0x00020067, + 0x00020067, + 0x00020067, + 0x00020067, + }, + { + 0x00020069, + 0x00020069, + 0x00020069, + 0x00020069, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006a, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006b, + 0x0002006c, + 0x0002006c, + 0x0002006c, + 0x0002006c, + }, + { + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006d, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006e, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x0002006f, + 0x00020070, + 0x00020070, + 0x00020070, + 0x00020070, + }, + { + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020071, + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020072, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020073, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + }, + { + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020075, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020076, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + }, + { + 0x00020079, + 0x00020079, + 0x00020079, + 0x00020079, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + }, + { + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007d, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x0002007f, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020081, + 0x00020081, + 0x00020081, + 0x00020081, + }, + { + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020082, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020083, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020084, + 0x00020085, + 0x00020085, + 0x00020085, + 0x00020085, + }, + { + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020086, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020087, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020088, + 0x00020089, + 0x00020089, + 0x00020089, + 0x00020089, + }, + { + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008a, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008b, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008c, + 0x0002008d, + 0x0002008d, + 0x0002008d, + 0x0002008d, + }, + { + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008e, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x0002008f, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020090, + 0x00020091, + 0x00020091, + 0x00020091, + 0x00020091, + }, + { + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020092, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020093, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020094, + 0x00020095, + 0x00020095, + 0x00020095, + 0x00020095, + }, }; #endif #ifndef ROM_TO_RAM @@ -4113,150 +43114,970 @@ const uint32_t c_aauiCQMFHuffEnc63[181][2] = #else const uint16_t c_aauiCQMFHuffEnc63[181][2] = #endif -{ - {0x0004, 0x0008}, {0x0003, 0x0005}, {0x0002, 0x0003}, {0x0004, 0x0009}, {0x0005, 0x000c}, {0x0005, 0x000d}, {0x0005, 0x000e}, {0x0005, 0x000f}, - {0x0006, 0x000c}, {0x0006, 0x000d}, {0x0006, 0x000e}, {0x0006, 0x000f}, {0x0006, 0x0010}, {0x0006, 0x0011}, {0x0006, 0x0012}, {0x0006, 0x0013}, - {0x0006, 0x0014}, {0x0006, 0x0015}, {0x0006, 0x0016}, {0x0006, 0x0017}, {0x0007, 0x000b}, {0x0007, 0x000c}, {0x0007, 0x000d}, {0x0007, 0x000e}, - {0x0007, 0x000f}, {0x0007, 0x0010}, {0x0007, 0x0011}, {0x0007, 0x0012}, {0x0007, 0x0013}, {0x0007, 0x0014}, {0x0007, 0x0015}, {0x0007, 0x0016}, - {0x0007, 0x0017}, {0x0008, 0x000c}, {0x0008, 0x000d}, {0x0008, 0x000e}, {0x0008, 0x000f}, {0x0008, 0x0010}, {0x0008, 0x0011}, {0x0008, 0x0012}, - {0x0008, 0x0013}, {0x0008, 0x0014}, {0x0008, 0x0015}, {0x0009, 0x0008}, {0x0009, 0x0009}, {0x0009, 0x000a}, {0x0009, 0x000b}, {0x0009, 0x000c}, - {0x0009, 0x000d}, {0x0009, 0x000e}, {0x0009, 0x000f}, {0x0009, 0x0010}, {0x0009, 0x0011}, {0x0009, 0x0012}, {0x0009, 0x0013}, {0x0009, 0x0014}, - {0x0009, 0x0015}, {0x000a, 0x0007}, {0x0009, 0x0016}, {0x0009, 0x0017}, {0x000a, 0x0008}, {0x000a, 0x0009}, {0x000a, 0x000a}, {0x000a, 0x000b}, - {0x000a, 0x000c}, {0x000a, 0x000d}, {0x000a, 0x000e}, {0x000b, 0x0008}, {0x000b, 0x0009}, {0x000b, 0x000a}, {0x000a, 0x000f}, {0x000b, 0x000b}, - {0x000b, 0x000c}, {0x000b, 0x000d}, {0x000c, 0x0009}, {0x000c, 0x000a}, {0x000c, 0x000b}, {0x000c, 0x000c}, {0x000c, 0x000d}, {0x000c, 0x000e}, - {0x000c, 0x000f}, {0x000d, 0x0008}, {0x000d, 0x0009}, {0x000d, 0x000a}, {0x000d, 0x000b}, {0x000d, 0x000c}, {0x000d, 0x000d}, {0x000d, 0x000e}, - {0x000d, 0x000f}, {0x000d, 0x0010}, {0x000d, 0x0011}, {0x000e, 0x0007}, {0x000e, 0x0008}, {0x000e, 0x0009}, {0x000e, 0x000a}, {0x000e, 0x000b}, - {0x000e, 0x000c}, {0x000e, 0x000d}, {0x000e, 0x000e}, {0x000e, 0x000f}, {0x000f, 0x0008}, {0x000f, 0x0009}, {0x000f, 0x000a}, {0x000f, 0x000b}, - {0x000f, 0x000c}, {0x0010, 0x0009}, {0x0010, 0x000a}, {0x000f, 0x000d}, {0x0010, 0x000b}, {0x0010, 0x000c}, {0x0010, 0x000d}, {0x0011, 0x000e}, - {0x0011, 0x000f}, {0x0010, 0x000e}, {0x0011, 0x0010}, {0x0011, 0x0011}, {0x0012, 0x0014}, {0x0014, 0x0000}, {0x0010, 0x000f}, {0x0012, 0x0015}, - {0x0012, 0x0016}, {0x0014, 0x0001}, {0x0012, 0x0017}, {0x0012, 0x0018}, {0x0012, 0x0019}, {0x0013, 0x0010}, {0x0012, 0x001a}, {0x0014, 0x0002}, - {0x0012, 0x001b}, {0x0014, 0x0003}, {0x0014, 0x0004}, {0x0014, 0x0005}, {0x0013, 0x0011}, {0x0014, 0x0006}, {0x0013, 0x0012}, {0x0014, 0x0007}, - {0x0014, 0x0008}, {0x0014, 0x0009}, {0x0014, 0x000a}, {0x0014, 0x000b}, {0x0014, 0x000c}, {0x0014, 0x000d}, {0x0014, 0x000e}, {0x0013, 0x0013}, - {0x0014, 0x000f}, {0x0014, 0x0010}, {0x0014, 0x0011}, {0x0014, 0x0012}, {0x0014, 0x0013}, {0x0014, 0x0014}, {0x0014, 0x0015}, {0x0014, 0x0016}, - {0x0014, 0x0017}, {0x0014, 0x0018}, {0x0014, 0x0019}, {0x0014, 0x001a}, {0x0014, 0x001b}, {0x0014, 0x001c}, {0x0014, 0x001d}, {0x0014, 0x001e}, - {0x0014, 0x001f}, {0x0013, 0x0014}, {0x0013, 0x0015}, {0x0013, 0x0016}, {0x0013, 0x0017}, {0x0013, 0x0018}, {0x0013, 0x0019}, {0x0013, 0x001a}, - {0x0013, 0x001b}, {0x0013, 0x001c}, {0x0013, 0x001d}, {0x0013, 0x001e}, {0x0013, 0x001f}, {0x0013, 0x0020}, {0x0013, 0x0021}, {0x0013, 0x0022}, - {0x0013, 0x0023}, {0x0013, 0x0024}, {0x0013, 0x0025}, {0x0013, 0x0026}, {0x0013, 0x0027}, + { + { 0x0004, 0x0008 }, + { 0x0003, 0x0005 }, + { 0x0002, 0x0003 }, + { 0x0004, 0x0009 }, + { 0x0005, 0x000c }, + { 0x0005, 0x000d }, + { 0x0005, 0x000e }, + { 0x0005, 0x000f }, + { 0x0006, 0x000c }, + { 0x0006, 0x000d }, + { 0x0006, 0x000e }, + { 0x0006, 0x000f }, + { 0x0006, 0x0010 }, + { 0x0006, 0x0011 }, + { 0x0006, 0x0012 }, + { 0x0006, 0x0013 }, + { 0x0006, 0x0014 }, + { 0x0006, 0x0015 }, + { 0x0006, 0x0016 }, + { 0x0006, 0x0017 }, + { 0x0007, 0x000b }, + { 0x0007, 0x000c }, + { 0x0007, 0x000d }, + { 0x0007, 0x000e }, + { 0x0007, 0x000f }, + { 0x0007, 0x0010 }, + { 0x0007, 0x0011 }, + { 0x0007, 0x0012 }, + { 0x0007, 0x0013 }, + { 0x0007, 0x0014 }, + { 0x0007, 0x0015 }, + { 0x0007, 0x0016 }, + { 0x0007, 0x0017 }, + { 0x0008, 0x000c }, + { 0x0008, 0x000d }, + { 0x0008, 0x000e }, + { 0x0008, 0x000f }, + { 0x0008, 0x0010 }, + { 0x0008, 0x0011 }, + { 0x0008, 0x0012 }, + { 0x0008, 0x0013 }, + { 0x0008, 0x0014 }, + { 0x0008, 0x0015 }, + { 0x0009, 0x0008 }, + { 0x0009, 0x0009 }, + { 0x0009, 0x000a }, + { 0x0009, 0x000b }, + { 0x0009, 0x000c }, + { 0x0009, 0x000d }, + { 0x0009, 0x000e }, + { 0x0009, 0x000f }, + { 0x0009, 0x0010 }, + { 0x0009, 0x0011 }, + { 0x0009, 0x0012 }, + { 0x0009, 0x0013 }, + { 0x0009, 0x0014 }, + { 0x0009, 0x0015 }, + { 0x000a, 0x0007 }, + { 0x0009, 0x0016 }, + { 0x0009, 0x0017 }, + { 0x000a, 0x0008 }, + { 0x000a, 0x0009 }, + { 0x000a, 0x000a }, + { 0x000a, 0x000b }, + { 0x000a, 0x000c }, + { 0x000a, 0x000d }, + { 0x000a, 0x000e }, + { 0x000b, 0x0008 }, + { 0x000b, 0x0009 }, + { 0x000b, 0x000a }, + { 0x000a, 0x000f }, + { 0x000b, 0x000b }, + { 0x000b, 0x000c }, + { 0x000b, 0x000d }, + { 0x000c, 0x0009 }, + { 0x000c, 0x000a }, + { 0x000c, 0x000b }, + { 0x000c, 0x000c }, + { 0x000c, 0x000d }, + { 0x000c, 0x000e }, + { 0x000c, 0x000f }, + { 0x000d, 0x0008 }, + { 0x000d, 0x0009 }, + { 0x000d, 0x000a }, + { 0x000d, 0x000b }, + { 0x000d, 0x000c }, + { 0x000d, 0x000d }, + { 0x000d, 0x000e }, + { 0x000d, 0x000f }, + { 0x000d, 0x0010 }, + { 0x000d, 0x0011 }, + { 0x000e, 0x0007 }, + { 0x000e, 0x0008 }, + { 0x000e, 0x0009 }, + { 0x000e, 0x000a }, + { 0x000e, 0x000b }, + { 0x000e, 0x000c }, + { 0x000e, 0x000d }, + { 0x000e, 0x000e }, + { 0x000e, 0x000f }, + { 0x000f, 0x0008 }, + { 0x000f, 0x0009 }, + { 0x000f, 0x000a }, + { 0x000f, 0x000b }, + { 0x000f, 0x000c }, + { 0x0010, 0x0009 }, + { 0x0010, 0x000a }, + { 0x000f, 0x000d }, + { 0x0010, 0x000b }, + { 0x0010, 0x000c }, + { 0x0010, 0x000d }, + { 0x0011, 0x000e }, + { 0x0011, 0x000f }, + { 0x0010, 0x000e }, + { 0x0011, 0x0010 }, + { 0x0011, 0x0011 }, + { 0x0012, 0x0014 }, + { 0x0014, 0x0000 }, + { 0x0010, 0x000f }, + { 0x0012, 0x0015 }, + { 0x0012, 0x0016 }, + { 0x0014, 0x0001 }, + { 0x0012, 0x0017 }, + { 0x0012, 0x0018 }, + { 0x0012, 0x0019 }, + { 0x0013, 0x0010 }, + { 0x0012, 0x001a }, + { 0x0014, 0x0002 }, + { 0x0012, 0x001b }, + { 0x0014, 0x0003 }, + { 0x0014, 0x0004 }, + { 0x0014, 0x0005 }, + { 0x0013, 0x0011 }, + { 0x0014, 0x0006 }, + { 0x0013, 0x0012 }, + { 0x0014, 0x0007 }, + { 0x0014, 0x0008 }, + { 0x0014, 0x0009 }, + { 0x0014, 0x000a }, + { 0x0014, 0x000b }, + { 0x0014, 0x000c }, + { 0x0014, 0x000d }, + { 0x0014, 0x000e }, + { 0x0013, 0x0013 }, + { 0x0014, 0x000f }, + { 0x0014, 0x0010 }, + { 0x0014, 0x0011 }, + { 0x0014, 0x0012 }, + { 0x0014, 0x0013 }, + { 0x0014, 0x0014 }, + { 0x0014, 0x0015 }, + { 0x0014, 0x0016 }, + { 0x0014, 0x0017 }, + { 0x0014, 0x0018 }, + { 0x0014, 0x0019 }, + { 0x0014, 0x001a }, + { 0x0014, 0x001b }, + { 0x0014, 0x001c }, + { 0x0014, 0x001d }, + { 0x0014, 0x001e }, + { 0x0014, 0x001f }, + { 0x0013, 0x0014 }, + { 0x0013, 0x0015 }, + { 0x0013, 0x0016 }, + { 0x0013, 0x0017 }, + { 0x0013, 0x0018 }, + { 0x0013, 0x0019 }, + { 0x0013, 0x001a }, + { 0x0013, 0x001b }, + { 0x0013, 0x001c }, + { 0x0013, 0x001d }, + { 0x0013, 0x001e }, + { 0x0013, 0x001f }, + { 0x0013, 0x0020 }, + { 0x0013, 0x0021 }, + { 0x0013, 0x0022 }, + { 0x0013, 0x0023 }, + { 0x0013, 0x0024 }, + { 0x0013, 0x0025 }, + { 0x0013, 0x0026 }, + { 0x0013, 0x0027 }, -}; + }; #ifndef ROM_TO_RAM -const uint32_t c_aauiCQMFHuffDec63[39][16] = -{ - {0x0008ffff, 0x0006ffff, 0x0007ffff, 0x0003ffff, 0x0004ffff, 0x0005ffff, 0x0001ffff, 0x0002ffff, 0x00000000, 0x00000003, 0x00010001, 0x00010001, 0x00020002, 0x00020002, 0x00020002, 0x00020002, }, - {0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030004, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, 0x00030005, }, - {0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030006, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, 0x00030007, }, - {0x00020008, 0x00020008, 0x00020008, 0x00020008, 0x00020009, 0x00020009, 0x00020009, 0x00020009, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000a, 0x0002000b, 0x0002000b, 0x0002000b, 0x0002000b, }, - {0x0002000c, 0x0002000c, 0x0002000c, 0x0002000c, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000d, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000e, 0x0002000f, 0x0002000f, 0x0002000f, 0x0002000f, }, - {0x00020010, 0x00020010, 0x00020010, 0x00020010, 0x00020011, 0x00020011, 0x00020011, 0x00020011, 0x00020012, 0x00020012, 0x00020012, 0x00020012, 0x00020013, 0x00020013, 0x00020013, 0x00020013, }, - {0x00000025, 0x00000026, 0x00000027, 0x00000028, 0x00000029, 0x0000002a, 0x00010014, 0x00010014, 0x00010015, 0x00010015, 0x00010016, 0x00010016, 0x00010017, 0x00010017, 0x00010018, 0x00010018, }, - {0x00010019, 0x00010019, 0x0001001a, 0x0001001a, 0x0001001b, 0x0001001b, 0x0001001c, 0x0001001c, 0x0001001d, 0x0001001d, 0x0001001e, 0x0001001e, 0x0001001f, 0x0001001f, 0x00010020, 0x00010020, }, - {0x0014ffff, 0x0011ffff, 0x0012ffff, 0x0013ffff, 0x0009ffff, 0x000affff, 0x000bffff, 0x000cffff, 0x000dffff, 0x000effff, 0x000fffff, 0x0010ffff, 0x00000021, 0x00000022, 0x00000023, 0x00000024, }, - {0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002b, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, 0x0003002c, }, - {0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002d, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, 0x0003002e, }, - {0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x0003002f, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, 0x00030030, }, - {0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030031, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, 0x00030032, }, - {0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030033, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, 0x00030034, }, - {0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030035, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, 0x00030036, }, - {0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030037, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, 0x00030038, }, - {0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003a, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, 0x0003003b, }, - {0x00010043, 0x00010043, 0x00010044, 0x00010044, 0x00010045, 0x00010045, 0x00010047, 0x00010047, 0x00010048, 0x00010048, 0x00010049, 0x00010049, 0x00020039, 0x00020039, 0x00020039, 0x00020039, }, - {0x0002003c, 0x0002003c, 0x0002003c, 0x0002003c, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003d, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003e, 0x0002003f, 0x0002003f, 0x0002003f, 0x0002003f, }, - {0x00020040, 0x00020040, 0x00020040, 0x00020040, 0x00020041, 0x00020041, 0x00020041, 0x00020041, 0x00020042, 0x00020042, 0x00020042, 0x00020042, 0x00020046, 0x00020046, 0x00020046, 0x00020046, }, - {0x001dffff, 0x001affff, 0x001bffff, 0x001cffff, 0x0015ffff, 0x0016ffff, 0x0017ffff, 0x0018ffff, 0x0019ffff, 0x0000004a, 0x0000004b, 0x0000004c, 0x0000004d, 0x0000004e, 0x0000004f, 0x00000050, }, - {0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030051, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, 0x00030052, }, - {0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030053, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, 0x00030054, }, - {0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030055, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, 0x00030056, }, - {0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030057, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, 0x00030058, }, - {0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x00030059, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, 0x0003005a, }, - {0x00010064, 0x00010064, 0x00010065, 0x00010065, 0x00010066, 0x00010066, 0x00010067, 0x00010067, 0x00010068, 0x00010068, 0x0001006b, 0x0001006b, 0x0002005b, 0x0002005b, 0x0002005b, 0x0002005b, }, - {0x0002005c, 0x0002005c, 0x0002005c, 0x0002005c, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005d, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005e, 0x0002005f, 0x0002005f, 0x0002005f, 0x0002005f, }, - {0x00020060, 0x00020060, 0x00020060, 0x00020060, 0x00020061, 0x00020061, 0x00020061, 0x00020061, 0x00020062, 0x00020062, 0x00020062, 0x00020062, 0x00020063, 0x00020063, 0x00020063, 0x00020063, }, - {0x0026ffff, 0x0025ffff, 0x0022ffff, 0x0023ffff, 0x0024ffff, 0x0020ffff, 0x0021ffff, 0x001effff, 0x001fffff, 0x00000069, 0x0000006a, 0x0000006c, 0x0000006d, 0x0000006e, 0x00000071, 0x00000076, }, - {0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x0003006f, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, 0x00030070, }, - {0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030072, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, 0x00030073, }, - {0x00020074, 0x00020074, 0x00020074, 0x00020074, 0x00020077, 0x00020077, 0x00020077, 0x00020077, 0x00020078, 0x00020078, 0x00020078, 0x00020078, 0x0002007a, 0x0002007a, 0x0002007a, 0x0002007a, }, - {0x0002007b, 0x0002007b, 0x0002007b, 0x0002007b, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007c, 0x0002007e, 0x0002007e, 0x0002007e, 0x0002007e, 0x00020080, 0x00020080, 0x00020080, 0x00020080, }, - {0x0001007d, 0x0001007d, 0x00010084, 0x00010084, 0x00010086, 0x00010086, 0x0001008f, 0x0001008f, 0x000100a1, 0x000100a1, 0x000100a2, 0x000100a2, 0x000100a3, 0x000100a3, 0x000100a4, 0x000100a4, }, - {0x000100a5, 0x000100a5, 0x000100a6, 0x000100a6, 0x000100a7, 0x000100a7, 0x000100a8, 0x000100a8, 0x000100a9, 0x000100a9, 0x000100aa, 0x000100aa, 0x000100ab, 0x000100ab, 0x000100ac, 0x000100ac, }, - {0x000100ad, 0x000100ad, 0x000100ae, 0x000100ae, 0x000100af, 0x000100af, 0x000100b0, 0x000100b0, 0x000100b1, 0x000100b1, 0x000100b2, 0x000100b2, 0x000100b3, 0x000100b3, 0x000100b4, 0x000100b4, }, - {0x00000091, 0x00000092, 0x00000093, 0x00000094, 0x00000095, 0x00000096, 0x00000097, 0x00000098, 0x00000099, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009d, 0x0000009e, 0x0000009f, 0x000000a0, }, - {0x00000075, 0x00000079, 0x0000007f, 0x00000081, 0x00000082, 0x00000083, 0x00000085, 0x00000087, 0x00000088, 0x00000089, 0x0000008a, 0x0000008b, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, }, +const uint32_t c_aauiCQMFHuffDec63[39][16] = { + { + 0x0008ffff, + 0x0006ffff, + 0x0007ffff, + 0x0003ffff, + 0x0004ffff, + 0x0005ffff, + 0x0001ffff, + 0x0002ffff, + 0x00000000, + 0x00000003, + 0x00010001, + 0x00010001, + 0x00020002, + 0x00020002, + 0x00020002, + 0x00020002, + }, + { + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030004, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + 0x00030005, + }, + { + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030006, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + 0x00030007, + }, + { + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020008, + 0x00020009, + 0x00020009, + 0x00020009, + 0x00020009, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000a, + 0x0002000b, + 0x0002000b, + 0x0002000b, + 0x0002000b, + }, + { + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000c, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000d, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000e, + 0x0002000f, + 0x0002000f, + 0x0002000f, + 0x0002000f, + }, + { + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020010, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020011, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020012, + 0x00020013, + 0x00020013, + 0x00020013, + 0x00020013, + }, + { + 0x00000025, + 0x00000026, + 0x00000027, + 0x00000028, + 0x00000029, + 0x0000002a, + 0x00010014, + 0x00010014, + 0x00010015, + 0x00010015, + 0x00010016, + 0x00010016, + 0x00010017, + 0x00010017, + 0x00010018, + 0x00010018, + }, + { + 0x00010019, + 0x00010019, + 0x0001001a, + 0x0001001a, + 0x0001001b, + 0x0001001b, + 0x0001001c, + 0x0001001c, + 0x0001001d, + 0x0001001d, + 0x0001001e, + 0x0001001e, + 0x0001001f, + 0x0001001f, + 0x00010020, + 0x00010020, + }, + { + 0x0014ffff, + 0x0011ffff, + 0x0012ffff, + 0x0013ffff, + 0x0009ffff, + 0x000affff, + 0x000bffff, + 0x000cffff, + 0x000dffff, + 0x000effff, + 0x000fffff, + 0x0010ffff, + 0x00000021, + 0x00000022, + 0x00000023, + 0x00000024, + }, + { + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002b, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + 0x0003002c, + }, + { + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002d, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + 0x0003002e, + }, + { + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x0003002f, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + 0x00030030, + }, + { + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030031, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + 0x00030032, + }, + { + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030033, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + 0x00030034, + }, + { + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030035, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + 0x00030036, + }, + { + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030037, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + 0x00030038, + }, + { + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003a, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + 0x0003003b, + }, + { + 0x00010043, + 0x00010043, + 0x00010044, + 0x00010044, + 0x00010045, + 0x00010045, + 0x00010047, + 0x00010047, + 0x00010048, + 0x00010048, + 0x00010049, + 0x00010049, + 0x00020039, + 0x00020039, + 0x00020039, + 0x00020039, + }, + { + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003c, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003d, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003e, + 0x0002003f, + 0x0002003f, + 0x0002003f, + 0x0002003f, + }, + { + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020040, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020041, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020042, + 0x00020046, + 0x00020046, + 0x00020046, + 0x00020046, + }, + { + 0x001dffff, + 0x001affff, + 0x001bffff, + 0x001cffff, + 0x0015ffff, + 0x0016ffff, + 0x0017ffff, + 0x0018ffff, + 0x0019ffff, + 0x0000004a, + 0x0000004b, + 0x0000004c, + 0x0000004d, + 0x0000004e, + 0x0000004f, + 0x00000050, + }, + { + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030051, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + 0x00030052, + }, + { + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030053, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + 0x00030054, + }, + { + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030055, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + 0x00030056, + }, + { + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030057, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + 0x00030058, + }, + { + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x00030059, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + 0x0003005a, + }, + { + 0x00010064, + 0x00010064, + 0x00010065, + 0x00010065, + 0x00010066, + 0x00010066, + 0x00010067, + 0x00010067, + 0x00010068, + 0x00010068, + 0x0001006b, + 0x0001006b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + 0x0002005b, + }, + { + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005c, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005d, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005e, + 0x0002005f, + 0x0002005f, + 0x0002005f, + 0x0002005f, + }, + { + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020060, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020061, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020062, + 0x00020063, + 0x00020063, + 0x00020063, + 0x00020063, + }, + { + 0x0026ffff, + 0x0025ffff, + 0x0022ffff, + 0x0023ffff, + 0x0024ffff, + 0x0020ffff, + 0x0021ffff, + 0x001effff, + 0x001fffff, + 0x00000069, + 0x0000006a, + 0x0000006c, + 0x0000006d, + 0x0000006e, + 0x00000071, + 0x00000076, + }, + { + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x0003006f, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + 0x00030070, + }, + { + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030072, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + 0x00030073, + }, + { + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020074, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020077, + 0x00020078, + 0x00020078, + 0x00020078, + 0x00020078, + 0x0002007a, + 0x0002007a, + 0x0002007a, + 0x0002007a, + }, + { + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007b, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007c, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x0002007e, + 0x00020080, + 0x00020080, + 0x00020080, + 0x00020080, + }, + { + 0x0001007d, + 0x0001007d, + 0x00010084, + 0x00010084, + 0x00010086, + 0x00010086, + 0x0001008f, + 0x0001008f, + 0x000100a1, + 0x000100a1, + 0x000100a2, + 0x000100a2, + 0x000100a3, + 0x000100a3, + 0x000100a4, + 0x000100a4, + }, + { + 0x000100a5, + 0x000100a5, + 0x000100a6, + 0x000100a6, + 0x000100a7, + 0x000100a7, + 0x000100a8, + 0x000100a8, + 0x000100a9, + 0x000100a9, + 0x000100aa, + 0x000100aa, + 0x000100ab, + 0x000100ab, + 0x000100ac, + 0x000100ac, + }, + { + 0x000100ad, + 0x000100ad, + 0x000100ae, + 0x000100ae, + 0x000100af, + 0x000100af, + 0x000100b0, + 0x000100b0, + 0x000100b1, + 0x000100b1, + 0x000100b2, + 0x000100b2, + 0x000100b3, + 0x000100b3, + 0x000100b4, + 0x000100b4, + }, + { + 0x00000091, + 0x00000092, + 0x00000093, + 0x00000094, + 0x00000095, + 0x00000096, + 0x00000097, + 0x00000098, + 0x00000099, + 0x0000009a, + 0x0000009b, + 0x0000009c, + 0x0000009d, + 0x0000009e, + 0x0000009f, + 0x000000a0, + }, + { + 0x00000075, + 0x00000079, + 0x0000007f, + 0x00000081, + 0x00000082, + 0x00000083, + 0x00000085, + 0x00000087, + 0x00000088, + 0x00000089, + 0x0000008a, + 0x0000008b, + 0x0000008c, + 0x0000008d, + 0x0000008e, + 0x00000090, + }, }; #endif #ifndef ROM_TO_RAM -const uint32_t(*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = +const uint32_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2] = #else -const uint16_t(*c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE])[2] = -#endif -{ - NULL, - c_aauiCQMFHuffEnc1, - c_aauiCQMFHuffEnc2, - c_aauiCQMFHuffEnc3, - c_aauiCQMFHuffEnc4, - c_aauiCQMFHuffEnc5, - c_aauiCQMFHuffEnc6, - c_aauiCQMFHuffEnc7, - c_aauiCQMFHuffEnc8, - c_aauiCQMFHuffEnc9, - c_aauiCQMFHuffEnc10, - c_aauiCQMFHuffEnc11, - c_aauiCQMFHuffEnc12, - c_aauiCQMFHuffEnc13, - c_aauiCQMFHuffEnc14, - c_aauiCQMFHuffEnc15, - c_aauiCQMFHuffEnc16, - c_aauiCQMFHuffEnc17, - c_aauiCQMFHuffEnc18, - c_aauiCQMFHuffEnc19, - c_aauiCQMFHuffEnc20, - c_aauiCQMFHuffEnc21, - c_aauiCQMFHuffEnc22, - c_aauiCQMFHuffEnc23, - c_aauiCQMFHuffEnc24, - c_aauiCQMFHuffEnc25, - c_aauiCQMFHuffEnc26, - c_aauiCQMFHuffEnc27, - c_aauiCQMFHuffEnc28, - c_aauiCQMFHuffEnc29, - c_aauiCQMFHuffEnc30, - c_aauiCQMFHuffEnc31, - NULL, - c_aauiCQMFHuffEnc33, - c_aauiCQMFHuffEnc34, - c_aauiCQMFHuffEnc35, - c_aauiCQMFHuffEnc36, - c_aauiCQMFHuffEnc37, - c_aauiCQMFHuffEnc38, - c_aauiCQMFHuffEnc39, - c_aauiCQMFHuffEnc40, - c_aauiCQMFHuffEnc41, - c_aauiCQMFHuffEnc42, - c_aauiCQMFHuffEnc43, - c_aauiCQMFHuffEnc44, - c_aauiCQMFHuffEnc45, - c_aauiCQMFHuffEnc46, - c_aauiCQMFHuffEnc47, - c_aauiCQMFHuffEnc48, - c_aauiCQMFHuffEnc49, - c_aauiCQMFHuffEnc50, - c_aauiCQMFHuffEnc51, - c_aauiCQMFHuffEnc52, - c_aauiCQMFHuffEnc53, - c_aauiCQMFHuffEnc54, - c_aauiCQMFHuffEnc55, - c_aauiCQMFHuffEnc56, - c_aauiCQMFHuffEnc57, - c_aauiCQMFHuffEnc58, - c_aauiCQMFHuffEnc59, - c_aauiCQMFHuffEnc60, - c_aauiCQMFHuffEnc61, - c_aauiCQMFHuffEnc62, - c_aauiCQMFHuffEnc63, -}; +const uint16_t ( *c_apauiHuffEncTabels[2 * ALLOC_TABLE_SIZE] )[2] = +#endif + { + NULL, + c_aauiCQMFHuffEnc1, + c_aauiCQMFHuffEnc2, + c_aauiCQMFHuffEnc3, + c_aauiCQMFHuffEnc4, + c_aauiCQMFHuffEnc5, + c_aauiCQMFHuffEnc6, + c_aauiCQMFHuffEnc7, + c_aauiCQMFHuffEnc8, + c_aauiCQMFHuffEnc9, + c_aauiCQMFHuffEnc10, + c_aauiCQMFHuffEnc11, + c_aauiCQMFHuffEnc12, + c_aauiCQMFHuffEnc13, + c_aauiCQMFHuffEnc14, + c_aauiCQMFHuffEnc15, + c_aauiCQMFHuffEnc16, + c_aauiCQMFHuffEnc17, + c_aauiCQMFHuffEnc18, + c_aauiCQMFHuffEnc19, + c_aauiCQMFHuffEnc20, + c_aauiCQMFHuffEnc21, + c_aauiCQMFHuffEnc22, + c_aauiCQMFHuffEnc23, + c_aauiCQMFHuffEnc24, + c_aauiCQMFHuffEnc25, + c_aauiCQMFHuffEnc26, + c_aauiCQMFHuffEnc27, + c_aauiCQMFHuffEnc28, + c_aauiCQMFHuffEnc29, + c_aauiCQMFHuffEnc30, + c_aauiCQMFHuffEnc31, + NULL, + c_aauiCQMFHuffEnc33, + c_aauiCQMFHuffEnc34, + c_aauiCQMFHuffEnc35, + c_aauiCQMFHuffEnc36, + c_aauiCQMFHuffEnc37, + c_aauiCQMFHuffEnc38, + c_aauiCQMFHuffEnc39, + c_aauiCQMFHuffEnc40, + c_aauiCQMFHuffEnc41, + c_aauiCQMFHuffEnc42, + c_aauiCQMFHuffEnc43, + c_aauiCQMFHuffEnc44, + c_aauiCQMFHuffEnc45, + c_aauiCQMFHuffEnc46, + c_aauiCQMFHuffEnc47, + c_aauiCQMFHuffEnc48, + c_aauiCQMFHuffEnc49, + c_aauiCQMFHuffEnc50, + c_aauiCQMFHuffEnc51, + c_aauiCQMFHuffEnc52, + c_aauiCQMFHuffEnc53, + c_aauiCQMFHuffEnc54, + c_aauiCQMFHuffEnc55, + c_aauiCQMFHuffEnc56, + c_aauiCQMFHuffEnc57, + c_aauiCQMFHuffEnc58, + c_aauiCQMFHuffEnc59, + c_aauiCQMFHuffEnc60, + c_aauiCQMFHuffEnc61, + c_aauiCQMFHuffEnc62, + c_aauiCQMFHuffEnc63, + }; #ifndef ROM_TO_RAM -const uint32_t(*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] = { +const uint32_t ( *c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE] )[HUFF_DEC_TABLE_SIZE] = { NULL, c_aauiCQMFHuffDec1, c_aauiCQMFHuffDec2, @@ -4323,317 +44144,7737 @@ const uint32_t(*c_apauiHuffDecTables[2 * ALLOC_TABLE_SIZE])[HUFF_DEC_TABLE_SIZE] c_aauiCQMFHuffDec63, }; #else -const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE] = -{ 0, 16, 16, 25, 36, 36, 49, 64, 81, 100, - 169, 196, 289, 324, 400, 576, 729, 729, 28, 29, - 32, 37, 39, 46, 55, 65, 77, 91, 109, 129, - 153, 181, 0, 16, 16, 25, 36, 36, 49, 64, 81, - 100, 169, 196, 289, 324, 400, 576, 729, 729, 28, - 29, 32, 37, 39, 46, 55, 65, 77, 91, 109, - 129, 153, 181 -}; +const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE] = { 0, 16, 16, 25, 36, 36, 49, 64, 81, 100, + 169, 196, 289, 324, 400, 576, 729, 729, 28, 29, + 32, 37, 39, 46, 55, 65, 77, 91, 109, 129, + 153, 181, 0, 16, 16, 25, 36, 36, 49, 64, 81, + 100, 169, 196, 289, 324, 400, 576, 729, 729, 28, + 29, 32, 37, 39, 46, 55, 65, 77, 91, 109, + 129, 153, 181 }; #endif #ifdef USE_DEMOD_TABLES const int32_t c_aaiHuffDemod1[16][2] = { - 0,0,0,1,0,2,0,3,1,0,1,1,1,2,1,3,2,0,2,1,2,2,2,3,3,0,3,1,3,2,3,3, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, }; const int32_t c_aaiHuffDemod2[16][2] = { - 0,0,0,1,0,2,0,3,1,0,1,1,1,2,1,3,2,0,2,1,2,2,2,3,3,0,3,1,3,2,3,3, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, }; const int32_t c_aaiHuffDemod3[25][2] = { - 0,0,0,1,0,2,0,3,0,4,1,0,1,1,1,2,1,3,1,4,2,0,2,1,2,2,2,3,2,4,3,0, - 3,1,3,2,3,3,3,4,4,0,4,1,4,2,4,3,4,4, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, }; const int32_t c_aaiHuffDemod4[36][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,1,0,1,1,1,2,1,3,1,4,1,5,2,0,2,1,2,2,2,3, - 2,4,2,5,3,0,3,1,3,2,3,3,3,4,3,5,4,0,4,1,4,2,4,3,4,4,4,5,5,0,5,1, - 5,2,5,3,5,4,5,5, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, }; const int32_t c_aaiHuffDemod5[36][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,1,0,1,1,1,2,1,3,1,4,1,5,2,0,2,1,2,2,2,3, - 2,4,2,5,3,0,3,1,3,2,3,3,3,4,3,5,4,0,4,1,4,2,4,3,4,4,4,5,5,0,5,1, - 5,2,5,3,5,4,5,5, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, }; const int32_t c_aaiHuffDemod6[49][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,1,0,1,1,1,2,1,3,1,4,1,5,1,6,2,0,2,1, - 2,2,2,3,2,4,2,5,2,6,3,0,3,1,3,2,3,3,3,4,3,5,3,6,4,0,4,1,4,2,4,3, - 4,4,4,5,4,6,5,0,5,1,5,2,5,3,5,4,5,5,5,6,6,0,6,1,6,2,6,3,6,4,6,5, - 6,6, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, }; const int32_t c_aaiHuffDemod7[64][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7, - 2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7, - 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7, - 6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, }; const int32_t c_aaiHuffDemod8[81][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,1,0,1,1,1,2,1,3,1,4,1,5,1,6, - 1,7,1,8,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,3,0,3,1,3,2,3,3,3,4, - 3,5,3,6,3,7,3,8,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,5,0,5,1,5,2, - 5,3,5,4,5,5,5,6,5,7,5,8,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,7,0, - 7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, - 8,8, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, }; const int32_t c_aaiHuffDemod9[100][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,1,0,1,1,1,2,1,3,1,4,1,5, - 1,6,1,7,1,8,1,9,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,3,0,3,1, - 3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, - 4,8,4,9,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,6,0,6,1,6,2,6,3, - 6,4,6,5,6,6,6,7,6,8,6,9,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9, - 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,9,0,9,1,9,2,9,3,9,4,9,5, - 9,6,9,7,9,8,9,9, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, }; const int32_t c_aaiHuffDemod10[169][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,1,0,1,1,1,2, - 1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,2,0,2,1,2,2,2,3,2,4,2,5, - 2,6,2,7,2,8,2,9,2,10,2,11,2,12,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8, - 3,9,3,10,3,11,3,12,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11, - 4,12,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10,5,11,5,12,6,0,6,1, - 6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,7,0,7,1,7,2,7,3,7,4, - 7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, - 8,8,8,9,8,10,8,11,8,12,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10, - 9,11,9,12,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,11,0, - 11,1,11,2,11,3,11,4,11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,12,0,12,1,12,2,12,3, - 12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, }; const int32_t c_aaiHuffDemod11[196][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,1,0,1,1, - 1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,2,0,2,1,2,2,2,3, - 2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,3,0,3,1,3,2,3,3,3,4,3,5, - 3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, - 4,8,4,9,4,10,4,11,4,12,4,13,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9, - 5,10,5,11,5,12,5,13,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11, - 6,12,6,13,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13, - 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,9,0,9,1, - 9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12,9,13,10,0,10,1,10,2,10,3, - 10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,11,0,11,1,11,2,11,3,11,4,11,5, - 11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7, - 12,8,12,9,12,10,12,11,12,12,12,13,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9, - 13,10,13,11,13,12,13,13, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, }; const int32_t c_aaiHuffDemod12[289][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14, - 1,15,1,16,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13, - 2,14,2,15,2,16,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12, - 3,13,3,14,3,15,3,16,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11, - 4,12,4,13,4,14,4,15,4,16,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10, - 5,11,5,12,5,13,5,14,5,15,5,16,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9, - 6,10,6,11,6,12,6,13,6,14,6,15,6,16,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7,7,8, - 7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, - 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,9,0,9,1,9,2,9,3,9,4,9,5,9,6, - 9,7,9,8,9,9,9,10,9,11,9,12,9,13,9,14,9,15,9,16,10,0,10,1,10,2,10,3,10,4,10,5, - 10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,11,0,11,1,11,2,11,3,11,4, - 11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,12,0,12,1,12,2,12,3, - 12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12,16,13,0,13,1,13,2, - 13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,14,0,14,1, - 14,2,14,3,14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,15,0, - 15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, }; const int32_t c_aaiHuffDemod13[324][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,0,17,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13, - 1,14,1,15,1,16,1,17,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11, - 2,12,2,13,2,14,2,15,2,16,2,17,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9, - 3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7, - 4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,5,0,5,1,5,2,5,3,5,4,5,5, - 5,6,5,7,5,8,5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,6,0,6,1,6,2,6,3, - 6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15,6,16,6,17,7,0,7,1, - 7,2,7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17, - 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, - 8,16,8,17,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12,9,13, - 9,14,9,15,9,16,9,17,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11, - 10,12,10,13,10,14,10,15,10,16,10,17,11,0,11,1,11,2,11,3,11,4,11,5,11,6,11,7,11,8,11,9, - 11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7, - 12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12,16,12,17,13,0,13,1,13,2,13,3,13,4,13,5, - 13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,13,17,14,0,14,1,14,2,14,3, - 14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,15,0,15,1, - 15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16,16,17,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13, - 17,14,17,15,17,16,17,17, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 0, + 17, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 1, + 17, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 2, + 17, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 3, + 17, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 4, + 17, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 5, + 17, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 6, + 17, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 7, + 17, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 8, + 17, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 9, + 17, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 10, + 17, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 11, + 17, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 12, + 17, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 13, + 17, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 14, + 17, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 15, + 17, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, + 16, + 17, + 17, + 0, + 17, + 1, + 17, + 2, + 17, + 3, + 17, + 4, + 17, + 5, + 17, + 6, + 17, + 7, + 17, + 8, + 17, + 9, + 17, + 10, + 17, + 11, + 17, + 12, + 17, + 13, + 17, + 14, + 17, + 15, + 17, + 16, + 17, + 17, }; const int32_t c_aaiHuffDemod14[400][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,0,17,0,18,0,19,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11, - 1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7, - 2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,3,0,3,1,3,2,3,3, - 3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,3,18,3,19, - 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15, - 4,16,4,17,4,18,4,19,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8,5,9,5,10,5,11, - 5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7, - 6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15,6,16,6,17,6,18,6,19,7,0,7,1,7,2,7,3, - 7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18,7,19, - 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, - 8,16,8,17,8,18,8,19,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11, - 9,12,9,13,9,14,9,15,9,16,9,17,9,18,9,19,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7, - 10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17,10,18,10,19,11,0,11,1,11,2,11,3, - 11,4,11,5,11,6,11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19, - 12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15, - 12,16,12,17,12,18,12,19,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11, - 13,12,13,13,13,14,13,15,13,16,13,17,13,18,13,19,14,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7, - 14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,15,0,15,1,15,2,15,3, - 15,4,15,5,15,6,15,7,15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16,16,17,16,18,16,19,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7,17,8,17,9,17,10,17,11, - 17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7, - 18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,19,0,19,1,19,2,19,3, - 19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14,19,15,19,16,19,17,19,18,19,19, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 0, + 17, + 0, + 18, + 0, + 19, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 1, + 17, + 1, + 18, + 1, + 19, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 2, + 17, + 2, + 18, + 2, + 19, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 3, + 17, + 3, + 18, + 3, + 19, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 4, + 17, + 4, + 18, + 4, + 19, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 5, + 17, + 5, + 18, + 5, + 19, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 6, + 17, + 6, + 18, + 6, + 19, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 7, + 17, + 7, + 18, + 7, + 19, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 8, + 17, + 8, + 18, + 8, + 19, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 9, + 17, + 9, + 18, + 9, + 19, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 10, + 17, + 10, + 18, + 10, + 19, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 11, + 17, + 11, + 18, + 11, + 19, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 12, + 17, + 12, + 18, + 12, + 19, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 13, + 17, + 13, + 18, + 13, + 19, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 14, + 17, + 14, + 18, + 14, + 19, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 15, + 17, + 15, + 18, + 15, + 19, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, + 16, + 17, + 16, + 18, + 16, + 19, + 17, + 0, + 17, + 1, + 17, + 2, + 17, + 3, + 17, + 4, + 17, + 5, + 17, + 6, + 17, + 7, + 17, + 8, + 17, + 9, + 17, + 10, + 17, + 11, + 17, + 12, + 17, + 13, + 17, + 14, + 17, + 15, + 17, + 16, + 17, + 17, + 17, + 18, + 17, + 19, + 18, + 0, + 18, + 1, + 18, + 2, + 18, + 3, + 18, + 4, + 18, + 5, + 18, + 6, + 18, + 7, + 18, + 8, + 18, + 9, + 18, + 10, + 18, + 11, + 18, + 12, + 18, + 13, + 18, + 14, + 18, + 15, + 18, + 16, + 18, + 17, + 18, + 18, + 18, + 19, + 19, + 0, + 19, + 1, + 19, + 2, + 19, + 3, + 19, + 4, + 19, + 5, + 19, + 6, + 19, + 7, + 19, + 8, + 19, + 9, + 19, + 10, + 19, + 11, + 19, + 12, + 19, + 13, + 19, + 14, + 19, + 15, + 19, + 16, + 19, + 17, + 19, + 18, + 19, + 19, }; const int32_t c_aaiHuffDemod15[576][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7, - 1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20,1,21,1,22,1,23, - 2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15, - 2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7, - 3,8,3,9,3,10,3,11,3,12,3,13,3,14,3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23, - 4,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15, - 4,16,4,17,4,18,4,19,4,20,4,21,4,22,4,23,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7, - 5,8,5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23, - 6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13,6,14,6,15, - 6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,7,0,7,1,7,2,7,3,7,4,7,5,7,6,7,7, - 7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18,7,19,7,20,7,21,7,22,7,23, - 8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7,8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15, - 8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7, - 9,8,9,9,9,10,9,11,9,12,9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23, - 10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15, - 10,16,10,17,10,18,10,19,10,20,10,21,10,22,10,23,11,0,11,1,11,2,11,3,11,4,11,5,11,6,11,7, - 11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22,11,23, - 12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15, - 12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,13,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7, - 13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16,13,17,13,18,13,19,13,20,13,21,13,22,13,23, - 14,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15, - 14,16,14,17,14,18,14,19,14,20,14,21,14,22,14,23,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7, - 15,8,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,17,0,17,1,17,2,17,3,17,4,17,5,17,6,17,7, - 17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20,17,21,17,22,17,23, - 18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15, - 18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7, - 19,8,19,9,19,10,19,11,19,12,19,13,19,14,19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23, - 20,0,20,1,20,2,20,3,20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15, - 20,16,20,17,20,18,20,19,20,20,20,21,20,22,20,23,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7, - 21,8,21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23, - 22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13,22,14,22,15, - 22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,23,0,23,1,23,2,23,3,23,4,23,5,23,6,23,7, - 23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18,23,19,23,20,23,21,23,22,23,23, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 0, + 17, + 0, + 18, + 0, + 19, + 0, + 20, + 0, + 21, + 0, + 22, + 0, + 23, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 1, + 17, + 1, + 18, + 1, + 19, + 1, + 20, + 1, + 21, + 1, + 22, + 1, + 23, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 2, + 17, + 2, + 18, + 2, + 19, + 2, + 20, + 2, + 21, + 2, + 22, + 2, + 23, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 3, + 17, + 3, + 18, + 3, + 19, + 3, + 20, + 3, + 21, + 3, + 22, + 3, + 23, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 4, + 17, + 4, + 18, + 4, + 19, + 4, + 20, + 4, + 21, + 4, + 22, + 4, + 23, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 5, + 17, + 5, + 18, + 5, + 19, + 5, + 20, + 5, + 21, + 5, + 22, + 5, + 23, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 6, + 17, + 6, + 18, + 6, + 19, + 6, + 20, + 6, + 21, + 6, + 22, + 6, + 23, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 7, + 17, + 7, + 18, + 7, + 19, + 7, + 20, + 7, + 21, + 7, + 22, + 7, + 23, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 8, + 17, + 8, + 18, + 8, + 19, + 8, + 20, + 8, + 21, + 8, + 22, + 8, + 23, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 9, + 17, + 9, + 18, + 9, + 19, + 9, + 20, + 9, + 21, + 9, + 22, + 9, + 23, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 10, + 17, + 10, + 18, + 10, + 19, + 10, + 20, + 10, + 21, + 10, + 22, + 10, + 23, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 11, + 17, + 11, + 18, + 11, + 19, + 11, + 20, + 11, + 21, + 11, + 22, + 11, + 23, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 12, + 17, + 12, + 18, + 12, + 19, + 12, + 20, + 12, + 21, + 12, + 22, + 12, + 23, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 13, + 17, + 13, + 18, + 13, + 19, + 13, + 20, + 13, + 21, + 13, + 22, + 13, + 23, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 14, + 17, + 14, + 18, + 14, + 19, + 14, + 20, + 14, + 21, + 14, + 22, + 14, + 23, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 15, + 17, + 15, + 18, + 15, + 19, + 15, + 20, + 15, + 21, + 15, + 22, + 15, + 23, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, + 16, + 17, + 16, + 18, + 16, + 19, + 16, + 20, + 16, + 21, + 16, + 22, + 16, + 23, + 17, + 0, + 17, + 1, + 17, + 2, + 17, + 3, + 17, + 4, + 17, + 5, + 17, + 6, + 17, + 7, + 17, + 8, + 17, + 9, + 17, + 10, + 17, + 11, + 17, + 12, + 17, + 13, + 17, + 14, + 17, + 15, + 17, + 16, + 17, + 17, + 17, + 18, + 17, + 19, + 17, + 20, + 17, + 21, + 17, + 22, + 17, + 23, + 18, + 0, + 18, + 1, + 18, + 2, + 18, + 3, + 18, + 4, + 18, + 5, + 18, + 6, + 18, + 7, + 18, + 8, + 18, + 9, + 18, + 10, + 18, + 11, + 18, + 12, + 18, + 13, + 18, + 14, + 18, + 15, + 18, + 16, + 18, + 17, + 18, + 18, + 18, + 19, + 18, + 20, + 18, + 21, + 18, + 22, + 18, + 23, + 19, + 0, + 19, + 1, + 19, + 2, + 19, + 3, + 19, + 4, + 19, + 5, + 19, + 6, + 19, + 7, + 19, + 8, + 19, + 9, + 19, + 10, + 19, + 11, + 19, + 12, + 19, + 13, + 19, + 14, + 19, + 15, + 19, + 16, + 19, + 17, + 19, + 18, + 19, + 19, + 19, + 20, + 19, + 21, + 19, + 22, + 19, + 23, + 20, + 0, + 20, + 1, + 20, + 2, + 20, + 3, + 20, + 4, + 20, + 5, + 20, + 6, + 20, + 7, + 20, + 8, + 20, + 9, + 20, + 10, + 20, + 11, + 20, + 12, + 20, + 13, + 20, + 14, + 20, + 15, + 20, + 16, + 20, + 17, + 20, + 18, + 20, + 19, + 20, + 20, + 20, + 21, + 20, + 22, + 20, + 23, + 21, + 0, + 21, + 1, + 21, + 2, + 21, + 3, + 21, + 4, + 21, + 5, + 21, + 6, + 21, + 7, + 21, + 8, + 21, + 9, + 21, + 10, + 21, + 11, + 21, + 12, + 21, + 13, + 21, + 14, + 21, + 15, + 21, + 16, + 21, + 17, + 21, + 18, + 21, + 19, + 21, + 20, + 21, + 21, + 21, + 22, + 21, + 23, + 22, + 0, + 22, + 1, + 22, + 2, + 22, + 3, + 22, + 4, + 22, + 5, + 22, + 6, + 22, + 7, + 22, + 8, + 22, + 9, + 22, + 10, + 22, + 11, + 22, + 12, + 22, + 13, + 22, + 14, + 22, + 15, + 22, + 16, + 22, + 17, + 22, + 18, + 22, + 19, + 22, + 20, + 22, + 21, + 22, + 22, + 22, + 23, + 23, + 0, + 23, + 1, + 23, + 2, + 23, + 3, + 23, + 4, + 23, + 5, + 23, + 6, + 23, + 7, + 23, + 8, + 23, + 9, + 23, + 10, + 23, + 11, + 23, + 12, + 23, + 13, + 23, + 14, + 23, + 15, + 23, + 16, + 23, + 17, + 23, + 18, + 23, + 19, + 23, + 20, + 23, + 21, + 23, + 22, + 23, + 23, }; const int32_t c_aaiHuffDemod16[729][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,1,0,1,1,1,2,1,3,1,4, - 1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20, - 1,21,1,22,1,23,1,24,1,25,1,26,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9, - 2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,2,24,2,25, - 2,26,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14, - 3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23,3,24,3,25,3,26,4,0,4,1,4,2,4,3, - 4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,4,18,4,19, - 4,20,4,21,4,22,4,23,4,24,4,25,4,26,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8, - 5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23,5,24, - 5,25,5,26,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13, - 6,14,6,15,6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,6,24,6,25,6,26,7,0,7,1,7,2, - 7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18, - 7,19,7,20,7,21,7,22,7,23,7,24,7,25,7,26,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, - 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23, - 8,24,8,25,8,26,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12, - 9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23,9,24,9,25,9,26,10,0,10,1, - 10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17, - 10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,26,11,0,11,1,11,2,11,3,11,4,11,5,11,6, - 11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22, - 11,23,11,24,11,25,11,26,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11, - 12,12,12,13,12,14,12,15,12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,12,24,12,25,12,26,13,0, - 13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16, - 13,17,13,18,13,19,13,20,13,21,13,22,13,23,13,24,13,25,13,26,14,0,14,1,14,2,14,3,14,4,14,5, - 14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,14,20,14,21, - 14,22,14,23,14,24,14,25,14,26,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10, - 15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23,15,24,15,25,15,26, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,17,0,17,1,17,2,17,3,17,4, - 17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20, - 17,21,17,22,17,23,17,24,17,25,17,26,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9, - 18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,18,24,18,25, - 18,26,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14, - 19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23,19,24,19,25,19,26,20,0,20,1,20,2,20,3, - 20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15,20,16,20,17,20,18,20,19, - 20,20,20,21,20,22,20,23,20,24,20,25,20,26,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7,21,8, - 21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23,21,24, - 21,25,21,26,22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13, - 22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,22,24,22,25,22,26,23,0,23,1,23,2, - 23,3,23,4,23,5,23,6,23,7,23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18, - 23,19,23,20,23,21,23,22,23,23,23,24,23,25,23,26,24,0,24,1,24,2,24,3,24,4,24,5,24,6,24,7, - 24,8,24,9,24,10,24,11,24,12,24,13,24,14,24,15,24,16,24,17,24,18,24,19,24,20,24,21,24,22,24,23, - 24,24,24,25,24,26,25,0,25,1,25,2,25,3,25,4,25,5,25,6,25,7,25,8,25,9,25,10,25,11,25,12, - 25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,25,24,25,25,25,26,26,0,26,1, - 26,2,26,3,26,4,26,5,26,6,26,7,26,8,26,9,26,10,26,11,26,12,26,13,26,14,26,15,26,16,26,17, - 26,18,26,19,26,20,26,21,26,22,26,23,26,24,26,25,26,26, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 0, + 17, + 0, + 18, + 0, + 19, + 0, + 20, + 0, + 21, + 0, + 22, + 0, + 23, + 0, + 24, + 0, + 25, + 0, + 26, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 1, + 17, + 1, + 18, + 1, + 19, + 1, + 20, + 1, + 21, + 1, + 22, + 1, + 23, + 1, + 24, + 1, + 25, + 1, + 26, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 2, + 17, + 2, + 18, + 2, + 19, + 2, + 20, + 2, + 21, + 2, + 22, + 2, + 23, + 2, + 24, + 2, + 25, + 2, + 26, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 3, + 17, + 3, + 18, + 3, + 19, + 3, + 20, + 3, + 21, + 3, + 22, + 3, + 23, + 3, + 24, + 3, + 25, + 3, + 26, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 4, + 17, + 4, + 18, + 4, + 19, + 4, + 20, + 4, + 21, + 4, + 22, + 4, + 23, + 4, + 24, + 4, + 25, + 4, + 26, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 5, + 17, + 5, + 18, + 5, + 19, + 5, + 20, + 5, + 21, + 5, + 22, + 5, + 23, + 5, + 24, + 5, + 25, + 5, + 26, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 6, + 17, + 6, + 18, + 6, + 19, + 6, + 20, + 6, + 21, + 6, + 22, + 6, + 23, + 6, + 24, + 6, + 25, + 6, + 26, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 7, + 17, + 7, + 18, + 7, + 19, + 7, + 20, + 7, + 21, + 7, + 22, + 7, + 23, + 7, + 24, + 7, + 25, + 7, + 26, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 8, + 17, + 8, + 18, + 8, + 19, + 8, + 20, + 8, + 21, + 8, + 22, + 8, + 23, + 8, + 24, + 8, + 25, + 8, + 26, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 9, + 17, + 9, + 18, + 9, + 19, + 9, + 20, + 9, + 21, + 9, + 22, + 9, + 23, + 9, + 24, + 9, + 25, + 9, + 26, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 10, + 17, + 10, + 18, + 10, + 19, + 10, + 20, + 10, + 21, + 10, + 22, + 10, + 23, + 10, + 24, + 10, + 25, + 10, + 26, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 11, + 17, + 11, + 18, + 11, + 19, + 11, + 20, + 11, + 21, + 11, + 22, + 11, + 23, + 11, + 24, + 11, + 25, + 11, + 26, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 12, + 17, + 12, + 18, + 12, + 19, + 12, + 20, + 12, + 21, + 12, + 22, + 12, + 23, + 12, + 24, + 12, + 25, + 12, + 26, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 13, + 17, + 13, + 18, + 13, + 19, + 13, + 20, + 13, + 21, + 13, + 22, + 13, + 23, + 13, + 24, + 13, + 25, + 13, + 26, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 14, + 17, + 14, + 18, + 14, + 19, + 14, + 20, + 14, + 21, + 14, + 22, + 14, + 23, + 14, + 24, + 14, + 25, + 14, + 26, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 15, + 17, + 15, + 18, + 15, + 19, + 15, + 20, + 15, + 21, + 15, + 22, + 15, + 23, + 15, + 24, + 15, + 25, + 15, + 26, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, + 16, + 17, + 16, + 18, + 16, + 19, + 16, + 20, + 16, + 21, + 16, + 22, + 16, + 23, + 16, + 24, + 16, + 25, + 16, + 26, + 17, + 0, + 17, + 1, + 17, + 2, + 17, + 3, + 17, + 4, + 17, + 5, + 17, + 6, + 17, + 7, + 17, + 8, + 17, + 9, + 17, + 10, + 17, + 11, + 17, + 12, + 17, + 13, + 17, + 14, + 17, + 15, + 17, + 16, + 17, + 17, + 17, + 18, + 17, + 19, + 17, + 20, + 17, + 21, + 17, + 22, + 17, + 23, + 17, + 24, + 17, + 25, + 17, + 26, + 18, + 0, + 18, + 1, + 18, + 2, + 18, + 3, + 18, + 4, + 18, + 5, + 18, + 6, + 18, + 7, + 18, + 8, + 18, + 9, + 18, + 10, + 18, + 11, + 18, + 12, + 18, + 13, + 18, + 14, + 18, + 15, + 18, + 16, + 18, + 17, + 18, + 18, + 18, + 19, + 18, + 20, + 18, + 21, + 18, + 22, + 18, + 23, + 18, + 24, + 18, + 25, + 18, + 26, + 19, + 0, + 19, + 1, + 19, + 2, + 19, + 3, + 19, + 4, + 19, + 5, + 19, + 6, + 19, + 7, + 19, + 8, + 19, + 9, + 19, + 10, + 19, + 11, + 19, + 12, + 19, + 13, + 19, + 14, + 19, + 15, + 19, + 16, + 19, + 17, + 19, + 18, + 19, + 19, + 19, + 20, + 19, + 21, + 19, + 22, + 19, + 23, + 19, + 24, + 19, + 25, + 19, + 26, + 20, + 0, + 20, + 1, + 20, + 2, + 20, + 3, + 20, + 4, + 20, + 5, + 20, + 6, + 20, + 7, + 20, + 8, + 20, + 9, + 20, + 10, + 20, + 11, + 20, + 12, + 20, + 13, + 20, + 14, + 20, + 15, + 20, + 16, + 20, + 17, + 20, + 18, + 20, + 19, + 20, + 20, + 20, + 21, + 20, + 22, + 20, + 23, + 20, + 24, + 20, + 25, + 20, + 26, + 21, + 0, + 21, + 1, + 21, + 2, + 21, + 3, + 21, + 4, + 21, + 5, + 21, + 6, + 21, + 7, + 21, + 8, + 21, + 9, + 21, + 10, + 21, + 11, + 21, + 12, + 21, + 13, + 21, + 14, + 21, + 15, + 21, + 16, + 21, + 17, + 21, + 18, + 21, + 19, + 21, + 20, + 21, + 21, + 21, + 22, + 21, + 23, + 21, + 24, + 21, + 25, + 21, + 26, + 22, + 0, + 22, + 1, + 22, + 2, + 22, + 3, + 22, + 4, + 22, + 5, + 22, + 6, + 22, + 7, + 22, + 8, + 22, + 9, + 22, + 10, + 22, + 11, + 22, + 12, + 22, + 13, + 22, + 14, + 22, + 15, + 22, + 16, + 22, + 17, + 22, + 18, + 22, + 19, + 22, + 20, + 22, + 21, + 22, + 22, + 22, + 23, + 22, + 24, + 22, + 25, + 22, + 26, + 23, + 0, + 23, + 1, + 23, + 2, + 23, + 3, + 23, + 4, + 23, + 5, + 23, + 6, + 23, + 7, + 23, + 8, + 23, + 9, + 23, + 10, + 23, + 11, + 23, + 12, + 23, + 13, + 23, + 14, + 23, + 15, + 23, + 16, + 23, + 17, + 23, + 18, + 23, + 19, + 23, + 20, + 23, + 21, + 23, + 22, + 23, + 23, + 23, + 24, + 23, + 25, + 23, + 26, + 24, + 0, + 24, + 1, + 24, + 2, + 24, + 3, + 24, + 4, + 24, + 5, + 24, + 6, + 24, + 7, + 24, + 8, + 24, + 9, + 24, + 10, + 24, + 11, + 24, + 12, + 24, + 13, + 24, + 14, + 24, + 15, + 24, + 16, + 24, + 17, + 24, + 18, + 24, + 19, + 24, + 20, + 24, + 21, + 24, + 22, + 24, + 23, + 24, + 24, + 24, + 25, + 24, + 26, + 25, + 0, + 25, + 1, + 25, + 2, + 25, + 3, + 25, + 4, + 25, + 5, + 25, + 6, + 25, + 7, + 25, + 8, + 25, + 9, + 25, + 10, + 25, + 11, + 25, + 12, + 25, + 13, + 25, + 14, + 25, + 15, + 25, + 16, + 25, + 17, + 25, + 18, + 25, + 19, + 25, + 20, + 25, + 21, + 25, + 22, + 25, + 23, + 25, + 24, + 25, + 25, + 25, + 26, + 26, + 0, + 26, + 1, + 26, + 2, + 26, + 3, + 26, + 4, + 26, + 5, + 26, + 6, + 26, + 7, + 26, + 8, + 26, + 9, + 26, + 10, + 26, + 11, + 26, + 12, + 26, + 13, + 26, + 14, + 26, + 15, + 26, + 16, + 26, + 17, + 26, + 18, + 26, + 19, + 26, + 20, + 26, + 21, + 26, + 22, + 26, + 23, + 26, + 24, + 26, + 25, + 26, + 26, }; const int32_t c_aaiHuffDemod17[729][2] = { - 0,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15, - 0,16,0,17,0,18,0,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,1,0,1,1,1,2,1,3,1,4, - 1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,19,1,20, - 1,21,1,22,1,23,1,24,1,25,1,26,2,0,2,1,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9, - 2,10,2,11,2,12,2,13,2,14,2,15,2,16,2,17,2,18,2,19,2,20,2,21,2,22,2,23,2,24,2,25, - 2,26,3,0,3,1,3,2,3,3,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14, - 3,15,3,16,3,17,3,18,3,19,3,20,3,21,3,22,3,23,3,24,3,25,3,26,4,0,4,1,4,2,4,3, - 4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,15,4,16,4,17,4,18,4,19, - 4,20,4,21,4,22,4,23,4,24,4,25,4,26,5,0,5,1,5,2,5,3,5,4,5,5,5,6,5,7,5,8, - 5,9,5,10,5,11,5,12,5,13,5,14,5,15,5,16,5,17,5,18,5,19,5,20,5,21,5,22,5,23,5,24, - 5,25,5,26,6,0,6,1,6,2,6,3,6,4,6,5,6,6,6,7,6,8,6,9,6,10,6,11,6,12,6,13, - 6,14,6,15,6,16,6,17,6,18,6,19,6,20,6,21,6,22,6,23,6,24,6,25,6,26,7,0,7,1,7,2, - 7,3,7,4,7,5,7,6,7,7,7,8,7,9,7,10,7,11,7,12,7,13,7,14,7,15,7,16,7,17,7,18, - 7,19,7,20,7,21,7,22,7,23,7,24,7,25,7,26,8,0,8,1,8,2,8,3,8,4,8,5,8,6,8,7, - 8,8,8,9,8,10,8,11,8,12,8,13,8,14,8,15,8,16,8,17,8,18,8,19,8,20,8,21,8,22,8,23, - 8,24,8,25,8,26,9,0,9,1,9,2,9,3,9,4,9,5,9,6,9,7,9,8,9,9,9,10,9,11,9,12, - 9,13,9,14,9,15,9,16,9,17,9,18,9,19,9,20,9,21,9,22,9,23,9,24,9,25,9,26,10,0,10,1, - 10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17, - 10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,26,11,0,11,1,11,2,11,3,11,4,11,5,11,6, - 11,7,11,8,11,9,11,10,11,11,11,12,11,13,11,14,11,15,11,16,11,17,11,18,11,19,11,20,11,21,11,22, - 11,23,11,24,11,25,11,26,12,0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11, - 12,12,12,13,12,14,12,15,12,16,12,17,12,18,12,19,12,20,12,21,12,22,12,23,12,24,12,25,12,26,13,0, - 13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,8,13,9,13,10,13,11,13,12,13,13,13,14,13,15,13,16, - 13,17,13,18,13,19,13,20,13,21,13,22,13,23,13,24,13,25,13,26,14,0,14,1,14,2,14,3,14,4,14,5, - 14,6,14,7,14,8,14,9,14,10,14,11,14,12,14,13,14,14,14,15,14,16,14,17,14,18,14,19,14,20,14,21, - 14,22,14,23,14,24,14,25,14,26,15,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,8,15,9,15,10, - 15,11,15,12,15,13,15,14,15,15,15,16,15,17,15,18,15,19,15,20,15,21,15,22,15,23,15,24,15,25,15,26, - 16,0,16,1,16,2,16,3,16,4,16,5,16,6,16,7,16,8,16,9,16,10,16,11,16,12,16,13,16,14,16,15, - 16,16,16,17,16,18,16,19,16,20,16,21,16,22,16,23,16,24,16,25,16,26,17,0,17,1,17,2,17,3,17,4, - 17,5,17,6,17,7,17,8,17,9,17,10,17,11,17,12,17,13,17,14,17,15,17,16,17,17,17,18,17,19,17,20, - 17,21,17,22,17,23,17,24,17,25,17,26,18,0,18,1,18,2,18,3,18,4,18,5,18,6,18,7,18,8,18,9, - 18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,18,18,18,19,18,20,18,21,18,22,18,23,18,24,18,25, - 18,26,19,0,19,1,19,2,19,3,19,4,19,5,19,6,19,7,19,8,19,9,19,10,19,11,19,12,19,13,19,14, - 19,15,19,16,19,17,19,18,19,19,19,20,19,21,19,22,19,23,19,24,19,25,19,26,20,0,20,1,20,2,20,3, - 20,4,20,5,20,6,20,7,20,8,20,9,20,10,20,11,20,12,20,13,20,14,20,15,20,16,20,17,20,18,20,19, - 20,20,20,21,20,22,20,23,20,24,20,25,20,26,21,0,21,1,21,2,21,3,21,4,21,5,21,6,21,7,21,8, - 21,9,21,10,21,11,21,12,21,13,21,14,21,15,21,16,21,17,21,18,21,19,21,20,21,21,21,22,21,23,21,24, - 21,25,21,26,22,0,22,1,22,2,22,3,22,4,22,5,22,6,22,7,22,8,22,9,22,10,22,11,22,12,22,13, - 22,14,22,15,22,16,22,17,22,18,22,19,22,20,22,21,22,22,22,23,22,24,22,25,22,26,23,0,23,1,23,2, - 23,3,23,4,23,5,23,6,23,7,23,8,23,9,23,10,23,11,23,12,23,13,23,14,23,15,23,16,23,17,23,18, - 23,19,23,20,23,21,23,22,23,23,23,24,23,25,23,26,24,0,24,1,24,2,24,3,24,4,24,5,24,6,24,7, - 24,8,24,9,24,10,24,11,24,12,24,13,24,14,24,15,24,16,24,17,24,18,24,19,24,20,24,21,24,22,24,23, - 24,24,24,25,24,26,25,0,25,1,25,2,25,3,25,4,25,5,25,6,25,7,25,8,25,9,25,10,25,11,25,12, - 25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,25,24,25,25,25,26,26,0,26,1, - 26,2,26,3,26,4,26,5,26,6,26,7,26,8,26,9,26,10,26,11,26,12,26,13,26,14,26,15,26,16,26,17, - 26,18,26,19,26,20,26,21,26,22,26,23,26,24,26,25,26,26, + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 4, + 0, + 5, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 10, + 0, + 11, + 0, + 12, + 0, + 13, + 0, + 14, + 0, + 15, + 0, + 16, + 0, + 17, + 0, + 18, + 0, + 19, + 0, + 20, + 0, + 21, + 0, + 22, + 0, + 23, + 0, + 24, + 0, + 25, + 0, + 26, + 1, + 0, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 4, + 1, + 5, + 1, + 6, + 1, + 7, + 1, + 8, + 1, + 9, + 1, + 10, + 1, + 11, + 1, + 12, + 1, + 13, + 1, + 14, + 1, + 15, + 1, + 16, + 1, + 17, + 1, + 18, + 1, + 19, + 1, + 20, + 1, + 21, + 1, + 22, + 1, + 23, + 1, + 24, + 1, + 25, + 1, + 26, + 2, + 0, + 2, + 1, + 2, + 2, + 2, + 3, + 2, + 4, + 2, + 5, + 2, + 6, + 2, + 7, + 2, + 8, + 2, + 9, + 2, + 10, + 2, + 11, + 2, + 12, + 2, + 13, + 2, + 14, + 2, + 15, + 2, + 16, + 2, + 17, + 2, + 18, + 2, + 19, + 2, + 20, + 2, + 21, + 2, + 22, + 2, + 23, + 2, + 24, + 2, + 25, + 2, + 26, + 3, + 0, + 3, + 1, + 3, + 2, + 3, + 3, + 3, + 4, + 3, + 5, + 3, + 6, + 3, + 7, + 3, + 8, + 3, + 9, + 3, + 10, + 3, + 11, + 3, + 12, + 3, + 13, + 3, + 14, + 3, + 15, + 3, + 16, + 3, + 17, + 3, + 18, + 3, + 19, + 3, + 20, + 3, + 21, + 3, + 22, + 3, + 23, + 3, + 24, + 3, + 25, + 3, + 26, + 4, + 0, + 4, + 1, + 4, + 2, + 4, + 3, + 4, + 4, + 4, + 5, + 4, + 6, + 4, + 7, + 4, + 8, + 4, + 9, + 4, + 10, + 4, + 11, + 4, + 12, + 4, + 13, + 4, + 14, + 4, + 15, + 4, + 16, + 4, + 17, + 4, + 18, + 4, + 19, + 4, + 20, + 4, + 21, + 4, + 22, + 4, + 23, + 4, + 24, + 4, + 25, + 4, + 26, + 5, + 0, + 5, + 1, + 5, + 2, + 5, + 3, + 5, + 4, + 5, + 5, + 5, + 6, + 5, + 7, + 5, + 8, + 5, + 9, + 5, + 10, + 5, + 11, + 5, + 12, + 5, + 13, + 5, + 14, + 5, + 15, + 5, + 16, + 5, + 17, + 5, + 18, + 5, + 19, + 5, + 20, + 5, + 21, + 5, + 22, + 5, + 23, + 5, + 24, + 5, + 25, + 5, + 26, + 6, + 0, + 6, + 1, + 6, + 2, + 6, + 3, + 6, + 4, + 6, + 5, + 6, + 6, + 6, + 7, + 6, + 8, + 6, + 9, + 6, + 10, + 6, + 11, + 6, + 12, + 6, + 13, + 6, + 14, + 6, + 15, + 6, + 16, + 6, + 17, + 6, + 18, + 6, + 19, + 6, + 20, + 6, + 21, + 6, + 22, + 6, + 23, + 6, + 24, + 6, + 25, + 6, + 26, + 7, + 0, + 7, + 1, + 7, + 2, + 7, + 3, + 7, + 4, + 7, + 5, + 7, + 6, + 7, + 7, + 7, + 8, + 7, + 9, + 7, + 10, + 7, + 11, + 7, + 12, + 7, + 13, + 7, + 14, + 7, + 15, + 7, + 16, + 7, + 17, + 7, + 18, + 7, + 19, + 7, + 20, + 7, + 21, + 7, + 22, + 7, + 23, + 7, + 24, + 7, + 25, + 7, + 26, + 8, + 0, + 8, + 1, + 8, + 2, + 8, + 3, + 8, + 4, + 8, + 5, + 8, + 6, + 8, + 7, + 8, + 8, + 8, + 9, + 8, + 10, + 8, + 11, + 8, + 12, + 8, + 13, + 8, + 14, + 8, + 15, + 8, + 16, + 8, + 17, + 8, + 18, + 8, + 19, + 8, + 20, + 8, + 21, + 8, + 22, + 8, + 23, + 8, + 24, + 8, + 25, + 8, + 26, + 9, + 0, + 9, + 1, + 9, + 2, + 9, + 3, + 9, + 4, + 9, + 5, + 9, + 6, + 9, + 7, + 9, + 8, + 9, + 9, + 9, + 10, + 9, + 11, + 9, + 12, + 9, + 13, + 9, + 14, + 9, + 15, + 9, + 16, + 9, + 17, + 9, + 18, + 9, + 19, + 9, + 20, + 9, + 21, + 9, + 22, + 9, + 23, + 9, + 24, + 9, + 25, + 9, + 26, + 10, + 0, + 10, + 1, + 10, + 2, + 10, + 3, + 10, + 4, + 10, + 5, + 10, + 6, + 10, + 7, + 10, + 8, + 10, + 9, + 10, + 10, + 10, + 11, + 10, + 12, + 10, + 13, + 10, + 14, + 10, + 15, + 10, + 16, + 10, + 17, + 10, + 18, + 10, + 19, + 10, + 20, + 10, + 21, + 10, + 22, + 10, + 23, + 10, + 24, + 10, + 25, + 10, + 26, + 11, + 0, + 11, + 1, + 11, + 2, + 11, + 3, + 11, + 4, + 11, + 5, + 11, + 6, + 11, + 7, + 11, + 8, + 11, + 9, + 11, + 10, + 11, + 11, + 11, + 12, + 11, + 13, + 11, + 14, + 11, + 15, + 11, + 16, + 11, + 17, + 11, + 18, + 11, + 19, + 11, + 20, + 11, + 21, + 11, + 22, + 11, + 23, + 11, + 24, + 11, + 25, + 11, + 26, + 12, + 0, + 12, + 1, + 12, + 2, + 12, + 3, + 12, + 4, + 12, + 5, + 12, + 6, + 12, + 7, + 12, + 8, + 12, + 9, + 12, + 10, + 12, + 11, + 12, + 12, + 12, + 13, + 12, + 14, + 12, + 15, + 12, + 16, + 12, + 17, + 12, + 18, + 12, + 19, + 12, + 20, + 12, + 21, + 12, + 22, + 12, + 23, + 12, + 24, + 12, + 25, + 12, + 26, + 13, + 0, + 13, + 1, + 13, + 2, + 13, + 3, + 13, + 4, + 13, + 5, + 13, + 6, + 13, + 7, + 13, + 8, + 13, + 9, + 13, + 10, + 13, + 11, + 13, + 12, + 13, + 13, + 13, + 14, + 13, + 15, + 13, + 16, + 13, + 17, + 13, + 18, + 13, + 19, + 13, + 20, + 13, + 21, + 13, + 22, + 13, + 23, + 13, + 24, + 13, + 25, + 13, + 26, + 14, + 0, + 14, + 1, + 14, + 2, + 14, + 3, + 14, + 4, + 14, + 5, + 14, + 6, + 14, + 7, + 14, + 8, + 14, + 9, + 14, + 10, + 14, + 11, + 14, + 12, + 14, + 13, + 14, + 14, + 14, + 15, + 14, + 16, + 14, + 17, + 14, + 18, + 14, + 19, + 14, + 20, + 14, + 21, + 14, + 22, + 14, + 23, + 14, + 24, + 14, + 25, + 14, + 26, + 15, + 0, + 15, + 1, + 15, + 2, + 15, + 3, + 15, + 4, + 15, + 5, + 15, + 6, + 15, + 7, + 15, + 8, + 15, + 9, + 15, + 10, + 15, + 11, + 15, + 12, + 15, + 13, + 15, + 14, + 15, + 15, + 15, + 16, + 15, + 17, + 15, + 18, + 15, + 19, + 15, + 20, + 15, + 21, + 15, + 22, + 15, + 23, + 15, + 24, + 15, + 25, + 15, + 26, + 16, + 0, + 16, + 1, + 16, + 2, + 16, + 3, + 16, + 4, + 16, + 5, + 16, + 6, + 16, + 7, + 16, + 8, + 16, + 9, + 16, + 10, + 16, + 11, + 16, + 12, + 16, + 13, + 16, + 14, + 16, + 15, + 16, + 16, + 16, + 17, + 16, + 18, + 16, + 19, + 16, + 20, + 16, + 21, + 16, + 22, + 16, + 23, + 16, + 24, + 16, + 25, + 16, + 26, + 17, + 0, + 17, + 1, + 17, + 2, + 17, + 3, + 17, + 4, + 17, + 5, + 17, + 6, + 17, + 7, + 17, + 8, + 17, + 9, + 17, + 10, + 17, + 11, + 17, + 12, + 17, + 13, + 17, + 14, + 17, + 15, + 17, + 16, + 17, + 17, + 17, + 18, + 17, + 19, + 17, + 20, + 17, + 21, + 17, + 22, + 17, + 23, + 17, + 24, + 17, + 25, + 17, + 26, + 18, + 0, + 18, + 1, + 18, + 2, + 18, + 3, + 18, + 4, + 18, + 5, + 18, + 6, + 18, + 7, + 18, + 8, + 18, + 9, + 18, + 10, + 18, + 11, + 18, + 12, + 18, + 13, + 18, + 14, + 18, + 15, + 18, + 16, + 18, + 17, + 18, + 18, + 18, + 19, + 18, + 20, + 18, + 21, + 18, + 22, + 18, + 23, + 18, + 24, + 18, + 25, + 18, + 26, + 19, + 0, + 19, + 1, + 19, + 2, + 19, + 3, + 19, + 4, + 19, + 5, + 19, + 6, + 19, + 7, + 19, + 8, + 19, + 9, + 19, + 10, + 19, + 11, + 19, + 12, + 19, + 13, + 19, + 14, + 19, + 15, + 19, + 16, + 19, + 17, + 19, + 18, + 19, + 19, + 19, + 20, + 19, + 21, + 19, + 22, + 19, + 23, + 19, + 24, + 19, + 25, + 19, + 26, + 20, + 0, + 20, + 1, + 20, + 2, + 20, + 3, + 20, + 4, + 20, + 5, + 20, + 6, + 20, + 7, + 20, + 8, + 20, + 9, + 20, + 10, + 20, + 11, + 20, + 12, + 20, + 13, + 20, + 14, + 20, + 15, + 20, + 16, + 20, + 17, + 20, + 18, + 20, + 19, + 20, + 20, + 20, + 21, + 20, + 22, + 20, + 23, + 20, + 24, + 20, + 25, + 20, + 26, + 21, + 0, + 21, + 1, + 21, + 2, + 21, + 3, + 21, + 4, + 21, + 5, + 21, + 6, + 21, + 7, + 21, + 8, + 21, + 9, + 21, + 10, + 21, + 11, + 21, + 12, + 21, + 13, + 21, + 14, + 21, + 15, + 21, + 16, + 21, + 17, + 21, + 18, + 21, + 19, + 21, + 20, + 21, + 21, + 21, + 22, + 21, + 23, + 21, + 24, + 21, + 25, + 21, + 26, + 22, + 0, + 22, + 1, + 22, + 2, + 22, + 3, + 22, + 4, + 22, + 5, + 22, + 6, + 22, + 7, + 22, + 8, + 22, + 9, + 22, + 10, + 22, + 11, + 22, + 12, + 22, + 13, + 22, + 14, + 22, + 15, + 22, + 16, + 22, + 17, + 22, + 18, + 22, + 19, + 22, + 20, + 22, + 21, + 22, + 22, + 22, + 23, + 22, + 24, + 22, + 25, + 22, + 26, + 23, + 0, + 23, + 1, + 23, + 2, + 23, + 3, + 23, + 4, + 23, + 5, + 23, + 6, + 23, + 7, + 23, + 8, + 23, + 9, + 23, + 10, + 23, + 11, + 23, + 12, + 23, + 13, + 23, + 14, + 23, + 15, + 23, + 16, + 23, + 17, + 23, + 18, + 23, + 19, + 23, + 20, + 23, + 21, + 23, + 22, + 23, + 23, + 23, + 24, + 23, + 25, + 23, + 26, + 24, + 0, + 24, + 1, + 24, + 2, + 24, + 3, + 24, + 4, + 24, + 5, + 24, + 6, + 24, + 7, + 24, + 8, + 24, + 9, + 24, + 10, + 24, + 11, + 24, + 12, + 24, + 13, + 24, + 14, + 24, + 15, + 24, + 16, + 24, + 17, + 24, + 18, + 24, + 19, + 24, + 20, + 24, + 21, + 24, + 22, + 24, + 23, + 24, + 24, + 24, + 25, + 24, + 26, + 25, + 0, + 25, + 1, + 25, + 2, + 25, + 3, + 25, + 4, + 25, + 5, + 25, + 6, + 25, + 7, + 25, + 8, + 25, + 9, + 25, + 10, + 25, + 11, + 25, + 12, + 25, + 13, + 25, + 14, + 25, + 15, + 25, + 16, + 25, + 17, + 25, + 18, + 25, + 19, + 25, + 20, + 25, + 21, + 25, + 22, + 25, + 23, + 25, + 24, + 25, + 25, + 25, + 26, + 26, + 0, + 26, + 1, + 26, + 2, + 26, + 3, + 26, + 4, + 26, + 5, + 26, + 6, + 26, + 7, + 26, + 8, + 26, + 9, + 26, + 10, + 26, + 11, + 26, + 12, + 26, + 13, + 26, + 14, + 26, + 15, + 26, + 16, + 26, + 17, + 26, + 18, + 26, + 19, + 26, + 20, + 26, + 21, + 26, + 22, + 26, + 23, + 26, + 24, + 26, + 25, + 26, + 26, }; -const int32_t(*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { +const int32_t ( *c_apaiDemodTables[ALLOC_TABLE_SIZE] )[2] = { NULL, c_aaiHuffDemod1, c_aaiHuffDemod2, @@ -4670,95 +51911,1156 @@ const int32_t(*c_apaiDemodTables[ALLOC_TABLE_SIZE])[2] = { #endif const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH] = { - 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D, 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39, - 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, - 0x31, 0x31, 0x31, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2B, - 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x29, 0x29, 0x29, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26, 0x26, - 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23, 0x23, 0x23, 0x23, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21, - 0x20, 0x20, 0x20, 0x20, 0x1F, 0x1F, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1D, 0x1D, 0x1D, 0x1C, 0x1C, - 0x1C, 0x1C, 0x1B, 0x1B, 0x1B, 0x1B, 0x1A, 0x1A, 0x1A, 0x1A, 0x19, 0x19, 0x19, 0x19, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x17, 0x16, 0x16, 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x15, - 0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, - 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0F, 0x0F, 0x0F, - 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, - 0x0D, 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, - 0x0B, 0x0B, 0x0B, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, + 0x40, + 0x3F, + 0x3F, + 0x3E, + 0x3E, + 0x3D, + 0x3D, + 0x3C, + 0x3C, + 0x3B, + 0x3B, + 0x3A, + 0x3A, + 0x39, + 0x39, + 0x38, + 0x38, + 0x37, + 0x37, + 0x37, + 0x36, + 0x36, + 0x35, + 0x35, + 0x34, + 0x34, + 0x33, + 0x33, + 0x33, + 0x32, + 0x32, + 0x31, + 0x31, + 0x31, + 0x30, + 0x30, + 0x2F, + 0x2F, + 0x2F, + 0x2E, + 0x2E, + 0x2D, + 0x2D, + 0x2D, + 0x2C, + 0x2C, + 0x2B, + 0x2B, + 0x2B, + 0x2A, + 0x2A, + 0x2A, + 0x29, + 0x29, + 0x29, + 0x28, + 0x28, + 0x27, + 0x27, + 0x27, + 0x26, + 0x26, + 0x26, + 0x25, + 0x25, + 0x25, + 0x24, + 0x24, + 0x24, + 0x23, + 0x23, + 0x23, + 0x23, + 0x22, + 0x22, + 0x22, + 0x21, + 0x21, + 0x21, + 0x20, + 0x20, + 0x20, + 0x20, + 0x1F, + 0x1F, + 0x1F, + 0x1E, + 0x1E, + 0x1E, + 0x1E, + 0x1D, + 0x1D, + 0x1D, + 0x1C, + 0x1C, + 0x1C, + 0x1C, + 0x1B, + 0x1B, + 0x1B, + 0x1B, + 0x1A, + 0x1A, + 0x1A, + 0x1A, + 0x19, + 0x19, + 0x19, + 0x19, + 0x18, + 0x18, + 0x18, + 0x18, + 0x18, + 0x17, + 0x17, + 0x17, + 0x17, + 0x16, + 0x16, + 0x16, + 0x16, + 0x16, + 0x15, + 0x15, + 0x15, + 0x15, + 0x15, + 0x14, + 0x14, + 0x14, + 0x14, + 0x14, + 0x13, + 0x13, + 0x13, + 0x13, + 0x13, + 0x13, + 0x12, + 0x12, + 0x12, + 0x12, + 0x12, + 0x11, + 0x11, + 0x11, + 0x11, + 0x11, + 0x11, + 0x10, + 0x10, + 0x10, + 0x10, + 0x10, + 0x10, + 0x0F, + 0x0F, + 0x0F, + 0x0F, + 0x0F, + 0x0F, + 0x0F, + 0x0E, + 0x0E, + 0x0E, + 0x0E, + 0x0E, + 0x0E, + 0x0E, + 0x0D, + 0x0D, + 0x0D, + 0x0D, + 0x0D, + 0x0D, + 0x0D, + 0x0D, + 0x0C, + 0x0C, + 0x0C, + 0x0C, + 0x0C, + 0x0C, + 0x0C, + 0x0C, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0B, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x0A, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x09, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x08, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x07, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x06, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x05, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x04, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x03, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x02, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, }; const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48] = { - 0,0,0,0,0,0,0,0,0,0,0,64,64,64,64,64, - 101,101,128,165,165,180,213, }; + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 64, + 64, + 64, + 64, + 64, + 101, + 101, + 128, + 165, + 165, + 180, + 213, +}; const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48] = { - -1787,-1787,-1787,-1787,-1787,-1787,-1787,-1787,-1782,-1761,-1737,-1679,-1638,-1613,-1590,-1568, - -1516,-1459,-1395,-1289,-671,-409,-401, }; + -1787, + -1787, + -1787, + -1787, + -1787, + -1787, + -1787, + -1787, + -1782, + -1761, + -1737, + -1679, + -1638, + -1613, + -1590, + -1568, + -1516, + -1459, + -1395, + -1289, + -671, + -409, + -401, +}; #if PERCEPTUAL_MODEL_SLGAIN_SHIFT == 4 const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { - 7,7,6,5,5,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4, + 7, + 7, + 6, + 5, + 5, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, }; #elif PERCEPTUAL_MODEL_SLGAIN_SHIFT == 8 const int32_t c_aiDefaultTheta48[MAX_BANDS_48] = { - 112,112,96,80,80,64,64,64,64,64,64,64,64,64,64,64, - 64,64,64,64,64,64,64, + 112, + 112, + 96, + 80, + 80, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, + 64, }; #endif -const int32_t c_aaiSpreadFunction48[MAX_BANDS_48*MAX_BANDS_48] = { - 0,-1561,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-289,-4,-1234,-2295,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-569,-229, - -8,-905,-1705,-2324,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-789,-445,-173,-16,-656,-1271,-1765,-2172,-2520,-2552,-2552, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-961,-616,-340,-136, - -28,-488,-976,-1382,-1729,-2032,-2305,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-2552,-2552,-1088,-743,-465,-257,-148,-31,-371,-769,-1114,-1417,-1689,-2054,-2483, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1198,-852,-574,-364,-209,-148, - -42,-300,-635,-936,-1207,-1572,-2000,-2376,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552, - -2552,-1293,-948,-669,-458,-301,-183,-145,-56,-258,-547,-816,-1179,-1606,-1982,-2311, - -2552,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1375,-1029,-750,-539,-381,-260,-180,-142, - -68,-231,-487,-846,-1272,-1647,-1976,-2261,-2552,-2552,-2552,-2552,-2552,-2552,-2552,-1444, - -1099,-820,-608,-449,-328,-233,-194,-138,-77,-213,-555,-978,-1352,-1681,-1966,-2268, - -2552,-2552,-2552,-2552,-2552,-2552,-1501,-1155,-876,-665,-505,-383,-287,-210,-193,-130, - -79,-298,-711,-1083,-1411,-1696,-1997,-2288,-2550,-2552,-2552,-2552,-2552,-1567,-1221,-942, - -730,-570,-448,-351,-272,-206,-189,-151,-72,-349,-713,-1039,-1324,-1625,-1915,-2177, - -2448,-2552,-2552,-2552,-1650,-1304,-1025,-813,-653,-530,-432,-352,-285,-227,-177,-163, - -69,-297,-613,-895,-1195,-1485,-1746,-2017,-2238,-2401,-2545,-1727,-1381,-1102,-890,-730, - -607,-509,-428,-360,-301,-249,-180,-153,-72,-257,-527,-824,-1112,-1373,-1643,-1865, - -2028,-2171,-1798,-1452,-1173,-960,-800,-677,-579,-498,-430,-370,-317,-246,-192,-145, - -76,-224,-505,-790,-1050,-1320,-1540,-1703,-1847,-1860,-1514,-1234,-1022,-862,-738,-640, - -559,-490,-430,-377,-306,-224,-197,-136,-81,-242,-515,-771,-1040,-1260,-1422,-1566, - -1923,-1577,-1297,-1085,-925,-801,-703,-621,-553,-492,-439,-367,-284,-213,-198,-144, - -83,-235,-479,-744,-963,-1125,-1268,-1986,-1640,-1360,-1148,-988,-864,-766,-684,-615, - -555,-501,-429,-345,-273,-211,-204,-146,-89,-216,-465,-680,-841,-984,-2043,-1697, - -1417,-1205,-1044,-921,-822,-741,-672,-611,-557,-485,-401,-328,-264,-211,-205,-140, - -93,-227,-430,-588,-729,-2104,-1758,-1479,-1266,-1106,-982,-884,-802,-733,-673,-619, - -546,-461,-388,-324,-269,-212,-211,-151,-100,-195,-336,-472,-2163,-1817,-1537,-1324, - -1164,-1040,-942,-860,-791,-731,-676,-604,-519,-445,-380,-325,-268,-226,-219,-147, - -114,-167,-280,-2203,-1857,-1577,-1365,-1205,-1081,-982,-901,-831,-771,-717,-644,-559, - -485,-420,-364,-306,-252,-239,-206,-132,-122,-163,-2224,-1878,-1598,-1386,-1225,-1102, - -1003,-921,-852,-792,-737,-665,-580,-505,-441,-385,-326,-271,-222,-224,-176,-121,-114, +const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48] = { + 0, + -1561, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -289, + -4, + -1234, + -2295, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -569, + -229, + -8, + -905, + -1705, + -2324, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -789, + -445, + -173, + -16, + -656, + -1271, + -1765, + -2172, + -2520, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -961, + -616, + -340, + -136, + -28, + -488, + -976, + -1382, + -1729, + -2032, + -2305, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1088, + -743, + -465, + -257, + -148, + -31, + -371, + -769, + -1114, + -1417, + -1689, + -2054, + -2483, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1198, + -852, + -574, + -364, + -209, + -148, + -42, + -300, + -635, + -936, + -1207, + -1572, + -2000, + -2376, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1293, + -948, + -669, + -458, + -301, + -183, + -145, + -56, + -258, + -547, + -816, + -1179, + -1606, + -1982, + -2311, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1375, + -1029, + -750, + -539, + -381, + -260, + -180, + -142, + -68, + -231, + -487, + -846, + -1272, + -1647, + -1976, + -2261, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1444, + -1099, + -820, + -608, + -449, + -328, + -233, + -194, + -138, + -77, + -213, + -555, + -978, + -1352, + -1681, + -1966, + -2268, + -2552, + -2552, + -2552, + -2552, + -2552, + -2552, + -1501, + -1155, + -876, + -665, + -505, + -383, + -287, + -210, + -193, + -130, + -79, + -298, + -711, + -1083, + -1411, + -1696, + -1997, + -2288, + -2550, + -2552, + -2552, + -2552, + -2552, + -1567, + -1221, + -942, + -730, + -570, + -448, + -351, + -272, + -206, + -189, + -151, + -72, + -349, + -713, + -1039, + -1324, + -1625, + -1915, + -2177, + -2448, + -2552, + -2552, + -2552, + -1650, + -1304, + -1025, + -813, + -653, + -530, + -432, + -352, + -285, + -227, + -177, + -163, + -69, + -297, + -613, + -895, + -1195, + -1485, + -1746, + -2017, + -2238, + -2401, + -2545, + -1727, + -1381, + -1102, + -890, + -730, + -607, + -509, + -428, + -360, + -301, + -249, + -180, + -153, + -72, + -257, + -527, + -824, + -1112, + -1373, + -1643, + -1865, + -2028, + -2171, + -1798, + -1452, + -1173, + -960, + -800, + -677, + -579, + -498, + -430, + -370, + -317, + -246, + -192, + -145, + -76, + -224, + -505, + -790, + -1050, + -1320, + -1540, + -1703, + -1847, + -1860, + -1514, + -1234, + -1022, + -862, + -738, + -640, + -559, + -490, + -430, + -377, + -306, + -224, + -197, + -136, + -81, + -242, + -515, + -771, + -1040, + -1260, + -1422, + -1566, + -1923, + -1577, + -1297, + -1085, + -925, + -801, + -703, + -621, + -553, + -492, + -439, + -367, + -284, + -213, + -198, + -144, + -83, + -235, + -479, + -744, + -963, + -1125, + -1268, + -1986, + -1640, + -1360, + -1148, + -988, + -864, + -766, + -684, + -615, + -555, + -501, + -429, + -345, + -273, + -211, + -204, + -146, + -89, + -216, + -465, + -680, + -841, + -984, + -2043, + -1697, + -1417, + -1205, + -1044, + -921, + -822, + -741, + -672, + -611, + -557, + -485, + -401, + -328, + -264, + -211, + -205, + -140, + -93, + -227, + -430, + -588, + -729, + -2104, + -1758, + -1479, + -1266, + -1106, + -982, + -884, + -802, + -733, + -673, + -619, + -546, + -461, + -388, + -324, + -269, + -212, + -211, + -151, + -100, + -195, + -336, + -472, + -2163, + -1817, + -1537, + -1324, + -1164, + -1040, + -942, + -860, + -791, + -731, + -676, + -604, + -519, + -445, + -380, + -325, + -268, + -226, + -219, + -147, + -114, + -167, + -280, + -2203, + -1857, + -1577, + -1365, + -1205, + -1081, + -982, + -901, + -831, + -771, + -717, + -644, + -559, + -485, + -420, + -364, + -306, + -252, + -239, + -206, + -132, + -122, + -163, + -2224, + -1878, + -1598, + -1386, + -1225, + -1102, + -1003, + -921, + -852, + -792, + -737, + -665, + -580, + -505, + -441, + -385, + -326, + -271, + -222, + -224, + -176, + -121, + -114, }; #endif - diff --git a/lib_rend/ivas_lcld_tables.h b/lib_rend/ivas_lcld_tables.h index ad2a836f49..ee92fa46b9 100644 --- a/lib_rend/ivas_lcld_tables.h +++ b/lib_rend/ivas_lcld_tables.h @@ -53,7 +53,7 @@ extern "C" #define MAX_BANDS ( 23 ) #define MAX_BANDS_48 ( 23 ) - extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this +extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this #define ENV_MIN ( -64 ) @@ -105,20 +105,6 @@ extern "C" #define TON_QUOTA_ABS_THRESHOLD ( 8.0f ) #define TON_QUOTA_INC_THRESHOLD ( 4.0f ) -#define LOG_ADD_TABLE_LENGTH ( 512 ) - -#define PERCEPTUAL_MODEL_SCALE ( 64 ) - -#define PERCEPTUAL_MODEL_SCALE_SHIFT ( 6 ) - -#define PERCEPTUAL_MODEL_ALPHA_SCALE ( 614 ) - -#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE ( 6827 ) - -#define PERCEPTUAL_MODEL_ALPHA_SHIFT ( 11 ) - -#define PERCEPTUAL_MODEL_SLGAIN_SHIFT ( 8 ) //(4) - #define MAX_BANDS_48 ( 23 ) //#define USE_DEMOD_TABLES @@ -149,12 +135,6 @@ extern "C" extern const int32_t c_aiHuffmanSize[ALLOC_TABLE_SIZE]; - extern const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH]; - extern const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48]; - extern const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48]; - extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; - extern const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48]; - #ifndef ROM_TO_RAM extern const uint32_t c_aauiCQMFHuffEnc1[16][2]; @@ -580,20 +560,6 @@ extern const uint32_t num_row_aauiCQMFHuff[2 * ALLOC_TABLE_SIZE]; extern const uint32_t c_aaiRMSEnvHuffDec[13][HUFF_DEC_TABLE_SIZE]; - void PerceptualModel( const int32_t iMaxQuantBands, - const int32_t *piRMSEnvelope, - int32_t *piExcitation, - int32_t *piSMR ); - - void PerceptualModelStereo( const int32_t iMaxQuantBands, - const int32_t *piMSFlags, - const int32_t *piRMSEnvelope0, - const int32_t *piRMSEnvelope1, - int32_t *piExcitation0, - int32_t *piExcitation1, - int32_t *piSMR0, - int32_t *piSMR1 ); - #ifdef __cplusplus } #endif -- GitLab From 2e253a1ed0296641a6ab60be5d1106e1aedc2456 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Thu, 4 May 2023 18:40:34 +0530 Subject: [PATCH 0140/1418] clang format fix --- lib_rend/ivas_CQMFEncoder.c | 24 ++++++++-------- lib_rend/ivas_PerceptualModel.h | 50 ++++++++++++++++----------------- lib_rend/ivas_lcld_tables.h | 2 +- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib_rend/ivas_CQMFEncoder.c b/lib_rend/ivas_CQMFEncoder.c index 82bcf6879a..755fb670f4 100644 --- a/lib_rend/ivas_CQMFEncoder.c +++ b/lib_rend/ivas_CQMFEncoder.c @@ -1079,12 +1079,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1094,12 +1094,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } @@ -1137,12 +1137,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset]; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1152,12 +1152,12 @@ static void QuantizeSpectrumDPCM_Opt( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset]; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } iQuantValue = ( iQuantValue < iMaxQuantVal ) ? iQuantValue : iMaxQuantVal; @@ -1239,12 +1239,12 @@ static void QuantizeSpectrumDPCM( const int32_t iNumGroups, fVal = ppfReal[iBlockOffset][iFBOffset] + fPredReal; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignReal[iBlockOffset][iFBOffset] = 1; } #ifdef _DEBUG_VERBOSE @@ -1262,12 +1262,12 @@ static void QuantizeSpectrumDPCM( const int32_t iNumGroups, fVal = ppfImag[iBlockOffset][iFBOffset] + fPredImag; if ( fVal > 0.0 ) { - iQuantValue = ( int32_t )( fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 0; } else { - iQuantValue = ( int32_t )( -fSCFGain * fVal + 0.5 ); + iQuantValue = (int32_t) ( -fSCFGain * fVal + 0.5 ); ppiSignImag[iBlockOffset][iFBOffset] = 1; } diff --git a/lib_rend/ivas_PerceptualModel.h b/lib_rend/ivas_PerceptualModel.h index fdd1027623..269bfa4a3f 100644 --- a/lib_rend/ivas_PerceptualModel.h +++ b/lib_rend/ivas_PerceptualModel.h @@ -39,34 +39,34 @@ extern "C" #endif #include -#define LOG_ADD_TABLE_LENGTH (512) -#define PERCEPTUAL_MODEL_SCALE (64) -#define PERCEPTUAL_MODEL_SCALE_SHIFT (6) -#define PERCEPTUAL_MODEL_ALPHA_SCALE (614) -#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE (6827) -#define PERCEPTUAL_MODEL_ALPHA_SHIFT (11) -#define PERCEPTUAL_MODEL_SLGAIN_SHIFT (8)//(4) -#define MAX_BANDS_48 ( 23 ) +#define LOG_ADD_TABLE_LENGTH ( 512 ) +#define PERCEPTUAL_MODEL_SCALE ( 64 ) +#define PERCEPTUAL_MODEL_SCALE_SHIFT ( 6 ) +#define PERCEPTUAL_MODEL_ALPHA_SCALE ( 614 ) +#define PERCEPTUAL_MODEL_ALPHA_INV_SCALE ( 6827 ) +#define PERCEPTUAL_MODEL_ALPHA_SHIFT ( 11 ) +#define PERCEPTUAL_MODEL_SLGAIN_SHIFT ( 8 ) //(4) +#define MAX_BANDS_48 ( 23 ) - extern const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH]; - extern const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48]; - extern const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48]; - extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; - extern const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48]; + extern const int32_t c_aiLogAddTable[LOG_ADD_TABLE_LENGTH]; + extern const int32_t c_aiBandwidthAdjust48[MAX_BANDS_48]; + extern const int32_t c_aiAbsoluteThresh48[MAX_BANDS_48]; + extern const int32_t c_aiDefaultTheta48[MAX_BANDS_48]; + extern const int32_t c_aaiSpreadFunction48[MAX_BANDS_48 * MAX_BANDS_48]; - extern void PerceptualModel(const int32_t iMaxQuantBands, - const int32_t *piRMSEnvelope, - int32_t *piExcitation, - int32_t *piSMR); + extern void PerceptualModel( const int32_t iMaxQuantBands, + const int32_t *piRMSEnvelope, + int32_t *piExcitation, + int32_t *piSMR ); - extern void PerceptualModelStereo(const int32_t iMaxQuantBands, - const int32_t *piMSFlags, - const int32_t *piRMSEnvelope0, - const int32_t *piRMSEnvelope1, - int32_t *piExcitation0, - int32_t *piExcitation1, - int32_t *piSMR0, - int32_t *piSMR1); + extern void PerceptualModelStereo( const int32_t iMaxQuantBands, + const int32_t *piMSFlags, + const int32_t *piRMSEnvelope0, + const int32_t *piRMSEnvelope1, + int32_t *piExcitation0, + int32_t *piExcitation1, + int32_t *piSMR0, + int32_t *piSMR1 ); #ifdef __cplusplus } diff --git a/lib_rend/ivas_lcld_tables.h b/lib_rend/ivas_lcld_tables.h index ee92fa46b9..b50edae637 100644 --- a/lib_rend/ivas_lcld_tables.h +++ b/lib_rend/ivas_lcld_tables.h @@ -53,7 +53,7 @@ extern "C" #define MAX_BANDS ( 23 ) #define MAX_BANDS_48 ( 23 ) -extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this + extern const int32_t c_aiBandwidths48[MAX_BANDS_48]; // move this #define ENV_MIN ( -64 ) -- GitLab From 1b7ecd9898acbd07616afabc70366c2f1c0a33c7 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Thu, 4 May 2023 16:46:01 +0200 Subject: [PATCH 0141/1418] added missing #ifdef CONTROL_METADATA_EARLY_REFLECTIONS; removed nested #ifdef DEBUGGING --- lib_util/render_config_reader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index d8edca110b..581a240a52 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -1445,7 +1445,9 @@ static ivas_error RenderConfigReader_readReverb( { pRenderConfigReader->pAE[n].pRT60 = 0; pRenderConfigReader->pAE[n].pDSR = 0; +#ifdef CONTROL_METADATA_EARLY_REFLECTIONS pRenderConfigReader->pAE[n].pEarlyReflections = 0; +#endif } for ( n = 0; n < pRenderConfigReader->nAE; n++ ) @@ -1830,13 +1832,11 @@ ivas_error RenderConfigReader_read( errorHandler( item, ERROR_VALUE_INVALID ); } } -#ifdef DEBUGGING else { fprintf( stderr, "Unsupported configuration property %s\n", item ); } #endif -#endif #ifdef CONTROL_METADATA_REVERB params_idx += params_length; #endif -- GitLab From 18f88b6aa439c1d88f06cd5c5b36a80eec10c74c Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 5 May 2023 16:48:15 +1000 Subject: [PATCH 0142/1418] minor clean up of buffer lenght macros for various formats --- lib_rend/lib_rend.c | 53 ++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1f1be0b7b0..650c10206b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -55,7 +55,14 @@ /* Maximum buffer length (total) in samples. */ #ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef REND_STATIC_MEM_OPT +#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) +#else #define MAX_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#endif + #else #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #endif @@ -2543,7 +2550,7 @@ static ivas_error setRendInputActiveSplitPostRend( outConfig = *rendCtx.pOutConfig; #ifdef REND_STATIC_MEM_OPT - if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) ) != IVAS_ERR_OK ) + if ( ( error = allocateInputBaseBufferData( &inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } @@ -2551,7 +2558,7 @@ static ivas_error setRendInputActiveSplitPostRend( initRendInputBase( &inputSplitPostRend->base, inConfig, id, rendCtx #ifdef REND_STATIC_MEM_OPT , - inputSplitPostRend->bufferData, MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS + inputSplitPostRend->bufferData, MAX_BIN_BUFFER_LENGTH #endif ); @@ -2588,7 +2595,7 @@ static ivas_error setRendInputActiveSba( } #ifdef REND_STATIC_MEM_OPT - if ( ( error = allocateInputBaseBufferData( &inputSba->bufferData, MAX_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) + if ( ( error = allocateInputBaseBufferData( &inputSba->bufferData, MAX_CLDFB_BUFFER_LENGTH ) ) != IVAS_ERR_OK ) { return error; } @@ -2596,7 +2603,7 @@ static ivas_error setRendInputActiveSba( initRendInputBase( &inputSba->base, inConfig, id, rendCtx #ifdef REND_STATIC_MEM_OPT , - inputSba->bufferData, MAX_BUFFER_LENGTH + inputSba->bufferData, MAX_CLDFB_BUFFER_LENGTH #endif ); setZeroPanMatrix( inputSba->hoaDecMtx ); @@ -4099,13 +4106,15 @@ ivas_error IVAS_REND_GetDelay( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->inputsSba[i].splitRendWrapper.hBinHrSplitPreRend != NULL ) { - if ( hIvasRend->hRendererConfig->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) + if ( hIvasRend->hRendererConfig->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { - latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0; + latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; } else +#endif { - latency_ns = hIvasRend->inputsSba[i].cldfbRendWrapper.binaural_latency_ns; + latency_ns = ( hIvasRend->inputsSba[i].crendWrapper != NULL ) ? hIvasRend->inputsSba[i].crendWrapper->binaural_latency_ns : 0; } max_latency_ns = max( max_latency_ns, latency_ns ); } @@ -6102,21 +6111,8 @@ static ivas_error renderSbaToSplitBinaural( &sbaInput->splitRendWrapper.multiBinPoseData, sbaInput->base.ctx.pHeadRotData->sr_pose_pred_axis ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override != RENDER_TYPE_OVERRIDE_FASTCONV ) - { - renderSbaToMultiBinaural( - sbaInput, - outConfig, - tmpCrendBuffer ); - max_band = (int16_t) ( ( BINAURAL_MAXBANDS * ( *sbaInput->base.ctx.pOutSampleRate ) ) / 48000 ); - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); - } - } - else -#endif +#if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) + if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); @@ -6131,6 +6127,19 @@ static ivas_error renderSbaToSplitBinaural( low_res_pre_rend_rot ); max_band = sbaInput->cldfbRendWrapper.hCldfbRend->max_band; } + else +#endif + { + renderSbaToMultiBinaural( + sbaInput, + outConfig, + tmpCrendBuffer ); + max_band = (int16_t) ( ( BINAURAL_MAXBANDS * ( *sbaInput->base.ctx.pOutSampleRate ) ) / 48000 ); + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + } + } /*SPLIT pre rendering MD and CLDFB coding*/ convertBitsBufferToInternalBitsBuff( *hBits, &bits ); -- GitLab From 0ec0211198b706b3f26e4586974295c5c104afcf Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 8 May 2023 16:58:22 +1000 Subject: [PATCH 0143/1418] fix for clang memory sanitizer --- lib_com/options.h | 1 + lib_rend/ivas_CQMFDecoder.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index dec3063de3..eadd9a164c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -207,6 +207,7 @@ #define SBA_CREND_ROT_OPT #define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ +#define SPLIT_REND_CLANG_SAN_FIX #endif diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 0c152e95e3..b5fe0b38ea 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -1623,18 +1623,39 @@ ReadCQMFData( const int32_t iNumGroups, const int32_t *piGroupLengths, const int ppiSignReal[iBlockOffest][iFBOffset] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); iBitsRead += 1; } +#ifdef SPLIT_REND_CLANG_SAN_FIX + else + { + ppiSignReal[iBlockOffest][iFBOffset] = 0; + } +#endif if ( iQuantValue2 > 0 ) { ppiSignImag[iBlockOffest][iFBOffset] = ivas_split_rend_bitstream_read_int32( pBits, 1 ); iBitsRead += 1; } +#ifdef SPLIT_REND_CLANG_SAN_FIX + else + { + ppiSignImag[iBlockOffest][iFBOffset] = 0; + } +#endif iFBOffset++; } } else { +#ifdef SPLIT_REND_CLANG_SAN_FIX + for ( m = 0; m < piBandwidths[b]; m++ ) + { + ppiSignReal[iBlockOffest][iFBOffset] = 0; + ppiSignImag[iBlockOffest][iFBOffset] = 0; + iFBOffset++; + } +#else iFBOffset += piBandwidths[b]; +#endif } } -- GitLab From 775112f019e64dc6414fd6561382f5a9a4d1b5ba Mon Sep 17 00:00:00 2001 From: rtyag Date: Tue, 9 May 2023 19:59:13 +1000 Subject: [PATCH 0144/1418] clang address sanitizer fix --- apps/renderer.c | 8 ++++++++ lib_com/ivas_cnst.h | 5 ++++- lib_com/options.h | 2 +- lib_dec/ivas_binRenderer_internal.c | 3 ++- lib_rend/lib_rend.c | 5 +++-- lib_util/split_render_file_read_write.c | 6 ++++++ 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 9f9f6f1ea8..64d87d0092 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -66,6 +66,10 @@ #define RENDERER_MAX_METADATA_LENGTH 8192 #define RENDERER_MAX_METADATA_LINE_LENGTH 1024 +#ifdef SPLIT_REND_CLDFB_HUFF_SAN_FIX +#define SPLIT_REND_BITS_BUFF_SIZE ( ( ( ( (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC ) + 7 ) >> 3 ) + SPLIT_REND_ADDITIONAL_BYTES_TO_READ ) +#endif + #if !defined( DEBUGGING ) && !defined( WMOPS ) static #endif @@ -1215,8 +1219,12 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( is_split_pre_rend_mode( &args ) || is_split_post_rend_mode( &args ) ) { +#ifdef SPLIT_REND_CLDFB_HUFF_SAN_FIX + bitsBufferSize = SPLIT_REND_BITS_BUFF_SIZE; +#else bitsBufferSize = (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC; bitsBufferSize = ( bitsBufferSize + 7 ) >> 3; +#endif } else { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 4256e41afb..2bcf082064 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1728,8 +1728,11 @@ typedef enum #define SPLIT_REND_384k 384000 #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 -#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k +#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k +#ifdef SPLIT_REND_CLDFB_HUFF_SAN_FIX +#define SPLIT_REND_ADDITIONAL_BYTES_TO_READ ( 1 ) +#endif /*----------------------------------------------------------------------------------* * Limiter constants diff --git a/lib_com/options.h b/lib_com/options.h index eadd9a164c..917becccbd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -208,7 +208,7 @@ #define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ #define SPLIT_REND_CLANG_SAN_FIX - +#define SPLIT_REND_CLDFB_HUFF_SAN_FIX #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index c7cf76137a..d1942d94f5 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1520,7 +1520,7 @@ void ivas_rend_CldfbMultiBinRendProcess( for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) - + { for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { idx = sf_idx * MAX_PARAM_SPATIAL_SUBFRAMES + slot_idx; @@ -1530,6 +1530,7 @@ void ivas_rend_CldfbMultiBinRendProcess( mvr2r( &Cldfb_ImagBuffer_Binaural[pose_idx][ch_idx][slot_idx][0], &Cldfb_Out_Imag[pose_idx][ch_idx][idx][0], hCldfbRend->max_band ); } } + } } return; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 650c10206b..80d578188f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -6087,8 +6087,6 @@ static ivas_error renderSbaToSplitBinaural( { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; - float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES + 1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -6114,6 +6112,9 @@ static ivas_error renderSbaToSplitBinaural( #if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); ivas_rend_CldfbMultiBinRendProcess( diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 8171354fe4..19c0544b16 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -235,6 +235,12 @@ ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileRea { return IVAS_ERR_FAILED_FILE_READ; } +#ifdef SPLIT_REND_CLDFB_HUFF_SAN_FIX + for ( i = 0; i < SPLIT_REND_ADDITIONAL_BYTES_TO_READ; i++ ) + { + bits[num_bytes + i] = 0; + } +#endif *bits_read = 0; *bits_written = bit_len; -- GitLab From 73f4d59582b584ded0089fd3f21fcf6494d2254e Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Wed, 10 May 2023 10:39:53 +0200 Subject: [PATCH 0145/1418] bugfixes for OMASA: missing inits of ISM extended meta flags and ISM/MASA delay buffers. missing renderer reconfig in brsw. --- lib_com/options.h | 3 +- lib_dec/ivas_init_dec.c | 5 +++ lib_dec/ivas_omasa_dec.c | 85 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 99627150c5..9a1d0ae929 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,7 +180,8 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define OMASA_ENERGIES -#define FIX_OMASA_STEREO_SWITCHING // VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps +#define FIX_OMASA_STEREO_SWITCHING // VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps +#define FIX_OMASA_BRSW /* Nokia + VA: Fix missing init of OMASA metadata delay buffers, brsw-related init fixes */ #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 9469278bb8..70d4b7a1c2 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -938,6 +938,11 @@ ivas_error ivas_init_decoder( if ( st_ivas->ivas_format == MASA_FORMAT ) { +#ifdef FIX_OMASA_BRSW + /* if we start in ISM_MODE_NONE in MASA_ISM, that appears as normal MASA, but we may change to a mode with ISMs */ + st_ivas->ism_extmeta_active = -1; + st_ivas->ism_extmeta_cnt = 0; +#endif if ( ( error = ivas_masa_dec_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 92cb4336ec..bc8bd03c5b 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -55,6 +55,9 @@ ivas_error ivas_masa_ism_data_open( { MASA_ISM_DATA_HANDLE hMasaIsmData; int16_t ch, bin; +#ifdef FIX_OMASA_BRSW + int16_t sf, obj_idx; +#endif if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) { @@ -83,6 +86,20 @@ ivas_error ivas_masa_ism_data_open( hMasaIsmData->q_azimuth_old[ch] = 0.0f; } +#ifdef FIX_OMASA_BRSW + for ( obj_idx = 0; obj_idx < MAX_NUM_OBJECTS; obj_idx++ ) + { + set_s( hMasaIsmData->azimuth_ism[obj_idx], 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); + set_s( hMasaIsmData->elevation_ism[obj_idx], 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR; sf++ ) + { + set_zero( hMasaIsmData->energy_ratio_ism[obj_idx][sf], CLDFB_NO_CHANNELS_MAX ); + } + } + set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); + set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); +#endif + st_ivas->hMasaIsmData = hMasaIsmData; return IVAS_ERR_OK; @@ -139,6 +156,10 @@ ivas_error ivas_omasa_dec_config( IVAS_FORMAT ivas_format_orig; ivas_error error; +#ifdef FIX_OMASA_BRSW + RENDERER_TYPE old_renderer_type; +#endif + /* initializations */ ism_total_brate = 0; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -158,6 +179,13 @@ ivas_error ivas_omasa_dec_config( /* set ism_mode of current frame */ st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); +#ifdef FIX_OMASA_BRSW + /*-----------------------------------------------------------------* + * Renderer selection + *-----------------------------------------------------------------*/ + old_renderer_type = st_ivas->renderer_type; +#endif + /* MASA reconfig. */ cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); if ( st_ivas->ini_active_frame == 0 && ivas_total_brate != FRAME_NO_DATA && ( cpe_brate < MASA_STEREO_MIN_BITRATE ) && st_ivas->nCPE == 1 ) @@ -243,6 +271,7 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); +#ifndef FIX_OMASA_BRSW #ifdef FIX_417_TD_DECORR_BRATE_SW /* TD Decorrelator */ if ( st_ivas->hDiracDecBin != NULL ) @@ -259,9 +288,40 @@ ivas_error ivas_omasa_dec_config( { return error; } +#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; +#ifdef FIX_OMASA_BRSW + /*-----------------------------------------------------------------* + * Renderer selection + *-----------------------------------------------------------------*/ + ivas_renderer_select( st_ivas ); + + /*-------------------------------------------------------------------* + * Reallocate rendering handles + *--------------------------------------------------------------------*/ + + if ( old_renderer_type != st_ivas->renderer_type ) + { + if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) + { + if ( ( error = ivas_mono_dmx_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( st_ivas->hMonoDmxRenderer != NULL ) + { + free( st_ivas->hMonoDmxRenderer ); + st_ivas->hMonoDmxRenderer = NULL; + } + } + } +#endif + /* objects renderer reconfig. */ if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) { @@ -331,6 +391,31 @@ ivas_error ivas_omasa_dec_config( } } } + +#ifdef FIX_OMASA_BRSW +#ifdef FIX_417_TD_DECORR_BRATE_SW + /*-----------------------------------------------------------------* + * TD Decorrelator + *-----------------------------------------------------------------*/ + + if ( st_ivas->hDiracDecBin != NULL ) + { + if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + + /*-----------------------------------------------------------------* + * CLDFB instances + *-----------------------------------------------------------------*/ + + if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif } return IVAS_ERR_OK; -- GitLab From 25a7e706e98cf94ad1aa81dc7a0fa8a64c82d31d Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Wed, 10 May 2023 15:13:56 +0200 Subject: [PATCH 0146/1418] disable flag DEBUG_MODE_INFO --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7cc706472c..4041f922c2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -58,7 +58,7 @@ #ifdef DEBUGGING -#define DEBUG_MODE_INFO /* output most important parameters to the subdirectory "res/" */ +/*#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/" */ -- GitLab From 42de1177a593842e889c6c0f27f361b1bd4d23a2 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Wed, 10 May 2023 15:24:24 +0200 Subject: [PATCH 0147/1418] wrap dbgwrite() within OMASA_ENERGIES under DEBUGGING flag --- lib_enc/ivas_enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index b945ac48c6..c15e4f0bf0 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -389,7 +389,9 @@ ivas_error ivas_enc( { flag_omasa_brate = 1; } +#ifdef DEBUGGING dbgwrite( &energy_ism, sizeof( float ), 1, 1, "en_ratio.bin" ); +#endif } #endif /* Analysis, decision about bitrates per channel & core coding */ -- GitLab From 206e675b7ce2443fd355fc16385295c469fbe073 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 10 May 2023 23:52:27 +1000 Subject: [PATCH 0148/1418] stack optimization with default rend options --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 51 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 917becccbd..5c06d98c06 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -209,6 +209,7 @@ #define ROM_TO_RAM /*switch to convert CQMF decoder tables to RAM*/ #define SPLIT_REND_CLANG_SAN_FIX #define SPLIT_REND_CLDFB_HUFF_SAN_FIX +#define SPLIT_REND_STACK_OPT #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 80d578188f..250445010c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -6077,6 +6077,30 @@ static ivas_error renderSbaToMultiBinaural( } #endif +#ifdef SPLIT_REND_STACK_OPT +static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput, + float Cldfb_Out_Real[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t low_res_pre_rend_rot ) +{ + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + + copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); + + ivas_rend_CldfbMultiBinRendProcess( + sbaInput->cldfbRendWrapper.hCldfbRend, + sbaInput->base.ctx.pHeadRotData, + &sbaInput->splitRendWrapper.multiBinPoseData, + Cldfb_RealBuffer, + Cldfb_ImagBuffer, + Cldfb_Out_Real, + Cldfb_Out_Imag, + low_res_pre_rend_rot ); + return IVAS_ERR_OK; +} +#endif + static ivas_error renderSbaToSplitBinaural( input_sba *sbaInput, #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -6112,6 +6136,13 @@ static ivas_error renderSbaToSplitBinaural( #if ( defined DEBUGGING ) || ( defined SPLIT_REND_WITH_HEAD_ROT ) if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { + +#ifdef SPLIT_REND_STACK_OPT + renderSbaToMultiBinauralCldfb( sbaInput, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + low_res_pre_rend_rot ); +#else float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -6126,6 +6157,7 @@ static ivas_error renderSbaToSplitBinaural( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, low_res_pre_rend_rot ); +#endif max_band = sbaInput->cldfbRendWrapper.hCldfbRend->max_band; } else @@ -6164,13 +6196,12 @@ static ivas_error renderSbaToSplitBinaural( } #endif -static ivas_error renderSbaToBinaural( +static ivas_error +renderSbaToBinaural( input_sba *sbaInput, const IVAS_REND_AudioConfig outConfig, IVAS_REND_AudioBuffer outAudio ) { - float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; @@ -6179,10 +6210,16 @@ static ivas_error renderSbaToBinaural( #if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT if ( sbaInput->base.ctx.hhRendererConfig[0]->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { - float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; +#ifdef SPLIT_REND_STACK_OPT + renderSbaToMultiBinauralCldfb( sbaInput, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + 0 ); +#else + float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; copyBufferToCLDFBarray( sbaInput->base.inputBuffer, Cldfb_RealBuffer, Cldfb_ImagBuffer ); @@ -6195,12 +6232,14 @@ static ivas_error renderSbaToBinaural( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, 0 ); - +#endif accumulateCLDFBArrayToBuffer( Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], &outAudio ); } else #endif { + float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + tmpRotBuffer = sbaInput->base.inputBuffer; tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); -- GitLab From 03186a11dd471e24ed24382d264b45e2862ea90a Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 19 May 2023 17:45:05 +1000 Subject: [PATCH 0149/1418] adding PCM output support to ivas SBA decoder in split rend mode --- apps/decoder.c | 71 +++++++++++++++++++++++++---- lib_dec/ivas_binRenderer_internal.c | 5 +- lib_dec/ivas_dec.c | 10 ++-- lib_dec/ivas_dirac_dec.c | 3 +- lib_dec/ivas_init_dec.c | 12 +++-- lib_dec/ivas_output_config.c | 6 +-- lib_dec/ivas_sba_dec.c | 8 ++-- lib_dec/ivas_spar_decoder.c | 2 +- lib_dec/lib_dec.c | 10 +++- lib_dec/lib_dec.h | 1 + lib_rend/ivas_output_init.c | 2 + lib_rend/ivas_splitRendererPre.c | 2 +- lib_rend/lib_rend.c | 2 +- 13 files changed, 105 insertions(+), 29 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 575a696452..0d9ce5fd0b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -117,7 +117,9 @@ typedef struct float no_diegetic_pan; bool renderConfigEnabled; char *renderConfigFilename; - +#ifdef SPLIT_REND_WITH_HEAD_ROT + char *outputMdFilename; +#endif #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC @@ -267,7 +269,7 @@ int main( /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB + && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM #endif ) { @@ -358,7 +360,7 @@ int main( /* sanity check */ if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB + && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM #endif ) { @@ -377,7 +379,7 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) + if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB || arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) { arg.enableHeadRotation = true; } @@ -489,7 +491,10 @@ int main( /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) && ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL ) && ( arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) ) + if ( ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM ) && + ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL ) && + ( arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) && + ( arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) ) { fprintf( stderr, "\nExternal Renderer Config is supported only when BINAURAL_ROOM is used as output OR when Split rendering mode is enabled. Exiting. \n" ); exit( -1 ); @@ -757,10 +762,14 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( output_config = IVAS_DEC_OUTPUT_BINAURAL; } #ifdef SPLIT_REND_WITH_HEAD_ROT - else if ( strcmp( argv_to_upper, "SPLIT_BINAURAL" ) == 0 ) + else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CLDFB" ) == 0 ) { output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB; } + else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 ) + { + output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM; + } #endif else if ( strcmp( argv_to_upper, "BINAURAL_ROOM" ) == 0 ) { @@ -830,6 +839,10 @@ static bool parseCmdlIVAS_dec( arg->renderConfigEnabled = false; arg->renderConfigFilename = NULL; +#ifdef SPLIT_REND_WITH_HEAD_ROT + arg->outputMdFilename = NULL; +#endif + arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->no_diegetic_pan = 0.f; @@ -1057,6 +1070,19 @@ static bool parseCmdlIVAS_dec( } i += 2; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else if ( strcmp( argv_to_upper, "-OM" ) == 0 ) + { + arg->outputMdFilename = argv[i + 1]; + if ( arg->outputMdFilename[0] == '\0' ) + { + fprintf( stderr, "Error: output metadata file path not specified\n\n" ); + usage_dec(); + return false; + } + i += 2; + } +#endif else if ( strcmp( argv_to_upper, "-NO_DIEGETIC_PAN" ) == 0 ) { i++; @@ -1197,7 +1223,7 @@ static void usage_dec( void ) fprintf( stdout, "---------------------\n" ); #ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); - fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, SPLIT_BINAURAL, EXT\n" ); + fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, BINAURAL_SPLIT_CLDFB, BINAURAL_SPLIT_PCM, EXT\n" ); #else fprintf( stdout, "OutputConf : Output configuration: MONO, STEREO, 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4, FOA,\n" ); fprintf( stdout, " HOA2, HOA3, BINAURAL, BINAURAL_ROOM, EXT\n" ); @@ -1242,6 +1268,9 @@ static void usage_dec( void ) fprintf( stdout, "-render_config File : Renderer configuration File\n" ); fprintf( stdout, "-no_diegetic_pan : panning mono non-diegetic 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" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + fprintf( stdout, "-om File : MD output file for BINAURAL_SPLIT_PCM output format\n" ); +#endif fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef DEBUGGING @@ -1343,6 +1372,22 @@ static ivas_error initOnFirstGoodFrame( else #endif { +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) + { + int16_t delayNumSamples_temp[3]; + int32_t delayTimeScale_temp; + IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ); + assert( arg.outputMdFilename != NULL ); + error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp ); + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "Could not open split rend metadata file %s\n", arg.outputWavFilename ); + exit( -1 ); + } + } +#endif + /* Open audio writer and write all previously skipped bad frames now that frame size is known */ if ( ( error = AudioFileWriter_open( ppAfWriter, arg.outputWavFilename, arg.output_Fs, *pNumOutChannels ) ) != IVAS_ERR_OK ) { @@ -1717,7 +1762,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hSplitRendFileReadWrite != NULL ) + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) ) { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written ) != IVAS_ERR_OK ) { @@ -1728,6 +1773,16 @@ static ivas_error decodeG192( else #endif { +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) ) + { + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nUnable to write to bitstream file!\n" ); + exit( -1 ); + } + } +#endif if ( delayNumSamples < nOutSamples ) { if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index d1942d94f5..7719f500dd 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -685,7 +685,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); - if ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG hBinRenderer->numPoses = pMultiBinPoseData->num_poses + 1; @@ -751,7 +751,8 @@ ivas_error ivas_binRenderer_open( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG hBinRenderer->numPoses = st_ivas->splitBinRend.splitrend.multiBinPoseData.num_poses + 1; diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index cc589fd7aa..4c9bf28a46 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -102,7 +102,8 @@ ivas_error ivas_dec( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hHeadTrackData, hSplitRendBits ); @@ -627,19 +628,22 @@ ivas_error ivas_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT /*split rendering process calls*/ - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; int16_t max_band; + int16_t pcm_out; hSplitBinRend = &st_ivas->splitBinRend; max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); + pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, hSplitBinRend->hSplitRendBits, hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, - max_band, output, 1, 0 ); + max_band, output, 1, pcm_out ); free( st_ivas->splitBinRend.hMultiBinCldfbData ); } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1e452a08f6..a29670397f 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2570,7 +2570,8 @@ void ivas_dirac_dec( Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t pos_idx; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 9f26e4e88f..721f30343b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -630,7 +630,7 @@ ivas_error ivas_init_decoder_front( if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -1217,7 +1217,8 @@ ivas_error ivas_init_decoder( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, @@ -1230,11 +1231,12 @@ ivas_error ivas_init_decoder( return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 1, 0 ); + hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); } #endif } @@ -2067,7 +2069,7 @@ static ivas_error doSanityChecks_IVAS( if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index bd4a3242d1..f4db4828e5 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -81,7 +81,7 @@ void ivas_renderer_select( if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -136,7 +136,7 @@ void ivas_renderer_select( *internal_config = output_config; if ( output_config == AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -153,7 +153,7 @@ void ivas_renderer_select( if ( output_config == AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 72f71e73d7..e551029c9a 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -241,7 +241,8 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->hBinRenderer == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, @@ -255,11 +256,12 @@ ivas_error ivas_sba_dec_reconfigure( return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 1, 0 ); + hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); } #endif } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index ea2da61151..5780c7da88 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1284,7 +1284,7 @@ void ivas_spar_dec_upmixer( { if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5b58da5874..c53df56c92 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -364,6 +364,10 @@ static AUDIO_CONFIG mapOutputFormat( { output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB; } + else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) + { + output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM; + } #endif else { @@ -1942,7 +1946,11 @@ static ivas_error get_channel_config( #ifdef SPLIT_REND_WITH_HEAD_ROT else if ( config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - strcpy( str, "Split_Binaural" ); + strcpy( str, "Binaural_Split_CLDFB" ); + } + else if ( config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + strcpy( str, "Binaural_Split_PCM" ); } #endif else if ( config == AUDIO_CONFIG_EXTERNAL ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index de65606568..d9608c2b83 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -59,6 +59,7 @@ typedef enum _IVAS_DEC_OUTPUT_CONFIG IVAS_DEC_OUTPUT_BINAURAL_ROOM, #ifdef SPLIT_REND_WITH_HEAD_ROT IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB, + IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM, #endif IVAS_DEC_OUTPUT_EXT, IVAS_DEC_OUTPUT_UNKNOWN = 0xffff diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 4802fcf388..bc3a637428 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -94,6 +94,7 @@ int16_t audioCfg2channels( case AUDIO_CONFIG_BINAURAL_ROOM: #ifdef SPLIT_REND_WITH_HEAD_ROT case AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif nchan_out = 2; break; @@ -223,6 +224,7 @@ void ivas_output_init( case AUDIO_CONFIG_BINAURAL_ROOM: #ifdef SPLIT_REND_WITH_HEAD_ROT case AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif case AUDIO_CONFIG_ISM1: case AUDIO_CONFIG_ISM2: diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index f498128c91..e6667c0d51 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1607,7 +1607,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, } if ( is_pcm_out == 0 ) { - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, 2, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate ) ); + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate ) ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 250445010c..dfa7a06e07 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2863,7 +2863,7 @@ static ivas_error initMasaDummyDecForBinauralOut( ivas_output_init( &( decDummy->hOutSetup ), output_config ); if ( output_config == AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { -- GitLab From 406ebc1503d25c7af0d98e41b32728feaff547ff Mon Sep 17 00:00:00 2001 From: rtyag Date: Mon, 22 May 2023 16:00:40 +1000 Subject: [PATCH 0150/1418] warning fix in MCT dec --- lib_dec/ivas_mct_dec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 845a5a6bd8..9c1aca1323 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1014,8 +1014,11 @@ static ivas_error ivas_mc_dec_reconfig( { ivas_binRenderer_close( &st_ivas->hBinRenderer ); } - +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != 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->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 ) ) ) +#endif { ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) #ifdef SPLIT_REND_WITH_HEAD_ROT -- GitLab From 7ad5cdbf88131ca9ac70ea4e719b4193cee9e5d5 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 24 May 2023 11:14:03 +0300 Subject: [PATCH 0151/1418] Add back support for 1TC MASA + objects. --- lib_enc/lib_enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 1420d8cef3..631b488626 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -389,6 +389,10 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( st_ivas->hEncoderConfig->nchan_inp = CPE_CHANNELS + numObjects; st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ break; + case IVAS_ENC_MASA_1CH: + st_ivas->hEncoderConfig->nchan_inp = 1 + numObjects; + st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; /* initialization only, might be changed later based on element_brate */ + break; default: return IVAS_ERR_INVALID_MASA_CONFIG; break; -- GitLab From 2047a0a4d7902e1b2f9649e995191f06c46c6baf Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 24 May 2023 12:05:06 +0300 Subject: [PATCH 0152/1418] Wrap debug output into DEBUG_MODE_INFO switch. --- lib_enc/ivas_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index c15e4f0bf0..cd97060613 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -389,7 +389,7 @@ ivas_error ivas_enc( { flag_omasa_brate = 1; } -#ifdef DEBUGGING +#ifdef DEBUG_MODE_INFO dbgwrite( &energy_ism, sizeof( float ), 1, 1, "en_ratio.bin" ); #endif } -- GitLab From 6d61e9152a10d6b3d50df030f9b18c6aec975143 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 26 May 2023 17:49:47 +0300 Subject: [PATCH 0153/1418] Fixes to merge of main up to 1bfc64ea --- lib_com/ivas_prot.h | 8 +- lib_dec/ivas_dirac_dec.c | 14 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 378 ++++++++++++------- 3 files changed, 243 insertions(+), 157 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 492ebd84ae..e609305047 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5537,11 +5537,9 @@ void ivas_omasa_dirac_rend( void preProcessStereoTransportsForMovedObjects( Decoder_Struct* st_ivas, - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const uint8_t nBins, - const uint8_t firstSubframe, - const uint8_t nSubframes + float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + const int16_t nBins ); ivas_error ivas_masa_ism_separate_object_renderer_open( diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index bcf788f3d2..c407a2b058 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2527,8 +2527,8 @@ void ivas_dirac_dec( float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; #ifdef MASA_AND_OBJECTS - float Cldfb_RealBuffer_Temp[2][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ - float Cldfb_ImagBuffer_Temp[2][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ + float Cldfb_RealBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ + float Cldfb_ImagBuffer_Temp[2][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; /* Todo Nokia: Temporary, to be removed once function calls have been refactored to accept another size */ #endif int16_t index, num_freq_bands; @@ -2718,8 +2718,8 @@ void ivas_dirac_dec( for ( ch = 0; ch < nchan_transport; ch++ ) { cldfbAnalysis_ts( &( output_f[sba_map_tc[ch]][hDirAC->num_freq_bands * index_slot] ), - Cldfb_RealBuffer_Temp[ch][index_slot], - Cldfb_ImagBuffer_Temp[ch][index_slot], + Cldfb_RealBuffer_Temp[ch][slot_idx], + Cldfb_ImagBuffer_Temp[ch][slot_idx], hDirAC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); } @@ -2727,7 +2727,7 @@ void ivas_dirac_dec( if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { - preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, (uint8_t) ( hDirAC->num_freq_bands ), (uint8_t) subframe_idx, 1 ); + preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_Temp, Cldfb_ImagBuffer_Temp, (uint8_t) ( hDirAC->num_freq_bands ) ); } } #endif @@ -2749,8 +2749,8 @@ void ivas_dirac_dec( { for ( ch = 0; ch < nchan_transport; ch++ ) { - mvr2r( Cldfb_RealBuffer_Temp[ch][index_slot], Cldfb_RealBuffer[ch][0], hDirAC->num_freq_bands ); - mvr2r( Cldfb_ImagBuffer_Temp[ch][index_slot], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands ); + mvr2r( Cldfb_RealBuffer_Temp[ch][slot_idx], Cldfb_RealBuffer[ch][0], hDirAC->num_freq_bands ); + mvr2r( Cldfb_ImagBuffer_Temp[ch][slot_idx], Cldfb_ImagBuffer[ch][0], hDirAC->num_freq_bands ); } } #endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index c58326d884..38a9374f10 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -498,8 +498,13 @@ static void ivas_dirac_dec_binaural_internal( { DIRAC_DEC_HANDLE hDirAC; int16_t slot, ch, numInChannels; +#ifdef MASA_AND_OBJECTS + float Cldfb_RealBuffer_in[6][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_in[6][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer_in[4][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_in[4][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; +#endif float Rmat[3][3]; int16_t max_band_decorr; DIFFUSE_DISTRIBUTION_DATA diffuseDistData; @@ -511,10 +516,21 @@ static void ivas_dirac_dec_binaural_internal( /* The input channel number at this processing function (not nchan_transport) */ numInChannels = BINAURAL_CHANNELS; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->hOutSetup.separateChannelEnabled || ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) ) ) + { + numInChannels++; + } + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) + { + numInChannels += (uint8_t) st_ivas->nchan_ism; + } +#else if ( st_ivas->hOutSetup.separateChannelEnabled ) { numInChannels++; } +#endif Rmat[0][0] = 1.0f; Rmat[0][1] = 0.0f; @@ -634,6 +650,13 @@ static void ivas_dirac_dec_binaural_internal( ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, subframe ); } +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) + { + preProcessStereoTransportsForMovedObjects( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, nBins ); + } +#endif + if ( st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) { QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[subframe], Rmat ); @@ -1063,6 +1086,10 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric for ( bin = 0; bin < nBins; bin++ ) { float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ +#ifdef MASA_AND_OBJECTS + float diffusenessValForDecorrelationReduction = 1.0f; + float diffEneValForDecorrelationReduction; +#endif float surCoh = 0.0f, spreadCoh = 0.0f; /* Default values if spreadSurroundCoherenceApplied == false */ float diffEne, dirEne, meanEnePerCh; int16_t dirIndex; @@ -1081,6 +1108,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric float lRealp, lImagp, rRealp, rImagp; float lRealpTmp, lImagpTmp, rRealpTmp, rImagpTmp; float hrtfEne[BINAURAL_CHANNELS], hrtfCrossRe, hrtfCrossIm, ratio; +#ifdef MASA_AND_OBJECTS + uint8_t isIsmDirection = 0; +#endif if ( dirIndex == 0 ) /* For first of the two simultaneous directions */ { @@ -1089,15 +1119,55 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; } +#ifdef MASA_AND_OBJECTS + else if ( st_ivas->ivas_format != MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_ISM_FORMAT && dirIndex < hDirAC->numParametricDirections ) ) /* For second of the two simultaneous directions */ +#else else /* For second of the two simultaneous directions */ +#endif { aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; ratio = hDirAC->energy_ratio2[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; } +#ifdef MASA_AND_OBJECTS + else /* For object directions of MASA_ISM_FORMAT */ + { + isIsmDirection = 1; + uint16_t ismDirIndex; + ismDirIndex = dirIndex - hDirAC->numParametricDirections; + if ( st_ivas->hMasaIsmData->ism_is_edited[ismDirIndex] ) + { + aziDeg = st_ivas->hMasaIsmData->azimuth_ism_edited[ismDirIndex]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism_edited[ismDirIndex]; + } + else + { + aziDeg = st_ivas->hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx]; + eleDeg = st_ivas->hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx]; + } + ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; + spreadCoh = 0.0f; + } +#endif diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ +#ifdef MASA_AND_OBJECTS + if ( diffuseness < 0.0f ) + { + diffuseness = 0.0f; + } + if ( isIsmDirection ) + { + /* Objects cause lesser decorrelation reduction, to avoid removing all decorrelation when only objects are present */ + diffusenessValForDecorrelationReduction -= ratio * 0.5f; + } + else + { + diffusenessValForDecorrelationReduction -= ratio; + } +#endif + if ( separateCenterChannelRendering ) { /* In masa + mono rendering mode, the center directions originate from phantom sources, so the @@ -1233,13 +1303,32 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric diffuseness = max( 0.0f, diffuseness ); diffEne = diffuseness * meanEnePerCh; surCoh = hDirAC->surroundingCoherence[dirac_read_idx][bin]; + +#ifdef MASA_AND_OBJECTS + diffusenessValForDecorrelationReduction = max( 0.0f, diffusenessValForDecorrelationReduction ); + diffEneValForDecorrelationReduction = diffusenessValForDecorrelationReduction * meanEnePerCh; +#endif + if ( ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { if ( !h->renderStereoOutputInsteadOfBinaural ) { +#ifdef MASA_AND_OBJECTS + float spectrumModVal; + + idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); + /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ + spectrumModVal = ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; + diffEne *= spectrumModVal; +#else idx = min( bin, MASA_NUM_DEFINED_SUR_SPR_COH_ENE_BINS - 1 ); /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ diffEne *= ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; +#endif +#ifdef MASA_AND_OBJECTS + /* Modify also the value for decorrelation reduction */ + diffEneValForDecorrelationReduction *= spectrumModVal; +#endif } } h->ChEneOut[0][bin] += diffEne; /* Diff ene part*/ @@ -1265,7 +1354,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } /* Store parameters for formulating average diffuseness over frame */ +#ifdef MASA_AND_OBJECTS + h->frameMeanDiffuseness[bin] += diffEneValForDecorrelationReduction; +#else h->frameMeanDiffuseness[bin] += diffEne; +#endif frameMeanDiffusenessEneWeight[bin] += meanEnePerCh; } @@ -2048,7 +2141,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( } } #else - gainFactor = 0.8414f * sqrtf( h->earlyPartEneCorrection[bin] ); for ( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { @@ -3194,13 +3286,12 @@ static void preProcessStereoTransportsForMovedObjects( Decoder_Struct *st_ivas, - float inRe[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float inIm[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const uint8_t nBins, - const uint8_t firstSubframe, - const uint8_t nSubframes ) + float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + const int16_t nBins +) { - int16_t subframe, bin, ch, inCh, outCh, ismDirIndex, slot; + int16_t bin, ch, inCh, outCh, ismDirIndex, slot; DIRAC_DEC_HANDLE hDirAC; MASA_ISM_DATA_HANDLE hMasaIsmData; uint8_t enableCentering; @@ -3236,176 +3327,173 @@ void preProcessStereoTransportsForMovedObjects( } /* Perform object-movement based processing */ - for ( subframe = firstSubframe; subframe < ( firstSubframe + nSubframes ); subframe++ ) - { - dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; + dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; - for ( bin = 0; bin < nBins; bin++ ) + for ( bin = 0; bin < nBins; bin++ ) + { + float ismPreprocMtxNew[2][2]; + float ismPreprocMtxIncrement[2][2]; + float eneMove[2]; + float enePreserve[2]; + float ismRatioAcc; + float subframeEne; + float normEnes[2]; + float remainderNormEne; + + set_zero( ismPreprocMtxNew[0], 2 ); + set_zero( ismPreprocMtxNew[1], 2 ); + set_zero( ismPreprocMtxIncrement[0], 2 ); + set_zero( ismPreprocMtxIncrement[1], 2 ); + set_zero( eneMove, 2 ); + set_zero( enePreserve, 2 ); + ismRatioAcc = 0.0f; + subframeEne = 0.0f; + set_zero( normEnes, 2 ); + + /* Determine transport normalized energies and subframe energy */ + for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) { - float ismPreprocMtxNew[2][2]; - float ismPreprocMtxIncrement[2][2]; - float eneMove[2]; - float enePreserve[2]; - float ismRatioAcc; - float subframeEne; - float normEnes[2]; - float remainderNormEne; - - set_zero( ismPreprocMtxNew[0], 2 ); - set_zero( ismPreprocMtxNew[1], 2 ); - set_zero( ismPreprocMtxIncrement[0], 2 ); - set_zero( ismPreprocMtxIncrement[1], 2 ); - set_zero( eneMove, 2 ); - set_zero( enePreserve, 2 ); - ismRatioAcc = 0.0f; - subframeEne = 0.0f; - set_zero( normEnes, 2 ); - - /* Determine transport normalized energies and subframe energy */ - for ( slot = subframe * hDirAC->subframe_nbslots; slot < (int16_t) ( ( subframe + 1 ) * hDirAC->subframe_nbslots ); slot++ ) + for ( ch = 0; ch < 2; ch++ ) { - for ( ch = 0; ch < 2; ch++ ) - { - normEnes[ch] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; - normEnes[ch] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; - } + normEnes[ch] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; + normEnes[ch] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; } - subframeEne = normEnes[0] + normEnes[1]; - normEnes[0] /= fmaxf( 1e-12f, subframeEne ); - normEnes[1] /= fmaxf( 1e-12f, subframeEne ); - - /* For each ismDir, formulate a mix-matrix that moves object audio signals between - * left and right channels when needed. Make a combined matrix by a ratio-weighted sum */ - for ( ismDirIndex = 0; ismDirIndex < hDirAC->numIsmDirections; ismDirIndex++ ) - { - float panGainsOut[2]; - float panGainsIn[2]; - float ratio; - float panEnesOut[2]; - float panEnesIn[2]; - float centeringFactor; + } + subframeEne = normEnes[0] + normEnes[1]; + normEnes[0] /= fmaxf( 1e-12f, subframeEne ); + normEnes[1] /= fmaxf( 1e-12f, subframeEne ); - ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; + /* For each ismDir, formulate a mix-matrix that moves object audio signals between + * left and right channels when needed. Make a combined matrix by a ratio-weighted sum */ + for ( ismDirIndex = 0; ismDirIndex < hDirAC->numIsmDirections; ismDirIndex++ ) + { + float panGainsOut[2]; + float panGainsIn[2]; + float ratio; + float panEnesOut[2]; + float panEnesIn[2]; + float centeringFactor; - ismRatioAcc += ratio; + ratio = hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; - /* Get input and output panning gains */ - ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], - hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], - panGainsIn ); + ismRatioAcc += ratio; - if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) - { - ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism_edited[ismDirIndex], - hMasaIsmData->elevation_ism_edited[ismDirIndex], - panGainsOut ); - } - else - { - /* When not edited, input and output pan gains are the same */ - for ( ch = 0; ch < 2; ch++ ) - { - panGainsOut[ch] = panGainsIn[ch]; - } - } + /* Get input and output panning gains */ + ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism[ismDirIndex][dirac_read_idx], + hMasaIsmData->elevation_ism[ismDirIndex][dirac_read_idx], + panGainsIn ); - /* Determine pan enes */ + if ( hMasaIsmData->ism_is_edited[ismDirIndex] ) + { + ivas_get_stereo_panning_gains( hMasaIsmData->azimuth_ism_edited[ismDirIndex], + hMasaIsmData->elevation_ism_edited[ismDirIndex], + panGainsOut ); + } + else + { + /* When not edited, input and output pan gains are the same */ for ( ch = 0; ch < 2; ch++ ) { - panEnesOut[ch] = panGainsOut[ch] * panGainsOut[ch]; - panEnesIn[ch] = panGainsIn[ch] * panGainsIn[ch]; + panGainsOut[ch] = panGainsIn[ch]; } + } - if ( enableCentering ) - { - centeringFactor = fmaxf( 0.0f, 2.0f * fabsf( panEnesIn[0] - panEnesOut[0] ) - 1.0f ); - for ( ch = 0; ch < 2; ch++ ) - { - panEnesOut[ch] *= ( 1.0f - centeringFactor ); - panEnesOut[ch] += 0.5f * centeringFactor; - } - } + /* Determine pan enes */ + for ( ch = 0; ch < 2; ch++ ) + { + panEnesOut[ch] = panGainsOut[ch] * panGainsOut[ch]; + panEnesIn[ch] = panGainsIn[ch] * panGainsIn[ch]; + } + if ( enableCentering ) + { + centeringFactor = fmaxf( 0.0f, 2.0f * fabsf( panEnesIn[0] - panEnesOut[0] ) - 1.0f ); for ( ch = 0; ch < 2; ch++ ) { - float eneMoveThis; - float enePreserveThis; - eneMoveThis = fmaxf( 0.0f, panEnesIn[ch] - panEnesOut[ch] ); - enePreserveThis = panEnesIn[ch] - eneMoveThis; - - eneMove[ch] += ratio * eneMoveThis; - enePreserve[ch] += ratio * enePreserveThis; - - /* Subtract object parts from normEnes */ - normEnes[ch] -= panEnesIn[ch] * ratio; + panEnesOut[ch] *= ( 1.0f - centeringFactor ); + panEnesOut[ch] += 0.5f * centeringFactor; } } - /* Any remaining (non-object) energy is set to be preserved at both channels */ - remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); for ( ch = 0; ch < 2; ch++ ) { - enePreserve[ch] += fmaxf( 0.0f, normEnes[ch] + remainderNormEne / 2.0f ); - } + float eneMoveThis; + float enePreserveThis; + eneMoveThis = fmaxf( 0.0f, panEnesIn[ch] - panEnesOut[ch] ); + enePreserveThis = panEnesIn[ch] - eneMoveThis; - /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix */ - for ( ch = 0; ch < 2; ch++ ) - { - float normVal; - hMasaIsmData->eneMoveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->eneMoveIIR[ch][bin] += eneMove[ch] * subframeEne; - hMasaIsmData->enePreserveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->enePreserveIIR[ch][bin] += enePreserve[ch] * subframeEne; - normVal = fmaxf( EPSILON, hMasaIsmData->eneMoveIIR[ch][bin] + hMasaIsmData->enePreserveIIR[ch][bin] ); - ismPreprocMtxNew[ch][ch] = sqrtf( hMasaIsmData->enePreserveIIR[ch][bin] / normVal ); - ismPreprocMtxNew[1 - ch][ch] = sqrtf( hMasaIsmData->eneMoveIIR[ch][bin] / normVal ); + eneMove[ch] += ratio * eneMoveThis; + enePreserve[ch] += ratio * enePreserveThis; + + /* Subtract object parts from normEnes */ + normEnes[ch] -= panEnesIn[ch] * ratio; } + } + + /* Any remaining (non-object) energy is set to be preserved at both channels */ + remainderNormEne = fmaxf( 0.0f, ( 1.0f - ismRatioAcc ) - normEnes[0] - normEnes[1] ); + for ( ch = 0; ch < 2; ch++ ) + { + enePreserve[ch] += fmaxf( 0.0f, normEnes[ch] + remainderNormEne / 2.0f ); + } + + /* Temporally average energy moving and preserving, and generate the transport signal preprocessing matrix */ + for ( ch = 0; ch < 2; ch++ ) + { + float normVal; + hMasaIsmData->eneMoveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->eneMoveIIR[ch][bin] += eneMove[ch] * subframeEne; + hMasaIsmData->enePreserveIIR[ch][bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->enePreserveIIR[ch][bin] += enePreserve[ch] * subframeEne; + normVal = fmaxf( EPSILON, hMasaIsmData->eneMoveIIR[ch][bin] + hMasaIsmData->enePreserveIIR[ch][bin] ); + ismPreprocMtxNew[ch][ch] = sqrtf( hMasaIsmData->enePreserveIIR[ch][bin] / normVal ); + ismPreprocMtxNew[1 - ch][ch] = sqrtf( hMasaIsmData->eneMoveIIR[ch][bin] / normVal ); + } - /* Get increment value for temporal interpolation */ - for ( inCh = 0; inCh < 2; inCh++ ) + /* Get increment value for temporal interpolation */ + for ( inCh = 0; inCh < 2; inCh++ ) + { + for ( outCh = 0; outCh < 2; outCh++ ) { - for ( outCh = 0; outCh < 2; outCh++ ) - { - ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] ) / (float) hDirAC->subframe_nbslots; - } + ismPreprocMtxIncrement[outCh][inCh] = ( ismPreprocMtxNew[outCh][inCh] - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] ) / (float) hDirAC->subframe_nbslots; } + } - /* Mix signals */ - for ( slot = subframe * hDirAC->subframe_nbslots; slot < (int16_t) ( ( subframe + 1 ) * hDirAC->subframe_nbslots ); slot++ ) - { - float eqVal; - float outSlotRe[2]; - float outSlotIm[2]; + /* Mix signals */ + for ( slot = 0; slot < hDirAC->subframe_nbslots; slot++ ) + { + float eqVal; + float outSlotRe[2]; + float outSlotIm[2]; - set_zero( outSlotRe, 2 ); - set_zero( outSlotIm, 2 ); + set_zero( outSlotRe, 2 ); + set_zero( outSlotIm, 2 ); - for ( outCh = 0; outCh < 2; outCh++ ) + for ( outCh = 0; outCh < 2; outCh++ ) + { + for ( inCh = 0; inCh < 2; inCh++ ) { - for ( inCh = 0; inCh < 2; inCh++ ) - { - hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] += ismPreprocMtxIncrement[outCh][inCh]; - outSlotRe[outCh] += inRe[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; - outSlotIm[outCh] += inIm[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; - } + hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin] += ismPreprocMtxIncrement[outCh][inCh]; + outSlotRe[outCh] += inRe[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; + outSlotIm[outCh] += inIm[inCh][slot][bin] * hMasaIsmData->ismPreprocMatrix[outCh][inCh][bin]; } + } - /* IIR average the energy measures and determine and apply energy-preserving equalizer */ - hMasaIsmData->preprocEneTarget[bin] *= STEREO_PREPROCESS_IIR_FACTOR; - hMasaIsmData->preprocEneRealized[bin] *= STEREO_PREPROCESS_IIR_FACTOR; - for ( ch = 0; ch < 2; ch++ ) - { - hMasaIsmData->preprocEneTarget[bin] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; - hMasaIsmData->preprocEneTarget[bin] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; - hMasaIsmData->preprocEneRealized[bin] += outSlotRe[ch] * outSlotRe[ch]; - hMasaIsmData->preprocEneRealized[bin] += outSlotIm[ch] * outSlotIm[ch]; - } - eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[bin] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[bin] ) ) ); - for ( ch = 0; ch < 2; ch++ ) - { - inRe[ch][slot][bin] = outSlotRe[ch] * eqVal; - inIm[ch][slot][bin] = outSlotIm[ch] * eqVal; - } + /* IIR average the energy measures and determine and apply energy-preserving equalizer */ + hMasaIsmData->preprocEneTarget[bin] *= STEREO_PREPROCESS_IIR_FACTOR; + hMasaIsmData->preprocEneRealized[bin] *= STEREO_PREPROCESS_IIR_FACTOR; + for ( ch = 0; ch < 2; ch++ ) + { + hMasaIsmData->preprocEneTarget[bin] += inRe[ch][slot][bin] * inRe[ch][slot][bin]; + hMasaIsmData->preprocEneTarget[bin] += inIm[ch][slot][bin] * inIm[ch][slot][bin]; + hMasaIsmData->preprocEneRealized[bin] += outSlotRe[ch] * outSlotRe[ch]; + hMasaIsmData->preprocEneRealized[bin] += outSlotIm[ch] * outSlotIm[ch]; + } + eqVal = fminf( 4.0f, sqrtf( hMasaIsmData->preprocEneTarget[bin] / fmaxf( 1e-12f, hMasaIsmData->preprocEneRealized[bin] ) ) ); + for ( ch = 0; ch < 2; ch++ ) + { + inRe[ch][slot][bin] = outSlotRe[ch] * eqVal; + inIm[ch][slot][bin] = outSlotIm[ch] * eqVal; } } } -- GitLab From 81183cb776db7ae68164a3e0b1227874844dffd4 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Wed, 31 May 2023 16:12:49 +0200 Subject: [PATCH 0154/1418] Corrected bugs reported as part of crosscheck feedback --- lib_util/render_config_reader.c | 57 ++++++++++--------- ...generate_acoustic_environments_metadata.py | 20 +++---- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 581a240a52..68296169de 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -412,7 +412,7 @@ const float defaultFrequencyGrid_8[] = { *-----------------------------------------------------------------------------------------*/ static ivas_error read_bits( RenderConfigReader *this, /* i/o : Renderer config reader handle */ - uint32_t *pTarget, /* i/o : Target read data pointer */ + uint32_t *pTarget, /* o : Target read data pointer */ const size_t nBits /* i : Number of bits to read */ ) { @@ -430,6 +430,7 @@ static ivas_error read_bits( return IVAS_ERR_INVALID_RENDER_CONFIG; } + *pTarget = 0; for ( n = 0; n < nBits; n++ ) { nByte = ( this->readOffset + n ) >> 3; @@ -451,7 +452,6 @@ static ivas_error read_bool( uint32_t *pResult /* o : Target read data pointer */ ) { - *pResult = false; return read_bits( this, pResult, 1 ); } @@ -513,10 +513,14 @@ static ivas_error read_code_word( uint8_t size; uint8_t n; uint32_t code; + uint32_t bits; + uint32_t nr_bits; uint8_t len; minLen = 255; maxLen = 0; + bits = 0; + nr_bits = 0; code = 0; if ( pResult == NULL ) @@ -624,11 +628,12 @@ static ivas_error read_code_word( } for ( len = minLen; len <= maxLen; len++ ) { - if ( ( error = read_bits( this, &code, ( len == minLen ) ? minLen : 1 ) ) != IVAS_ERR_OK ) + nr_bits = ( len == minLen ) ? minLen : 1; + if ( ( error = read_bits( this, &bits, nr_bits ) ) != IVAS_ERR_OK ) { return error; } - + code = ( code << nr_bits ) | bits; for ( n = 0; n < size; n++ ) { if ( code == pCodes[n] && len == pLengths[n] ) @@ -835,7 +840,7 @@ static ivas_error get_distance( if ( isSmall == false ) { /* addHectometers flag */ - if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( this, &flag ) ) != IVAS_ERR_OK ) { return error; } @@ -850,7 +855,7 @@ static ivas_error get_distance( *pResult += value * 100.0f; /* addKilometers flag */ - if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( this, &flag ) ) != IVAS_ERR_OK ) { return error; } @@ -865,28 +870,27 @@ static ivas_error get_distance( *pResult += value * 1000.0f; /* addKilometers flag */ - if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( this, &flag ) ) != IVAS_ERR_OK ) { return error; } } } + } - /* addCentimeters flag */ - if ( ( error = read_bits( this, &flag, 1 ) ) != IVAS_ERR_OK ) + /* addCentimeters flag */ + if ( ( error = read_bool( this, &flag ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( flag == true ) + { + /* Centimeters */ + if ( ( error = read_code_word( this, RC_LUT_CENTIMETERS, &value ) ) != IVAS_ERR_OK ) { return error; } - if ( flag == true ) - { - /* Centimeters */ - /* Kilometers */ - if ( ( error = read_code_word( this, RC_LUT_CENTIMETERS, &value ) ) != IVAS_ERR_OK ) - { - return error; - } - *pResult += value * 0.01f; - } + *pResult += value * 0.01f; } return IVAS_ERR_OK; @@ -1240,7 +1244,7 @@ static ivas_error RenderConfigReader_readReverb( /****************************/ /* Read the presence flag */ /****************************/ - if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) { return error; } @@ -1506,7 +1510,7 @@ static ivas_error RenderConfigReader_readReverb( #ifdef CONTROL_METADATA_EARLY_REFLECTIONS /* Has early reflections */ - if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) { return error; } @@ -1556,7 +1560,7 @@ static ivas_error RenderConfigReader_readReverb( } /* Has listener origin */ - if ( ( error = read_bits( pRenderConfigReader, &value, 1 ) ) != IVAS_ERR_OK ) + if ( ( error = read_bool( pRenderConfigReader, &value ) ) != IVAS_ERR_OK ) { return error; } @@ -1592,6 +1596,10 @@ static ivas_error RenderConfigReader_readReverb( { pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->y *= -1.0f; } + if ( ( error = get_distance( pRenderConfigReader, true, &pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->z ) ) != IVAS_ERR_OK ) + { + return error; + } } } #endif @@ -1942,10 +1950,7 @@ void RenderConfigReader_close( #ifdef CONTROL_METADATA_EARLY_REFLECTIONS if ( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections != NULL ) { - if ( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pListenerOrigin != NULL ) - { - free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pListenerOrigin ); - } + free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pListenerOrigin ); free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections->pAbsCoeff ); free( ( *ppRenderConfigReader )->pAE[n].pEarlyReflections ); } diff --git a/scripts/reverb/generate_acoustic_environments_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py index 77c9841b40..9fc9c6a3ca 100644 --- a/scripts/reverb/generate_acoustic_environments_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -294,7 +294,7 @@ def get_distance_code(distance, isSmallScene = True): code = metersCode[m] if isSmallScene: - assert(m == hm == km == 0) + assert(hm == km == 0) else: # large scenes if hm > 0 or km > 0: @@ -359,7 +359,7 @@ def test(): string += concatenate(lambda d : get_distance_code(d, False), [d for d in range(20 * 1000)]) string += concatenate(lambda d : get_distance_code(d, False), [d / 10 for d in range(20 * 1000)]) string += concatenate(lambda d : get_distance_code(d, False), [d / 100 for d in range(20 * 1000)]) - string += concatenate(lambda d : get_distance_code(d, True), [d / 100 for d in range( 100)]) + string += concatenate(lambda d : get_distance_code(d, True), [d / 100 for d in range(10 * 1000)]) # absorption encoding string += concatenate(get_absorption_code, [a / 100 for a in range(100 + 1)]) @@ -450,7 +450,7 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re 2.6267e-08 ]) + '1' # hasEarlyReflections - + concatenate(lambda d : get_distance_code(d, False), + + concatenate(lambda d : get_distance_code(d, True), [ 3.0, 4.0, 2.5 ]) # room dimensions + get_count_or_index_code(0) # FreqGridID @@ -461,7 +461,7 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re , endian='big') - file = open('rend_config_renderer.dat', 'wb') + file = open('rend_config_renderer_cfg_plus_early_reflections_no_listener_origin.dat', 'wb') data.tofile(file) file.close() @@ -507,7 +507,7 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re 2.6267e-08 ]) + '1' # hasEarlyReflections - + concatenate(lambda code : get_distance_code(code, False), + + concatenate(lambda code : get_distance_code(code, True), [ 3.0, 4.0, 2.5 ]) # room dimensions + get_count_or_index_code(0) # FreqGridID @@ -515,14 +515,14 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_re [ 0.8, 0.8, 0.8, 0.8, 0.2, 0.6 ]) + '1' # listener origin flag - + '1' # positive x origin - + '0' # negative y origin - + concatenate(lambda d : get_distance_code(d, False), + + '1' # is possitive x + + '0' # is possitive y + + concatenate(lambda d : get_distance_code(d, True), [ 0.5, 0.5, 1.5 ]) # listener origin (x, y, z) , endian='big') - file = open('rend_config_renderer.dat', 'wb') + file = open('rend_config_renderer_cfg_plus_early_reflections_listener_origin.dat', 'wb') data.tofile(file) file.close() @@ -616,5 +616,5 @@ generate_reverb_payload_equivalent_to_rend_config_renderer_cfg() generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() generate_reverb_payload_equivalent_to_rend_config_recreation_cfg() -#generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin() #generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_listener_origin() +#generate_reverb_payload_equivalent_to_rend_config_renderer_cfg_plus_early_reflections_no_listener_origin() -- GitLab From 02ec59ebe8353da6689f2460553dbb60d3dd4d45 Mon Sep 17 00:00:00 2001 From: Rivukanta Bhattacharya <100792@ittiam.com> Date: Thu, 1 Jun 2023 20:20:20 +0530 Subject: [PATCH 0155/1418] SBA VLBR 20ms Optimization --- lib_com/ivas_prot.h | 4 ++ lib_com/options.h | 4 ++ lib_dec/ivas_dec.c | 8 +++ lib_dec/ivas_jbm_dec.c | 8 +++ lib_dec/ivas_masa_dec.c | 4 ++ lib_dec/ivas_sba_dec.c | 4 ++ lib_dec/ivas_sba_rendering_internal.c | 9 +++ lib_dec/ivas_spar_decoder.c | 7 +++ lib_dec/ivas_spar_md_dec.c | 83 +++++++++++++++++++++++++-- lib_rend/ivas_sba_rendering.c | 37 ++++++++++-- 10 files changed, 160 insertions(+), 8 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f455c552a5..ff4c59af56 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4395,6 +4395,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ +#ifdef VLBR_20MS_MD + , + const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ +#endif ); /* AGC */ diff --git a/lib_com/options.h b/lib_com/options.h index 8a491e2499..ccbaa53ff0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -209,6 +209,8 @@ #define FIX_468_16KHZ_PUPMIX /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */ #define FIX_499_DFT_STEREO_PLC /* Eri: Fix for issue 499: Wrong past memory addressed for computing energy of DFT stereo residual ECU frame */ #define FIX_489_COV_SMOOTHING /* Dlb: Fix covariance smoothing for ParamUpmix */ +#define FIX_501_TABLE_IDX_INIT /* Dlb: Fix for the issue 501 */ + #define FIX_485_STATIC_BUFFERS /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */ #define FIX_I503_ASAN_ERROR_IND_LIST /* VA: fix issue #503: address sanitizer error with IND_LIST_DYN */ #define FIX_473_JITTER_NONDIEGETIC_PANNING /* FhG,Orange: add missing non-diegetic panning to JITTER */ @@ -232,6 +234,8 @@ #define FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER /* ..\apps\renderer.c(240): .... (todo: implementation)",*/ #define REMOVE_OBS_CODE /* FhG: Remove unnecessary assignement after LFE cleanup (Issue #451)*/ +#define VLBR_20MS_MD /* Dlb: SBA VLBR 20ms Optimization*/ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 82f03fdb3b..edec0deeb0 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -69,6 +69,9 @@ ivas_error ivas_dec( #ifdef JBM_TSM_ON_TCS float *p_output[MAX_OUTPUT_CHANNELS]; #endif +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; +#endif error = IVAS_ERR_OK; @@ -458,7 +461,12 @@ ivas_error ivas_dec( #endif { +#ifdef VLBR_20MS_MD + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); +#else ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame ); +#endif } #ifdef JBM_TSM_ON_TCS #ifndef SBA_MODE_CLEAN_UP diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 04ae490414..3248c2d60a 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -78,6 +78,9 @@ ivas_error ivas_jbm_dec_tc( AUDIO_CONFIG output_config; ivas_error error; float *p_output[MAX_TRANSPORT_CHANNELS]; +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; +#endif error = IVAS_ERR_OK; @@ -311,7 +314,12 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif { +#ifdef VLBR_20MS_MD + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame, num_md_sub_frames ); +#else ivas_sba_mix_matrix_determiner( st_ivas->hSpar, output, st_ivas->bfi, nchan_remapped, output_frame ); +#endif } #ifndef SBA_MODE_CLEAN_UP else if ( st_ivas->sba_mode == SBA_MODE_SPAR ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 8d6cebe036..34bf8c576d 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1414,7 +1414,11 @@ void ivas_spar_param_to_masa_param_mapping( else { #ifdef JBM_TSM_ON_TCS +#ifdef VLBR_20MS_MD + mixer_mat_index = ( ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) == 1 ) ? 0 : ( sf - SPAR_META_DELAY_SUBFRAMES ); +#else mixer_mat_index = sf - SPAR_META_DELAY_SUBFRAMES; +#endif #else mixer_mat_index = subframe - SPAR_META_DELAY_SUBFRAMES; #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 478749ddc0..d7ef992b36 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -176,7 +176,11 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } +#ifdef VLBR_20MS_MD + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate >= IVAS_24k4 && ivas_total_brate < IVAS_24k4 ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) +#else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) +#endif { ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index dd4af01ccf..1e4c9eb9e6 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -653,6 +653,10 @@ void ivas_sba_mix_matrix_determiner( const int16_t bfi, /* i : BFI flag */ const int16_t nchan_remapped, /* i : num channels after remapping of TCs */ const int16_t output_frame /* i : output frame length */ +#ifdef VLBR_20MS_MD + , + const int16_t num_md_sub_frames /* i : number of subframes in mixing matrix */ +#endif ) { int16_t i, ch; @@ -696,8 +700,13 @@ void ivas_sba_mix_matrix_determiner( /* Mixing matrix determiner */ num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; +#ifdef VLBR_20MS_MD + ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi, + num_md_sub_frames ); +#else ivas_spar_dec_gen_umx_mat( hSpar->hMdDec, nchan_transport, num_bands_out, bfi, MAX_PARAM_SPATIAL_SUBFRAMES ); +#endif return; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 0d028b2359..06e50255fa 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -123,7 +123,14 @@ ivas_error ivas_spar_dec_open( return error; } hSpar->hMdDec->td_decorr_flag = 1; +#ifdef FIX_501_TABLE_IDX_INIT + if ( hSpar->hTdDecorr && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) + { + hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[hSpar->hMdDec->table_idx].td_ducking; + } +#else hSpar->hMdDec->table_idx = -1; +#endif /* set FB config. */ active_w_mixing = -1; diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index cf03e7b9d8..8ceda9fb18 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -83,9 +83,11 @@ static ivas_error ivas_spar_set_dec_config( ivas_spar_md_dec_state_t *hMdDec, co static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decoder_State *st, const int16_t bw, const int16_t num_bands, int16_t *num_dmx_per_band, int16_t *num_dec_per_band ); static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 ); - +#ifdef FIX_501_TABLE_IDX_INIT +static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode, const int32_t last_active_brate ); +#else static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode ); - +#endif /*------------------------------------------------------------------------- * ivas_spar_md_dec_matrix_open() @@ -254,6 +256,12 @@ int16_t ivas_get_spar_dec_md_num_subframes( num_subframes = 1; } } +#ifdef VLBR_20MS_MD + if ( ivas_total_brate < IVAS_24k4 ) + { + num_subframes = 1; + } +#endif return ( num_subframes ); } @@ -289,11 +297,29 @@ ivas_error ivas_spar_md_dec_open( return error; } +#ifdef FIX_501_TABLE_IDX_INIT + if ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) + { + if ( sid_format == SID_SBA_2TC ) + { + hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } + else + { + hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_24k4, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } + } + else + { + hMdDec->table_idx = ivas_get_spar_table_idx( hDecoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL ); + } +#else hMdDec->table_idx = 0; /* just to initialize state variables*/ if ( ( hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) && ( sid_format == SID_SBA_2TC ) ) { hMdDec->table_idx = ivas_get_spar_table_idx( IVAS_48k, sba_order, SPAR_CONFIG_BW, NULL, NULL ); } +#endif if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels, sba_order ) ) != IVAS_ERR_OK ) { return error; @@ -671,7 +697,12 @@ void ivas_spar_md_dec_process( ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, - ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode ); + ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode +#ifdef FIX_501_TABLE_IDX_INIT + , + st_ivas->last_active_ivas_total_brate +#endif + ); #if 0 { @@ -1707,7 +1738,12 @@ static void ivas_spar_dec_parse_md_bs( int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, - const int16_t sba_inactive_mode ) + const int16_t sba_inactive_mode +#ifdef FIX_501_TABLE_IDX_INIT + , + const int32_t last_active_brate +#endif +) { int16_t i, j, k, num_bands; int16_t ii, jj, ndec, ndm, b, idx; @@ -1718,6 +1754,9 @@ static void ivas_spar_dec_parse_md_bs( int16_t planarCP; float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; +#ifdef FIX_501_TABLE_IDX_INIT + int16_t bw_final, bw_fact; +#endif *dtx_vad = 1; *bands_bw = 1; @@ -1790,13 +1829,33 @@ static void ivas_spar_dec_parse_md_bs( ivas_parse_parameter_bitstream_dtx( &hMdDec->spar_md, st0, *bands_bw, *nB, hMdDec->spar_md_cfg.num_dmx_chans_per_band, hMdDec->spar_md_cfg.num_decorr_per_band ); + +#ifdef FIX_501_TABLE_IDX_INIT + if ( last_active_brate >= IVAS_24k4 ) + { + bw_final = 1; + } + else + { + bw_final = 2; + } + bw_fact = *bands_bw / bw_final; +#endif for ( i = *nB - 1; i >= 0; i-- ) { +#ifdef FIX_501_TABLE_IDX_INIT + ndec = hMdDec->spar_md_cfg.num_decorr_per_band[bw_fact * i]; + + for ( b = bw_fact - 1; b >= 0; b-- ) + { + idx = i * bw_fact + b; +#else ndec = hMdDec->spar_md_cfg.num_decorr_per_band[( *bands_bw ) * i]; for ( b = *bands_bw - 1; b >= 0; b-- ) { idx = i * *bands_bw + b; +#endif for ( j = 0; j < FOA_CHANNELS - 1; j++ ) { hMdDec->spar_md.band_coeffs[idx].pred_re[j] = hMdDec->spar_md.band_coeffs[i].pred_re[j]; @@ -1809,8 +1868,13 @@ static void ivas_spar_dec_parse_md_bs( } } +#ifdef FIX_501_TABLE_IDX_INIT + *bands_bw = bw_final; + *nB = num_bands / bw_final; +#else *nB = num_bands; *bands_bw = 1; +#endif return; } @@ -3081,6 +3145,12 @@ void ivas_spar_to_dirac( } } } +#ifdef VLBR_20MS_MD + int16_t num_md_sub_frames; + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, st_ivas->hDecoderConfig->ivas_total_brate ); + ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, num_md_sub_frames, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, + end_band, num_bands_out / bw, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL, st_ivas->hQMetaData->useLowerRes, active_w_vlbr ); +#else int16_t num_subframes; num_subframes = MAX_PARAM_SPATIAL_SUBFRAMES; if ( st_ivas->hQMetaData->useLowerRes ) @@ -3089,12 +3159,17 @@ void ivas_spar_to_dirac( } ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, num_subframes, NULL, &hMdDec->spar_md, &hMdDec->spar_md_cfg, end_band, num_bands_out / bw, ( hMdDec->spar_hoa_md_flag ) ? 1 : sba_order_internal, dtx_vad, NULL, st_ivas->hQMetaData->useLowerRes, active_w_vlbr ); +#endif if ( st_ivas->hQMetaData->useLowerRes && dtx_vad ) { for ( band = SPAR_DIRAC_SPLIT_START_BAND; band < IVAS_MAX_NUM_BANDS; band++ ) { +#ifdef VLBR_20MS_MD + for ( block = 1; block < num_md_sub_frames; block++ ) +#else for ( block = 1; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) +#endif { for ( int16_t i = 0; i < FOA_CHANNELS - 1; i++ ) /* pred coefficient index (index 0, 1, 2 predicts Y, Z, X respectively) */ { diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index 059cd847e1..3e36f173ef 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -69,6 +69,11 @@ void ivas_sba_prototype_renderer( #ifdef JBM_TSM_ON_TCS int16_t slot_idx_start, md_idx; #endif +#ifdef VLBR_20MS_MD + int16_t sf_idx_flag, num_md_sub_frames; + sf_idx_flag = 0; + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); +#endif push_wmops( "ivas_sba_prototype_renderer" ); @@ -168,16 +173,40 @@ void ivas_sba_prototype_renderer( mvr2r( hSpar->hMdDec->mixer_mat_prev[3][0][0], hSpar->hMdDec->mixer_mat_prev[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); mvr2r( hSpar->hMdDec->mixer_mat_prev[4][0][0], hSpar->hMdDec->mixer_mat_prev[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) +#ifdef VLBR_20MS_MD + if ( num_md_sub_frames == 1 ) { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + if ( !sf_idx_flag ) { - for ( b = 0; b < num_spar_bands; b++ ) + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + { + for ( b = 0; b < num_spar_bands; b++ ) + { + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b]; + } + } } } + sf_idx_flag = 1; } + else + { +#endif + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) + { + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + { + for ( b = 0; b < num_spar_bands; b++ ) + { + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; + } + } + } +#ifdef VLBR_20MS_MD + } +#endif } #endif } -- GitLab From 3954aac564378774877c3a45cd748bfdcec3299d Mon Sep 17 00:00:00 2001 From: Rivukanta Bhattacharya <100792@ittiam.com> Date: Fri, 2 Jun 2023 19:04:28 +0530 Subject: [PATCH 0156/1418] Minor modification --- lib_dec/ivas_sba_dec.c | 2 +- lib_dec/ivas_spar_md_dec.c | 4 ++++ lib_rend/ivas_sba_rendering.c | 38 ++++++++--------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d7ef992b36..6bce1610b7 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -177,7 +177,7 @@ ivas_error ivas_sba_dec_reconfigure( } #ifdef VLBR_20MS_MD - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate >= IVAS_24k4 && ivas_total_brate < IVAS_24k4 ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) + if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) #else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) #endif diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 8ceda9fb18..c01323d126 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -3183,7 +3183,11 @@ void ivas_spar_to_dirac( } } /* expand DirAC TC 20ms MD for residual channels to all subframes*/ +#ifdef VLBR_20MS_MD + for ( block = 0; block < num_md_sub_frames; block++ ) +#else for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) +#endif { for ( band = SPAR_DIRAC_SPLIT_START_BAND; band < IVAS_MAX_NUM_BANDS; band++ ) { diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index 3e36f173ef..c2e33ed74f 100644 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -70,8 +70,7 @@ void ivas_sba_prototype_renderer( int16_t slot_idx_start, md_idx; #endif #ifdef VLBR_20MS_MD - int16_t sf_idx_flag, num_md_sub_frames; - sf_idx_flag = 0; + int16_t num_md_sub_frames; num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); #endif @@ -166,6 +165,9 @@ void ivas_sba_prototype_renderer( { /* we have crossed an unadapted parameter sf border, update previous mixing matrices */ int16_t md_sf = md_idx / JBM_CLDFB_SLOTS_IN_SUBFRAME; +#ifdef VLBR_20MS_MD + md_sf = ( num_md_sub_frames == MAX_PARAM_SPATIAL_SUBFRAMES ) ? md_sf : 0; +#endif hSpar->i_subframe++; hSpar->i_subframe = min( hSpar->i_subframe, MAX_PARAM_SPATIAL_SUBFRAMES ); mvr2r( hSpar->hMdDec->mixer_mat_prev[1][0][0], hSpar->hMdDec->mixer_mat_prev[0][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); @@ -173,40 +175,16 @@ void ivas_sba_prototype_renderer( mvr2r( hSpar->hMdDec->mixer_mat_prev[3][0][0], hSpar->hMdDec->mixer_mat_prev[2][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); mvr2r( hSpar->hMdDec->mixer_mat_prev[4][0][0], hSpar->hMdDec->mixer_mat_prev[3][0][0], IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_FB_MIXER_IN_CH * IVAS_MAX_NUM_BANDS ); -#ifdef VLBR_20MS_MD - if ( num_md_sub_frames == 1 ) - { - if ( !sf_idx_flag ) - { - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) - { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( b = 0; b < num_spar_bands; b++ ) - { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b]; - } - } - } - } - sf_idx_flag = 1; - } - else + for ( out_ch = 0; out_ch < numch_out; out_ch++ ) { -#endif - for ( out_ch = 0; out_ch < numch_out; out_ch++ ) + for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) + for ( b = 0; b < num_spar_bands; b++ ) { - for ( b = 0; b < num_spar_bands; b++ ) - { - hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; - } + hSpar->hMdDec->mixer_mat_prev[4][out_ch][in_ch][b] = hSpar->hMdDec->mixer_mat[out_ch][in_ch][b + md_sf * IVAS_MAX_NUM_BANDS]; } } -#ifdef VLBR_20MS_MD } -#endif } #endif } -- GitLab From b156afd1db211b069254be7b9f0fe0dd158f82cb Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 6 Jun 2023 23:25:15 +0200 Subject: [PATCH 0157/1418] clang formatting updates --- lib_rend/lib_rend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2075acacbd..29f1da4482 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4571,8 +4571,8 @@ static ivas_error renderIsmToBinauralRoom( if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM, - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *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, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif { return error; -- GitLab From ac2fb24d1100ea9a21800cb5c6bedb8b85bb1e8c Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 7 Jun 2023 12:18:44 +0200 Subject: [PATCH 0158/1418] integration of contributions 21 and 35 as per working assumption from 2023.06.01 meeting --- .gitignore | 1 + .gitlab-ci-custom.yml | 2 +- .gitlab-ci.yml | 4 +- CMakeLists.txt | 33 +- Makefile | 2 +- ...t_renderer_config_1536_2dof_tdposecorr.txt | 12 + ...t_renderer_config_1792_3dof_tdposecorr.txt | 12 + ...it_renderer_config_320_0dof_tdposecorr.txt | 12 + ...t_renderer_config_768_1dof_hoa_lc3plus.txt | 11 + ...it_renderer_config_768_1dof_tdposecorr.txt | 12 + .../split_renderer_config_768_2dof.txt | 10 + ...it_renderer_config_HBR_1dof_tdposecorr.txt | 12 + apps/decoder.c | 26 +- apps/renderer.c | 37 +- ci/comment_defines.py | 47 + ci/disable_ram_counting.py | 20 - lib_com/common_api_types.h | 25 + lib_com/ivas_cnst.h | 20 +- lib_com/ivas_error.h | 7 + lib_com/options.h | 7 + lib_dec/FEC_HQ_phase_ecu.c | 12 + lib_dec/ivas_dec.c | 28 +- lib_dec/ivas_init_dec.c | 44 +- lib_dec/ivas_sba_dec.c | 18 +- lib_dec/lib_dec.c | 20 +- lib_dec/lib_dec.h | 2 +- lib_dec/rom_dec.c | 4 + lib_dec/rom_dec.h | 4 + lib_rend/ivas_lc3plus_common.c | 49 + lib_rend/ivas_lc3plus_common.h | 53 + lib_rend/ivas_lc3plus_dec.c | 678 ++++++ lib_rend/ivas_lc3plus_dec.h | 138 ++ lib_rend/ivas_lc3plus_enc.c | 296 +++ lib_rend/ivas_lc3plus_enc.h | 73 + lib_rend/ivas_objectRenderer.c | 137 ++ lib_rend/ivas_objectRenderer_sfx.c | 8 + lib_rend/ivas_prot_rend.h | 34 +- lib_rend/ivas_render_config.c | 5 + lib_rend/ivas_rotation.c | 2 +- lib_rend/ivas_splitRend_lcld_dec.c | 4 + lib_rend/ivas_splitRend_lcld_enc.c | 8 +- lib_rend/ivas_splitRendererPost.c | 21 +- lib_rend/ivas_splitRendererPre.c | 503 ++++- lib_rend/ivas_splitRenderer_utils.c | 129 ++ lib_rend/ivas_stat_rend.h | 25 + lib_rend/lc3plus_codec/.gitignore | 3 + lib_rend/lc3plus_codec/README.md | 6 + lib_rend/lc3plus_codec/get_lc3plus.sh | 7 + lib_rend/lc3plus_codec/lc3plus.patch | 1571 +++++++++++++ lib_rend/lib_rend.c | 582 ++++- lib_rend/lib_rend.h | 4 + lib_util/render_config_reader.c | 11 + lib_util/split_render_file_read_write.c | 44 +- lib_util/split_render_file_read_write.h | 14 +- scripts/cppp/.gitignore | 2 + scripts/prepare_instrumentation.sh | 6 +- scripts/split_rendering/lc3plus/.gitignore | 1 + .../lc3plus/ivas_lc3plus_unit_test.c | 632 ++++++ ...vas_lc3plus_unit_test_selective_decoding.c | 1954 +++++++++++++++++ .../lc3plus/split_rend_lc3plus_cmdlines.py | 173 ++ 60 files changed, 7437 insertions(+), 180 deletions(-) create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_768_2dof.txt create mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt create mode 100755 ci/comment_defines.py delete mode 100755 ci/disable_ram_counting.py create mode 100644 lib_rend/ivas_lc3plus_common.c create mode 100644 lib_rend/ivas_lc3plus_common.h create mode 100644 lib_rend/ivas_lc3plus_dec.c create mode 100644 lib_rend/ivas_lc3plus_dec.h create mode 100644 lib_rend/ivas_lc3plus_enc.c create mode 100644 lib_rend/ivas_lc3plus_enc.h create mode 100644 lib_rend/lc3plus_codec/.gitignore create mode 100644 lib_rend/lc3plus_codec/README.md create mode 100755 lib_rend/lc3plus_codec/get_lc3plus.sh create mode 100644 lib_rend/lc3plus_codec/lc3plus.patch create mode 100644 scripts/cppp/.gitignore create mode 100644 scripts/split_rendering/lc3plus/.gitignore create mode 100644 scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c create mode 100644 scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c create mode 100755 scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py diff --git a/.gitignore b/.gitignore index c87c691a4a..4beec23e77 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ scripts/td_object_renderer/object_renderer_standalone/renderer_standalone.exe .DS_Store .vscode .cache +.idea *.log *.bak .\#* diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 86c1f487e0..3bc0785711 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -1,4 +1,4 @@ include: - project: $CUSTOM_CI_PROJECT - ref: $CUSTOM_CI_REF + ref: lc3plus-integration-with-unit-tests file: $CUSTOM_CI_FILE diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71ff18eb92..a059d9eb2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -406,7 +406,7 @@ renderer-asan: needs: ["build-codec-linux-cmake"] stage: test script: - - python3 ci/disable_ram_counting.py + - python3 ci/comment_defines.py -d RAM_COUNTING_TOOL -f lib_com/options.h - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake --build cmake-build -- -j - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py @@ -429,7 +429,7 @@ renderer-msan: needs: ["build-codec-linux-cmake"] stage: test script: - - python3 ci/disable_ram_counting.py + - python3 ci/comment_defines.py -d RAM_COUNTING_TOOL -f lib_com/options.h - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true - cmake --build cmake-build -- -j - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 8098dc1c68..8d468dfeac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,7 +116,7 @@ file(GLOB libComSrcs "lib_com/*.c") file(GLOB libComHeaders "lib_com/*.h") add_library(lib_com ${libComSrcs} ${libComHeaders}) if(UNIX) - target_link_libraries(lib_com m) + target_link_libraries(lib_com PRIVATE m) endif() target_include_directories(lib_com PUBLIC lib_com PRIVATE lib_enc lib_dec lib_rend lib_debug) @@ -132,12 +132,30 @@ add_library(lib_enc ${libEncSrcs} ${libEncHeaders}) target_link_libraries(lib_enc lib_com lib_debug) target_include_directories(lib_enc PUBLIC lib_enc PRIVATE lib_dec lib_rend) +set(lc3plus_floating_point_dir ${CMAKE_CURRENT_SOURCE_DIR}/lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point) +if(NOT EXISTS ${lc3plus_floating_point_dir}) + MESSAGE(FATAL_ERROR "${lc3plus_floating_point_dir} does not exist. Please follow instructions in lib_rend/lc3plus_codec/README.md and download the LC3plus codec") +endif() +file(GLOB libLC3plusSrcs "${lc3plus_floating_point_dir}/*.c") +file(GLOB libLC3plusHeaders "${lc3plus_floating_point_dir}/*.h") +file(GLOB libLC3plusFftSrcs "${lc3plus_floating_point_dir}/fft/*.c") +file(GLOB libLC3plusFftHeaders "${lc3plus_floating_point_dir}/fft/*.h") +add_library(lc3plus ${libLC3plusSrcs} ${libLC3plusFftSrcs} ${libLC3plusHeaders} ${libLC3plusFftHeaders}) +target_include_directories(lc3plus PUBLIC ${floating_point_dir} PRIVATE ${floating_point_dir}/fft ) +target_link_libraries(lc3plus lib_com) # For including options.h, which is needed for instrumentation to work correctly +if(WMOPS) + target_link_libraries(lc3plus lib_debug) +endif() + +file(GLOB libCldfbTransCodecSrcs "lib_rend/ivas_cldfb_trans_codec/*.c") +file(GLOB libCldfbTransCodecHeaders "lib_rend/ivas_cldfb_trans_codec/*.h") file(GLOB libRendSrcs "lib_rend/*.c") file(GLOB libRendHeaders "lib_rend/*.h") -add_library(lib_rend ${libRendSrcs} ${libRendHeaders}) -target_link_libraries(lib_rend lib_dec lib_com lib_debug) # Todo refactor: This dependency on lib_dec should be removed. +add_library(lib_rend ${libRendSrcs} ${libCldfbTransCodecSrcs} ${libRendHeaders} ${libCldfbTransCodecHeaders}) +target_link_libraries(lib_rend lib_dec lib_com lib_debug lc3plus) # Todo refactor: This dependency on lib_dec should be removed. target_include_directories(lib_rend PUBLIC lib_rend PRIVATE lib_enc) + file(GLOB libDecSrcs "lib_dec/*.c") file(GLOB libDecHeaders "lib_dec/*.h") add_library(lib_dec ${libDecSrcs} ${libDecHeaders}) @@ -149,6 +167,12 @@ file(GLOB libUtilHeaders "lib_util/*.h") add_library(lib_util ${libUtilSrcs} ${libUtilHeaders}) target_include_directories(lib_util PUBLIC lib_util PRIVATE lib_com lib_enc lib_dec lib_rend lib_debug) +if(NOT WMOPS) + file(GLOB unitTestIvasLc3plusSrcs "scripts/split_rendering/lc3plus/*.c") + add_executable(ivas_lc3plus_unit_test ${unitTestIvasLc3plusSrcs}) + target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug) +endif() + add_executable(IVAS_cod apps/encoder.c) target_link_libraries(IVAS_cod lib_enc lib_util) if(WIN32) @@ -170,6 +194,9 @@ if(COPY_EXECUTABLES_FROM_BUILD_DIR) add_custom_command(TARGET IVAS_cod POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command(TARGET IVAS_dec POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") add_custom_command(TARGET IVAS_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/") + if (NOT WMOPS) + add_custom_command(TARGET ivas_lc3plus_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/split_rendering/lc3plus") + endif() endif() # Allow creating packages for CMake install diff --git a/Makefile b/Makefile index 7f8874d343..baf4a1ead7 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SRC_LIBCOM = lib_com SRC_LIBDEBUG = lib_debug SRC_LIBDEC = lib_dec SRC_LIBENC = lib_enc -SRC_LIBREND = lib_rend +SRC_LIBREND = lib_rend lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft SRC_LIBUTIL = lib_util SRC_APP = apps BUILD = build diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt new file mode 100644 index 0000000000..7ef48fb635 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 1536000; +DOF = 2; +HQMODE = 0; +CODEC = 1; +POSECORRECTIONMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt new file mode 100644 index 0000000000..c77307afd6 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 1792000; +DOF = 3; +HQMODE = 0; +CODEC = 1; +POSECORRECTIONMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt new file mode 100644 index 0000000000..c4457e80d7 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 320000; +DOF = 0; +HQMODE = 0; +CODEC = 1; +POSECORRECTIONMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt new file mode 100644 index 0000000000..9de2dad1a0 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt @@ -0,0 +1,11 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; +CODEC = 1 + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt new file mode 100644 index 0000000000..ec5427bebc --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 1; +HQMODE = 0; +CODEC = 1; +POSECORRECTIONMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_2dof.txt new file mode 100644 index 0000000000..20488df35b --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_2dof.txt @@ -0,0 +1,10 @@ +[SPLITREND] +BITRATE = 768000; +DOF = 2; +HQMODE = 0; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt new file mode 100644 index 0000000000..559352f637 --- /dev/null +++ b/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt @@ -0,0 +1,12 @@ +[SPLITREND] +BITRATE = -1; +DOF = 1; +HQMODE = 0; +CODEC = 1; +POSECORRECTIONMODE = 1; + +[GENERAL] +RENDERER = CREND; + +[ROOMACOUSTICS] +REVERB = FALSE; diff --git a/apps/decoder.c b/apps/decoder.c index 0d9ce5fd0b..75d0fd2ea7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -75,7 +75,11 @@ static #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) #ifdef SPLIT_REND_WITH_HEAD_ROT -#define MAX_SPLIT_REND_BITRATE ( 768000 ) +#ifdef SPLIT_REND_LC3PLUS +#define MAX_SPLIT_REND_BITRATE ( 1792000 ) /* TODO tmu: unify with SPLIT_REND_MAX_BRATE ?*/ +#else +#define MAX_SPLIT_REND_BITRATE ( 768000 ) +#endif #define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) #endif #define IVAS_PUBLIC_ORIENT_TRK_NONE ( 0 ) @@ -1407,7 +1411,11 @@ static ivas_error initOnFirstGoodFrame( IVAS_SPLIT_REND_BITS splitRendBitsZero; splitRendBitsZero.bits_written = 0; splitRendBitsZero.bits_read = 0; - if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written +#ifdef SPLIT_REND_LC3PLUS + , -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE +#endif + ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); @@ -1764,7 +1772,12 @@ static ivas_error decodeG192( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) ) { - if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written +#ifdef SPLIT_REND_LC3PLUS + , + splitRendBits.codec, splitRendBits.pose_correction +#endif + ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); @@ -1776,7 +1789,12 @@ static ivas_error decodeG192( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) ) { - if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written +#ifdef SPLIT_REND_LC3PLUS + , + splitRendBits.codec, splitRendBits.pose_correction +#endif + ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); diff --git a/apps/renderer.c b/apps/renderer.c index 64d87d0092..eed31e9cfa 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -668,7 +668,7 @@ static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER #ifdef DEBUGGING cldfb_in = 1; #endif - if ( ( audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ) + if ( audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { cldfb_in = 1; } @@ -995,7 +995,7 @@ int main( if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed\n" ); + fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed\n" ); exit( -1 ); } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1224,6 +1224,9 @@ int main( #else bitsBufferSize = (int32_t) SPLIT_REND_MAX_BRATE / FRAMES_PER_SEC; bitsBufferSize = ( bitsBufferSize + 7 ) >> 3; +#endif +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + bitsBufferSize = ( SPLIT_REND_LC3PLUS_HBR * MAX_HEAD_ROT_POSES /* Max head poses */ * BINAURAL_CHANNELS /* Ech pose is 2 channels */ + 256000 /* Max metadata bitrate */ ) / FRAMES_PER_SEC / 8; #endif } else @@ -1313,7 +1316,12 @@ int main( { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; - error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ); + error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten +#ifdef SPLIT_REND_LC3PLUS + , + &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection +#endif + ); if ( error_tmp != IVAS_ERR_OK ) { if ( error_tmp == IVAS_ERR_END_OF_FILE ) @@ -1529,14 +1537,14 @@ int main( } #endif - if ( IVAS_REND_GetSamples( hIvasRend, outBuffer + if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer #ifdef SPLIT_REND_WITH_HEAD_ROT - , - &bitsBuffer + , + &bitsBuffer #endif - ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "Error in getting samples\n" ); + fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); exit( -1 ); } @@ -1586,7 +1594,12 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) { - if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ) != IVAS_ERR_OK ) + if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten +#ifdef SPLIT_REND_LC3PLUS + , + bitsBuffer.config.codec, bitsBuffer.config.poseCorrection +#endif + ) != IVAS_ERR_OK ) { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); @@ -2395,7 +2408,7 @@ IsmPositionProvider *IsmPositionProvider_open( IsmPositionProvider *ipp; uint16_t i; - ipp = (IsmPositionProvider *) malloc_( sizeof( IsmPositionProvider ) ); + ipp = (IsmPositionProvider *) malloc( sizeof( IsmPositionProvider ) ); ipp->frameCounter = 0; ipp->numObjects = 0; @@ -2790,8 +2803,8 @@ static void parseIsm( if ( parseUint32( line, &numberOfObjectPositionsToRead ) == 0 ) { positionProvider->numPositions[idx] = numberOfObjectPositionsToRead; - positionProvider->positions[idx] = malloc_( numberOfObjectPositionsToRead * sizeof( IVAS_REND_AudioObjectPosition ) ); - positionProvider->positionDurations[idx] = malloc_( numberOfObjectPositionsToRead * sizeof( uint16_t ) ); + positionProvider->positions[idx] = malloc( numberOfObjectPositionsToRead * sizeof( IVAS_REND_AudioObjectPosition ) ); + positionProvider->positionDurations[idx] = malloc( numberOfObjectPositionsToRead * sizeof( uint16_t ) ); for ( i = 0; i < numberOfObjectPositionsToRead; ++i ) { diff --git a/ci/comment_defines.py b/ci/comment_defines.py new file mode 100755 index 0000000000..0b6e345703 --- /dev/null +++ b/ci/comment_defines.py @@ -0,0 +1,47 @@ +import re +import argparse + + +def process_file(file_path: str, defines_re): + with open(file_path, "r", encoding="utf-8") as file: + lines = file.readlines() + + num_subbed = dict() + for name in defines_re.keys(): + num_subbed[name] = 0 + + for i, line in enumerate(lines): + for name, regex in defines_re.items(): + # Spaces are replaced with underscores to avoid matching on multiple runs + lines[i] = regex.sub(lambda x: f"/* {x.group(0).replace(' ', '_')} */", line) + + if lines[i] != line: + num_subbed[name] += 1 + + with open(file_path, "w", encoding="utf-8") as file: + file.writelines(lines) + + print(f"Processed {file_path}") + for name, num in num_subbed.items(): + print(f"{name} - {num} occurences commented") + print("") + + +def compile_define_re(define_name: str): + return re.compile(f"#define\\s+{define_name}") + + +def main(args): + defines_re = dict() + for define_name in args.defines: + defines_re[define_name] = compile_define_re(define_name) + + for file_path in args.files: + process_file(file_path, defines_re) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Comment out preprocessor defines in c/c++ files") + parser.add_argument("-f", "--files", nargs="+", required=True, type=str) + parser.add_argument("-d", "--defines", nargs="+", required=True, type=str) + main(parser.parse_args()) diff --git a/ci/disable_ram_counting.py b/ci/disable_ram_counting.py deleted file mode 100755 index 3c89153508..0000000000 --- a/ci/disable_ram_counting.py +++ /dev/null @@ -1,20 +0,0 @@ -import re -import os - -FILE_PATH = os.path.join(os.path.dirname(__file__), "..", "lib_com", "options.h") -RE_TO_COMMENT_OUT = re.compile(r"#define\s+RAM_COUNTING_TOOL") - - -def main(): - with open(FILE_PATH, "r", encoding="utf-8") as file: - lines = file.readlines() - - for i, line in enumerate(lines): - lines[i] = RE_TO_COMMENT_OUT.sub(lambda x: f"/* {x.group(0)} */", line) - - with open(FILE_PATH, "w", encoding="utf-8") as file: - file.writelines(lines) - - -if __name__ == "__main__": - main() diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index fae93bc2c8..506547144d 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -102,12 +102,32 @@ typedef enum #endif #ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_LC3PLUS +typedef enum +{ + IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE, + IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB, +} IVAS_SPLIT_REND_POSE_CORRECTION_MODE; +#endif + +#ifdef SPLIT_REND_LC3PLUS +typedef enum +{ + IVAS_SPLIT_REND_CODEC_LCLD, + IVAS_SPLIT_REND_CODEC_LC3PLUS, +} IVAS_SPLIT_REND_CODEC; +#endif + typedef struct ivas_split_rend_bits_t { uint8_t *bits_buf; int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ int32_t bits_written; int32_t bits_read; +#ifdef SPLIT_REND_LC3PLUS + IVAS_SPLIT_REND_CODEC codec; + IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; +#endif } ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS, *IVAS_SPLIT_REND_BITS_HANDLE; #endif typedef struct @@ -155,6 +175,7 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG } IVAS_ROOM_ACOUSTICS_CONFIG_DATA; #ifdef SPLIT_REND_WITH_HEAD_ROT + typedef struct _IVAS_SPLIT_REND_CONFIG { int32_t splitRendBitRate; /*Bit rate for split rendering mode, if "pcm_out" is set then "splitRendBitRate" is used as a limit for MD bitrate */ @@ -167,6 +188,10 @@ typedef struct _IVAS_SPLIT_REND_CONFIG 3 - (3dof correction. By default YAW, PITCH and ROLL correction) */ int16_t codec_delay_ms; /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/ +#ifdef SPLIT_REND_LC3PLUS + IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; + IVAS_SPLIT_REND_CODEC codec; +#endif } IVAS_SPLIT_REND_CONFIG_DATA; #endif diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 2bcf082064..595e5578e9 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1432,8 +1432,20 @@ typedef enum #define SPLIT_REND_MAX_ONE_AXIS_MD_POSES (2) #define MAX_EXTRAPOLATION_ANGLE (15.0f) /* this means additional 15 degrees can be extrapolated on top of MD probing poses*/ +#ifdef SPLIT_REND_LC3PLUS +#define SPLIT_REND_MAX_DOF (3) +#define SPLIT_REND_MSPC_NPOSES_0DOF (1) +#define SPLIT_REND_MSPC_NPOSES_1DOF (3) +#define SPLIT_REND_MSPC_NPOSES_2DOF (7) +#define SPLIT_REND_MSPC_NPOSES_3DOF (8) +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT +#ifdef SPLIT_REND_LC3PLUS +#define MAX_HEAD_ROT_POSES (2 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) /* TODO tmu : revisit for harmonization */ +#else #define MAX_HEAD_ROT_POSES (1 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) +#endif #else #define MAX_HEAD_ROT_POSES (1 + SPLIT_REND_MAX_YAW_ONLY_POSES) #endif @@ -1725,10 +1737,16 @@ typedef enum #define SIZE_SPLIT_REND_BRATE_TBL (4) #define SPLIT_REND_256k 256000 +#ifdef SPLIT_REND_LC3PLUS +#define SPLIT_REND_320k 320000 /* TODO tmu: LC3plus 0DOF only at the moment - not included in SIZE_SPLIT_REND_BRATE_TBL! */ +#endif #define SPLIT_REND_384k 384000 #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 -#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k +#define SPLIT_REND_MAX_BRATE SPLIT_REND_768k +#ifdef SPLIT_REND_LC3PLUS +#define SPLIT_REND_LC3PLUS_HBR 128000 /* bitrate per LC3plus core */ +#endif #ifdef SPLIT_REND_CLDFB_HUFF_SAN_FIX #define SPLIT_REND_ADDITIONAL_BYTES_TO_READ ( 1 ) diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 9438ad44a1..f4ea7ecb8c 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -133,6 +133,9 @@ typedef enum IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, +#ifdef SPLIT_REND_LC3PLUS + IVAS_ERR_LC3PLUS_INVALID_BITRATE, +#endif /*----------------------------------------* * unknown error * @@ -179,6 +182,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Parse error"; case IVAS_ERR_END_OF_FILE: return "End of file"; +#ifdef SPLIT_REND_LC3PLUS + case IVAS_ERR_LC3PLUS_INVALID_BITRATE: + return "Specified split rendering bit rate is not supported by LC3plus"; +#endif default: break; } diff --git a/lib_com/options.h b/lib_com/options.h index 5c06d98c06..30e4a8fe4f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -210,7 +210,14 @@ #define SPLIT_REND_CLANG_SAN_FIX #define SPLIT_REND_CLDFB_HUFF_SAN_FIX #define SPLIT_REND_STACK_OPT + +#define SPLIT_REND_LC3PLUS /* FhG: split rendering using LC3plus codec */ +#define FIX_SPLIT_REND_OPEN_ERROR_HANDLING /* adds missing error handling around ivas_split_renderer_open calls */ +// #define SPLIT_REND_LC3PLUS_HBR_DBG /* Override bitrate per LC3 core */ #endif +#define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ +#define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ +#define RENAME_GWLPR /* FhG: Rename clashing symbol */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/FEC_HQ_phase_ecu.c b/lib_dec/FEC_HQ_phase_ecu.c index 96974b9f8e..e4fddda6d2 100644 --- a/lib_dec/FEC_HQ_phase_ecu.c +++ b/lib_dec/FEC_HQ_phase_ecu.c @@ -1079,7 +1079,11 @@ static void subst_spec( } i++; im_ind--; +#ifdef RENAME_GWLPR + if ( i >= ivas_gwlpr[k + 1] ) +#else if ( i >= gwlpr[k + 1] ) +#endif { k++; } @@ -1191,7 +1195,11 @@ static void subst_spec( i++; im_ind--; +#ifdef RENAME_GWLPR + if ( i >= ivas_gwlpr[k + 1] ) +#else if ( i >= gwlpr[k + 1] ) +#endif { k++; } @@ -1246,7 +1254,11 @@ static void subst_spec( } i++; +#ifdef RENAME_GWLPR + if ( i >= ivas_gwlpr[k + 1] ) +#else if ( i >= gwlpr[k + 1] ) +#endif { k++; } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 4c9bf28a46..ad7284cb4f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -105,7 +105,11 @@ ivas_error ivas_dec( if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { +#ifdef SPLIT_REND_LC3PLUS + assert( ( st_ivas->ivas_format == SBA_FORMAT || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC ) ) && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA or discrete ISM format and 48k sampling rate only" ); +#else assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); +#endif ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hHeadTrackData, hSplitRendBits ); } #endif @@ -240,10 +244,21 @@ ivas_error ivas_dec( /* Binaural rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { - if ( ( ivas_td_binaural_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_LC3PLUS + if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - return error; + ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ); } + else + { +#endif + if ( ( error = ivas_td_binaural_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } +#ifdef SPLIT_REND_LC3PLUS + } +#endif } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { @@ -640,10 +655,17 @@ ivas_error ivas_dec( ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, +#ifdef SPLIT_REND_LC3PLUS + st_ivas->hRenderConfig->split_rend_config.codec, +#endif hSplitBinRend->hSplitRendBits, hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, - max_band, output, 1, pcm_out ); + max_band, output, 1, +#ifdef SPLIT_REND_LC3PLUS + st_ivas->ivas_format != SBA_FORMAT, +#endif + pcm_out ); free( st_ivas->splitBinRend.hMultiBinCldfbData ); } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 721f30343b..0582ed8844 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1234,9 +1234,20 @@ ivas_error ivas_init_decoder( if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, - &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + error = +#endif + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, + 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + if ( error != IVAS_ERR_OK ) + { + return error; + } +#endif } #endif } @@ -1269,6 +1280,33 @@ ivas_error ivas_init_decoder( return error; } } + +#ifdef SPLIT_REND_LC3PLUS + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + + /* Split rendering with ISMs only supported with LC3plus */ + assert(st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS); + +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + error = +#endif + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, 0, 0 ); + +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + if ( error != IVAS_ERR_OK ) + { + return error; + } +#endif + } +#endif } else if ( st_ivas->renderer_type == RENDERER_MC ) { diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index e551029c9a..d5733e77b4 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -259,9 +259,21 @@ ivas_error ivas_sba_dec_reconfigure( if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { - ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, - &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); +#ifdef SPLIT_REND_LC3PLUS + assert(st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LCLD); +#endif +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + error = +#endif + ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); +#ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING + if ( error != IVAS_ERR_OK ) + { + return error; + } +#endif } #endif } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c53df56c92..6ca89f3aea 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1222,6 +1222,10 @@ ivas_error IVAS_DEC_GetRenderConfig( hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; #endif +#ifdef SPLIT_REND_LC3PLUS + hRCout->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LCLD; + hRCout->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; +#endif return IVAS_ERR_OK; } @@ -1269,10 +1273,14 @@ ivas_error IVAS_DEC_FeedRenderConfig( mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 ); #ifdef SPLIT_REND_WITH_HEAD_ROT - hRenderConfig->split_rend_config.splitRendBitRate = renderConfig.split_rend_config.splitRendBitRate; - hRenderConfig->split_rend_config.dof = renderConfig.split_rend_config.dof; - hRenderConfig->split_rend_config.hq_mode = renderConfig.split_rend_config.hq_mode; - hRenderConfig->split_rend_config.codec_delay_ms = renderConfig.split_rend_config.codec_delay_ms; + hRenderConfig->split_rend_config = renderConfig.split_rend_config; +#endif +#ifdef SPLIT_REND_LC3PLUS + /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ + if (hRenderConfig->split_rend_config.dof == 0) + { + hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + } #endif return IVAS_ERR_OK; @@ -1871,6 +1879,10 @@ const char *IVAS_DEC_GetErrorMessage( return "could not read from file"; case IVAS_ERR_NOT_IMPLEMENTED: return "not implemented"; +#ifdef SPLIT_REND_LC3PLUS + case IVAS_ERR_LC3PLUS_INVALID_BITRATE: + return ivas_error_to_string( IVAS_ERR_LC3PLUS_INVALID_BITRATE ); +#endif case IVAS_ERR_UNKNOWN: default: break; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index d9608c2b83..2b58d7bf83 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -58,7 +58,7 @@ typedef enum _IVAS_DEC_OUTPUT_CONFIG IVAS_DEC_OUTPUT_BINAURAL, IVAS_DEC_OUTPUT_BINAURAL_ROOM, #ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB, + IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB, /* ToDo: Also includes LC3plus, should be renamed during harmonization */ IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM, #endif IVAS_DEC_OUTPUT_EXT, diff --git a/lib_dec/rom_dec.c b/lib_dec/rom_dec.c index beba87c3da..6f0751dc56 100644 --- a/lib_dec/rom_dec.c +++ b/lib_dec/rom_dec.c @@ -92,7 +92,11 @@ const float lsf_tab[LPC_SHB_ORDER] = const int16_t gw[LGW_MAX] = { 1, 3, 6, 10, 16, 32, 64, 128, 192 }; /* 31.25 343.75 718.75 1218.75 1968.75 4000 8000 16000 24000 */ +#ifdef RENAME_GWLPR +const int16_t ivas_gwlpr[LGW_MAX] = { 1, 3*QUOT_LPR_LTR-1, 6*QUOT_LPR_LTR-1, 10*QUOT_LPR_LTR-1, 16*QUOT_LPR_LTR-1, 32*QUOT_LPR_LTR, 64*QUOT_LPR_LTR, 128*QUOT_LPR_LTR, 192*QUOT_LPR_LTR }; +#else const int16_t gwlpr[LGW_MAX] = { 1, 3*QUOT_LPR_LTR-1, 6*QUOT_LPR_LTR-1, 10*QUOT_LPR_LTR-1, 16*QUOT_LPR_LTR-1, 32*QUOT_LPR_LTR, 64*QUOT_LPR_LTR, 128*QUOT_LPR_LTR, 192*QUOT_LPR_LTR }; +#endif const float w_hamm48k_2[L_TRANA48k/2] = { diff --git a/lib_dec/rom_dec.h b/lib_dec/rom_dec.h index 751a2e4da0..604bfc2fe0 100644 --- a/lib_dec/rom_dec.h +++ b/lib_dec/rom_dec.h @@ -56,7 +56,11 @@ extern const int16_t hestable[15]; extern const float lsf_tab[LPC_SHB_ORDER]; extern const int16_t gw[LGW_MAX]; +#ifdef RENAME_GWLPR +extern const int16_t ivas_gwlpr[LGW_MAX]; +#else extern const int16_t gwlpr[LGW_MAX]; +#endif extern const float w_hamm32k_2[L_TRANA32k / 2]; extern const float w_hamm16k_2[L_TRANA16k / 2]; extern const float w_hamm_sana32k_2[L_PROT_HAMM_LEN2_32k]; diff --git a/lib_rend/ivas_lc3plus_common.c b/lib_rend/ivas_lc3plus_common.c new file mode 100644 index 0000000000..3b12f78be5 --- /dev/null +++ b/lib_rend/ivas_lc3plus_common.c @@ -0,0 +1,49 @@ +/****************************************************************************************************** + + (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 "ivas_lc3plus_common.h" +#include "ivas_error.h" +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" + +ivas_error IVAS_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ) +{ + switch ( lc3PlusError ) + { + case LC3PLUS_OK: + return IVAS_ERR_OK; + case LC3PLUS_BITRATE_ERROR: + return IVAS_ERR_LC3PLUS_INVALID_BITRATE; + default: + break; + } + return IVAS_ERR_INTERNAL; +} diff --git a/lib_rend/ivas_lc3plus_common.h b/lib_rend/ivas_lc3plus_common.h new file mode 100644 index 0000000000..01971679d2 --- /dev/null +++ b/lib_rend/ivas_lc3plus_common.h @@ -0,0 +1,53 @@ +/****************************************************************************************************** + + (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. + +*******************************************************************************************************/ + +#pragma once + +#include +#include "ivas_error.h" +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" + +/*! common configuration parameters between encoder and decoder */ +typedef struct LC3PLUS_CONFIG +{ + /*! frame duration in microseconds [10000, 5000, 2500] */ + uint32_t lc3plus_frame_duration_us; + /*! ivas frame duration in microseconds [20000, 5000] */ + uint32_t ivas_frame_duration_us; + /*! sampling rate*/ + uint32_t samplerate; + /*! number of channels */ + uint16_t channels; +} LC3PLUS_CONFIG; + +/*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */ +ivas_error IVAS_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError ); diff --git a/lib_rend/ivas_lc3plus_dec.c b/lib_rend/ivas_lc3plus_dec.c new file mode 100644 index 0000000000..30a7941242 --- /dev/null +++ b/lib_rend/ivas_lc3plus_dec.c @@ -0,0 +1,678 @@ +/****************************************************************************************************** + + (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 "prot.h" +#include "ivas_prot.h" +#include "ivas_lc3plus_dec.h" +#include "ivas_lc3plus_common.h" +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" +#include "ivas_error_utils.h" +#include "wmc_auto.h" + +ivas_error IVAS_LC3PLUS_DEC_Open( + const LC3PLUS_CONFIG config, /* i: decoder configuration */ +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ +#endif + IVAS_LC3PLUS_DEC_HANDLE *handle /* o: decoder handle */ +) +{ + LC3PLUS_Error err; + int32_t decoder_size; + int16_t lc3plusFrameIdx; + int16_t numLC3plusFramesPerIvasFrame; + int16_t i; + + *handle = malloc( sizeof( struct IVAS_LC3PLUS_DEC_HANDLE ) ); + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); + } + if( 0 == config.lc3plus_frame_duration_us ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid lc3plus_frame_duration_us (0)\n" ); + } +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + (*handle)->cachingEnabled = enableCaching; +#endif + numLC3plusFramesPerIvasFrame = config.ivas_frame_duration_us / config.lc3plus_frame_duration_us; + +#ifdef LC3PLUS_DEC_COLLECT_STATS + ( *handle )->stats.action_histogram[DEC_ACTION_DECODE_AND_DROP] = 0; + ( *handle )->stats.action_histogram[DEC_ACTION_DECODE_AND_USE] = 0; + ( *handle )->stats.action_histogram[DEC_ACTION_SKIP] = 0; + ( *handle )->stats.action_histogram[DEC_ACTION_CACHE] = 0; + ( *handle )->stats.num_cached_frames_decoded_and_dropped = 0; +#endif + + ( *handle )->num_decs = 0; + ( *handle )->pcm_conversion_buffer = NULL; + ( *handle )->handles = NULL; + ( *handle )->selective_decoding_states = NULL; + ( *handle )->bitstream_caches = NULL; + ( *handle )->handles = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_HANDLE ) ); + ( *handle )->selective_decoding_states = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE * ) ); + if ( NULL == ( *handle )->handles || NULL == ( *handle )->selective_decoding_states ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); + } + for ( i = 0; i < config.channels; ++i ) + { + ( *handle )->handles[i] = NULL; + ( *handle )->selective_decoding_states[i] = NULL; + } + +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + if(enableCaching) + { +#endif + ( *handle )->bitstream_caches = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE* ) ); + if ( NULL == ( *handle )->bitstream_caches ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); + } + for ( i = 0; i < config.channels; ++i ) + { + ( *handle )->bitstream_caches[i] = NULL; + } +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + } +#endif + ( *handle )->num_decs = config.channels; + for ( int32_t iCh = 0; iCh < config.channels; iCh++ ) + { + ( *handle )->selective_decoding_states[iCh] = NULL; + if(NULL != ( *handle )->bitstream_caches) + { + ( *handle )->bitstream_caches[iCh] = NULL; + } + /* allocate and configure LC3plus decoder */ + decoder_size = lc3plus_dec_get_size( config.samplerate, 1 ); + if ( 0 == decoder_size ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_dec_get_size failed\n" ); + } + + ( *handle )->handles[iCh] = malloc( decoder_size ); + if ( NULL == ( *handle )->handles[iCh] ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); + } + + err = lc3plus_dec_init( ( *handle )->handles[iCh], config.samplerate, 1, LC3PLUS_PLC_ADVANCED, 0 ); + if ( LC3PLUS_OK != err ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_init failed\n" ); + } + + err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); + if ( LC3PLUS_OK != err ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_set_frame_dms failed\n" ); + } + + /* allocate and configure per LC3plus decoder skip state */ + ( *handle )->selective_decoding_states[iCh] = malloc( sizeof( IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE ) ); + if ( NULL == ( *handle )->selective_decoding_states[iCh] ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); + } + ( *handle )->selective_decoding_states[iCh]->frame_actions = malloc( numLC3plusFramesPerIvasFrame*sizeof(SelectiveDecAction) ); + if ( NULL == ( *handle )->selective_decoding_states[iCh]->frame_actions ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); + } + ( *handle )->selective_decoding_states[iCh]->has_skipped_a_frame = 0; + ( *handle )->selective_decoding_states[iCh]->shall_decode_cached_frame = 0; + for(lc3plusFrameIdx = 0; lc3plusFrameIdx < numLC3plusFramesPerIvasFrame; lc3plusFrameIdx++) + { + ( *handle )->selective_decoding_states[iCh]->frame_actions[lc3plusFrameIdx] = DEC_ACTION_DECODE_AND_USE; + } +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + if(enableCaching) + { +#endif + /* allocate and configure per LC3plus decoder bitstream cache */ + ( *handle )->bitstream_caches[iCh] = malloc( sizeof(IVAS_LC3PLUS_DEC_BITSTREAM_CACHE) ); + if ( NULL == ( *handle )->bitstream_caches[iCh] ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); + } + ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity = 400 /*LC3plus max non-HR octet count*/ * numLC3plusFramesPerIvasFrame; + ( *handle )->bitstream_caches[iCh]->bitstream_cache = malloc(( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity); + if ( NULL == ( *handle )->bitstream_caches[iCh]->bitstream_cache ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); + } + ( *handle )->bitstream_caches[iCh]->bitstream_cache_size = 0; +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + } +#endif + } + ( *handle )->config = config; + if ( config.ivas_frame_duration_us < config.lc3plus_frame_duration_us || config.ivas_frame_duration_us % config.lc3plus_frame_duration_us != 0 ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Current pcm_conversion_buffer sizing requires that lc3plus uses a shorter or equal frame duration than ivas\n" ); + } + ( *handle )->pcm_conversion_buffer = malloc( sizeof( int16_t ) * config.samplerate * config.lc3plus_frame_duration_us / 1000000 ); + if ( NULL == ( *handle )->pcm_conversion_buffer ) + { + IVAS_LC3PLUS_DEC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder wrapper pcm_conversion_buffer\n" ); + } + return IVAS_ERR_OK; +} + +ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix(int16_t ***subframeChannelMatrix, const uint32_t num_decs) +{ + *subframeChannelMatrix = malloc(MAX_PARAM_SPATIAL_SUBFRAMES * sizeof(int16_t *)); + if(NULL == *subframeChannelMatrix) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); + } + for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + { + (*subframeChannelMatrix)[i] = NULL; + } + for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + { + (*subframeChannelMatrix)[i] = malloc(num_decs * sizeof(int16_t)); + if(NULL == (*subframeChannelMatrix)[i]) + { + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(*subframeChannelMatrix); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); + } + } + return IVAS_ERR_OK; +} + +void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(int16_t **subframeChannelMatrix) +{ + for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + { + free(subframeChannelMatrix[i]); + } + free(subframeChannelMatrix); +} + +ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] +) +{ + int16_t numIvasSubFramesPerLC3frame; + uint32_t decIdx; + int16_t ivasSubframeIdx; + int16_t effectiveIvasSubframeDuration; + int16_t actual_num_spatial_subframes; + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "IVAS_LC3PLUS_DEC_HANDLE is NULL\n" ); + } + if ( NULL == subframeChannelMatrix ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "subframeChannelMatrix is NULL\n" ); + } + if(handle->config.lc3plus_frame_duration_us == 0 || handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "invalid ivas_frame_duration_us/lc3plus_frame_duration_us values\n" ); + } + + effectiveIvasSubframeDuration = handle->config.ivas_frame_duration_us == 20000 ? handle->config.ivas_frame_duration_us/MAX_PARAM_SPATIAL_SUBFRAMES : handle->config.ivas_frame_duration_us; + numIvasSubFramesPerLC3frame = handle->config.lc3plus_frame_duration_us/effectiveIvasSubframeDuration; + actual_num_spatial_subframes = handle->config.ivas_frame_duration_us / effectiveIvasSubframeDuration; + // 0.5(0) = 10ms lc3plus, 5ms subframe + if(numIvasSubFramesPerLC3frame != 1) + { + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Selective decoding is only implemented for aligned IVAS-Subframes & LC3plus \n" ); + } + + + /* map subframeChannelMatrix to lc3plus skip states */ + /* 1st pass: Flag the required frames */ + for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + { + for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + { + if( 1 == subframeChannelMatrix[ivasSubframeIdx][decIdx] ) + { + /* subframe needed by the user, definitely decode */ + handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_USE; + } + else + { + + /* subframe not needed by the user, but might be required to re-initialize a decoder after inactivity */ + if( +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + handle->cachingEnabled && +#endif + (ivasSubframeIdx != actual_num_spatial_subframes - 1) && 1 == subframeChannelMatrix[ivasSubframeIdx + 1][decIdx] ) + { + /* ... but if the following subframe is required, it needs to be decoded and dropped */ + handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_DROP; + } + else + { + handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_SKIP; + } + } + } + } +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + if(handle->cachingEnabled) + { +#endif + /* if a decoder was paused before, it needs to either: + * - Decode the cached frame (if available) and the first required frame OR + * - Decode the previous LC3plus subframe, even if it isn't needed by the user */ + for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + { + if( handle->selective_decoding_states[decIdx]->has_skipped_a_frame ) + { + /* find the first frame required by the user */ + for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + { + if( DEC_ACTION_DECODE_AND_USE == handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] ) + { + /* The first required frame is the first subframe. To flush the decoder, the cached frame must be decoded and dropped */ + if(0 == ivasSubframeIdx) + { + handle->selective_decoding_states[decIdx]->shall_decode_cached_frame = 1; + break; + } + /* The first required frame is not the first frame, so the cache is useless. Instead we decode & drop the previous frame*/ + else + { + handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx - 1] = DEC_ACTION_DECODE_AND_DROP; + break; + } + } + } + } + } + + /* if a dec gets paused & caching is activated we need to flag the last useful LC3plus frame for caching */ + for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + { + for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + { + if( handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] == DEC_ACTION_SKIP + && handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] != DEC_ACTION_DECODE_AND_USE ) + { + handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] = DEC_ACTION_CACHE; + } + } + } +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + } +#endif + return IVAS_ERR_OK; +} + +ivas_error IVAS_LC3PLUS_DEC_GetDelay( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + int32_t *delayInSamples /* o: decoder delay in number of samples per channel */ +) +{ + int32_t tmpDelayInSamples; + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "IVAS_LC3PLUS_DEC_HANDLE is NULL\n" ); + } + if ( NULL == delayInSamples ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "delayInSamples is NULL\n" ); + } + + *delayInSamples = 0; + /* sanity check whether all encoders are actually configured identically */ + for ( uint32_t iDec = 0; iDec < handle->num_decs; iDec++ ) + { + if ( NULL == handle->handles[iDec] ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3plus decoder handle is NULL\n" ); + } + + tmpDelayInSamples = lc3plus_dec_get_delay( handle->handles[iDec] ); + if ( 0 != *delayInSamples && tmpDelayInSamples != *delayInSamples ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Not all mono LC3plus decoders are configured identically\n" ); + } + *delayInSamples = tmpDelayInSamples; + } + return IVAS_ERR_OK; +} + +void IVAS_LC3PLUS_DEC_Close( + IVAS_LC3PLUS_DEC_HANDLE *handle /* i/o: Pointer to decoder handle */ +) +{ + if ( NULL == handle || NULL == *handle ) + { + return; + } +#ifdef LC3PLUS_DEC_COLLECT_STATS + printLC3plusDecStats( &(*handle)->stats ); +#endif + for ( uint32_t iDec = 0; iDec < ( *handle )->num_decs; iDec++ ) + { + if ( NULL != ( *handle )->handles && NULL != ( *handle )->handles[iDec] ) + { + lc3plus_free_decoder_structs( ( *handle )->handles[iDec] ); + free( ( *handle )->handles[iDec] ); + } + + if ( NULL != ( *handle )->selective_decoding_states && NULL != ( *handle )->selective_decoding_states[iDec] ) + { + free( ( *handle )->selective_decoding_states[iDec]->frame_actions ); + free( ( *handle )->selective_decoding_states[iDec] ); + } + + if ( NULL != ( *handle )->bitstream_caches && NULL != ( *handle )->bitstream_caches[iDec] ) + { + free( ( *handle )->bitstream_caches[iDec]->bitstream_cache ); + free( ( *handle )->bitstream_caches[iDec] ); + } + } + if ( NULL != ( *handle )->pcm_conversion_buffer ) + { + free( ( *handle )->pcm_conversion_buffer ); + } + free( ( *handle )->handles ); + if( NULL != ( *handle )->bitstream_caches ) + { + free( ( *handle )->bitstream_caches ); + } + free( ( *handle )->selective_decoding_states ); + free( *handle ); + *handle = NULL; +} + +static ivas_error decode_or_conceal_one_lc3plus_frame( + LC3PLUS_Dec* dec, + uint8_t* bitstream_in, + const int32_t bitstream_in_length, + int16_t **pcm_out_buffer, + const int32_t badFrameIndicator) +{ + LC3PLUS_Error err; + push_wmops( "lc3plus_dec16" ); + err = lc3plus_dec16( dec, bitstream_in, bitstream_in_length, pcm_out_buffer, NULL, badFrameIndicator ); + pop_wmops(); + if ( err == LC3PLUS_DECODE_ERROR && 1 == badFrameIndicator ) + { + /* LC3PLUS_DECODE_ERROR && badFrameIndicator means that the decoder has successfully concealed, which is actually OK. */ + err = LC3PLUS_OK; + } + if ( err != LC3PLUS_OK ) + { + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr(err), "lc3plus_dec16 failed\n" ); + } + return IVAS_ERR_OK; +} + +static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder configuration */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + const int32_t badFrameIndicator, /* i: bad frame indicator. If set to 1, triggers concealment */ + float **pcm_out /* o: decoded samples */ +) +{ + uint32_t iDec; + int32_t iLc3plusFrame; + int32_t lc3framesPerIvasFrame; + int32_t ivasSampleIndex; + int16_t numSamplesPerLC3plusChannel; + int32_t bitstreamOffsetPerCoder; + ivas_error err; + uint8_t *bitstream_in_iter = bitstream_in; + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Dec_Wrap_Handle is NULL\n" ); + } + if ( NULL == bitstream_in ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "bitstream_in is NULL\n" ); + } + if ( NULL == pcm_out ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "pcm_out is NULL\n" ); + } + if ( badFrameIndicator != 0 && badFrameIndicator != 1 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "badFrameIndicator must be 1 or 0\n" ); + } + if ( badFrameIndicator == 0 && bitstream_in_size <= 0 ) + { + return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "bitstream_in_size must be positive\n" ); + } + + if ( handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) + { + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "ivas_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); + } + lc3framesPerIvasFrame = handle->config.ivas_frame_duration_us / handle->config.lc3plus_frame_duration_us; + + numSamplesPerLC3plusChannel = handle->config.samplerate / ( 1000000 / handle->config.ivas_frame_duration_us ) / lc3framesPerIvasFrame; + bitstreamOffsetPerCoder = bitstream_in_size / handle->num_decs / lc3framesPerIvasFrame; + for ( iDec = 0; iDec < handle->num_decs; iDec++ ) + { + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if( handle->selective_decoding_states[iDec]->shall_decode_cached_frame) + { + if(0 == handle->bitstream_caches[iDec]->bitstream_cache_size) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "LC3plus cache is empty\n" ); + } + err = decode_or_conceal_one_lc3plus_frame( + handle->handles[iDec], + handle->bitstream_caches[iDec]->bitstream_cache, + handle->bitstream_caches[iDec]->bitstream_cache_size, + &handle->pcm_conversion_buffer, + badFrameIndicator ); + if(err != IVAS_ERR_OK) + { + return IVAS_ERROR( err, "lc3plus decoding failed\n" ); + } + handle->selective_decoding_states[iDec]->shall_decode_cached_frame = 0; + handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; +#ifdef LC3PLUS_DEC_COLLECT_STATS + handle->stats.num_cached_frames_decoded_and_dropped++; +#endif + } + /* reset cache if caching is enabled - it has either been decoded or is not needed */ + if(NULL != handle->bitstream_caches) + { + handle->bitstream_caches[iDec]->bitstream_cache_size = 0; + } +#ifdef LC3PLUS_DEC_COLLECT_STATS + handle->stats.action_histogram[handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame]]++; +#endif + switch ( handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] ) + { + case DEC_ACTION_DECODE_AND_DROP: + { + err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator ); + if(err != IVAS_ERR_OK) + { + return IVAS_ERROR( err, "lc3plus decoding failed\n" ); + } + handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; + break; + } + case DEC_ACTION_DECODE_AND_USE: + { + err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator ); + if(err != IVAS_ERR_OK) + { + return IVAS_ERROR( err, "lc3plus decoding failed\n" ); + } + + for ( int32_t iSampleInt16 = 0; iSampleInt16 < numSamplesPerLC3plusChannel; iSampleInt16++ ) + { + ivasSampleIndex = iSampleInt16 + iLc3plusFrame * numSamplesPerLC3plusChannel; + pcm_out[iDec][ivasSampleIndex] = (float) handle->pcm_conversion_buffer[iSampleInt16]; + } + handle->selective_decoding_states[iDec]->has_skipped_a_frame = 0; + break; + } + case DEC_ACTION_SKIP: + { + /* log that this instance has skipped a frame and must decode twice once reactivated */ + handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; + break; + } + case DEC_ACTION_CACHE: + { + if( handle->bitstream_caches[iDec]->bitstream_cache_capacity < bitstreamOffsetPerCoder ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "bitstream_cache_capacity is too low for LC3plus frame size\n" ); + } + /* store bit rate of cached frame */ + mvc2c(bitstream_in_iter, handle->bitstream_caches[iDec]->bitstream_cache, bitstreamOffsetPerCoder); + handle->bitstream_caches[iDec]->bitstream_cache_size = bitstreamOffsetPerCoder; + /* log that this instance has skipped a frame and must decode twice once reactivated */ + handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; + break; + } + case DEC_ACTION_NUM_ENUMS: + default: + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "invalid LC3plus decoder state\n" ); + } + bitstream_in_iter += bitstreamOffsetPerCoder; + } + /* reset skipping state, must be set by the user before each decode call*/ + for(iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++) + { + handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] = DEC_ACTION_DECODE_AND_USE; + } + } + return IVAS_ERR_OK; +} + +ivas_error IVAS_LC3PLUS_DEC_Decode( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder configuration */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ +) +{ + int32_t badFrameIndicator; + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Dec_Wrap_Handle is NULL\n" ); + } + if ( NULL == bitstream_in ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "bitstream_in is NULL\n" ); + } + if ( NULL == pcm_out ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "pcm_out is NULL\n" ); + } + badFrameIndicator = 0; + return IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, bitstream_in_size, badFrameIndicator, pcm_out ); +} + +ivas_error IVAS_LC3PLUS_DEC_Conceal( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + float **pcm_out /* o: concealed samples */ +) +{ + uint8_t bitstream_in[LC3PLUS_MAX_BYTES]; + int32_t badFrameIndicator; + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Dec_Wrap_Handle is NULL\n" ); + } + if ( NULL == pcm_out ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "pcm_out is NULL\n" ); + } + /* LC3plus API requires a non-NULL bitstream pointer, even when triggering concealment */ + badFrameIndicator = 1; + return IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( handle, bitstream_in, 0, badFrameIndicator, pcm_out ); +} + + +#ifdef LC3PLUS_DEC_COLLECT_STATS +void printLC3plusDecStats(const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats) +{ + int32_t sum_pushed_frames = 0; + int32_t sum_decoded_and_dropped_frames, sum_skipped_frames; + + sum_pushed_frames = stats->action_histogram[DEC_ACTION_DECODE_AND_USE] + + stats->action_histogram[DEC_ACTION_SKIP] + + stats->action_histogram[DEC_ACTION_CACHE]; + + sum_decoded_and_dropped_frames = + stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] + + stats->num_cached_frames_decoded_and_dropped; + + sum_skipped_frames = stats->action_histogram[DEC_ACTION_SKIP] + stats->action_histogram[DEC_ACTION_CACHE]; + + if( sum_pushed_frames == 0) + { + printf( "\n Dec didn't run"); + return; + } + + printf( "\nsum_pushed_frames: %i\n" , sum_pushed_frames ); + printf( " DECODE_AND_USE count: %i \n" , stats->action_histogram[DEC_ACTION_DECODE_AND_USE]); + printf( " SKIP count: %i\n" , stats->action_histogram[DEC_ACTION_SKIP]); + printf( " CACHE count: %i\n" , stats->action_histogram[DEC_ACTION_CACHE]); + printf( "Decoded-and-Dropped:\n" ); + printf( " DECODE_AND_DROP count: %i \n" , stats->action_histogram[DEC_ACTION_DECODE_AND_DROP]); + printf( " DEC_CACHE count: %i\n" , stats->num_cached_frames_decoded_and_dropped); + printf( " perc of req : %f\n" , 100.f*(float)sum_decoded_and_dropped_frames/ sum_pushed_frames ); + printf( "Workload saved: \n"); + printf( " Skipped perc. of req %f\n", 100.f*(float)sum_skipped_frames/ sum_pushed_frames ); +} +#endif diff --git a/lib_rend/ivas_lc3plus_dec.h b/lib_rend/ivas_lc3plus_dec.h new file mode 100644 index 0000000000..45bbef86a1 --- /dev/null +++ b/lib_rend/ivas_lc3plus_dec.h @@ -0,0 +1,138 @@ +/****************************************************************************************************** + + (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. + +*******************************************************************************************************/ + +#pragma once + +#include +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" +#include "ivas_error.h" +#include "ivas_lc3plus_common.h" +#include "ivas_cnst.h" + +#ifdef DEBUGGING +/* if defined, collects runtime stats and prints them in the DTOR */ +// #define LC3PLUS_DEC_COLLECT_STATS +/* if defined, caching can be disabled, otherwise it's always active */ +// #define LC3PLUS_DEC_ALLOW_DISABLE_CACHING +#endif + +typedef enum +{ + DEC_ACTION_DECODE_AND_DROP = 0, + DEC_ACTION_DECODE_AND_USE, + DEC_ACTION_SKIP, + DEC_ACTION_CACHE, + DEC_ACTION_NUM_ENUMS +} SelectiveDecAction; + +#ifdef LC3PLUS_DEC_COLLECT_STATS +typedef struct IVAS_LC3PLUS_DEC_COLLECT_STATS +{ + int32_t action_histogram[DEC_ACTION_NUM_ENUMS]; + int32_t num_cached_frames_decoded_and_dropped; +} IVAS_LC3PLUS_DEC_COLLECT_STATS; + +void printLC3plusDecStats(const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats); +#endif + +typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE +{ + /*! indicates that the decoder has skipped one or more frames. This means it must decode two frames to flush algorithmic delay when re-activated */ + int16_t has_skipped_a_frame; + /*! if set to 1, decoder will skip decoding for the next frame */ + SelectiveDecAction *frame_actions; + /*! if set to 1, decoder will decode the cache before decoding any of current frames */ + int16_t shall_decode_cached_frame; +} IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE; + +typedef struct IVAS_LC3PLUS_DEC_BITSTREAM_CACHE +{ + uint8_t* bitstream_cache; + int32_t bitstream_cache_capacity; + int32_t bitstream_cache_size; +} IVAS_LC3PLUS_DEC_BITSTREAM_CACHE; + +/* decoder wrapper */ +typedef struct IVAS_LC3PLUS_DEC_HANDLE +{ + LC3PLUS_Dec **handles; + IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE **selective_decoding_states; + IVAS_LC3PLUS_DEC_BITSTREAM_CACHE **bitstream_caches; + uint32_t num_decs; + int16_t *pcm_conversion_buffer; + LC3PLUS_CONFIG config; +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + int16_t cachingEnabled; +#endif +#ifdef LC3PLUS_DEC_COLLECT_STATS + IVAS_LC3PLUS_DEC_COLLECT_STATS stats; +#endif +} * IVAS_LC3PLUS_DEC_HANDLE; + +ivas_error IVAS_LC3PLUS_DEC_Open( + const LC3PLUS_CONFIG config, /* i: decoder configuration */ +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ +#endif + IVAS_LC3PLUS_DEC_HANDLE *handle /* o: decoder handle */ +); + +ivas_error IVAS_LC3PLUS_DEC_GetDelay( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + int32_t *delayInSamples /* o: algorithmic delay of encoding and decoding in number of samples per channel */ +); + +void IVAS_LC3PLUS_DEC_Close( + IVAS_LC3PLUS_DEC_HANDLE *handle /* i/o: pointer to decoder handle */ +); + +/*! Sets a matrix[MAX_PARAM_SPATIAL_SUBFRAMES][numLC3plusDecoders] where all require subframes must be flagged with 1, frames that are not required with 0 */ +ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] /* i: */ +); + +ivas_error IVAS_LC3PLUS_DEC_Decode( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ +); + +ivas_error IVAS_LC3PLUS_DEC_Conceal( + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + float **pcm_out /* o: concealed samples */ +); + +ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix(int16_t ***subframeChannelMatrix, uint32_t num_decs); + +void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(int16_t **subframeChannelMatrix); diff --git a/lib_rend/ivas_lc3plus_enc.c b/lib_rend/ivas_lc3plus_enc.c new file mode 100644 index 0000000000..758299c067 --- /dev/null +++ b/lib_rend/ivas_lc3plus_enc.c @@ -0,0 +1,296 @@ +/****************************************************************************************************** + + (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 "ivas_lc3plus_enc.h" +#include "ivas_lc3plus_common.h" +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" +#include "ivas_error_utils.h" +#include "prot.h" +#include "wmc_auto.h" + +ivas_error IVAS_LC3PLUS_ENC_Open( + const LC3PLUS_CONFIG config, /* i: encoder configuration */ + const uint32_t bitsPerSecond, /* i: bit rate */ + IVAS_LC3PLUS_ENC_HANDLE *handle /* o: encoder handle */ +) +{ + int32_t bitsPerSecondPerChannel; + int32_t encoder_size; + LC3PLUS_Error err; + int32_t lfeChans[1] = { 0 }; + int16_t i; + + if ( 0U == config.channels ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid number of channels\n" ); + } + bitsPerSecondPerChannel = bitsPerSecond / config.channels; +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + if ( bitsPerSecond == (uint32_t) -1 ) + { + bitsPerSecondPerChannel = SPLIT_REND_LC3PLUS_HBR; + } +#endif + + encoder_size = lc3plus_enc_get_size( config.samplerate, 1 ); + if ( 0 == encoder_size ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_enc_get_size failed\n" ); + } + + *handle = malloc( sizeof( struct IVAS_LC3PLUS_ENC_HANDLE ) ); + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); + } + + ( *handle )->pcm_conversion_buffer = NULL; + ( *handle )->num_encs = 0; + ( *handle )->handles = malloc( config.channels * sizeof( IVAS_LC3PLUS_ENC_HANDLE ) ); + if ( NULL == ( *handle )->handles ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); + } + for ( i = 0; i < config.channels; ++i ) + { + ( *handle )->handles[i] = NULL; + } + ( *handle )->num_encs = config.channels; + + for ( int32_t iCh = 0; iCh < config.channels; iCh++ ) + { + ( *handle )->handles[iCh] = malloc( encoder_size ); + if ( NULL == ( *handle )->handles[iCh] ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder\n" ); + } + + err = lc3plus_enc_init( ( *handle )->handles[iCh], config.samplerate, 1, 0, lfeChans ); + if ( err != LC3PLUS_OK ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_init failed\n" ); + } + + err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 ); + if ( err != LC3PLUS_OK ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_frame_dms failed\n" ); + } + + err = lc3plus_enc_set_bitrate( ( *handle )->handles[iCh], bitsPerSecondPerChannel ); + if ( err != LC3PLUS_OK ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_set_bitrate failed\n" ); + } + } + + if ( config.ivas_frame_duration_us < config.lc3plus_frame_duration_us || config.ivas_frame_duration_us % config.lc3plus_frame_duration_us != 0 ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Current pcm_conversion_buffer sizing requires that lc3plus uses a shorter or equal frame duration than ivas\n" ); + } + ( *handle )->config = config; + ( *handle )->pcm_conversion_buffer = malloc( sizeof( int16_t ) * config.samplerate * config.lc3plus_frame_duration_us / 1000000 ); + if ( NULL == ( *handle )->pcm_conversion_buffer ) + { + IVAS_LC3PLUS_ENC_Close( handle ); + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus encoder wrapper pcm_conversion_buffer\n" ); + } + return IVAS_ERR_OK; +} + +ivas_error IVAS_LC3PLUS_ENC_GetDelay( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + int32_t *delayInSamples /* o: encoder delay in number of samples per channel */ +) +{ + int32_t tmpDelayInSamples; + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Enc_Wrap_Handle is NULL\n" ); + } + if ( NULL == delayInSamples ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "delayInSamples is NULL\n" ); + } + + *delayInSamples = 0; + /* sanity check whether all encoders are actually configured identically */ + for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) + { + if ( NULL == handle->handles[iEnc] ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3plus encoder handle is NULL\n" ); + } + + tmpDelayInSamples = lc3plus_enc_get_delay( handle->handles[iEnc] ); + if ( 0 != *delayInSamples && tmpDelayInSamples != *delayInSamples ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "Not all mono LC3plus encoders are configured identically\n" ); + } + *delayInSamples = tmpDelayInSamples; + } + return IVAS_ERR_OK; +} + +ivas_error IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + int32_t *bsSize /* o: size of each bitstream frame in bytes */ +) +{ + int32_t bitstreamSizeMultiplier; + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Enc_Wrap_Handle is NULL\n" ); + } + if ( NULL == bsSize ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "bsSize is NULL\n" ); + } + + *bsSize = 0; + for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) + { + if ( NULL == handle->handles[iEnc] ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3plus encoder handle is NULL\n" ); + } + *bsSize += lc3plus_enc_get_num_bytes( handle->handles[iEnc] ); + } + + if ( handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) + { + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "ivas_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); + } + bitstreamSizeMultiplier = handle->config.ivas_frame_duration_us / handle->config.lc3plus_frame_duration_us; + + *bsSize *= bitstreamSizeMultiplier; + return IVAS_ERR_OK; +} + +void IVAS_LC3PLUS_ENC_Close( + IVAS_LC3PLUS_ENC_HANDLE *handle /* i/o: pointer to encoder handle */ +) +{ + if ( NULL == handle || NULL == *handle ) + { + return; + } + for ( uint32_t iEnc = 0; iEnc < ( *handle )->num_encs; iEnc++ ) + { + if ( NULL != ( *handle )->handles[iEnc] ) + { + lc3plus_free_encoder_structs( ( *handle )->handles[iEnc] ); + free( ( *handle )->handles[iEnc] ); + } + } + if ( NULL != ( *handle )->pcm_conversion_buffer ) + { + free( ( *handle )->pcm_conversion_buffer ); + } + free( ( *handle )->handles ); + free( *handle ); + *handle = NULL; +} + +ivas_error IVAS_LC3PLUS_ENC_Encode( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + float **pcm_in, /* i: pointer input samples */ + void *bitstream_out /* o: pointer to bitstream frame */ +) +{ + uint32_t numSamplesPerLC3plusChannel; + uint32_t lc3framesPerIvasFrame; + int32_t ivasSampleIndex; + uint8_t *bitstream_out_iter = bitstream_out; + int32_t num_bytes = 0; + LC3PLUS_Error err; + + push_wmops( "IVAS_LC3PLUS_ENC_Encode" ); + + if ( NULL == handle ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "LC3PLUS_Enc_Wrap_Handle is NULL\n" ); + } + if ( NULL == pcm_in ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "pcm_in is NULL\n" ); + } + if ( NULL == bitstream_out ) + { + return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "bitstream_out is NULL\n" ); + } + + if ( handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) + { + return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "ivas_frame_duration_us must be equal or multiple of lc3plus_frame_duration_us \n" ); + } + lc3framesPerIvasFrame = handle->config.ivas_frame_duration_us / handle->config.lc3plus_frame_duration_us; + + numSamplesPerLC3plusChannel = handle->config.samplerate / ( 1000000 / handle->config.ivas_frame_duration_us ) / lc3framesPerIvasFrame; + for ( uint32_t iEnc = 0; iEnc < handle->num_encs; iEnc++ ) + { + for ( uint32_t iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + for ( uint32_t iSampleInt16 = 0; iSampleInt16 < numSamplesPerLC3plusChannel; iSampleInt16++ ) + { + ivasSampleIndex = iSampleInt16 + iLc3plusFrame * numSamplesPerLC3plusChannel; + handle->pcm_conversion_buffer[iSampleInt16] = max( INT16_MIN, min( pcm_in[iEnc][ivasSampleIndex], INT16_MAX ) ); + } + + num_bytes = 0; + push_wmops( "lc3plus_enc16" ); + err = lc3plus_enc16( handle->handles[iEnc], &handle->pcm_conversion_buffer, bitstream_out_iter, &num_bytes, NULL ); + pop_wmops(); + if ( err != LC3PLUS_OK ) + { + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc16 failed\n" ); + } + if ( 0 == num_bytes ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "lc3plus_enc16 did not produce output\n" ); + } + + bitstream_out_iter += num_bytes; + } + } + + pop_wmops(); + + return IVAS_ERR_OK; +} diff --git a/lib_rend/ivas_lc3plus_enc.h b/lib_rend/ivas_lc3plus_enc.h new file mode 100644 index 0000000000..e1edd9016c --- /dev/null +++ b/lib_rend/ivas_lc3plus_enc.h @@ -0,0 +1,73 @@ +/****************************************************************************************************** + + (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. + +*******************************************************************************************************/ + +#pragma once + +#include +#include "lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.h" +#include "ivas_error.h" +#include "ivas_lc3plus_common.h" + +/* encoder wrapper */ +typedef struct IVAS_LC3PLUS_ENC_HANDLE +{ + LC3PLUS_CONFIG config; + LC3PLUS_Enc **handles; + uint32_t num_encs; + int16_t *pcm_conversion_buffer; +} * IVAS_LC3PLUS_ENC_HANDLE; + +ivas_error IVAS_LC3PLUS_ENC_Open( + const LC3PLUS_CONFIG config, /* i: encoder configuration */ + const uint32_t bitsPerSecond, /* i: bit rate */ + IVAS_LC3PLUS_ENC_HANDLE *handle /* o: encoder handle */ +); + +ivas_error IVAS_LC3PLUS_ENC_GetDelay( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + int32_t *delayInSamples /* o: algorithmic delay of encoding and decoding in number of samples per channel */ +); + +ivas_error IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + int32_t *bsSize /* o: size of each bitstream frame in bytes */ +); + +void IVAS_LC3PLUS_ENC_Close( + IVAS_LC3PLUS_ENC_HANDLE *handle /* i/o: pointer to encoder handle */ +); + +ivas_error IVAS_LC3PLUS_ENC_Encode( + IVAS_LC3PLUS_ENC_HANDLE handle, /* i: encoder handle */ + float **pcm_in, /* i: pointer input samples */ + void *bitstream_out /* o: pointer to bitstream frame */ +); diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 0618534448..8fb3497458 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -35,6 +35,9 @@ #include "options.h" #include "prot.h" #include "ivas_prot_rend.h" +#ifdef SPLIT_REND_LC3PLUS +#include "ivas_prot.h" +#endif #include #include "ivas_rom_com.h" #ifdef DEBUGGING @@ -545,8 +548,17 @@ ivas_error ivas_td_binaural_open_ext( transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT; +#ifdef TD_TDREND_FIX_NULLPTR_ACCESS + if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + { + hTransSetup.ls_azimuth = customLsInput->ls_azimuth; + hTransSetup.ls_elevation = customLsInput->ls_elevation; + } +#else hTransSetup.ls_azimuth = customLsInput->ls_azimuth; hTransSetup.ls_elevation = customLsInput->ls_elevation; +#endif /* TD_TDREND_FIX_NULLPTR_ACCESS */ + if ( NULL != hRendCfg ) { @@ -632,6 +644,131 @@ ivas_error ivas_td_binaural_renderer_ext( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_LC3PLUS +/*---------------------------------------------------------------------* + * ObjRenderIvasFrame_splitBinaural() + * + * Render to multiple binaural pairs based on relative head positions for split rendering. + *---------------------------------------------------------------------*/ +void ObjRenderIvasFrame_splitBinaural( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ +) +{ + int32_t i; + float tmpProcessing[MAX_NUM_OBJECTS][L_FRAME48k]; + float tmpBinaural[MAX_HEAD_ROT_POSES * 2][L_FRAME48k]; + int16_t pos_idx; + IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + BINAURAL_TD_OBJECT_RENDERER_HANDLE tmpTdRendHandle; + + push_wmops( "ObjRenderIvasFrame_splitBinaural" ); + + pMultiBinPoseData = &st_ivas->splitBinRend.splitrend.multiBinPoseData; + + /* If not yet allocated, open additional instances of TD renderer */ + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( st_ivas->splitBinRend.splitrend.hTdRendHandles[i] != NULL ) + { + continue; + } + + 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->splitBinRend.splitrend.hTdRendHandles[i], + &st_ivas->binaural_latency_ns ); + } + + /* Save current head positions */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + originalHeadRot[i] = st_ivas->hHeadTrackData->Quaternions[i]; + } + + /* Copy input audio to a processing buffer. Cannot render in-place because binaurally rendered + * audio would overwrite original material, which is still needed for rendering next head pose. */ + for ( i = 0; i < MAX_NUM_OBJECTS; ++i ) + { + mvr2r( output[i], tmpProcessing[i], output_frame ); + } + + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + /* Update head positions */ + if ( pos_idx != 0 ) + { + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + if ( originalHeadRot[i].w == -3.0f ) + { + st_ivas->hHeadTrackData->Quaternions[i].w = -3.0f; + st_ivas->hHeadTrackData->Quaternions[i].x = originalHeadRot[i].x + pMultiBinPoseData->relative_head_poses[pos_idx][0]; + st_ivas->hHeadTrackData->Quaternions[i].y = originalHeadRot[i].y + pMultiBinPoseData->relative_head_poses[pos_idx][1]; + st_ivas->hHeadTrackData->Quaternions[i].z = originalHeadRot[i].z + pMultiBinPoseData->relative_head_poses[pos_idx][2]; + } + else + { + st_ivas->hHeadTrackData->Quaternions[i].w = -3.0f; + Quat2EulerDegree( originalHeadRot[i], /* TODO tmu : fix bug with ordering*/ + &st_ivas->hHeadTrackData->Quaternions[i].z, + &st_ivas->hHeadTrackData->Quaternions[i].y, + &st_ivas->hHeadTrackData->Quaternions[i].x ); + st_ivas->hHeadTrackData->Quaternions[i].x += pMultiBinPoseData->relative_head_poses[pos_idx][0]; + st_ivas->hHeadTrackData->Quaternions[i].y += pMultiBinPoseData->relative_head_poses[pos_idx][1]; + st_ivas->hHeadTrackData->Quaternions[i].z += pMultiBinPoseData->relative_head_poses[pos_idx][2]; + } + } + } + + /* Render */ + if ( pos_idx == 0 ) + { + ivas_td_binaural_renderer( st_ivas, tmpProcessing, output_frame ); + } + else + { + /* Tmp swap renderer handles for rendering call */ + tmpTdRendHandle = st_ivas->hBinRendererTd; + st_ivas->hBinRendererTd = st_ivas->splitBinRend.splitrend.hTdRendHandles[pos_idx - 1]; + ivas_td_binaural_renderer( st_ivas, tmpProcessing, output_frame ); + st_ivas->hBinRendererTd = tmpTdRendHandle; + } + + /* Copy rendered audio to tmp storage buffer. Copying directly to output would + * overwrite original audio, which is still needed for rendering next head pose. */ + mvr2r( tmpProcessing[0], tmpBinaural[2 * pos_idx], output_frame ); + mvr2r( tmpProcessing[1], tmpBinaural[2 * pos_idx + 1], output_frame ); + + /* Overwrite first 2 channels with original input audio again */ + mvr2r( output[0], tmpProcessing[0], output_frame ); + mvr2r( output[1], tmpProcessing[1], output_frame ); + } + + /* Copy from storage buffer to output */ + for ( i = 0; i < pMultiBinPoseData->num_poses * BINAURAL_CHANNELS; ++i ) + { + mvr2r( tmpBinaural[i], output[i], output_frame ); + } + + /* Restore original head rotation */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + st_ivas->hHeadTrackData->Quaternions[i] = originalHeadRot[i]; + } + + pop_wmops(); +} +#endif + + /*---------------------------------------------------------------------* * angles_to_vec() * diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index af3231df61..8d102714ae 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -182,6 +182,14 @@ static void sincResample( const float *p_sinc_forward; const float *p_sinc_backward; +#ifdef TD_REND_FIX_DIV_BY_ZERO + /* avoid division by 0 */ + if ( 0 == length_out ) + { + return; + } +#endif /* TD_REND_FIX_DIV_BY_ZERO */ + /* Compute fractional time step */ t_step = (float) ( length_in ) / (float) ( length_out ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3bf05159d4..1d5aec07fa 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -211,6 +211,15 @@ void ivas_HRTF_CRend_binary_close( * TD object renderer *----------------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_LC3PLUS +/* TODO(sgi): Rework interface */ +void ObjRenderIvasFrame_splitBinaural( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ +); +#endif + ivas_error ivas_td_binaural_renderer_unwrap( const REVERB_HANDLE hReverb, /* i : Reverberator handle */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ @@ -566,6 +575,11 @@ IVAS_QUATERNION ivas_split_rend_get_sf_rot_data( void ivas_rend_closeCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend ); int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate ); int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, const int16_t pcm_out ); +#ifdef SPLIT_REND_LC3PLUS +int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); +int8_t ivas_get_lc3plus_bitrate_id( const int32_t SplitRendBitRate ); +int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); +#endif void ivas_split_rend_get_quant_params( const int16_t num_md_bands, int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], @@ -1058,8 +1072,12 @@ ivas_error ivas_splitBinPreRendOpen( ivas_error ivas_splitBinPostRendOpen( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - const int32_t output_Fs, - const int16_t is_cldfb_in ); + const int32_t output_Fs +#ifndef SPLIT_REND_LC3PLUS + ,const int16_t is_cldfb_in +#endif +); + void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); @@ -1068,16 +1086,28 @@ void ivas_renderSplitGetMultiBinPoseData( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const IVAS_SPLIT_REND_ROT_AXIS rot_axis); +#ifdef SPLIT_REND_LC3PLUS +void ivas_renderSplitUpdateNoCorrectionPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ); +#endif + ivas_error ivas_renderMultiBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], const int32_t SplitRendBitRate, +#ifdef SPLIT_REND_LC3PLUS + const IVAS_SPLIT_REND_CODEC splitCodec, +#endif ivas_split_rend_bits_t *pBits, float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, float out[][L_FRAME48k], const int16_t low_res_pre_rend_rot, +#ifdef SPLIT_REND_LC3PLUS + const int8_t td_input, +#endif const int16_t pcm_out ); diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index baaec129d6..8829a8b830 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -135,5 +135,10 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->split_rend_config.hq_mode = 0; ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; #endif +#ifdef SPLIT_REND_LC3PLUS + ( *hRenderConfig )->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LCLD; + ( *hRenderConfig )->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; +#endif + return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 80e7d5c23e..596dc8f918 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -887,7 +887,7 @@ static float SHrot_w( if ( m == 0 ) { - printf( "ERROR should not be called\n" ); + assert( 0 && "ERROR should not be called\n" ); return 0.0f; } else diff --git a/lib_rend/ivas_splitRend_lcld_dec.c b/lib_rend/ivas_splitRend_lcld_dec.c index eab5b7d1e3..641d642152 100644 --- a/lib_rend/ivas_splitRend_lcld_dec.c +++ b/lib_rend/ivas_splitRend_lcld_dec.c @@ -152,6 +152,8 @@ void ivas_splitBinLCLDDecProcess( #endif ) { + push_wmops( "ivas_splitBinLCLDDecProcess" ); + assert( hSplitBinLCLDDec != NULL ); assert( Cldfb_Out_Real != NULL ); assert( Cldfb_Out_Imag != NULL ); @@ -218,6 +220,8 @@ void ivas_splitBinLCLDDecProcess( ivas_splitBinRendPLCsaveState( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real, Cldfb_Out_Imag, (int16_t) hSplitBinLCLDDec->iChannels ); #endif + pop_wmops(); + return; } #endif diff --git a/lib_rend/ivas_splitRend_lcld_enc.c b/lib_rend/ivas_splitRend_lcld_enc.c index d2f4ebf638..1904f895b3 100644 --- a/lib_rend/ivas_splitRend_lcld_enc.c +++ b/lib_rend/ivas_splitRend_lcld_enc.c @@ -141,13 +141,15 @@ void ivas_splitBinLCLDEncProcess( const int32_t available_bits, ivas_split_rend_bits_t *pBits ) { + int32_t iBitsWritten; + + push_wmops( "ivas_splitBinLCLDEncProcess" ); + assert( hSplitBinLCLDEnc != NULL ); assert( Cldfb_In_Real != NULL ); assert( Cldfb_In_Imag != NULL ); assert( pBits != NULL ); - int32_t iBitsWritten; - // A conversion is needed for the 3d pointer interface here ........ :( for ( int32_t n = 0; n < hSplitBinLCLDEnc->iChannels; n++ ) { @@ -214,6 +216,8 @@ void ivas_splitBinLCLDEncProcess( printf( "Bits written = %d\n", iBitsWritten ); #endif + pop_wmops(); + return; } #endif diff --git a/lib_rend/ivas_splitRendererPost.c b/lib_rend/ivas_splitRendererPost.c index 3b22d644ce..78ad146699 100644 --- a/lib_rend/ivas_splitRendererPost.c +++ b/lib_rend/ivas_splitRendererPost.c @@ -55,8 +55,12 @@ ivas_error ivas_splitBinPostRendOpen( BIN_HR_SPLIT_POST_REND_HANDLE *hBinHrSplitPostRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, - const int32_t output_Fs, - const int16_t is_cldfb_in ) + const int32_t output_Fs +#ifndef SPLIT_REND_LC3PLUS + , + const int16_t is_cldfb_in +#endif +) { BIN_HR_SPLIT_POST_REND_HANDLE hBinRend; ivas_error error; @@ -90,13 +94,17 @@ ivas_error ivas_splitBinPostRendOpen( { return error; } +#ifndef SPLIT_REND_LC3PLUS if ( is_cldfb_in == 0 ) { +#endif if ( ( error = openCldfb( &( hBinRend->cldfbAna[ch] ), CLDFB_ANALYSIS, output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) { return error; } +#ifndef SPLIT_REND_LC3PLUS } +#endif } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG @@ -1806,11 +1814,15 @@ void ivas_rend_CldfbSplitPostRendProcess( const int16_t is_cldfb_in ) { int16_t ch_idx, slot_idx, num_cldfb_bands; + + push_wmops( "ivas_rend_CldfbSplitPostRendProcess" ); + num_cldfb_bands = hBinHrSplitPostRend->cldfbSyn[0]->no_channels; if ( is_cldfb_in == 0 ) { ivas_rend_CldfbSplitPostRendProcessTdIn( hBinHrSplitPostRend, pMultiBinPoseData, QuaternionsPost, output ); + pop_wmops(); return; } @@ -1836,6 +1848,8 @@ void ivas_rend_CldfbSplitPostRendProcess( cldfbSynthesis( RealBuffer, ImagBuffer, &( output[ch_idx][0] ), num_cldfb_bands * CLDFB_NO_COL_MAX, hBinHrSplitPostRend->cldfbSyn[ch_idx] ); } + pop_wmops(); + return; } @@ -1843,6 +1857,9 @@ void ivas_init_split_post_rend_handles( SPLIT_POST_REND_WRAPPER *hSplitRendWrapp { hSplitRendWrapper->hBinHrSplitPostRend = NULL; hSplitRendWrapper->hSplitBinLCLDDec = NULL; +#ifdef SPLIT_REND_LC3PLUS + hSplitRendWrapper->hLc3plusDec = NULL; +#endif ivas_init_multi_bin_pose_data( &hSplitRendWrapper->multiBinPoseData ); #ifdef SPLIT_REND_PLC hSplitRendWrapper->first_good_frame_received = 0; diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index e6667c0d51..ba1ce4244c 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -46,6 +46,9 @@ #include "ivas_rom_binauralRenderer.h" #include "lib_rend.h" #include "ivas_prot_rend.h" +#ifdef SPLIT_REND_LC3PLUS +#include "ivas_lc3plus_enc.h" +#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -1304,7 +1307,7 @@ static void ivas_SplitRenderer_quant_code( void ivas_SplitRenderer_GetRotMd( - BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ @@ -1440,6 +1443,7 @@ void ivas_rend_CldfbSplitPreRendProcess( const int32_t target_md_bits, const int16_t low_res_pre_rend_rot ) { + push_wmops( "ivas_rend_CldfbSplitPreRendProcess" ); ivas_SplitRenderer_GetRotMd( hBinHrSplitPreRend, @@ -1456,6 +1460,8 @@ void ivas_rend_CldfbSplitPreRendProcess( low_res_pre_rend_rot, target_md_bits ); + pop_wmops(); + return; } @@ -1547,14 +1553,86 @@ void ivas_splitBinPreRendClose( BIN_HR_SPLIT_PRE_REND_HANDLE *hBinHrSplitPreRend void ivas_init_split_rend_handles( SPLIT_REND_WRAPPER *hSplitRendWrapper ) { +#ifdef SPLIT_REND_LC3PLUS + int32_t i; +#endif + hSplitRendWrapper->hBinHrSplitPreRend = NULL; hSplitRendWrapper->hCldfbHandles = NULL; hSplitRendWrapper->hSplitBinLCLDEnc = NULL; +#ifdef SPLIT_REND_LC3PLUS + hSplitRendWrapper->hLc3plusEnc = NULL; + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + hSplitRendWrapper->hTdRendHandles[i] = NULL; + } + for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) + { + hSplitRendWrapper->lc3plusDelayBuffers[i] = NULL; + } + hSplitRendWrapper->lc3plusDelaySamples = 0; +#endif ivas_init_multi_bin_pose_data( &hSplitRendWrapper->multiBinPoseData ); return; } +#ifdef SPLIT_REND_LC3PLUS +static ivas_error split_renderer_open_lc3plus( SPLIT_REND_WRAPPER *hSplitRendWrapper, + const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, + const int32_t OutSampleRate ) +{ + ivas_error error; + int32_t i, delayBufferLength; + LC3PLUS_CONFIG config; + + config.lc3plus_frame_duration_us = 5000; + config.ivas_frame_duration_us = 20000; + config.samplerate = OutSampleRate; + + config.channels = BINAURAL_CHANNELS; + + error = IVAS_LC3PLUS_ENC_Open( config, ivas_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ), &hSplitRendWrapper->hLc3plusEnc ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + /* This returns delay of entire LC3plus chain (enc + dec) */ + error = IVAS_LC3PLUS_ENC_GetDelay( hSplitRendWrapper->hLc3plusEnc, &hSplitRendWrapper->lc3plusDelaySamples ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + /* Alocate buffers for delay compensation */ + if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ) + { + delayBufferLength = OutSampleRate / FRAMES_PER_SECOND + hSplitRendWrapper->lc3plusDelaySamples; + for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i ) + { + hSplitRendWrapper->lc3plusDelayBuffers[i] = malloc( delayBufferLength * sizeof( float ) ); + set_zero( hSplitRendWrapper->lc3plusDelayBuffers[i], delayBufferLength ); + } + } + else + { + /* Delay is always expected to be exactly 2 CLDFB columns */ + assert( hSplitRendWrapper->lc3plusDelaySamples % ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 0 ); + assert( hSplitRendWrapper->lc3plusDelaySamples / ( OutSampleRate / FRAMES_PER_SEC / CLDFB_NO_COL_MAX ) == 2 ); + + delayBufferLength = 2 /* Columns */ * 2 /* real and imag */ * CLDFB_NO_CHANNELS_MAX; + for ( i = 0; i < hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; ++i ) + { + hSplitRendWrapper->lc3plusDelayBuffers[i] = malloc( delayBufferLength * sizeof( float ) ); + set_zero( hSplitRendWrapper->lc3plusDelayBuffers[i], delayBufferLength ); + } + } + + return IVAS_ERR_OK; +} +#endif + ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, const int32_t OutSampleRate, @@ -1562,10 +1640,35 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, const int16_t is_pcm_out ) { ivas_error error, ch, num_ch; +#ifdef SPLIT_REND_LC3PLUS + CLDFB_TYPE cldfbMode; + uint8_t useLc3plus; + uint8_t isCldfbNeeded = 0; + + useLc3plus = pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS; /* TODO(sgi): change "useLc3plus" to "splitCodec" */ +#endif error = IVAS_ERR_OK; - hSplitRendWrapper->hCldfbHandles = NULL; +#ifdef SPLIT_REND_LC3PLUS if ( is_cldfb_in == 0 ) + { + isCldfbNeeded = 1; + cldfbMode = CLDFB_ANALYSIS; + } + else if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && is_cldfb_in ) + { + isCldfbNeeded = 1; + cldfbMode = CLDFB_SYNTHESIS; + } +#endif + + hSplitRendWrapper->hCldfbHandles = NULL; + if ( +#ifdef SPLIT_REND_LC3PLUS + isCldfbNeeded ) +#else + is_cldfb_in == 0 ) +#endif { if ( ( hSplitRendWrapper->hCldfbHandles = (CLDFB_HANDLES_WRAPPER_HANDLE) malloc( sizeof( CLDFB_HANDLES_WRAPPER ) ) ) == NULL ) { @@ -1584,10 +1687,22 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, num_ch = ( 1 + hSplitRendWrapper->multiBinPoseData.num_poses ) * BINAURAL_CHANNELS; #else num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; +#endif +#ifdef SPLIT_REND_LC3PLUS + if ( cldfbMode == CLDFB_SYNTHESIS ) + { + num_ch = BINAURAL_CHANNELS; + } #endif for ( ch = 0; ch < num_ch; ch++ ) { - if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), CLDFB_ANALYSIS, OutSampleRate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) + if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), +#ifdef SPLIT_REND_LC3PLUS + cldfbMode, +#else + CLDFB_ANALYSIS, +#endif + OutSampleRate, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK ) { return error; } @@ -1607,17 +1722,34 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, } if ( is_pcm_out == 0 ) { - error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate ) ); - if ( error != IVAS_ERR_OK ) +#ifdef SPLIT_REND_LC3PLUS + if ( !useLc3plus ) + { +#endif + error = ivas_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, ivas_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate ) ); + if ( error != IVAS_ERR_OK ) + { + return error; + } +#ifdef SPLIT_REND_LC3PLUS + } + else { - return error; + error = split_renderer_open_lc3plus( hSplitRendWrapper, pSplitRendConfig, OutSampleRate ); + if ( error != IVAS_ERR_OK ) + { + return error; + } } +#endif } return error; } void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ) { + int32_t i; + if ( hSplitBinRend->hBinHrSplitPreRend != NULL ) { ivas_splitBinPreRendClose( &hSplitBinRend->hBinHrSplitPreRend ); @@ -1646,9 +1778,78 @@ void ivas_split_renderer_close( SPLIT_REND_WRAPPER *hSplitBinRend ) free( hSplitBinRend->hCldfbHandles ); hSplitBinRend->hCldfbHandles = NULL; } + +#ifdef SPLIT_REND_LC3PLUS + if ( hSplitBinRend->hLc3plusEnc != NULL ) + { + IVAS_LC3PLUS_ENC_Close( &hSplitBinRend->hLc3plusEnc ); + } + + for ( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) + { + if ( hSplitBinRend->lc3plusDelayBuffers[i] != NULL ) + { + free( hSplitBinRend->lc3plusDelayBuffers[i] ); + hSplitBinRend->lc3plusDelayBuffers[i] = NULL; + } + } + + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( hSplitBinRend->hTdRendHandles[i] != NULL ) + { + hSplitBinRend->hTdRendHandles[i]->HrFiltSet_p = NULL; + ivas_td_binaural_close( &hSplitBinRend->hTdRendHandles[i] ); + } + } +#endif + return; } +#ifdef SPLIT_REND_LC3PLUS +static ivas_error splitRendLc3plusEncodeAndWrite( + SPLIT_REND_WRAPPER *hSplitBin, + ivas_split_rend_bits_t *pBits, + const int32_t SplitRendBitRate, + float in[][L_FRAME48k] ) +{ + ivas_error error; + int16_t i; + + int32_t lc3plusBitstreamSize; + float *channel_ptrs[MAX_HEAD_ROT_POSES * 2]; + assert( hSplitBin->hLc3plusEnc != NULL ); + + /* Find next byte boundary and zero-pad to it */ + while ( pBits->bits_written % 8 != 0 ) + { + ivas_split_rend_bitstream_write_int32( pBits, (int32_t) 0, 1 ); + } + + for ( i = 0; i < BINAURAL_CHANNELS * hSplitBin->multiBinPoseData.num_poses; ++i ) + { + channel_ptrs[i] = in[i]; + } + if ( ( error = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( hSplitBin->hLc3plusEnc, &lc3plusBitstreamSize ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Write bitstream size info */ + ivas_split_rend_bitstream_write_int32( pBits, ivas_get_lc3plus_bitrate_id( SplitRendBitRate ), 8 ); + + /* Write bitstream */ + if ( ( error = IVAS_LC3PLUS_ENC_Encode( hSplitBin->hLc3plusEnc, channel_ptrs, &pBits->bits_buf[pBits->bits_written / 8] ) ) != IVAS_ERR_OK ) + { + return error; + } + pBits->bits_written += 8 * lc3plusBitstreamSize; + pBits->codec = IVAS_SPLIT_REND_CODEC_LC3PLUS; + pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; + return IVAS_ERR_OK; +} +#endif + static ivas_error ivas_renderMultiTDBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], @@ -1669,12 +1870,45 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( float Cldfb_In_BinReal[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_In_BinImag[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; #endif +#ifdef SPLIT_REND_LC3PLUS + uint8_t useLc3plus; + float *in_delayed[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; + int32_t i; +#endif + + push_wmops( "ivas_renderMultiTDBinToSplitBinaural" ); error = IVAS_ERR_OK; +#ifndef SPLIT_REND_LC3PLUS assert( hSplitBin->hCldfbHandles != NULL ); num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; +#endif num_poses = hSplitBin->multiBinPoseData.num_poses; +#ifdef SPLIT_REND_LC3PLUS + useLc3plus = hSplitBin->hLc3plusEnc != NULL; + + if ( useLc3plus ) + { + int32_t frame_size = hSplitBin->hLc3plusEnc->config.samplerate / FRAMES_PER_SECOND; + + for ( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) + { + /* Artificially delay input to head pose correction analysis by LC3plus coding delay, so that audio and metadata are in sync after decoding */ + mvr2r( hSplitBin->lc3plusDelayBuffers[i] + frame_size, hSplitBin->lc3plusDelayBuffers[i], hSplitBin->lc3plusDelaySamples ); + in_delayed[i] = hSplitBin->lc3plusDelayBuffers[i]; + mvr2r( in[i], hSplitBin->lc3plusDelayBuffers[i] + hSplitBin->lc3plusDelaySamples, frame_size ); + } + } + else + { + for ( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) + { + in_delayed[i] = in[i]; + } + } +#endif + #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) { @@ -1695,51 +1929,80 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( } #endif +#ifdef SPLIT_REND_LC3PLUS + if ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + num_cldfb_bands = hSplitBin->hCldfbHandles->cldfbAna[0]->no_channels; - /* CLDFB Analysis*/ +#endif + /* CLDFB Analysis*/ #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - for ( pos_idx = 0; pos_idx < num_poses + 1; pos_idx++ ) + for ( pos_idx = 0; pos_idx < num_poses + 1; pos_idx++ ) #else for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) #endif - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { - for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + { +#ifdef SPLIT_REND_LC3PLUS + cldfbAnalysis_ts( &( in_delayed[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), +#else cldfbAnalysis_ts( &( in[pos_idx * BINAURAL_CHANNELS + ch][num_cldfb_bands * slot_idx] ), - Cldfb_In_BinReal[pos_idx][ch][slot_idx], - Cldfb_In_BinImag[pos_idx][ch][slot_idx], - max_bands, - hSplitBin->hCldfbHandles->cldfbAna[pos_idx * BINAURAL_CHANNELS + ch] ); +#endif + Cldfb_In_BinReal[pos_idx][ch][slot_idx], + Cldfb_In_BinImag[pos_idx][ch][slot_idx], + max_bands, + hSplitBin->hCldfbHandles->cldfbAna[pos_idx * BINAURAL_CHANNELS + ch] ); + } } } - } - target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written; - ivas_rend_CldfbSplitPreRendProcess( - hSplitBin->hBinHrSplitPreRend, - headPositions, - &hSplitBin->multiBinPoseData, - Cldfb_In_BinReal, - Cldfb_In_BinImag, - pBits, - target_md_bits, - low_res_pre_rend_rot ); + target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written; + ivas_rend_CldfbSplitPreRendProcess( + hSplitBin->hBinHrSplitPreRend, + headPositions, + &hSplitBin->multiBinPoseData, + Cldfb_In_BinReal, + Cldfb_In_BinImag, + pBits, + target_md_bits, + low_res_pre_rend_rot ); + } if ( pcm_out == 0 ) { - // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; - available_bits = SplitRendBitRate * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written - actual_md_bits; - available_bits -= actual_md_bits; - ivas_splitBinLCLDEncProcess( - hSplitBin->hSplitBinLCLDEnc, - Cldfb_In_BinReal[0], - Cldfb_In_BinImag[0], - available_bits, - pBits ); +#ifdef SPLIT_REND_LC3PLUS + pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; + pBits->codec = useLc3plus ? IVAS_SPLIT_REND_CODEC_LC3PLUS : IVAS_SPLIT_REND_CODEC_LCLD; /* TODO(sgi): useLc3plus could be changed to splitCodec */ +#endif + +#ifdef SPLIT_REND_LC3PLUS + if ( !useLc3plus ) + { +#endif + // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; + available_bits = SplitRendBitRate * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + ivas_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0], + available_bits, + pBits ); +#ifdef SPLIT_REND_LC3PLUS + } + else + { + if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, SplitRendBitRate, in ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } /*zero pad*/ @@ -1748,60 +2011,179 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( { ivas_split_rend_bitstream_write_int32( pBits, (int32_t) 0, 1 ); } + + pop_wmops(); + return error; } +#ifdef SPLIT_REND_LC3PLUS +static void lc3plusTimeAlignCldfbPoseCorr( + SPLIT_REND_WRAPPER *hSplitBin, + float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] ) +{ + float Cldfb_In_BinReal_tmp[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_In_BinImag_tmp[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX]; + int16_t pose, ch, slot_idx; + float *bufRead, *bufWrite; + + for ( pose = 0; pose < hSplitBin->multiBinPoseData.num_poses; ++pose ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ++ch ) + { + bufRead = hSplitBin->lc3plusDelayBuffers[pose * BINAURAL_CHANNELS + ch]; + bufWrite = bufRead; + + /* Save last 2 columns for next frame */ + for ( slot_idx = 0; slot_idx < 2; ++slot_idx ) + { + mvr2r( Cldfb_In_BinReal[pose][ch][CLDFB_NO_COL_MAX - 2 + slot_idx], Cldfb_In_BinReal_tmp[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX ); + mvr2r( Cldfb_In_BinImag[pose][ch][CLDFB_NO_COL_MAX - 2 + slot_idx], Cldfb_In_BinImag_tmp[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX ); + } + + /* Delay existing columns by 2 slots */ + for ( slot_idx = CLDFB_NO_COL_MAX - 2 - 1; slot_idx >= 0; --slot_idx ) + { + mvr2r( Cldfb_In_BinReal[pose][ch][slot_idx], Cldfb_In_BinReal[pose][ch][slot_idx + 2], CLDFB_NO_CHANNELS_MAX ); + mvr2r( Cldfb_In_BinImag[pose][ch][slot_idx], Cldfb_In_BinImag[pose][ch][slot_idx + 2], CLDFB_NO_CHANNELS_MAX ); + } + + /* Fill 2 first columns from buffer */ + for ( slot_idx = 0; slot_idx < 2; ++slot_idx ) + { + mvr2r( bufRead, Cldfb_In_BinReal[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX ); + bufRead += CLDFB_NO_CHANNELS_MAX; + mvr2r( bufRead, Cldfb_In_BinImag[pose][ch][slot_idx], CLDFB_NO_CHANNELS_MAX ); + bufRead += CLDFB_NO_CHANNELS_MAX; + } + + /* Copy last 2 columns to buffer */ + for ( slot_idx = 0; slot_idx < 2; ++slot_idx ) + { + mvr2r( Cldfb_In_BinReal_tmp[pose][ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX ); + bufWrite += CLDFB_NO_CHANNELS_MAX; + mvr2r( Cldfb_In_BinImag_tmp[pose][ch][slot_idx], bufWrite, CLDFB_NO_CHANNELS_MAX ); + bufWrite += CLDFB_NO_CHANNELS_MAX; + } + } + } +} +#endif + ivas_error ivas_renderMultiBinToSplitBinaural( SPLIT_REND_WRAPPER *hSplitBin, const IVAS_QUATERNION headPositions[MAX_PARAM_SPATIAL_SUBFRAMES], const int32_t SplitRendBitRate, +#ifdef SPLIT_REND_LC3PLUS + const IVAS_SPLIT_REND_CODEC splitCodec, +#endif ivas_split_rend_bits_t *pBits, float Cldfb_In_BinReal[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_BinImag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t max_bands, float out[][L_FRAME48k], const int16_t low_res_pre_rend_rot, +#ifdef SPLIT_REND_LC3PLUS + const int8_t td_input, +#endif const int16_t pcm_out ) { ivas_error error; int32_t bit_len, target_md_bits, actual_md_bits, available_bits; error = IVAS_ERR_OK; + push_wmops( "ivas_renderMultiBinToSplitBinaural" ); + set_fix_rotation_mat( hSplitBin->hBinHrSplitPreRend->fix_pos_rot_mat, &hSplitBin->multiBinPoseData ); set_pose_types( hSplitBin->hBinHrSplitPreRend->pose_type, &hSplitBin->multiBinPoseData ); - if ( hSplitBin->hCldfbHandles != NULL ) + if ( +#ifdef SPLIT_REND_LC3PLUS + td_input +#else + hSplitBin->hCldfbHandles != NULL +#endif + ) { /*TD input*/ /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ error = ivas_renderMultiTDBinToSplitBinaural( hSplitBin, headPositions, SplitRendBitRate, pBits, max_bands, out, low_res_pre_rend_rot, pcm_out ); + pop_wmops(); return error; } - target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written; - ivas_rend_CldfbSplitPreRendProcess( - hSplitBin->hBinHrSplitPreRend, - headPositions, - &hSplitBin->multiBinPoseData, - Cldfb_In_BinReal, - Cldfb_In_BinImag, - pBits, - target_md_bits, - low_res_pre_rend_rot ); + +#ifdef SPLIT_REND_LC3PLUS + if ( splitCodec == IVAS_SPLIT_REND_CODEC_LC3PLUS && hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + /* Time-align pose correction to delay of LC3plus */ + lc3plusTimeAlignCldfbPoseCorr( hSplitBin, Cldfb_In_BinReal, Cldfb_In_BinImag ); + } + + if ( hSplitBin->multiBinPoseData.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif + target_md_bits = ivas_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out ) * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written; + ivas_rend_CldfbSplitPreRendProcess( + hSplitBin->hBinHrSplitPreRend, + headPositions, + &hSplitBin->multiBinPoseData, + Cldfb_In_BinReal, + Cldfb_In_BinImag, + pBits, + target_md_bits, + low_res_pre_rend_rot ); +#ifdef SPLIT_REND_LC3PLUS + } +#endif if ( pcm_out == 0 ) { - // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; - available_bits = SplitRendBitRate * L_FRAME48k / 48000; - actual_md_bits = pBits->bits_written - actual_md_bits; - available_bits -= actual_md_bits; - ivas_splitBinLCLDEncProcess( - hSplitBin->hSplitBinLCLDEnc, - Cldfb_In_BinReal[0], - Cldfb_In_BinImag[0], - available_bits, - pBits ); +#ifdef SPLIT_REND_LC3PLUS + pBits->codec = splitCodec; + pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; + + if ( splitCodec == IVAS_SPLIT_REND_CODEC_LCLD ) + { +#endif + // available_bits = ivas_get_lcld_bitrate( SplitRendBitRate ) * L_FRAME48k / 48000; + available_bits = SplitRendBitRate * L_FRAME48k / 48000; + actual_md_bits = pBits->bits_written - actual_md_bits; + available_bits -= actual_md_bits; + ivas_splitBinLCLDEncProcess( + hSplitBin->hSplitBinLCLDEnc, + Cldfb_In_BinReal[0], + Cldfb_In_BinImag[0], + available_bits, + pBits ); + +#ifdef SPLIT_REND_LC3PLUS + } + else + { + int16_t ch, slot_idx; + /* CLDFB synthesis of main pose */ + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX]; + float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX]; + + for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ ) + { + Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[0][ch][slot_idx]; + Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[0][ch][slot_idx]; + } + cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, out[ch], -1, hSplitBin->hCldfbHandles->cldfbAna[ch] ); + } + + if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, SplitRendBitRate, out ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } /*zero pad*/ @@ -1812,6 +2194,9 @@ ivas_error ivas_renderMultiBinToSplitBinaural( { ivas_split_rend_bitstream_write_int32( pBits, (int32_t) 0, 1 ); } + + pop_wmops(); + return error; } #endif diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index 8725921b52..b84c37dbb5 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -396,6 +396,13 @@ int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, con md_bitrate = 128000; break; } +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + case -1: + { + md_bitrate = 256000; + break; + } +#endif default: { return -1; @@ -422,11 +429,116 @@ int32_t ivas_get_lcld_bitrate( const int32_t SplitRendBitRate ) return IVAS_256k; } default: + { + break; + } + } + return -1; +} + +#ifdef SPLIT_REND_LC3PLUS +int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ) +{ +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + if ( SplitRendBitRate == -1 ) + { + return -1; + } +#endif + + if ( poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + int32_t inBandMdBps = 8 * FRAMES_PER_SECOND; + return ivas_get_lcld_bitrate( SplitRendBitRate ) - inBandMdBps; + } + if ( poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) + { + return SplitRendBitRate; + } + + /* Should not be reached */ + assert( 0 ); + return -1; +} + +int8_t ivas_get_lc3plus_bitrate_id( const int32_t SplitRendBitRate ) +{ +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + if ( SplitRendBitRate == -1 ) + { + return 3; + } +#endif + switch ( SplitRendBitRate ) + { + case SPLIT_REND_768k: + { + return 3; + } + case SPLIT_REND_512k: + { + return 2; + } + case SPLIT_REND_384k: + { + return 1; + } + case SPLIT_REND_320k: + { + return 0; + } + default: + { + break; + } + } + return -1; +} +int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ) +{ + int32_t bitrate; + +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + if ( SplitRendBitRateId == 3 ) + { + return -1; + } +#endif + + switch ( SplitRendBitRateId ) + { + case 3: + { + bitrate = SPLIT_REND_768k; + break; + } + case 2: + { + bitrate = SPLIT_REND_512k; + break; + } + case 1: + { + bitrate = SPLIT_REND_384k; + break; + } + case 0: + { + bitrate = SPLIT_REND_320k; + break; + } + default: { return -1; } } + + bitrate = ivas_get_lc3plus_bitrate( bitrate, poseCorrectionMode ); + + /* Return size in bytes */ + return bitrate / FRAMES_PER_SECOND / 8; } +#endif void ivas_split_rend_get_quant_params( const int16_t num_md_bands, @@ -599,10 +711,26 @@ void ivas_renderSplitGetMultiBinPoseData( pMultiBinPoseData->dof = pSplit_rend_config->dof; pMultiBinPoseData->hq_mode = pSplit_rend_config->hq_mode; pMultiBinPoseData->rot_axis = rot_axis; +#ifdef SPLIT_REND_LC3PLUS + pMultiBinPoseData->poseCorrectionMode = pSplit_rend_config->poseCorrectionMode; +#endif return; } +#ifdef SPLIT_REND_LC3PLUS +void ivas_renderSplitUpdateNoCorrectionPoseData( + const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) +{ + pMultiBinPoseData->num_poses = 1; + assert( pSplit_rend_config->dof == 0 ); + pMultiBinPoseData->dof = pSplit_rend_config->dof; + assert( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ); + pMultiBinPoseData->poseCorrectionMode = pSplit_rend_config->poseCorrectionMode; +} +#endif + void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData ) { int16_t pos_idx; @@ -617,6 +745,7 @@ void ivas_init_multi_bin_pose_data( MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData pMultiBinPoseData->dof = 3; pMultiBinPoseData->hq_mode = 0; pMultiBinPoseData->rot_axis = DEFAULT_AXIS; + return; } #endif diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 114021cd3c..65f12e16de 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -43,6 +43,10 @@ #include "ivas_CQMFEncoder.h" #include "ivas_CQMFDecoder.h" #endif +#ifdef SPLIT_REND_LC3PLUS +#include "ivas_lc3plus_enc.h" +#include "ivas_lc3plus_dec.h" +#endif /*----------------------------------------------------------------------------------* * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) @@ -295,6 +299,7 @@ typedef struct #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG HANDLE_CLDFB_FILTER_BANK cldfbAna[( 1 + MAX_HEAD_ROT_POSES ) * BINAURAL_CHANNELS]; #else + /* TODO(sgi): rename to "cldfb" during harmonization - these handles are sometimes also used for synthesis */ HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; #endif } CLDFB_HANDLES_WRAPPER, *CLDFB_HANDLES_WRAPPER_HANDLE; @@ -307,15 +312,32 @@ typedef struct int16_t dof; int16_t hq_mode; IVAS_SPLIT_REND_ROT_AXIS rot_axis; +#ifdef SPLIT_REND_LC3PLUS + IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; +#endif } MULTI_BIN_REND_POSE_DATA; #endif +#ifdef SPLIT_REND_LC3PLUS +/* Forward declaration of TD_OBJECT_RENDERER_HANDLE. + This avoids shifting the entire definition of TD Renderer structs above + this line, which could cause merge conflicts. + Can be cleaned up later. */ +typedef struct ivas_binaural_td_rendering_struct *TD_OBJECT_RENDERER_HANDLE; +#endif + typedef struct { MULTI_BIN_REND_POSE_DATA multiBinPoseData; BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend; BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc; CLDFB_HANDLES_WRAPPER_HANDLE hCldfbHandles; +#ifdef SPLIT_REND_LC3PLUS + IVAS_LC3PLUS_ENC_HANDLE hLc3plusEnc; + TD_OBJECT_RENDERER_HANDLE hTdRendHandles[MAX_HEAD_ROT_POSES - 1]; + float *lc3plusDelayBuffers[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; /* Used to time-align head pose correction metadata with LC3plus-coded reference audio */ + int32_t lc3plusDelaySamples; +#endif } SPLIT_REND_WRAPPER; typedef struct @@ -326,6 +348,9 @@ typedef struct #ifdef SPLIT_REND_PLC int16_t first_good_frame_received; #endif +#ifdef SPLIT_REND_LC3PLUS + IVAS_LC3PLUS_DEC_HANDLE hLc3plusDec; +#endif } SPLIT_POST_REND_WRAPPER; #endif diff --git a/lib_rend/lc3plus_codec/.gitignore b/lib_rend/lc3plus_codec/.gitignore new file mode 100644 index 0000000000..5514f3a7bc --- /dev/null +++ b/lib_rend/lc3plus_codec/.gitignore @@ -0,0 +1,3 @@ +ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228 +package.info +lc3plus_sources.zip \ No newline at end of file diff --git a/lib_rend/lc3plus_codec/README.md b/lib_rend/lc3plus_codec/README.md new file mode 100644 index 0000000000..4dc05171ab --- /dev/null +++ b/lib_rend/lc3plus_codec/README.md @@ -0,0 +1,6 @@ +# Download and unzip LC3plus + +1. Download the V1.4.1 version of the LC3plus source code from ETSI: https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip +2. Unzip it into this folder. After unzipping, the path to the `Readme.txt` of the LC3plus sources must be: `lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/Readme.txt` +3. Apply the `lc3plus.patch`, for example by using the command `git apply --ignore-whitespace lc3plus.patch` +4. Remove files `ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c` `ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/codec_exe.c` diff --git a/lib_rend/lc3plus_codec/get_lc3plus.sh b/lib_rend/lc3plus_codec/get_lc3plus.sh new file mode 100755 index 0000000000..ab578850cc --- /dev/null +++ b/lib_rend/lc3plus_codec/get_lc3plus.sh @@ -0,0 +1,7 @@ +# This script shall only be used by automated continuous integration systems +# Humans shall follow the instructions in lib_rend/lc3plus_codec/README.md +curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip +unzip lc3plus_sources.zip -d . +rm -f lc3plus_sources.zip +git apply --ignore-whitespace lc3plus.patch +rm ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/codec_exe.c diff --git a/lib_rend/lc3plus_codec/lc3plus.patch b/lib_rend/lc3plus_codec/lc3plus.patch new file mode 100644 index 0000000000..8ebffc6289 --- /dev/null +++ b/lib_rend/lc3plus_codec/lc3plus.patch @@ -0,0 +1,1571 @@ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "stdint.h" + #include + #include +@@ -1010,8 +1011,8 @@ + LC3_UINT8 blacklist[FEC_N_MODES]; + LC3_INT32 rop; + +- rop = 0; + void (*syndr_calc[3])(LC3_UINT8 *, LC3_UINT8 *, LC3_INT32); ++ rop = 0; + + /* initialization */ + blacklist[0] = 0; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void ac_shift_fl(Encoder_State_fl* st); +@@ -620,7 +621,7 @@ + + if (st.pc_c_bp_side != 0) + { +- nbits_side = total_bits - 8 * (st.pc_b_left) + 8 * (st.pc_bytes - bp_side) - (8 - LC3_LOG2(mask_side)); ++ nbits_side = total_bits - 8 * (st.pc_b_left) + 8 * (st.pc_bytes - bp_side) - (8 - LC3_LOGTWO(mask_side)); + } + } + +@@ -891,7 +892,7 @@ + { + LC3_INT bits = 0, mask = 0, val = 0, over1 = 0, high = 0, over2 = 0, c = 0, b = 0; + +- bits = 24 - floor(LC3_LOG2(st->range)); ++ bits = 24 - floor(LC3_LOGTWO(st->range)); + mask = ((LC3_INT)pow(2, 24) - 1) >> bits; + val = st->low + mask; + over1 = val >> 24; +@@ -1078,8 +1079,8 @@ + } + + /* Residual bits */ +- nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - LC3_LOG2(*(st.mask_side))); +- nbits_ari = (st.bp + 1) * 8 + 25 - floor(LC3_LOG2(st.range)); ++ nbits_side = total_bits - (8 * (*(st.bp_side) + 1) + 8 - LC3_LOGTWO(*(st.mask_side))); ++ nbits_ari = (st.bp + 1) * 8 + 25 - floor(LC3_LOGTWO(st.range)); + + if (st.cache >= 0) { + nbits_ari = nbits_ari + 8; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + /* DCT */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void dct2_init(Dct2* dct, int length) +@@ -27,11 +28,11 @@ + + void dct2_apply(Dct2* dct, const LC3_FLOAT* input, LC3_FLOAT* output) + { +- assert(input != output); + Complex tmp1[MAX_LEN]; + Complex tmp2[MAX_LEN]; + int i = 0; + const int len = dct->length; ++ assert(input != output); + + for (i = 0; i < len / 2; i++) { + tmp1[i] = cmplx(input[i * 2], 0); +@@ -49,8 +50,8 @@ + + void dct4_init(Dct4* dct, int length) + { +- assert(length <= MAX_LEN); + int i = 0; ++ assert(length <= MAX_LEN); + dct->length = length; + dct->twid1 = calloc(sizeof(*dct->twid1), length / 2); + dct->twid2 = calloc(sizeof(*dct->twid2), length / 2); +@@ -73,12 +74,12 @@ + + void dct4_apply(Dct4* dct, const LC3_FLOAT* input, LC3_FLOAT* output) + { +- assert(input != output); + Complex tmp2[MAX_LEN / 2]; + int i = 0; + Complex* tmp1 = (Complex*)output; + const int len = dct->length; + const LC3_FLOAT norm = (LC3_FLOAT)1.0 / LC3_SQRT((LC3_FLOAT)(len >> 1)); ++ assert(input != output); + + for (i = 0; i < len / 2; i++) { + tmp1[i] = cmul(cmplx(input[i * 2], input[len - i * 2 - 1]), dct->twid1[i]); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void read_bit_fl(LC3_UINT8* ptr, LC3_INT* mask_side, LC3_INT* bp_side, LC3_INT* bit); +@@ -53,7 +54,7 @@ + LC3_INT nbbytes = nbbits >> 3; + LC3_INT lastnz; + LC3_INT bw_cutoff_idx; +- LC3_INT nbits = ceil(LC3_LOG2(L_spec / 2)); ++ LC3_INT nbits = ceil(LC3_LOGTWO(L_spec / 2)); + + if (nbits > nbbits) + { +@@ -173,7 +174,7 @@ + } + + /* Last non-zero tuple */ +- read_uint_fl(ceil(LC3_LOG2(N / 2)), ptr, &mask_side_local, &bp_side_local, lastnz); ++ read_uint_fl(ceil(LC3_LOGTWO(N / 2)), ptr, &mask_side_local, &bp_side_local, lastnz); + *lastnz = (*lastnz + 1) * 2; + + if (*lastnz > N) { +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +@@ -53,8 +54,8 @@ + + if (decoder->rframe == 1 && zero_frame == 0 && bfi != 1) + { +- bfi = 2; + LC3_INT32 max_bw_stopband = BW_cutoff_bin_all[bw_cutoff_idx]; ++ bfi = 2; + switch (decoder->frame_dms) + { + # ifdef ENABLE_025_DMS_MODE +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-05-26 10:23:38 +@@ -24,13 +24,13 @@ + typedef uint32_t LC3_UINT32; + + /* Release defines */ +-#define ENABLE_2_5MS_MODE ++// #define ENABLE_2_5MS_MODE + #define ENABLE_5MS_MODE + #define ENABLE_10_MS_MODE + #define ENABLE_ADVANCED_PLC_FL + #define ENABLE_ADVANCED_PLC_FL_DEFAULT + #define ENABLE_BW_CONTROLLER +-#define ENABLE_HR_MODE_FL ++//#define ENABLE_HR_MODE_FL + #define ENABLE_PADDING + #define ENABLE_RFRAME_FL + #define ENABLE_PLC +@@ -49,8 +49,8 @@ + /* Precision Defines */ + #define LC3_FABS(x) (fabsf(x)) + #define LC3_POW(x, y) (powf(x, y)) +-#define LC3_LOG10(x) (log10f(x)) +-#define LC3_LOG2(x) (log2f(x)) ++#define LC3_LOGTEN(x) (log10f(x)) ++#define LC3_LOGTWO(x) (log2f(x)) + # define LC3_COS(x) (cos(x)) + # define LC3_SIN(x) (sin(x)) + #define LC3_SQRT(x) (sqrtf(x)) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_dms, LC3_INT* bw_idx) +@@ -68,7 +69,7 @@ + dist = bw_dist[counter]; + + for (i = stop; i >= stop - dist; i--) { +- e_diff = 10.0 * LC3_LOG10(d2[i - dist + 1] + FLT_EPSILON) - 10.0 * LC3_LOG10(d2[i + 1] + FLT_EPSILON); ++ e_diff = 10.0 * LC3_LOGTEN(d2[i - dist + 1] + FLT_EPSILON) - 10.0 * LC3_LOGTEN(d2[i + 1] + FLT_EPSILON); + + if (e_diff > thr) { + brickwall = 1; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processEncoderEntropy_fl(LC3_UINT8* bytes, LC3_INT* bp_side, LC3_INT* mask_side, LC3_INT numbytes, LC3_INT bw_cutoff_bits, +@@ -33,11 +34,11 @@ + + /* Last non zero touple */ + if (bfi_ext == 1) { +- write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], ceil(LC3_LOG2(N >> 1))); ++ write_uint_backward_fl(ptr, bp_side, mask_side, lastnzTrigger[fs_idx], ceil(LC3_LOGTWO(N >> 1))); + } + else + { +- write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOG2(N / 2))); ++ write_uint_backward_fl(ptr, bp_side, mask_side, lastnz / 2 - 1, ceil(LC3_LOGTWO(N / 2))); + } + + /* LSB mode bit */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +@@ -60,8 +61,8 @@ + } else { + g_min = x_max / (32767 - 0.375); + } +- /* Prevent positive rounding errors from LC3_LOG10 function */ +- ind_min = 28.0 * LC3_LOG10(g_min); ++ /* Prevent positive rounding errors from LC3_LOGTEN function */ ++ ind_min = 28.0 * LC3_LOGTEN(g_min); + + ind_min = ceil(ind_min + LC3_FABS(ind_min) * LC3_EPS); + +@@ -76,7 +77,7 @@ + tmp += x[i + 1] * x[i + 1]; + tmp += x[i + 2] * x[i + 2]; + tmp += x[i + 3] * x[i + 3]; +- en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOG10(tmp + reg_val)); ++ en[j] = (28.0 / 20.0) * (7 + 10.0 * LC3_LOGTEN(tmp + reg_val)); + j++; + } + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-05-26 10:24:14 +@@ -8,7 +8,7 @@ + ******************************************************************************/ + + +- ++#include "options.h" + #include "cfft.h" + #include "iisfft.h" /* for M_PIl */ + #include /* for abs() */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-05-26 10:24:14 +@@ -8,14 +8,15 @@ + ******************************************************************************/ + + ++#include "options.h" + #include + #include +-#include "iis_fft.h" + #include + #include + #include +-#include "../structs.h" ++#include + ++#include "iis_fft.h" + /**************************************************************************************************/ + + /* AFFT uses two fft implementations +@@ -24,9 +25,6 @@ + fast lengths, check the fft_n function. + */ + +-#include +-#include "cfft.h" +-#include "iisfft.h" + + #define FFT_COMPLEX 1 + #define FFT_REAL 2 +@@ -122,12 +120,13 @@ + + IIS_FFT_ERROR LC3_IIS_FFT_Apply_CFFT(HANDLE_IIS_FFT handle, const Complex* input, Complex* output) + { ++ LC3_FLOAT* dummy; + if (!handle) + return IIS_FFT_INTERNAL_ERROR; + + /* check for inplace operation */ + memmove(output, input, sizeof(*input) * handle->len); +- LC3_FLOAT* dummy = (LC3_FLOAT*)output; ++ dummy = (LC3_FLOAT*)output; + if (handle->cfft.len > 0) { + LC3_cfft_apply(&handle->cfft, dummy, dummy + 1, 2); + } else { +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-05-26 10:23:38 +@@ -12,6 +12,7 @@ + #define IIS_FFT_H + + #include "../structs.h" ++#include "../defines.h" + #include "cfft.h" + + #ifdef __cplusplus +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + + #include + #include /* for mmove */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-05-26 10:23:38 +@@ -11,6 +11,7 @@ + #ifndef IISFFT_H + #define IISFFT_H + ++#include "../defines.h" + + #ifndef M_PIl + #define M_PIl 3.1415926535897932384626433832795029L /* pi */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c 1970-01-01 01:00:00 +@@ -1,99 +0,0 @@ +-/****************************************************************************** +-* ETSI TS 103 634 V1.4.1 * +-* Low Complexity Communication Codec Plus (LC3plus) * +-* * +-* Copyright licence is solely granted through ETSI Intellectual Property * +-* Rights Policy, 3rd April 2019. No patent licence is granted by implication, * +-* estoppel or otherwise. * +-******************************************************************************/ +- +- +-#include "functions.h" +-#include "fft/iis_fft.c" +-#include "fft/iisfft.c" +-#include "fft/cfft.c" +- +-void fft_init(Fft* fft, int length) +-{ +- assert(length % 2 == 0); +- HANDLE_IIS_FFT handle = NULL; +- IIS_FFT_ERROR error = 0; +- +- fft->length = length; +- +- error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); +- +- assert(error == IIS_FFT_NO_ERROR); +- fft->handle = handle; +-} +- +-void fft_free(Fft* fft) +-{ +- IIS_FFT_ERROR error = 0; +- +- if (fft) { +- error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); +- +- assert(error == IIS_FFT_NO_ERROR); +- memset(fft, 0, sizeof(*fft)); +- } +-} +- +-void real_fft_free(Fft* fft) +-{ +- IIS_FFT_ERROR error = 0; +- +- if (fft) { +- error = LC3_IIS_RFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); +- +- assert(error == IIS_FFT_NO_ERROR); +- memset(fft, 0, sizeof(*fft)); +- } +-} +- +-void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) +-{ +- assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ +- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; +- +- fft->length = length; +- +- error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD); +- assert(error == IIS_FFT_NO_ERROR); +- fft->handle = *handle; +-} +- +- +-void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) +-{ +- assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ +- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; +- +- fft->length = length; +- +- error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_BWD); +- +- assert(error == IIS_FFT_NO_ERROR); +- fft->handle = *handle; +-} +- +-void fft_apply(Fft* fft, const Complex* input, Complex* output) +-{ +- IIS_FFT_ERROR error = 0; +- error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); +- +- assert(error == IIS_FFT_NO_ERROR); +-} +- +- +-void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) +-{ +- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; +- +- UNUSED(error); +- +- error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); +- +- assert(error == IIS_FFT_NO_ERROR); +-} +- +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + /* Function expects already flipped window */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "lc3.h" + #include "defines.h" + #include "functions.h" +@@ -48,8 +49,9 @@ + case 44100: return 1; + case 48000: return 1; + case 96000: return 1; +- default: return 0; ++ default: break; + } ++ return 0; + } + + static int lc3plus_plc_mode_supported(LC3PLUS_PlcMode plc_mode) +@@ -58,8 +60,9 @@ + { + case LC3PLUS_PLC_ADVANCED: /* fallthru */ + return 1; +- default: return 0; ++ default: break; + } ++ return 0; + } + + static int lc3plus_frame_size_supported(float frame_ms) +@@ -69,8 +72,9 @@ + case 25: /* fallthru */ + case 50: /* fallthru */ + case 100: return 1; +- default: return 0; ++ default: break; + } ++ return 0; + } + + static int null_in_list(void **list, int n) +@@ -97,13 +101,14 @@ + /* encoder functions *********************************************************/ + LC3PLUS_Error lc3plus_enc_init(LC3PLUS_Enc *encoder, int samplerate, int channels, int hrmode, int32_t lfe_channel_array[]) + { ++ int ch = 0; ++ + RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); + RETURN_IF((uintptr_t)encoder % 4 != 0, LC3PLUS_ALIGN_ERROR); + RETURN_IF(!lc3plus_samplerate_supported(samplerate), LC3PLUS_SAMPLERATE_ERROR); + RETURN_IF(!lc3plus_channels_supported(channels), LC3PLUS_CHANNELS_ERROR); + RETURN_IF(samplerate==96000 && hrmode == 0, LC3PLUS_HRMODE_ERROR); + +- int ch = 0; + for (ch = 0; ch < channels; ch++) + { + RETURN_IF(!lc3_enc_supported_lfe() && lfe_channel_array[ch], LC3PLUS_LFE_MODE_NOT_SUPPORTED); +@@ -142,6 +147,7 @@ + int lc3plus_enc_get_real_bitrate(const LC3PLUS_Enc *encoder) + { + int ch = 0, totalBytes = 0; ++ int bitrate; + RETURN_IF(encoder == NULL, 0); + RETURN_IF(!encoder->lc3_br_set, LC3PLUS_BITRATE_UNSET_ERROR); + +@@ -150,7 +156,7 @@ + totalBytes += encoder->channel_setup[ch]->targetBytes; + } + +- int bitrate = (totalBytes * 80000.0 + encoder->frame_dms - 1) / encoder->frame_dms; ++ bitrate = (totalBytes * 80000.0 + encoder->frame_dms - 1) / encoder->frame_dms; + + if (encoder->fs_in == 44100) + { +@@ -191,11 +197,13 @@ + + LC3PLUS_Error lc3plus_enc_set_bandwidth(LC3PLUS_Enc *encoder, int bandwidth) + { ++ LC3_INT effective_fs; ++ + RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); + #ifdef ENABLE_HR_MODE_FL_FLAG + RETURN_IF(encoder->hrmode == 1, LC3PLUS_HRMODE_BW_ERROR); + #endif +- LC3_INT effective_fs = encoder->fs_in; ++ effective_fs = encoder->fs_in; + if (encoder->bandwidth != bandwidth) { + if (encoder->fs_in > 40000) { + effective_fs = 40000; +@@ -338,9 +346,9 @@ + + LC3PLUS_Error lc3plus_free_encoder_structs(LC3PLUS_Enc* encoder) + { ++ int ch = 0; + RETURN_IF(!encoder, LC3PLUS_NULL_ERROR); + +- int ch = 0; + for (ch = 0; ch < encoder->channels; ch++) { + mdct_free(&encoder->channel_setup[ch]->mdctStruct); + dct2_free(&encoder->channel_setup[ch]->dct2StructSNS); +@@ -351,9 +359,9 @@ + + LC3PLUS_Error lc3plus_free_decoder_structs(LC3PLUS_Dec* decoder) + { ++ int ch = 0; + RETURN_IF(!decoder, LC3PLUS_NULL_ERROR); + +- int ch = 0; + for (ch = 0; ch < decoder->channels; ch++) { + dct4_free(&decoder->channel_setup[ch]->dct4structImdct); + real_fft_free(&decoder->channel_setup[ch]->PlcAdvSetup->PlcPhEcuSetup.PhEcu_Fft); +@@ -378,11 +386,14 @@ + + LC3PLUS_Error lc3plus_enc_set_ep_mode(LC3PLUS_Enc *encoder, LC3PLUS_EpMode epmode) + { ++ LC3PLUS_EpMode oldEpmode; ++ LC3PLUS_Error error; ++ + RETURN_IF(encoder == NULL, LC3PLUS_NULL_ERROR); + RETURN_IF((unsigned)epmode > LC3PLUS_EP_HIGH, LC3PLUS_EPMODE_ERROR); +- LC3PLUS_EpMode oldEpmode = encoder->epmode; ++ oldEpmode = encoder->epmode; + encoder->epmode = epmode; +- LC3PLUS_Error error = encoder->lc3_br_set ? update_enc_bitrate(encoder, encoder->bitrate) : LC3PLUS_OK; ++ error = encoder->lc3_br_set ? update_enc_bitrate(encoder, encoder->bitrate) : LC3PLUS_OK; + if (error != LC3PLUS_OK) + { + encoder->epmode = oldEpmode; // preserve old epmode in case of failure +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 1970-01-01 01:00:00 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 2023-05-26 10:24:14 +@@ -0,0 +1,99 @@ ++/****************************************************************************** ++* ETSI TS 103 634 V1.4.1 * ++* Low Complexity Communication Codec Plus (LC3plus) * ++* * ++* Copyright licence is solely granted through ETSI Intellectual Property * ++* Rights Policy, 3rd April 2019. No patent licence is granted by implication, * ++* estoppel or otherwise. * ++******************************************************************************/ ++ ++ ++#include "options.h" ++#include "functions.h" ++#include "fft/iis_fft.c" ++#include "fft/iisfft.c" ++#include "fft/cfft.c" ++ ++void fft_init(Fft* fft, int length) ++{ ++ HANDLE_IIS_FFT handle = NULL; ++ IIS_FFT_ERROR error = 0; ++ assert(length % 2 == 0); ++ ++ fft->length = length; ++ ++ error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = handle; ++} ++ ++void fft_free(Fft* fft) ++{ ++ IIS_FFT_ERROR error = 0; ++ ++ if (fft) { ++ error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ memset(fft, 0, sizeof(*fft)); ++ } ++} ++ ++void real_fft_free(Fft* fft) ++{ ++ IIS_FFT_ERROR error = 0; ++ ++ if (fft) { ++ error = LC3_IIS_RFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ memset(fft, 0, sizeof(*fft)); ++ } ++} ++ ++void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ ++ ++ fft->length = length; ++ ++ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD); ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = *handle; ++} ++ ++ ++void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ ++ ++ fft->length = length; ++ ++ error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_BWD); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++ fft->handle = *handle; ++} ++ ++void fft_apply(Fft* fft, const Complex* input, Complex* output) ++{ ++ IIS_FFT_ERROR error = 0; ++ error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++} ++ ++ ++void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) ++{ ++ IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; ++ ++ UNUSED(error); ++ ++ error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); ++ ++ assert(error == IIS_FFT_NO_ERROR); ++} +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static const LC3_FLOAT* mdct_window(LC3_INT length, LC3_INT frame_dms, LC3_INT hrmode) +@@ -104,6 +105,7 @@ + { + LC3_FLOAT tmp[MAX_LEN * 2] = {0}; + LC3_INT i = 0; ++ LC3_INT hlen; + + move_float(tmp, mdct->mem, mdct->mem_length); + move_float(tmp + mdct->mem_length, input, mdct->length); +@@ -112,7 +114,7 @@ + + mult_vec(tmp, mdct->window, mdct->length * 2); + +- LC3_INT hlen = mdct->length / 2; ++ hlen = mdct->length / 2; + for (i = 0; i < hlen; i++) { + output[i] = -tmp[hlen * 3 - i - 1] - tmp[hlen * 3 + i]; + output[hlen + i] = tmp[i] - tmp[hlen * 2 - i - 1]; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-05-26 10:38:32 +@@ -8,15 +8,16 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + + void processNearNyquistdetector_fl(LC3_INT16* near_nyquist_flag, const LC3_INT fs_idx, const LC3_INT near_nyquist_index, + const LC3_INT bands_number, const LC3_FLOAT* ener) + { + *near_nyquist_flag = 0; +- ++ + if (fs_idx < 4) +- { ++ { + LC3_INT i = 0; + LC3_FLOAT ener_low = FLT_EPSILON, ener_high = 0; + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processPlcMain_fl(LC3_FLOAT *q_d_fl_c, LC3_FLOAT *syntM_fl_c, LC3PLUS_Dec* decoder, DecSetup* h_DecSetup, LC3_INT bfi, +@@ -56,6 +57,8 @@ + { + case 2: + { ++ LC3_FLOAT pitch_fl_c; ++ + assert(decoder->fs_idx == floor(decoder->fs / 10000)); + // phaseECU supports only 10ms framing + assert(PlcSetup->nbLostCmpt != 0 || decoder->frame_dms == 100); +@@ -69,7 +72,7 @@ + } + + /* call phaseEcu */ +- LC3_FLOAT pitch_fl_c = (LC3_FLOAT)ltpf_pitch_int + (LC3_FLOAT)ltpf_pitch_fr / 4.0; /* use non-rounded pitch indeces */ ++ pitch_fl_c = (LC3_FLOAT)ltpf_pitch_int + (LC3_FLOAT)ltpf_pitch_fr / 4.0; /* use non-rounded pitch indeces */ + + + if (prev_bfi_plc2 == 0) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +@@ -135,13 +136,13 @@ + + if (max_xfp_abs >= 0.5) + { +- PLC2_Q_flt = (LC3_FLOAT)LC3_FLOOR(LC3_LOG2(32768 / 2 / 2 / max_xfp_abs)); ++ PLC2_Q_flt = (LC3_FLOAT)LC3_FLOOR(LC3_LOGTWO(32768 / 2 / 2 / max_xfp_abs)); + Q_scale_flt = LC3_POW(2.0, PLC2_Q_flt) / fx_fft_scale / fft_fs_scale; /* basop way using xfp scale */ + + /* C-Float additional safety limit/verification of the integer xfp based scaling using the available C-float Xabs max value inp_high as well */ + { + LC3_FLOAT tmp_scale; +- tmp_scale = LC3_POW(2.0, LC3_FLOOR(LC3_LOG2(32768 / 2 / 2 / inp_high))); ++ tmp_scale = LC3_POW(2.0, LC3_FLOOR(LC3_LOGTWO(32768 / 2 / 2 / inp_high))); + if (Q_scale_flt > tmp_scale) { + Q_scale_flt = tmp_scale; + } +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + #include "constants.h" +@@ -30,6 +31,7 @@ + LC3_INT32 segmentLen, e; + LC3_FLOAT Xph; + LC3_FLOAT seed_local; ++ LC3_INT32 binCounter, subInd; + + UNUSED(corr_phase_dbg); + UNUSED(X_i_new_re_dbg); +@@ -49,8 +51,8 @@ + + + // EVOLVE PHASE ----------------- +- LC3_INT32 binCounter = 1; +- LC3_INT32 subInd = 0; ++ binCounter = 1; ++ subInd = 0; + + one_peak_flag_mask = -1; + if (n_plocs < 3 && n_plocs > 0) { +@@ -219,9 +221,10 @@ + } + + static LC3_INT32 own_rand(LC3_INT32 seed) { +- assert(seed <= 32767 && seed >= -32768); +- LC3_INT32 retSeed = (13849 + (seed + 32768) * 31821) & 65535; +- retSeed -= 32768; ++ LC3_INT32 retSeed; ++ assert(seed <= 32767 && seed >= -32768); ++ retSeed = (13849 + (seed + 32768) * 31821) & 65535; ++ retSeed -= 32768; + assert(retSeed <= 32767 && retSeed >= -32768); + return retSeed; + } +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-05-26 10:38:32 +@@ -6,13 +6,14 @@ + * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * + * estoppel or otherwise. * + ******************************************************************************/ +- + ++ ++#include "options.h" + #include "defines.h" + #include "functions.h" + + +-void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change) ++void plc_phEcu_tba_per_band_gain(LC3_INT32 n_grp, LC3_FLOAT *gr_pow_left, LC3_FLOAT *gr_pow_right, LC3_FLOAT *trans, LC3_FLOAT *grp_pow_change) + { + LC3_INT32 i; + +@@ -34,10 +35,10 @@ + trans[i] = 1.0; /* 0/0 no transient , no power change */ + } + } +- grp_pow_change[i] = (LC3_FLOAT) 10.0 * LC3_LOG10(trans[i]); ++ grp_pow_change[i] = (LC3_FLOAT) 10.0 * LC3_LOGTEN(trans[i]); + + } + +- return; ++ return; + } + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "defines.h" + #include "functions.h" + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-05-26 10:38:32 +@@ -6,16 +6,17 @@ + * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * + * estoppel or otherwise. * + ******************************************************************************/ +- + ++ ++#include "options.h" + #include "defines.h" + #include "functions.h" + + +-void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape, +- LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape, ++void plc_phEcu_trans_burst_ana_sub(LC3_INT32 fs_idx, LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FLOAT *oold_spect_shape, ++ LC3_FLOAT *oold_EwPtr, LC3_FLOAT *old_spect_shape, + LC3_FLOAT *old_EwPtr, LC3_FLOAT *stPhECU_beta_mute, +- LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg) ++ LC3_FLOAT *stPhECU_mag_chg_1st, LC3_FLOAT *stPhECU_Xavg, LC3_FLOAT *alpha, LC3_FLOAT *beta, LC3_FLOAT *mag_chg, LC3_INT32 *tr_dec_dbg, LC3_FLOAT *gpc_dbg) + { + LC3_FLOAT gr_pow_left[MAX_LGW]; + LC3_FLOAT gr_pow_right[MAX_LGW]; +@@ -27,7 +28,7 @@ + + LC3_INT32 attDegreeFrames; + LC3_FLOAT thresh_dbg; +- ++ + UNUSED(tr_dec_dbg); + UNUSED(gpc_dbg); + +@@ -39,7 +40,7 @@ + + } + +- ++ + plc_phEcu_tba_trans_dect_gains(burst_len, n_grp, grp_pow_change, stPhECU_beta_mute, stPhECU_mag_chg_1st, alpha, beta, mag_chg, ph_dith, tr_dec, att_val, &attDegreeFrames, &thresh_dbg); + + return; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + /***************************************************************************\ + * contents/description: Main function for Time domain concealment + \***************************************************************************/ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + + void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q, +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static LC3_INT sign(LC3_FLOAT x); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void process_resamp12k8_fl(LC3_FLOAT x[], LC3_INT x_len, LC3_FLOAT mem_in[], LC3_INT mem_in_len, LC3_FLOAT mem_50[], LC3_FLOAT mem_out[], +@@ -17,6 +18,8 @@ + + LC3_INT len_12k8 = 0, N12k8 = 0, i = 0, k = 0; + LC3_FLOAT mac = 0, buf_out[120 + MAX_LEN] = {0}, bufdown[128] = {0}, buf[120 + MAX_LEN] = {0}; ++ LC3_INT32 index_int, index_frac, resamp_upfac, resamp_delay, resamp_off_int, resamp_off_frac; ++ LC3_FLOAT u_11, u_21, u_1, u_2; + + const LC3_FLOAT *filter; + const LC3_FLOAT *filt_input, *filt_coeff; +@@ -49,12 +52,12 @@ + + /* Upsampling & Low-pass Filtering & Downsampling */ + +- LC3_INT32 index_int = 1; +- LC3_INT32 index_frac = 0; +- LC3_INT32 resamp_upfac = resamp_params[fs_idx][0]; +- LC3_INT32 resamp_delay = resamp_params[fs_idx][1]; +- LC3_INT32 resamp_off_int = resamp_params[fs_idx][2]; +- LC3_INT32 resamp_off_frac = resamp_params[fs_idx][3]; ++ index_int = 1; ++ index_frac = 0; ++ resamp_upfac = resamp_params[fs_idx][0]; ++ resamp_delay = resamp_params[fs_idx][1]; ++ resamp_off_int = resamp_params[fs_idx][2]; ++ resamp_off_frac = resamp_params[fs_idx][3]; + + k = 0; + for (i = 0; i < N12k8; i++) { +@@ -78,9 +81,8 @@ + + + /* 50Hz High-Pass */ +- LC3_FLOAT u_11 = mem_50[0]; +- LC3_FLOAT u_21 = mem_50[1]; +- LC3_FLOAT u_1, u_2; ++ u_11 = mem_50[0]; ++ u_21 = mem_50[1]; + + for (i = 0; i < len_12k8; i++) { + LC3_FLOAT y1 = (highpass50_filt_b[0] * bufdown[i] + u_11); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + #include "functions.h" ++#include "options.h" + + LC3_FLOAT array_max_abs(LC3_FLOAT *in, LC3_INT32 len) + { +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "setup_dec_lc3.h" + #include "functions.h" + #include +@@ -32,6 +33,7 @@ + LC3_FLOAT *sine_table1_phecu, *sine_table2_phecu; + HANDLE_IIS_FFT handle_fft_phaseecu; + HANDLE_IIS_FFT handle_ifft_phaseecu; ++ LC3_FLOAT *q_old_res; + + for (ch = 0; ch < channels; ch++) { + DecSetup* setup = balloc(decoder, &size, sizeof(DecSetup)); +@@ -56,7 +58,7 @@ + sine_table1_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); + sine_table2_phecu = balloc(decoder, &size, sizeof(LC3_FLOAT) * (((CODEC_FS(samplerate) * 16) / 1000) / 2 + 1)); + +- LC3_FLOAT *q_old_res = balloc(decoder, &size, sizeof(LC3_FLOAT) * frame_len); ++ q_old_res = balloc(decoder, &size, sizeof(LC3_FLOAT) * frame_len); + + if (decoder) { + decoder->channel_setup[ch] = setup; +@@ -346,6 +348,7 @@ + LC3PLUS_Error update_dec_bitrate(LC3PLUS_Dec* decoder, int ch, int nBytes) + { + int totalBits = 0, bitsTmp = 0, channel_bytes = 0, maxBytes = 0, minBytes = 0; ++ DecSetup* setup; + + if (decoder->hrmode) + { +@@ -375,7 +378,7 @@ + + channel_bytes = nBytes; + +- DecSetup* setup = decoder->channel_setup[ch]; ++ setup = decoder->channel_setup[ch]; + + if (channel_bytes < minBytes || channel_bytes > maxBytes) + { +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "setup_enc_lc3.h" + #include "functions.h" + #include +@@ -33,6 +34,7 @@ + , int32_t lfe_channel_array[] + ) + { ++ int ch = 0; + memset(encoder, 0, lc3plus_enc_get_size(samplerate, channels)); + alloc_encoder(encoder, channels); + +@@ -56,7 +58,6 @@ + encoder->r12k8_mem_in_len = 2 * 8 * encoder->fs / 12800; + encoder->r12k8_mem_out_len = 24; + +- int ch = 0; + for (ch = 0; ch < encoder->channels; ch++) + { + encoder->channel_setup[ch]->lfe = lfe_channel_array[ch] != 0; +@@ -220,6 +221,7 @@ + + if (encoder->hrmode) + { ++#ifdef ENABLE_HR_MODE_FL + switch (encoder->frame_dms) + { + case 25: +@@ -243,6 +245,7 @@ + default: + return LC3PLUS_HRMODE_ERROR; + } ++#endif + } + else + { +@@ -368,7 +371,7 @@ + setup->total_bits = setup->targetBytes << 3; + setup->targetBitsInit = setup->total_bits - encoder->envelope_bits - encoder->global_gain_bits - + encoder->noise_fac_bits - encoder->BW_cutoff_bits - +- ceil(LC3_LOG2(encoder->frame_length / 2)) - 2 - 1; ++ ceil(LC3_LOGTWO(encoder->frame_length / 2)) - 2 - 1; + + if (setup->total_bits > 1280) { + setup->targetBitsInit = setup->targetBitsInit - 1; +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processSnsComputeScf_fl(LC3_FLOAT* x, LC3_INT tilt, LC3_INT xLen, LC3_FLOAT* gains, LC3_INT smooth, LC3_FLOAT sns_damping, LC3_FLOAT attdec_damping_factor) +@@ -109,7 +110,7 @@ + + /* Log-domain */ + for (i = 0; i < 64; i++) { +- xl[i] = LC3_LOG2(x[i]) / 2.0; ++ xl[i] = LC3_LOGTWO(x[i]) / 2.0; + } + + /* Downsampling */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-05-26 10:23:38 +@@ -17,6 +17,7 @@ + #include + #include + ++ + #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || defined(__arm__) || \ + defined(__aarch64__) + #define __TWI_LE /* _T_iny _W_ave _I_n _L_ittle _E_ndian */ +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen); +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-05-26 10:24:14 +@@ -8,6 +8,7 @@ + ******************************************************************************/ + + ++#include "options.h" + #include "functions.h" + + void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index dfa7a06e07..e81a6a2b7c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -108,6 +108,9 @@ typedef struct #ifdef SPLIT_REND_PLC const int16_t *pSplitRendBFI; #endif +#ifdef SPLIT_REND_LC3PLUS + const SPLIT_REND_WRAPPER *pSplitRendWrapper; +#endif /* TODO @Philips : would this be a better place to store the render config data? * bearing in mind we could have multiple inputs to the renderer, we might neeed to accomodate @@ -139,6 +142,9 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; +#ifdef SPLIT_REND_LC3PLUS + TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ +#endif #ifdef REND_STATIC_MEM_OPT float *bufferData; #endif @@ -242,6 +248,10 @@ struct IVAS_REND IVAS_REND_AudioConfig outputConfig; EFAP_WRAPPER efapOutWrapper; IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; +#ifdef SPLIT_REND_LC3PLUS + SPLIT_REND_WRAPPER splitRendWrapper; + IVAS_REND_AudioBuffer splitRendEncBuffer; +#endif IVAS_REND_HeadRotData headRotData; #ifdef SPLIT_REND_PLC @@ -306,6 +316,10 @@ static void convertBitsBufferToInternalBitsBuff( hBits->bits_read = outBits.config.bitsRead; hBits->bits_written = outBits.config.bitsWritten; hBits->buf_len = outBits.config.bufLenInBytes; +#ifdef SPLIT_REND_LC3PLUS + hBits->codec = outBits.config.codec; + hBits->pose_correction = outBits.config.poseCorrection; +#endif return; } @@ -318,6 +332,10 @@ static void convertInternalBitsBuffToBitsBuffer( hOutBits->config.bitsRead = bits.bits_read; hOutBits->config.bitsWritten = bits.bits_written; hOutBits->config.bufLenInBytes = bits.buf_len; +#ifdef SPLIT_REND_LC3PLUS + hOutBits->config.codec = bits.codec; + hOutBits->config.poseCorrection = bits.pose_correction; +#endif return; } @@ -415,7 +433,7 @@ static void copyBufferTo2dArray( static void accumulate2dArrayToBuffer( float array[MAX_OUTPUT_CHANNELS][L_FRAME48k], - IVAS_REND_AudioBuffer *buffer ) + const IVAS_REND_AudioBuffer *buffer ) { int16_t smplIdx, chnlIdx; float *writePtr; @@ -1246,6 +1264,9 @@ static rendering_context getRendCtx( #ifdef SPLIT_REND_PLC ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; #endif +#ifdef SPLIT_REND_LC3PLUS + ctx.pSplitRendWrapper = &hIvasRend->splitRendWrapper; +#endif return ctx; } @@ -1307,6 +1328,9 @@ static ivas_error setRendInputActiveIsm( rendering_context rendCtx; IVAS_REND_AudioConfig outConfig; input_ism *inputIsm; +#ifdef SPLIT_REND_LC3PLUS + int16_t i; +#endif inputIsm = (input_ism *) input; rendCtx = inputIsm->base.ctx; @@ -1336,9 +1360,19 @@ static ivas_error setRendInputActiveIsm( inputIsm->hReverb = NULL; inputIsm->tdRendWrapper = defaultTdRendWrapper(); initRotMatrix( inputIsm->rot_mat_prev ); +#ifdef SPLIT_REND_LC3PLUS + for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) + { + inputIsm->splitTdRendWrappers[i] = defaultTdRendWrapper(); + } +#endif error = IVAS_ERR_OK; - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL ) + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL +#ifdef SPLIT_REND_LC3PLUS + || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif + ) { if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -1381,6 +1415,9 @@ static void clearInputIsm( input_ism *inputIsm ) { rendering_context rendCtx; +#ifdef SPLIT_REND_LC3PLUS + int16_t i; +#endif rendCtx = inputIsm->base.ctx; @@ -1410,6 +1447,13 @@ static void clearInputIsm( ivas_td_binaural_close( &inputIsm->tdRendWrapper.hBinRendererTd ); inputIsm->tdRendWrapper.hHrtfTD = NULL; } +#ifdef SPLIT_REND_LC3PLUS + for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) + { + ivas_td_binaural_close( &inputIsm->splitTdRendWrappers[i].hBinRendererTd ); + inputIsm->splitTdRendWrappers[i].hHrtfTD = NULL; + } +#endif return; } @@ -2380,11 +2424,17 @@ updateSplitPostRendPanGains( error = ivas_splitBinPostRendOpen( &inputSplitPostRend->splitPostRendWrapper.hBinHrSplitPostRend, &inputSplitPostRend->splitPostRendWrapper.multiBinPoseData, - *rendCtx.pOutSampleRate, ( inputSplitPostRend->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 ); + *rendCtx.pOutSampleRate +#ifndef SPLIT_REND_LC3PLUS + , + ( inputSplitPostRend->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 +#endif + ); if ( error != IVAS_ERR_OK ) { return error; } +#ifndef SPLIT_REND_LC3PLUS if ( inputSplitPostRend->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { error = ivas_splitBinLCLDDecOpen( &inputSplitPostRend->splitPostRendWrapper.hSplitBinLCLDDec, *rendCtx.pOutSampleRate, numOutChannels ); @@ -2393,6 +2443,7 @@ updateSplitPostRendPanGains( return error; } } +#endif return IVAS_ERR_OK; } @@ -2435,7 +2486,7 @@ updateSbaPanGains( &rendCtx.hhRendererConfig[0]->split_rend_config, &inputSba->splitRendWrapper.multiBinPoseData, rendCtx.pHeadRotData->sr_pose_pred_axis ); -#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT +#if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT /* TODO: redundant nested switch SPLIT_REND_WITH_HEAD_ROT */ if ( hRendCfg->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) { @@ -2466,7 +2517,8 @@ updateSbaPanGains( error = ivas_split_renderer_open( &inputSba->splitRendWrapper, &inputSba->base.ctx.hhRendererConfig[0]->split_rend_config, - *rendCtx.pOutSampleRate, is_cldfb_in, ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + *rendCtx.pOutSampleRate, + is_cldfb_in, ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); break; } #endif @@ -2651,6 +2703,12 @@ static void clearInputSplitRend( { ivas_splitBinLCLDDecClose( &inputSplitRend->splitPostRendWrapper.hSplitBinLCLDDec ); } +#ifdef SPLIT_REND_LC3PLUS + if ( inputSplitRend->splitPostRendWrapper.hLc3plusDec != NULL ) + { + IVAS_LC3PLUS_DEC_Close( &inputSplitRend->splitPostRendWrapper.hLc3plusDec ); + } +#endif return; } @@ -3156,12 +3214,68 @@ static void clearInputMasa( return; } +#ifdef SPLIT_REND_LC3PLUS +static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, IVAS_REND_HeadRotData headRotData, const int32_t outputSampleRate, const IVAS_REND_AudioConfig outConfig ) +{ + ivas_error error; + IVAS_REND_AudioBufferConfig bufConfig; + + ivas_init_split_rend_handles( pSplitRendWrapper ); + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + + if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + ivas_renderSplitGetMultiBinPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData, headRotData.sr_pose_pred_axis ); + } + else if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) + { + ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData ); + } + + error = ivas_split_renderer_open( pSplitRendWrapper, + pSplit_rend_config, + outputSampleRate, + 0, 0 ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + + bufConfig.numSamplesPerChannel = MAX_BUFFER_LENGTH_PER_CHANNEL; + bufConfig.numChannels = BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; + bufConfig.is_cldfb = 0; + pSplitRendEncBuffer->config = bufConfig; + pSplitRendEncBuffer->data = malloc( bufConfig.numChannels * bufConfig.numSamplesPerChannel * sizeof( float ) ); + if ( pSplitRendEncBuffer->data == NULL ) + { + return IVAS_ERR_FAILED_ALLOC; + } + } + else + { + IVAS_REND_AudioBufferConfig bufConfig; + + bufConfig.numSamplesPerChannel = 0; + bufConfig.numChannels = 0; + bufConfig.is_cldfb = 0; + pSplitRendEncBuffer->config = bufConfig; + pSplitRendEncBuffer->data = NULL; + } + + return IVAS_ERR_OK; +} +#endif + ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, const IVAS_REND_AudioConfig outConfig ) { int16_t i; +#ifdef SPLIT_REND_LC3PLUS + int16_t j; +#endif IVAS_REND_HANDLE hIvasRend; ivas_error error; int16_t numOutChannels; @@ -3234,6 +3348,13 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; hIvasRend->inputsIsm[i].tdRendWrapper.hBinRendererTd = NULL; +#ifdef SPLIT_REND_LC3PLUS + for ( j = 0; j < (int16_t) ( sizeof( hIvasRend->inputsIsm[i].splitTdRendWrappers ) / sizeof( *hIvasRend->inputsIsm[i].splitTdRendWrappers ) ); ++j ) + { + hIvasRend->inputsIsm[i].splitTdRendWrappers[j].hBinRendererTd = NULL; + hIvasRend->inputsIsm[i].splitTdRendWrappers[j].hHrtfTD = NULL; + } +#endif #ifdef REND_STATIC_MEM_OPT hIvasRend->inputsIsm[i].bufferData = NULL; #endif @@ -3682,6 +3803,18 @@ static ivas_error findFreeInputSlot( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_LC3PLUS +static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer ) +{ + ivas_split_renderer_close( pSplitRendWrapper ); + if ( pSplitRendEncBuffer->data != NULL ) + { + free( pSplitRendEncBuffer->data ); + } + pSplitRendEncBuffer->config.numChannels = 0; + pSplitRendEncBuffer->config.numSamplesPerChannel = 0; +} +#endif /*-------------------------------------------------------------------* * IVAS_REND_AddInput() @@ -3715,6 +3848,19 @@ ivas_error IVAS_REND_AddInput( inputsArray = hIvasRend->inputsIsm; inputStructSize = sizeof( *hIvasRend->inputsIsm ); activateInput = setRendInputActiveIsm; +#ifdef SPLIT_REND_LC3PLUS + if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + /* Hack to override default split rendering codec from Dolby CLDFB to LC3plus. + This will not be necessary once the split rendering codec becomes selectable by the lib user. */ + closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + hIvasRend->hRendererConfig->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LC3PLUS; + if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif break; case IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED: maxNumInputsOfType = RENDERER_MAX_MC_INPUTS; @@ -4137,8 +4283,21 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSplitPost[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { - latency_ns = IVAS_FB_DEC_DELAY_NS; - max_latency_ns = max( max_latency_ns, latency_ns ); +#ifdef SPLIT_REND_LC3PLUS + if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec != NULL ) + { + int32_t lc3plusDelaySamples; + IVAS_LC3PLUS_DEC_GetDelay( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec, &lc3plusDelaySamples ); + max_latency_ns = max( max_latency_ns, roundf( lc3plusDelaySamples * 1000000000.f / *timeScale ) ); + } + else + { +#endif + latency_ns = IVAS_FB_DEC_DELAY_NS; + max_latency_ns = max( max_latency_ns, latency_ns ); +#ifdef SPLIT_REND_LC3PLUS + } +#endif } } #endif @@ -4356,6 +4515,15 @@ ivas_error IVAS_REND_InitConfig( hIvasRend->hRendererConfig = NULL; } +#ifdef SPLIT_REND_LC3PLUS + /* ToDo: The entire contents of this function should be part of IVAS_REND_Open - otherwise renderer handle is partly uninitialized after opening */ + /* Initialize split rendering */ + if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + return IVAS_ERR_OK; } @@ -4427,6 +4595,10 @@ int16_t IVAS_REND_GetRenderConfig( hRCout->split_rend_config.hq_mode = 0; hRCout->split_rend_config.codec_delay_ms = 0; #endif +#ifdef SPLIT_REND_LC3PLUS + hRCout->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LCLD; + hRCout->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; +#endif return IVAS_ERR_OK; } @@ -4444,6 +4616,9 @@ int16_t IVAS_REND_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; +#ifdef SPLIT_REND_LC3PLUS + ivas_error error; +#endif if ( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) { @@ -4474,10 +4649,23 @@ int16_t IVAS_REND_FeedRenderConfig( mvr2r( renderConfig.room_acoustics.pAcoustic_dsr, hRenderConfig->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); #ifdef SPLIT_REND_WITH_HEAD_ROT - hRenderConfig->split_rend_config.splitRendBitRate = renderConfig.split_rend_config.splitRendBitRate; - hRenderConfig->split_rend_config.dof = renderConfig.split_rend_config.dof; - hRenderConfig->split_rend_config.hq_mode = renderConfig.split_rend_config.hq_mode; - hRenderConfig->split_rend_config.codec_delay_ms = renderConfig.split_rend_config.codec_delay_ms; + hRenderConfig->split_rend_config = renderConfig.split_rend_config; +#endif +#ifdef SPLIT_REND_LC3PLUS + /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ + if ( hRenderConfig->split_rend_config.dof == 0 ) + { + hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + } + + hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; + + /* Must re-initialize split rendering config which depends on renderer config */ + closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); + if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) + { + return error; + } #endif return IVAS_ERR_OK; @@ -5350,6 +5538,136 @@ static ivas_error renderIsmToSba( return error; } +#ifdef SPLIT_REND_LC3PLUS +static ivas_error renderIsmToSplitBinaural( + input_ism *ismInput, + const IVAS_REND_AudioBuffer outAudio ) +{ + int32_t i; + ivas_error error; + float tmpProcessing[MAX_NUM_OBJECTS][L_FRAME48k]; + int16_t pos_idx; + const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + const SPLIT_REND_WRAPPER *pSplitRendWrapper; + IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; + float tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; + int16_t output_frame = ismInput->base.inputBuffer.config.numSamplesPerChannel; + IVAS_REND_HeadRotData modifiedHeadRotData; + + push_wmops( "renderIsmToSplitBinaural" ); + + pSplitRendWrapper = ismInput->base.ctx.pSplitRendWrapper; + pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; + + /* If not yet allocated, open additional instances of TD renderer */ + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( ismInput->splitTdRendWrappers[i].hBinRendererTd != NULL ) + { + continue; + } + + /* ToDo: Could re-use already existing HRTF (ismInput->tdRendWrapper.hHrtfTD), but this complicates internal memory handling in TD renderer */ + ismInput->splitTdRendWrappers[i].hHrtfTD = NULL; + + /* Open TD renderer wrapper */ + if ( ( error = ivas_td_binaural_open_ext( &ismInput->splitTdRendWrappers[i], ismInput->base.inConfig, *ismInput->base.ctx.hhRendererConfig, NULL, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Assert same delay as main TD renderer */ + assert( ismInput->splitTdRendWrappers[i].binaural_latency_ns == ismInput->tdRendWrapper.binaural_latency_ns ); + } + + /* Save current head positions */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + originalHeadRot[i] = ismInput->base.ctx.pHeadRotData->headPositions[i]; + } + + /* Copy input audio to a processing buffer. */ + copyBufferTo2dArray( ismInput->base.inputBuffer, tmpProcessing ); + + modifiedHeadRotData = *ismInput->base.ctx.pHeadRotData; + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + /* Update head positions */ + if ( pos_idx != 0 ) + { + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + if ( originalHeadRot[i].w == -3.0f ) + { + modifiedHeadRotData.headPositions[i].w = -3.0f; + modifiedHeadRotData.headPositions[i].x = originalHeadRot[i].x + pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + modifiedHeadRotData.headPositions[i].y = originalHeadRot[i].y + pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + modifiedHeadRotData.headPositions[i].z = originalHeadRot[i].z + pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + } + else + { + modifiedHeadRotData.headPositions[i].w = -3.0f; + Quat2EulerDegree( originalHeadRot[i], + &modifiedHeadRotData.headPositions[i].z, + &modifiedHeadRotData.headPositions[i].y, + &modifiedHeadRotData.headPositions[i].x ); + modifiedHeadRotData.headPositions[i].x += pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + modifiedHeadRotData.headPositions[i].y += pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + modifiedHeadRotData.headPositions[i].z += pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + } + } + } + + /* Render */ + if ( pos_idx == 0 ) + { + error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, + ismInput->base.inConfig, + NULL, + ismInput->base.ctx.pHeadRotData, + &ismInput->currentPos, + NULL, + output_frame, + tmpProcessing ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + else + { + error = ivas_td_binaural_renderer_ext( &ismInput->splitTdRendWrappers[pos_idx - 1], + ismInput->base.inConfig, + NULL, + &modifiedHeadRotData, + &ismInput->currentPos, + NULL, + output_frame, + tmpProcessing ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + + /* Copy rendered audio to tmp storage buffer. Copying directly to output would + * overwrite original audio, which is still needed for rendering next head pose. */ + mvr2r( tmpProcessing[0], tmpBinaural[2 * pos_idx], output_frame ); + mvr2r( tmpProcessing[1], tmpBinaural[2 * pos_idx + 1], output_frame ); + + /* Overwrite processing buffer with original input audio again */ + copyBufferTo2dArray( ismInput->base.inputBuffer, tmpProcessing ); + } + + accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); + /* Encoding to split rendering bitstream done at a higher level */ + + pop_wmops(); + + return IVAS_ERR_OK; +} +#endif + static ivas_error renderInputIsm( input_ism *ismInput, const IVAS_REND_AudioConfig outConfig, @@ -5387,6 +5705,12 @@ static ivas_error renderInputIsm( case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; +#ifdef SPLIT_REND_LC3PLUS + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + error = renderIsmToSplitBinaural( ismInput, outAudio ); + break; +#endif default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; } @@ -5879,6 +6203,53 @@ static void renderSbaToSba( return; } +#ifdef SPLIT_REND_LC3PLUS +static ivas_error splitBinLc3plusDecode( + SPLIT_POST_REND_WRAPPER *hSplitBin, + ivas_split_rend_bits_t *bits, + float outputBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k], + IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction ) +{ + ivas_error error; + float *channel_ptrs[MAX_HEAD_ROT_POSES * 2]; + int32_t lc3plusBitrateId, lc3plusBitstreamSize; + + push_wmops( "splitBinLc3plusDecode" ); + + assert( hSplitBin->hLc3plusDec != NULL ); + + /* Find next byte boundary */ + while ( bits->bits_read % 8 != 0 ) + { + ++bits->bits_read; + } + /* Read LC3plus bitstream size info */ + lc3plusBitrateId = ivas_split_rend_bitstream_read_int32( bits, 8 ); + lc3plusBitstreamSize = ivas_get_lc3plus_size_from_id( lc3plusBitrateId, pose_correction ); +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG + if ( lc3plusBitstreamSize == -1 ) + { + lc3plusBitstreamSize = hSplitBin->hLc3plusDec->num_decs * SPLIT_REND_LC3PLUS_HBR / FRAMES_PER_SECOND / 8; + } +#endif + + for ( int16_t i = 0; i < BINAURAL_CHANNELS * hSplitBin->multiBinPoseData.num_poses; ++i ) + { + channel_ptrs[i] = outputBuffer[i]; + } + if ( ( error = IVAS_LC3PLUS_DEC_Decode( hSplitBin->hLc3plusDec, + &bits->bits_buf[bits->bits_read / 8], + lc3plusBitstreamSize, + channel_ptrs ) ) != IVAS_ERR_OK ) + { + return error; + } + + pop_wmops(); + + return IVAS_ERR_OK; +} +#endif #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderSplitBinauralWithPostRot( @@ -5888,7 +6259,7 @@ static ivas_error renderSplitBinauralWithPostRot( #ifdef SPLIT_REND_PLC , const int16_t SplitRendBFI -#endif +#endif /* SPLIT_REND_PLC */ ) { float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -5900,6 +6271,13 @@ static ivas_error renderSplitBinauralWithPostRot( float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; const IVAS_REND_HeadRotData *pHeadRotData; SPLIT_POST_REND_WRAPPER *hSplitBin; +#ifdef SPLIT_REND_LC3PLUS + int8_t isPostRendInputCldfb; + + isPostRendInputCldfb = 0; +#endif /* SPLIT_REND_LC3PLUS */ + + push_wmops( "renderSplitBinauralWithPostRot" ); error = IVAS_ERR_OK; @@ -5907,64 +6285,118 @@ static ivas_error renderSplitBinauralWithPostRot( hSplitBin = &splitBinInput->splitPostRendWrapper; convertBitsBufferToInternalBitsBuff( *hBits, &bits ); +#ifdef SPLIT_REND_LC3PLUS + if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD && splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec == NULL ) + { + error = ivas_splitBinLCLDDecOpen( &splitBinInput->splitPostRendWrapper.hSplitBinLCLDDec, *splitBinInput->base.ctx.pOutSampleRate, BINAURAL_CHANNELS ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } + else if ( bits.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS && splitBinInput->splitPostRendWrapper.hLc3plusDec == NULL ) + { + LC3PLUS_CONFIG config; + config.lc3plus_frame_duration_us = 5000; + config.ivas_frame_duration_us = 20000; + config.channels = BINAURAL_CHANNELS; + config.samplerate = *splitBinInput->base.ctx.pOutSampleRate; + + IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 0 /* caching disabled */, +#endif + &splitBinInput->splitPostRendWrapper.hLc3plusDec ); + } +#endif /* SPLIT_REND_LC3PLUS */ + for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ ) { QuaternionsPost[sf_idx] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); } + #ifdef SPLIT_REND_PLC if ( !SplitRendBFI ) { hSplitBin->first_good_frame_received = 1; } -#endif +#endif /* SPLIT_REND_PLC */ #ifdef SPLIT_REND_PLC if ( hSplitBin->first_good_frame_received == 1 ) { -#endif +#endif /* SPLIT_REND_PLC */ -#ifdef SPLIT_REND_PLC - if ( !SplitRendBFI ) -#endif + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) { - ivas_splitBinPostRendMdDec( - &bits, - hSplitBin->hBinHrSplitPostRend, - &hSplitBin->multiBinPoseData +#ifdef SPLIT_REND_PLC + if ( !SplitRendBFI ) /* ToDo: this is always true */ +#endif /* SPLIT_REND_PLC */ + { + ivas_splitBinPostRendMdDec( + &bits, + hSplitBin->hBinHrSplitPostRend, + &hSplitBin->multiBinPoseData #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - , - hSplitBin->hBinHrSplitPreRend -#endif - ); + , + hSplitBin->hBinHrSplitPreRend +#endif /* SPLIT_REND_WITH_HEAD_ROT_DEBUG */ + ); + } } - if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - ivas_splitBinLCLDDecProcess( - hSplitBin->hSplitBinLCLDDec, - &bits, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural +#ifdef SPLIT_REND_LC3PLUS + if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD ) + { +#endif /* SPLIT_REND_LC3PLUS */ + ivas_splitBinLCLDDecProcess( + hSplitBin->hSplitBinLCLDDec, + &bits, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural #ifdef SPLIT_REND_PLC - , - SplitRendBFI + , + SplitRendBFI +#endif /* SPLIT_REND_PLC */ + ); +#ifdef SPLIT_REND_LC3PLUS + isPostRendInputCldfb = 1; + } + else + { + error = splitBinLc3plusDecode( hSplitBin, &bits, tmpCrendBuffer, bits.pose_correction ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } #endif - ); } else { copyBufferTo2dArray( splitBinInput->base.inputBuffer, tmpCrendBuffer ); } - ivas_rend_CldfbSplitPostRendProcess( - hSplitBin->hBinHrSplitPostRend, - &hSplitBin->multiBinPoseData, - QuaternionsPost, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - tmpCrendBuffer, - ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 ); +#ifdef SPLIT_REND_LC3PLUS + if ( bits.pose_correction == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { +#endif /* SPLIT_REND_LC3PLUS */ + ivas_rend_CldfbSplitPostRendProcess( + hSplitBin->hBinHrSplitPostRend, + &hSplitBin->multiBinPoseData, + QuaternionsPost, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + tmpCrendBuffer, +#ifdef SPLIT_REND_LC3PLUS + isPostRendInputCldfb ); + } +#else /* SPLIT_REND_LC3PLUS */ + ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? 1 : 0 ); +#endif /* SPLIT_REND_LC3PLUS */ + #ifdef SPLIT_REND_PLC } else @@ -5982,13 +6414,16 @@ static ivas_error renderSplitBinauralWithPostRot( copyBufferTo2dArray( splitBinInput->base.inputBuffer, tmpCrendBuffer ); } } -#endif +#endif /* SPLIT_REND_PLC */ convertInternalBitsBuffToBitsBuffer( hBits, bits ); accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); + pop_wmops(); + return error; } + #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -6048,12 +6483,8 @@ static ivas_error renderSbaToMultiBinaural( assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); /* call CREND */ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - pos_idx -#endif - ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate, + pos_idx ) ) != IVAS_ERR_OK ) { return error; } @@ -6180,12 +6611,18 @@ static ivas_error renderSbaToSplitBinaural( ivas_renderMultiBinToSplitBinaural( &sbaInput->splitRendWrapper, sbaInput->base.ctx.pHeadRotData->headPositions, sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.splitRendBitRate, +#ifdef SPLIT_REND_LC3PLUS + sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config.codec, +#endif &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, max_band, tmpCrendBuffer, low_res_pre_rend_rot, +#ifdef SPLIT_REND_LC3PLUS + 1, +#endif ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); convertInternalBitsBuffToBitsBuffer( hBits, bits ); @@ -6791,6 +7228,14 @@ ivas_error IVAS_REND_GetSamples( return IVAS_ERR_WRONG_NUM_CHANNELS; } +#ifdef SPLIT_REND_LC3PLUS + /* Use internal buffer if outputting split rendering bitstream */ + if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + outAudio = hIvasRend->splitRendEncBuffer; + } +#endif + /* Clear output buffer */ set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); @@ -6842,6 +7287,41 @@ ivas_error IVAS_REND_GetSamples( limitRendererOutput( hIvasRend->hLimiter, outAudio.data, outAudio.config.numSamplesPerChannel, IVAS_LIMITER_THRESHOLD ); #endif +#ifdef SPLIT_REND_LC3PLUS + if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + /* The condition below is a temp fix for differences in procesing paths between split rendering of SBA and ISM. Should be unified */ + && hIvasRend->inputsIsm[0].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + { + /* TODO: doesn't work for multiple SBA inputs, needs to be updated like the ISM path for TD */ + ivas_split_rend_bits_t bits; + float Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float tmpBinaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; + + copyBufferTo2dArray( outAudio, tmpBinaural ); + + /* Encode split rendering bitstream */ + convertBitsBufferToInternalBitsBuff( *hBits, &bits ); + error = ivas_renderMultiBinToSplitBinaural( &hIvasRend->splitRendWrapper, + hIvasRend->headRotData.headPositions, + hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, + hIvasRend->hRendererConfig->split_rend_config.codec, + &bits, + Cldfb_RealBuffer_Binaural, + Cldfb_ImagBuffer_Binaural, + ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000, + tmpBinaural, + 1, + 1, + 0 ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + convertInternalBitsBuffToBitsBuffer( hBits, bits ); + } +#endif + return IVAS_ERR_OK; } @@ -6901,6 +7381,10 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); +#ifdef SPLIT_REND_LC3PLUS + closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#endif + closeHeadRotation( hIvasRend ); free( hIvasRend ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 05923e3d88..3b4a236133 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -68,6 +68,10 @@ typedef struct int32_t bufLenInBytes; int32_t bitsWritten; int32_t bitsRead; +#ifdef SPLIT_REND_LC3PLUS + IVAS_SPLIT_REND_CODEC codec; + IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection; +#endif } IVAS_REND_BitstreamBufferConfig; typedef struct { diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 242a3d05d8..5b0a308e06 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -535,6 +535,17 @@ ivas_error RenderConfigReader_read( errorHandler( item, ERROR_VALUE_INVALID ); } } +#ifdef SPLIT_REND_LC3PLUS + else if ( strcmp( item, "CODEC") == 0 ) + { + int16_t tmp; + if ( !sscanf( pValue, "%hd", &tmp ) ) + { + errorHandler( item, ERROR_VALUE_INVALID ); + } + hRenderConfig->split_rend_config.codec = tmp == 0 ? IVAS_SPLIT_REND_CODEC_LCLD : IVAS_SPLIT_REND_CODEC_LC3PLUS; + } +#endif #ifdef DEBUGGING else diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 19c0544b16..852d31b2db 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -148,7 +148,12 @@ ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileR return IVAS_ERR_OK; } -ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ) +ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written +#ifdef SPLIT_REND_LC3PLUS + , + IVAS_SPLIT_REND_CODEC codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection +#endif +) { char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "SPLIT_FRAME"; size_t header_len, i, num_bytes; @@ -174,6 +179,19 @@ ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFil } } +#ifdef SPLIT_REND_LC3PLUS + /* Write codec signalling */ + if ( fwrite( &codec, sizeof( codec ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } + /* Write pose correction signalling */ + if ( fwrite( &poseCorrection, sizeof( poseCorrection ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_WRITE; + } +#endif + /*write num bytes*/ if ( fwrite( bits_written, sizeof( int32_t ), 1, hSplitRendFileReadWrite->file ) != 1 ) { @@ -192,11 +210,16 @@ ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFil return IVAS_ERR_OK; } -ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ) +ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written +#ifdef SPLIT_REND_LC3PLUS + , + IVAS_SPLIT_REND_CODEC *codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE* poseCorrection +#endif +) { char header[SPLIT_RENDERER_FRAME_HEADER_LEN] = "SPLIT_FRAME"; char header_read[SPLIT_RENDERER_FRAME_HEADER_LEN]; - size_t header_len, i, num_bytes, bit_len = 0; + int32_t header_len, i, num_bytes, bit_len = 0; if ( hSplitRendFileReadWrite == NULL ) { @@ -224,6 +247,19 @@ ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileRea return IVAS_ERR_FAILED_FILE_READ; } +#ifdef SPLIT_REND_LC3PLUS + /* read codec signalling */ + if ( fread( codec, sizeof( *codec ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_READ; + } + /* read pose correction signalling */ + if ( fread( poseCorrection, sizeof( *poseCorrection ), 1, hSplitRendFileReadWrite->file ) != 1 ) + { + return IVAS_ERR_FAILED_FILE_READ; + } +#endif + /*write num bytes*/ if ( fread( &bit_len, sizeof( int32_t ), 1, hSplitRendFileReadWrite->file ) != 1 ) { @@ -231,7 +267,7 @@ ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileRea } num_bytes = ( bit_len + 7 ) >> 3; - if ( fread( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != num_bytes ) + if ( fread( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != (uint32_t)num_bytes ) { return IVAS_ERR_FAILED_FILE_READ; } diff --git a/lib_util/split_render_file_read_write.h b/lib_util/split_render_file_read_write.h index d98bc4b936..694774afd9 100644 --- a/lib_util/split_render_file_read_write.h +++ b/lib_util/split_render_file_read_write.h @@ -50,10 +50,20 @@ ivas_error split_rend_writer_open( SplitFileReadWrite **hhSplitRendFileReadWrite ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileReadWrite ); /*write split rend coded bitstream to file*/ -ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ); +ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written +#ifdef SPLIT_REND_LC3PLUS + , + IVAS_SPLIT_REND_CODEC codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection +#endif +); /*read split rend coded bits from file*/ -ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written ); +ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written +#ifdef SPLIT_REND_LC3PLUS + , + IVAS_SPLIT_REND_CODEC *codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection +#endif +); /*read split pre rend delay*/ ivas_error split_rend_read_pre_rend_delay_ns( SplitFileReadWrite *hSplitRendFileReadWrite, uint32_t *delay_ns ); diff --git a/scripts/cppp/.gitignore b/scripts/cppp/.gitignore new file mode 100644 index 0000000000..d9e7f83c69 --- /dev/null +++ b/scripts/cppp/.gitignore @@ -0,0 +1,2 @@ +*.pm +*.pl \ No newline at end of file diff --git a/scripts/prepare_instrumentation.sh b/scripts/prepare_instrumentation.sh index c748f19aca..2a8037fcc7 100755 --- a/scripts/prepare_instrumentation.sh +++ b/scripts/prepare_instrumentation.sh @@ -65,6 +65,7 @@ mkdir $targetdir cp -R ../lib_* $targetdir cp -R ../apps $targetdir cp -R ../Makefile $targetdir +cp -R ../CMakeLists.txt $targetdir cp -R ../Workspace_msvc $targetdir # back up #ifdef-list @@ -101,9 +102,12 @@ shopt -u extglob # patch code before wmc_tool: replace hexadecimal unsigned long constants (0x...UL) by regular integer constant + cast to unsigned long find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(unsigned long\)\1\)/" \{\} \; +lc3plus_main_dir="lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/*.c" +lc3plus_fft_dir="lib_rend/lc3plus_codec/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/*.c" + # run wmc_tool "tools/$system/wmc_tool" -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" >> /dev/null -"tools/$system/wmc_tool" -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >> /dev/null +"tools/$system/wmc_tool" -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" "$targetdir/$lc3plus_main_dir" "$targetdir/$lc3plus_fft_dir" >> /dev/null # automatically enable #define WMOPS in options.h sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*WMOPS\)[[:space:]]*\*\//\1/g" $targetdir/lib_com/options.h diff --git a/scripts/split_rendering/lc3plus/.gitignore b/scripts/split_rendering/lc3plus/.gitignore new file mode 100644 index 0000000000..9cd2def1f8 --- /dev/null +++ b/scripts/split_rendering/lc3plus/.gitignore @@ -0,0 +1 @@ +ivas_lc3plus_unit_test \ No newline at end of file diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c new file mode 100644 index 0000000000..c27809c2e7 --- /dev/null +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c @@ -0,0 +1,632 @@ +/****************************************************************************************************** + +(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 +#include +#include "ivas_lc3plus_enc.h" +#include "ivas_lc3plus_common.h" +#include "ivas_lc3plus_dec.h" +#include "ivas_error_utils.h" + +#define MAX_SAMPLES_PER_CHANNEL 960 + +static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config ) +{ + ivas_error err; + uint32_t bps = 128000; + int32_t encDelay = -1; + int32_t decDelay = -1; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + if ( encDelay == -1 || encDelay == 0 ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "encDelay is zero or uninitialized\n" ); + } + + /* encode one frame */ + int16_t numSamplesPerChannels = config.samplerate / ( 1000000 / config.ivas_frame_duration_us ); + float *pcm_in[2]; + float pcm_in_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch2[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch2, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_in[0] = pcm_in_ch1; + pcm_in[1] = pcm_in_ch2; + + int32_t bitstreamSizePerIvasFrame = 0; + err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + if ( IVAS_ERR_OK != err ) + return err; + + uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); + memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); + + err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + if ( IVAS_ERR_OK != err ) + return err; + IVAS_LC3PLUS_ENC_Close( &encHandle ); + + /* decode one frame */ + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + if ( decDelay == -1 || decDelay == 0 ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "decDelay is zero or uninitialized\n" ); + } + + uint8_t *bitstream_in = bitstream_out; + + float *pcm_out[2]; + float pcm_out_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch2[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch2, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_out[0] = pcm_out_ch1; + pcm_out[1] = pcm_out_ch2; + + err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_DEC_Close( &decHandle ); + free( bitstream_out ); + + return 0; +} + + +static int openCloseEncoder( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + uint32_t bps = 128000; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_ENC_Close( &encHandle ); + return 0; +} + +static int tryOpenEncoderWithInvalidBitrate( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + /* lc3plus max bitrate is 320000 per channel */ + uint32_t invalid_high_bps = 700000; + uint32_t invalid_low_bps = 8; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, invalid_high_bps, &encHandle ); + /* setting an invalid bitrate should trigger an error - which is what we expect */ + if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) + { + return 1; + } + err = IVAS_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); + /* setting an invalid bitrate should trigger an error - which is what we expect */ + if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) + { + return 1; + } + return 0; +} + +static int tryOpenEncoderWithInvalidFrameDuration( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ + uint32_t bps = 320000; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + /* setting an invalid fame duration should trigger an error - which is what we expect */ + if ( IVAS_ERR_OK == err ) + { + return 1; + } + return 0; +} + +static int tryOpenEncoderWithInvalidSampleRate( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + config.samplerate = 1234; /*unsupported sample rate */ + uint32_t bps = 320000; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + /* setting an invalid sample rate should trigger an error - which is what we expect */ + if ( IVAS_ERR_OK == err ) + { + return 1; + } + return 0; +} + +static int tryCallEncoderApiWithInvalidParams( void ) +{ + IVAS_LC3PLUS_ENC_HANDLE invalidEncHandle = NULL; + int32_t *invalidBsSize = NULL; + int32_t bsSize; + int32_t *invalidDelayInSamples = NULL; + int32_t delayInSamples; + float **invalidPcm_in = NULL; + void *invalidBitstream_out = NULL; + + const int16_t numSamplesPerChannels = MAX_SAMPLES_PER_CHANNEL; + float *pcm_in[1]; + float pcm_in_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_in[0] = pcm_in_ch1; + uint8_t bitstream_out[1200]; + + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetDelay( invalidEncHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetDelay( invalidEncHandle, &delayInSamples ) ) + { + return 1; + } + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, invalidBsSize ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( invalidEncHandle, &bsSize ) ) + { + return 1; + } + IVAS_LC3PLUS_ENC_Close( &invalidEncHandle ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out ) ) + { + return 1; + } + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out ) ) + { + return 1; + } + return 0; +} + + +static int tryCallDecoderApiWithInvalidParams( void ) +{ + IVAS_LC3PLUS_DEC_HANDLE invalidDecHandle = NULL; + + int32_t *invalidDelayInSamples = NULL; + int32_t delayInSamples; + float **invalidPcm_out = NULL; + void *invalidBitstream_in = NULL; + int32_t invalidBitstream_in_size = 0; + int32_t bitstream_in_size = 100; + + const int16_t numSamplesPerChannels = MAX_SAMPLES_PER_CHANNEL; + float *pcm_out[1]; + float pcm_out_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_out[0] = pcm_out_ch1; + uint8_t bitstream_in[1200]; + + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_GetDelay( invalidDecHandle, invalidDelayInSamples ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_GetDelay( invalidDecHandle, &delayInSamples ) ) + { + return 1; + } + IVAS_LC3PLUS_DEC_Close( &invalidDecHandle ); + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, invalidBitstream_in, bitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, invalidBitstream_in_size, pcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Decode( invalidDecHandle, bitstream_in, bitstream_in_size, pcm_out ) ) + { + return 1; + } + + if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Conceal( invalidDecHandle, invalidPcm_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != IVAS_LC3PLUS_DEC_Conceal( invalidDecHandle, pcm_out ) ) + { + return 1; + } + return 0; +} + +static int openCloseDecoderWithCaching( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_DEC_Close( &decHandle ); + return 0; +} + +static int openCloseDecoderWithoutCaching( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_DEC_Close( &decHandle ); + return 0; +} + + + + +static int tryOpenDecoderWithInvalidFrameDuration( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ + + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + /* setting an invalid fame duration should trigger an error - which is what we expect */ + if ( IVAS_ERR_OK == err ) + { + return 1; + } + return 0; +} + +static int tryOpenDecoderWithInvalidSampleRate( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + config.samplerate = 1234; /*unsupported sample rate*/ + + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + /* setting an invalid sample rate should trigger an error - which is what we expect */ + if ( IVAS_ERR_OK == err ) + { + return 1; + } + return 0; +} + +static int encodeOneFrame( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + uint32_t bps = 128000; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + if ( IVAS_ERR_OK != err ) + return err; + + int16_t numSamplesPerChannels = config.samplerate / ( 1000000 / config.ivas_frame_duration_us ); + + float *pcm[1]; + float pcm_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + pcm[0] = pcm_ch1; + + int32_t bitstreamSizePerIvasFrame = 0; + err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + if ( IVAS_ERR_OK != err ) + return err; + uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); + memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); + + err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out ); + if ( IVAS_ERR_OK != err ) + return err; + + IVAS_LC3PLUS_ENC_Close( &encHandle ); + free( bitstream_out ); + return 0; +} + + +static int encodeAndDecodeOneMonoFrame( void ) +{ + ivas_error err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; + uint32_t bps = 128000; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* encode one frame */ + int16_t numSamplesPerChannels = config.samplerate / ( 1000000 / config.ivas_frame_duration_us ); + float *pcm_in[1]; + float pcm_in_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_in[0] = pcm_in_ch1; + + int32_t bitstreamSizePerIvasFrame = 0; + err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + if ( IVAS_ERR_OK != err ) + return err; + + uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); + memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); + + err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + if ( IVAS_ERR_OK != err ) + return err; + IVAS_LC3PLUS_ENC_Close( &encHandle ); + + /* decode one frame */ + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + 1 /*caching enabled*/, +#endif + &decHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + uint8_t *bitstream_in = bitstream_out; + + float *pcm_out[1]; + float pcm_out_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_out[0] = pcm_out_ch1; + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_DEC_Close( &decHandle ); + free( bitstream_out ); + + return 0; +} + +static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_48kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_32kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 32000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_16kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 16000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneStereoFrameIvas5msLc3plus5ms_48kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneMonoFrameIvas20msLc3plus10ms_48kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 1, .samplerate = 48000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneMonoFrameIvas5msLc3plus5ms_48kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 5 * 1000, .channels = 1, .samplerate = 48000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +static int encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz( void ) +{ + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 2.5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; + return encodeAndDecodeOneStereoFrame( config ); +} + +#include "ivas_lc3plus_unit_test_selective_decoding.c" + + +int main( + int argc, + char *argv[] ) +{ + int ret = 0; + ret = openCloseEncoder(); + if ( ret != 0 ) + return ret; + ret = tryOpenEncoderWithInvalidBitrate(); + if ( ret != 0 ) + return ret; + ret = tryOpenEncoderWithInvalidFrameDuration(); + if ( ret != 0 ) + return ret; + ret = tryOpenEncoderWithInvalidSampleRate(); + if ( ret != 0 ) + return ret; + ret = tryCallEncoderApiWithInvalidParams(); + if ( ret != 0 ) + return ret; + ret = openCloseDecoderWithCaching(); + if ( ret != 0 ) + return ret; + ret = openCloseDecoderWithoutCaching(); + if ( ret != 0 ) + return ret; + ret = tryOpenDecoderWithInvalidFrameDuration(); + if ( ret != 0 ) + return ret; + ret = tryOpenDecoderWithInvalidSampleRate(); + if ( ret != 0 ) + return ret; + ret = tryCallDecoderApiWithInvalidParams(); + if ( ret != 0 ) + return ret; + ret = encodeOneFrame(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneMonoFrame(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_48kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_32kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_16kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneStereoFrameIvas5msLc3plus5ms_48kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneMonoFrameIvas20msLc3plus10ms_48kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneMonoFrameIvas5msLc3plus5ms_48kHz(); + if ( ret != 0 ) + return ret; + ret = encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_decode_all_subframes(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_dont_decode_last_2_subframes(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_dont_decode_last_3_subframes(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_skip_first_subframe(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_decode_cache(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_skip_first(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_dec_first(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_bundle_switches_dec_first(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_bundle_switches_skip_first(); + if ( ret != 0 ) + return ret; + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_get_active_dont_cache(); + if ( ret != 0 ) + return ret; +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + ret = selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_dec_first_no_caching(); + if ( ret != 0 ) + return ret; +#endif +#if 0 + ret = selectiveDecIvas5msLc3plus5ms_48kHz_scenario_decode_all_subframes(); + if(ret != 0) + return ret; + ret = selectiveDecIvas5msLc3plus5ms_48kHz_scenario_dont_decode_last_subframes(); + if(ret != 0) + return ret; +#endif + return ret; +} diff --git a/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c new file mode 100644 index 0000000000..d90e98ed5b --- /dev/null +++ b/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test_selective_decoding.c @@ -0,0 +1,1954 @@ +/****************************************************************************************************** + +(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 +#include +#include "ivas_lc3plus_enc.h" +#include "ivas_lc3plus_common.h" +#include "ivas_lc3plus_dec.h" +#include "ivas_error_utils.h" + +#define MAX_SAMPLES_PER_CHANNEL 960 + +/* included by ivas_lc3plus_unit_test.c */ + +typedef int ( *ScenarioFnPtr )( const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE dec, + uint8_t *bitstream_in, + int32_t bitstream_in_size, + float **pcm_out ); + +static int encodeAndDecodeOne6chFrameFixture( LC3PLUS_CONFIG config, const int16_t enableCaching, const int32_t bps, ScenarioFnPtr scenarioFn ) +{ + ivas_error err; + int32_t encDelay = -1; + int32_t decDelay = -1; + + IVAS_LC3PLUS_ENC_HANDLE encHandle; + err = IVAS_LC3PLUS_ENC_Open( config, bps, &encHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_ENC_GetDelay( encHandle, &encDelay ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + if ( encDelay == -1 || encDelay == 0 ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "encDelay is zero or uninitialized\n" ); + } + + /* encode one frame */ + int16_t numSamplesPerChannels = config.samplerate / ( 1000000 / config.ivas_frame_duration_us ); + float *pcm_in[6]; + float pcm_in_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch2[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch2, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch3[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch3, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch4[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch4, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch5[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch5, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_in_ch6[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_in_ch6, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_in[0] = pcm_in_ch1; + pcm_in[1] = pcm_in_ch2; + pcm_in[2] = pcm_in_ch3; + pcm_in[3] = pcm_in_ch4; + pcm_in[4] = pcm_in_ch5; + pcm_in[5] = pcm_in_ch6; + + int32_t bitstreamSizePerIvasFrame = 0; + err = IVAS_LC3PLUS_ENC_GetOutputBitstreamSize( encHandle, &bitstreamSizePerIvasFrame ); + if ( IVAS_ERR_OK != err ) + return err; + + uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); + memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); + + err = IVAS_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); + if ( IVAS_ERR_OK != err ) + return err; + IVAS_LC3PLUS_ENC_Close( &encHandle ); + + /* decode one frame */ + IVAS_LC3PLUS_DEC_HANDLE decHandle; + err = IVAS_LC3PLUS_DEC_Open( config, +#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING + enableCaching, +#endif + &decHandle ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_GetDelay( decHandle, &decDelay ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + if ( decDelay == -1 || decDelay == 0 ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "decDelay is zero or uninitialized\n" ); + } + + uint8_t *bitstream_in = bitstream_out; + + float *pcm_out[6]; + float pcm_out_ch1[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch1, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch2[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch2, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch3[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch3, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch4[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch4, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch5[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch5, 0, numSamplesPerChannels * sizeof( float ) ); + float pcm_out_ch6[MAX_SAMPLES_PER_CHANNEL * sizeof( float )]; + memset( pcm_out_ch6, 0, numSamplesPerChannels * sizeof( float ) ); + pcm_out[0] = pcm_out_ch1; + pcm_out[1] = pcm_out_ch2; + pcm_out[2] = pcm_out_ch3; + pcm_out[3] = pcm_out_ch4; + pcm_out[4] = pcm_out_ch5; + pcm_out[5] = pcm_out_ch6; + + err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + if ( NULL != scenarioFn ) + { + err = ( *scenarioFn )( config, decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstreamSizePerIvasFrame, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + err = IVAS_LC3PLUS_DEC_Conceal( decHandle, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + IVAS_LC3PLUS_DEC_Close( &decHandle ); + free( bitstream_out ); + + return 0; +} + +/* + * in: [dec, dec, dec, dec] + * expected out: [dec_and_use, dec_and_use, dec_and_use, dec_and_use] + */ +static int scenario_decode_all_subframes( const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + // const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + assert( decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame == 0 ); + if(NULL != decHandle->bitstream_caches) + { + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + } + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct post decoding state */ + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + + +/* + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + */ +static int scenario_dont_decode_last_2_subframes( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + if(NULL != decHandle->bitstream_caches) + { + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + } + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * in: [dec, skip, skip, skip] + * expected out: [dec_and_use, skip, skip, cache] + */ +static int scenario_dont_decode_last_3_subframes( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 3 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last three subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframes before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 3 ) + { + /* subframes before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + + +/* + * in: [skip, dec, dec, dec] + * expected out: [dec_and_drop, dec_and_use, dec_and_use, dec_and_use] + */ +static int scenario_skip_first_subframe( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if ( iSubframeIdx == 0 ) + { + /* skip the first subframe */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the following subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + + if ( iLc3plusFrame == 0 ) + { + /* first subframe is expected to be decoded and dropped */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + * + * Step2: + * in: [dec, dec, dec, dec] + * expected out: [dec_cache & dec_and_use, dec_and_use, dec_and_use, dec_and_use] + */ +static int scenario_decode_cache( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2, ensure that the cache is used */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + /* decode all */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 1 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * Step1: + * in: [skip, skip, dec, dec] + * expected out: [skip, dec_and_drop, dec_and_use, dec_and_use] + * + * Step2: + * in: [dec, dec, dec, dec] + * expected out: [no_cache & dec_and_use, dec_and_use, dec_and_use, dec_and_use] + */ +static int scenario_get_active_dont_cache( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * * expected out: [skip, dec_and_drop, dec_and_use, dec_and_use] */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 3 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2, ensure that there is no cache */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + /* decode all [dec, dec, dec, dec]*/ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct decoder actions + * expected out: [no_cache & dec_and_use, dec_and_use, dec_and_use, dec_and_use]*/ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + * + * Step2: + * in: [skip, dec, skip, dec] + * expected out: [drop_cache & dec_and_drop, dec_and_use, dec_and_drop, dec_and_use] + * */ +static int scenario_per_subframe_switches_skip_first( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2 + * in: [skip, dec, skip, dec] + * */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if(iSubframeIdx == 0 || iSubframeIdx == 2) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else if(iSubframeIdx == 1 || iSubframeIdx == 3) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else + { + //unsupported iSubframeIdx count; + return 1; + } + + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * expected out: [drop_cache & dec_and_drop, dec_and_use, dec_and_drop, dec_and_use] + * */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == 1 || iLc3plusFrame == 3) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 0 || iLc3plusFrame == 2) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else + { + assert(0); + } + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + * + * Step2: + * in: [dec, skip, dec, skip] + * expected out: [dec_cache & dec_and_use, dec_and_drop, dec_and_use, cache] + * */ +static int scenario_per_subframe_switches_dec_first( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2 + * in: [dec, skip, dec, skip] + * */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if(iSubframeIdx == 0 || iSubframeIdx == 2) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else if(iSubframeIdx == 1 || iSubframeIdx == 3) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + // unsupported iSubframeIdx count + return 1; + } + + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * expected out: [dec_cache & dec_and_use, dec_and_drop, dec_and_use, cache] + * */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 1 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == 0 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 1 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else if ( iLc3plusFrame == 2 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 3) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else + { + assert(0); + } + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, skip] + * + * Step2: + * in: [dec, skip, dec, skip] + * expected out: [drop_cache & dec_and_use, skip, dec_and_use, skip] + * */ +static int scenario_per_subframe_switches_dec_first_no_caching( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( NULL == decHandle->bitstream_caches ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( NULL == decHandle->bitstream_caches ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2 + * in: [dec, skip, dec, skip] + * */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if(iSubframeIdx == 0 || iSubframeIdx == 2) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else if(iSubframeIdx == 1 || iSubframeIdx == 3) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + // unsupported iSubframeIdx count + return 1; + } + + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * expected out: [drop_cache & dec_and_use, skip, dec_and_use, skip] + * */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( NULL == decHandle->bitstream_caches ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == 0 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 1 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else if ( iLc3plusFrame == 2 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 3) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert(0); + } + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( NULL == decHandle->bitstream_caches ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + * + * Step2: + * in: [dec, skip, skip, dec] + * expected out: [dec_cache & dec_and_use, skip, dec_and_drop, dec_and_use] + * */ +static int scenario_per_subframe_bundle_switches_dec_first( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2 + * in: [dec, skip, skip, dec] + * */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if(iSubframeIdx == 0 || iSubframeIdx == 3) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else if(iSubframeIdx == 1 || iSubframeIdx == 2) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + // unsupported iSubframeIdx count + return 1; + } + + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * expected out: [dec_cache & dec_and_use, skip, dec_and_drop, dec_and_use] + * */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 1 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == 0 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 1 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else if ( iLc3plusFrame == 2 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else if ( iLc3plusFrame == 3) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else + { + assert(0); + } + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + +/* + * Step1: + * in: [dec, dec, skip, skip] + * expected out: [dec_and_use, dec_and_use, skip, cache] + * + * Step2: + * in: [skip, dec, dec, skip] + * expected out: [drop_cache & dec_and_drop, dec_and_use, dec_and_use, cache] + * */ +static int scenario_per_subframe_bundle_switches_skip_first( + const LC3PLUS_CONFIG config, + IVAS_LC3PLUS_DEC_HANDLE decHandle, /* i: decoder handle */ + uint8_t *bitstream_in, /* i: pointer to input bitstream */ + int32_t bitstream_in_size, /* i: size of bitstream_in */ + float **pcm_out /* o: decoded samples */ ) +{ + ivas_error err; + const int16_t decode = 1; + const int16_t skipDecoding = 0; + uint32_t iDec = 0; + int iLc3plusFrame = 0; + int lc3framesPerIvasFrame; + int16_t **selective_decoding_matrix; + err = IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( &selective_decoding_matrix, config.channels ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* Set selective decoding scenario */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + assert( MAX_PARAM_SPATIAL_SUBFRAMES == 4 ); + if ( iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 1 || iSubframeIdx == MAX_PARAM_SPATIAL_SUBFRAMES - 2 ) /*only valid for MAX_PARAM_SPATIAL_SUBFRAMES == 4 */ + { + /* skip the last two subframes */ + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + /* decode the previous ones */ + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + } + } + + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 0 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 == decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == lc3framesPerIvasFrame - 1 ) + { + /* last subframe is expected to be cached */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else if ( iLc3plusFrame == lc3framesPerIvasFrame - 2 ) + { + /* subframe before the last one is expected to be skipped, since only the last one is required to flush the decoder after a pause */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_SKIP ); + } + else + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + } + + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder caching */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + /* Step 2 + * in: [skip, dec, dec, skip] + * */ + for ( int16_t iSubframeIdx = 0; iSubframeIdx < MAX_PARAM_SPATIAL_SUBFRAMES; iSubframeIdx++ ) + { + for ( int16_t decIdx = 0; decIdx < config.channels; decIdx++ ) + { + if(iSubframeIdx == 1 || iSubframeIdx == 2) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = decode; + } + else if(iSubframeIdx == 0 || iSubframeIdx == 3) + { + selective_decoding_matrix[iSubframeIdx][decIdx] = skipDecoding; + } + else + { + // unsupported iSubframeIdx count + return 1; + } + + } + } + /* Apply selective decoding scenario */ + err = IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( decHandle, selective_decoding_matrix ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + + /* verify correct decoder actions + * expected out: [drop_cache & dec_and_drop, dec_and_use, dec_and_use, cache] + * */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + if ( iLc3plusFrame == 0 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_DROP ); + } + else if ( iLc3plusFrame == 1 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 2 ) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + else if ( iLc3plusFrame == 3) + { + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_CACHE ); + } + else + { + assert(0); + } + } + } + err = IVAS_LC3PLUS_DEC_Decode( decHandle, bitstream_in, bitstream_in_size, pcm_out ); + if ( IVAS_ERR_OK != err ) + { + return err; + } + /* verify correct post-decoding state */ + lc3framesPerIvasFrame = decHandle->config.ivas_frame_duration_us / decHandle->config.lc3plus_frame_duration_us; + for ( iDec = 0; iDec < decHandle->num_decs; iDec++ ) + { + assert( 1 == decHandle->selective_decoding_states[iDec]->has_skipped_a_frame ); + assert( 0 == decHandle->selective_decoding_states[iDec]->shall_decode_cached_frame ); + assert( 0 != decHandle->bitstream_caches[iDec]->bitstream_cache_size ); + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) + { + /* default action after decoding should be DEC_ACTION_DECODE_AND_USE again */ + assert( decHandle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] == DEC_ACTION_DECODE_AND_USE ); + } + } + + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( selective_decoding_matrix ); + return IVAS_ERR_OK; +} + + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_decode_all_subframes( void ) +{ + int err; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_decode_all_subframes ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_dont_decode_last_2_subframes( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_dont_decode_last_2_subframes ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_dont_decode_last_3_subframes( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_dont_decode_last_3_subframes ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_skip_first_subframe( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_skip_first_subframe ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_decode_cache( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_decode_cache ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_skip_first( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_per_subframe_switches_skip_first ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_dec_first( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_per_subframe_switches_dec_first ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_bundle_switches_dec_first( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_per_subframe_bundle_switches_dec_first ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_bundle_switches_skip_first( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_per_subframe_bundle_switches_skip_first ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_per_subframe_switches_dec_first_no_caching( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 0; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_per_subframe_switches_dec_first_no_caching ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + + +static int selectiveDecIvas20msLc3plus5ms_48kHz_scenario_get_active_dont_cache( void ) +{ + int err = 0; + LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .ivas_frame_duration_us = 20 * 1000, .channels = 6, .samplerate = 48000 }; + const int16_t enableCaching = 1; + err = encodeAndDecodeOne6chFrameFixture( config, enableCaching, 768000, &scenario_get_active_dont_cache ); + if ( 0 != err ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL, "test failed\n" ); + } + return err; +} + + + + + + diff --git a/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py b/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py new file mode 100755 index 0000000000..f72fce6a87 --- /dev/null +++ b/scripts/split_rendering/lc3plus/split_rend_lc3plus_cmdlines.py @@ -0,0 +1,173 @@ +""" +Generate command lines for split rendering with LC3plus +""" + +import itertools +import os + +# Paths +ENC_PATH = "./IVAS_cod" +DEC_PATH = "./IVAS_dec" +REND_PATH = "./IVAS_rend" +TEMP_DIR = "tmp" + +# Config values to iterate over +ISM_CONFIGS_NUM_OBJECTS = [1, 2, 3, 4] +IVAS_BITRATES = [128000] +PRE_HEAD_ROT_FILES = ["Workspace_msvc/trajectories/pre-renderer_pose_files/pre_yaw-20static.csv"] +POST_HEAD_ROT_FILES = ["Workspace_msvc/trajectories/post-renderer_pose_files/post_0static.csv"] +RENDER_CONFIG_FILES = [ + ####################################################### + # Alternative 2 - LC3plus with CLDFB pose correction + "Workspace_msvc/renderer_configs/split_renderer_config_768_1dof.txt", + "Workspace_msvc/renderer_configs/split_renderer_config_512_2dof.txt", + None, # Alternative 2 is the default when no rendering config file is given on command line + ####################################################### + # Alternative 3 - LC3plus with multi-stream (TD) pose correction + "Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt", + "Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt", +] + + +def audio_for_ism(num_objects): + return f"scripts/testv/stv{num_objects}ISM48s.wav" + + +def metadata_for_ism(num_objects): + return f"scripts/testv/stvISM{num_objects}.csv" + + +def basename(file_path): + basename_w_ext = os.path.basename(file_path) + return os.path.splitext(basename_w_ext)[0] + + +# Full chain: IVAS_cod -> IVAS_dec -> IVAS_rend(post) +def full_chain(num_objects, ivas_bitrate, pre_head_rot_file, render_config_file, post_head_rot_file): + bs_name = f"{TEMP_DIR}/ism{num_objects}_b{ivas_bitrate}_full_chain.g192" + cod = [ + ENC_PATH, + "-ism", + str(num_objects), + *[metadata_for_ism(i + 1) for i in range(num_objects)], + str(ivas_bitrate), + "48", + audio_for_ism(num_objects), + bs_name, + ] + + render_config_infix = f"##{basename(render_config_file)}" if render_config_file else "" + split_bs_name = bs_name.replace(".g192", f"##{basename(pre_head_rot_file)}{render_config_infix}##split.bs") + render_config_args = ["-render_config", render_config_file] if render_config_file else [] + dec = [ + DEC_PATH, + "-T", + pre_head_rot_file, + *render_config_args, + "SPLIT_BINAURAL", + "48", + bs_name, + split_bs_name, + ] + + binaural_output_name = split_bs_name.replace(".bs", f"##{basename(post_head_rot_file)}##binaural.wav") + rend = [ + REND_PATH, + "-i", + split_bs_name, + "-if", + "BINAURAL_SPLIT_CLDFB", + "-of", + "BINAURAL", + "-fs", + "48", + "-tf", + post_head_rot_file, + "-o", + binaural_output_name, + ] + + return [cod, dec, rend] + + +# Renderer chain: IVAS_rend(pre) -> IVAS_rend(post) +def rend_chain(num_objects, pre_head_rot_file, render_config_file, post_head_rot_file): + render_config_infix = f"##{basename(render_config_file)}" if render_config_file else "" + split_bs_name = ( + f"{TEMP_DIR}/ism{num_objects}_rend_chain##{basename(pre_head_rot_file)}{render_config_infix}##split.bs" + ) + render_config_args = ["-render_config", render_config_file] if render_config_file else [] + pre = [ + REND_PATH, + "-i", + audio_for_ism(num_objects), + "-if", + f"ISM{num_objects}", + "-im", + *[metadata_for_ism(i + 1) for i in range(num_objects)], + "-of", + "BINAURAL_SPLIT_CLDFB", + "-fs", + "48", + *render_config_args, + "-tf", + pre_head_rot_file, + "-o", + split_bs_name, + ] + + binaural_output_name = split_bs_name.replace(".bs", f"##{basename(post_head_rot_file)}##binaural.wav") + post = [ + REND_PATH, + "-i", + split_bs_name, + "-if", + "BINAURAL_SPLIT_CLDFB", + "-of", + "BINAURAL", + "-fs", + "48", + "-tf", + post_head_rot_file, + "-o", + binaural_output_name, + ] + + return [pre, post] + + +def print_command_list(list_of_lists): + for lst in list_of_lists: + print(" ".join(lst)) + print("") # newline + + +def main(): + print("\n##########################################") + print("# Full chain: enc -> dec -> rend(post)") + print("##########################################\n") + for args_full_chain in itertools.product( + # Ordering here must match argument order in function call below! + ISM_CONFIGS_NUM_OBJECTS, + IVAS_BITRATES, + PRE_HEAD_ROT_FILES, + RENDER_CONFIG_FILES, + POST_HEAD_ROT_FILES, + ): + print_command_list(full_chain(*args_full_chain)) + + print("\n##########################################") + print("# Renderer chain: rend(pre) -> rend(post)") + print("##########################################\n") + for args_rend_chain in itertools.product( + # Ordering here must match argument order in function call below! + ISM_CONFIGS_NUM_OBJECTS, + PRE_HEAD_ROT_FILES, + RENDER_CONFIG_FILES, + POST_HEAD_ROT_FILES, + ): + print_command_list(rend_chain(*args_rend_chain)) + + +if __name__ == "__main__": + main() -- GitLab From b174c8e996e728c8e15270700a38ef502aa2ac36 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 7 Jun 2023 12:31:18 +0200 Subject: [PATCH 0159/1418] [ci] revert accidental change to .gitlab-ci-custom.yml --- .gitlab-ci-custom.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 3bc0785711..86c1f487e0 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -1,4 +1,4 @@ include: - project: $CUSTOM_CI_PROJECT - ref: lc3plus-integration-with-unit-tests + ref: $CUSTOM_CI_REF file: $CUSTOM_CI_FILE -- GitLab From a240a14a392ed23a2d677ec7449fb5af87fd466d Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 9 Jun 2023 15:16:58 +0200 Subject: [PATCH 0160/1418] Merge conflict resolution --- apps/renderer.c | 6 ------ lib_rend/lib_rend.c | 7 ------- scripts/config/self_test.prm | 17 ++++++++--------- scripts/testv/config_directivity.cfg | 1 + tests/renderer/test_renderer.py | 1 + 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index b6823742e9..3b94cd45b2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1907,12 +1907,6 @@ static IVAS_REND_AudioConfig parseAudioConfig( { return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM; } -#ifdef COMMAND_LINE_OPTION_LATE_REVERB - if ( strcmp( charBuf, "BINAURAL_REVERB" ) == 0 ) - { - return IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB; - } -#endif if ( strcmp( charBuf, "BINAURAL" ) == 0 ) { return IVAS_REND_AUDIO_CONFIG_BINAURAL; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 004b1ec4aa..f59b49fec1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1235,11 +1235,7 @@ static ivas_error setRendInputActiveIsm( return error; } } -#ifdef COMMAND_LINE_OPTION_LATE_REVERB - else if ( ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) || ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB ) ) -#else else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) -#endif { if ( hRendCfg != NULL && hRendCfg->roomAcoustics.use_brir == 0 && hRendCfg->roomAcoustics.late_reverb_on ) { @@ -5342,9 +5338,6 @@ static ivas_error renderInputIsm( break; #else case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: -#ifdef COMMAND_LINE_OPTION_LATE_REVERB - case IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB: -#endif error = renderIsmToBinauralRoom( ismInput, outAudio ); break; #endif diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index b5701b55ce..c42fba7501 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -924,36 +924,35 @@ ../IVAS_cod -mc 5_1 256000 48 testv/stv51MC48c.wav bit ../IVAS_dec testv/ls_setup_16ch_8+4+4.txt 48 bit testv/stv51MC48c.wav_MC51_256000_48-48_MC_custom_setup.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit -../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 32kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 32 bit testv/stv51MC48c.wav_MC51_512000_48-32_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 5_1 at 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_MC51_512000_48-16_MC_Config_renderer.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config hospital_patientroom +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config hospital_patientroom ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_hospital_patientroom.tst -// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config recreation +// Multi-channel 5_1 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config recreation ../IVAS_cod -mc 5_1 512000 48 testv/stv51MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv51MC48c.wav_MC51_512000_48-48_MC_Config_recreation.tst -// Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 5_1_2 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1_2 512000 48 testv/stv512MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv512MC48c.wav_MC512_512000_48-48_MC_Config_renderer.tst -// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 5_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 5_1_4 512000 48 testv/stv514MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv514MC48c.wav_MC514_512000_48-48_MC_Config_renderer.tst -// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_REVERB out Config renderer +// Multi-channel 7_1_4 at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out Config renderer ../IVAS_cod -mc 7_1_4 512000 48 testv/stv714MC48c.wav bit ../IVAS_dec -render_config testv/rend_config_renderer.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv714MC48c.wav_MC714_512000_48-48_MC_Config_renderer.tst diff --git a/scripts/testv/config_directivity.cfg b/scripts/testv/config_directivity.cfg index f958df1d31..94807d688c 100644 --- a/scripts/testv/config_directivity.cfg +++ b/scripts/testv/config_directivity.cfg @@ -1,2 +1,3 @@ [general] directivity = [0.0, 360.0, 0.2512]; + diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index df90da7f86..806e871a2e 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -55,6 +55,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), ) + # 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) -- GitLab From afc493736d8db10db466d489cc6a94a6ec40e660 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 9 Jun 2023 15:19:07 +0200 Subject: [PATCH 0161/1418] Merge conflict resolution --- apps/decoder.c | 2 +- lib_com/options.h | 1 - lib_rend/ivas_crend.c | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 0f51903ab2..a3efbbf68a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -85,7 +85,7 @@ static #define IVAS_PUBLIC_ORIENT_TRK_REF_VEC_LEV ( 4 ) #ifdef CONTROL_METADATA_REVERB -#define ACOUSTIC_ENVIRONMENT_ID 0 +#define ACOUSTIC_ENVIRONMENT_ID ( 0 ) #endif #ifdef VARIABLE_SPEED_DECODING diff --git a/lib_com/options.h b/lib_com/options.h index 5e39771af3..f17a34806b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -145,7 +145,6 @@ #ifdef CONTROL_METADATA_REVERB #define CONTROL_METADATA_EARLY_REFLECTIONS /* Philips/Qualcomm: early reflections extension to reverb configuration */ #endif -#define COMMAND_LINE_OPTION_LATE_REVERB /* Philips: late reverb command line option */ #define USE_HRIR_128_METH5_IRC_53_Q10_SYML_ITRP1_48000 /* Dolby (Orange, FhG) : Contribution 36 - SBA HRIR update */ #define UPDATE_SBA_FILTER /* Dolby (Orange, FhG) : Contribution 36 - SBA HRIR update */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 4f28106542..367bdee3ec 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -206,9 +206,6 @@ static ivas_error ivas_rend_initCrend( #ifndef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG /* set BRIR flag */ use_brir = false; -#ifdef COMMAND_LINE_OPTION_LATE_REVERB - /* note: use_brir = false for IVAS_REND_AUDIO_CONFIG_BINAURAL_REVERB */ -#endif if ( ( ( hRendCfg != NULL ) && hRendCfg->roomAcoustics.use_brir ) || ( ( hRendCfg == NULL ) && ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) ) ) { use_brir = true; -- GitLab From 5afac642d22859ed963afad1a48ec93d10b38add Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 12 Jun 2023 11:05:49 +0200 Subject: [PATCH 0162/1418] fixes for support of IND_LIST_DYN + activate IND_LIST_DYN --- lib_com/bitstream.c | 86 ++++++++++++++++++++++++++++++++++++++++ lib_com/options.h | 4 +- lib_enc/ivas_enc.c | 13 ++++++ lib_enc/ivas_init_enc.c | 5 ++- lib_enc/ivas_omasa_enc.c | 16 +++++++- 5 files changed, 119 insertions(+), 5 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index aa46c531d1..5ac1b602ba 100755 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -462,6 +462,47 @@ int16_t get_ivas_max_num_indices( /* o : maximum return 1650; } } +#ifdef MASA_AND_OBJECTS + else if ( ivas_format == MASA_ISM_FORMAT ) + { + 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; + } + } +#endif else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate <= IVAS_16k4 ) @@ -862,6 +903,51 @@ int16_t get_ivas_max_num_indices_metadata( /* o #endif } } +#ifdef MASA_AND_OBJECTS + else if ( ivas_format == MASA_ISM_FORMAT ) + { + if ( ivas_total_brate <= IVAS_16k4 ) + { + return 80; + } + else if ( ivas_total_brate <= IVAS_32k ) + { + return 125 + 100; + } + else if ( ivas_total_brate <= IVAS_48k ) + { + return 205 + 100; + } + else if ( ivas_total_brate <= IVAS_96k ) + { + return 240 + 100; + } + else if ( ivas_total_brate <= IVAS_128k ) + { + return 305 + 30; + } + else if ( ivas_total_brate <= IVAS_160k ) + { + return 425 + 30; + } + else if ( ivas_total_brate <= IVAS_192k ) + { + return 630 + 30; + } + else if ( ivas_total_brate <= IVAS_256k ) + { + return 850 + 30; + } + else if ( ivas_total_brate <= IVAS_384k ) + { + return 1000 + 30; + } + else + { + return 1750 + 30; + } + } +#endif else if ( ivas_format == MC_FORMAT ) { if ( ivas_total_brate <= IVAS_13k2 ) diff --git a/lib_com/options.h b/lib_com/options.h index ab71c50837..7fa5e09a70 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -134,8 +134,8 @@ /* ################# Start DEVELOPMENT switches ######################## */ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ -/* Todo OMASA: This needs to be implemented for OMASA */ -/*#define IND_LIST_DYN */ /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ + +#define IND_LIST_DYN /* VA: Issue 18: Dynamic allocation of ind_list[] and ind_list_metadata[] based on # of transport channels */ #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/ivas_enc.c b/lib_enc/ivas_enc.c index ce7d6d764a..4cf4018cb6 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -319,7 +319,9 @@ ivas_error ivas_enc( return error; } +#ifndef IND_LIST_DYN hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; +#endif /* Stereo transport is used also with monoMASA, duplicate mono if monoMASA */ if ( ( st_ivas->hEncoderConfig->nchan_inp - hEncoderConfig->nchan_ism ) == 1 ) @@ -407,6 +409,17 @@ ivas_error ivas_enc( n = st_ivas->hEncoderConfig->nchan_ism; } +#ifdef IND_LIST_DYN + hMetaData = st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; + + if ( st_ivas->nSCE > 0 ) + { + /* update pointer to the buffer of indices (ISM indices were alredy written) */ + hMetaData->ind_list = st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData->ind_list + st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData->nb_ind_tot; + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list = st_ivas->hSCE[st_ivas->nSCE - 1]->hCoreCoder[0]->hBstr->ind_list + st_ivas->hSCE[st_ivas->nSCE - 1]->hCoreCoder[0]->hBstr->nb_ind_tot; + } +#endif + /* Encode MASA parameters and write MASA metadata bitstream */ if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 2900d3e143..7e9f349e1d 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -661,12 +661,14 @@ 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 ); 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 ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) @@ -706,7 +708,7 @@ ivas_error ivas_init_encoder( return error; } - +#ifndef IND_LIST_DYN /* prepare bitstream buffers */ for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -716,6 +718,7 @@ ivas_error ivas_init_encoder( st_ivas->hCPE[0]->hMetaData->ind_list = ind_list_metadata[st_ivas->nSCE]; reset_indices_enc( st_ivas->hCPE[0]->hMetaData, MAX_BITS_METADATA ); +#endif } #endif else if ( ivas_format == MC_FORMAT ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 03055d56cb..46b7c0418b 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -253,11 +253,23 @@ ivas_error ivas_omasa_enc_config( /* re-write IVAS format signalling - actual 'ism_mode' was not known before */ if ( st_ivas->nSCE > 0 ) { - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->next_ind ); + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot +#else + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->next_ind +#endif + ); } else { - reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->next_ind ); + reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, +#ifdef IND_LIST_DYN + st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot +#else + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->next_ind +#endif + ); } ivas_write_format( st_ivas ); -- GitLab From b8b402c32c1db4e1138ea5e573de52ca5aac0974 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Mon, 12 Jun 2023 11:26:24 +0200 Subject: [PATCH 0163/1418] Removed superfluous file --- scripts/reverb/generate_scene_metadata.py | 399 ---------------------- 1 file changed, 399 deletions(-) delete mode 100644 scripts/reverb/generate_scene_metadata.py diff --git a/scripts/reverb/generate_scene_metadata.py b/scripts/reverb/generate_scene_metadata.py deleted file mode 100644 index 5e1df7334b..0000000000 --- a/scripts/reverb/generate_scene_metadata.py +++ /dev/null @@ -1,399 +0,0 @@ -#!/usr/bin/env python3 - -""" - (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. -""" - -# -# Generate binary render configuration output files for testing purposes -# The binary code generation is based on the MPEG-I audio standard -# which defines functions to decode raw bitstream into internal parameters -# - - -from bitarray import bitarray, test as bitarray_test -import math -from enum import Enum -import numpy as np - - -# Set to True to print values suitable for inclusion into .cfg configuration files -print_cfg = False - -def get_id_code(id): - code = format(id % 128, '07b') + '0' - id //= 128 - while id > 0: - code = format(id % 128, '07b') + '1' + code - id = id // 128 - return code - - -def get_count_or_index_code(n): - # 0, 1, ... 63 - countOrIndexLoCodes = [ - '0111', '100', '01100', '01101', '01010', '01011', '01000', '01001', '001111', '001110', - '001101', '001100', '001011', '001010', '001001', '001000', '000111', '000110', '000101', '000100', - '000011', '000010', '000001', '000000', '111111', '111110', '111101', '111100', '111011', '111010', - '111001', '111000', '1101111', '1101110', '1101101', '1101100', '1101011', '1101010', '1101001', '1101000', - '1100111', '1100110', '1100101', '1100100', '1100011', '1100010', '1100001', '1100000', '1011111', '1011110', - '1011101', '1011100', '1011011', '1011010', '1011001', '1011000', '1010111', '1010110', '1010101', '1010100', - '1010011', '1010010', '1010001', '1010000'] - - # 1, 2, ... 15 - countOrIndexHiCode = [ - '001', '000', '110', '101', '100', '0111', '0101', '1111', '1110', '01101', - '01001', '01000', '011001', '0110001', '0110000'] - - assert 0 <= n < 16 * 64 - code = countOrIndexLoCodes[n % 64] - if n < 64: - code += '0' - else: - code += '1' + countOrIndexHiCode[n // 64 - 1] - return code - - -def get_duration_code(duration): - # 1, 2, ... 30 - secondsCode = [ - '0011', '0001', '0000', '1111', '1101', '1100', '1011', '1001', '1000', '01110', - '01101', '01100', '01011', '01001', '01000', '00101', '11101', '11100', '10101', '011111', - '011110', '010101', '001001', '001000', '101001', '0101001', '0101000', '1010001', '10100001', '10100000' ] - - # 0, 0.1, ... 1.0 - deciSecondsCode = [ - '110', '100', '101', '0110', '0111', '111', '0100', '0101', '0010', '0011', '000' ] - - # 0, 1, ..., 99 - millisecondsCode = [ - '1111010', '1111011', '1111000', '1111001', '1111110', '1111111', '1111100', '1111101', '1110010', '1110011', - '11001', '1110000', '1110001', '1110110', '1110111', '1110100', '1110101', '0101010', '0101011', '0101000', - '10010', '0101001', '0101110', '0101111', '0101100', '0101101', '0100010', '0100011', '0100000', '0100001', - '10011', '0100110', '0100111', '0100100', '0100101', '0111010', '0111011', '0111000', '0111001', '0111110', - '10000', '0111111', '0111100', '0111101', '0110010', '0110011', '0110000', '0110001', '0110110', '0110111', - '10001', '0110100', '0110101', '0001010', '0001011', '0001000', '0001001', '0001110', '0001111', '0001100', - '10110', '0001101', '0000010', '0000011', '0000000', '0000001', '0000110', '0000111', '0000100', '0000101', - '10111', '0011010', '0011011', '0011000', '0011001', '0011110', '0011111', '0011100', '0011101', '0010010', - '10100', '0010011', '0010000', '0010001', '0010110', '0010111', '0010100', '0010101', '1101010', '1101011', - '10101', '1101000', '1101001', '1101110', '1101111', '1101100', '1101101', '1100010', '1100011', '110000' ] - - # 10, 20, ... 990 - microsecondsCode = [ - '110111100', '10010', '110111101', '10011', '1101111110', '10000', '1101111111', '10001', '1101111100', '10110', - '1101111101', '10111', '110110010', '10100', '110110011', '10101', '110110000', '001010', '110110001', '001011', - '110110110', '001000', '110110111', '001001', '110110100', '001110', '110110101', '001111', '110011010', '001100', - '110011011', '001101', '110011000', '000010', '110011001', '000011', '110011110', '000000', '110011111', '000001', - '110011100', '000110', '110011101', '000111', '110010010', '000100', '110010011', '000101', '110010000', '011010', - '110010001', '011011', '110010110', '011000', '110010111', '011001', '110010100', '011110', '110010101', '011111', - '110101010', '011100', '110101011', '011101', '110101000', '010010', '110101001', '010011', '110101110', '010000', - '110101111', '010001', '110101100', '010110', '110101101', '010111', '110100010', '010100', '110100011', '010101', - '110100000', '111010', '110100001', '111011', '110100110', '111000', '110100111', '111001', '110100100', '111110', - '110100101', '111111', '110111010', '111100', '110111011', '111101', '110111000', '11000', '110111001' ] - - duration_dus = int(round(np.float32(duration) * np.float32(100000))) # [deca us] - if print_cfg: - print('duration: ', duration_dus) - - dus = duration_dus # [deca us] - s = dus // 100000 # 0, 1, ... 30 [s] - ms = (dus % 100000) // 100 # 0, 1, ... 999 [ms] - dus = (dus % 100) # 0, 1, ... 99 [deca us] - ds = ms // 100 # 0, 1, ... 9 [deci s] - ms = ms % 100 # 0, 1, ... 99 [ms] - if s >= 1 and ds == 0: - s -= 1 - ds = 10 # 0, 1, ... 10 [deci s] - - assert 0 <= s <= 30 - assert 0 <= ds <= 10 - assert 0 <= ms <= 99 - assert 0 <= dus <= 99 - assert duration_dus == s * 100000 + ds * 10000 + ms * 100 + dus - - code = deciSecondsCode[ds] - if ms > 0 or dus > 0: - code += '1' + millisecondsCode[ms] - if dus > 0: - code += '1' + microsecondsCode[dus - 1] - else: - code += '0' - else: - code += '0' - if s > 0: - # long range mode not implemented - code += '1' + secondsCode[s - 1] - else: - code += '0' - - return code - - -def get_frequency_code(f): - frequencyCode = { - 16 : '100011', 20 : '001110', 25 : '001111', 31.5 : '1001', 40 : '001100', - 50 : '001101', 63 : '0000', 80 : '011010', 100 : '011011', 125 : '0001', - 160 : '011000', 200 : '011001', 250 : '1110', 315 : '011110', 400 : '011111', - 500 : '1111', 630 : '011100', 800 : '011101', 1000 : '1100', 1250 : '010010', - 1600 : '010011', 2000 : '1101', 2500 : '010000', 3150 : '010001', 4000 : '1010', - 5000 : '010110', 6300 : '010111', 8000 : '1011', 10000: '010100', 12500: '010101', - 16000: '0010', 20000: '10000', 25000: '10001010', 31500: '10001011', 40000: '1000100', } - - assert 16 <= f <= 40000 - if f in frequencyCode.keys(): - if print_cfg: - print('frequency:', f) - return frequencyCode[f] + '0' - else: - # exact frequency not found, use frequency refinement to aproximate - # (largest relative deviation seen for range(16, 40000) was 0.006818) - # find frequencies enveloping f - f_low = 16 - f_high = 40000 - for key in frequencyCode.keys(): - if key < f: - f_low = max(f_low, key) - else: - f_high = min(f_high, key) - refinement = round(51 * math.log(f / f_low, 2)) - 1 - if refinement >= 16: - # choose next higer frequency - if print_cfg: - print('frequency:', list(frequencyCode)[f_high]) - return frequencyCode[f_high] + '0' - else: - if print_cfg: - print('frequency:', list(frequencyCode)[f_low], ', refined: ', f_low * 2 ** ((refinement + 1) / 51)) - return frequencyCode[f_low] + '1' + format(refinement, '04b') - - -def get_frequency_hop_code(index): - assert 0 <= index < 9 - return [ - '1100', # 2^(1/8) - '1101', # 2^(1/7) - '0010', # 2^(1/6) - '0011', # 2^(1/5) - '0000', # 2^(1/4) - '01', # 2^(1/3) - '0001', # 2^(1/2) - '10', # 2^1 - '111'][index] # 2^2 - - -def get_dsr_code(dsr): - # -150.0, -149.0, ... -10.0 - dsrCode = [ - '10001100', '10001101', '100011110', '100011111', '100011100', '100011101', '10000010', '10000011', '10000000', '10000001', - '10000110', '10000111', '10000100', '10000101', '011101010', '011101011', '011101000', '011101001', '011101110', '011101111', - '011101100', '011101101', '011100010', '011100011', '011100000', '011100001', '011100110', '011100111', '011100100', '011100101', - '011111010', '011111011', '011111000', '011111001', '011111110', '011111111', '011111100', '011111101', '011110010', '011110011', - '011110000', '011110001', '011110110', '011110111', '011110100', '011110101', '011001010', '011001011', '011001000', '011001001', - '011001110', '011001111', '011001100', '011001101', '011000010', '011000011', '011000000', '011000001', '011000110', '011000111', - '011000100', '011000101', '011011010', '011011011', '011011000', '011011001', '011011110', '011011111', '011011100', '011011101', - '010100', '010101', '100110', '100111', '100100', '100101', '111010', '111011', '111000', '111001', - '111110', '111111', '111100', '111101', '110010', '110011', '110000', '110001', '110110', '110111', - '110100', '110101', '001010', '001011', '001000', '001001', '001110', '001111', '001100', '001101', - '000010', '000011', '000000', '000001', '000110', '000111', '000100', '000101', '101010', '101011', - '101000', '101001', '101110', '101111', '101100', '101101', '010010', '010011', '010000', '010001', - '010110', '011010010', '011010011', '011010000', '011010001', '011010110', '011010111', '011010100', '011010101', '010111010', - '010111011', '010111000', '010111001', '010111110', '010111111', '010111100', '010111101', '10001010', '10001011', '10001000', - '10001001' ] - - d = math.log10(dsr) * 10 - d = round(d + 150) - assert 0 <= d <= 140 - if print_cfg: - print('dsr:', np.float32(np.power(np.float32(10), np.float32(d - 150) / np.float32(10)))) # C decoder uses float precision math - return dsrCode[d] - - -class fgdMethod(Enum): - Individual_Frequencies = '00' - Start_Hop_Amount = '01' - Default_Banding = '10' - - -# apply function to elements of list and concatenate the resulting strings -def concatenate(function, data): - return ''.join([function(d) for d in data]) - - -def test(): - # generate binary output which can be compared with the Matlab implementation output - string = '' - - # count or index encoding - string += concatenate(get_count_or_index_code, [n for n in range(0, 16 * 64)]) - - # duration encoding - string += concatenate(get_duration_code, [d / 1000 for d in range(0, 30 * 1000)]) - string += concatenate(get_duration_code, [d / 10000 for d in range(0, 30 * 1000)]) - string += concatenate(get_duration_code, [d / 100000 for d in range(0, 30 * 1000)]) - - # frequency encoding - string += concatenate(get_frequency_code, - [16 , 20 , 25 , 31.5 , 40 , 50 , 63 , 80 , 100 , 125 , - 160 , 200 , 250 , 315 , 400 , 500 , 630 , 800 , 1000 , 1250 , - 1600 , 2000 , 2500 , 3150 , 4000 , 5000 , 6300 , 8000, 10000, 12500, - 16000, 20000, 25000, 31500, 40000]) - - # frequency hop encoding - string += concatenate(get_frequency_hop_code, [index for index in range(0, 9)]) - - # DSR encoding - string += concatenate(get_dsr_code, [math.pow(10, dsr / 10) for dsr in range(-150, -10 + 1)]) - - data = bitarray(string, endian='big') - - file = open('test_python.dat', 'wb') - data.tofile(file) - file.close() - - -def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): - # based on config_renderer.cfg - # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values - data = bitarray( - get_count_or_index_code(1) # fgdNrGrids - + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.1) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 1.3622, 1.4486, 1.3168, 1.5787, 1.4766, 1.3954, 1.2889, 1.3462, 1.0759, 1.0401, - 1.0970, 1.0850, 1.0910, 1.0404, 1.0499, 1.0699, 1.1028, 1.1714, 1.1027, 1.0666, - 1.0550, 1.0553, 1.0521, 1.0569, 1.0421, 0.97822, 0.80487, 0.75944, 0.71945, 0.61682, - 0.60031 ]) - - + concatenate(get_dsr_code, # DSR - [ 1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, 8.9719e-08, 1.902e-07, - 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, - 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, - 2.6267e-08 ]) - - , endian='big') - - file = open('rend_config_renderer.dat', 'wb') - data.tofile(file) - file.close() - - -def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg(): - # based on config_hospital_patientroom.cfg - # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values - data = bitarray( - get_count_or_index_code(1) # fgdNrGrids - + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.08163) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 0.81275, 0.61888, 0.45111, 0.34672, 0.46683, 0.53987, 0.61874, 0.70291, 0.66657, 0.73037, - 0.75090, 0.72470, 0.75486, 0.75857, 0.76844, 0.74999, 0.77622, 0.78227, 0.77441, 0.74688, - 0.73521, 0.73782, 0.71928, 0.71708, 0.71465, 0.60592, 0.52031, 0.51768, 0.52102, 0.37956, - 0.30786 ]) - - + concatenate(get_dsr_code, # DSR - [ 0.000219780698, 0.000205275364, 7.18711e-05, 4.5745977e-05, 8.381106e-06, 6.884964e-06, 6.532765e-06, 8.296928e-06, 1.0005793e-05, 9.191127e-06, - 8.635287e-06, 9.627704e-06, 1.0806965e-05, 1.0041916e-05, 7.77047e-06, 9.695803e-06, 9.594324e-06, 8.32215e-06, 7.564813e-06, 6.215871e-06, - 6.379496e-06, 6.358105e-06, 6.6696e-06, 6.369334e-06, 6.378474e-06, 3.339913e-06, 3.129318e-06, 2.892564e-06, 6.00202e-07, 3.40124e-07, - 3.37705e-07 ]) - - , endian='big') - - file = open('rend_config_hospital_patientroom.dat', 'wb') - data.tofile(file) - file.close() - - -def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): - # based on config_recreation.cfg - # note that because of encoding, resolution is lost and behaviour may not be bit-exact compared to .cfg file based values - data = bitarray( - get_count_or_index_code(1) # fgdNrGrids - + fgdMethod.Individual_Frequencies.value # fgdMethod - + get_count_or_index_code(31) # fgdNrBands - - - + concatenate(get_frequency_code, # fgdCenterFreq - [ 20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, - 200.0, 250.0, 315.0, 400.0, 500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, - 2000.0, 2500.0, 3150.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 12500.0, 16000.0, - 20000.0 ]) - - + get_count_or_index_code(1) # AcousticEnvCount - + get_id_code(0) # ID - + get_count_or_index_code(0) # FreqGridID - + get_duration_code(0.43031) # (input)Predelay - - + concatenate(get_duration_code, # RT60 - [ 4.51916, 4.89553, 4.83276, 5.00198, 5.34468, 5.76026, 6.36818, 6.95503, 7.27557, 7.62559, - 8.08892, 8.16002, 8.13900, 8.17919, 8.16280, 8.46226, 9.61806, 9.93048, 9.81353, 8.59340, - 8.38885, 8.36823, 6.51845, 3.76089, 3.75374, 3.57451, 1.28724, 1.22174, 1.22448, 1.71631, - 2.14343 ]) - - + concatenate(get_dsr_code, # DSR - [ 9.18578e-07, 7.63803e-07, 9.23183e-07, 1.048656e-06, 1.61449e-06, 2.13745e-06, 2.854805e-06, 3.979651e-06, 6.229977e-06, 7.782421e-06, - 9.091754e-06, 8.545798e-06, 7.482083e-06, 7.351071e-06, 7.947039e-06, 8.152676e-06, 5.201189e-06, 4.744103e-06, 4.397069e-06, 3.017449e-06, - 2.958383e-06, 2.725911e-06, 7.94912e-07, 6.20198e-07, 5.71181e-07, 5.5546e-08, 1.3987e-08, 1.338e-08, 1.322e-09, 1.3e-11, - 4e-12 ]) - - , endian='big') - - file = open('rend_config_recreation.dat', 'wb') - data.tofile(file) - file.close() - - -#test() -generate_reverb_payload_equivalent_to_rend_config_renderer_cfg() -generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() -generate_reverb_payload_equivalent_to_rend_config_recreation_cfg() -- GitLab From 65d7ce3950e593b6dc305576f46491827741b839 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Tue, 13 Jun 2023 13:21:25 +0530 Subject: [PATCH 0164/1418] Made correction in SID MD bits calculation --- lib_com/options.h | 2 +- lib_dec/ivas_qmetadata_dec.c | 5 +++++ lib_enc/ivas_qmetadata_enc.c | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index aafa43e9af..2f683d856b 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,7 +180,7 @@ #define MASA_PREREND /* Nokia: Contribution 42: Support for IVAS_rend to merge MASA + other format to MASA */ #define ISM_25k6_HZ_CORE /* VA: issue 540: 1ISM 48 kbps - change ACELP/TCX 16 kHz core to TCX only 25.6 kHz core */ - +#define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_528_ISM_MD_FILE_TOO_SHORT /* VA: issue 528: ISM Metadata file too short */ diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index a9fc4693f0..ccb0b69844 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -1187,8 +1187,13 @@ int16_t ivas_qmetadata_dec_sid_decode( if ( ivas_format == SBA_FORMAT ) { +#ifndef FIX_137_SID_MD_BITS /* TODO: still use old sid frame size to keep bitexactness */ metadata_sid_bits = (int16_t) ( 5000 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1; /* -1 for inactive mode header bit*/ +#else + metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1; /* -1 for inactive mode header bit*/ + +#endif } else { diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index ad34d810c1..c21463413d 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -985,8 +985,13 @@ void ivas_qmetadata_enc_sid_encode( if ( ivas_format == SBA_FORMAT ) { +#ifndef FIX_137_SID_MD_BITS /* TODO: still use old sid frame size to keep bitexactness */ metadata_sid_bits = (int16_t) ( 5000 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1; /* -1 for inactive mode header bit*/ +#else + metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1; /* -1 for inactive mode header bit*/ + +#endif } else { -- GitLab From 3b64b06c035bc2a0607456ced088a7b5b62e1fee Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 13 Jun 2023 11:23:59 +0300 Subject: [PATCH 0165/1418] Fix build with switch MASA_AND_OBJECTS inactive --- lib_dec/ivas_ism_metadata_dec.c | 1 + lib_dec/ivas_masa_dec.c | 6 +++++- lib_enc/ivas_masa_enc.c | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 4b154a22cd..8be626576b 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -174,6 +174,7 @@ ivas_error ivas_ism_metadata_dec( int16_t md_diff_flag[MAX_NUM_OBJECTS]; ivas_error error; + push_wmops( "ism_meta_dec" ); diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 6c0606de0f..310781c0c7 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -814,7 +814,11 @@ static ivas_error ivas_masa_dec_config( ivas_masa_set_coding_config(&(hMasa->config), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, (st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA)); #endif #ifdef HR_METADATA - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) +#ifdef MASA_AND_OBJECTS + if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) +#else + if ((st_ivas->ivas_format == MASA_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k) +#endif { hMasa->config.mergeRatiosOverSubframes = 0; /* initialize spherical grid */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 4e2670ff9f..6db0dd1a0c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -317,7 +317,11 @@ ivas_error ivas_masa_encode( } #ifdef HR_METADATA +#ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ivas_total_brate >= IVAS_384k ) +#else + if ( (ivas_format == MASA_FORMAT) && ivas_total_brate >= IVAS_384k ) +#endif { hMasa->config.mergeRatiosOverSubframes = 0; } -- GitLab From 7f6cdce89e8c43b9927cb3279553c5d726b3c94f Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 13 Jun 2023 11:58:41 +0300 Subject: [PATCH 0166/1418] Fix DIRAC_MAX_ANA_CHANS to FOA_CHANNELS within OMASA. --- lib_enc/ivas_omasa_enc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 46b7c0418b..00f61fca4a 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -56,9 +56,9 @@ static void ivas_omasa_energy_and_ratio_est( OMASA_ENC_HANDLE hOMasa, MASA_ENCOD static void ivas_omasa_dmx( float data_in_f[][L_FRAME48k], float data_out_f[][L_FRAME48k], const int16_t input_frame, const int16_t nchan_transport, const int16_t nchan_ism, ISM_METADATA_HANDLE hIsmMeta[], float prev_gains[][MASA_MAX_TRANSPORT_CHANNELS], const float interpolator[L_FRAME48k] ); -static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); +static void computeIntensityVector_enc( const int16_t *band_grouping, float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ); -static void computeReferencePower_omasa( const int16_t *band_grouping, float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], float *reference_power, const int16_t enc_param_start_band, const int16_t num_freq_bands ); +static void computeReferencePower_omasa( const int16_t *band_grouping, float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], float *reference_power, const int16_t enc_param_start_band, const int16_t num_freq_bands ); /*--------------------------------------------------------------------------* @@ -753,8 +753,8 @@ static void ivas_omasa_param_est_enc( int16_t l_ts; float Chnl_RealBuffer[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; float Chnl_ImagBuffer[MCMASA_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; - float Foa_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; - float Foa_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX]; + float Foa_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX]; + float Foa_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX]; float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float direction_vector[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS]; float diffuseness_vector[MASA_FREQUENCY_BANDS]; @@ -1057,8 +1057,8 @@ static void ivas_omasa_dmx( static void computeIntensityVector_enc( const int16_t *band_grouping, - float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], - float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], + float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], + float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], const int16_t num_frequency_bands, float intensity_real[DIRAC_NUM_DIMS][MASA_FREQUENCY_BANDS] ) { @@ -1095,8 +1095,8 @@ static void computeIntensityVector_enc( static void computeReferencePower_omasa( const int16_t *band_grouping, /* i : Band grouping for estimation */ - float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ - float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ + float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ + float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ float *reference_power, /* o : Estimated power */ const int16_t enc_param_start_band, /* i : first band to process */ const int16_t num_freq_bands /* i : Number of frequency bands */ @@ -1111,7 +1111,7 @@ static void computeReferencePower_omasa( brange[1] = band_grouping[i + enc_param_start_band + 1]; reference_power[i] = 0; - for ( ch_idx = 0; ch_idx < DIRAC_MAX_ANA_CHANS; ch_idx++ ) + for ( ch_idx = 0; ch_idx < FOA_CHANNELS; ch_idx++ ) { /* abs()^2 */ for ( j = brange[0]; j < brange[1]; j++ ) -- GitLab From 39836d9722636edf23dbb48647054b5e4ffe6044 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 11:18:52 +0200 Subject: [PATCH 0167/1418] fix crash in bitrate switching --- lib_enc/ivas_omasa_enc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 00f61fca4a..24d1cfe140 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -265,7 +265,7 @@ ivas_error ivas_omasa_enc_config( { reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, #ifdef IND_LIST_DYN - st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot + st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->nb_bits_tot #else st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->next_ind #endif @@ -1094,12 +1094,12 @@ static void computeIntensityVector_enc( static void computeReferencePower_omasa( - const int16_t *band_grouping, /* i : Band grouping for estimation */ + const int16_t *band_grouping, /* i : Band grouping for estimation */ float Cldfb_RealBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : Real part of input signal */ float Cldfb_ImagBuffer[FOA_CHANNELS][CLDFB_NO_CHANNELS_MAX], /* i : Imag part of input signal */ - float *reference_power, /* o : Estimated power */ - const int16_t enc_param_start_band, /* i : first band to process */ - const int16_t num_freq_bands /* i : Number of frequency bands */ + float *reference_power, /* o : Estimated power */ + const int16_t enc_param_start_band, /* i : first band to process */ + const int16_t num_freq_bands /* i : Number of frequency bands */ ) { int16_t brange[2]; -- GitLab From e380832aff0c2fda4b0341138715018a6bfc5baa Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 11:23:26 +0200 Subject: [PATCH 0168/1418] clang-format --- lib_dec/ivas_dirac_dec.c | 8 ++-- lib_dec/ivas_masa_dec.c | 44 ++++++++++---------- lib_enc/ivas_ism_metadata_enc.c | 4 +- lib_enc/ivas_masa_enc.c | 4 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 3 +- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index fbdd9f76f5..4796b15788 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -3784,7 +3784,7 @@ static void initDiffuseResponses( #ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) #else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) #endif { mvr2r( diffuse_response_CICP6, diffuse_response_function, num_channels ); @@ -3792,7 +3792,7 @@ static void initDiffuseResponses( #ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_2 ) && ( num_channels == 7 ) ) #else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) #endif { mvr2r( diffuse_response_CICP14, diffuse_response_function, num_channels ); @@ -3800,7 +3800,7 @@ static void initDiffuseResponses( #ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) #else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) #endif { mvr2r( diffuse_response_CICP16, diffuse_response_function, num_channels ); @@ -3808,7 +3808,7 @@ static void initDiffuseResponses( #ifdef MASA_AND_OBJECTS else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) #else - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) #endif { if ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 310781c0c7..633e4edfb2 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -314,25 +314,25 @@ ivas_error ivas_masa_decode( /* Remove already read bits from the bit budget */ hQMetaData->metadata_max_bits -= *nb_bits_read; #ifdef MASA_AND_OBJECTS - if (st_ivas->ivas_format == MASA_ISM_FORMAT) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if (st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { - if (st_ivas->hDirAC != NULL) + if ( st_ivas->hDirAC != NULL ) { - *nb_bits_read += ivas_decode_masaism_metadata(hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, - st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length); + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hDirAC->dirac_bs_md_write_idx, st_ivas->hDirAC->dirac_md_buffer_length ); - for (obj = 0; obj <= st_ivas->nchan_ism; obj++) + for ( obj = 0; obj <= st_ivas->nchan_ism; obj++ ) { - if (st_ivas->hMasaIsmData->idx_separated_ism == obj) + if ( st_ivas->hMasaIsmData->idx_separated_ism == obj ) { int16_t sf; int16_t meta_write_index; - for (sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++) + for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { - meta_write_index = (st_ivas->hDirAC->dirac_bs_md_write_idx + sf) % st_ivas->hDirAC->dirac_md_buffer_length; + meta_write_index = ( st_ivas->hDirAC->dirac_bs_md_write_idx + sf ) % st_ivas->hDirAC->dirac_md_buffer_length; st_ivas->hMasaIsmData->azimuth_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->azimuth_ism[obj][meta_write_index]; st_ivas->hMasaIsmData->elevation_separated_ism[meta_write_index] = st_ivas->hMasaIsmData->elevation_ism[obj][meta_write_index]; } @@ -341,8 +341,8 @@ ivas_error ivas_masa_decode( } else { - *nb_bits_read += ivas_decode_masaism_metadata(hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, - st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, 0, MAX_PARAM_SPATIAL_SUBFRAMES); + *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, + st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, 0, MAX_PARAM_SPATIAL_SUBFRAMES ); } } } @@ -392,10 +392,10 @@ ivas_error ivas_masa_decode( #endif #ifdef MASA_AND_OBJECTS - if (st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { /* Modify spatial metadata based on the MASA-to-total energy ratios */ - modify_masa_energy_ratios(hQMetaData); + modify_masa_energy_ratios( hQMetaData ); } #endif @@ -791,33 +791,33 @@ static ivas_error ivas_masa_dec_config( #ifdef MASA_AND_OBJECTS ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; ism_total_brate = 0; - if (st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && (st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ)) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { - for (i = 0; i < st_ivas->nSCE; i++) + for ( i = 0; i < st_ivas->nSCE; i++ ) { ism_total_brate += st_ivas->hSCE[i]->element_brate; } } - ivas_masa_set_elements(ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate); + ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); - if (st_ivas->ivas_format == MASA_ISM_FORMAT) + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - ivas_masa_set_coding_config(&(hMasa->config), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE); + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hCPE[0]->element_brate, st_ivas->nchan_transport, MC_MODE_NONE ); } else { - ivas_masa_set_coding_config(&(hMasa->config), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, (st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA)); + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); } #else - ivas_masa_set_elements(st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE); - ivas_masa_set_coding_config(&(hMasa->config), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, (st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA)); + ivas_masa_set_elements( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &st_ivas->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE ); + ivas_masa_set_coding_config( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ); #endif #ifdef HR_METADATA #ifdef MASA_AND_OBJECTS if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) #else - if ((st_ivas->ivas_format == MASA_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k) + if ( ( st_ivas->ivas_format == MASA_FORMAT ) && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_512k ) #endif { hMasa->config.mergeRatiosOverSubframes = 0; diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 457ba7bbd4..734a0cbd14 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -252,7 +252,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS else if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC ) #else - else if ( ism_mode == ISM_MODE_DISC ) + else if ( ism_mode == ISM_MODE_DISC ) #endif { if ( hIsmMeta[ch]->ism_metadata_flag == 1 ) @@ -897,7 +897,7 @@ ivas_error ivas_ism_metadata_enc_create( } else { - if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_config( st_ivas->hEncoderConfig->ivas_total_brate, nchan_transport, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 6db0dd1a0c..5260e097dc 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -69,7 +69,7 @@ static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_H static void reduce_metadata_further( MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hqmetadata, const IVAS_FORMAT ivas_format ); #endif -static void average_masa_metadata(MASA_METADATA_FRAME* masaMetadata, float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] +static void average_masa_metadata( MASA_METADATA_FRAME *masaMetadata, float energy[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] #ifdef HR_METADATA , const SPHERICAL_GRID_DATA *sphGrid @@ -320,7 +320,7 @@ ivas_error ivas_masa_encode( #ifdef MASA_AND_OBJECTS if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) && ivas_total_brate >= IVAS_384k ) #else - if ( (ivas_format == MASA_FORMAT) && ivas_total_brate >= IVAS_384k ) + if ( ( ivas_format == MASA_FORMAT ) && ivas_total_brate >= IVAS_384k ) #endif { hMasa->config.mergeRatiosOverSubframes = 0; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 6401243fb4..00f86731e5 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -826,7 +826,6 @@ static void ivas_dirac_dec_decorrelate_slot( } - static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( Decoder_Struct *st_ivas, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], @@ -958,7 +957,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Determine target covariance matrix containing target binaural properties */ for ( bin = 0; bin < nBins; bin++ ) { - float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ + float diffuseness = 1.0f; /* ratio1 and ratio2 are subtracted from diffuseness further below */ #ifdef MASA_AND_OBJECTS float diffusenessValForDecorrelationReduction = 1.0f; float diffEneValForDecorrelationReduction; -- GitLab From 7b4ed8589c95fe2778ddd5234fea5ac79b7818ac Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 12:09:18 +0200 Subject: [PATCH 0169/1418] activate FIX_356_ISM_METADATA_SYNC; intorduce FIX_356_ISM_METADATA_SYNC_OMASA to temporarily keep BE in OMASA --- lib_com/options.h | 4 ++-- lib_dec/ivas_objectRenderer_internal.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7fa5e09a70..1fd31be0c5 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,8 +158,7 @@ #define FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING /* Eri: Fix incorrect use of stack variable used for channel aware config file */ #define COMBINED_FORMAT_SIGNALING /* VA: Introduce a signaling bit for combined format coding */ -/* Todo OMASA: This switch causes more difference for OMASA path. Thus, disabled for OMASA currently. Enable to get BE to main. */ -/*#define FIX_356_ISM_METADATA_SYNC*/ /* Eri: issue 356: Metadata out-of-synch for -no_delay_comp */ +#define FIX_356_ISM_METADATA_SYNC /* Eri: issue 356: Metadata out-of-synch for -no_delay_comp */ #define FIX_446_STEREO_DMX_CRASH /* FhG: fix discrepancy with EVS code that could cause crashes in rare cases */ @@ -230,6 +229,7 @@ #define OMASA_ENERGIES #define FIX_OMASA_STEREO_SWITCHING /* VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps */ #define FIX_OMASA_BRSW /* Nokia + VA: Fix missing init of OMASA metadata delay buffers, brsw-related init fixes */ +#define FIX_356_ISM_METADATA_SYNC_OMASA #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 8d5f8e8772..21093ff266 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -114,6 +114,13 @@ ivas_error ivas_td_binaural_renderer( ism_md_subframe_update = 2; } +#ifdef FIX_356_ISM_METADATA_SYNC_OMASA + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + ism_md_subframe_update = 0; + } +#endif + return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, -- GitLab From af411f1128d9128ccc903b9e5fc865966af87e5a Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Tue, 13 Jun 2023 12:33:01 +0200 Subject: [PATCH 0170/1418] make .cfg files support current style roomAcoustics settings as well as the new style reverbFile setting --- ...generate_acoustic_environments_metadata.py | 26 ++++++++--------- .../rend_config_hospital_patientroom.cfg | 26 +++++++++++++++++ scripts/testv/rend_config_recreation.cfg | 26 +++++++++++++++++ scripts/testv/rend_config_renderer.cfg | 29 +++++++++++++++++++ 4 files changed, 93 insertions(+), 14 deletions(-) diff --git a/scripts/reverb/generate_acoustic_environments_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py index 9fc9c6a3ca..5ac095e5a1 100644 --- a/scripts/reverb/generate_acoustic_environments_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -398,10 +398,10 @@ def generate_reverb_payload_equivalent_to_rend_config_renderer_cfg(): 0.60031 ]) + concatenate(get_dsr_code, # DSR - [ 1.8811e-08, 2.1428e-08, 1.3972e-08, 1.51e-08, 1.287e-08, 1.8747e-08, 2.413e-08, 3.9927e-08, 8.9719e-08, 1.902e-07, - 3.702e-07, 6.1341e-07, 7.1432e-07, 6.5331e-07, 4.6094e-07, 5.4683e-07, 7.0134e-07, 6.856e-07, 7.114e-07, 6.9604e-07, - 5.2939e-07, 5.699e-07, 6.1773e-07, 5.7488e-07, 4.7748e-07, 2.7213e-07, 1.3681e-07, 1.0941e-07, 6.2001e-08, 2.8483e-08, - 2.6267e-08 ]) + [ 1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, + 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, + 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, + 2.511887e-08 ]) + '0' # hasEarlyReflections , endian='big') @@ -555,11 +555,10 @@ def generate_reverb_payload_equivalent_to_rend_config_hospital_patientroom_cfg() 0.30786 ]) + concatenate(get_dsr_code, # DSR - [ 0.000219780698, 0.000205275364, 7.18711e-05, 4.5745977e-05, 8.381106e-06, 6.884964e-06, 6.532765e-06, 8.296928e-06, 1.0005793e-05, 9.191127e-06, - 8.635287e-06, 9.627704e-06, 1.0806965e-05, 1.0041916e-05, 7.77047e-06, 9.695803e-06, 9.594324e-06, 8.32215e-06, 7.564813e-06, 6.215871e-06, - 6.379496e-06, 6.358105e-06, 6.6696e-06, 6.369334e-06, 6.378474e-06, 3.339913e-06, 3.129318e-06, 2.892564e-06, 6.00202e-07, 3.40124e-07, - 3.37705e-07 ]) - + [ 0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, 7.943284e-06, 6.3095763e-06, 6.3095763e-06, 7.943284e-06, 1e-05, 1e-05, + 7.943284e-06, 1e-05, 1e-05, 1e-05, 7.943284e-06, 1e-05, 1e-05, 7.943284e-06, 7.943284e-06, 6.3095763e-06, + 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, 6.3095763e-07, 3.1622776e-07, + 3.1622776e-07 ]) + '0' # hasEarlyReflections , endian='big') @@ -597,11 +596,10 @@ def generate_reverb_payload_equivalent_to_rend_config_recreation_cfg(): 2.14343 ]) + concatenate(get_dsr_code, # DSR - [ 9.18578e-07, 7.63803e-07, 9.23183e-07, 1.048656e-06, 1.61449e-06, 2.13745e-06, 2.854805e-06, 3.979651e-06, 6.229977e-06, 7.782421e-06, - 9.091754e-06, 8.545798e-06, 7.482083e-06, 7.351071e-06, 7.947039e-06, 8.152676e-06, 5.201189e-06, 4.744103e-06, 4.397069e-06, 3.017449e-06, - 2.958383e-06, 2.725911e-06, 7.94912e-07, 6.20198e-07, 5.71181e-07, 5.5546e-08, 1.3987e-08, 1.338e-08, 1.322e-09, 1.3e-11, - 4e-12 ]) - + [ 1e-06, 7.943284e-07, 1e-06, 1e-06, 1.5848925e-06, 1.9952631e-06, 3.1622776e-06, 3.9810707e-06, 6.3095763e-06, 7.943284e-06, + 1e-05, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 5.01187e-06, 5.01187e-06, 3.9810707e-06, 3.1622776e-06, + 3.1622776e-06, 2.511887e-06, 7.943284e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-08, 1.2589251e-08, 1.2589251e-08, 1.2589265e-09, 1.2589266e-11, + 3.981075e-12 ]) + '0' # hasEarlyReflections , endian='big') diff --git a/scripts/testv/rend_config_hospital_patientroom.cfg b/scripts/testv/rend_config_hospital_patientroom.cfg index 75bfdf910f..07b8614d5d 100644 --- a/scripts/testv/rend_config_hospital_patientroom.cfg +++ b/scripts/testv/rend_config_hospital_patientroom.cfg @@ -1,2 +1,28 @@ +[roomAcoustics] +nBands = 31; + +fc = [20.0, 25.0, 31.5, 40.0, + 50.0, 63.0, 80.0, 100.0, + 125.0, 160.0, 200.0, 250.0, + 315.0, 400.0, 500.0, 630.0, + 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, + 5000.0, 6300.0, 8000.0, 10000.0, + 12500.0, 16000.0, 20000.0]; + +rt60 = [0.81275, 0.61888, 0.45111, 0.34672, 0.46683, 0.53987, 0.61874, 0.70291, 0.66657, 0.73037, + 0.75090, 0.72470, 0.75486, 0.75857, 0.76844, 0.74999, 0.77622, 0.78227, 0.77441, 0.74688, + 0.73521, 0.73782, 0.71928, 0.71708, 0.71465, 0.60592, 0.52031, 0.51768, 0.52102, 0.37956, + 0.30786]; + +dsr = [0.00019952621, 0.00019952621, 7.9432844e-05, 5.0118702e-05, 7.943284e-06, 6.3095763e-06, 6.3095763e-06, 7.943284e-06, 1e-05, 1e-05, + 7.943284e-06, 1e-05, 1e-05, 1e-05, 7.943284e-06, 1e-05, 1e-05, 7.943284e-06, 7.943284e-06, 6.3095763e-06, + 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 6.3095763e-06, 3.1622776e-06, 3.1622776e-06, 3.1622776e-06, 6.3095763e-07, 3.1622776e-07, + 3.1622776e-07]; + + +acousticPreDelay = 0.016; +inputPreDelay = 0.08163; + [general] reverbFile = rend_config_hospital_patientroom.dat; diff --git a/scripts/testv/rend_config_recreation.cfg b/scripts/testv/rend_config_recreation.cfg index d91064856c..43c060eab6 100644 --- a/scripts/testv/rend_config_recreation.cfg +++ b/scripts/testv/rend_config_recreation.cfg @@ -1,2 +1,28 @@ +[roomAcoustics] +nBands = 31; + +fc = [20.0, 25.0, 31.5, 40.0, + 50.0, 63.0, 80.0, 100.0, + 125.0, 160.0, 200.0, 250.0, + 315.0, 400.0, 500.0, 630.0, + 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, + 5000.0, 6300.0, 8000.0, 10000.0, + 12500.0, 16000.0, 20000.0]; + +rt60 = [4.51916, 4.89553, 4.83276, 5.00198, 5.34468, 5.76026, 6.36818, 6.95503, 7.27557, 7.62559, + 8.08892, 8.16002, 8.13900, 8.17919, 8.16280, 8.46226, 9.61806, 9.93048, 9.81353, 8.59340, + 8.38885, 8.36823, 6.51845, 3.76089, 3.75374, 3.57451, 1.28724, 1.22174, 1.22448, 1.71631, + 2.14343]; + +dsr = [1e-06, 7.943284e-07, 1e-06, 1e-06, 1.5848925e-06, 1.9952631e-06, 3.1622776e-06, 3.9810707e-06, 6.3095763e-06, 7.943284e-06, + 1e-05, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 7.943284e-06, 5.01187e-06, 5.01187e-06, 3.9810707e-06, 3.1622776e-06, + 3.1622776e-06, 2.511887e-06, 7.943284e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-08, 1.2589251e-08, 1.2589251e-08, 1.2589265e-09, 1.2589266e-11, + 3.981075e-12]; + + +acousticPreDelay = 0.016; +inputPreDelay = 0.43031; + [general] reverbFile = rend_config_recreation.dat; diff --git a/scripts/testv/rend_config_renderer.cfg b/scripts/testv/rend_config_renderer.cfg index c0c3715f58..3cd52373da 100644 --- a/scripts/testv/rend_config_renderer.cfg +++ b/scripts/testv/rend_config_renderer.cfg @@ -1,2 +1,31 @@ +[roomAcoustics] +nBands = 31; + +fc = [20.0, 25.0, 31.5, 40.0, + 50.0, 63.0, 80.0, 100.0, + 125.0, 160.0, 200.0, 250.0, + 315.0, 400.0, 500.0, 630.0, + 800.0, 1000.0, 1250.0, 1600.0, + 2000.0, 2500.0, 3150.0, 4000.0, + 5000.0, 6300.0, 8000.0, 10000.0, + 12500.0, 16000.0, 20000.0]; + +rt60 = [1.3622, 1.4486, 1.3168, 1.5787, + 1.4766, 1.3954, 1.2889, 1.3462, + 1.0759, 1.0401, 1.0970, 1.0850, + 1.0910, 1.0404, 1.0499, 1.0699, + 1.1028, 1.1714, 1.1027, 1.0666, + 1.0550, 1.0553, 1.0521, 1.0569, + 1.0421, 0.97822, 0.80487, 0.75944, + 0.71945, 0.61682, 0.60031]; + +dsr = [1.9952632e-08, 1.9952632e-08, 1.2589251e-08, 1.5848926e-08, 1.2589251e-08, 1.9952632e-08, 2.511887e-08, 3.9810708e-08, 1e-07, 1.9952633e-07, + 3.981071e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, 5.01187e-07, 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 7.943284e-07, 6.3095763e-07, + 5.01187e-07, 6.3095763e-07, 6.3095763e-07, 6.3095763e-07, 5.01187e-07, 2.511887e-07, 1.2589251e-07, 1e-07, 6.309576e-08, 3.1622776e-08, + 2.511887e-08]; + +acousticPreDelay = 0.016; +inputPreDelay = 0.1; + [general] reverbFile = rend_config_renderer.dat; -- GitLab From 1d6ebb472f56cefd6eb65c789a4978c6a29adc0a Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 15:21:09 +0200 Subject: [PATCH 0171/1418] fix warnings --- lib_dec/ivas_dirac_output_synthesis_dec.c | 188 +++++++++++----------- lib_dec/ivas_init_dec.c | 7 +- lib_rend/ivas_objectRenderer.c | 44 ++--- lib_rend/lib_rend.c | 10 +- 4 files changed, 123 insertions(+), 126 deletions(-) diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 8de9c8539e..1c74fec901 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -625,119 +625,119 @@ void ivas_dirac_dec_output_synthesis_process_slot( } else // ( hDirAC->hConfig->dec_param_estim == TRUE ) if ( hDirAC->hConfig->dec_param_estim == TRUE ) - { + { - /* compute direct responses */ - ivas_dirac_dec_compute_directional_responses( hDirAC, - hVBAPdata, - NULL, + /* compute direct responses */ + ivas_dirac_dec_compute_directional_responses( hDirAC, + hVBAPdata, + NULL, #ifdef MASA_AND_OBJECTS - NULL, + NULL, #endif - azimuth, - elevation, - md_idx, - NULL, - sh_rot_max_order, - p_Rmat, - hodirac_flag ); - - if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) - { - ivas_dirac_dec_compute_gain_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); + azimuth, + elevation, + md_idx, + NULL, + sh_rot_max_order, + p_Rmat, + hodirac_flag ); + + if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) + { + ivas_dirac_dec_compute_gain_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); - v_multc( h_dirac_output_synthesis_state->direct_power_factor, - 0.25f, - h_dirac_output_synthesis_state->direct_power_factor, - num_freq_bands ); - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - 0.25f, - h_dirac_output_synthesis_state->diffuse_power_factor, - num_freq_bands ); + v_multc( h_dirac_output_synthesis_state->direct_power_factor, + 0.25f, + h_dirac_output_synthesis_state->direct_power_factor, + num_freq_bands ); + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + 0.25f, + h_dirac_output_synthesis_state->diffuse_power_factor, + num_freq_bands ); - /*Direct gain*/ - for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) - { - int16_t k; - if ( ch_idx != 0 ) + /*Direct gain*/ + for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) { - float a, b, c; - - /*Directonal sound gain nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) + int16_t k; + if ( ch_idx != 0 ) { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + float a, b, c; + + /*Directonal sound gain nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + } + for ( ; k < num_freq_bands; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + } } - for ( ; k < num_freq_bands; k++ ) + else { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); + /*Diffuseness modellling nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); + } + for ( ; k < num_freq_bands; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); + } } } - else + + /*Directional gain (panning)*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) { - /*Diffuseness modellling nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); - } - for ( ; k < num_freq_bands; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); - } + v_mult( h_dirac_output_synthesis_state->direct_power_factor, + &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], + aux_buf, + num_freq_bands ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + num_freq_bands ); } - } - /*Directional gain (panning)*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) - { - v_mult( h_dirac_output_synthesis_state->direct_power_factor, - &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], - aux_buf, - num_freq_bands ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - num_freq_bands ); - } + /*Diffuse gain*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) + { + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + hDirAC->diffuse_response_function[ch_idx], + aux_buf, + num_freq_bands_diff ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + num_freq_bands_diff ); + } - /*Diffuse gain*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) + return; + } + else { - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - hDirAC->diffuse_response_function[ch_idx], - aux_buf, - num_freq_bands_diff ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - num_freq_bands_diff ); + /* compute reference and diffuse power factor for this frame */ + ivas_dirac_dec_compute_power_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); } - - return; - } - else - { - /* compute reference and diffuse power factor for this frame */ - ivas_dirac_dec_compute_power_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); } - } diff_start_band = 0; if ( h_dirac_output_synthesis_params->use_onset_filters ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 6e730727cf..5d4b7812c0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -731,7 +731,11 @@ ivas_error ivas_init_decoder( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { +#ifdef MASA_AND_OBJECTS + int16_t i, n, k; +#else int16_t i, n; +#endif int16_t sce_id, cpe_id; int16_t numCldfbAnalyses, numCldfbSyntheses; int16_t granularity, n_channels_transport_jbm; @@ -743,6 +747,7 @@ ivas_error ivas_init_decoder( #ifdef MASA_AND_OBJECTS int32_t ism_total_brate; #endif + error = IVAS_ERR_OK; output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -1061,7 +1066,7 @@ ivas_error ivas_init_decoder( return error; } - int16_t k = 0; + k = 0; ism_total_brate = 0; while ( k < SIZE_IVAS_BRATE_TBL && ivas_total_brate != ivas_brate_tbl[k] ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1ffbeecec9..f9831d4ce5 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -275,13 +275,13 @@ ivas_error ivas_td_binaural_renderer_unwrap( #ifdef EXTERNAL_ORIENTATIONS const int16_t *enableCombinedOrientation, /* i : Combined orientation flag */ #else - const int16_t Opt_Headrotation, /* i : Head rotation flag */ + const int16_t Opt_Headrotation, /* i : Head rotation flag */ #endif - const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ - const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ + const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ + const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ const int16_t ism_md_subframe_update, /* i: Number of subframes to delay ism metadata to sync with audio */ - float *output[], /* i/o: SCE channels / Binaural synthesis */ - const int16_t output_frame /* i : output frame length */ + float *output[], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ ) { int16_t subframe_length; @@ -366,10 +366,10 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - float *output[], /* 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 */ - const int16_t ism_md_subframe_update /* Number of subframes to delay ism metadata to sync with audio */ + float *output[], /* 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 */ + const int16_t ism_md_subframe_update /* Number of subframes to delay ism metadata to sync with audio */ ) { int16_t i; @@ -470,8 +470,8 @@ 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 IVAS_FORMAT in_format, /* i : Format of input sources */ - const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ + const IVAS_FORMAT in_format, /* i : Format of input sources */ + const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { TDREND_DirAtten_t *DirAtten_p; @@ -552,13 +552,13 @@ void TDREND_Update_listener_orientation( #ifdef EXTERNAL_ORIENTATIONS if ( Pos != NULL ) { - /* Input position */ - Pos_p[0] = ( *Pos ).x; - Pos_p[1] = ( *Pos ).y; - Pos_p[2] = ( *Pos ).z; - } - else - { + /* Input position */ + Pos_p[0] = ( *Pos ).x; + Pos_p[1] = ( *Pos ).y; + Pos_p[2] = ( *Pos ).z; + } + else + { /* Listener at the origin */ Pos_p[0] = 0.0f; Pos_p[1] = 0.0f; @@ -649,13 +649,13 @@ ivas_error ivas_td_binaural_open_ext( *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_renderer_ext( - const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ - const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */ - const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ + const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ + const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */ + const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ #ifdef EXTERNAL_ORIENTATIONS const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ #else - const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ + const IVAS_REND_HeadRotData *headRotData, /* i : Input head positions */ #endif const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6b637b7767..3ceb66f2c5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5117,7 +5117,6 @@ static ivas_error renderIsmToBinauralRoom( } #ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG - static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) @@ -5452,13 +5451,6 @@ static ivas_error renderMcToBinaural( #else int8_t headRotEnabled; #endif - float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; - int16_t i; - - for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) - { - p_tmpRendBuffer[i] = tmpRendBuffer[i]; - } push_wmops( "renderMcToBinaural" ); @@ -5537,7 +5529,7 @@ static ivas_error renderMcToBinaural( /* call CREND */ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, NULL /* ToDo: TBV */, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From f31a511372ff196a26bfd8ab50a3a1012c1e18dc Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 16:01:40 +0200 Subject: [PATCH 0172/1418] formatting --- apps/encoder.c | 6 +- lib_com/ivas_prot.h | 8 +- lib_com/ivas_stat_com.h | 2 + lib_dec/ivas_cpe_dec.c | 1 + lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_dirac_dec.c | 2 +- lib_dec/ivas_dirac_output_synthesis_dec.c | 194 +++++++++---------- lib_dec/ivas_init_dec.c | 11 +- lib_dec/ivas_masa_dec.c | 2 + lib_dec/ivas_mono_dmx_renderer.c | 1 + lib_dec/ivas_omasa_dec.c | 2 + lib_dec/ivas_vbap.c | 14 +- lib_enc/ivas_cpe_enc.c | 1 - lib_enc/ivas_decision_matrix_enc.c | 1 + lib_enc/ivas_ism_metadata_enc.c | 4 - lib_enc/ivas_masa_enc.c | 14 +- lib_enc/ivas_qmetadata_enc.c | 3 + lib_enc/ivas_stat_enc.h | 2 +- lib_enc/lib_enc.c | 6 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 + lib_rend/ivas_objectRenderer.c | 1 + 21 files changed, 151 insertions(+), 128 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 567e32d431..66c64f39f3 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -97,6 +97,7 @@ typedef union _EncInputFormatConfig IVAS_ENC_MASA_VARIANT masaVariant; } masa_ism; #endif + } EncInputFormatConfig; /* Struct for storing cmdln arguments */ @@ -542,7 +543,6 @@ int main( } } - #ifdef MASA_AND_OBJECTS const int16_t numIsmInputs = ( arg.inputFormat == IVAS_ENC_INPUT_ISM || arg.inputFormat == IVAS_ENC_INPUT_MASA_ISM ) ? arg.inputFormatConfig.ism.numObjects : 0; #else @@ -1809,8 +1809,8 @@ static void usage_enc( void ) 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" ); #ifdef MASA_AND_OBJECTS - fprintf( stdout, " for IVAS MASA and objects R = (13200, 16400, 24400, 32000, 48000, 64000, 96000, 128000, \n" ); - fprintf( stdout, " 160000, 192000, 256000, 384000, 512000)\n" ); + fprintf( stdout, " for IVAS objects-MASA R =(13200, 16400, 24400, 32000, 48000, 64000, 96000, 128000, \n" ); + fprintf( stdout, " 160000, 192000, 256000, 384000, 512000)\n" ); #endif fprintf( stdout, " Alternatively, R can be a bitrate switching file which consists of R values\n" ); fprintf( stdout, " indicating the bitrate for each frame in bps. These values are stored in\n" ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 0d4c8dc241..09c08ccb29 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1024,7 +1024,7 @@ void ivas_ism_metadata_close( ISM_METADATA_HANDLE hIsmMetaData[] /* i/o : object metadata handles */ #ifdef MASA_AND_OBJECTS , - const int16_t first_idx /* i : index of first handle to deallocate */ + const int16_t first_idx /* i : index of first handle to deallocate */ #endif ); @@ -5090,7 +5090,7 @@ ivas_error ivas_masa_encode( const int16_t ism_imp /* i : importance of separated object */ #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate /* i: flag for using less bitrate for objects in OMASA */ + const int16_t flag_omasa_brate /* i : flag for using less bitrate for objects in OMASA*/ #endif #endif ); @@ -5404,7 +5404,7 @@ ivas_error vbap_init_data( const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ #ifdef MASA_AND_OBJECTS , - const int16_t support_object_mode /* i : init VBAP also for object panning mode */ + const IVAS_FORMAT ivas_format /* i : IVAS format */ #endif ); @@ -5706,7 +5706,7 @@ void ivas_omasa_set_config( OMASA_ENC_HANDLE hOMasa, /* i/o: OMASA encoder handle */ MASA_ENCODER_HANDLE hMasa, /* i : MASA encoder handle */ const int32_t input_Fs, /* i : Input sample rate */ - const ISM_MODE ism_mode /* i : ISM mode */ + const ISM_MODE ism_mode /* i : ISM mode */ ); void ivas_omasa_enc( diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index f0e5a05a97..9b8cee1df5 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -455,6 +455,7 @@ typedef struct ivas_omasa_meta_struct uint8_t num_dirs; MASA_DIRECTIONAL_SPATIAL_META directional_meta[MASA_MAXIMUM_DIRECTIONS]; MASA_COMMON_SPATIAL_META common_meta; + } OMASA_SPATIAL_META, *OMASA_SPATIAL_META_HANDLE; #endif @@ -570,6 +571,7 @@ typedef struct ivas_masa_qmetadata_frame_struct #ifdef MASA_AND_OBJECTS float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; /* TODO Nokia: This should be moved to some other place and reserved only when needed. */ #endif + } IVAS_QMETADATA, *IVAS_QMETADATA_HANDLE; diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 8a1d2e93e1..daf7056f7b 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -83,6 +83,7 @@ ivas_error ivas_cpe_dec( int32_t element_brate_ref; #endif #endif + error = IVAS_ERR_OK; push_wmops( "ivas_cpe_dec" ); diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 4cb89aec42..6fb6cbc2cd 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -71,10 +71,10 @@ ivas_error ivas_dec( float pan_left, pan_right; ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS]; - #ifdef MASA_AND_OBJECTS int32_t ism_total_brate; #endif + error = IVAS_ERR_OK; push_wmops( "ivas_dec" ); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1b76add66a..7197186a0b 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -784,7 +784,7 @@ ivas_error ivas_dirac_dec_config( } #ifdef MASA_AND_OBJECTS - if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE, st_ivas->ivas_format == MASA_ISM_FORMAT ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( ( error = vbap_init_data( &( st_ivas->hVBAPdata ), ls_azimuth, ls_elevation, nchan_out_woLFE, st_ivas->ivas_format ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 1c74fec901..97bbbab852 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -623,121 +623,119 @@ void ivas_dirac_dec_output_synthesis_process_slot( h_dirac_output_synthesis_state->diffuse_power_factor ); } } - else // ( hDirAC->hConfig->dec_param_estim == TRUE ) - if ( hDirAC->hConfig->dec_param_estim == TRUE ) - { - - /* compute direct responses */ - ivas_dirac_dec_compute_directional_responses( hDirAC, - hVBAPdata, - NULL, + else if ( hDirAC->hConfig->dec_param_estim == TRUE ) + { + /* compute direct responses */ + ivas_dirac_dec_compute_directional_responses( hDirAC, + hVBAPdata, + NULL, #ifdef MASA_AND_OBJECTS - NULL, + NULL, #endif - azimuth, - elevation, - md_idx, - NULL, - sh_rot_max_order, - p_Rmat, - hodirac_flag ); - - if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) - { - ivas_dirac_dec_compute_gain_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); + azimuth, + elevation, + md_idx, + NULL, + sh_rot_max_order, + p_Rmat, + hodirac_flag ); + if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) + { + ivas_dirac_dec_compute_gain_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); - v_multc( h_dirac_output_synthesis_state->direct_power_factor, - 0.25f, - h_dirac_output_synthesis_state->direct_power_factor, - num_freq_bands ); - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - 0.25f, - h_dirac_output_synthesis_state->diffuse_power_factor, - num_freq_bands ); - /*Direct gain*/ - for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) + v_multc( h_dirac_output_synthesis_state->direct_power_factor, + 0.25f, + h_dirac_output_synthesis_state->direct_power_factor, + num_freq_bands ); + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + 0.25f, + h_dirac_output_synthesis_state->diffuse_power_factor, + num_freq_bands ); + + /*Direct gain*/ + for ( ch_idx = 0; ch_idx < min( 4, nchan_transport ); ch_idx++ ) + { + int16_t k; + if ( ch_idx != 0 ) { - int16_t k; - if ( ch_idx != 0 ) - { - float a, b, c; + float a, b, c; - /*Directonal sound gain nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) - { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); - } - for ( ; k < num_freq_bands; k++ ) - { - a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; - b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); - c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); - } + /*Directonal sound gain nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); } - else + for ( ; k < num_freq_bands; k++ ) { - /*Diffuseness modellling nrg compensation*/ - for ( k = 0; k < num_freq_bands_diff; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); - } - for ( ; k < num_freq_bands; k++ ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); - } + a = h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands + k]; + b = reference_power[k + num_freq_bands] / ( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] + EPSILON ); + c = 1.f + ( 1.f / 6.f ) * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ); /*Diffuseness modellling nrg compensation*/ + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( diffuseness[k] * c + ( ( 1.f - diffuseness[k] ) * a * a * b ) ); } } - - /*Directional gain (panning)*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) - { - v_mult( h_dirac_output_synthesis_state->direct_power_factor, - &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], - aux_buf, - num_freq_bands ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], - num_freq_bands ); - } - - /*Diffuse gain*/ - for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) + else { - v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, - hDirAC->diffuse_response_function[ch_idx], - aux_buf, - num_freq_bands_diff ); - - v_add( aux_buf, - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], - num_freq_bands_diff ); + /*Diffuseness modellling nrg compensation*/ + for ( k = 0; k < num_freq_bands_diff; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) ); + } + for ( ; k < num_freq_bands; k++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands + k] += 0.25f * sqrtf( 1.0f + diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor - 1.f ) ); + } } + } - return; + /*Directional gain (panning)*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) + { + v_mult( h_dirac_output_synthesis_state->direct_power_factor, + &h_dirac_output_synthesis_state->direct_responses[ch_idx * num_freq_bands], + aux_buf, + num_freq_bands ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + &h_dirac_output_synthesis_state->cy_cross_dir_smooth[ch_idx * num_freq_bands], + num_freq_bands ); } - else + + /*Diffuse gain*/ + for ( ch_idx = min( 4, nchan_transport ); ch_idx < num_channels_diff; ch_idx++ ) { - /* compute reference and diffuse power factor for this frame */ - ivas_dirac_dec_compute_power_factors( num_freq_bands, - diffuseness, - h_dirac_output_synthesis_params->max_band_decorr, - h_dirac_output_synthesis_state->direct_power_factor, - h_dirac_output_synthesis_state->diffuse_power_factor ); + v_multc( h_dirac_output_synthesis_state->diffuse_power_factor, + hDirAC->diffuse_response_function[ch_idx], + aux_buf, + num_freq_bands_diff ); + + v_add( aux_buf, + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + &h_dirac_output_synthesis_state->cy_auto_diff_smooth[ch_idx * num_freq_bands_diff], + num_freq_bands_diff ); } + + return; + } + else + { + /* compute reference and diffuse power factor for this frame */ + ivas_dirac_dec_compute_power_factors( num_freq_bands, + diffuseness, + h_dirac_output_synthesis_params->max_band_decorr, + h_dirac_output_synthesis_state->direct_power_factor, + h_dirac_output_synthesis_state->diffuse_power_factor ); } + } diff_start_band = 0; if ( h_dirac_output_synthesis_params->use_onset_filters ) @@ -1874,6 +1872,7 @@ void ivas_dirac_dec_compute_directional_responses( { /* Synthesize the first direction */ spreadCoherencePanningHoa( azimuth[k], elevation[k], hDirAC->spreadCoherence[md_idx][k], direct_response_hoa, num_channels_dir, hDirAC->hOutSetup.ambisonics_order ); + /* Synthesize the second direction and combine the gains */ #ifdef MASA_AND_OBJECTS if ( hDirAC->numParametricDirections == 2 ) @@ -2010,6 +2009,7 @@ void ivas_dirac_dec_compute_directional_responses( } normalizePanningGains( direct_response_ls, num_channels_dir ); } + #ifdef MASA_AND_OBJECTS // Todo OMASA JBM: Here we also probably need md_idx if ( hDirAC->numIsmDirections > 0 ) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 5d4b7812c0..f4f741bb8c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -436,14 +436,13 @@ static ivas_error ivas_read_format( case 3: if ( st_ivas->bit_stream[*num_bits_read] ) { - ( *num_bits_read )++; st_ivas->ivas_format = MASA_FORMAT; } else { - ( *num_bits_read )++; st_ivas->ivas_format = SBA_FORMAT; } + ( *num_bits_read )++; break; } @@ -1009,7 +1008,7 @@ ivas_error ivas_init_decoder( } } - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { if ( ( error = create_sce_dec( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK ) { @@ -1237,7 +1236,7 @@ ivas_error ivas_init_decoder( return error; } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { if ( ( error = create_cpe_dec( st_ivas, cpe_id, ivas_total_brate / ( st_ivas->nSCE + st_ivas->nCPE ) ) ) != IVAS_ERR_OK ) { @@ -1304,7 +1303,7 @@ ivas_error ivas_init_decoder( ivas_mcmasa_split_brate( st_ivas->hOutSetup.separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe ); - for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) // VE: TBV - is this loop needed? + for ( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) { if ( ( error = create_sce_dec( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK ) { @@ -1314,7 +1313,7 @@ ivas_error ivas_init_decoder( reset_indices_dec( st_ivas->hSCE[sce_id]->hCoreCoder[0] ); } - for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) // VE: TBV - is this loop needed? + for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { st_ivas->element_mode_init = IVAS_CPE_MDCT; /* element_mode_init was IVAS_SCE for SCE initialization */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 6b8a947402..1251cecac3 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -309,6 +309,7 @@ ivas_error ivas_masa_decode( /* Remove already read bits from the bit budget */ hQMetaData->metadata_max_bits -= *nb_bits_read; + #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -351,6 +352,7 @@ ivas_error ivas_masa_decode( { total_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); } + if ( total_brate >= IVAS_384k ) { if ( total_brate >= IVAS_512k ) diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 4e16edca30..61d8c68094 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -94,6 +94,7 @@ void ivas_mono_downmix_render_passive( MONO_DOWNMIX_RENDERER_HANDLE hDownmix; numInputChannels = st_ivas->nSCE; + #ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index a198c6a774..40d505d5fc 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -183,6 +183,7 @@ ivas_error ivas_omasa_dec_config( /*-----------------------------------------------------------------* * Renderer selection *-----------------------------------------------------------------*/ + old_renderer_type = st_ivas->renderer_type; #endif @@ -296,6 +297,7 @@ ivas_error ivas_omasa_dec_config( /*-----------------------------------------------------------------* * Renderer selection *-----------------------------------------------------------------*/ + ivas_renderer_select( st_ivas ); /*-------------------------------------------------------------------* diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index e45d525fc3..dcc73907e2 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -163,7 +163,7 @@ ivas_error vbap_init_data( const int16_t num_speaker_nodes /* i : number of speaker nodes in the set */ #ifdef MASA_AND_OBJECTS , - const int16_t support_object_mode /* i : init VBAP also for object panning mode */ + const IVAS_FORMAT ivas_format /* i : IVAS format */ #endif ) { @@ -242,14 +242,16 @@ ivas_error vbap_init_data( } set_zero( vbap->bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->bottom_virtual_speaker_node_division_gains != NULL; + #ifdef MASA_AND_OBJECTS - if ( support_object_mode ) + if ( ivas_format == MASA_ISM_FORMAT ) { vbap->object_mode_bottom_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->object_mode_bottom_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->object_mode_bottom_virtual_speaker_node_division_gains != NULL; } #endif + speaker_node_azi_deg_internal[vbap->bottom_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->bottom_virtual_speaker_node_index] = -90.0f; } @@ -262,14 +264,16 @@ ivas_error vbap_init_data( } set_zero( vbap->top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->top_virtual_speaker_node_division_gains != NULL; + #ifdef MASA_AND_OBJECTS - if ( support_object_mode ) + if ( ivas_format == MASA_ISM_FORMAT ) { vbap->object_mode_top_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->object_mode_top_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->object_mode_top_virtual_speaker_node_division_gains != NULL; } #endif + speaker_node_azi_deg_internal[vbap->top_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->top_virtual_speaker_node_index] = 90.0f; } @@ -283,7 +287,7 @@ ivas_error vbap_init_data( set_zero( vbap->back_virtual_speaker_node_division_gains, num_speaker_nodes ); is_success &= vbap->back_virtual_speaker_node_division_gains != NULL; #ifdef MASA_AND_OBJECTS - if ( support_object_mode ) + if ( ivas_format == MASA_ISM_FORMAT ) { vbap->object_mode_back_virtual_speaker_node_division_gains = (float *) malloc( num_speaker_nodes * sizeof( float ) ); set_zero( vbap->object_mode_back_virtual_speaker_node_division_gains, num_speaker_nodes ); @@ -383,7 +387,7 @@ ivas_error vbap_init_data( determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->top_virtual_speaker_node_division_gains, connections, virtual_top_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type, max_num_connections, num_speaker_nodes, 0 ); determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes, 0 ); - if ( support_object_mode ) + if ( ivas_format == MASA_ISM_FORMAT ) { determine_virtual_speaker_node_division_gains( vbap->top_virtual_speaker_node_index, vbap->object_mode_top_virtual_speaker_node_division_gains, connections, virtual_top_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); determine_virtual_speaker_node_division_gains( vbap->bottom_virtual_speaker_node_index, vbap->object_mode_bottom_virtual_speaker_node_division_gains, connections, virtual_bottom_type == NO_VIRTUAL_SPEAKER_NODE ? NO_VIRTUAL_SPEAKER_NODE : VIRTUAL_SPEAKER_NODE_DISTRIBUTE_ENERGY, max_num_connections, num_speaker_nodes, 1 ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index f573b4ac6e..f099d448f4 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -327,7 +327,6 @@ ivas_error ivas_cpe_enc( } else { - #endif stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, st_ivas->hQMetaData->bits_frame_nominal * FRAMES_PER_SEC, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); #ifdef MASA_AND_OBJECTS diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 115a7eecde..2db13f8ecf 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -424,6 +424,7 @@ void ivas_signaling_enc( /*-------------------------------------------------------------------------- * Write element mode info *--------------------------------------------------------------------------*/ + #ifdef MASA_AND_OBJECTS if ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && !MCT_flag ) /* note: in MCT, the MDCT stereo is used exclusively */ #else diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 734a0cbd14..fcceeca57d 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -341,11 +341,7 @@ ivas_error ivas_ism_metadata_enc( } /* write ISM metadata flag (one per object) */ -#ifdef MASA_AND_OBJECTS - for ( ch = 0; ch < nchan_transport; ch++ ) -#else for ( ch = 0; ch < nchan_transport; ch++ ) -#endif { #ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 60e80bbfb3..4c1fd0644a 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -50,7 +50,6 @@ static void combine_freqbands_and_subframes( MASA_ENCODER_HANDLE hMasa ); #ifndef MASA_AND_OBJECTS static void combine_directions( MASA_ENCODER_HANDLE hMasa ); #endif - static void find_n_largest( const float *input, int16_t *largestIndices, const int16_t numElements, const int16_t numLargest ); static void move_metadata_to_qmetadata( const MASA_ENCODER_HANDLE hMasa, IVAS_QMETADATA_HANDLE hQMeta ); @@ -140,6 +139,7 @@ ivas_error ivas_masa_enc_open( return error; } } + #ifdef MASA_AND_OBJECTS ism_total_brate = 0; if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) @@ -150,6 +150,7 @@ ivas_error ivas_masa_enc_open( } } #endif + ivas_masa_set_elements( st_ivas->hEncoderConfig->ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &hEncoderConfig->element_mode_init, &st_ivas->nSCE, &st_ivas->nCPE #ifdef MASA_AND_OBJECTS @@ -248,7 +249,7 @@ ivas_error ivas_masa_encode( const int16_t ism_imp /* i : importance of separated object */ #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate /* i: flag for using less bitrate for objects in OMASA */ + const int16_t flag_omasa_brate /* i : flag for using less bitrate for objects in OMASA */ #endif #endif ) @@ -256,7 +257,6 @@ ivas_error ivas_masa_encode( MASA_DIRECTIONAL_SPATIAL_META *h_orig_metadata; int16_t i, j; int16_t masa_sid_descriptor; - #ifdef MASA_AND_OBJECTS int16_t low_bitrate_mode; #endif @@ -265,6 +265,7 @@ ivas_error ivas_masa_encode( h_orig_metadata = NULL; #ifdef MASA_AND_OBJECTS low_bitrate_mode = 0; + if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else if ( ivas_format == MASA_FORMAT ) @@ -317,6 +318,7 @@ ivas_error ivas_masa_encode( /* Combine frequency bands and sub-frames */ combine_freqbands_and_subframes( hMasa ); } + #ifdef MASA_AND_OBJECTS if ( hMasa->config.numberOfDirections == 2 && hMasa->config.numTwoDirBands < hMasa->config.numCodingBands && ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT ) ) #else @@ -333,6 +335,7 @@ ivas_error ivas_masa_encode( /* Combine directions */ combine_directions( hMasa ); #endif + /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) { @@ -350,7 +353,6 @@ ivas_error ivas_masa_encode( if ( ivas_format == MASA_FORMAT ) #endif { - #ifndef MASA_AND_OBJECTS /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); @@ -458,6 +460,7 @@ ivas_error ivas_masa_encode( #else reduce_metadata_further( hMasa, hQMetaData, ivas_format ); #endif + /* Write low bitrate mode. 1 signals that we have merged through time, 0 signals merge through frequency. */ push_next_indice( hMetaData, hQMetaData->q_direction[0].cfg.nblocks == 1 ? 1 : 0, MASA_LOWBITRATE_MODE_BITS ); hQMetaData->metadata_max_bits -= MASA_LOWBITRATE_MODE_BITS; @@ -476,6 +479,7 @@ ivas_error ivas_masa_encode( hQMetaData->masa_to_total_energy_ratio[0][0] = -1; /* signals NOT to adjust the energy ratios */ } #endif + /* Encode metadata */ #ifdef MASA_AND_OBJECTS int32_t total_brate; @@ -484,6 +488,7 @@ ivas_error ivas_masa_encode( { total_brate = calculate_cpe_brate_MASA_ISM( ism_mode, ivas_total_brate, nchan_ism ); } + if ( total_brate >= IVAS_384k ) { if ( total_brate >= IVAS_512k ) @@ -559,6 +564,7 @@ ivas_error ivas_masa_encode( #else combine_directions( hMasa ); #endif + /* If we joined all bands, then metadata is now one directional. */ if ( hMasa->config.numTwoDirBands == 0 ) { diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 6af86d0098..628bbe6cb5 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -144,6 +144,7 @@ static int16_t find_optimal_GR_order( const int16_t *q_idx, const int16_t len, i static int16_t find_optimal_GR_orders( const int16_t *q_idx, const int16_t len, const int16_t len_max_GR1, int16_t *GR1, int16_t *GR2, int16_t *i_min ); #endif + /*-----------------------------------------------------------------------* * ivas_qmetadata_enc_encode() * @@ -3102,6 +3103,7 @@ static int16_t ivas_qmetadata_get_optimal_gr_param( * * *------------------------------------------------------------------------*/ + #ifndef MASA_AND_OBJECTS static #endif @@ -3248,6 +3250,7 @@ static int16_t ivas_qmetadata_reorder_azimuth_index( * * *------------------------------------------------------------------------*/ + #ifndef MASA_AND_OBJECTS static #endif diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 1b2542e757..4f3a1eb162 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1221,7 +1221,7 @@ typedef struct MC_PARAMUPMIX_ENC_HANDLE hMCParamUpmix; /* MC Param-Upmix handle */ MCMASA_ENC_HANDLE hMcMasa; /* Multi-channel MASA data handle */ #ifdef MASA_AND_OBJECTS - OMASA_ENC_HANDLE hOMasa; /* Object MASA data handle */ + OMASA_ENC_HANDLE hOMasa; /* Object-MASA data handle */ #endif LFE_ENC_HANDLE hLFE; /* LFE data handle */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 39d9f658cc..f47467aba8 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -383,6 +383,7 @@ ivas_error IVAS_ENC_ConfigureForStereo( return error; } + #ifdef MASA_AND_OBJECTS /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForMASAObjects() @@ -439,6 +440,7 @@ ivas_error IVAS_ENC_ConfigureForMASAObjects( } #endif + /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForObjects() * @@ -504,6 +506,7 @@ ivas_error IVAS_ENC_FeedObjectMetadata( { return IVAS_ERR_NOT_CONFIGURED; } + #ifdef MASA_AND_OBJECTS if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != ISM_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) #else @@ -664,6 +667,7 @@ ivas_error IVAS_ENC_FeedMasaMetadata( { return IVAS_ERR_NOT_CONFIGURED; } + #ifdef MASA_AND_OBJECTS if ( hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_FORMAT && hIvasEnc->st_ivas->hEncoderConfig->ivas_format != MASA_ISM_FORMAT ) #else @@ -758,6 +762,7 @@ static ivas_error configureEncoder( #ifdef MASA_AND_OBJECTS int32_t cpe_brate; #endif + error = IVAS_ERR_OK; st_ivas = hIvasEnc->st_ivas; @@ -898,7 +903,6 @@ static ivas_error configureEncoder( } } } - #ifdef MASA_AND_OBJECTS else if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index f2fe66d886..2c916691d0 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1067,6 +1067,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = 0.0f; } #endif + diffuseness -= ratio; /* diffuseness = 1 - ratio1 - ratio2 */ #ifdef MASA_AND_OBJECTS @@ -1254,6 +1255,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply target spectrum that emphasizes low frequencies when the sound is surround coherent */ diffEne *= ( 1.0f - surCoh ) + surCoh * surCohEne[idx]; #endif + #ifdef MASA_AND_OBJECTS /* Modify also the value for decorrelation reduction */ diffEneValForDecorrelationReduction *= spectrumModVal; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index f9831d4ce5..82a08ef9d5 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -191,6 +191,7 @@ ivas_error ivas_td_binaural_open_unwrap( TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ); } } + #ifdef MASA_AND_OBJECTS if ( ivas_format == ISM_FORMAT || ivas_format == MASA_ISM_FORMAT ) #else -- GitLab From 25903e4a4e1252a169c3e10218f9e6fbf4bd78ca Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 16:14:04 +0200 Subject: [PATCH 0173/1418] fix build warning --- lib_rend/lib_rend.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 3ceb66f2c5..f57f06b887 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5125,13 +5125,6 @@ static ivas_error renderIsmToBinauralReverb( float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; - float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; - - for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) - { - p_tmpRendBuffer[i] = tmpRendBuffer[i]; - } - push_wmops( "renderIsmToBinauralRoom" ); copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); -- GitLab From c2e627b35c7f9f39e3e93a6ea306b194f149aaf9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 13 Jun 2023 16:34:35 +0200 Subject: [PATCH 0174/1418] fix ext renderer failures --- lib_rend/lib_rend.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f57f06b887..3d841fef0e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5121,7 +5121,6 @@ static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) { - int16_t i; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; @@ -5444,6 +5443,13 @@ static ivas_error renderMcToBinaural( #else int8_t headRotEnabled; #endif + float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; + int16_t i; + + for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) + { + p_tmpRendBuffer[i] = tmpRendBuffer[i]; + } push_wmops( "renderMcToBinaural" ); @@ -5522,7 +5528,7 @@ static ivas_error renderMcToBinaural( /* call CREND */ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, NULL /* ToDo: TBV */, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From c394a0e063bc339e873f9ef7ca59535d056c8798 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Tue, 13 Jun 2023 18:22:15 +0200 Subject: [PATCH 0175/1418] Update contribution 35 - fixed Visual Studio build - fixed memory sanitizer issues for all split rendering modes - improved validation of split rendering configuration struct --- Workspace_msvc/Workspace_msvc.sln | 8 + Workspace_msvc/lib_rend.vcxproj | 10 + ...t_renderer_config_1536_2dof_tdposecorr.txt | 12 - ...t_renderer_config_1792_3dof_tdposecorr.txt | 12 - ...it_renderer_config_320_0dof_tdposecorr.txt | 12 - ...it_renderer_config_768_1dof_tdposecorr.txt | 12 - ...it_renderer_config_HBR_1dof_tdposecorr.txt | 12 - apps/decoder.c | 3 +- apps/renderer.c | 5 +- lib_com/ivas_cnst.h | 6 +- lib_com/ivas_error.h | 71 +++- lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_init_dec.c | 11 +- lib_dec/ivas_rom_dec.c | 2 + lib_dec/ivas_sba_dec.c | 2 +- lib_dec/lib_dec.c | 67 +-- lib_enc/lib_enc.c | 66 +-- lib_rend/ivas_lc3plus_dec.c | 157 ++++--- lib_rend/ivas_lc3plus_dec.h | 18 +- lib_rend/ivas_prot_rend.h | 3 +- lib_rend/ivas_splitRendererPre.c | 19 +- lib_rend/ivas_splitRenderer_utils.c | 52 +++ lib_rend/lc3plus_codec/get_lc3plus.ps1 | 9 + lib_rend/lc3plus_codec/get_lc3plus.sh | 1 + lib_rend/lc3plus_codec/lc3plus.patch | 399 ++++++++++-------- lib_rend/lib_rend.c | 9 +- lib_util/render_config_reader.c | 2 +- lib_util/split_render_file_read_write.c | 8 +- lib_util/split_render_file_read_write.h | 6 +- 29 files changed, 515 insertions(+), 481 deletions(-) delete mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt delete mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt delete mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt delete mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt delete mode 100644 Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt create mode 100755 lib_rend/lc3plus_codec/get_lc3plus.ps1 diff --git a/Workspace_msvc/Workspace_msvc.sln b/Workspace_msvc/Workspace_msvc.sln index fbdb561ee2..5bf4656fd7 100644 --- a/Workspace_msvc/Workspace_msvc.sln +++ b/Workspace_msvc/Workspace_msvc.sln @@ -20,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder", "encoder.vcxproj" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "renderer", "renderer.vcxproj", "{12B4C8A5-1E06-4E30-B443-D1F916F52B47}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LC3plus", "..\lib_rend\lc3plus_codec\ETSI_Release\LC3plus_ETSI_src_va15eb59632b_20230228\src\floating_point\msvc\LC3plus.vcxproj", "{95030B82-70CD-4C6B-84D4-61096035BEA2}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{51160D4C-55C9-4C16-A792-D94507225746}" ProjectSection(SolutionItems) = preProject ..\.clang-format = ..\.clang-format @@ -87,6 +89,12 @@ Global {12B4C8A5-1E06-4E30-B443-D1F916F52B47}.Release|Win32.ActiveCfg = Release|Win32 {12B4C8A5-1E06-4E30-B443-D1F916F52B47}.Release|Win32.Build.0 = Release|Win32 {12B4C8A5-1E06-4E30-B443-D1F916F52B47}.Release|x64.ActiveCfg = Release|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Debug|Win32.ActiveCfg = Debug|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Debug|Win32.Build.0 = Debug|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Debug|x64.ActiveCfg = Debug|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|Win32.ActiveCfg = Release|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|Win32.Build.0 = Release|Win32 + {95030B82-70CD-4C6B-84D4-61096035BEA2}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index cf98947589..9de01d06bb 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -199,6 +199,9 @@ + + + @@ -252,6 +255,9 @@ + + + @@ -262,6 +268,10 @@ {54509728-928b-44d9-a118-a6f92f08b34f} false + + {95030B82-70CD-4C6B-84D4-61096035BEA2} + false + diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt deleted file mode 100644 index 7ef48fb635..0000000000 --- a/Workspace_msvc/renderer_configs/split_renderer_config_1536_2dof_tdposecorr.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SPLITREND] -BITRATE = 1536000; -DOF = 2; -HQMODE = 0; -CODEC = 1; -POSECORRECTIONMODE = 1; - -[GENERAL] -RENDERER = CREND; - -[ROOMACOUSTICS] -REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt deleted file mode 100644 index c77307afd6..0000000000 --- a/Workspace_msvc/renderer_configs/split_renderer_config_1792_3dof_tdposecorr.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SPLITREND] -BITRATE = 1792000; -DOF = 3; -HQMODE = 0; -CODEC = 1; -POSECORRECTIONMODE = 1; - -[GENERAL] -RENDERER = CREND; - -[ROOMACOUSTICS] -REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt deleted file mode 100644 index c4457e80d7..0000000000 --- a/Workspace_msvc/renderer_configs/split_renderer_config_320_0dof_tdposecorr.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SPLITREND] -BITRATE = 320000; -DOF = 0; -HQMODE = 0; -CODEC = 1; -POSECORRECTIONMODE = 1; - -[GENERAL] -RENDERER = CREND; - -[ROOMACOUSTICS] -REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt deleted file mode 100644 index ec5427bebc..0000000000 --- a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_tdposecorr.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SPLITREND] -BITRATE = 768000; -DOF = 1; -HQMODE = 0; -CODEC = 1; -POSECORRECTIONMODE = 1; - -[GENERAL] -RENDERER = CREND; - -[ROOMACOUSTICS] -REVERB = FALSE; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt b/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt deleted file mode 100644 index 559352f637..0000000000 --- a/Workspace_msvc/renderer_configs/split_renderer_config_HBR_1dof_tdposecorr.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SPLITREND] -BITRATE = -1; -DOF = 1; -HQMODE = 0; -CODEC = 1; -POSECORRECTIONMODE = 1; - -[GENERAL] -RENDERER = CREND; - -[ROOMACOUSTICS] -REVERB = FALSE; diff --git a/apps/decoder.c b/apps/decoder.c index 75d0fd2ea7..25b1fdd405 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1413,7 +1413,8 @@ static ivas_error initOnFirstGoodFrame( splitRendBitsZero.bits_read = 0; if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written #ifdef SPLIT_REND_LC3PLUS - , -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE + , + -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE #endif ) != IVAS_ERR_OK ) { diff --git a/apps/renderer.c b/apps/renderer.c index eed31e9cfa..8f9408fee4 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -983,7 +983,7 @@ int main( if ( ( error = IVAS_REND_GetRenderConfig( hIvasRend, &renderConfig ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed\n" ); + fprintf( stderr, "\nIVAS_DEC_GetRenderConfig failed: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } @@ -995,7 +995,7 @@ int main( if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed\n" ); + fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1270,6 +1270,7 @@ int main( #endif outBuffer.config.numChannels = (int16_t) numOutChannels; outBuffer.data = outFloatBuffer; + memset( outBuffer.data, 0, outBuffer.config.numSamplesPerChannel * outBuffer.config.numChannels * sizeof( float ) ); #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 595e5578e9..53e812cde7 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1735,16 +1735,18 @@ typedef enum * Split rendering bitrate constants *----------------------------------------------------------------------------------*/ +#ifndef SPLIT_REND_LC3PLUS #define SIZE_SPLIT_REND_BRATE_TBL (4) +#endif #define SPLIT_REND_256k 256000 #ifdef SPLIT_REND_LC3PLUS -#define SPLIT_REND_320k 320000 /* TODO tmu: LC3plus 0DOF only at the moment - not included in SIZE_SPLIT_REND_BRATE_TBL! */ +#define SPLIT_REND_320k 320000 #endif #define SPLIT_REND_384k 384000 #define SPLIT_REND_512k 512000 #define SPLIT_REND_768k 768000 #define SPLIT_REND_MAX_BRATE SPLIT_REND_768k -#ifdef SPLIT_REND_LC3PLUS +#ifdef SPLIT_REND_LC3PLUS_HBR_DBG #define SPLIT_REND_LC3PLUS_HBR 128000 /* bitrate per LC3plus core */ #endif diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index f4ea7ecb8c..234deaf241 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -56,7 +56,7 @@ typedef enum IVAS_ERR_INVALID_SAMPLING_RATE, IVAS_ERR_NOT_CONFIGURED, IVAS_ERR_INVALID_STEREO_MODE, - IVAS_ERR_INVALID_CICP_INDEX, + IVAS_ERR_INVALID_CICP_INDEX, /* ToDo: rename, CICP not used in IVAS anymore */ IVAS_ERR_INVALID_BITRATE, IVAS_ERR_INVALID_MASA_CONFIG, IVAS_ERR_TOO_MANY_INPUTS, @@ -72,17 +72,15 @@ typedef enum IVAS_ERR_INVALID_SPAR_CONFIG, IVAS_ERR_WRONG_PARAMS, IVAS_ERR_INIT_ERROR, - IVAS_ERR_DECODER_ERROR, IVAS_ERR_WRONG_MODE, IVAS_ERR_INVALID_OUTPUT_FORMAT, IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED, IVAS_ERR_INVALID_HRTF, IVAS_ERR_INVALID_INPUT_FORMAT, - IVAS_ERR_INVALID_INDEX, + IVAS_ERR_INVALID_INDEX, /* ToDo: should be merged with IVAS_ERR_INDEX_OUT_OF_BOUNDS */ IVAS_ERR_NOT_SUPPORTED_OPTION, IVAS_ERR_NOT_IMPLEMENTED, IVAS_ERR_WAITING_FOR_BITSTREAM, - IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH, IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, @@ -128,13 +126,14 @@ typedef enum * renderer (lib_rend only) * *----------------------------------------*/ - IVAS_ERR_NUM_CHANNELS_UNKNOWN, + IVAS_ERR_NUM_CHANNELS_UNKNOWN = 0x6000, IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT, IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, #ifdef SPLIT_REND_LC3PLUS IVAS_ERR_LC3PLUS_INVALID_BITRATE, + IVAS_ERR_INVALID_SPLIT_REND_CONFIG, #endif /*----------------------------------------* @@ -182,9 +181,69 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Parse error"; case IVAS_ERR_END_OF_FILE: return "End of file"; + case IVAS_ERR_WRONG_PARAMS: + return "Wrong function parameters"; + case IVAS_ERR_INVALID_BANDWIDTH: + return "Invalid bandwidth"; + case IVAS_ERR_INVALID_DTX_UPDATE_RATE: + return "Invalid DTX update rate"; + case IVAS_ERR_NOT_CONFIGURED: + return "Handle has not been configured"; + case IVAS_ERR_INVALID_STEREO_MODE: + return "Invalid stereo mode"; + case IVAS_ERR_INVALID_CICP_INDEX: + return "Invalid speaker layout"; + case IVAS_ERR_INVALID_BITRATE: + return "Invalid bitrate"; + case IVAS_ERR_INVALID_MASA_CONFIG: + return "Invalid MASA config"; + case IVAS_ERR_TOO_MANY_INPUTS: + return "Too many object inputs provided"; + case IVAS_ERR_INDEX_OUT_OF_BOUNDS: + return "Index out of bounds"; + case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED: + return "Reconfigure not supported"; + case IVAS_ERR_INVALID_FEC_OFFSET: + return "Invalid FEC offset"; + case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE: + return "Invalid input buffer size"; + case IVAS_ERR_DTX_NOT_SUPPORTED: + return "DTX is not supported in this IVAS format and element mode"; + case IVAS_ERR_UNEXPECTED_NULL_POINTER: + return "Unexpected NULL pointer"; + case IVAS_ERR_METADATA_NOT_EXPECTED: + return "Metadata input not expected for current configuration"; +#ifdef DEBUGGING + case IVAS_ERR_INVALID_FORCE_MODE: + return "Invalid force mode"; +#endif + case IVAS_ERR_NOT_IMPLEMENTED: + return "Not implemented"; + case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT: + return "Invalid metadata file format"; + case IVAS_ERR_ISM_INVALID_METADATA_VALUE: + return "Invalid metadata value provided"; + case IVAS_ERR_NOT_SUPPORTED_OPTION: + return "Option not supported in this set-up"; + case IVAS_ERR_INIT_ERROR: + return "Initialization error"; + case IVAS_ERR_INVALID_BITSTREAM: + return "Invalid bitstream"; + case IVAS_ERR_WRONG_MODE: + return "Wrong mode"; + case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED: + return "Head rotation not supported"; + case IVAS_ERR_INVALID_HRTF: + return "Unsupported HRTF filter set"; + case IVAS_ERR_INVALID_INPUT_FORMAT: + return "Invalid format of input bitstream"; + case IVAS_ERR_INVALID_INDEX: + return "Invalid index"; #ifdef SPLIT_REND_LC3PLUS case IVAS_ERR_LC3PLUS_INVALID_BITRATE: - return "Specified split rendering bit rate is not supported by LC3plus"; + return "Specified split rendering bit rate is not supported"; + case IVAS_ERR_INVALID_SPLIT_REND_CONFIG: + return "Specified split rendering configuration is invalid"; #endif default: break; diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index ad7284cb4f..61435787cf 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -661,7 +661,7 @@ ivas_error ivas_dec( hSplitBinRend->hSplitRendBits, hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, - max_band, output, 1, + max_band, output, 1, #ifdef SPLIT_REND_LC3PLUS st_ivas->ivas_format != SBA_FORMAT, #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 0582ed8844..a94dcfafb9 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1284,13 +1284,12 @@ ivas_error ivas_init_decoder( #ifdef SPLIT_REND_LC3PLUS if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - ivas_renderSplitGetMultiBinPoseData( - &st_ivas->hRenderConfig->split_rend_config, - &st_ivas->splitBinRend.splitrend.multiBinPoseData, - st_ivas->hHeadTrackData->sr_pose_pred_axis ); - + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); /* Split rendering with ISMs only supported with LC3plus */ - assert(st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS); + assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ); #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING error = diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index 3608022efe..9c00833471 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -542,6 +542,7 @@ const float dmxmtx_table[BINAURAL_CHANNELS][11] = * split rendering ROM tables *-----------------------------------------------------------------------*/ +#ifndef SPLIT_REND_LC3PLUS /* Functionality moved to ivas_split_rend_validate_config() */ /*----------------------------------------------------------------------------------* * Table of Split rendering bitrates *----------------------------------------------------------------------------------*/ @@ -549,6 +550,7 @@ const int32_t split_rend_brate_tbl[SIZE_SPLIT_REND_BRATE_TBL] = { SPLIT_REND_256k, SPLIT_REND_384k, SPLIT_REND_512k, SPLIT_REND_768k }; +#endif /*rotations in this array are relative to ref rotation */ const float split_rend_relative_yaw_pos_angles[SPLIT_REND_MAX_YAW_ONLY_POSES] = {-15.0f, 15.0f}; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d5733e77b4..e0880ab799 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -260,7 +260,7 @@ ivas_error ivas_sba_dec_reconfigure( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef SPLIT_REND_LC3PLUS - assert(st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LCLD); + assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LCLD ); #endif #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING error = diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 6ca89f3aea..9e1e5ef8eb 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -207,7 +207,7 @@ ivas_error IVAS_DEC_Open( return IVAS_ERR_WRONG_PARAMS; } - +#ifndef SPLIT_REND_LC3PLUS /* Functionality moved to ivas_split_rend_validate_config() */ #ifdef SPLIT_REND_WITH_HEAD_ROT /*-------------------------------------------------------------------* * is_SplitRend_BitRate() @@ -230,6 +230,7 @@ static int16_t is_SplitRend_BitRate( const int32_t splitRendBitRate ) return 1; } #endif +#endif /*---------------------------------------------------------------------* * init_decoder_config() @@ -1243,6 +1244,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; +#ifdef SPLIT_REND_LC3PLUS + ivas_error error; +#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { @@ -1277,10 +1281,15 @@ ivas_error IVAS_DEC_FeedRenderConfig( #endif #ifdef SPLIT_REND_LC3PLUS /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ - if (hRenderConfig->split_rend_config.dof == 0) + if ( hRenderConfig->split_rend_config.dof == 0 ) { hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } + + if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config ) ) != IVAS_ERR_OK ) + { + return error; + } #endif return IVAS_ERR_OK; @@ -1836,59 +1845,7 @@ const char *IVAS_DEC_GetErrorMessage( ivas_error error /* i : decoder error code enum */ ) { - switch ( error ) - { - case IVAS_ERR_OK: - return "no error"; - case IVAS_ERR_FAILED_ALLOC: - return "Failed allocation error"; - case IVAS_ERR_WRONG_PARAMS: - return "wrong parameters"; - case IVAS_ERR_INIT_ERROR: - return "initialization error"; - case IVAS_ERR_INVALID_BITSTREAM: - return "Invalid bitstream"; - case IVAS_ERR_DECODER_ERROR: - return "decoder error"; - case IVAS_ERR_WRONG_MODE: - return "wrong mode"; - case IVAS_ERR_INVALID_OUTPUT_FORMAT: - return "invalid output format"; - case IVAS_ERR_INVALID_SAMPLING_RATE: - return "invalid sampling rate"; - case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED: - return "head rotation not supported"; - case IVAS_ERR_INVALID_HRTF: - return "Not supported HRTF filter set"; - case IVAS_ERR_INVALID_INPUT_FORMAT: - return "invalid format of input bitstream"; - case IVAS_ERR_INVALID_INDEX: - return "invalid index"; - case IVAS_ERR_INTERNAL: - case IVAS_ERR_INTERNAL_FATAL: - return "internal error"; - case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED: - return "reconfigure not supported"; - case IVAS_ERR_UNEXPECTED_NULL_POINTER: - return "unexpected NULL pointer"; -#ifdef DEBUGGING - case IVAS_ERR_INVALID_FORCE_MODE: - return "invalid force mode"; -#endif - case IVAS_ERR_FAILED_FILE_READ: - return "could not read from file"; - case IVAS_ERR_NOT_IMPLEMENTED: - return "not implemented"; -#ifdef SPLIT_REND_LC3PLUS - case IVAS_ERR_LC3PLUS_INVALID_BITRATE: - return ivas_error_to_string( IVAS_ERR_LC3PLUS_INVALID_BITRATE ); -#endif - case IVAS_ERR_UNKNOWN: - default: - break; - } - - return "unknown error"; + return ivas_error_to_string( error ); } diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 5b60da2759..9b31580938 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1376,71 +1376,7 @@ const char *IVAS_ENC_GetErrorMessage( ivas_error error /* i : encoder error code enum */ ) { - switch ( error ) - { - case IVAS_ERR_OK: - return "no error"; - case IVAS_ERR_FAILED_ALLOC: - return "Failed allocation error"; - case IVAS_ERR_WRONG_PARAMS: - return "wrong parameters"; - case IVAS_ERR_INVALID_BANDWIDTH: - return "invalid bandwidth"; - case IVAS_ERR_INVALID_DTX_UPDATE_RATE: - return "invalid DTX update rate"; - case IVAS_ERR_INVALID_SAMPLING_RATE: - return "invalid sampling rate"; - case IVAS_ERR_NOT_CONFIGURED: - return "encoder has not been configured"; - case IVAS_ERR_INVALID_STEREO_MODE: - return "invalid stereo mode"; - case IVAS_ERR_INVALID_CICP_INDEX: - return "invalid CICP index"; - case IVAS_ERR_INVALID_BITRATE: - return "invalid bitrate"; - case IVAS_ERR_INVALID_MASA_CONFIG: - return "invalid MASA config"; - case IVAS_ERR_TOO_MANY_INPUTS: - return "too many object inputs provided"; - case IVAS_ERR_INDEX_OUT_OF_BOUNDS: - return "index out of bounds"; - case IVAS_ERR_INTERNAL: - case IVAS_ERR_INTERNAL_FATAL: - return "internal error"; - case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED: - return "reconfigure not supported"; - case IVAS_ERR_INVALID_FEC_OFFSET: - return "invalid FEC offset"; - case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE: - return "invalid input buffer size"; - case IVAS_ERR_DTX_NOT_SUPPORTED: - return "DTX is not supported in this IVAS format and element mode"; - case IVAS_ERR_UNEXPECTED_NULL_POINTER: - return "unexpected NULL pointer"; - case IVAS_ERR_METADATA_NOT_EXPECTED: - return "metadata input not expected for current configuration"; -#ifdef DEBUGGING - case IVAS_ERR_INVALID_FORCE_MODE: - return "invalid force mode"; -#endif - case IVAS_ERR_NOT_IMPLEMENTED: - return "not implemented"; - case IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH: - return "mismatched timestamp"; - case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT: - return "invalid metadata format"; - case IVAS_ERR_ISM_INVALID_METADATA_VALUE: - return "invalid metadata value provided"; - case IVAS_ERR_FAILED_FILE_READ: - return "could not read from file"; - case IVAS_ERR_NOT_SUPPORTED_OPTION: - return "option not supported in this set-up"; - case IVAS_ERR_UNKNOWN: - default: - break; - } - - return "unknown error"; + return ivas_error_to_string( error ); } diff --git a/lib_rend/ivas_lc3plus_dec.c b/lib_rend/ivas_lc3plus_dec.c index 30a7941242..f81d7fd176 100644 --- a/lib_rend/ivas_lc3plus_dec.c +++ b/lib_rend/ivas_lc3plus_dec.c @@ -39,9 +39,9 @@ #include "wmc_auto.h" ivas_error IVAS_LC3PLUS_DEC_Open( - const LC3PLUS_CONFIG config, /* i: decoder configuration */ + const LC3PLUS_CONFIG config, /* i: decoder configuration */ #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ + const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ #endif IVAS_LC3PLUS_DEC_HANDLE *handle /* o: decoder handle */ ) @@ -57,12 +57,12 @@ ivas_error IVAS_LC3PLUS_DEC_Open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); } - if( 0 == config.lc3plus_frame_duration_us ) + if ( 0 == config.lc3plus_frame_duration_us ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid lc3plus_frame_duration_us (0)\n" ); } #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - (*handle)->cachingEnabled = enableCaching; + ( *handle )->cachingEnabled = enableCaching; #endif numLC3plusFramesPerIvasFrame = config.ivas_frame_duration_us / config.lc3plus_frame_duration_us; @@ -81,7 +81,7 @@ ivas_error IVAS_LC3PLUS_DEC_Open( ( *handle )->bitstream_caches = NULL; ( *handle )->handles = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_HANDLE ) ); ( *handle )->selective_decoding_states = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE * ) ); - if ( NULL == ( *handle )->handles || NULL == ( *handle )->selective_decoding_states ) + if ( NULL == ( *handle )->handles || NULL == ( *handle )->selective_decoding_states ) { IVAS_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus wrapper handle\n" ); @@ -93,10 +93,10 @@ ivas_error IVAS_LC3PLUS_DEC_Open( } #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - if(enableCaching) + if ( enableCaching ) { #endif - ( *handle )->bitstream_caches = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE* ) ); + ( *handle )->bitstream_caches = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE * ) ); if ( NULL == ( *handle )->bitstream_caches ) { IVAS_LC3PLUS_DEC_Close( handle ); @@ -113,7 +113,7 @@ ivas_error IVAS_LC3PLUS_DEC_Open( for ( int32_t iCh = 0; iCh < config.channels; iCh++ ) { ( *handle )->selective_decoding_states[iCh] = NULL; - if(NULL != ( *handle )->bitstream_caches) + if ( NULL != ( *handle )->bitstream_caches ) { ( *handle )->bitstream_caches[iCh] = NULL; } @@ -153,7 +153,7 @@ ivas_error IVAS_LC3PLUS_DEC_Open( IVAS_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } - ( *handle )->selective_decoding_states[iCh]->frame_actions = malloc( numLC3plusFramesPerIvasFrame*sizeof(SelectiveDecAction) ); + ( *handle )->selective_decoding_states[iCh]->frame_actions = malloc( numLC3plusFramesPerIvasFrame * sizeof( SelectiveDecAction ) ); if ( NULL == ( *handle )->selective_decoding_states[iCh]->frame_actions ) { IVAS_LC3PLUS_DEC_Close( handle ); @@ -161,23 +161,23 @@ ivas_error IVAS_LC3PLUS_DEC_Open( } ( *handle )->selective_decoding_states[iCh]->has_skipped_a_frame = 0; ( *handle )->selective_decoding_states[iCh]->shall_decode_cached_frame = 0; - for(lc3plusFrameIdx = 0; lc3plusFrameIdx < numLC3plusFramesPerIvasFrame; lc3plusFrameIdx++) + for ( lc3plusFrameIdx = 0; lc3plusFrameIdx < numLC3plusFramesPerIvasFrame; lc3plusFrameIdx++ ) { ( *handle )->selective_decoding_states[iCh]->frame_actions[lc3plusFrameIdx] = DEC_ACTION_DECODE_AND_USE; } #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - if(enableCaching) + if ( enableCaching ) { #endif /* allocate and configure per LC3plus decoder bitstream cache */ - ( *handle )->bitstream_caches[iCh] = malloc( sizeof(IVAS_LC3PLUS_DEC_BITSTREAM_CACHE) ); + ( *handle )->bitstream_caches[iCh] = malloc( sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE ) ); if ( NULL == ( *handle )->bitstream_caches[iCh] ) { IVAS_LC3PLUS_DEC_Close( handle ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" ); } ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity = 400 /*LC3plus max non-HR octet count*/ * numLC3plusFramesPerIvasFrame; - ( *handle )->bitstream_caches[iCh]->bitstream_cache = malloc(( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity); + ( *handle )->bitstream_caches[iCh]->bitstream_cache = malloc( ( *handle )->bitstream_caches[iCh]->bitstream_cache_capacity ); if ( NULL == ( *handle )->bitstream_caches[iCh]->bitstream_cache ) { IVAS_LC3PLUS_DEC_Close( handle ); @@ -203,42 +203,41 @@ ivas_error IVAS_LC3PLUS_DEC_Open( return IVAS_ERR_OK; } -ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix(int16_t ***subframeChannelMatrix, const uint32_t num_decs) +ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( int16_t ***subframeChannelMatrix, const uint32_t num_decs ) { - *subframeChannelMatrix = malloc(MAX_PARAM_SPATIAL_SUBFRAMES * sizeof(int16_t *)); - if(NULL == *subframeChannelMatrix) + *subframeChannelMatrix = malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( int16_t * ) ); + if ( NULL == *subframeChannelMatrix ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); } - for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + for ( int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { - (*subframeChannelMatrix)[i] = NULL; + ( *subframeChannelMatrix )[i] = NULL; } - for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + for ( int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { - (*subframeChannelMatrix)[i] = malloc(num_decs * sizeof(int16_t)); - if(NULL == (*subframeChannelMatrix)[i]) + ( *subframeChannelMatrix )[i] = malloc( num_decs * sizeof( int16_t ) ); + if ( NULL == ( *subframeChannelMatrix )[i] ) { - IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(*subframeChannelMatrix); + IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( *subframeChannelMatrix ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "subframeChannelMatrix allocation failed\n" ); } } return IVAS_ERR_OK; } -void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(int16_t **subframeChannelMatrix) +void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( int16_t **subframeChannelMatrix ) { - for (int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++) + for ( int i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { - free(subframeChannelMatrix[i]); + free( subframeChannelMatrix[i] ); } - free(subframeChannelMatrix); + free( subframeChannelMatrix ); } ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ - int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] -) + int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] ) { int16_t numIvasSubFramesPerLC3frame; uint32_t decIdx; @@ -253,16 +252,16 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "subframeChannelMatrix is NULL\n" ); } - if(handle->config.lc3plus_frame_duration_us == 0 || handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) + if ( handle->config.lc3plus_frame_duration_us == 0 || handle->config.ivas_frame_duration_us % handle->config.lc3plus_frame_duration_us != 0 ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "invalid ivas_frame_duration_us/lc3plus_frame_duration_us values\n" ); } - effectiveIvasSubframeDuration = handle->config.ivas_frame_duration_us == 20000 ? handle->config.ivas_frame_duration_us/MAX_PARAM_SPATIAL_SUBFRAMES : handle->config.ivas_frame_duration_us; - numIvasSubFramesPerLC3frame = handle->config.lc3plus_frame_duration_us/effectiveIvasSubframeDuration; + effectiveIvasSubframeDuration = handle->config.ivas_frame_duration_us == 20000 ? handle->config.ivas_frame_duration_us / MAX_PARAM_SPATIAL_SUBFRAMES : handle->config.ivas_frame_duration_us; + numIvasSubFramesPerLC3frame = handle->config.lc3plus_frame_duration_us / effectiveIvasSubframeDuration; actual_num_spatial_subframes = handle->config.ivas_frame_duration_us / effectiveIvasSubframeDuration; // 0.5(0) = 10ms lc3plus, 5ms subframe - if(numIvasSubFramesPerLC3frame != 1) + if ( numIvasSubFramesPerLC3frame != 1 ) { return IVAS_ERROR( IVAS_ERR_NOT_IMPLEMENTED, "Selective decoding is only implemented for aligned IVAS-Subframes & LC3plus \n" ); } @@ -270,11 +269,11 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( /* map subframeChannelMatrix to lc3plus skip states */ /* 1st pass: Flag the required frames */ - for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) { - for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) { - if( 1 == subframeChannelMatrix[ivasSubframeIdx][decIdx] ) + if ( 1 == subframeChannelMatrix[ivasSubframeIdx][decIdx] ) { /* subframe needed by the user, definitely decode */ handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_USE; @@ -283,11 +282,11 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( { /* subframe not needed by the user, but might be required to re-initialize a decoder after inactivity */ - if( + if ( #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING handle->cachingEnabled && #endif - (ivasSubframeIdx != actual_num_spatial_subframes - 1) && 1 == subframeChannelMatrix[ivasSubframeIdx + 1][decIdx] ) + ( ivasSubframeIdx != actual_num_spatial_subframes - 1 ) && 1 == subframeChannelMatrix[ivasSubframeIdx + 1][decIdx] ) { /* ... but if the following subframe is required, it needs to be decoded and dropped */ handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] = DEC_ACTION_DECODE_AND_DROP; @@ -300,23 +299,23 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( } } #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - if(handle->cachingEnabled) + if ( handle->cachingEnabled ) { #endif /* if a decoder was paused before, it needs to either: - * - Decode the cached frame (if available) and the first required frame OR - * - Decode the previous LC3plus subframe, even if it isn't needed by the user */ - for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + * - Decode the cached frame (if available) and the first required frame OR + * - Decode the previous LC3plus subframe, even if it isn't needed by the user */ + for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) { - if( handle->selective_decoding_states[decIdx]->has_skipped_a_frame ) + if ( handle->selective_decoding_states[decIdx]->has_skipped_a_frame ) { /* find the first frame required by the user */ - for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) { - if( DEC_ACTION_DECODE_AND_USE == handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] ) + if ( DEC_ACTION_DECODE_AND_USE == handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] ) { /* The first required frame is the first subframe. To flush the decoder, the cached frame must be decoded and dropped */ - if(0 == ivasSubframeIdx) + if ( 0 == ivasSubframeIdx ) { handle->selective_decoding_states[decIdx]->shall_decode_cached_frame = 1; break; @@ -333,12 +332,11 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( } /* if a dec gets paused & caching is activated we need to flag the last useful LC3plus frame for caching */ - for(decIdx = 0; decIdx < handle->num_decs; decIdx++) + for ( decIdx = 0; decIdx < handle->num_decs; decIdx++ ) { - for( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) + for ( ivasSubframeIdx = 0; ivasSubframeIdx < actual_num_spatial_subframes; ivasSubframeIdx++ ) { - if( handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] == DEC_ACTION_SKIP - && handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] != DEC_ACTION_DECODE_AND_USE ) + if ( handle->selective_decoding_states[decIdx]->frame_actions[ivasSubframeIdx] == DEC_ACTION_SKIP && handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] != DEC_ACTION_DECODE_AND_USE ) { handle->selective_decoding_states[decIdx]->frame_actions[actual_num_spatial_subframes - 1] = DEC_ACTION_CACHE; } @@ -394,7 +392,7 @@ void IVAS_LC3PLUS_DEC_Close( return; } #ifdef LC3PLUS_DEC_COLLECT_STATS - printLC3plusDecStats( &(*handle)->stats ); + printLC3plusDecStats( &( *handle )->stats ); #endif for ( uint32_t iDec = 0; iDec < ( *handle )->num_decs; iDec++ ) { @@ -421,7 +419,7 @@ void IVAS_LC3PLUS_DEC_Close( free( ( *handle )->pcm_conversion_buffer ); } free( ( *handle )->handles ); - if( NULL != ( *handle )->bitstream_caches ) + if ( NULL != ( *handle )->bitstream_caches ) { free( ( *handle )->bitstream_caches ); } @@ -431,11 +429,11 @@ void IVAS_LC3PLUS_DEC_Close( } static ivas_error decode_or_conceal_one_lc3plus_frame( - LC3PLUS_Dec* dec, - uint8_t* bitstream_in, + LC3PLUS_Dec *dec, + uint8_t *bitstream_in, const int32_t bitstream_in_length, int16_t **pcm_out_buffer, - const int32_t badFrameIndicator) + const int32_t badFrameIndicator ) { LC3PLUS_Error err; push_wmops( "lc3plus_dec16" ); @@ -448,7 +446,7 @@ static ivas_error decode_or_conceal_one_lc3plus_frame( } if ( err != LC3PLUS_OK ) { - return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr(err), "lc3plus_dec16 failed\n" ); + return IVAS_ERROR( IVAS_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec16 failed\n" ); } return IVAS_ERR_OK; } @@ -503,9 +501,9 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( { for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) { - if( handle->selective_decoding_states[iDec]->shall_decode_cached_frame) + if ( handle->selective_decoding_states[iDec]->shall_decode_cached_frame ) { - if(0 == handle->bitstream_caches[iDec]->bitstream_cache_size) + if ( 0 == handle->bitstream_caches[iDec]->bitstream_cache_size ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "LC3plus cache is empty\n" ); } @@ -515,7 +513,7 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( handle->bitstream_caches[iDec]->bitstream_cache_size, &handle->pcm_conversion_buffer, badFrameIndicator ); - if(err != IVAS_ERR_OK) + if ( err != IVAS_ERR_OK ) { return IVAS_ERROR( err, "lc3plus decoding failed\n" ); } @@ -526,7 +524,7 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( #endif } /* reset cache if caching is enabled - it has either been decoded or is not needed */ - if(NULL != handle->bitstream_caches) + if ( NULL != handle->bitstream_caches ) { handle->bitstream_caches[iDec]->bitstream_cache_size = 0; } @@ -538,7 +536,7 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( case DEC_ACTION_DECODE_AND_DROP: { err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator ); - if(err != IVAS_ERR_OK) + if ( err != IVAS_ERR_OK ) { return IVAS_ERROR( err, "lc3plus decoding failed\n" ); } @@ -548,7 +546,7 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( case DEC_ACTION_DECODE_AND_USE: { err = decode_or_conceal_one_lc3plus_frame( handle->handles[iDec], bitstream_in_iter, bitstreamOffsetPerCoder, &handle->pcm_conversion_buffer, badFrameIndicator ); - if(err != IVAS_ERR_OK) + if ( err != IVAS_ERR_OK ) { return IVAS_ERROR( err, "lc3plus decoding failed\n" ); } @@ -569,12 +567,12 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( } case DEC_ACTION_CACHE: { - if( handle->bitstream_caches[iDec]->bitstream_cache_capacity < bitstreamOffsetPerCoder ) + if ( handle->bitstream_caches[iDec]->bitstream_cache_capacity < bitstreamOffsetPerCoder ) { return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "bitstream_cache_capacity is too low for LC3plus frame size\n" ); } /* store bit rate of cached frame */ - mvc2c(bitstream_in_iter, handle->bitstream_caches[iDec]->bitstream_cache, bitstreamOffsetPerCoder); + mvc2c( bitstream_in_iter, handle->bitstream_caches[iDec]->bitstream_cache, bitstreamOffsetPerCoder ); handle->bitstream_caches[iDec]->bitstream_cache_size = bitstreamOffsetPerCoder; /* log that this instance has skipped a frame and must decode twice once reactivated */ handle->selective_decoding_states[iDec]->has_skipped_a_frame = 1; @@ -587,7 +585,7 @@ static ivas_error IVAS_LC3PLUS_DEC_Decode_or_Conceal_internal( bitstream_in_iter += bitstreamOffsetPerCoder; } /* reset skipping state, must be set by the user before each decode call*/ - for(iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++) + for ( iLc3plusFrame = 0; iLc3plusFrame < lc3framesPerIvasFrame; iLc3plusFrame++ ) { handle->selective_decoding_states[iDec]->frame_actions[iLc3plusFrame] = DEC_ACTION_DECODE_AND_USE; } @@ -643,36 +641,33 @@ ivas_error IVAS_LC3PLUS_DEC_Conceal( #ifdef LC3PLUS_DEC_COLLECT_STATS -void printLC3plusDecStats(const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats) +void printLC3plusDecStats( const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats ) { int32_t sum_pushed_frames = 0; int32_t sum_decoded_and_dropped_frames, sum_skipped_frames; - sum_pushed_frames = stats->action_histogram[DEC_ACTION_DECODE_AND_USE] - + stats->action_histogram[DEC_ACTION_SKIP] - + stats->action_histogram[DEC_ACTION_CACHE]; + sum_pushed_frames = stats->action_histogram[DEC_ACTION_DECODE_AND_USE] + stats->action_histogram[DEC_ACTION_SKIP] + stats->action_histogram[DEC_ACTION_CACHE]; sum_decoded_and_dropped_frames = - stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] - + stats->num_cached_frames_decoded_and_dropped; + stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] + stats->num_cached_frames_decoded_and_dropped; sum_skipped_frames = stats->action_histogram[DEC_ACTION_SKIP] + stats->action_histogram[DEC_ACTION_CACHE]; - if( sum_pushed_frames == 0) + if ( sum_pushed_frames == 0 ) { - printf( "\n Dec didn't run"); + printf( "\n Dec didn't run" ); return; } - printf( "\nsum_pushed_frames: %i\n" , sum_pushed_frames ); - printf( " DECODE_AND_USE count: %i \n" , stats->action_histogram[DEC_ACTION_DECODE_AND_USE]); - printf( " SKIP count: %i\n" , stats->action_histogram[DEC_ACTION_SKIP]); - printf( " CACHE count: %i\n" , stats->action_histogram[DEC_ACTION_CACHE]); + printf( "\nsum_pushed_frames: %i\n", sum_pushed_frames ); + printf( " DECODE_AND_USE count: %i \n", stats->action_histogram[DEC_ACTION_DECODE_AND_USE] ); + printf( " SKIP count: %i\n", stats->action_histogram[DEC_ACTION_SKIP] ); + printf( " CACHE count: %i\n", stats->action_histogram[DEC_ACTION_CACHE] ); printf( "Decoded-and-Dropped:\n" ); - printf( " DECODE_AND_DROP count: %i \n" , stats->action_histogram[DEC_ACTION_DECODE_AND_DROP]); - printf( " DEC_CACHE count: %i\n" , stats->num_cached_frames_decoded_and_dropped); - printf( " perc of req : %f\n" , 100.f*(float)sum_decoded_and_dropped_frames/ sum_pushed_frames ); - printf( "Workload saved: \n"); - printf( " Skipped perc. of req %f\n", 100.f*(float)sum_skipped_frames/ sum_pushed_frames ); + printf( " DECODE_AND_DROP count: %i \n", stats->action_histogram[DEC_ACTION_DECODE_AND_DROP] ); + printf( " DEC_CACHE count: %i\n", stats->num_cached_frames_decoded_and_dropped ); + printf( " perc of req : %f\n", 100.f * (float) sum_decoded_and_dropped_frames / sum_pushed_frames ); + printf( "Workload saved: \n" ); + printf( " Skipped perc. of req %f\n", 100.f * (float) sum_skipped_frames / sum_pushed_frames ); } #endif diff --git a/lib_rend/ivas_lc3plus_dec.h b/lib_rend/ivas_lc3plus_dec.h index 45bbef86a1..38abf70bd6 100644 --- a/lib_rend/ivas_lc3plus_dec.h +++ b/lib_rend/ivas_lc3plus_dec.h @@ -61,7 +61,7 @@ typedef struct IVAS_LC3PLUS_DEC_COLLECT_STATS int32_t num_cached_frames_decoded_and_dropped; } IVAS_LC3PLUS_DEC_COLLECT_STATS; -void printLC3plusDecStats(const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats); +void printLC3plusDecStats( const IVAS_LC3PLUS_DEC_COLLECT_STATS *stats ); #endif typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE @@ -76,9 +76,9 @@ typedef struct IVAS_LC3PLUS_DEC_SELECTIVE_DECODING_STATE typedef struct IVAS_LC3PLUS_DEC_BITSTREAM_CACHE { - uint8_t* bitstream_cache; - int32_t bitstream_cache_capacity; - int32_t bitstream_cache_size; + uint8_t *bitstream_cache; + int32_t bitstream_cache_capacity; + int32_t bitstream_cache_size; } IVAS_LC3PLUS_DEC_BITSTREAM_CACHE; /* decoder wrapper */ @@ -99,9 +99,9 @@ typedef struct IVAS_LC3PLUS_DEC_HANDLE } * IVAS_LC3PLUS_DEC_HANDLE; ivas_error IVAS_LC3PLUS_DEC_Open( - const LC3PLUS_CONFIG config, /* i: decoder configuration */ + const LC3PLUS_CONFIG config, /* i: decoder configuration */ #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING - const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ + const int16_t enableCaching, /* i: if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */ #endif IVAS_LC3PLUS_DEC_HANDLE *handle /* o: decoder handle */ ); @@ -117,7 +117,7 @@ void IVAS_LC3PLUS_DEC_Close( /*! Sets a matrix[MAX_PARAM_SPATIAL_SUBFRAMES][numLC3plusDecoders] where all require subframes must be flagged with 1, frames that are not required with 0 */ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix( - IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ + IVAS_LC3PLUS_DEC_HANDLE handle, /* i: decoder handle */ int16_t *subframeChannelMatrix[MAX_PARAM_SPATIAL_SUBFRAMES] /* i: */ ); @@ -133,6 +133,6 @@ ivas_error IVAS_LC3PLUS_DEC_Conceal( float **pcm_out /* o: concealed samples */ ); -ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix(int16_t ***subframeChannelMatrix, uint32_t num_decs); +ivas_error IVAS_LC3PLUS_DEC_AllocateSubframeDecodingMatrix( int16_t ***subframeChannelMatrix, uint32_t num_decs ); -void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix(int16_t **subframeChannelMatrix); +void IVAS_LC3PLUS_DEC_FreeSubframeDecodingMatrix( int16_t **subframeChannelMatrix ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 1d5aec07fa..6149a97d71 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -579,6 +579,7 @@ int32_t ivas_get_split_rend_md_target_brate( const int32_t SplitRendBitRate, con int32_t ivas_get_lc3plus_bitrate( const int32_t SplitRendBitRate, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); int8_t ivas_get_lc3plus_bitrate_id( const int32_t SplitRendBitRate ); int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode ); +ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig ); #endif void ivas_split_rend_get_quant_params( const int16_t num_md_bands, @@ -1106,7 +1107,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( float out[][L_FRAME48k], const int16_t low_res_pre_rend_rot, #ifdef SPLIT_REND_LC3PLUS - const int8_t td_input, + int8_t td_input, #endif const int16_t pcm_out ); diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index ba1ce4244c..da1c8b9bca 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -1307,7 +1307,7 @@ static void ivas_SplitRenderer_quant_code( void ivas_SplitRenderer_GetRotMd( - BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_RealBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ float Cldfb_ImagBuffer_Ref_Binaural[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ @@ -1645,12 +1645,18 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, uint8_t useLc3plus; uint8_t isCldfbNeeded = 0; + if ( ( error = ivas_split_rend_validate_config( pSplitRendConfig ) ) != IVAS_ERR_OK ) + { + return error; + } + useLc3plus = pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LC3PLUS; /* TODO(sgi): change "useLc3plus" to "splitCodec" */ #endif error = IVAS_ERR_OK; #ifdef SPLIT_REND_LC3PLUS - if ( is_cldfb_in == 0 ) + if ( + is_cldfb_in == 0 ) { isCldfbNeeded = 1; cldfbMode = CLDFB_ANALYSIS; @@ -1688,12 +1694,7 @@ ivas_error ivas_split_renderer_open( SPLIT_REND_WRAPPER *hSplitRendWrapper, #else num_ch = hSplitRendWrapper->multiBinPoseData.num_poses * BINAURAL_CHANNELS; #endif -#ifdef SPLIT_REND_LC3PLUS - if ( cldfbMode == CLDFB_SYNTHESIS ) - { - num_ch = BINAURAL_CHANNELS; - } -#endif + for ( ch = 0; ch < num_ch; ch++ ) { if ( ( error = openCldfb( &( hSplitRendWrapper->hCldfbHandles->cldfbAna[ch] ), @@ -2085,7 +2086,7 @@ ivas_error ivas_renderMultiBinToSplitBinaural( float out[][L_FRAME48k], const int16_t low_res_pre_rend_rot, #ifdef SPLIT_REND_LC3PLUS - const int8_t td_input, + int8_t td_input, #endif const int16_t pcm_out ) { diff --git a/lib_rend/ivas_splitRenderer_utils.c b/lib_rend/ivas_splitRenderer_utils.c index b84c37dbb5..50d70ceb31 100644 --- a/lib_rend/ivas_splitRenderer_utils.c +++ b/lib_rend/ivas_splitRenderer_utils.c @@ -538,6 +538,58 @@ int32_t ivas_get_lc3plus_size_from_id( const int8_t SplitRendBitRateId, IVAS_SPL /* Return size in bytes */ return bitrate / FRAMES_PER_SECOND / 8; } + +ivas_error ivas_split_rend_validate_config( const IVAS_SPLIT_REND_CONFIG_DATA *pSplitRendConfig ) +{ + /* Valid DOF range is 0-3 */ + if ( pSplitRendConfig->dof < 0 || pSplitRendConfig->dof > 3 ) + { + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } + + if ( pSplitRendConfig->codec == IVAS_SPLIT_REND_CODEC_LCLD ) + { + /* LCLD only supports CLDFB head pose correction */ + if ( pSplitRendConfig->poseCorrectionMode != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) + { + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } + + /* LCLD doesn't support 0-DOF */ + if ( pSplitRendConfig->dof == 0 ) + { + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } + } + + /* Only CLDFB pose correction supports HQ mode */ + if ( pSplitRendConfig->poseCorrectionMode != IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB && pSplitRendConfig->hq_mode != 0 ) + { + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } + + /* Validate bitrate */ + switch ( pSplitRendConfig->splitRendBitRate ) + { + case SPLIT_REND_256k: + case SPLIT_REND_384k: + case SPLIT_REND_512k: + case SPLIT_REND_768k: + /* Always valid */ + break; + case SPLIT_REND_320k: + /* Only valid with 0 DOF */ + if ( pSplitRendConfig->dof != 0 ) + { + return IVAS_ERR_INVALID_SPLIT_REND_CONFIG; + } + break; + default: + return IVAS_ERR_LC3PLUS_INVALID_BITRATE; + } + + return IVAS_ERR_OK; +} #endif void ivas_split_rend_get_quant_params( diff --git a/lib_rend/lc3plus_codec/get_lc3plus.ps1 b/lib_rend/lc3plus_codec/get_lc3plus.ps1 new file mode 100755 index 0000000000..d660f78310 --- /dev/null +++ b/lib_rend/lc3plus_codec/get_lc3plus.ps1 @@ -0,0 +1,9 @@ +# This script shall only be used by automated continuous integration systems +# Humans shall follow the instructions in lib_rend/lc3plus_codec/README.md +Remove-Item -Force -Recurse ETSI_Release -ErrorAction 'silentlycontinue' +(new-object System.Net.WebClient).DownloadFile('https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip',"$(pwd)\lc3plus_sources.zip") +Expand-Archive -Force -Path .\lc3plus_sources.zip -DestinationPath . +Remove-Item -Force lc3plus_sources.zip +git apply --ignore-whitespace lc3plus.patch +Remove-Item -Force ETSI_Release\LC3plus_ETSI_src_va15eb59632b_20230228\src\floating_point\fft.c +Remove-Item -Force ETSI_Release\LC3plus_ETSI_src_va15eb59632b_20230228\src\floating_point\codec_exe.c diff --git a/lib_rend/lc3plus_codec/get_lc3plus.sh b/lib_rend/lc3plus_codec/get_lc3plus.sh index ab578850cc..f605c98688 100755 --- a/lib_rend/lc3plus_codec/get_lc3plus.sh +++ b/lib_rend/lc3plus_codec/get_lc3plus.sh @@ -1,5 +1,6 @@ # This script shall only be used by automated continuous integration systems # Humans shall follow the instructions in lib_rend/lc3plus_codec/README.md +rm -rf ETSI_Release curl -o ./lc3plus_sources.zip https://www.etsi.org/deliver/etsi_ts/103600_103699/103634/01.04.01_60/ts_103634v010401p0.zip unzip lc3plus_sources.zip -d . rm -f lc3plus_sources.zip diff --git a/lib_rend/lc3plus_codec/lc3plus.patch b/lib_rend/lc3plus_codec/lc3plus.patch index 8ebffc6289..816f664fef 100644 --- a/lib_rend/lc3plus_codec/lc3plus.patch +++ b/lib_rend/lc3plus_codec/lc3plus.patch @@ -1,6 +1,6 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/adjust_global_gain.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -11,7 +11,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processAdjustGlobalGain_fl(LC3_INT* gg_idx, LC3_INT gg_idx_min, LC3_INT gg_idx_off, LC3_FLOAT* gain, LC3_INT target, LC3_INT nBits, LC3_INT* gainChange, LC3_INT fs_idx diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/al_fec_fl.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -32,7 +32,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin blacklist[0] = 0; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/apply_global_gain.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -43,7 +43,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processApplyGlobalGain_fl(LC3_FLOAT x[], LC3_INT xLen, LC3_INT global_gain_idx, LC3_INT global_gain_off) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ari_codec.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -83,7 +83,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin nbits_ari = nbits_ari + 8; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/attack_detector.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -94,7 +94,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void attack_detector_fl(LC3_FLOAT* in, LC3_INT frame_size, LC3_INT fs, LC3_INT* lastAttackPosition, LC3_FLOAT* accNrg, LC3_INT* attackFlag, diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/constants.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -105,7 +105,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /* DCT */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/cutoff_bandwidth.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -116,7 +116,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void process_cutoff_bandwidth(LC3_FLOAT *d_fl, LC3_INT len, LC3_INT bw_bin) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dct4.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -164,7 +164,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin tmp1[i] = cmul(cmplx(input[i * 2], input[len - i * 2 - 1]), dct->twid1[i]); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_entropy.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -193,7 +193,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (*lastnz > N) { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/dec_lc3_fl.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -214,7 +214,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin # ifdef ENABLE_025_DMS_MODE diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-05-26 10:23:38 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/defines.h 2023-05-31 14:59:52 @@ -24,13 +24,13 @@ typedef uint32_t LC3_UINT32; @@ -244,7 +244,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #define LC3_SQRT(x) (sqrtf(x)) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/detect_cutoff_warped.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -264,7 +264,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin brickwall = 1; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_entropy.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -289,7 +289,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /* LSB mode bit */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/enc_lc3_fl.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -300,7 +300,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s_in, uint8_t* bytes, int bps diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/estimate_global_gain.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -331,7 +331,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/cfft.c 2023-05-31 14:59:52 @@ -8,7 +8,7 @@ ******************************************************************************/ @@ -343,7 +343,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #include /* for abs() */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.c 2023-05-31 14:59:52 @@ -8,14 +8,15 @@ ******************************************************************************/ @@ -389,7 +389,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } else { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-05-26 10:23:38 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iis_fft.h 2023-05-31 14:59:52 @@ -12,6 +12,7 @@ #define IIS_FFT_H @@ -400,7 +400,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #ifdef __cplusplus diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -411,7 +411,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #include /* for mmove */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-05-26 10:23:38 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft/iisfft.h 2023-05-31 14:59:52 @@ -11,6 +11,7 @@ #ifndef IISFFT_H #define IISFFT_H @@ -420,112 +420,9 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #ifndef M_PIl #define M_PIl 3.1415926535897932384626433832795029L /* pi */ -diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c ---- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/fft.c 1970-01-01 01:00:00 -@@ -1,99 +0,0 @@ --/****************************************************************************** --* ETSI TS 103 634 V1.4.1 * --* Low Complexity Communication Codec Plus (LC3plus) * --* * --* Copyright licence is solely granted through ETSI Intellectual Property * --* Rights Policy, 3rd April 2019. No patent licence is granted by implication, * --* estoppel or otherwise. * --******************************************************************************/ -- -- --#include "functions.h" --#include "fft/iis_fft.c" --#include "fft/iisfft.c" --#include "fft/cfft.c" -- --void fft_init(Fft* fft, int length) --{ -- assert(length % 2 == 0); -- HANDLE_IIS_FFT handle = NULL; -- IIS_FFT_ERROR error = 0; -- -- fft->length = length; -- -- error = LC3_IIS_CFFT_Create(&handle, length, IIS_FFT_FWD); -- -- assert(error == IIS_FFT_NO_ERROR); -- fft->handle = handle; --} -- --void fft_free(Fft* fft) --{ -- IIS_FFT_ERROR error = 0; -- -- if (fft) { -- error = LC3_IIS_CFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); -- -- assert(error == IIS_FFT_NO_ERROR); -- memset(fft, 0, sizeof(*fft)); -- } --} -- --void real_fft_free(Fft* fft) --{ -- IIS_FFT_ERROR error = 0; -- -- if (fft) { -- error = LC3_IIS_RFFT_Destroy((HANDLE_IIS_FFT *) &fft->handle); -- -- assert(error == IIS_FFT_NO_ERROR); -- memset(fft, 0, sizeof(*fft)); -- } --} -- --void real_fft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) --{ -- assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ -- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; -- -- fft->length = length; -- -- error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_FWD); -- assert(error == IIS_FFT_NO_ERROR); -- fft->handle = *handle; --} -- -- --void real_ifft_init(Fft* fft, LC3_INT32 length, HANDLE_IIS_FFT *handle) --{ -- assert(length % 4 == 0); /* due to current limitation of core complex FFTs*/ -- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; -- -- fft->length = length; -- -- error = LC3_IIS_RFFT_Create(handle, length, IIS_FFT_BWD); -- -- assert(error == IIS_FFT_NO_ERROR); -- fft->handle = *handle; --} -- --void fft_apply(Fft* fft, const Complex* input, Complex* output) --{ -- IIS_FFT_ERROR error = 0; -- error = LC3_IIS_FFT_Apply_CFFT(fft->handle, input, output); -- -- assert(error == IIS_FFT_NO_ERROR); --} -- -- --void real_fft_apply(Fft* fft, const LC3_FLOAT* input, LC3_FLOAT* output) --{ -- IIS_FFT_ERROR error = IIS_FFT_NO_ERROR; -- -- UNUSED(error); -- -- error = LC3_IIS_FFT_Apply_RFFT(fft->handle, input, output); -- -- assert(error == IIS_FFT_NO_ERROR); --} -- diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/imdct.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -536,7 +433,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /* Function expects already flipped window */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -667,7 +564,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin encoder->epmode = oldEpmode; // preserve old epmode in case of failure diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 1970-01-01 01:00:00 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/lc3plus_fft.c 2023-05-31 14:59:52 @@ -0,0 +1,99 @@ +/****************************************************************************** +* ETSI TS 103 634 V1.4.1 * @@ -770,7 +667,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin +} diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_coder.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -781,7 +678,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static LC3_INT searchMaxIndice(LC3_FLOAT* in, LC3_INT len); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/ltpf_decoder.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -792,7 +689,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void process_ltpf_decoder_fl(LC3_FLOAT* x, LC3_INT xLen, LC3_FLOAT* y, LC3_INT fs, LC3_FLOAT* mem_old_x, LC3_FLOAT* mem_old_y, diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -820,7 +717,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin output[hlen + i] = tmp[i] - tmp[hlen * 2 - i - 1]; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/mdct_shaping.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -829,9 +726,161 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #include "functions.h" void processMdctShaping_fl(LC3_FLOAT x[], LC3_FLOAT scf[], const LC3_INT bands_offset[], LC3_INT fdns_npts) +diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/LC3plus.vcxproj mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/LC3plus.vcxproj +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/LC3plus.vcxproj 2023-02-28 20:25:37 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/msvc/LC3plus.vcxproj 2023-06-12 14:50:03 +@@ -26,31 +26,18 @@ + + + +- Application ++ StaticLibrary + true + v141 + Unicode + + +- Application ++ StaticLibrary + false + v141 + true + Unicode + +- +- Application +- true +- v141 +- Unicode +- +- +- Application +- false +- v141 +- true +- Unicode +- + + + +@@ -62,12 +49,6 @@ + + + +- +- +- +- +- +- + + + true +@@ -75,30 +56,20 @@ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\Obj\ + +- +- true +- LC3plus +- $(Platform)\$(Configuration)\ +- $(Platform)\$(Configuration)\Obj\ +- + + false + LC3plus + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\Obj\ + +- +- false +- LC3plus +- $(Platform)\$(Configuration)\ +- $(Platform)\$(Configuration)\Obj\ +- + + + + + Level3 ++ ..\..\..\..\..\..\..\lib_com;%(AdditionalIncludeDirectories) + Disabled ++ MultiThreadedDebug + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4305;4244;4996 + +@@ -107,25 +78,14 @@ + true + + +- +- +- +- +- Level3 +- Disabled +- _DEBUG;_CONSOLE;%(PreprocessorDefinitions) +- +- +- Console +- true +- +- + + + Level3 + + ++ ..\..\..\..\..\..\..\lib_com;%(AdditionalIncludeDirectories) + MaxSpeed ++ MultiThreaded + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) +@@ -138,31 +98,12 @@ + true + + +- +- +- Level3 +- +- +- MaxSpeed +- true +- true +- NDEBUG;_CONSOLE;%(PreprocessorDefinitions) +- 4244;4305;4267;4996 +- +- +- Console +- true +- true +- true +- +- + + + + + + +- + + + +@@ -173,7 +114,7 @@ + + + +- ++ + + + diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-05-26 10:38:32 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/near_nyquist_detector.c 2023-06-12 12:10:26 @@ -8,15 +8,16 @@ ******************************************************************************/ @@ -853,7 +902,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_factor.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -864,7 +913,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gg, LC3_INT BW_cutoff_idx, LC3_INT frame_dms, diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/noise_filling.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -875,7 +924,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processNoiseFilling_fl(LC3_FLOAT xq[], LC3_INT nfseed, LC3_INT fac_ns_idx, LC3_INT bw_stopband, LC3_INT frame_dms, LC3_FLOAT fac_ns_pc, LC3_INT spec_inv_idx) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/olpa.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -886,7 +935,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static void filter_olpa(LC3_FLOAT* in, LC3_FLOAT* out, const LC3_FLOAT* buf, LC3_FLOAT len_buf, LC3_INT len_input); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_apply.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -897,7 +946,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_classify.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -908,7 +957,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_main.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -919,7 +968,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/pc_update.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -930,7 +979,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/per_band_energy.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -941,7 +990,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_classify.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -952,7 +1001,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_compute_stab_fac.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -963,7 +1012,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_damping_scrambling.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -974,7 +1023,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_main.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1003,7 +1052,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin if (prev_bfi_plc2 == 0) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1014,7 +1063,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_noise_substitution0.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1025,7 +1074,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_f0_refine_first.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1036,7 +1085,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_fec_hq.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1047,7 +1096,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_hq_ecu.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1058,7 +1107,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_lf_peak_analysis.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1069,7 +1118,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_rec_frame.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1080,7 +1129,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_setf0hz.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1091,7 +1140,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_spec_ana.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1118,7 +1167,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_subst_spec.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1162,7 +1211,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin } diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-05-26 10:38:32 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_per_band_gain.c 2023-06-12 12:10:26 @@ -6,13 +6,14 @@ * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * @@ -1195,7 +1244,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_spect_Xavg.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1206,7 +1255,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_tba_trans_dect_gains.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1217,7 +1266,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-05-26 10:38:32 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_phecu_trans_burst_ana_sub.c 2023-06-12 12:10:26 @@ -6,16 +6,17 @@ * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * * estoppel or otherwise. * @@ -1260,7 +1309,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin return; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1271,7 +1320,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin \***************************************************************************/ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_tdc_tdac.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1282,7 +1331,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/plc_update.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1292,8 +1341,8 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processPlcUpdate_fl(PlcAdvSetup *PlcAdvSetup, LC3_INT32 frame_length, LC3_FLOAT *syntM, LC3_FLOAT *scf_q, diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c ---- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-05-26 10:24:14 +--- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-06-12 12:26:35 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/quantize_spec.c 2023-06-12 12:28:54 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1304,7 +1353,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static LC3_INT sign(LC3_FLOAT x); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/reorder_bitstream.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1315,7 +1364,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/resamp12k8.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1366,7 +1415,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin LC3_FLOAT y1 = (highpass50_filt_b[0] * bufdown[i] + u_11); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_coding.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1377,7 +1426,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processResidualCoding_fl(LC3_FLOAT x[], LC3_INT xq[], LC3_FLOAT gain, LC3_INT L_spec, LC3_INT targetBits, LC3_INT nBits, uint8_t* resBits, LC3_INT* numResBits diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/residual_decoding.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1388,7 +1437,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processResidualDecoding_fl(LC3_INT* bitsRead, LC3_FLOAT x[], LC3_INT L_spec, uint8_t prm[], LC3_INT resQBits diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_com_lc3.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1399,7 +1448,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_dec_lc3.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1444,7 +1493,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin { diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/setup_enc_lc3.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1496,7 +1545,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin setup->targetBitsInit = setup->targetBitsInit - 1; diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_compute_scf.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1516,7 +1565,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin /* Downsampling */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_interpolate_scf.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1527,7 +1576,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int) diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/sns_quantize_scf.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1538,7 +1587,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static void pvq_dec(LC3_INT k, LC3_INT m, LC3_INT LS_ind, LC3_INT MPVQ_ind, LC3_INT* pulses); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-05-26 10:23:38 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tinywavein_c.h 2023-05-31 14:59:52 @@ -17,6 +17,7 @@ #include #include @@ -1549,7 +1598,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin #define __TWI_LE /* _T_iny _W_ave _I_n _L_ittle _E_ndian */ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_coder.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ @@ -1560,7 +1609,7 @@ diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_poin static void xcorr(LC3_FLOAT* in, LC3_FLOAT* out, LC3_INT lag, LC3_INT inLen); diff -Naur ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c --- ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-02-28 20:25:37 -+++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-05-26 10:24:14 ++++ mod/ETSI_Release/LC3plus_ETSI_src_va15eb59632b_20230228/src/floating_point/tns_decoder.c 2023-05-31 14:59:52 @@ -8,6 +8,7 @@ ******************************************************************************/ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e81a6a2b7c..1647424486 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2486,6 +2486,7 @@ updateSbaPanGains( &rendCtx.hhRendererConfig[0]->split_rend_config, &inputSba->splitRendWrapper.multiBinPoseData, rendCtx.pHeadRotData->sr_pose_pred_axis ); + #if defined DEBUGGING && defined SPLIT_REND_WITH_HEAD_ROT /* TODO: redundant nested switch SPLIT_REND_WITH_HEAD_ROT */ if ( hRendCfg->renderer_type_override == RENDER_TYPE_OVERRIDE_FASTCONV ) @@ -4527,6 +4528,7 @@ ivas_error IVAS_REND_InitConfig( return IVAS_ERR_OK; } +#ifndef SPLIT_REND_LC3PLUS /* Functionality moved to ivas_split_rend_validate_config() */ #ifdef SPLIT_REND_WITH_HEAD_ROT static int16_t is_SplitRend_BitRate( const int32_t splitRendBitRate ) { @@ -4544,6 +4546,7 @@ static int16_t is_SplitRend_BitRate( const int32_t splitRendBitRate ) return 1; } #endif +#endif /*-------------------------------------------------------------------* * IVAS_REND_GetRenderConfig() @@ -4660,6 +4663,11 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; + if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config ) ) != IVAS_ERR_OK ) + { + return error; + } + /* Must re-initialize split rendering config which depends on renderer config */ closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) @@ -6558,7 +6566,6 @@ static ivas_error renderSbaToSplitBinaural( push_wmops( "renderSbaToSplitBinaural" ); error = IVAS_ERR_OK; - ivas_renderSplitGetMultiBinPoseData( &sbaInput->base.ctx.hhRendererConfig[0]->split_rend_config, &sbaInput->splitRendWrapper.multiBinPoseData, diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 5b0a308e06..dfc5c36e25 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -536,7 +536,7 @@ ivas_error RenderConfigReader_read( } } #ifdef SPLIT_REND_LC3PLUS - else if ( strcmp( item, "CODEC") == 0 ) + else if ( strcmp( item, "CODEC" ) == 0 ) { int16_t tmp; if ( !sscanf( pValue, "%hd", &tmp ) ) diff --git a/lib_util/split_render_file_read_write.c b/lib_util/split_render_file_read_write.c index 852d31b2db..2e9547ce08 100644 --- a/lib_util/split_render_file_read_write.c +++ b/lib_util/split_render_file_read_write.c @@ -151,7 +151,8 @@ ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileR ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written #ifdef SPLIT_REND_LC3PLUS , - IVAS_SPLIT_REND_CODEC codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection + IVAS_SPLIT_REND_CODEC codec, + IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection #endif ) { @@ -213,7 +214,8 @@ ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFil ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written #ifdef SPLIT_REND_LC3PLUS , - IVAS_SPLIT_REND_CODEC *codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE* poseCorrection + IVAS_SPLIT_REND_CODEC *codec, + IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection #endif ) { @@ -267,7 +269,7 @@ ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileRea } num_bytes = ( bit_len + 7 ) >> 3; - if ( fread( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != (uint32_t)num_bytes ) + if ( fread( bits, sizeof( uint8_t ), num_bytes, hSplitRendFileReadWrite->file ) != (uint32_t) num_bytes ) { return IVAS_ERR_FAILED_FILE_READ; } diff --git a/lib_util/split_render_file_read_write.h b/lib_util/split_render_file_read_write.h index 694774afd9..2ec0cdcb54 100644 --- a/lib_util/split_render_file_read_write.h +++ b/lib_util/split_render_file_read_write.h @@ -53,7 +53,8 @@ ivas_error split_rend_reader_writer_close( SplitFileReadWrite **hhSplitRendFileR ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written #ifdef SPLIT_REND_LC3PLUS , - IVAS_SPLIT_REND_CODEC codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection + IVAS_SPLIT_REND_CODEC codec, + IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection #endif ); @@ -61,7 +62,8 @@ ivas_error split_rend_write_bitstream_to_file( SplitFileReadWrite *hSplitRendFil ivas_error split_rend_read_bits_from_file( SplitFileReadWrite *hSplitRendFileReadWrite, uint8_t *bits, int32_t *bits_read, int32_t *bits_written #ifdef SPLIT_REND_LC3PLUS , - IVAS_SPLIT_REND_CODEC *codec, IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection + IVAS_SPLIT_REND_CODEC *codec, + IVAS_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection #endif ); -- GitLab From 3a9743d05de925224ac0cda0453434498fd5b263 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 14 Jun 2023 07:11:37 +0200 Subject: [PATCH 0176/1418] 5ms API first step, not completely BE yet --- apps/decoder.c | 795 ++++++++++++++++--- lib_com/ivas_error.h | 5 + lib_com/options.h | 3 + lib_dec/ivas_binRenderer_internal.c | 8 + lib_dec/ivas_dirac_dec.c | 24 +- lib_dec/ivas_init_dec.c | 11 +- lib_dec/ivas_ism_dec.c | 5 +- lib_dec/ivas_ism_param_dec.c | 37 +- lib_dec/ivas_ism_renderer.c | 32 + lib_dec/ivas_jbm_dec.c | 76 +- lib_dec/ivas_masa_dec.c | 6 + lib_dec/ivas_mc_param_dec.c | 14 +- lib_dec/ivas_mct_dec.c | 5 +- lib_dec/ivas_objectRenderer_internal.c | 13 +- lib_dec/ivas_sba_dec.c | 6 +- lib_dec/ivas_spar_decoder.c | 4 + lib_dec/ivas_stat_dec.h | 4 + lib_dec/lib_dec.c | 691 ++++++++++++++-- lib_dec/lib_dec.h | 37 +- lib_rend/ivas_crend.c | 8 + lib_rend/ivas_dirac_dec_binaural_functions.c | 12 + lib_rend/ivas_objectRenderer.c | 4 + lib_rend/ivas_rotation.c | 14 + lib_rend/ivas_stat_rend.h | 5 + lib_rend/lib_rend.c | 14 +- 25 files changed, 1632 insertions(+), 201 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 7ceda8f6f3..5113b8e242 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -85,6 +85,9 @@ static #ifdef JBM_TSM_ON_TCS #define JBM_FRONTEND_FETCH_FRAMESIZE_MS 20 #endif +#ifdef API_5MS +#define HEADROTATION_FETCH_FRAMESIZE_MS 5 +#endif typedef struct { @@ -121,7 +124,9 @@ typedef struct bool renderConfigEnabled; char *renderConfigFilename; IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; - +#ifdef API_5MS + bool tsmEnabled; +#endif #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC @@ -131,7 +136,9 @@ typedef struct bool noBadFrameDelay; #endif #ifdef VARIABLE_SPEED_DECODING +#ifndef API_5MS bool variableSpeedMode; +#endif bool tsmScaleFileEnabled; char *tsmScaleFileName; uint16_t tsmScale; @@ -388,7 +395,11 @@ int main( *------------------------------------------------------------------------------------------*/ #ifdef FIX_356_ISM_METADATA_SYNC #ifdef FIX_439_OTR_PARAMS +#ifdef API_5MS + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#endif #else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) #endif @@ -412,12 +423,17 @@ int main( if ( arg.voipMode ) { +#ifdef API_5MS + if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, IVAS_DEC_VOIP_MODE_VOIP, 100, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING #ifdef DEBUGGING else if ( arg.variableSpeedMode ) @@ -431,6 +447,7 @@ int main( #endif #endif #endif +#endif #ifdef DEBUGGING /*-----------------------------------------------------------------* @@ -465,7 +482,11 @@ int main( #ifdef VARIABLE_SPEED_DECODING #ifdef DEBUGGING +#ifdef API_5MS + if ( arg.tsmEnabled ) +#else if ( arg.variableSpeedMode ) +#endif { if ( arg.tsmScaleFileEnabled ) { @@ -671,6 +692,7 @@ int main( #endif error = decodeVoIP( arg, hBsReader, hIvasDec ); } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING #ifdef DEBUGGING else if ( arg.variableSpeedMode ) @@ -678,6 +700,7 @@ int main( error = decodeVariableSpeed( arg, hBsReader, headRotReader, refRotReader, referenceVectorReader, hIvasDec ); } #endif +#endif #endif else { @@ -913,10 +936,14 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; - +#ifdef API_5MS + arg->tsmEnabled = false; +#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING +#ifndef API_5MS arg->variableSpeedMode = false; +#endif arg->tsmScale = 100; arg->tsmScaleFileEnabled = false; arg->tsmScaleFileName = NULL; @@ -1067,7 +1094,11 @@ static bool parseCmdlIVAS_dec( { i++; int32_t tmp = 100; +#ifdef API_5MS + arg->tsmEnabled = true; +#else arg->variableSpeedMode = true; +#endif if ( i < argc - 3 ) { if ( !is_digits_only( argv[i] ) ) @@ -1626,7 +1657,7 @@ static ivas_error initOnFirstGoodFrame( * * Read G.192 bitstream and decode in regular decoder *---------------------------------------------------------------------*/ - +#ifdef API_5MS static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, @@ -1650,20 +1681,58 @@ static ivas_error decodeG192( int16_t numInitialBadFrames = 0; /* Number of bad frames received until first good frame is decoded */ int16_t nOutChannels = 0; int16_t delayNumSamples = -1; - int16_t delayNumSamples_orig[3]; /* stores: overall delay, dec+rend delay, and binauralization delay */ + int16_t delayNumSamples_orig[3]; int16_t nOutSamples = 0; int32_t delayTimeScale = 0; ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; - IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - + uint16_t nSamplesAvailableNext; + bool needNewFrame; + int16_t nSamplesRendered, nSamplesRendered_loop, nSamplesToRender; +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + TsmScaleFileReader *tsmScaleFileReader = NULL; + int16_t scale; +#endif +#endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; + IVAS_VECTOR3 Pos; + int16_t vec_pos_update, vec_pos_len; + + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { ismWriters[i] = NULL; } + /* we always start with needing a new frame */ + needNewFrame = true; + +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + /*------------------------------------------------------------------------------------------* + * Open TSM scale file or set global TSM scale + *------------------------------------------------------------------------------------------*/ + + if ( arg.tsmEnabled ) + { + if ( arg.tsmScaleFileEnabled ) + { + if ( ( tsmScaleFileReader = TsmScaleFileReader_open( arg.tsmScaleFileName ) ) == NULL ) + { + fprintf( stderr, "\nError: Can't open TSM scale file %s \n\n", arg.tsmScaleFileName ); + goto cleanup; + } + } + else + { + IVAS_DEC_VoIP_SetScale( hIvasDec, arg.tsmScale, arg.tsmScale ); + } + } +#endif +#endif + if ( !arg.quietModeEnabled ) { fprintf( stdout, "\n------ Running the decoder ------\n\n" ); @@ -1680,7 +1749,19 @@ static ivas_error decodeG192( reset_stack(); reset_wmops(); #endif + nSamplesAvailableNext = 0; + vec_pos_update = 0; + if ( arg.enableHeadRotation ) + { + nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS ); + vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; + } + else + { + nOutSamples = (int16_t) ( arg.output_Fs / 1000 * VARIABLE_SPEED_FETCH_FRAMESIZE_MS ); + vec_pos_len = 1; + } /*------------------------------------------------------------------------------------------* * Loop for every packet (frame) of bitstream data * - Read the bitstream packet @@ -1690,42 +1771,10 @@ static ivas_error decodeG192( while ( 1 ) { - /* Read next frame */ - if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) - { - if ( error == IVAS_ERR_END_OF_FILE ) - { - break; - } - fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); - goto cleanup; - } - -#ifdef DEBUGGING - /* Random FEC simulation */ - if ( arg.FER > 0.0f ) - { - float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; - if ( ftmp <= arg.FER / 100.0f * 65535.0f ) - { - bfi = 1; - } - else - { - bfi = 0; - } - } -#endif - - /* Feed into decoder */ - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } + /* Read next frame if not enough samples availble */ /* reference vector */ - if ( arg.enableReferenceVectorTracking ) + if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) { IVAS_VECTOR3 listenerPosition, referencePosition; if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) @@ -1740,8 +1789,9 @@ static ivas_error decodeG192( goto cleanup; } } + /* Reference rotation */ - if ( arg.enableReferenceRotation ) + if ( arg.enableReferenceRotation && vec_pos_update == 0 ) { IVAS_QUATERNION quaternion; if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) @@ -1756,31 +1806,95 @@ static ivas_error decodeG192( goto cleanup; } } + /* Head-tracking input simulation */ if ( arg.enableHeadRotation ) { - IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_QUATERNION Quaternion; - for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) { - if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; - } + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; } - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, Pos ) ) != IVAS_ERR_OK ) + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) { 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 ) + + /* decode and get samples */ + nSamplesRendered = 0; + nSamplesToRender = nOutSamples; + do { - fprintf( stderr, "\nError: could not get samples from decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; + if ( needNewFrame ) + { +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + if ( arg.tsmScaleFileEnabled ) + { + if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); + goto cleanup; + } + IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ); + } +#endif +#endif + + if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) + { + if ( error == IVAS_ERR_END_OF_FILE ) + { + break; + } + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); + goto cleanup; + } + +#ifdef DEBUGGING + /* Random FEC simulation */ + if ( arg.FER > 0.0f ) + { + float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; + if ( ftmp <= arg.FER / 100.0f * 65535.0f ) + { + bfi = 1; + } + else + { + bfi = 0; + } + } +#endif + + /* Feed into decoder */ + if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nOutChannels * nSamplesRendered, &nSamplesRendered_loop, &needNewFrame ); + nSamplesRendered += nSamplesRendered_loop; + nSamplesToRender -= nSamplesRendered_loop; + if ( error != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + + } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); + + if ( error == IVAS_ERR_END_OF_FILE ) + { + break; } /* Continue checking for first good frame until it is found */ @@ -1838,7 +1952,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 ) @@ -1884,6 +1998,7 @@ static ivas_error decodeG192( } frame++; + vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; if ( !arg.quietModeEnabled ) { fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); @@ -1895,77 +2010,552 @@ static ivas_error decodeG192( #endif } #ifdef WMOPS - update_mem(); update_wmops(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); +#endif #endif } - /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ - - memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); - - if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); - goto cleanup; - } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished + * Flush what is still left in the VoIP Buffers.... *------------------------------------------------------------------------------------------*/ - if ( !arg.quietModeEnabled ) + while ( nSamplesAvailableNext > 0 ) { - printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + int16_t nSamplesFlushed; - 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 ); - 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 ); - } - } + /* Feed into decoder */ - /* Print output metadata file name(s) */ - if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) - { - if ( bsFormat == IVAS_DEC_BS_OBJ ) + /* reference vector */ + if ( arg.enableReferenceVectorTracking ) { - for ( i = 0; i < numObj; i++ ) + IVAS_VECTOR3 listenerPosition, referencePosition; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) { - fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + 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; } - fprintf( stdout, "\n" ); } - else if ( bsFormat == IVAS_DEC_BS_MASA ) + /* Reference rotation */ + if ( arg.enableReferenceRotation ) { - fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); - } - } + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( refRotReader ) ); + goto cleanup; + } - /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternion; - decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ -cleanup: + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } - AudioFileWriter_close( &afWriter ); - MasaFileWriter_close( &masaWriter ); - for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) - { - IsmFileWriter_close( &ismWriters[i] ); - } - if ( decodingFailed && error == IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* decode and get samples */ + if ( ( error = IVAS_DEC_VoIP_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* Write current frame */ + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + + /* Write ISm metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + + frame++; + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); +#ifdef DEBUGGING + if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) + { + fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); + } +#endif + } + } + + /*------------------------------------------------------------------------------------------* + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ + + if ( !arg.quietModeEnabled ) + { + printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + + 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 ); + 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 ); + } + } + + /* Print output metadata file name(s) */ + if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + for ( i = 0; i < numObj; i++ ) + { + fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + } + fprintf( stdout, "\n" ); + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + } + } + + /* add zeros at the end to have equal length of synthesized signals */ + memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } + + /*------------------------------------------------------------------------------------------* + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ + + decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + +cleanup: + + AudioFileWriter_close( &afWriter ); + MasaFileWriter_close( &masaWriter ); + TsmScaleFileReader_close( &tsmScaleFileReader ); + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) + { + IsmFileWriter_close( &ismWriters[i] ); + } + + if ( decodingFailed && error == IVAS_ERR_OK ) + { + return IVAS_ERR_UNKNOWN; + } + + return error; +} +#else +static ivas_error decodeG192( + DecArguments arg, + BS_READER_HANDLE hBsReader, + HeadRotFileReader *headRotReader, + HeadRotFileReader *refRotReader, + Vector3PairFileReader *referenceVectorReader, + IVAS_DEC_HANDLE hIvasDec, + int16_t *pcmBuf ) + +{ + bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */ + uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; + int16_t i, num_bits; + int16_t bfi = 0; +#ifdef DEBUGGING + int16_t fec_seed = 12558; /* FEC_SEED */ +#endif + AudioFileWriter *afWriter = NULL; + MasaFileWriter *masaWriter = NULL; + bool decodedGoodFrame = false; + int16_t numInitialBadFrames = 0; /* Number of bad frames received until first good frame is decoded */ + int16_t nOutChannels = 0; + int16_t delayNumSamples = -1; + int16_t delayNumSamples_orig[3]; /* stores: overall delay, dec+rend delay, and binauralization delay */ + int16_t nOutSamples = 0; + int32_t delayTimeScale = 0; + ivas_error error = IVAS_ERR_UNKNOWN; + uint16_t numObj = 0; + IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; + IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) + { + ismWriters[i] = NULL; + } + + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "\n------ Running the decoder ------\n\n" ); + fprintf( stdout, "Frames processed: " ); + } + else + { + fprintf( stdout, "\n-- Start the decoder (quiet mode) --\n\n" ); + } + + delayNumSamples_orig[0] = -1; + +#ifdef WMOPS + reset_stack(); + reset_wmops(); +#endif + + /*------------------------------------------------------------------------------------------* + * Loop for every packet (frame) of bitstream data + * - Read the bitstream packet + * - Run the decoder + * - Write the synthesized signal into output file + *------------------------------------------------------------------------------------------*/ + + while ( 1 ) + { + /* Read next frame */ + if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) + { + if ( error == IVAS_ERR_END_OF_FILE ) + { + break; + } + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); + goto cleanup; + } + +#ifdef DEBUGGING + /* Random FEC simulation */ + if ( arg.FER > 0.0f ) + { + float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; + if ( ftmp <= arg.FER / 100.0f * 65535.0f ) + { + bfi = 1; + } + else + { + bfi = 0; + } + } +#endif + + /* Feed into decoder */ + if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* 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; + } + } + /* Reference rotation */ + if ( arg.enableReferenceRotation ) + { + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + 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; + } + } + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + } + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, Pos ) ) != IVAS_ERR_OK ) + { + 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 ) + { + fprintf( stderr, "\nError: could not get samples from decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* Continue checking for first good frame until it is found */ + if ( !decodedGoodFrame ) + { + if ( ( error = IVAS_DEC_HasDecodedFirstGoodFrame( hIvasDec, &decodedGoodFrame ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_HasDecodedFirstGoodFrame, code: %d\n", error ); + goto cleanup; + } + + /* Once good frame decoded, catch up */ + if ( decodedGoodFrame ) + { + error = initOnFirstGoodFrame( + hIvasDec, + arg, + numInitialBadFrames, + nOutSamples, + delayNumSamples_orig, + &delayNumSamples, + &delayTimeScale, + &bsFormat, + &afWriter, + &masaWriter, + ismWriters, + &nOutChannels, + &numObj ); + if ( error != IVAS_ERR_OK ) + { + goto cleanup; + } + } + else + { + ++numInitialBadFrames; + } + } + + /* Write current frame */ + if ( decodedGoodFrame ) + { + if ( delayNumSamples < nOutSamples ) + { + if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= nOutSamples; + } + } + + /* Write ISM metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + + frame++; + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); +#ifdef DEBUGGING + if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) + { + fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); + } +#endif + } +#ifdef WMOPS + update_mem(); + update_wmops(); +#endif + } + + /*------------------------------------------------------------------------------------------* + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ + + memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); + + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } + + /*------------------------------------------------------------------------------------------* + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ + + if ( !arg.quietModeEnabled ) + { + printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + + 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 ); + 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 ); + } + } + + /* Print output metadata file name(s) */ + if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + for ( i = 0; i < numObj; i++ ) + { + fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + } + fprintf( stdout, "\n" ); + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + } + } + + /*------------------------------------------------------------------------------------------* + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ + + decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + +cleanup: + + AudioFileWriter_close( &afWriter ); + MasaFileWriter_close( &masaWriter ); + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) + { + IsmFileWriter_close( &ismWriters[i] ); + } + + if ( decodingFailed && error == IVAS_ERR_OK ) { return IVAS_ERR_UNKNOWN; } return error; } +#endif #ifdef DEBUGGING /*---------------------------------------------------------------------* @@ -2241,9 +2831,11 @@ static ivas_error decodeVoIP( while ( 1 ) { int16_t nOutSamples = 0; +#ifndef API_5MS #if defined( JBM_TSM_ON_TCS ) || defined( VARIABLE_SPEED_DECODING ) uint16_t nSamplesAvailableNext = 0; #endif +#endif #ifdef JBM_TSM_ON_TCS #ifdef DEBUG_JBM_CMD_OPTION nOutSamples = (int16_t) ( arg.output_Fs / 1000 * arg.frontendFetchSizeMs ); @@ -2309,10 +2901,12 @@ static ivas_error decodeVoIP( /* decode and get samples */ if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms +#ifndef API_5MS #if defined( JBM_TSM_ON_TCS ) || defined( VARIABLE_SPEED_DECODING ) , &nSamplesAvailableNext #endif +#endif #ifdef SUPPORT_JBM_TRACEFILE , writeJbmTraceFileFrameWrapper, @@ -2522,6 +3116,7 @@ cleanup: #ifdef DEBUGGING +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING /*---------------------------------------------------------------------* * decodeVariableSpeed() @@ -2694,7 +3289,7 @@ static ivas_error decodeVariableSpeed( fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); goto cleanup; } - IVAS_DEC_VoIP_SetScale( hIvasDec, scale ); + IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ); } if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) @@ -3057,7 +3652,7 @@ cleanup: return error; } #endif - +#endif /*---------------------------------------------------------------------* * parseForcedRendModeDec() diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 56e09c558d..c444553021 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -93,6 +93,11 @@ typedef enum #ifdef VARIABLE_SPEED_DECODING IVAS_ERR_VS_FRAME_NEEDED, #endif +#ifdef API_5MS + IVAS_ERR_TSM_NOT_ENABLED, + IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, + IVAS_ERR_NEED_NEW_FRAME, +#endif #endif /*----------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 42d6a6a471..85195e86cc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -227,6 +227,9 @@ #define FIX_170_DTX_MASA /* Nokia: Fix issue 170, relaxing the use of DTX in MASA format */ #define FIX_510 /* FhG: fix issue 510, misleading error message for invalid input format */ #define FIX_509 /* FhG: fix issue 509, too low number of bitsream indices in SBA */ +#define FIX_XXX_JITTER_SBA_BINAURAL_GAIN + +#define API_5MS /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 240205706f..2cea0226c5 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1221,14 +1221,22 @@ void ivas_binRenderer( } /* Head rotation in HOA3 or CICPx */ +#ifdef API_5MS + if ( hHeadTrackData && hBinRenderer->rotInCldfb ) +#else if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) +#endif { if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { /* Rotation in SHD (HOA3) */ if ( hHeadTrackData->shd_rot_max_order == -1 ) { +#ifdef API_5MS + QuatToRotMat( hHeadTrackData->Quaternion, hHeadTrackData->Rmat ); +#else QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], hHeadTrackData->Rmat ); +#endif #ifdef JBM_TSM_ON_TCS rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hHeadTrackData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); #else diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 502420781f..8ab712b762 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1166,7 +1166,11 @@ ivas_error ivas_dirac_dec_config( /* allocate transport channels*/ if ( flag_config == DIRAC_OPEN ) { +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { #ifndef SBA_MODE_CLEAN_UP if ( st_ivas->sba_mode == SBA_MODE_DIRAC ) @@ -2592,12 +2596,12 @@ void ivas_dirac_dec( *------------------------------------------------------------------------*/ void ivas_dirac_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const int16_t nchan_transport, /* i : number of transport channels */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const int16_t nchan_transport, /* i : number of transport channels */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { int16_t slots_to_render, first_sf, last_sf, subframe_idx; @@ -2653,7 +2657,7 @@ void ivas_dirac_dec_render( } } - *nSamplesAvailable = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; return; } @@ -2888,7 +2892,11 @@ void ivas_dirac_dec_render_sf( if ( st_ivas->hHeadTrackData ) #endif { - QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[st_ivas->hHeadTrackData->num_quaternions++], st_ivas->hHeadTrackData->Rmat ); +#ifdef API_5MS + QuatToRotMat( st_ivas->hHeadTrackData->Quaternion, st_ivas->hHeadTrackData->Rmat ); +#else + QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[st_ivas->hHeadTrackData->num_quaternions++], st_ivas->hHeadTrackData->Rmat ); +#endif p_Rmat = &st_ivas->hHeadTrackData->Rmat[0][0]; diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b232078417..d696217825 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1367,7 +1367,9 @@ ivas_error ivas_init_decoder( } #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1412,7 +1414,9 @@ ivas_error ivas_init_decoder( st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1522,8 +1526,11 @@ ivas_error ivas_init_decoder( /*-----------------------------------------------------------------* * Allocate and initialize JBM struct + buffer *-----------------------------------------------------------------*/ - +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active && st_ivas->hTcBuffer == NULL ) +#endif { /* no module has yet open the TC buffer, open a default one */ n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1534,6 +1541,7 @@ ivas_error ivas_init_decoder( } } +#ifndef API_5MS if ( st_ivas->hTcBuffer == NULL ) { /* we need the handle anyway, but without the buffer*/ @@ -1542,6 +1550,7 @@ ivas_error ivas_init_decoder( return error; } } +#endif #endif return error; diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index fe98ca0dcb..59baa05d9b 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -130,7 +130,9 @@ static ivas_error ivas_ism_bitrate_switching( } #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hDirAC != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) @@ -331,8 +333,9 @@ static ivas_error ivas_ism_bitrate_switching( /*-----------------------------------------------------------------* * Reconfigure TC buffer *-----------------------------------------------------------------*/ - +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index da4ce92107..f782e32460 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -648,7 +648,11 @@ ivas_error ivas_param_ism_dec_open( { /* Initialize Param ISM Rendering handle */ #ifdef JBM_TSM_ON_TCS +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) +#else if ( st_ivas->hDecoderConfig->voip_active ) +#endif { if ( ( error = ivas_param_ism_rendering_init( hDirAC->hParamIsmRendering, hOutSetup, st_ivas->nchan_transport, MAX_JBM_CLDFB_TIMESLOTS, output_config ) ) != IVAS_ERR_OK ) { @@ -710,7 +714,9 @@ ivas_error ivas_param_ism_dec_open( st_ivas->hDirAC = hDirAC; #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) { @@ -724,7 +730,31 @@ ivas_error ivas_param_ism_dec_open( } else { +#ifdef API_5MS + int16_t n_slots_to_alloc; + if ( st_ivas->hDecoderConfig->tsm_active == 1 ) + { + n_slots_to_alloc = MAX_JBM_CLDFB_TIMESLOTS; + } + else + { + n_slots_to_alloc = CLDFB_SLOTS_PER_SUBFRAME * MAX_PARAM_SPATIAL_SUBFRAMES; + } + if ( ( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); + } + set_zero( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc, n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands ); + + if ( ( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); + } + set_zero( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc, n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands ); +#else if ( ( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } @@ -735,6 +765,7 @@ ivas_error ivas_param_ism_dec_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } set_zero( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc, MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hDirAC->num_freq_bands ); +#endif } if ( st_ivas->hTcBuffer == NULL ) { @@ -758,11 +789,13 @@ ivas_error ivas_param_ism_dec_open( } } } +#ifndef API_5MS else { hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; } +#endif #endif pop_wmops(); @@ -1450,7 +1483,7 @@ void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ) { @@ -1532,7 +1565,7 @@ void ivas_param_ism_dec_render( } } - *nSamplesAvailable = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; return; } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 031c6cf18f..329f17e81e 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -87,7 +87,11 @@ ivas_error ivas_ism_renderer_open( } #ifdef JBM_TSM_ON_TCS +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) +#else if ( st_ivas->hDecoderConfig->voip_active ) +#endif { init_interpolator_length = NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_CLDFB_TIMESLOTS * CLDFB_SLOT_NS ); interpolator_length = (uint16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); @@ -159,10 +163,18 @@ void ivas_ism_render( set_f( output_f[i], 0.0f, output_frame ); } +#ifdef API_5MS + if ( st_ivas->hHeadTrackData != NULL ) +#else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 ) +#endif { /* Calculate rotation matrix from the quaternion */ +#ifdef API_5MS + QuatToRotMat( st_ivas->hHeadTrackData->Quaternion, Rmat ); +#else QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[st_ivas->hHeadTrackData->num_quaternions++], Rmat ); +#endif } for ( i = 0; i < nchan_ism; i++ ) @@ -177,7 +189,11 @@ void ivas_ism_render( else { /* Head rotation: rotate the object positions depending the head's orientation */ +#ifdef API_5MS + if ( st_ivas->hHeadTrackData != NULL && !st_ivas->hIsmMetaData[i]->non_diegetic_flag ) +#else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 && !st_ivas->hIsmMetaData[i]->non_diegetic_flag ) +#endif { rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, Rmat, st_ivas->hIntSetup.is_planar_setup ); } @@ -262,10 +278,18 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } +#ifdef API_5MS + if ( st_ivas->hHeadTrackData != NULL ) +#else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 ) +#endif { /* Calculate rotation matrix from the quaternion */ +#ifdef API_5MS + QuatToRotMat( st_ivas->hHeadTrackData->Quaternion, Rmat ); +#else QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[st_ivas->hHeadTrackData->num_quaternions++], Rmat ); +#endif ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, @@ -277,7 +301,11 @@ void ivas_ism_render_sf( { /* Head rotation: rotate the object positions depending the head's orientation */ #ifdef FIX_473_JITTER_NONDIEGETIC_PANNING +#ifdef API_5MS + if ( st_ivas->hHeadTrackData != NULL && !st_ivas->hIsmMetaData[i]->non_diegetic_flag ) +#else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 && !st_ivas->hIsmMetaData[i]->non_diegetic_flag ) +#endif #else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 ) #endif @@ -311,7 +339,11 @@ void ivas_ism_render_sf( } /* update here only in case of head rotation */ +#ifdef API_5MS + if ( st_ivas->hHeadTrackData != NULL ) +#else if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 ) +#endif { st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 987c55f221..5a96069893 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -329,12 +329,30 @@ ivas_error ivas_jbm_dec_tc( } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { +#ifdef FIX_XXX_JITTER_SBA_BINAURAL_GAIN + float gain; + + if ( nchan_remapped == 1 ) + { + gain = 1.4454f; + } + else + { + gain = 1.3657f; + } + + for ( n = 0; n < nchan_remapped; n++ ) + { + v_multc( output[n], gain, output[n], output_frame ); + } +#else float gain = 0.8414f; /* Todo: Temporary gain for roughly matching the loudness. To be tuned later together with other outputs. */ for ( n = 0; n < nchan_remapped; n++ ) { v_multc( output[n], gain, output[n], output_frame ); } +#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) @@ -861,6 +879,12 @@ ivas_error ivas_jbm_dec_render( { ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } +#ifdef API_5MS + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + return IVAS_ERR_NOT_IMPLEMENTED; + } +#endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { int16_t offset = st_ivas->hDirAC->slots_rendered * st_ivas->hDirAC->slot_size; @@ -1369,6 +1393,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } } } +#ifdef API_5MS + else if ( st_ivas->ivas_format == MONO_FORMAT && st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) + { + num_tc = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; + } +#endif return num_tc; } @@ -1522,9 +1552,26 @@ ivas_error ivas_jbm_dec_tc_buffer_open( } else { +#ifdef API_5MS + int16_t n_samp_full, n_samp_residual; +#else int16_t n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); int16_t n_samp_residual = hTcBuffer->n_samples_granularity - 1; +#endif int32_t offset; +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { + n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); + n_samp_residual = hTcBuffer->n_samples_granularity - 1; + } + else + { + n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + n_samp_residual = 0; + } +#endif + nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; @@ -1628,8 +1675,18 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( /* realloc buffers */ free( hTcBuffer->tc_buffer ); - n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); - n_samp_residual = hTcBuffer->n_samples_granularity - 1; +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { + n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); + n_samp_residual = hTcBuffer->n_samples_granularity - 1; + } + else + { + n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + n_samp_residual = 0; + } +#endif nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; @@ -1811,11 +1868,26 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: +#ifdef API_5MS + buffer_mode = TC_BUFFER_MODE_RENDERER; + break; + case RENDERER_NON_DIEGETIC_DOWNMIX: + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + buffer_mode = TC_BUFFER_MODE_BUFFER; + } + else + { + buffer_mode = TC_BUFFER_MODE_RENDERER; + } + break; +#else #ifdef FIX_473_JITTER_NONDIEGETIC_PANNING case RENDERER_NON_DIEGETIC_DOWNMIX: #endif buffer_mode = TC_BUFFER_MODE_RENDERER; break; +#endif case RENDERER_MC_PARAMMC: if ( st_ivas->hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 8d6cebe036..96502f3326 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -416,7 +416,11 @@ ivas_error ivas_masa_dec_open( #ifdef JBM_TSM_ON_TCS /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) +#endif { int16_t nchan_to_allocate; TC_BUFFER_MODE buffer_mode; @@ -1300,7 +1304,9 @@ ivas_error ivas_masa_dec_reconfigure( ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 4be35d188e..d058f4d5ba 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -479,7 +479,11 @@ ivas_error ivas_param_mc_dec_open( ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov ); #ifdef JBM_TSM_ON_TCS +#ifdef API_5MS + if ( hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) +#else if ( st_ivas->hDecoderConfig->voip_active && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) +#endif { if ( ( hParamMC->Cldfb_RealBuffer_tc = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hParamMC->num_freq_bands * sizeof( float ) ) ) == NULL ) { @@ -1576,7 +1580,7 @@ void ivas_param_mc_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ) { @@ -1840,7 +1844,7 @@ void ivas_param_mc_dec_render( param_mc_update_mixing_matrices( hParamMC, hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_transport, nchan_out_cov ); } hParamMC->subframes_rendered = last_sf; - *nSamplesAvailable = ( hParamMC->num_slots - hParamMC->slots_rendered ) * NS2SA( output_Fs, CLDFB_SLOT_NS ); + *nSamplesAvailableNext = ( hParamMC->num_slots - hParamMC->slots_rendered ) * NS2SA( output_Fs, CLDFB_SLOT_NS ); pop_wmops(); return; @@ -1863,7 +1867,7 @@ void ivas_param_mc_dec( PARAM_MC_DEC_HANDLE hParamMC; float Cldfb_RealBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - uint16_t nSamplesAsked, nSamplesAvailable, nSamplesRendered; + uint16_t nSamplesAsked, nSamplesAvailableNext, nSamplesRendered; hParamMC = st_ivas->hParamMC; assert( hParamMC ); @@ -1875,10 +1879,10 @@ void ivas_param_mc_dec( nSamplesAsked = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); ivas_param_mc_dec_digest_tc( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS, output_f ); - ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailable, output_f ); + ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailableNext, output_f ); #ifdef DEBUGGING assert( nSamplesRendered == nSamplesAsked ); - assert( nSamplesAvailable == 0 ); + assert( nSamplesAvailableNext == 0 ); #endif /* set handle pointers back to NULL */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 46c4343800..81eb631741 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -750,7 +750,9 @@ static ivas_error ivas_mc_dec_reconfig( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ if ( last_mc_mode == MC_MODE_PARAMMC ) @@ -1294,8 +1296,9 @@ static ivas_error ivas_mc_dec_reconfig( /*-----------------------------------------------------------------* * Reconfigure TC buffer *-----------------------------------------------------------------*/ - +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index ba14104ed9..c1347b85d9 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -90,8 +90,13 @@ ivas_error ivas_td_binaural_renderer( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, +#ifdef API_5MS + st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternion : NULL, + ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Pos : NULL, ism_md_subframe_update, output, output_frame ); +#else 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, ism_md_subframe_update, output, output_frame ); +#endif #else return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, @@ -195,9 +200,15 @@ ivas_error ivas_td_binaural_renderer_sf( #endif /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, st_ivas->hDecoderConfig->Opt_Headrotation, + ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternion : NULL, + ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Pos : NULL ); +#else TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternions[0] : NULL, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL ); +#endif if ( ( st_ivas->hRenderConfig != NULL ) && ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) ) { @@ -209,7 +220,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* Render subframe */ #ifdef FIX_356_ISM_METADATA_SYNC - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm ) ) != IVAS_ERR_OK ) + if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) #else if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) #endif diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 2d4c4cb2ab..d0e90ce9e2 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -377,7 +377,9 @@ ivas_error ivas_sba_dec_reconfigure( * JBM TC buffer *-----------------------------------------------------------------*/ +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_tc; @@ -524,7 +526,7 @@ void ivas_sba_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ) { @@ -593,7 +595,7 @@ void ivas_sba_dec_render( } } - *nSamplesAvailable = ( hSpar->num_slots - hSpar->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hSpar->num_slots - hSpar->slots_rendered ) * slot_size; return; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 0d028b2359..3b28fb77ee 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -221,7 +221,11 @@ ivas_error ivas_spar_dec_open( } /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { int16_t nchan_to_allocate; int16_t nchan_tc; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index aacaa7aa0f..8a53910080 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1224,9 +1224,13 @@ typedef struct decoder_config_structure #ifdef DEBUGGING int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ #endif +#ifdef API_5MS + int16_t tsm_active; +#else #ifdef JBM_TSM_ON_TCS int16_t voip_active; #endif +#endif #ifdef FIX_356_ISM_METADATA_SYNC int16_t Opt_delay_comp; /* flag indicating delay compensation active */ #endif diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 69b6e127fd..a090d90621 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -53,20 +53,26 @@ struct IVAS_DEC_VOIP { uint16_t nSamplesFrame; /* Total number of samples in a frame (includes number of channels) */ JB4_HANDLE hJBM; +#ifndef API_5MS PCMDSP_APA_HANDLE hTimeScaler; +#endif uint16_t lastDecodedWasActive; +#ifndef API_5MS #ifdef JBM_TSM_ON_TCS float *apaExecBuffer; /* Buffer for APA scaling */ #else int16_t *apaExecBuffer; /* Buffer for APA scaling */ +#endif #endif JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING IVAS_DEC_VOIP_MODE voipMode; uint16_t speedFac; bool needNewFrame; #endif + #ifdef JBM_TSM_ON_TCS JBM_RENDERER_TYPE rendererType; PCMDSP_FIFO_HANDLE hFifoOut; @@ -75,6 +81,7 @@ struct IVAS_DEC_VOIP #else PCMDSP_FIFO_HANDLE hFifoAfterTimeScaler; #endif +#endif #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -92,8 +99,20 @@ struct IVAS_DEC bool hasDecodedFirstGoodFrame; /* False on init. Gets set to true after first good frame has been decoded -> all bitstream information is known from that point on */ bool isInitialized; - int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ - bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ + int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ + bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ +#ifdef API_5MS + bool Opt_TSM; /* flag indicating TSM mode*/ + int16_t tsm_scale; /* scale for TSM operation */ + int16_t tsm_max_scaling; + float *apaExecBuffer; /* Buffer for APA scaling */ + PCMDSP_APA_HANDLE hTimeScaler; + bool needNewFrame; + bool hasBeenFedFrame; + uint16_t nSamplesAvailableNext; + int16_t nSamplesRendered; + int16_t nTransportChannelsOld; +#endif int16_t amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ int16_t prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ @@ -123,7 +142,7 @@ static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig, const int #ifdef JBM_TSM_ON_TCS static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas ); static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec ); -static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); +static ivas_error IVAS_DEC_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, int16_t *data ); static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples ); static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf ); @@ -165,6 +184,18 @@ ivas_error IVAS_DEC_Open( } hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; +#ifdef API_5MS + hIvasDec->apaExecBuffer = NULL; + hIvasDec->hTimeScaler = NULL; + hIvasDec->Opt_TSM = false; + hIvasDec->tsm_scale = 100; + hIvasDec->needNewFrame = false; + hIvasDec->nTransportChannelsOld = 0; + hIvasDec->nSamplesAvailableNext = 0; + hIvasDec->nSamplesRendered = 0; + hIvasDec->nSamplesFrame = 0; + hIvasDec->hasBeenFedFrame = false; +#endif hIvasDec->hasBeenFedFirstGoodFrame = false; hIvasDec->hasDecodedFirstGoodFrame = false; hIvasDec->isInitialized = false; @@ -275,10 +306,13 @@ static void init_decoder_config( #endif hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; - +#ifdef API_5MS + hDecoderConfig->tsm_active = 0; +#else #ifdef JBM_TSM_ON_TCS hDecoderConfig->voip_active = 0; #endif +#endif #ifdef FIX_356_ISM_METADATA_SYNC hDecoderConfig->Opt_delay_comp = 0; @@ -316,6 +350,14 @@ void IVAS_DEC_Close( ( *phIvasDec )->st_ivas = NULL; } +#ifdef API_5MS + apa_exit( &( *phIvasDec )->hTimeScaler ); + + if ( ( *phIvasDec )->apaExecBuffer != NULL ) + { + free( ( *phIvasDec )->apaExecBuffer ); + } +#endif free( *phIvasDec ); *phIvasDec = NULL; phIvasDec = NULL; @@ -442,9 +484,12 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ 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 API_5MS + const int16_t tsmEnabled, /* i : enable TSM */ +#endif + 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_439_OTR_PARAMS const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif @@ -526,6 +571,16 @@ ivas_error IVAS_DEC_Configure( hIvasDec->st_ivas->ivas_format = MONO_FORMAT; } +#ifdef API_5MS + hDecoderConfig->tsm_active = tsmEnabled; + hIvasDec->Opt_TSM = tsmEnabled; + hIvasDec->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + hIvasDec->nSamplesAvailableNext = 0; + hIvasDec->nSamplesRendered = 0; + hIvasDec->tsm_scale = 100; + hIvasDec->tsm_max_scaling = 100; +#endif + return error; } @@ -540,9 +595,11 @@ ivas_error IVAS_DEC_Configure( ivas_error IVAS_DEC_EnableVoIP( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING const IVAS_DEC_VOIP_MODE voipMode, /* i : VoIP or variable speed */ const uint16_t speedFac, /* i : speed factor for variable speed */ +#endif #endif const int16_t jbmSafetyMargin, /* i : allowed delay reserve for JBM, in milliseconds */ const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ @@ -566,9 +623,14 @@ ivas_error IVAS_DEC_EnableVoIP( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; hIvasDec->Opt_VOIP = 1; +#ifdef API_5MS + hIvasDec->Opt_TSM = 1; + hDecoderConfig->tsm_active = 1; +#else #ifdef JBM_TSM_ON_TCS hDecoderConfig->voip_active = 1; #endif +#endif #ifdef JBM_TSM_ON_TCS if ( hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL ) @@ -602,25 +664,31 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; hIvasDec->hVoIP->hCurrentDataUnit = NULL; +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING hIvasDec->hVoIP->voipMode = voipMode; hIvasDec->hVoIP->speedFac = speedFac; hIvasDec->hVoIP->needNewFrame = false; #endif +#endif #ifdef JBM_TSM_ON_TCS hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); +#ifndef API_5MS hIvasDec->hVoIP->nSamplesAvailableNext = 0; hIvasDec->hVoIP->rendererType = JBM_RENDERER_NONE; hIvasDec->hVoIP->hFifoOut = NULL; +#endif #else hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs * hDecoderConfig->nchan_out / FRAMES_PER_SEC ); #endif +#ifndef API_5MS #ifdef JBM_TSM_ON_TCS /* postpone init of the buffers until we know the real number of TCs*/ hIvasDec->hVoIP->apaExecBuffer = NULL; hIvasDec->hVoIP->nTransportChannelsOld = 0; #else +#endif hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( int16_t ) * APA_BUF_PER_CHANNEL * hDecoderConfig->nchan_out ); if ( hIvasDec->hVoIP->apaExecBuffer == NULL ) @@ -640,10 +708,12 @@ ivas_error IVAS_DEC_EnableVoIP( } /* initialize JBM */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING hIvasDec->hVoIP->hJBM = NULL; if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VOIP ) { +#endif #endif if ( ( error = JB4_Create( &hIvasDec->hVoIP->hJBM ) != IVAS_ERR_OK ) != IVAS_ERR_OK ) { @@ -653,9 +723,11 @@ ivas_error IVAS_DEC_EnableVoIP( { return IVAS_ERR_FAILED_ALLOC; } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING } #endif +#endif #ifndef JBM_TSM_ON_TCS if ( hDecoderConfig->output_Fs == 8000 ) { @@ -683,6 +755,7 @@ ivas_error IVAS_DEC_EnableVoIP( } #endif +#ifndef API_5MS #ifdef JBM_TSM_ON_TCS /* postpone init of time scaler and output FIFO until we know the real number of TCs */ hIvasDec->hVoIP->hTimeScaler = NULL; @@ -721,6 +794,7 @@ ivas_error IVAS_DEC_EnableVoIP( return IVAS_ERR_INIT_ERROR; } #endif +#endif #endif return error; @@ -766,9 +840,13 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; } +#ifdef API_5MS + hIvasDec->isInitialized = true; +#endif } - +#ifndef API_5MS hIvasDec->isInitialized = true; +#endif } if ( !bfi ) /* TODO(mcjbm): Is this ok for bfi == 2 (partial frame)? Is there enough info to fully configure decoder? */ @@ -810,11 +888,18 @@ ivas_error IVAS_DEC_FeedFrame_Serial( st->use_partial_copy = 1; } +#ifdef API_5MS + hIvasDec->needNewFrame = false; + hIvasDec->hasBeenFedFrame = true; + hIvasDec->nSamplesRendered = 0; + hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; +#else #ifdef VARIABLE_SPEED_DECODING if ( hIvasDec->hVoIP != NULL && hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) { hIvasDec->hVoIP->needNewFrame = false; } +#endif #endif return error; @@ -826,7 +911,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( * * Main function to decode to PCM data *---------------------------------------------------------------------*/ - +#ifndef API_5MS ivas_error IVAS_DEC_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ @@ -876,6 +961,136 @@ ivas_error IVAS_DEC_GetSamples( return error; } +#else +ivas_error IVAS_DEC_GetSamples( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t nSamplesAsked, /* i: number of samples wanted by the caller */ + 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 */ + int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ + bool *needNewFrame /* indication that the decoder needs a new frame */ +) +{ + Decoder_Struct *st_ivas; + ivas_error error; + int16_t nOutSamplesElse, result, nSamplesToRender; + uint16_t nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; + uint8_t nTransportChannels, nOutChannels; + error = IVAS_ERR_OK; + nSamplesRendered = 0; + nOutChannels = 0; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + st_ivas = hIvasDec->st_ivas; + + if ( !hIvasDec->hasBeenFedFrame && hIvasDec->nSamplesAvailableNext == 0 ) + { + /* no frame was fed, do nothing but ask for a frame */ + *needNewFrame = true; + *nOutSamples = 0; + hIvasDec->needNewFrame = true; + return error; + } + + /* check if we are still at the beginning with bad frames, put out zeroes, keep track of subframes */ + if ( !hIvasDec->isInitialized && hIvasDec->st_ivas->bfi ) + { + hIvasDec->hasBeenFedFrame = false; + set_s( pcmBuf, 0, hIvasDec->st_ivas->hDecoderConfig->nchan_out * nSamplesAsked ); + hIvasDec->nSamplesRendered += nSamplesAsked; + *nOutSamples = nSamplesAsked; + hIvasDec->nSamplesAvailableNext -= nSamplesAsked; + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + hIvasDec->needNewFrame = true; + *needNewFrame = true; + } + } + else + { + /* check if we need to run the setup function, tc decoding and feeding the renderer */ + if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) + { + int16_t nResidualSamples, nSamplesTcsScaled; + /* setup */ + if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels, &nOutChannels, &nSamplesRendered_loop, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + if ( nTransportChannels != hIvasDec->nTransportChannelsOld ) + { + IVAS_DEC_reconfigure( hIvasDec, nTransportChannels, l_ts ); + } + /* decode TCs only */ + if ( ( error = IVAS_DEC_GetTcSamples( hIvasDec, hIvasDec->apaExecBuffer, &nOutSamplesElse ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( hIvasDec->Opt_TSM ) + { + if ( apa_set_scale( hIvasDec->hTimeScaler, hIvasDec->tsm_scale ) != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + result = apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ); + if ( result != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + assert( nTimeScalerOutSamples <= APA_BUF ); + } + else + { + nTimeScalerOutSamples = hIvasDec->nSamplesFrame * nTransportChannels; + } + nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; + + /* render IVAS frames */ + + + if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( hIvasDec->Opt_TSM ) + { + /* feed residual samples to TSM for the next call */ + if ( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (uint16_t) nResidualSamples ) != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + } + hIvasDec->hasBeenFedFrame = false; + } + /* render IVAS frames directly to the output buffer */ + nSamplesToRender = nSamplesAsked - nSamplesRendered; + if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + nSamplesToRender -= nSamplesRendered_loop; + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + *needNewFrame = true; + hIvasDec->needNewFrame = true; + } + else + { + *needNewFrame = false; + } + } + + *nOutSamples = nSamplesRendered; + + return error; +} +#endif #ifdef JBM_TSM_ON_TCS @@ -1265,15 +1480,26 @@ ivas_error IVAS_DEC_GetMasaMetadata( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedHeadTrackData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 Pos /* i : listener position */ +#else IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ IVAS_VECTOR3 *Pos /* i : listener position */ +#endif ) { HEAD_TRACK_DATA_HANDLE hHeadTrackData; +#ifndef API_5MS int16_t i; +#endif +#ifdef API_5MS + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) +#else if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || orientation == NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1286,6 +1512,18 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } /* Move head-tracking data to the decoder handle */ +#ifdef API_5MS + /* check for Euler angle signaling */ + if ( orientation.w == -3.0f ) + { + Euler2Quat( deg2rad( orientation.x ), deg2rad( orientation.y ), deg2rad( orientation.z ), &orientation ); + } + + ivas_orient_trk_Process( hHeadTrackData->OrientationTracker, orientation, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hHeadTrackData->Quaternion ); + hHeadTrackData->Pos.x = Pos.x; + hHeadTrackData->Pos.y = Pos.y; + hHeadTrackData->Pos.z = Pos.z; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { /* check for Euler angle signaling */ @@ -1301,6 +1539,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } hIvasDec->st_ivas->hHeadTrackData->num_quaternions = 0; +#endif return IVAS_ERR_OK; } @@ -1824,7 +2063,6 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( } #ifdef VARIABLE_SPEED_DECODING -#ifdef DEBUGGING /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_SetScale( ) * @@ -1833,20 +2071,220 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( ivas_error IVAS_DEC_VoIP_SetScale( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const int16_t scale /* i : TSM scale to set */ +#ifdef API_5MS + const int16_t maxScaling, +#endif + const int16_t scale /* i : TSM scale to set */ ) { ivas_error error; error = IVAS_ERR_OK; +#ifdef API_5MS + if ( hIvasDec->Opt_TSM == false ) + { + return IVAS_ERR_TSM_NOT_ENABLED; + } + else + { + hIvasDec->tsm_scale = scale; + hIvasDec->tsm_max_scaling = maxScaling; + } +#else hIvasDec->hVoIP->speedFac = scale; +#endif return error; } #endif + + +#ifdef API_5MS +/*---------------------------------------------------------------------* + * IVAS_DEC_VoIP_GetSamples( ) + * + * Main function to decode one frame in VoIP + *---------------------------------------------------------------------*/ + +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 */ + 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 + , + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter +#endif + +) +{ + Decoder_Struct *st_ivas; + DECODER_CONFIG_HANDLE hDecoderConfig; + IVAS_DEC_VOIP *hVoIP; + uint32_t extBufferedTime_ms, scale, maxScaling; +#ifndef API_5MS + uint16_t nTimeScalerOutSamples; +#endif + JB4_DATAUNIT_HANDLE dataUnit; +#ifndef API_5MS + int16_t nOutSamplesElse; +#endif + uint16_t extBufferedSamples; + int16_t timeScalingDone; + int16_t result; + ivas_error error; +#ifdef JBM_TSM_ON_TCS + int16_t nSamplesRendered; + uint16_t nSamplesTcsScaled; + uint8_t nTransportChannels; + uint8_t nOutChannels; #endif + error = IVAS_ERR_OK; + + st_ivas = hIvasDec->st_ivas; + hDecoderConfig = st_ivas->hDecoderConfig; + hVoIP = hIvasDec->hVoIP; + timeScalingDone = 0; + + nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; + nTransportChannels = 0; + nSamplesTcsScaled = hVoIP->nSamplesFrame; + nSamplesRendered = 0; + + if ( nSamplesPerChannel == 0 ) + { + return IVAS_ERR_WRONG_PARAMS; + } + + /* make sure that the FIFO after decoder/scaler contains at least one sound card frame (i.e. 20ms) */ + while ( nSamplesRendered < nSamplesPerChannel ) + { + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + int16_t nSamplesBuffered; + nSamplesBuffered = 0; + if ( hIvasDec->hasBeenFedFirstGoodFrame ) + { + IVAS_DEC_GetBufferedNumberOfSamples( hIvasDec, &nSamplesBuffered ); + } + extBufferedSamples = nSamplesRendered + nSamplesBuffered; + + extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; + + dataUnit = NULL; + + + /* pop one access unit from the jitter buffer */ + result = JB4_PopDataUnit( hVoIP->hJBM, systemTimestamp_ms, extBufferedTime_ms, &dataUnit, &scale, &maxScaling ); + if ( result != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + + + maxScaling = maxScaling * hDecoderConfig->output_Fs / 1000; + /* avoid time scaling multiple times in one sound card slot */ + if ( scale != 100U ) + { + if ( timeScalingDone ) + { + scale = 100; + } + else + { + timeScalingDone = 1; + } + } + + /* limit scale to range supported by time scaler */ + if ( scale < APA_MIN_SCALE ) + { + scale = APA_MIN_SCALE; + } + else if ( scale > APA_MAX_SCALE ) + { + scale = APA_MAX_SCALE; + } + + IVAS_DEC_VoIP_SetScale( hIvasDec, (int16_t) maxScaling, (int16_t) scale ); + + /* copy bitstream into decoder state */ + if ( dataUnit ) + { + hIvasDec->hVoIP->hCurrentDataUnit = dataUnit; + + bsCompactToSerial( dataUnit->data, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize ); + IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0 ); + } + else if ( hIvasDec->hasDecodedFirstGoodFrame ) + { + /* Decoder has been initialized with first good frame - do PLC */ + IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1 ); + } + +#ifdef SUPPORT_JBM_TRACEFILE + /* jbmWriterFn and jbmWriter may be NULL if tracefile writing was not requested on CLI */ + if ( jbmWriterFn != NULL && jbmWriter != NULL ) + { + /* write JBM trace data entry */ + store_JbmData( hVoIP, dataUnit, systemTimestamp_ms, extBufferedSamples, hDecoderConfig->output_Fs ); + if ( ( jbmWriterFn( &hVoIP->JbmTraceData, jbmWriter ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing JBM Trace data to file\n" ); + return IVAS_ERR_UNKNOWN; + } + } +#endif + if ( dataUnit ) + { + if ( dataUnit->partial_frame != 0 ) + { + hVoIP->lastDecodedWasActive = 1; + } + else + { + hVoIP->lastDecodedWasActive = !dataUnit->silenceIndicator; + } + /* data unit memory is no longer used */ + JB4_FreeDataUnit( hVoIP->hJBM, dataUnit ); + } + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; + hIvasDec->nSamplesRendered = 0; + } + } + /* decode */ + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + /* codec mode to use not known yet - simply output silence */ + /* directly set output zero */ + int16_t nSamplesToZero = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); + set_s( pcmBuf + nSamplesRendered * nOutChannels, 0, nSamplesToZero * nOutChannels ); + nSamplesRendered += nSamplesToZero; + hIvasDec->nSamplesRendered += nSamplesToZero; + hIvasDec->nSamplesAvailableNext -= nSamplesToZero; + } + else + { + int16_t nSamplesToRender, nSamplesRendered_loop; + bool tmp; + nSamplesToRender = nSamplesPerChannel - nSamplesRendered; + + /* render IVAS frames directly to the output buffer */ + if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nSamplesRendered * nOutChannels, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + } + } + return error; +} +#else /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetSamples( ) * @@ -2076,7 +2514,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesRendered_loop; if ( nTransportChannels != hVoIP->nTransportChannelsOld ) { - IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ); + IVAS_DEC_reconfigure( hIvasDec, nTransportChannels, l_ts ); } /* decode TCs only */ @@ -2159,8 +2597,8 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #ifdef VARIABLE_SPEED_DECODING if ( hVoIP->mode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) { - int16_t nSamplesAvailable = pcmdsp_fifo_nReadableSamplesPerChannel( hVoIP->hFifoAfterTimeScaler ); - if ( nSamplesAvailable < nSamplesPerChannel ) + int16_t nSamplesAvailableNext = pcmdsp_fifo_nReadableSamplesPerChannel( hVoIP->hFifoAfterTimeScaler ); + if ( nSamplesAvailableNext < nSamplesPerChannel ) { hVoIP->needNewFrame = true; } @@ -2312,6 +2750,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return error; } +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) @@ -2331,7 +2770,9 @@ ivas_error IVAS_DEC_VoIP_Flush( ivas_error error; IVAS_DEC_VOIP *hVoIP; #ifdef JBM_TSM_ON_TCS +#ifndef API_5MS int16_t rendererPcmBuf[( MAX_OUTPUT_CHANNELS * L_FRAME_MAX * APA_MAX_SCALE ) / 100]; +#endif uint16_t nSamplesToRender; uint16_t nSamplesFlushedLocal; #endif @@ -2340,11 +2781,16 @@ ivas_error IVAS_DEC_VoIP_Flush( hVoIP = hIvasDec->hVoIP; #if defined( JBM_TSM_ON_TCS ) +#ifdef API_5MS + *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); +#else *nSamplesFlushed = min( nSamplesPerChannel, hVoIP->nSamplesAvailableNext ); +#endif #else *nSamplesFlushed = min( nSamplesPerChannel, pcmdsp_fifo_nReadableSamplesPerChannel( hVoIP->hFifoAfterTimeScaler ) ); #endif +#ifndef API_5MS #ifdef JBM_TSM_ON_TCS if ( hVoIP->rendererType == JBM_RENDERER_NONE ) { @@ -2368,6 +2814,7 @@ ivas_error IVAS_DEC_VoIP_Flush( } else { + nSamplesToRender = (uint16_t) *nSamplesFlushed; /* render IVAS frames */ if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hVoIP->nSamplesAvailableNext, rendererPcmBuf ) ) != IVAS_ERR_OK ) @@ -2389,7 +2836,15 @@ ivas_error IVAS_DEC_VoIP_Flush( *nSamplesFlushed = (int16_t) nSamplesFlushedLocal; } #endif +#else + nSamplesToRender = (uint16_t) *nSamplesFlushed; + /* render IVAS frames */ + if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif return error; } #endif @@ -2410,7 +2865,11 @@ bool IVAS_DEC_VoIP_IsEmpty( ) { #ifdef JBM_TSM_ON_TCS +#ifdef API_5MS + return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); +#else return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->hVoIP->nSamplesAvailableNext < nSamplesAsked ) ); +#endif #else return JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0; #endif @@ -2452,6 +2911,7 @@ static void IVAS_DEC_Close_VoIP( { JB4_Destroy( &hVoIP->hJBM ); +#ifndef API_5MS apa_exit( &hVoIP->hTimeScaler ); #ifdef JBM_TSM_ON_TCS @@ -2464,7 +2924,7 @@ static void IVAS_DEC_Close_VoIP( { free( hVoIP->apaExecBuffer ); } - +#endif if ( hVoIP->bs_conversion_buf != NULL ) { #define WMC_TOOL_SKIP @@ -2805,17 +3265,25 @@ static ivas_error printConfigInfo_dec( } } +#ifdef API_5MS + /*-----------------------------------------------------------------* + * Print VoIP mode info + *-----------------------------------------------------------------*/ + if ( st_ivas->hDecoderConfig->tsm_active ) + { + fprintf( stdout, "TSM mode: ON\n" ); + } +#else #ifdef JBM_TSM_ON_TCS /*-----------------------------------------------------------------* * Print VoIP mode info *-----------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->voip_active ) { fprintf( stdout, "VoIP mode: ON\n" ); } #endif - +#endif return IVAS_ERR_OK; } @@ -3269,64 +3737,103 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( * *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_reconfigure( +ivas_error IVAS_DEC_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ) { IVAS_DEC_VOIP *hVoIP; +#ifdef API_5MS + int16_t apa_buffer_size; +#endif + ivas_error error; + hVoIP = hIvasDec->hVoIP; +#ifdef API_5MS + apa_buffer_size = hIvasDec->nSamplesFrame; +#endif +#ifdef API_5MS + if ( hIvasDec->apaExecBuffer == NULL ) +#else if ( hIvasDec->hVoIP->hTimeScaler == NULL ) +#endif { - +#ifndef API_5MS uint16_t wss, css; float startQuality; +#endif DECODER_CONFIG_HANDLE hDecoderConfig; +#ifdef API_5MS + if ( hIvasDec->Opt_TSM ) + { + uint16_t wss, css; + float startQuality; + + startQuality = 1.0f; + apa_buffer_size = APA_BUF_PER_CHANNEL; +#else #ifdef VARIABLE_SPEED_DECODING startQuality = hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ? -2.0f : 1.0f; #else startQuality = 1.0f; +#endif #endif - /* get current renderer type*/ - hVoIP->rendererType = IVAS_DEC_VoIP_GetRendererConfig( hIvasDec ); - hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; - if ( hDecoderConfig->output_Fs == 8000 ) - { - wss = 1; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 16000 ) - { - wss = 2; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 32000 ) - { - wss = 4; - css = 2; - } - else if ( hDecoderConfig->output_Fs == 48000 ) - { - wss = 6; - css = 3; - } - else - { - return IVAS_ERR_INIT_ERROR; - } + /* get current renderer type*/ +#ifndef API_5MS + hVoIP->rendererType = IVAS_DEC_VoIP_GetRendererConfig( hIvasDec ); +#endif + hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; - if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); + if ( hDecoderConfig->output_Fs == 8000 ) + { + wss = 1; + css = 1; + } + else if ( hDecoderConfig->output_Fs == 16000 ) + { + wss = 2; + css = 1; + } + else if ( hDecoderConfig->output_Fs == 32000 ) + { + wss = 4; + css = 2; + } + else if ( hDecoderConfig->output_Fs == 48000 ) + { + wss = 6; + css = 3; + } + else + { + return IVAS_ERR_INIT_ERROR; + } +#ifndef API_5MS + if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif +#ifdef API_5MS + if ( apa_init( &hIvasDec->hTimeScaler, + nTransportChannels ) != IVAS_ERR_OK || + apa_set_rate( hIvasDec->hTimeScaler, hDecoderConfig->output_Fs ) != 0 || + apa_set_complexity_options( hIvasDec->hTimeScaler, wss, css ) != 0 || + apa_set_quality( hIvasDec->hTimeScaler, startQuality, 4, 4 ) != 0 || + apa_set_renderer_granularity( hIvasDec->hTimeScaler, l_ts ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } +#else if ( apa_init( &hIvasDec->hVoIP->hTimeScaler, nTransportChannels ) != IVAS_ERR_OK || apa_set_rate( hIvasDec->hVoIP->hTimeScaler, hDecoderConfig->output_Fs ) != 0 || @@ -3336,51 +3843,91 @@ ivas_error IVAS_DEC_VoIP_reconfigure( { return IVAS_ERR_INIT_ERROR; } +#endif - if ( hVoIP->hFifoOut == NULL && hVoIP->rendererType == JBM_RENDERER_NONE ) - { - /* we still need the FIFO out buffer */ - if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || - pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) +#ifndef API_5MS + if ( hVoIP->hFifoOut == NULL && hVoIP->rendererType == JBM_RENDERER_NONE ) { - return IVAS_ERR_INIT_ERROR; + /* we still need the FIFO out buffer */ + if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || + pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } } - } #ifdef VARIABLE_SPEED_DECODING - else if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) - { - if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || - pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + else if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) { - return IVAS_ERR_INIT_ERROR; + if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || + pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } } - } +#endif #endif - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) - { - if ( apa_set_evs_compat_mode( hIvasDec->hVoIP->hTimeScaler, true ) != 0 ) + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { - return IVAS_ERR_INIT_ERROR; +#ifdef API_5MS + if ( apa_set_evs_compat_mode( hIvasDec->hTimeScaler, true ) != 0 ) +#else + if ( apa_set_evs_compat_mode( hIvasDec->hVoIP->hTimeScaler, true ) != 0 ) +#endif + { + return IVAS_ERR_INIT_ERROR; + } } +#ifdef API_5MS } +#endif + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); } else { - if ( apa_reconfigure( hVoIP->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#ifdef API_5MS + if ( hIvasDec->Opt_TSM ) { - return IVAS_ERR_INIT_ERROR; + if ( apa_reconfigure( hIvasDec->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#else + if ( apa_reconfigure( hVoIP->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#endif + { + return IVAS_ERR_INIT_ERROR; + } +#ifdef API_5MS + apa_buffer_size = APA_BUF_PER_CHANNEL; } - +#endif /* realloc apa_exe_buffer */ +#ifdef API_5MS + free( hIvasDec->apaExecBuffer ); + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); +#else free( hIvasDec->hVoIP->apaExecBuffer ); if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif } + +#ifdef API_5MS + hIvasDec->nTransportChannelsOld = nTransportChannels; +#else hIvasDec->hVoIP->nTransportChannelsOld = (uint8_t) nTransportChannels; +#endif error = IVAS_ERR_OK; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 0539d75188..50d899e8f6 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -83,7 +83,7 @@ typedef enum _IVAS_DEC_COMPLEXITY_LEVEL IVAS_DEC_COMPLEXITY_LEVEL_THREE = 3 } IVAS_DEC_COMPLEXITY_LEVEL; - +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING typedef enum { @@ -91,6 +91,7 @@ typedef enum IVAS_DEC_VOIP_MODE_VARIABLE_SPEED = 1 } IVAS_DEC_VOIP_MODE; #endif +#endif #ifdef DEBUGGING typedef enum _IVAS_DEC_FORCED_REND_MODE @@ -144,11 +145,14 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ +#ifdef API_5MS + const int16_t tsmEnabled, /* i : enable TSM */ +#endif 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_439_OTR_PARAMS - const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ #endif const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ @@ -177,9 +181,17 @@ ivas_error IVAS_DEC_FeedFrame_Serial( /*! r: decoder error code */ ivas_error IVAS_DEC_GetSamples( +#ifdef API_5MS + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t nSamplesAsked, /* i: number of samples wanted by the caller */ + 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 */ + int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ + bool *needNewFrame /* indication that the decoder needs a new frame */ +#else IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ +#endif ); /*! r: error code */ @@ -199,8 +211,13 @@ ivas_error IVAS_DEC_GetMasaMetadata( /*! r: error code */ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *orientation, /* i : head-tracking data */ - IVAS_VECTOR3 *Pos /* i : listener position */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 Pos /* i : listener position */ +#else + IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 *Pos /* i : listener position */ +#endif ); /*! r: error code */ @@ -226,6 +243,13 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( const bool qBit /* i : Q bit for AMR-WB IO */ ); +#ifdef API_5MS +ivas_error IVAS_DEC_VoIP_SetScale( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t maxScaling, /* i : maximum allowed TSM scale */ + const int16_t scale /* i : TSM scale to set */ +); +#else #ifdef VARIABLE_SPEED_DECODING #ifdef DEBUGGING /*! r: error code */ @@ -235,6 +259,7 @@ ivas_error IVAS_DEC_VoIP_SetScale( ); #endif #endif +#endif /*! r: error code */ ivas_error IVAS_DEC_VoIP_GetSamples( @@ -242,10 +267,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( 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 */ +#ifndef API_5MS #if defined( JBM_TSM_ON_TCS ) || defined(VARIABLE_SPEED_DECODING ) , uint16_t *sampleAvailableNext /* o : samples available for the next call */ #endif +#endif #ifdef SUPPORT_JBM_TRACEFILE , JbmTraceFileWriterFn jbmWriterFn, void* jbmWriter @@ -267,9 +294,11 @@ ivas_error IVAS_DEC_VoIP_Flush( /*! r: error code */ ivas_error IVAS_DEC_EnableVoIP( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING const IVAS_DEC_VOIP_MODE voipMode, /* i : VoIP or variable speed */ const uint16_t speedFac, /* i : speed factor for variable speed */ +#endif #endif const int16_t jbmSafetyMargin, /* i : allowed delay reserve for JBM, in milliseconds */ const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 76af4a17c8..4fa4a61760 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1517,7 +1517,11 @@ ivas_error ivas_rend_crendProcess( for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { +#ifdef API_5MS + if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData ) +#else if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData && hHeadTrackData->num_quaternions >= 0 ) +#endif { /* Orientation tracking */ @@ -1656,7 +1660,11 @@ ivas_error ivas_rend_crendProcessSubframe( { subframe_len = hTcBuffer->subframe_nbslots[subframe_idx] * hTcBuffer->n_samples_granularity; +#ifdef API_5MS + if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData ) +#else if ( hDecoderConfig && hDecoderConfig->Opt_Headrotation && hHeadTrackData && hHeadTrackData->num_quaternions >= 0 ) +#endif { /* Rotation in SHD for: MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index c3e76e7306..0791d274f3 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -236,7 +236,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( #ifdef JBM_TSM_ON_TCS /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { int16_t nchan_to_allocate; @@ -688,9 +692,17 @@ static void ivas_dirac_dec_binaural_internal( ivas_sba_prototype_renderer( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, subframe ); } +#ifdef API_5MS + if ( st_ivas->hHeadTrackData ) +#else if ( st_ivas->hHeadTrackData && st_ivas->hHeadTrackData->num_quaternions >= 0 ) +#endif { +#ifdef API_5MS + QuatToRotMat( st_ivas->hHeadTrackData->Quaternion, Rmat ); +#else QuatToRotMat( st_ivas->hHeadTrackData->Quaternions[subframe], Rmat ); +#endif if ( nchan_transport == 2 ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2f5b406c66..9636f58bbb 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -319,7 +319,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( } #endif /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? Quaternions : NULL, ( Pos != NULL ) ? Pos : NULL ); +#else TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); +#endif if ( hReverb != NULL && hReverb->pConfig.roomAcoustics.late_reverb_on ) { diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 79ef75e470..649e387c0a 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -64,7 +64,9 @@ ivas_error ivas_headTrack_open( } /* Initialization */ +#ifndef API_5MS ( *hHeadTrackData )->num_quaternions = 0; +#endif ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; ( *hHeadTrackData )->lrSwitchedCurrent = 0; ( *hHeadTrackData )->lrSwitchedNext = 0; @@ -286,7 +288,11 @@ void rotateFrame_shd( } /* get next quaternion */ +#ifdef API_5MS + QuatToRotMat( hHeadTrackData->Quaternion, hHeadTrackData->Rmat ); +#else QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], hHeadTrackData->Rmat ); +#endif /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( SHrotmat_prev, hHeadTrackData->Rmat_prev, shd_rot_max_order ); @@ -392,7 +398,11 @@ void rotateFrame_sd( } /* Get next quaternion and calculate rotation matrix */ +#ifdef API_5MS + QuatToRotMat( hHeadTrackData->Quaternion, hHeadTrackData->Rmat ); +#else QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], hHeadTrackData->Rmat ); +#endif for ( ch_in = 0; ch_in < nchan; ch_in++ ) { @@ -632,7 +642,11 @@ void rotateFrame_sd_cldfb( } /* Get next quaternion and calculate rotation matrix */ +#ifdef API_5MS + QuatToRotMat( hHeadTrackData->Quaternion, Rmat ); +#else QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], Rmat ); +#endif /* rotation of Euler angles */ for ( n = 0; n < nInChannels; n++ ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 877076db9a..e7acc00e97 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -260,9 +260,14 @@ typedef struct typedef struct ivas_binaural_head_track_struct { +#ifdef API_5MS + IVAS_QUATERNION Quaternion; + IVAS_VECTOR3 Pos; +#else int16_t num_quaternions; IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_VECTOR3 Pos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif float Rmat[3][3]; float Rmat_prev[3][3]; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index cd4f16aaa7..f53cbd5695 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2473,10 +2473,13 @@ static DecoderDummy *initDecoderDummy( decDummy->hDecoderConfig->output_Fs = sampleRate; decDummy->hDecoderConfig->nchan_out = numOutChannels; decDummy->hDecoderConfig->Opt_Headrotation = 0; +#ifdef API_5MS + decDummy->hDecoderConfig->tsm_active = 0; +#else #ifdef JBM_TSM_ON_TCS decDummy->hDecoderConfig->voip_active = 0; #endif - +#endif decDummy->hBinRenderer = NULL; decDummy->hEFAPdata = NULL; decDummy->hCrendWrapper = NULL; @@ -2513,6 +2516,12 @@ static DecoderDummy *initDecoderDummy( set_zero( decDummy->hHeadTrackData->chEneIIR[1], MASA_FREQUENCY_BANDS ); set_zero( decDummy->hHeadTrackData->procChEneIIR[0], MASA_FREQUENCY_BANDS ); set_zero( decDummy->hHeadTrackData->procChEneIIR[1], MASA_FREQUENCY_BANDS ); +#ifdef API_5MS + decDummy->hHeadTrackData->Quaternion.w = 1.0f; + decDummy->hHeadTrackData->Quaternion.x = 0.0f; + decDummy->hHeadTrackData->Quaternion.y = 0.0f; + decDummy->hHeadTrackData->Quaternion.z = 0.0f; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { decDummy->hHeadTrackData->Quaternions[i].w = 1.0f; @@ -2520,8 +2529,9 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData->Quaternions[i].y = 0.0f; decDummy->hHeadTrackData->Quaternions[i].z = 0.0f; } -#endif decDummy->hHeadTrackData->num_quaternions = 0; +#endif +#endif decDummy->hHeadTrackData->lrSwitchInterpVal = 0.0f; decDummy->hHeadTrackData->lrSwitchedCurrent = 0; decDummy->hHeadTrackData->lrSwitchedNext = 0; -- GitLab From f35a6797d6b1745de518ea83c0bb90f0a1950849 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 11:38:43 +0530 Subject: [PATCH 0177/1418] Modified SID-MD bits calculation [x] Considered the SID format bits in the calculation --- lib_dec/ivas_qmetadata_dec.c | 2 +- lib_enc/ivas_qmetadata_enc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index ccb0b69844..fc24398e39 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -1191,7 +1191,7 @@ int16_t ivas_qmetadata_dec_sid_decode( /* TODO: still use old sid frame size to keep bitexactness */ metadata_sid_bits = (int16_t) ( 5000 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1; /* -1 for inactive mode header bit*/ #else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1; /* -1 for inactive mode header bit*/ + metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ #endif } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index c21463413d..0f6ea973da 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -989,7 +989,7 @@ void ivas_qmetadata_enc_sid_encode( /* TODO: still use old sid frame size to keep bitexactness */ metadata_sid_bits = (int16_t) ( 5000 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1; /* -1 for inactive mode header bit*/ #else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1; /* -1 for inactive mode header bit*/ + metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ #endif } -- GitLab From ad4a1668dae54ca014630c8d45f852f720f86d89 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 13:29:54 +0530 Subject: [PATCH 0178/1418] Resolving the BR switching test cases failures. --- lib_com/ivas_prot.h | 11 ++++ lib_dec/ivas_sba_dec.c | 124 ++++++++++++++++++++++++++++++++++++- lib_dec/ivas_spar_md_dec.c | 28 ++++++--- 3 files changed, 151 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 8d91fda692..bf918404ae 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4530,7 +4530,18 @@ void ivas_get_spar_md_from_dirac( int16_t ivas_get_spar_dec_md_num_subframes( const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int32_t ivas_total_brate ); +#ifdef VLBR_20MS_MD + +ivas_error ivas_spar_md_dec_matrix_open( + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels, /* i : number of internal channels */ + const int16_t num_md_sub_frames ); +void ivas_spar_md_dec_matrix_close( + ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels ); /* i : number of internal channels */ + +#endif ivas_error ivas_spar_md_dec_open( ivas_spar_md_dec_state_t **hMdDec_out, /* i/o: SPAR MD decoder handle */ const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 79bde81a90..1a3a7517d6 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -110,7 +110,10 @@ ivas_error ivas_sba_dec_reconfigure( int16_t sba_dirac_stereo_flag_old; int32_t ivas_total_brate; int32_t last_ivas_total_brate; - +#ifdef VLBR_20MS_MD + int16_t num_channels, num_md_sub_frames; + int16_t i,j,k; +#endif RENDERER_TYPE old_renderer_type; DECODER_CONFIG_HANDLE hDecoderConfig; @@ -170,7 +173,7 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } -#ifdef VLBR_20MS_MD +#ifndef VLBR_20MS_MD if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) #else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) @@ -184,7 +187,65 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } +#ifdef VLBR_20MS_MD + else if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) + { + + num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; + + ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); + + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); + if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, + num_md_sub_frames ) ) != IVAS_ERR_OK ) + { + return error; + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; + } + } + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; + } + } + } + } +#endif 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 @@ -194,7 +255,66 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } +#ifndef VLBR_20MS_MD + if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) + { + + num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; + ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); + + num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); + if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, + num_md_sub_frames ) ) != IVAS_ERR_OK ) + { + return error; + } + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; + } + } + } + + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; + } + } + } + + } +#endif hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index ab2fd9a7c4..9e381f6900 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -96,11 +96,15 @@ static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder * * Allocate and initialize SPAR MD decoder matrices *------------------------------------------------------------------------*/ - -static ivas_error ivas_spar_md_dec_matrix_open( - ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ - const int16_t num_channels, /* i : number of internal channels */ - const int16_t num_md_sub_frames ) +#ifdef VLBR_20MS_MD +ivas_error ivas_spar_md_dec_matrix_open +#else +static ivas_error ivas_spar_md_dec_matrix_open +#endif + ( + ivas_spar_md_dec_state_t *hMdDec, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels, /* i : number of internal channels */ + const int16_t num_md_sub_frames ) { int16_t i, j; @@ -337,11 +341,15 @@ ivas_error ivas_spar_md_dec_open( * * Deallocate SPAR MD decoder matrices *------------------------------------------------------------------------*/ - -static void ivas_spar_md_dec_matrix_close( - ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ - const int16_t num_channels /* i : number of internal channels */ -) +#ifdef VLBR_20MS_MD +void ivas_spar_md_dec_matrix_close +#else +static void ivas_spar_md_dec_matrix_close +#endif + ( + ivas_spar_md_dec_state_t *hMdDecoder, /* i/o: SPAR MD decoder handle */ + const int16_t num_channels /* i : number of internal channels */ + ) { int16_t i, j; -- GitLab From 2ffc67a7414f5e9e7c4aae77fe332b7636e4661d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 14:10:21 +0530 Subject: [PATCH 0179/1418] Minor clean up changes --- lib_dec/ivas_sba_dec.c | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 3c7323008d..5394b8b9d8 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -173,11 +173,7 @@ ivas_error ivas_sba_dec_reconfigure( hSpar->hPCA = NULL; } -#ifndef VLBR_20MS_MD - if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) || ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) ) -#else if ( nchan_transport_old != ivas_get_sba_num_TCs( ivas_total_brate, sba_order_internal ) || ( last_ivas_total_brate >= IVAS_512k && ivas_total_brate < IVAS_512k ) || ( last_ivas_total_brate < IVAS_512k && ivas_total_brate >= IVAS_512k ) ) -#endif { ivas_spar_dec_close( &( st_ivas->hSpar ), hDecoderConfig->output_Fs, 1 ); @@ -255,65 +251,6 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } -#ifndef VLBR_20MS_MD - if ( last_ivas_total_brate < IVAS_24k4 && ivas_total_brate >= IVAS_24k4 ) - { - - num_channels = st_ivas->hSpar->hMdDec->spar_md_cfg.num_umx_chs; - - ivas_spar_md_dec_matrix_close( st_ivas->hSpar->hMdDec, num_channels ); - - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order_internal, ivas_total_brate ); - if ( ( error = ivas_spar_md_dec_matrix_open( st_ivas->hSpar->hMdDec, num_channels, - num_md_sub_frames ) ) != IVAS_ERR_OK ) - { - return error; - } - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; - } - } - } - } -#endif hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -- GitLab From 38d9ee96531da70c65c207c36bbc31a04645aed2 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Wed, 14 Jun 2023 11:15:15 +0200 Subject: [PATCH 0180/1418] Move TDREND_PLAY_STATUS update outside the subframe loop --- lib_com/options.h | 3 ++- lib_rend/ivas_objectRenderer.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index aafa43e9af..2e6cb33e29 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,8 +185,9 @@ #define FIX_528_ISM_MD_FILE_TOO_SHORT /* VA: issue 528: ISM Metadata file too short */ +#define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ -/* ################## End DEVELOPMENT switches ######################### */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ #endif diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index d1858ee97f..44aedc5cfa 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -296,6 +296,16 @@ ivas_error ivas_td_binaural_renderer_unwrap( hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE; c_indx++; } +#ifdef FIX_550_FIRST_FRAME_ACCESS + if (hIsmMetaData[nS]->non_diegetic_flag) + { + TDREND_MIX_SRC_SetPlayState(hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC); + } + else + { + TDREND_MIX_SRC_SetPlayState(hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING); + } +#endif } for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) @@ -489,11 +499,15 @@ void TDREND_Update_object_positions( Pos[1] = hIsmMetaData[nS]->azimuth / 90.f; Pos[2] = 0; TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos ); +#ifndef FIX_550_FIRST_FRAME_ACCESS TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ); +#endif } else { +#ifndef FIX_550_FIRST_FRAME_ACCESS TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); +#endif } TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir ); } -- GitLab From 60aa51b3b647c6992191d1eaf4207d24040814ad Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Wed, 14 Jun 2023 11:18:20 +0200 Subject: [PATCH 0181/1418] Include the condition for ISM format --- lib_rend/ivas_objectRenderer.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 44aedc5cfa..07c076edec 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -297,13 +297,16 @@ ivas_error ivas_td_binaural_renderer_unwrap( c_indx++; } #ifdef FIX_550_FIRST_FRAME_ACCESS - if (hIsmMetaData[nS]->non_diegetic_flag) + if ( ivas_format == ISM_FORMAT ) { - TDREND_MIX_SRC_SetPlayState(hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC); - } - else - { - TDREND_MIX_SRC_SetPlayState(hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING); + if ( hIsmMetaData[nS]->non_diegetic_flag ) + { + TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ); + } + else + { + TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); + } } #endif } @@ -501,7 +504,7 @@ void TDREND_Update_object_positions( TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos ); #ifndef FIX_550_FIRST_FRAME_ACCESS TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ); -#endif +#endif } else { -- GitLab From b1786afa8993d43fc570a9f1ede8e58f13407036 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 14 Jun 2023 15:01:50 +0530 Subject: [PATCH 0182/1418] Few more minor clean-up done --- lib_dec/ivas_sba_dec.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 5394b8b9d8..d4d55504cc 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -110,6 +110,7 @@ ivas_error ivas_sba_dec_reconfigure( int16_t sba_dirac_stereo_flag_old; int32_t ivas_total_brate; int32_t last_ivas_total_brate; + #ifdef VLBR_20MS_MD int16_t num_channels, num_md_sub_frames; int16_t i, j, k; @@ -204,38 +205,8 @@ ivas_error ivas_sba_dec_reconfigure( for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) { st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - } - } - } - - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; } } @@ -251,6 +222,7 @@ ivas_error ivas_sba_dec_reconfigure( return error; } } + hSpar = st_ivas->hSpar; st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas ); -- GitLab From 57f30a596e16da1dbf533fd751e4ba244922391d Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 14 Jun 2023 16:01:18 +0200 Subject: [PATCH 0183/1418] MASA_AND_OBJECTS fix within ISM_25k6_HZ_CORE --- lib_dec/ivas_sce_dec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 19c655c87a..9024e91e73 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -380,7 +380,11 @@ ivas_error create_sce_dec( st->mct_chan_mode = MCT_CHAN_MODE_REGULAR; #ifdef ISM_25k6_HZ_CORE st->is_ism_format = 0; +#ifdef MASA_AND_OBJECTS + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) +#else if ( st_ivas->ivas_format == ISM_FORMAT ) +#endif { st->is_ism_format = 1; } -- GitLab From fde3a29385ef0720a21fb9ba897eada28c736ca9 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 08:07:25 +0200 Subject: [PATCH 0184/1418] temp fix for orientation tracking init --- lib_com/options.h | 2 +- lib_dec/ivas_init_dec.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 85195e86cc..11128d2641 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -228,7 +228,7 @@ #define FIX_510 /* FhG: fix issue 510, misleading error message for invalid input format */ #define FIX_509 /* FhG: fix issue 509, too low number of bitsream indices in SBA */ #define FIX_XXX_JITTER_SBA_BINAURAL_GAIN - +#define FIX_XXX_HEADTRACKER_INIT #define API_5MS /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d696217825..57eac86767 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -631,6 +631,12 @@ ivas_error ivas_init_decoder_front( { return error; } +#ifdef FIX_XXX_HEADTRACKER_INIT + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, st_ivas->hDecoderConfig->orientation_tracking ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif } /*-------------------------------------------------------------------* @@ -781,6 +787,7 @@ ivas_error ivas_init_decoder( } } +#ifndef FIX_XXX_HEADTRACKER_INIT /*-----------------------------------------------------------------* * Set head/orientation tracking *-----------------------------------------------------------------*/ @@ -834,7 +841,7 @@ ivas_error ivas_init_decoder( } #endif } - +#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ -- GitLab From 619e2346bdcac9d7fa57e14d7cd9fb63cd53ac18 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 11:56:01 +0530 Subject: [PATCH 0185/1418] Removed the code related to planarCP = 1 --- lib_com/ivas_prot.h | 10 ++- lib_com/ivas_spar_com.c | 21 +++-- lib_com/ivas_spar_com_quant_util.c | 14 ++- lib_com/options.h | 1 + lib_dec/ivas_spar_md_dec.c | 138 ++++++++++++++++++++++++----- lib_enc/ivas_spar_md_enc.c | 136 +++++++++++++++++++++++----- 6 files changed, 265 insertions(+), 55 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 646d025ec3..ad7161e1b5 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4489,8 +4489,11 @@ void ivas_calc_c_p_coeffs( const int16_t num_dmx, const int16_t band_idx, const int16_t dtx_vad, - const int16_t compute_p_flag, + const int16_t compute_p_flag +#ifndef FIX_280_PLANAR_CP + , const int16_t planarCP +#endif ); void ivas_get_spar_md_from_dirac( @@ -4957,8 +4960,11 @@ void ivas_copy_band_coeffs_idx_to_arr( const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, - const ivas_coeffs_type_t coeff_type, + const ivas_coeffs_type_t coeff_type +#ifndef FIX_280_PLANAR_CP + , const int16_t planarCP +#endif ); void ivas_clear_band_coeffs( diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index c56421103d..59f976f4c9 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1253,10 +1253,16 @@ void ivas_calc_c_p_coeffs( const int16_t num_dmx, const int16_t band_idx, const int16_t dtx_vad, - const int16_t compute_p_flag, - const int16_t planarCP ) + const int16_t compute_p_flag +#ifndef FIX_280_PLANAR_CP + , + const int16_t planarCP +#endif +) { +#ifndef FIX_280_PLANAR_CP int16_t i, j; +#endif float postpred_cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; if ( num_dmx != num_ch ) @@ -1267,7 +1273,7 @@ void ivas_calc_c_p_coeffs( { ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < num_ch - num_dmx; i++ ) @@ -1281,12 +1287,12 @@ void ivas_calc_c_p_coeffs( } } } - +#endif if ( compute_p_flag == 1 ) { ivas_calc_p_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, dtx_vad, num_dmx, band_idx ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = num_dmx; i < num_ch; i++ ) @@ -1297,6 +1303,7 @@ void ivas_calc_c_p_coeffs( } } } +#endif } return; @@ -1611,7 +1618,11 @@ void ivas_compute_spar_params( if ( ndm != num_ch ) { +#ifndef FIX_280_PLANAR_CP ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1, 0 ); +#else + ivas_calc_c_p_coeffs( hSparMd, cov_real, i_ts, mixer_mat, num_ch, ndm, b, dtx_vad, 1 ); +#endif #ifdef SPAR_HOA_DBG /* if (b == 0) */ diff --git a/lib_com/ivas_spar_com_quant_util.c b/lib_com/ivas_spar_com_quant_util.c index 355e02ca76..018bf33818 100644 --- a/lib_com/ivas_spar_com_quant_util.c +++ b/lib_com/ivas_spar_com_quant_util.c @@ -243,11 +243,17 @@ void ivas_copy_band_coeffs_idx_to_arr( const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, - const ivas_coeffs_type_t coeff_type, - const int16_t planarCP ) + const ivas_coeffs_type_t coeff_type +#ifndef FIX_280_PLANAR_CP + , + const int16_t planarCP +#endif +) { int16_t i, len; +#ifndef FIX_280_PLANAR_CP int16_t j, k; +#endif int16_t *pPtr_idx = NULL; for ( i = 0; i < nB; i++ ) @@ -277,10 +283,13 @@ void ivas_copy_band_coeffs_idx_to_arr( len = pCell_dims[i].dim1 * pCell_dims[i].dim2; if ( ( coeff_type != DECX_COEFF ) ) { +#ifndef FIX_280_PLANAR_CP if ( ( coeff_type == PRED_COEFF ) || !planarCP ) { +#endif mvs2s( pPtr_idx, pSymbol_re, len ); pSymbol_re += len; +#ifndef FIX_280_PLANAR_CP } else { @@ -295,6 +304,7 @@ void ivas_copy_band_coeffs_idx_to_arr( } pSymbol_re += k; } +#endif } } diff --git a/lib_com/options.h b/lib_com/options.h index a0864dee37..c5900869ab 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -153,6 +153,7 @@ #define FIX_383_CLEAN_UP /* Dlb : Clean up of unused functions */ // #define FIX_532_ISM_MD_INACTIVE /* VA: issue 532: improve MD coding in ISM inactive frames */ #define FIX_547_NAN_IGF_DEC /* FhG: issue 547: fix possible nan in IGF decoder */ +#define FIX_280_PLANAR_CP /* Dlb : fix issue 28 : remove planarCP=1 related code*/ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 92e18c5c2c..2c212352d6 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -63,13 +63,21 @@ static const int16_t ivas_spar_dec_plc_spatial_target[IVAS_SPAR_MAX_CH] = { 1, 0 *------------------------------------------------------------------------------------------*/ static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, const int16_t numch_out, const int16_t active_w_vlbr ); - +#ifndef FIX_280_PLANAR_CP static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, const int16_t planarCP ); static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type, const int16_t planarCP ); +#else +static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t strat, const int32_t ivas_total_brate ); + +static void ivas_decode_huffman_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw ); + +static void ivas_fill_band_coeffs_idx( ivas_band_coeffs_ind_t *pBands_idx, const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, ivas_coeffs_type_t coeff_type ); + +#endif static void ivas_get_band_idx_from_differential( ivas_spar_md_t *pSpar_md, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const ivas_coeffs_type_t coeff_type ); static void ivas_mat_col_rearrange( float in_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], const int16_t order[IVAS_SPAR_MAX_CH], const int16_t i_ts, float ***mixer_mat, const int16_t bands, const int16_t num_ch ); @@ -84,7 +92,12 @@ static void ivas_parse_parameter_bitstream_dtx( ivas_spar_md_t *pSpar_md, Decode static ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, const float min_value, const float max_value, float *quant, const int16_t num_ch_dim2 ); +#ifndef FIX_280_PLANAR_CP static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t use_planar_coeff, const int16_t sba_inactive_mode, const int32_t last_active_brate ); +#else +static void ivas_spar_dec_parse_md_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, int16_t *nB, int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, const int16_t sba_inactive_mode, const int32_t last_active_brate ); + +#endif /*------------------------------------------------------------------------- @@ -675,8 +688,10 @@ void ivas_spar_md_dec_process( ivas_spar_dec_parse_md_bs( hMdDec, st0, &nB, &bw, &dtx_vad, st_ivas->hDecoderConfig->ivas_total_brate, - ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, st_ivas->hQMetaData->sba_inactive_mode, - st_ivas->last_active_ivas_total_brate ); +#ifndef FIX_280_PLANAR_CP + ivas_spar_br_table_consts[hMdDec->table_idx].usePlanarCoeff, +#endif + st_ivas->hQMetaData->sba_inactive_mode, st_ivas->last_active_ivas_total_brate ); #if 0 { @@ -1697,7 +1712,9 @@ static void ivas_spar_dec_parse_md_bs( int16_t *bands_bw, int16_t *dtx_vad, const int32_t ivas_total_brate, +#ifndef FIX_280_PLANAR_CP const int16_t use_planar_coeff, +#endif const int16_t sba_inactive_mode, const int32_t last_active_brate ) { @@ -1707,7 +1724,9 @@ static void ivas_spar_dec_parse_md_bs( ivas_quant_strat_t qs; int16_t strat, freq_diff, no_ec; int16_t do_diff[IVAS_MAX_NUM_BANDS]; +#ifndef FIX_280_PLANAR_CP int16_t planarCP; +#endif float quant[IVAS_SPAR_MAX_C_COEFF]; int16_t do_repeat[IVAS_MAX_NUM_BANDS]; int16_t bw_final, bw_fact; @@ -1819,7 +1838,7 @@ static void ivas_spar_dec_parse_md_bs( } qs = hMdDec->spar_md_cfg.quant_strat[qsi]; - +#ifndef FIX_280_PLANAR_CP planarCP = 0; if ( ( qsi == 2 ) && ( use_planar_coeff ) ) { @@ -1828,6 +1847,7 @@ static void ivas_spar_dec_parse_md_bs( fprintf( stdout, "planarCP = 1\n" ); #endif } +#endif strat = get_next_indice( st0, 3 ); #ifdef SPAR_HOA_DBG @@ -1888,12 +1908,20 @@ static void ivas_spar_dec_parse_md_bs( if ( no_ec == 0 ) { - ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, freq_diff, planarCP, + ivas_decode_arith_bs( hMdDec, st0, qsi, *nB, *bands_bw, do_diff, freq_diff, +#ifndef FIX_280_PLANAR_CP + planarCP, +#endif strat, ivas_total_brate ); } else { - ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw, planarCP ); + ivas_decode_huffman_bs( hMdDec, st0, qsi, *nB, *bands_bw +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } for ( i = 0; i < *nB; i++ ) @@ -2036,7 +2064,9 @@ static void ivas_decode_arith_bs( const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, +#ifndef FIX_280_PLANAR_CP const int16_t planarCP, +#endif const int16_t strat, const int32_t ivas_total_brate ) { @@ -2111,13 +2141,23 @@ static void ivas_decode_arith_bs( } } } - ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, pred_cell_dims, PRED_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, pred_cell_dims, PRED_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.pred_arith_re[qsi], &hMdDec->arith_coeffs.pred_arith_re_diff[qsi], st0, pred_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re ); - ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF, planarCP ); + ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( hMdDec->spar_hoa_md_flag && hMdDec->spar_hoa_dirac2spar_md_flag ) { @@ -2140,9 +2180,14 @@ static void ivas_decode_arith_bs( if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, drct_cell_dims, DRCT_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, drct_cell_dims, DRCT_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < nB; i++ ) @@ -2150,17 +2195,27 @@ static void ivas_decode_arith_bs( drct_cell_dims[i].dim1 = drct_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS; } } - +#endif ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.drct_arith_re[qsi], &hMdDec->arith_coeffs.drct_arith_re_diff[qsi], st0, drct_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re ); - ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, drct_cell_dims, DRCT_COEFF, planarCP ); + ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, drct_cell_dims, DRCT_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decd_cell_dims, DECD_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decd_cell_dims, DECD_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < nB; i++ ) @@ -2168,18 +2223,33 @@ static void ivas_decode_arith_bs( decd_cell_dims[i].dim1 = decd_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS; } } - +#endif ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.decd_arith_re[qsi], &hMdDec->arith_coeffs.decd_arith_re_diff[qsi], st0, decd_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re ); - ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decd_cell_dims, DECD_COEFF, planarCP ); + ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decd_cell_dims, DECD_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decx_cell_dims, DECX_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdDec->spar_md_prev.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decx_cell_dims, DECX_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } - ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF, planarCP ); + ivas_fill_band_coeffs_idx( hMdDec->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( freq_diff == 1 ) { @@ -2291,10 +2361,18 @@ static void ivas_fill_band_coeffs_idx( const int16_t nB, int16_t *pSymbol_re, ivas_cell_dim_t *pCell_dims, - const ivas_coeffs_type_t coeff_type, - const int16_t planarCP ) + const ivas_coeffs_type_t coeff_type +#ifndef FIX_280_PLANAR_CP + , + const int16_t planarCP +#endif +) { +#ifndef FIX_280_PLANAR_CP int16_t i, j, k, len; +#else + int16_t i, len; +#endif int16_t *pPtr_idx = NULL; for ( i = 0; i < nB; i++ ) @@ -2327,11 +2405,14 @@ static void ivas_fill_band_coeffs_idx( if ( coeff_type != DECX_COEFF ) { +#ifndef FIX_280_PLANAR_CP if ( ( coeff_type == PRED_COEFF ) || !planarCP ) { +#endif len = pCell_dims[i].dim1 * pCell_dims[i].dim2; mvs2s( pSymbol_re, pPtr_idx, len ); pSymbol_re += len; +#ifndef FIX_280_PLANAR_CP } else { @@ -2351,6 +2432,7 @@ static void ivas_fill_band_coeffs_idx( } pSymbol_re += k; } +#endif } } @@ -2369,8 +2451,12 @@ static void ivas_decode_huffman_bs( Decoder_State *st0, /* i/o: decoder state structure - for bitstream handling*/ const uint16_t qsi, const int16_t nB, - const int16_t bands_bw, - const int16_t planarCP ) + const int16_t bands_bw +#ifndef FIX_280_PLANAR_CP + , + const int16_t planarCP +#endif +) { int16_t i, j; int16_t ndm, ndec; @@ -2412,26 +2498,34 @@ static void ivas_decode_huffman_bs( for ( j = 0; j < drct_dim; j++ ) { +#ifndef FIX_280_PLANAR_CP if ( planarCP && !keep_planar[(int16_t) floor( j / ( ndm - 1 ) )] ) { hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] = 0; } else { +#endif ivas_huffman_decode( &hMdDec->huff_coeffs.drct_huff_re[qsi], st0, &hMdDec->spar_md.band_coeffs_idx[i].drct_index_re[j] ); +#ifndef FIX_280_PLANAR_CP } +#endif } for ( j = 0; j < decd_dim; j++ ) { +#ifndef FIX_280_PLANAR_CP if ( planarCP && !keep_planar[j] ) { hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j] = 0; } else { +#endif ivas_huffman_decode( &hMdDec->huff_coeffs.decd_huff_re[qsi], st0, &hMdDec->spar_md.band_coeffs_idx[i].decd_index_re[j] ); +#ifndef FIX_280_PLANAR_CP } +#endif } } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index dbca3809cc..bd2f817b48 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -72,18 +72,28 @@ static void ivas_band_mixer( float *cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #ifndef FIX_383_CLEAN_UP static void ivas_get_band_differential_index( ivas_band_coeffs_ind_t *pBand_idx, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const int16_t complex_cov, const int16_t dim, const ivas_coeffs_type_t coeff_type ); #endif - -static int16_t ivas_get_huffman_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, const int16_t planarCP, const int16_t bands_bw ); +static int16_t ivas_get_huffman_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, +#ifndef FIX_280_PLANAR_CP + const int16_t planarCP, +#endif + const int16_t bands_bw ); +#ifndef FIX_280_PLANAR_CP static int16_t ivas_get_arith_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t *pDo_diff, const int16_t bands_bw, const int16_t nB, const int16_t qsi, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); +#else +static int16_t ivas_get_arith_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t *pDo_diff, const int16_t bands_bw, const int16_t nB, const int16_t qsi, const int16_t strat, const int32_t ivas_total_brate ); + +#endif static ivas_error ivas_spar_set_enc_config( ivas_spar_md_enc_state_t *hMdEnc, int16_t *max_freq_per_chan, const int16_t nchan_transport, float *pFC, const int16_t nchan_inp ); static void ivas_select_next_strat( ivas_strats_t prior_strat, ivas_strats_t cs[MAX_QUANT_STRATS], const int16_t dmx_switch, const int16_t dtx_vad ); static void ivas_store_prior_coeffs( ivas_spar_md_enc_state_t *hMdEnc, const int16_t num_bands, const int16_t strat, const int16_t dtx_vad, const int16_t qsi ); - +#ifndef FIX_280_PLANAR_CP static void ivas_write_spar_md_bitstream( ivas_spar_md_enc_state_t *hMdEnc, const int16_t nB, const int16_t bands_bw, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, const int16_t qsi, const int16_t planarCP ); - +#else +static void ivas_write_spar_md_bitstream( ivas_spar_md_enc_state_t *hMdEnc, const int16_t nB, const int16_t bands_bw, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, const int16_t qsi ); +#endif static void ivas_spar_quant_pred_coeffs_dtx( ivas_spar_md_t *pSpar_md, const float *pValues, const int16_t ndm, int16_t *pIndex, const int16_t dim1, float *pQuant ); static void ivas_quant_p_per_band_dtx( float *pP_mat, const int16_t num_dec, const int16_t num_dmx, int16_t *ppIdx_pd, float *pP_out, const int16_t num_ch ); @@ -571,7 +581,9 @@ ivas_error ivas_spar_md_enc_process( float pred_coeffs_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; float dm_fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; int16_t i, j, b, qsi, ndm, ndec, num_ch, num_quant_strats; +#ifndef FIX_280_PLANAR_CP int16_t planarCP; +#endif float pred_coeffs_re_local[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; int16_t k, bwidth, num_bands, num_bands_full, num_bands_bw; int16_t active_w, nchan_transport, dmx_switch, strat; @@ -709,7 +721,9 @@ ivas_error ivas_spar_md_enc_process( #ifdef DEBUG_LBR_SBA float dirac_md_kbps = (float) ( hMetaData->nb_bits_tot ) * 50 / 1000; #endif +#ifndef FIX_280_PLANAR_CP planarCP = 0; +#endif code_strat = 0; #ifdef DEBUG_SBA_MD_DUMP ndec = -1; @@ -723,6 +737,7 @@ ivas_error ivas_spar_md_enc_process( #ifdef SPAR_HOA_DBG fprintf( stdout, "qsi = %d\n", qsi ); #endif +#ifndef FIX_280_PLANAR_CP if ( qsi == 2 && ivas_spar_br_table_consts[hMdEnc->table_idx].usePlanarCoeff ) { planarCP = 1; @@ -747,6 +762,7 @@ ivas_error ivas_spar_md_enc_process( } } } +#endif for ( b = 0; b < num_bands; b++ ) { ndm = hMdEnc->spar_md_cfg.num_dmx_chans_per_band[b * bands_bw]; @@ -770,7 +786,7 @@ ivas_error ivas_spar_md_enc_process( fprintf(stderr, "\n\n"); */ #endif - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < ndec; i++ ) @@ -793,6 +809,7 @@ ivas_error ivas_spar_md_enc_process( fprintf(stderr, "\n\n"); */ #endif } +#endif ivas_quant_p_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch ); } ivas_quant_pred_coeffs_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], num_ch ); @@ -885,7 +902,12 @@ ivas_error ivas_spar_md_enc_process( if ( ( ndm != num_ch ) && ( ndm != 1 ) ) { - ivas_calc_c_p_coeffs( &hMdEnc->spar_md, cov_real, 0, hMdEnc->mixer_mat, num_ch, ndm, b, dtx_vad, 0, planarCP ); + ivas_calc_c_p_coeffs( &hMdEnc->spar_md, cov_real, 0, hMdEnc->mixer_mat, num_ch, ndm, b, dtx_vad, 0 +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); #ifdef SPAR_HOA_DBG /*fprintf(stderr, "\n\n C coefficients: band %d\n", b); @@ -899,6 +921,7 @@ ivas_error ivas_spar_md_enc_process( } fprintf(stderr, "\n\n"); */ #endif +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < num_ch - ndm; i++ ) @@ -925,7 +948,7 @@ ivas_error ivas_spar_md_enc_process( fprintf(stderr, "\n\n"); */ #endif } - +#endif ivas_quant_c_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], ndec, ndm ); #ifdef SPAR_HOA_DBG @@ -964,7 +987,12 @@ ivas_error ivas_spar_md_enc_process( { reset_indices_enc( &hMetaData_tmp, md_indices_allocated ); - ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi, planarCP ); + ivas_write_spar_md_bitstream( hMdEnc, num_bands, bands_bw, &hMetaData_tmp, hEncoderConfig->ivas_total_brate, strat, qsi +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); /*write to main buffer if its a valid bitstream*/ if ( hMetaData_tmp.nb_bits_tot > 0 ) @@ -1320,8 +1348,12 @@ static void ivas_write_spar_md_bitstream( BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, - const int16_t qsi, - const int16_t planarCP ) + const int16_t qsi +#ifndef FIX_280_PLANAR_CP + , + const int16_t planarCP +#endif +) { int16_t no_ec, i; int16_t do_diff[IVAS_MAX_NUM_BANDS]; @@ -1431,12 +1463,20 @@ static void ivas_write_spar_md_bitstream( if ( no_ec == 1 ) { entropy_coding_result = - ivas_get_huffman_coded_bs( hMdEnc, hMetaData, nB, qsi, planarCP, bands_bw ); + ivas_get_huffman_coded_bs( hMdEnc, hMetaData, nB, qsi, +#ifndef FIX_280_PLANAR_CP + planarCP, +#endif + bands_bw ); } else { entropy_coding_result = - ivas_get_arith_coded_bs( hMdEnc, hMetaData, do_diff, bands_bw, nB, qsi, planarCP, strat, ivas_total_brate ); + ivas_get_arith_coded_bs( hMdEnc, hMetaData, do_diff, bands_bw, nB, qsi, +#ifndef FIX_280_PLANAR_CP + planarCP, +#endif + strat, ivas_total_brate ); } if ( entropy_coding_result < 0 ) @@ -1458,7 +1498,9 @@ static int16_t ivas_get_huffman_coded_bs( BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, +#ifndef FIX_280_PLANAR_CP const int16_t planarCP, +#endif const int16_t bands_bw ) { int16_t i, j; @@ -1480,7 +1522,7 @@ static int16_t ivas_get_huffman_coded_bs( pred_offset = DIRAC_TO_SPAR_HBR_PRED_CHS; } } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( j = pred_offset; j < pred_coeff_dim; j++ ) @@ -1521,6 +1563,7 @@ static int16_t ivas_get_huffman_coded_bs( } else { +#endif for ( j = pred_offset; j < pred_coeff_dim; j++ ) { ivas_huffman_encode( &hMdEnc->huff_coeffs.pred_huff_re[qsi], hMdEnc->spar_md.band_coeffs_idx[i].pred_index_re[j], &code, &len ); @@ -1550,7 +1593,9 @@ static int16_t ivas_get_huffman_coded_bs( } push_next_indice( hMetaData, code, len ); } +#ifndef FIX_280_PLANAR_CP } +#endif } return 0; @@ -1569,7 +1614,9 @@ static int16_t ivas_get_arith_coded_bs( const int16_t bands_bw, const int16_t nB, const int16_t qsi, +#ifndef FIX_280_PLANAR_CP const int16_t planarCP, +#endif const int16_t strat, const int32_t ivas_total_brate ) { @@ -1649,11 +1696,21 @@ static int16_t ivas_get_arith_coded_bs( } } } - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, pred_cell_dims, PRED_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, pred_cell_dims, PRED_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, pred_cell_dims, PRED_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } arith_result = ivas_arith_encode_cmplx_cell_array( &hMdEnc->arith_coeffs.pred_arith_re[qsi], &hMdEnc->arith_coeffs.pred_arith_re_diff[qsi], pDo_diff, nB, @@ -1688,13 +1745,23 @@ static int16_t ivas_get_arith_coded_bs( fprintf(stderr, "%d, ", hMdEnc->spar_md.band_coeffs_idx[0].drct_index_re[j]); fprintf(stderr, "\n\n"); */ #endif - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, drct_cell_dims, DRCT_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, drct_cell_dims, DRCT_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, drct_cell_dims, DRCT_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, drct_cell_dims, DRCT_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < nB; i++ ) @@ -1702,7 +1769,7 @@ static int16_t ivas_get_arith_coded_bs( drct_cell_dims[i].dim1 = drct_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS; } } - +#endif arith_result = ivas_arith_encode_cmplx_cell_array( &hMdEnc->arith_coeffs.drct_arith_re[qsi], &hMdEnc->arith_coeffs.drct_arith_re_diff[qsi], pDo_diff, nB, symbol_arr_re, symbol_arr_old_re, drct_cell_dims, hMetaData, any_diff, hMdEnc->spar_md_cfg.max_bits_per_blk ); if ( arith_result < 0 ) @@ -1710,13 +1777,23 @@ static int16_t ivas_get_arith_coded_bs( return -1; } - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, decd_cell_dims, DECD_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, decd_cell_dims, DECD_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decd_cell_dims, DECD_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decd_cell_dims, DECD_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } - +#ifndef FIX_280_PLANAR_CP if ( planarCP ) { for ( i = 0; i < nB; i++ ) @@ -1724,6 +1801,7 @@ static int16_t ivas_get_arith_coded_bs( decd_cell_dims[i].dim1 = decd_cell_dims[i].dim1 - IVAS_SPAR_HOA3_NP_CHS; } } +#endif arith_result = ivas_arith_encode_cmplx_cell_array( &hMdEnc->arith_coeffs.decd_arith_re[qsi], &hMdEnc->arith_coeffs.decd_arith_re_diff[qsi], pDo_diff, nB, symbol_arr_re, symbol_arr_old_re, decd_cell_dims, hMetaData, any_diff, hMdEnc->spar_md_cfg.max_bits_per_blk ); if ( arith_result < 0 ) @@ -1731,11 +1809,21 @@ static int16_t ivas_get_arith_coded_bs( return -1; } - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md.band_coeffs_idx, nB, symbol_arr_re, decx_cell_dims, DECX_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); if ( any_diff == 1 ) { - ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decx_cell_dims, DECX_COEFF, planarCP ); + ivas_copy_band_coeffs_idx_to_arr( hMdEnc->spar_md_prior.band_coeffs_idx_mapped, nB, symbol_arr_old_re, decx_cell_dims, DECX_COEFF +#ifndef FIX_280_PLANAR_CP + , + planarCP +#endif + ); } return 0; -- GitLab From e9bfe105548e7f4adceb5bd8c7e63922ee63001d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 12:10:23 +0530 Subject: [PATCH 0186/1418] Added line spacing that was removed --- lib_com/ivas_spar_com.c | 3 +++ lib_dec/ivas_spar_md_dec.c | 5 +++++ lib_enc/ivas_spar_md_enc.c | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index 59f976f4c9..86c9e76136 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -1273,6 +1273,7 @@ void ivas_calc_c_p_coeffs( { ivas_calc_c_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, num_dmx, band_idx, dtx_vad ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { @@ -1288,10 +1289,12 @@ void ivas_calc_c_p_coeffs( } } #endif + if ( compute_p_flag == 1 ) { ivas_calc_p_coeffs_per_band( pSparMd, i_ts, postpred_cov_re, num_ch, dtx_vad, num_dmx, band_idx ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 2c212352d6..69988b317b 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -63,6 +63,7 @@ static const int16_t ivas_spar_dec_plc_spatial_target[IVAS_SPAR_MAX_CH] = { 1, 0 *------------------------------------------------------------------------------------------*/ static void ivas_get_spar_matrices( ivas_spar_md_dec_state_t *hMdDec, const int16_t num_bands_out, const int16_t n_ts, const int16_t bw, const int16_t dtx_vad, const int16_t nB, const int16_t numch_out, const int16_t active_w_vlbr ); + #ifndef FIX_280_PLANAR_CP static void ivas_decode_arith_bs( ivas_spar_md_dec_state_t *hMdDec, Decoder_State *st, const uint16_t qsi, const int16_t nB, const int16_t bands_bw, int16_t *pDo_diff, const int16_t freq_diff, const int16_t planarCP, const int16_t strat, const int32_t ivas_total_brate ); @@ -1838,6 +1839,7 @@ static void ivas_spar_dec_parse_md_bs( } qs = hMdDec->spar_md_cfg.quant_strat[qsi]; + #ifndef FIX_280_PLANAR_CP planarCP = 0; if ( ( qsi == 2 ) && ( use_planar_coeff ) ) @@ -2187,6 +2189,7 @@ static void ivas_decode_arith_bs( #endif ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { @@ -2196,6 +2199,7 @@ static void ivas_decode_arith_bs( } } #endif + ivas_arith_decode_cmplx_cell_array( &hMdDec->arith_coeffs.drct_arith_re[qsi], &hMdDec->arith_coeffs.drct_arith_re_diff[qsi], st0, drct_cell_dims, pDo_diff, nB, symbol_arr_re, symbol_arr_old_re ); @@ -2215,6 +2219,7 @@ static void ivas_decode_arith_bs( #endif ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index bd2f817b48..6ac24e4039 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -72,6 +72,7 @@ static void ivas_band_mixer( float *cov_re[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH], #ifndef FIX_383_CLEAN_UP static void ivas_get_band_differential_index( ivas_band_coeffs_ind_t *pBand_idx, const int16_t q_levels[2], const int16_t one_sided, const int16_t nB, const int16_t complex_cov, const int16_t dim, const ivas_coeffs_type_t coeff_type ); #endif + static int16_t ivas_get_huffman_coded_bs( ivas_spar_md_enc_state_t *hMdEnc, BSTR_ENC_HANDLE hMetaData, const int16_t nB, const int16_t qsi, #ifndef FIX_280_PLANAR_CP const int16_t planarCP, @@ -89,11 +90,13 @@ static ivas_error ivas_spar_set_enc_config( ivas_spar_md_enc_state_t *hMdEnc, in static void ivas_select_next_strat( ivas_strats_t prior_strat, ivas_strats_t cs[MAX_QUANT_STRATS], const int16_t dmx_switch, const int16_t dtx_vad ); static void ivas_store_prior_coeffs( ivas_spar_md_enc_state_t *hMdEnc, const int16_t num_bands, const int16_t strat, const int16_t dtx_vad, const int16_t qsi ); + #ifndef FIX_280_PLANAR_CP static void ivas_write_spar_md_bitstream( ivas_spar_md_enc_state_t *hMdEnc, const int16_t nB, const int16_t bands_bw, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, const int16_t qsi, const int16_t planarCP ); #else static void ivas_write_spar_md_bitstream( ivas_spar_md_enc_state_t *hMdEnc, const int16_t nB, const int16_t bands_bw, BSTR_ENC_HANDLE hMetaData, const int32_t ivas_total_brate, const int16_t strat, const int16_t qsi ); #endif + static void ivas_spar_quant_pred_coeffs_dtx( ivas_spar_md_t *pSpar_md, const float *pValues, const int16_t ndm, int16_t *pIndex, const int16_t dim1, float *pQuant ); static void ivas_quant_p_per_band_dtx( float *pP_mat, const int16_t num_dec, const int16_t num_dmx, int16_t *ppIdx_pd, float *pP_out, const int16_t num_ch ); @@ -786,6 +789,7 @@ ivas_error ivas_spar_md_enc_process( fprintf(stderr, "\n\n"); */ #endif + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { @@ -949,6 +953,7 @@ ivas_error ivas_spar_md_enc_process( #endif } #endif + ivas_quant_c_per_band( &hMdEnc->spar_md.band_coeffs[b], &hMdEnc->spar_md.band_coeffs_idx[b], &hMdEnc->spar_md_cfg.quant_strat[qsi], ndec, ndm ); #ifdef SPAR_HOA_DBG @@ -1522,6 +1527,7 @@ static int16_t ivas_get_huffman_coded_bs( pred_offset = DIRAC_TO_SPAR_HBR_PRED_CHS; } } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { @@ -1761,6 +1767,7 @@ static int16_t ivas_get_arith_coded_bs( #endif ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { @@ -1770,6 +1777,7 @@ static int16_t ivas_get_arith_coded_bs( } } #endif + arith_result = ivas_arith_encode_cmplx_cell_array( &hMdEnc->arith_coeffs.drct_arith_re[qsi], &hMdEnc->arith_coeffs.drct_arith_re_diff[qsi], pDo_diff, nB, symbol_arr_re, symbol_arr_old_re, drct_cell_dims, hMetaData, any_diff, hMdEnc->spar_md_cfg.max_bits_per_blk ); if ( arith_result < 0 ) @@ -1793,6 +1801,7 @@ static int16_t ivas_get_arith_coded_bs( #endif ); } + #ifndef FIX_280_PLANAR_CP if ( planarCP ) { -- GitLab From 629ff241502096a6ee8e3c4127fdbac73f4a7f87 Mon Sep 17 00:00:00 2001 From: Shikha Shetgeri <100861@ittiam.com> Date: Thu, 15 Jun 2023 12:58:13 +0530 Subject: [PATCH 0187/1418] code clean up --- lib_com/ivas_cov_smooth.c | 87 ++++++++++++++++++++++++++++++++++++++ lib_com/ivas_spar_com.c | 2 + lib_com/options.h | 2 +- lib_dec/ivas_spar_md_dec.c | 6 +++ 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index e2aa44627b..7211274eea 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -41,6 +41,7 @@ #include "prot.h" #define BAND_SMOOTH_REST_START_IDX ( 2 ) +#ifndef CODE_CLEAN_UP_DIRAC /*-----------------------------------------------------------------------------------------* * Function ivas_set_up_cov_smoothing() * @@ -138,7 +139,93 @@ static void ivas_set_up_cov_smoothing( return; } +#else +/*-----------------------------------------------------------------------------------------* + * Function ivas_calculate_update_factor() + * + * To calculate the update factor + *-----------------------------------------------------------------------------------------*/ + +static float ivas_calculate_update_factor( float *p_bin_to_band, int16_t active_bins ) +{ + float update_factor_temp = 0.0f; + int16_t k; + for ( k = 0; k < active_bins; k++ ) + { + update_factor_temp += p_bin_to_band[k]; + } + return update_factor_temp; +} + +/*-----------------------------------------------------------------------------------------* + * Function ivas_calculate_smoothning_factor() + * + * To calculate the Smoothning factor + *-----------------------------------------------------------------------------------------*/ + +static void ivas_calculate_smoothning_factor( float *Smoothing_factor, float update_factor, const int16_t min_pool_size, const float max_update_rate, const COV_SMOOTHING_TYPE smooth_mode, const int32_t ivas_total_brate, int16_t j ) +{ + float smooth_fact; + *Smoothing_factor = update_factor / min_pool_size; + if ( smooth_mode != COV_SMOOTH_MC ) + { + if ( ivas_total_brate < IVAS_24k4 ) + { + smooth_fact = 0.5f; + } + else + { + smooth_fact = 0.75f; + } + *Smoothing_factor *= ( j + 1 ) * smooth_fact; + } + if ( *Smoothing_factor > max_update_rate ) + { + *Smoothing_factor = max_update_rate; + } +} + +/*-----------------------------------------------------------------------------------------* + * Function ivas_set_up_cov_smoothing() + * + * Setup for covariance smoothing + *-----------------------------------------------------------------------------------------*/ + +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, + const COV_SMOOTHING_TYPE smooth_mode, /* i : flag multichannel vs SPAR */ + const int32_t ivas_total_brate ) +{ + int16_t j; + float update_factor; + if ( smooth_mode == COV_SMOOTH_MC ) + { + for ( j = 0; j < pFb->filterbank_num_bands; j++ ) + { + int16_t active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; + update_factor = ivas_calculate_update_factor( pFb->fb_bin_to_band.pFb_bin_to_band[j], active_bins ); + ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); + } + } + else + { + for ( j = 0; j < pFb->filterbank_num_bands; j++ ) + { + float *p_bin_to_band = pFb->fb_bin_to_band.pp_short_stride_bin_to_band[j]; + int16_t active_bins = pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j]; + update_factor = ivas_calculate_update_factor( p_bin_to_band, active_bins ); + ivas_calculate_smoothning_factor( &hCovState->pSmoothing_factor[j], update_factor, min_pool_size, max_update_rate, smooth_mode, ivas_total_brate, j ); + } + } + + hCovState->prior_bank_idx = -1; +} + +#endif /*------------------------------------------------------------------------- * ivas_spar_covar_smooth_enc_open() diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index 86c9e76136..46b5351318 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -802,6 +802,7 @@ void ivas_create_fullr_dmx_mat( { ivas_reorder_array( down_mix_mat1_re, in_chans, order, mixer_mat, start_band, end_band ); } +#ifndef CODE_CLEAN_UP_DIRAC else { /* Custom 4x4 mult for WYiX case */ @@ -823,6 +824,7 @@ void ivas_create_fullr_dmx_mat( } } } +#endif return; } diff --git a/lib_com/options.h b/lib_com/options.h index c5900869ab..7b65897041 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,7 +154,7 @@ // #define FIX_532_ISM_MD_INACTIVE /* VA: issue 532: improve MD coding in ISM inactive frames */ #define FIX_547_NAN_IGF_DEC /* FhG: issue 547: fix possible nan in IGF decoder */ #define FIX_280_PLANAR_CP /* Dlb : fix issue 28 : remove planarCP=1 related code*/ - +#define CODE_CLEAN_UP_DIRAC /*Dlb : code clean up*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 69988b317b..6547d13a1d 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -625,9 +625,11 @@ static ivas_error ivas_spar_set_dec_config( case 9: /* IVAS_HOA_2_CH */ hMdDec->num_decorr = IVAS_TD_DECORR_OUT_5CH; break; +#ifndef CODE_CLEAN_UP_DIRAC case 16: /* IVAS_HOA_3_CH */ // ToDo: is this relevant? hMdDec->num_decorr = IVAS_TD_DECORR_OUT_12CH; break; +#endif case 6: /* IVAS_HOA_2_CH */ hMdDec->num_decorr = IVAS_TD_DECORR_OUT_2CH; break; @@ -1357,6 +1359,7 @@ static void ivas_get_spar_matrices( { ivas_mat_col_rearrange( tmp_dm_re, order, i_ts, hMdDec->mixer_mat, b, numch_out ); } +#ifndef CODE_CLEAN_UP_DIRAC else { /* Custom 4x4 mult for WYiX case */ @@ -1375,6 +1378,7 @@ static void ivas_get_spar_matrices( hMdDec->mixer_mat[i][3][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_dm_re[i][2]; } } +#endif } else { @@ -1382,6 +1386,7 @@ static void ivas_get_spar_matrices( { ivas_mat_col_rearrange( tmp_C1_re, order, i_ts, hMdDec->mixer_mat, b, numch_out ); } +#ifndef CODE_CLEAN_UP_DIRAC else { /* Custom 4x4 mult for WYiX case */ @@ -1400,6 +1405,7 @@ static void ivas_get_spar_matrices( hMdDec->mixer_mat[i][3][b + i_ts * IVAS_MAX_NUM_BANDS] = tmp_C1_re[i][2]; } } +#endif } if ( dmx_ch > 0 ) -- GitLab From 1e5e8f48f4d8da3d4955f7af0643808a166ba06d Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Jun 2023 09:41:10 +0200 Subject: [PATCH 0188/1418] fix remaining issues with FIX_532_ISM_MD_INACTIVE in OMASA --- lib_enc/ivas_masa_enc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 349ffa9515..dab2c493e2 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -385,22 +385,28 @@ ivas_error ivas_masa_encode( { /* signal NULL metadata frame */ push_next_indice( hMetaData, 1, ISM_METADATA_MD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_MD_FLAG_BITS; /* write the ISM class to ISM_NO_META and again the true ISM class */ push_next_indice( hMetaData, ISM_NO_META, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; } else { push_next_indice( hMetaData, hIsmMetaData[0]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; if ( hIsmMetaData[0]->ism_imp == ISM_NO_META ) { /* signal low-rate ISM_NO_META frame */ push_next_indice( hMetaData, 0, ISM_METADATA_MD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_MD_FLAG_BITS; /* signal presence of MD in low-rate ISM_NO_META frame */ push_next_indice( hMetaData, hIsmMetaData[0]->ism_md_lowrate_flag, ISM_METADATA_INACTIVE_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_INACTIVE_FLAG_BITS; } } #else @@ -424,22 +430,28 @@ ivas_error ivas_masa_encode( { /* signal NULL metadata frame */ push_next_indice( hMetaData, 1, ISM_METADATA_MD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_MD_FLAG_BITS; /* write the ISM class to ISM_NO_META and again the true ISM class */ push_next_indice( hMetaData, ISM_NO_META, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; push_next_indice( hMetaData, hIsmMetaData[i]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; } else { push_next_indice( hMetaData, hIsmMetaData[i]->ism_imp, ISM_METADATA_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_FLAG_BITS; if ( hIsmMetaData[i]->ism_imp == ISM_NO_META ) { /* signal low-rate ISM_NO_META frame */ push_next_indice( hMetaData, 0, ISM_METADATA_MD_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_MD_FLAG_BITS; /* signal presence of MD in low-rate ISM_NO_META frame */ push_next_indice( hMetaData, hIsmMetaData[i]->ism_md_lowrate_flag, ISM_METADATA_INACTIVE_FLAG_BITS ); + hQMetaData->metadata_max_bits -= ISM_METADATA_INACTIVE_FLAG_BITS; } } #else -- GitLab From b9df4e449978db7c3a07ffad28a8089e60f47295 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 13:27:16 +0530 Subject: [PATCH 0189/1418] Changes as part of issue#523 --- lib_com/options.h | 1 + lib_dec/ivas_dirac_dec.c | 4 ++++ lib_dec/ivas_init_dec.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index c0679a9f4d..993ad9df58 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,6 +151,7 @@ #endif +#define SBA_MODE_CLEANUP_2 /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/ #define FIX_137_SID_MD_BITS /* Dlb: Fix issue #137 , SID bitrate mismatch correction */ #define FIX_383_CLEAN_UP /* Dlb : Clean up of unused functions */ // #define FIX_532_ISM_MD_INACTIVE /* VA: issue 532: improve MD coding in ISM inactive frames */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 521baa405f..43d7307cf5 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1736,7 +1736,11 @@ void ivas_dirac_dec_read_BS( /* subtract mode signaling bits, since bitstream was moved after mode reading */ st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); +#ifndef SBA_MODE_CLEANUP_2 /* 1 bit flag for SPAR/DirAC, already read in read format function */ +#else + /* 1 bit flag for signaling metadata to read */ +#endif b = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits )++; hQMetaData->sba_inactive_mode = 1; diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b746baf47b..1495ddeed8 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -452,9 +452,11 @@ static ivas_error ivas_read_format( if ( st_ivas->ivas_format == SBA_FORMAT ) { +#ifndef SBA_MODE_CLEANUP_2 int16_t tc_mode_offset; tc_mode_offset = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); idx = st_ivas->bit_stream[tc_mode_offset]; +#endif if ( st_ivas->sba_analysis_order == 0 ) { st_ivas->sba_analysis_order = SBA_FOA_ORDER; -- GitLab From f5da52905bf0dae41db283fb5d5a6d1f9efb53d9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Jun 2023 10:16:37 +0200 Subject: [PATCH 0190/1418] update within FIX_511_OPTIMIZE_PARAMBIN_GAIN_FETCH for OMASA --- lib_enc/ivas_spar_md_enc.c | 2 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index dbca3809cc..9ff27f82fc 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -45,7 +45,7 @@ /*------------------------------------------------------------------------------------------* * PreProcessor *------------------------------------------------------------------------------------------*/ -#define IVAS_MAX_MD_BYTES ( 1000 ) +#define IVAS_MAX_MD_BYTES ( 1000 ) // ToDo: not used static const float pr_boost_range[2] = { 0.1f, 0.4f }; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 2c916691d0..4b6e364200 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -53,8 +53,8 @@ *------------------------------------------------------------------------*/ #define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f -#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) -#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) +#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) // ToDo: not used +#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) // ToDo: not used #ifdef MASA_AND_OBJECTS #define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f ) @@ -69,7 +69,11 @@ #define ADAPT_HTPROTO_ROT_LIM_1 0.8f #ifdef FIX_511_OPTIMIZE_PARAMBIN_GAIN_FETCH +#ifdef MASA_AND_OBJECTS +#define MAX_GAIN_CACHE_SIZE ( 5 * 3 ) /* == max number of simultaneous directions * 3 */ +#else #define MAX_GAIN_CACHE_SIZE 6 +#endif typedef struct hrtfGainCache { -- GitLab From 29a8aecfd90a08bac86b35d9c978d87be37f0018 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Jun 2023 11:12:31 +0200 Subject: [PATCH 0191/1418] fix MAX_GAIN_CACHE_SIZE size --- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1ca593f68e..fe2dc890b4 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -69,7 +69,7 @@ #define ADAPT_HTPROTO_ROT_LIM_1 0.8f #ifdef MASA_AND_OBJECTS -#define MAX_GAIN_CACHE_SIZE ( 5 * 3 ) /* == max number of simultaneous directions * 3 */ +#define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS + MAX_NUM_OBJECTS ) * 3 ) /* == max number of simultaneous directions * 3 */ #else #define MAX_GAIN_CACHE_SIZE 6 #endif -- GitLab From a862ad26249f69d3b05a4a820cf3015d3f966b1f Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 14:55:31 +0530 Subject: [PATCH 0192/1418] Address review comments --- lib_dec/ivas_qmetadata_dec.c | 2 +- lib_dec/ivas_spar_decoder.c | 4 ++++ lib_enc/ivas_qmetadata_enc.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index fc24398e39..d622f46fad 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -1191,7 +1191,7 @@ int16_t ivas_qmetadata_dec_sid_decode( /* TODO: still use old sid frame size to keep bitexactness */ metadata_sid_bits = (int16_t) ( 5000 /*IVAS_SID_5k2*/ - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1; /* -1 for inactive mode header bit*/ #else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * 18 ) - 1 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ + metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 1 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ #endif } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index b80cc08684..b93c28dc34 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -351,11 +351,15 @@ ivas_error ivas_spar_dec( if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { +#ifndef FIX_137_SID_MD_BITS int16_t zero_pad_bits; +#endif *nb_bits_read += SID_FORMAT_NBITS; +#ifndef FIX_137_SID_MD_BITS zero_pad_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - *nb_bits_read; assert( zero_pad_bits <= 1 ); *nb_bits_read += zero_pad_bits; +#endif } pop_wmops(); diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 0f6ea973da..a4b02b19d0 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -1224,10 +1224,14 @@ void reset_metadata_spatial( #endif hMetaData->ind_list[0].value = 1; metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; +#ifdef FIX_137_SID_MD_BITS + assert( hMetaData->nb_bits_tot == metadata_sid_bits ); +#else while ( hMetaData->nb_bits_tot < metadata_sid_bits ) { push_next_indice( hMetaData, 0, 1 ); /*fill bit*/ } +#endif } else { -- GitLab From 9ea697c8c11d35546c396818ec1da181ab5628ff Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Jun 2023 11:36:13 +0200 Subject: [PATCH 0193/1418] maintenance: new function ivas_omasa_ener_brate() + comments --- lib_com/ivas_prot.h | 16 ++++++++--- lib_enc/ivas_enc.c | 45 +++++++------------------------ lib_enc/ivas_ism_enc.c | 4 +-- lib_enc/ivas_ism_metadata_enc.c | 6 ++--- lib_enc/ivas_masa_enc.c | 4 +-- lib_enc/ivas_omasa_enc.c | 47 +++++++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 46 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 69745469ac..e1263217f7 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -947,7 +947,7 @@ ivas_error ivas_ism_enc( int16_t *nb_bits_metadata /* i : number of metadata bits */ #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif ); @@ -971,7 +971,7 @@ ivas_error ivas_ism_metadata_enc( ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif #ifdef FIX_OMASA_STEREO_SWITCHING ,int16_t *omasa_stereo_sw_cnt @@ -5078,7 +5078,7 @@ ivas_error ivas_masa_encode( const int16_t ism_imp /* i : importance of separated object */ #ifdef OMASA_ENERGIES , - const int16_t flag_omasa_brate /* i : flag for using less bitrate for objects in OMASA*/ + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif #endif ); @@ -5728,6 +5728,16 @@ void set_ism_importance_interformat( int16_t ism_imp[] /* o : ISM importance flags */ ); +#ifdef OMASA_ENERGIES +/*! r: flag for using less bitrate for objects in OMASA */ +int16_t ivas_omasa_ener_brate( + const int16_t nchan_ism, /* i : number of ISMs */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + float data_f[][L_FRAME48k], /* i : Input / transport audio signals */ + const int16_t input_frame /* i : Input frame size */ +); +#endif + /*! r: adjusted bitrate */ int32_t ivas_interformat_brate( const ISM_MODE ism_mode, /* i : ISM mode */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 9a1ed1ae30..3898b44fc5 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -63,9 +63,6 @@ ivas_error ivas_enc( Encoder_State *st; /* used for bitstream handling */ #ifdef MASA_AND_OBJECTS int16_t nb_bits_metadata[MAX_SCE + 1]; -#ifdef OMASA_ENERGIES - int16_t flag_omasa_brate; -#endif #else int16_t nb_bits_metadata[MAX_SCE]; #endif @@ -92,9 +89,6 @@ ivas_error ivas_enc( #ifdef MASA_AND_OBJECTS set_s( nb_bits_metadata, 0, MAX_SCE + 1 ); -#ifdef OMASA_ENERGIES - flag_omasa_brate = 0; -#endif #else set_s( nb_bits_metadata, 0, MAX_SCE ); #endif @@ -304,6 +298,11 @@ ivas_error ivas_enc( { float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; +#ifdef OMASA_ENERGIES + int16_t flag_omasa_ener_brate; + + flag_omasa_ener_brate = 0; +#endif if ( ( error = ivas_omasa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { @@ -358,40 +357,14 @@ ivas_error ivas_enc( else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { #ifdef OMASA_ENERGIES - float energy_ism, energy_masa; - - energy_ism = 0.0f; - - if ( st_ivas->nSCE >= 3 && st_ivas->hEncoderConfig->ivas_total_brate == IVAS_128k ) - { - for ( i = 0; i < st_ivas->nSCE; i++ ) - { - energy_ism += sum2_f( data_f[i], input_frame ); - } - - energy_masa = 0.0f; - - for ( i = st_ivas->nSCE; i < st_ivas->nSCE + 2; i++ ) - { - energy_masa += sum2_f( data_f[i], input_frame ); - } - - energy_ism = energy_ism / ( energy_masa + 1.0f ) * 2.0f / (float) ( st_ivas->nSCE ); - flag_omasa_brate = 0; - if ( energy_ism < 1.0f ) - { - flag_omasa_brate = 1; - } -#ifdef DEBUG_MODE_INFO - dbgwrite( &energy_ism, sizeof( float ), 1, 1, "en_ratio.bin" ); -#endif - } + flag_omasa_ener_brate = ivas_omasa_ener_brate( st_ivas->hEncoderConfig->nchan_ism, ivas_total_brate, data_f, input_frame ); #endif + /* Analysis, decision about bitrates per channel & core coding */ if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] #ifdef OMASA_ENERGIES , - flag_omasa_brate + flag_omasa_ener_brate #endif ) ) != IVAS_ERR_OK ) { @@ -416,7 +389,7 @@ ivas_error ivas_enc( st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp #ifdef OMASA_ENERGIES , - flag_omasa_brate + flag_omasa_ener_brate #endif ) ) != IVAS_ERR_OK ) { diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index c9ce0e7721..f68940c9dd 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -55,7 +55,7 @@ ivas_error ivas_ism_enc( int16_t *nb_bits_metadata /* i : number of metadata bits */ #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif ) { @@ -288,7 +288,7 @@ ivas_error ivas_ism_enc( nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 #ifdef OMASA_ENERGIES , - flag_omasa_brate + flag_omasa_ener_brate #endif #ifdef FIX_OMASA_STEREO_SWITCHING , diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 97e10027a9..d9b3645358 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -194,7 +194,7 @@ ivas_error ivas_ism_metadata_enc( const float lp_noise_CPE #ifdef OMASA_ENERGIES , - int16_t flag_omasa_brate + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif #ifdef FIX_OMASA_STEREO_SWITCHING , @@ -704,9 +704,9 @@ ivas_error ivas_ism_metadata_enc( { *ism_total_brate += ivas_interformat_brate( ism_mode, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag ); #ifdef OMASA_ENERGIES - if ( ism_imp[ch] > 1 && flag_omasa_brate == 1 && brate_limit_flag >= 0 ) + if ( ism_imp[ch] > 1 && flag_omasa_ener_brate == 1 && brate_limit_flag >= 0 ) { - *ism_total_brate -= flag_omasa_brate * ADJUST_ISM_BRATE_NEG; + *ism_total_brate -= ADJUST_ISM_BRATE_NEG; } if ( brate_limit_flag == -1 && ism_imp[ch] >= 1 && nchan_ism >= 3 && ( ism_total_brate_ref - *ism_total_brate > IVAS_48k ) ) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index dab2c493e2..6fa2d7885f 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -249,7 +249,7 @@ ivas_error ivas_masa_encode( const int16_t ism_imp /* i : importance of separated object */ #ifdef OMASA_ENERGIES , - const int16_t flag_omasa_brate /* i : flag for using less bitrate for objects in OMASA */ + const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif #endif ) @@ -470,7 +470,7 @@ ivas_error ivas_masa_encode( #ifdef OMASA_ENERGIES if ( ivas_total_brate == IVAS_128k && nchan_ism >= 3 ) { - push_next_indice( hMetaData, flag_omasa_brate, 1 ); + push_next_indice( hMetaData, flag_omasa_ener_brate, 1 ); hQMetaData->metadata_max_bits -= 1; } #endif diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 24d1cfe140..714054d977 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -727,6 +727,53 @@ void ivas_set_surplus_brate_enc( } +#ifdef OMASA_ENERGIES +/*--------------------------------------------------------------------------* + * ivas_omasa_ener_brate() + * + * + *--------------------------------------------------------------------------*/ + +/*! r: OMASA energy bitrate flag */ +int16_t ivas_omasa_ener_brate( + const int16_t nchan_ism, /* i : number of ISMs */ + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + float data_f[][L_FRAME48k], /* i : Input / transport audio signals */ + const int16_t input_frame /* i : Input frame size */ +) +{ + int16_t i, flag_omasa_ener_brate; + float energy_ism, energy_masa; + + flag_omasa_ener_brate = 0; + + if ( nchan_ism >= 3 && ivas_total_brate == IVAS_128k ) + { + energy_ism = 0.0f; + for ( i = 0; i < nchan_ism; i++ ) + { + energy_ism += sum2_f( data_f[i], input_frame ); + } + + energy_masa = 0.0f; + for ( i = nchan_ism; i < nchan_ism + MASA_MAXIMUM_DIRECTIONS; i++ ) + { + energy_masa += sum2_f( data_f[i], input_frame ); + } + + energy_ism = energy_ism / ( energy_masa + 1.0f ) * 2.0f / (float) ( nchan_ism ); + + if ( energy_ism < 1.0f ) + { + flag_omasa_ener_brate = 1; + } + } + + return flag_omasa_ener_brate; +} +#endif + + /*--------------------------------------------------------------------------* * Local functions *--------------------------------------------------------------------------*/ -- GitLab From 8d73b36a1595651fbf1f967b8ea516103181b76b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 13:06:03 +0200 Subject: [PATCH 0194/1418] fix compiling, re-add all 5ms API stuff that got lost in the latest merge from main --- apps/decoder.c | 46 ++- lib_com/ivas_prot.h | 2 + lib_dec/ivas_binRenderer_internal.c | 35 ++- lib_dec/ivas_dirac_dec.c | 24 +- lib_dec/ivas_ism_renderer.c | 21 ++ lib_dec/ivas_mc_param_dec.c | 15 +- lib_dec/ivas_objectRenderer_internal.c | 12 + lib_dec/ivas_stat_dec.h | 2 +- lib_dec/lib_dec.c | 91 +++--- lib_dec/lib_dec.h | 24 +- lib_rend/ivas_crend.c | 14 + lib_rend/ivas_dirac_dec_binaural_functions.c | 12 + lib_rend/ivas_objectRenderer.c | 11 +- lib_rend/ivas_prot_rend.h | 9 +- lib_rend/ivas_rotation.c | 288 ++++++++++++++++++- lib_rend/ivas_stat_rend.h | 27 +- lib_rend/lib_rend.c | 107 +++++++ 17 files changed, 637 insertions(+), 103 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3f8be70cbd..d8f16e7768 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -403,8 +403,8 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ #ifdef API_5MS - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) #endif { @@ -1635,8 +1635,9 @@ static ivas_error initOnFirstGoodFrame( static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, - HeadRotFileReader *headRotReader, - HeadRotFileReader *refRotReader, + RotFileReader *headRotReader, + RotFileReader *externalOrientationFileReader, + RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ) @@ -1770,7 +1771,7 @@ static ivas_error decodeG192( IVAS_QUATERNION quaternion; if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( refRotReader ) ); + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); goto cleanup; } @@ -1781,6 +1782,30 @@ static ivas_error decodeG192( } } + if ( arg.enableExternalOrientation ) + { + IVAS_QUATERNION Quaternion; + int8_t enableHeadRotation; + int8_t enableExternalOrientation; + int8_t enableRotationInterpolation; + int16_t numFramesToTargetOrientation; + + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( externalOrientationFileReader ) ); + goto cleanup; + } + + + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + /* Head-tracking input simulation */ if ( arg.enableHeadRotation ) { @@ -1788,7 +1813,7 @@ static ivas_error decodeG192( if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } @@ -2024,7 +2049,7 @@ static ivas_error decodeG192( IVAS_QUATERNION quaternion; if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( refRotReader ) ); + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); goto cleanup; } @@ -2042,7 +2067,7 @@ static ivas_error decodeG192( if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), HeadRotationFileReader_getFilePath( headRotReader ) ); + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } @@ -2055,7 +2080,7 @@ static ivas_error decodeG192( } /* decode and get samples */ - if ( ( error = IVAS_DEC_VoIP_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -2833,7 +2858,8 @@ static ivas_error decodeVoIP( int16_t nOutSamples = 0; #ifndef API_5MS uint16_t nSamplesAvailableNext = 0; -#endif#ifdef DEBUG_JBM_CMD_OPTION +#endif +#ifdef DEBUG_JBM_CMD_OPTION nOutSamples = (int16_t) ( arg.output_Fs / 1000 * arg.frontendFetchSizeMs ); #else nOutSamples = (int16_t) ( arg.output_Fs / 1000 * JBM_FRONTEND_FETCH_FRAMESIZE_MS ); diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 646d025ec3..7d3042d861 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5148,7 +5148,9 @@ void ivas_binaural_cldfb_sf( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ +#ifndef API_5MS int16_t subframe_idx, /* i : subframe index */ +#endif const int16_t numTimeSlots, /* i: : number of time slots to process */ float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 48eda8b313..eb2e33b80a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -994,7 +994,11 @@ void ivas_binaural_cldfb( } /* Implement binaural rendering */ +#ifdef API_5MS + ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#else ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -1086,8 +1090,11 @@ void ivas_binaural_cldfb_sf( } /* Implement binaural rendering */ +#ifdef API_5MS + ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#else ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - +#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { @@ -1120,9 +1127,11 @@ void ivas_binaural_cldfb_sf( *-------------------------------------------------------------------------*/ void ivas_binRenderer( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ - int16_t subframe_idx, /* i : subframe index */ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ +#ifndef API_5MS + int16_t subframe_idx, /* i : subframe index */ +#endif const int16_t numTimeSlots, /* i : number of time slots to render*/ float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ @@ -1146,8 +1155,10 @@ void ivas_binRenderer( } /* Head rotation in HOA3 or CICPx */ - if ( - hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb ) +#ifdef API_5MS + if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation && hBinRenderer->rotInCldfb ) +#else + if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb ) #endif { if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) @@ -1155,17 +1166,29 @@ void ivas_binRenderer( /* Rotation in SHD (HOA3) */ if ( hCombinedOrientationData->shd_rot_max_order == -1 ) { +#ifdef API_5MS + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); +#else rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); +#endif } else if ( hCombinedOrientationData->shd_rot_max_order > 0 ) { +#ifdef API_5MS + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); +#else rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); +#endif } } else { /* Rotation in SD (CICPx) */ +#ifdef API_5MS + rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); +#else rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); +#endif } } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index e7c3b7c371..19f99cad4e 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2456,9 +2456,17 @@ void ivas_dirac_dec_render_sf( set_zero( onset_filter_subframe, hDirAC->num_freq_bands ); } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] ) +#endif { +#ifdef API_5MS + p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[0][0]; +#else p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[subframe_idx][0][0]; +#endif if ( st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) { @@ -2522,7 +2530,11 @@ void ivas_dirac_dec_render_sf( set_zero( surCohRatio, hDirAC->num_freq_bands ); } } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) +#endif { ivas_dirac_dec_compute_directional_responses( hDirAC, st_ivas->hVBAPdata, @@ -2615,7 +2627,11 @@ void ivas_dirac_dec_render_sf( if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#endif { protoSignalComputation_shd( Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirAC->h_output_synthesis_psd_state.proto_direct_buffer_f, @@ -2848,8 +2864,12 @@ void ivas_dirac_dec_render_sf( ivas_dirac_dec_compute_diffuse_proto( hDirAC, slot_idx ); } - /*Compute PSDs*/ +/*Compute PSDs*/ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) +#endif { ivas_dirac_dec_output_synthesis_process_slot( reference_power, p_onset_filter, @@ -2942,7 +2962,9 @@ void ivas_dirac_dec_render_sf( /* Perform binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, +#ifndef API_5MS subframe_idx, +#endif hDirAC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 6dcc6dcd15..037f4a8b50 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -159,10 +159,17 @@ void ivas_ism_render( else { /* Combined rotation: rotate the object positions depending the head and external orientations */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif { +#ifdef API_5MS + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat, st_ivas->hIntSetup.is_planar_setup ); +#else rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); +#endif } else { @@ -243,6 +250,9 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) #endif { @@ -256,9 +266,17 @@ void ivas_ism_render_sf( { /* Combined rotation: rotate the object positions depending the head and external orientations */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) +#endif { +#ifdef API_5MS + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat, st_ivas->hIntSetup.is_planar_setup ); +#else rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); +#endif if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); @@ -287,6 +305,9 @@ void ivas_ism_render_sf( } /* update here only in case of head rotation */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) #endif { diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index a8a5f0c944..16159ad005 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1541,11 +1541,11 @@ void ivas_param_mc_dec_digest_tc( *------------------------------------------------------------------------*/ void ivas_param_mc_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { PARAM_MC_DEC_HANDLE hParamMC; @@ -1755,7 +1755,10 @@ void ivas_param_mc_dec_render( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { ivas_binRenderer( st_ivas->hBinRenderer, - st_ivas->hCombinedOrientationData, subframe_idx, + st_ivas->hCombinedOrientationData, +#ifndef API_5MS + subframe_idx, +#endif hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index a4c23b6110..3802c4fc09 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -86,9 +86,15 @@ ivas_error ivas_td_binaural_renderer( st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, +#ifdef API_5MS + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->Quaternion : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos : NULL, +#else ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL, +#endif ism_md_subframe_update, output, output_frame ); } @@ -178,6 +184,12 @@ ivas_error ivas_td_binaural_renderer_sf( } /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, + ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : 0, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->Quaternion : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos : NULL ); +#else TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] : 0, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c31389ddf9..18fedf54aa 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1197,8 +1197,8 @@ typedef struct decoder_config_structure #ifdef API_5MS int16_t tsm_active; #else - int16_t voip_active; +#endif int16_t Opt_delay_comp; /* flag indicating delay compensation active */ } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 841250b0c9..351ddf8722 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -445,9 +445,9 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const uint32_t sampleRate, /* i : output sampling frequency */ + const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ #ifdef API_5MS const int16_t tsmEnabled, /* i : enable TSM */ #endif @@ -611,6 +611,7 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->voipMode = voipMode; hIvasDec->hVoIP->speedFac = speedFac; hIvasDec->hVoIP->needNewFrame = false; +#endif #endif hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); #ifndef API_5MS @@ -654,35 +655,8 @@ ivas_error IVAS_DEC_EnableVoIP( } #endif #endif -#ifndef JBM_TSM_ON_TCS - if ( hDecoderConfig->output_Fs == 8000 ) - { - wss = 1; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 16000 ) - { - wss = 2; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 32000 ) - { - wss = 4; - css = 2; - } - else if ( hDecoderConfig->output_Fs == 48000 ) - { - wss = 6; - css = 3; - } - else - { - return IVAS_ERR_INIT_ERROR; - } -#endif #ifndef API_5MS -#ifdef JBM_TSM_ON_TCS /* postpone init of time scaler and output FIFO until we know the real number of TCs */ hIvasDec->hVoIP->hTimeScaler = NULL; #ifdef VARIABLE_SPEED_DECODING @@ -692,7 +666,6 @@ ivas_error IVAS_DEC_EnableVoIP( } #endif #endif - return error; } @@ -1493,18 +1466,32 @@ ivas_error IVAS_DEC_FeedRefVectorData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedExternalOrientationData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : external orientation data */ + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else IVAS_QUATERNION *orientation, /* i : external orientation data */ int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ) { EXTERNAL_ORIENTATION_HANDLE hExternalOrientationData; +#ifndef API_5MS int16_t i; +#endif +#ifdef API_5MS + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) +#else if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || orientation == NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1517,6 +1504,14 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( } /* Move external orientation data to the decoder handle (invert orientations) */ +#ifdef API_5MS + QuaternionInverse( orientation, &hExternalOrientationData->Quaternion ); + + hExternalOrientationData->enableHeadRotation = enableHeadRotation; + hExternalOrientationData->enableExternalOrientation = enableExternalOrientation; + hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation; + hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { QuaternionInverse( orientation[i], &hExternalOrientationData->Quaternions[i] ); @@ -1526,6 +1521,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( hExternalOrientationData->enableRotationInterpolation[i] = enableRotationInterpolation[i]; hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; } +#endif return IVAS_ERR_OK; } @@ -2062,12 +2058,10 @@ ivas_error IVAS_DEC_VoIP_GetSamples( int16_t timeScalingDone; int16_t result; ivas_error error; -#ifdef JBM_TSM_ON_TCS int16_t nSamplesRendered; uint16_t nSamplesTcsScaled; uint8_t nTransportChannels; uint8_t nOutChannels; -#endif error = IVAS_ERR_OK; @@ -2477,23 +2471,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( assert( nTimeScalerOutSamples <= APA_BUF ); nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; -#else - /* append scaled samples to FIFO */ - if ( pcmdsp_fifo_write( hVoIP->hFifoAfterTimeScaler, (uint8_t *) hVoIP->apaExecBuffer, (uint16_t) ( nTimeScalerOutSamples / hDecoderConfig->nchan_out ) ) != 0 ) - { - return IVAS_ERR_UNKNOWN; - } -#ifdef VARIABLE_SPEED_DECODING - if ( hVoIP->mode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) - { - int16_t nSamplesAvailableNext = pcmdsp_fifo_nReadableSamplesPerChannel( hVoIP->hFifoAfterTimeScaler ); - if ( nSamplesAvailableNext < nSamplesPerChannel ) - { - hVoIP->needNewFrame = true; - } - } -#endif -#endif if ( hIvasDec->hasBeenFedFirstGoodFrame && hVoIP->rendererType != JBM_RENDERER_NONE ) { @@ -2622,12 +2599,14 @@ ivas_error IVAS_DEC_VoIP_GetSamples( * Function to flush remaining audio in VoIP *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_Flush( +ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_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 */ - uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ - int16_t *nSamplesFlushed /* o : number of samples flushed */ +#ifndef API_5MS + uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#endif + int16_t *nSamplesFlushed /* o : number of samples flushed */ ) { ivas_error error; @@ -2645,6 +2624,7 @@ ivas_error IVAS_DEC_VoIP_Flush( *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); #else *nSamplesFlushed = min( nSamplesPerChannel, hVoIP->nSamplesAvailableNext ); +#endif #ifndef API_5MS if ( hVoIP->rendererType == JBM_RENDERER_NONE ) @@ -2707,7 +2687,8 @@ bool IVAS_DEC_VoIP_IsEmpty( return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); #else return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->hVoIP->nSamplesAvailableNext < nSamplesAsked ) ); -#endif} +#endif +} /*---------------------------------------------------------------------* diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index f17b6b6835..24d0bf1b57 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -227,11 +227,19 @@ ivas_error IVAS_DEC_FeedRefVectorData( /*! r: error code */ ivas_error IVAS_DEC_FeedExternalOrientationData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ - int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ - int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ - int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ - int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : external orientation data */ + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else + IVAS_QUATERNION *orientation, /* i : external orientation data */ + int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ); /*! r: error code */ @@ -279,11 +287,13 @@ ivas_error IVAS_DEC_VoIP_GetSamples( #endif ); -ivas_error IVAS_DEC_VoIP_Flush( +ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_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 */ - uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#ifndef API_5MS + uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#endif int16_t *nSamplesFlushed /* o : number of samples flushed */ ); diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index b2b4887499..e5bdd05ed1 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1348,6 +1348,12 @@ ivas_error ivas_rend_crendProcess( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + if ( hCombinedOrientationData->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( hCombinedOrientationData->enableCombinedOrientation[subframe_idx] != 0 ) @@ -1356,6 +1362,7 @@ ivas_error ivas_rend_crendProcess( break; } } +#endif } push_wmops( "ivas_rend_crendProcess" ); @@ -1470,6 +1477,12 @@ ivas_error ivas_rend_crendProcessSubframe( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + if ( hCombinedOrientationData->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( hCombinedOrientationData->enableCombinedOrientation[subframe_idx] != 0 ) @@ -1478,6 +1491,7 @@ ivas_error ivas_rend_crendProcessSubframe( break; } } +#endif } push_wmops( "ivas_rend_crendProcessSubframe" ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 41605cb678..c698ad1d3f 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -656,7 +656,11 @@ static void ivas_dirac_dec_binaural_internal( { for ( j = 0; j < 3; j++ ) { +#ifdef API_5MS + Rmat[i][j] = hCombinedOrientationData->Rmat[i][j]; +#else Rmat[i][j] = hCombinedOrientationData->Rmat[subframe][i][j]; +#endif } } @@ -669,7 +673,11 @@ static void ivas_dirac_dec_binaural_internal( } ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, +#ifdef API_5MS + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation > 0 ); +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -685,7 +693,11 @@ static void ivas_dirac_dec_binaural_internal( } ivas_dirac_dec_binaural_determine_processing_matrices( st_ivas, max_band_decorr, Rmat, +#ifdef API_5MS + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation > 0 ); +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); +#endif ivas_dirac_dec_binaural_process_output( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, subframe ); st_ivas->hDirAC->hDiffuseDist = NULL; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 86ec0125d5..842925d11a 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -302,8 +302,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( TDREND_Update_object_positions( hBinRendererTd, num_src, ivas_format, hIsmMetaData ); } /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? *enableCombinedOrientation : 0, ( Quaternions != NULL ) ? Quaternions : NULL, ( Pos != NULL ) ? Pos : NULL ); +#else TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); - +#endif if ( hReverb != NULL ) { if ( ( error = ivas_reverb_process( hReverb, transport_config, 0, output, p_reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) @@ -676,9 +679,15 @@ ivas_error ivas_td_binaural_renderer_ext( } if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, +#ifdef API_5MS + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->enableCombinedOrientation : NULL, + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->Quaternion : NULL, + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->listenerPos : NULL, +#else ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->enableCombinedOrientation : NULL, ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->Quaternions : NULL, ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->listenerPos : NULL, +#endif ism_md_subframe_update_ext, p_output, output_frame ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 4ea5cb4484..29a5ace8f4 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -859,15 +859,20 @@ ivas_error combine_external_and_head_orientations_rend( ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ IVAS_VECTOR3 *listenerPos, /* i : listener position */ - int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ +#ifndef API_5MS + int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ +#endif EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ); void external_target_interpolation( EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ +#ifndef API_5MS + , const int16_t i +#endif ); bool are_orientations_same( diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index dbeda48727..184f382ee8 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -286,7 +286,11 @@ void rotateFrame_shd( /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( SHrotmat_prev, hCombinedOrientationData->Rmat_prev, shd_rot_max_order ); +#ifdef API_5MS + SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat, shd_rot_max_order ); +#else SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat[subframe_idx], shd_rot_max_order ); +#endif for ( i = 0; i < subframe_len; i++ ) { @@ -338,7 +342,11 @@ void rotateFrame_shd( /* move Rmat to Rmat_prev */ for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + mvr2r( hCombinedOrientationData->Rmat[i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#else mvr2r( hCombinedOrientationData->Rmat[subframe_idx][i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#endif } return; @@ -426,7 +434,11 @@ void rotateFrame_sd( /* gains for current subframe rotation */ +#ifdef API_5MS + rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat, hTransSetup.is_planar_setup ); +#else rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat[subframe_idx], hTransSetup.is_planar_setup ); +#endif if ( hEFAPdata != NULL && ( hTransSetup.ls_azimuth[ch_in_woLFE] != azimuth || hTransSetup.ls_elevation[ch_in_woLFE] != elevation ) ) { efap_determine_gains( hEFAPdata, tmp_gains, azimuth, elevation, EFAP_MODE_EFAP ); @@ -463,7 +475,11 @@ void rotateFrame_sd( /* move Rmat to Rmat_prev */ for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + mvr2r( hCombinedOrientationData->Rmat[i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#else mvr2r( hCombinedOrientationData->Rmat[subframe_idx][i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#endif } /* copy to output */ @@ -692,7 +708,9 @@ ivas_error ivas_external_orientation_open( EXTERNAL_ORIENTATION_HANDLE *hExtOrientationData /* o : external orientation handle */ ) { +#ifndef API_5MS int16_t i; +#endif IVAS_QUATERNION identity; identity.w = 1.0f; @@ -705,6 +723,13 @@ ivas_error ivas_external_orientation_open( } /* Enable head rotation and disable external orientation as default */ +#ifdef API_5MS + ( *hExtOrientationData )->enableHeadRotation = 1; + ( *hExtOrientationData )->enableExternalOrientation = 0; + ( *hExtOrientationData )->enableRotationInterpolation = 0; + ( *hExtOrientationData )->numFramesToTargetOrientation = 0; + ( *hExtOrientationData )->Quaternion = identity; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { ( *hExtOrientationData )->enableHeadRotation[i] = 1; @@ -713,7 +738,7 @@ ivas_error ivas_external_orientation_open( ( *hExtOrientationData )->numFramesToTargetOrientation[i] = 0; ( *hExtOrientationData )->Quaternions[i] = identity; } - +#endif return IVAS_ERR_OK; } @@ -750,7 +775,10 @@ ivas_error ivas_combined_orientation_open( COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData /* o : combined orientation handle */ ) { - int16_t i, j; +#ifndef API_5MS + int16_t i; +#endif + int16_t j; IVAS_QUATERNION identity; IVAS_VECTOR3 origo; @@ -775,6 +803,19 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->Quaternions_ext_interpolation_start = identity; ( *hCombinedOrientationData )->Quaternions_ext_interpolation_target = identity; +#ifdef API_5MS + ( *hCombinedOrientationData )->enableCombinedOrientation = 0; + ( *hCombinedOrientationData )->Quaternion = identity; + ( *hCombinedOrientationData )->Quaternion_prev_headRot = identity; + ( *hCombinedOrientationData )->Quaternion_prev_extOrientation = identity; + ( *hCombinedOrientationData )->listenerPos = origo; + + for ( j = 0; j < 3; j++ ) + { + set_zero( ( *hCombinedOrientationData )->Rmat[j], 3 ); + ( *hCombinedOrientationData )->Rmat[j][j] = 1.0f; + } +#else /* Initialise orientations to identity */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { @@ -790,7 +831,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->Rmat[i][j][j] = 1.0f; } } - +#endif for ( j = 0; j < 3; j++ ) { set_zero( ( *hCombinedOrientationData )->Rmat_prev[j], 3 ); @@ -842,19 +883,29 @@ ivas_error combine_external_and_head_orientations_dec( { IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; +#ifndef API_5MS int16_t numHeadRotQuaternions = 0; +#endif if ( hHeadTrackData != NULL ) { +#ifdef API_5MS + headRotQuaternions = &hHeadTrackData->Quaternion; + listenerPos = &hHeadTrackData->Pos; +#else numHeadRotQuaternions = hHeadTrackData->num_quaternions; if ( hHeadTrackData->num_quaternions >= 0 ) { headRotQuaternions = hHeadTrackData->Quaternions; listenerPos = hHeadTrackData->Pos; } +#endif } - +#ifdef API_5MS + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); +#endif } @@ -872,8 +923,10 @@ ivas_error combine_external_and_head_orientations_rend( { IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; +#ifndef API_5MS int16_t numHeadRotQuaternions = 0; int16_t i; +#endif if ( hHeadTrackData != NULL ) { @@ -886,6 +939,13 @@ ivas_error combine_external_and_head_orientations_rend( else if ( hExtOrientationData != NULL ) { /* Head rotation data not available, use the freezed value or disable */ +#ifdef API_5MS + if ( hExtOrientationData->enableHeadRotation != 2 ) + { + hExtOrientationData->enableHeadRotation = 0; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableHeadRotation[i] != 2 ) @@ -893,9 +953,13 @@ ivas_error combine_external_and_head_orientations_rend( hExtOrientationData->enableHeadRotation[i] = 0; } } +#endif } - +#ifdef API_5MS + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); +#endif } @@ -907,14 +971,19 @@ ivas_error combine_external_and_head_orientations_rend( *------------------------------------------------------------------------*/ ivas_error combine_external_and_head_orientations( - IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ - IVAS_VECTOR3 *listenerPos, /* i : listener position */ - int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ + IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ + IVAS_VECTOR3 *listenerPos, /* i : listener position */ +#ifndef API_5MS + int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ +#endif EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { - int16_t i, j; +#ifndef API_5MS + int16_t i; +#endif + int16_t j; IVAS_QUATERNION identity; IVAS_VECTOR3 origo; @@ -942,6 +1011,18 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->interpolationIncrement = 1.0f; hCombinedOrientationData->Quaternions_ext_interpolation_start = identity; hCombinedOrientationData->Quaternions_ext_interpolation_target = identity; +#ifdef API_5MS + + hCombinedOrientationData->enableCombinedOrientation = 0; + hCombinedOrientationData->Quaternion = identity; + hCombinedOrientationData->listenerPos = origo; + + for ( j = 0; j < 3; j++ ) + { + set_zero( hCombinedOrientationData->Rmat[j], 3 ); + hCombinedOrientationData->Rmat[j][j] = 1.0f; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hCombinedOrientationData->enableCombinedOrientation[i] = 0; @@ -954,10 +1035,15 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Rmat[i][j][j] = 1.0f; } } +#endif } else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) { /* Head rotation only */ +#ifdef API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternions; + +#else if ( numHeadRotQuaternions >= 0 ) { for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) @@ -965,11 +1051,47 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; } } +#endif } if ( hExtOrientationData != NULL ) { /* External orientations */ +#ifdef API_5MS + + if ( hExtOrientationData->enableRotationInterpolation == 1 && hExtOrientationData->enableExternalOrientation > 0 ) + { + if ( hCombinedOrientationData->isInterpolationOngoing == TRUE && hCombinedOrientationData->interpolationCoefficient <= 1.0f && are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == true ) + { + /* Continue interpolation */ + QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternion ); + hCombinedOrientationData->interpolationCoefficient += hCombinedOrientationData->interpolationIncrement; + } + else + { + /* Stop interpolation or check for new interpolation */ + hCombinedOrientationData->isInterpolationOngoing = FALSE; + hCombinedOrientationData->interpolationCoefficient = 1.0f; + hCombinedOrientationData->interpolationIncrement = 1.0f; + external_target_interpolation( hExtOrientationData, hCombinedOrientationData ); + } + } + else + { + /* Interpolation disabled, use the current orientation values */ + + /* Use the most recent external orientation */ + if ( hExtOrientationData->enableExternalOrientation == 1 ) + { + hCombinedOrientationData->Quaternion = hExtOrientationData->Quaternion; + } + /* Use the freezed external orientation */ + else if ( hExtOrientationData->enableExternalOrientation == 2 ) + { + hCombinedOrientationData->Quaternion = hCombinedOrientationData->Quaternion_prev_extOrientation; + } + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableRotationInterpolation[i] == 1 && hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1005,11 +1127,46 @@ ivas_error combine_external_and_head_orientations( } } } +#endif } if ( hExtOrientationData != NULL && headRotQuaternions != NULL ) { /* Combine head and external orientations */ +#ifdef API_5MS + + /* Use the most recent head rotation */ + if ( hExtOrientationData->enableHeadRotation == 1 ) + { + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternions, &hCombinedOrientationData->Quaternion ); + } + else + { + hCombinedOrientationData->Quaternion = *headRotQuaternions; + } + } + /* Use the freezed head rotation */ + else if ( hExtOrientationData->enableHeadRotation == 2 ) + { + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternion, hCombinedOrientationData->Quaternion_prev_headRot, &hCombinedOrientationData->Quaternion ); + } + else + { + hCombinedOrientationData->Quaternion = hCombinedOrientationData->Quaternion_prev_headRot; + } + } + + /* Reset the combined orientations to identity */ + if ( hExtOrientationData->enableHeadRotation == 0 && hExtOrientationData->enableExternalOrientation == 0 ) + { + hCombinedOrientationData->Quaternion = identity; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { /* Use the most recent head rotation */ @@ -1043,20 +1200,36 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions[i] = identity; } } +#endif } if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) { /* Calculate the combined rotation matrix */ +#ifdef API_5MS + QuatToRotMat( hCombinedOrientationData->Quaternion, hCombinedOrientationData->Rmat ); +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { QuatToRotMat( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Rmat[i] ); } +#endif } /* Save the current orientations */ if ( hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + hCombinedOrientationData->Quaternion_prev_extOrientation = hCombinedOrientationData->Quaternion; + } + else + { + hCombinedOrientationData->Quaternion_prev_extOrientation = identity; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1068,9 +1241,29 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions_prev_extOrientation[i] = identity; } } +#endif } if ( headRotQuaternions != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData != NULL ) + { + if ( hExtOrientationData->enableHeadRotation > 0 ) + { + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; + } + else + { + hCombinedOrientationData->Quaternion_prev_headRot = identity; + } + } + else + { + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; + } + hCombinedOrientationData->listenerPos = *listenerPos; + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData != NULL ) @@ -1097,11 +1290,16 @@ ivas_error combine_external_and_head_orientations( } hCombinedOrientationData->listenerPos[i] = listenerPos[i]; } +#endif } /* Check if combined orientation is enabled */ if ( headRotQuaternions != NULL && hExtOrientationData == NULL ) { +#ifdef API_5MS + hCombinedOrientationData->enableCombinedOrientation = 1; + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( numHeadRotQuaternions >= 0 ) @@ -1113,9 +1311,20 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else if ( headRotQuaternions == NULL && hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + hCombinedOrientationData->enableCombinedOrientation = 1; + } + else + { + hCombinedOrientationData->enableCombinedOrientation = 0; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1127,9 +1336,20 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else if ( headRotQuaternions != NULL && hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 || hExtOrientationData->enableHeadRotation > 0 ) + { + hCombinedOrientationData->enableCombinedOrientation = 1; + } + else + { + hCombinedOrientationData->enableCombinedOrientation = 0; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 || ( hExtOrientationData->enableHeadRotation[i] > 0 && numHeadRotQuaternions >= 0 ) ) @@ -1141,13 +1361,18 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else { +#ifdef API_5MS + hCombinedOrientationData->enableCombinedOrientation = 0; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hCombinedOrientationData->enableCombinedOrientation[i] = 0; } +#endif } return IVAS_ERR_OK; @@ -1161,35 +1386,68 @@ ivas_error combine_external_and_head_orientations( *------------------------------------------------------------------------*/ void external_target_interpolation( - EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */ - const int16_t i ) + EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ +#ifndef API_5MS + , + const int16_t i +#endif +) { /* Sanity check for number of frames */ +#ifdef API_5MS + hExtOrientationData->numFramesToTargetOrientation = min( hExtOrientationData->numFramesToTargetOrientation, hCombinedOrientationData->maximumFramesToTargetOrientation ); + hExtOrientationData->numFramesToTargetOrientation = max( hExtOrientationData->numFramesToTargetOrientation, 0 ); +#else hExtOrientationData->numFramesToTargetOrientation[i] = min( hExtOrientationData->numFramesToTargetOrientation[i], hCombinedOrientationData->maximumFramesToTargetOrientation ); hExtOrientationData->numFramesToTargetOrientation[i] = max( hExtOrientationData->numFramesToTargetOrientation[i], 0 ); +#endif /* Interpolate from the current orientation to the target orientation */ +#ifdef API_5MS + if ( hExtOrientationData->numFramesToTargetOrientation > 0 ) +#else if ( hExtOrientationData->numFramesToTargetOrientation[i] > 0 ) +#endif { - if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternions[i] ) == false ) +#ifdef API_5MS + if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == false ) +#else + if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == false ) +#endif { /* Target orientation is different from the previous target, update the values */ /* Set the received orientation as the target */ +#ifdef API_5MS + hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternion; +#else hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternions[i]; +#endif /* Use the most recent external orientation as the starting orientation */ +#ifdef API_5MS + hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternion_prev_extOrientation; +#else hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternions_prev_extOrientation[i]; +#endif /* Calculate the interpolation increment and coefficient */ +#ifdef API_5MS + hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); +#else hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); +#endif hCombinedOrientationData->interpolationCoefficient = hCombinedOrientationData->interpolationIncrement; } /* Interpolate */ hCombinedOrientationData->isInterpolationOngoing = TRUE; +#ifdef API_5MS + QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternion ); +#else QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternions[i] ); +#endif hCombinedOrientationData->interpolationCoefficient += hCombinedOrientationData->interpolationIncrement; } else @@ -1198,7 +1456,11 @@ void external_target_interpolation( hCombinedOrientationData->isInterpolationOngoing = FALSE; hCombinedOrientationData->interpolationCoefficient = 1.0f; hCombinedOrientationData->interpolationIncrement = 1.0f; +#ifdef API_5MS + hCombinedOrientationData->Quaternion = hExtOrientationData->Quaternion; +#else hCombinedOrientationData->Quaternions[i] = hExtOrientationData->Quaternions[i]; +#endif } } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 3dde2563f2..14de5e7d55 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -286,12 +286,19 @@ typedef struct ivas_binaural_head_track_struct typedef struct ivas_external_orientation_struct { +#ifdef API_5MS + int8_t enableHeadRotation; /* 0 - disable, 1 - enable, 2 - freeze to previous rotation */ + int8_t enableExternalOrientation; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ + int8_t enableRotationInterpolation; /* 0 - disable, 1 - enable */ + int16_t numFramesToTargetOrientation; /* Number of frames until target orientation is reached */ + IVAS_QUATERNION Quaternion; /* External orientation in quaternions */ +#else int8_t enableHeadRotation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous rotation */ int8_t enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ int8_t enableRotationInterpolation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable */ int16_t numFramesToTargetOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* Number of frames until target orientation is reached */ IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; /* External orientation in quaternions */ - +#endif } EXTERNAL_ORIENTATION_DATA, *EXTERNAL_ORIENTATION_HANDLE; /*----------------------------------------------------------------------------------* @@ -300,7 +307,11 @@ typedef struct ivas_external_orientation_struct typedef struct ivas_combined_orientation_struct { +#ifdef API_5MS + int16_t enableCombinedOrientation; +#else int16_t enableCombinedOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif float interpolationCoefficient; float interpolationIncrement; int16_t maximumFramesToTargetOrientation; @@ -308,17 +319,31 @@ typedef struct ivas_combined_orientation_struct uint8_t lrSwitchedCurrent; float lrSwitchInterpVal; bool isInterpolationOngoing; +#ifdef API_5MS + IVAS_QUATERNION Quaternion; + IVAS_QUATERNION Quaternion_prev_headRot; + IVAS_QUATERNION Quaternion_prev_extOrientation; +#else IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION Quaternions_prev_headRot[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION Quaternions_prev_extOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif IVAS_QUATERNION Quaternions_ext_interpolation_start; IVAS_QUATERNION Quaternions_ext_interpolation_target; +#ifdef API_5MS + float Rmat[3][3]; +#else float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3]; +#endif float Rmat_prev[3][3]; float chEneIIR[2][MASA_FREQUENCY_BANDS]; /* independent of the format. MASA bands are suitable for the task and readily available in ROM. */ float procChEneIIR[2][MASA_FREQUENCY_BANDS]; int16_t shd_rot_max_order; +#ifdef API_5MS + IVAS_VECTOR3 listenerPos; +#else IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c1963fa031..89b51e7745 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2632,6 +2632,7 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData->Quaternions[i].y = 0.0f; decDummy->hHeadTrackData->Quaternions[i].z = 0.0f; } +#endif decDummy->hHeadTrackData->lrSwitchInterpVal = 0.0f; decDummy->hHeadTrackData->lrSwitchedCurrent = 0; decDummy->hHeadTrackData->lrSwitchedNext = 0; @@ -4254,21 +4255,35 @@ ivas_error IVAS_REND_SetExternalOrientation( if ( orientation == NULL ) { +#ifdef API_5MS + hIvasRend->hExternalOrientationData->enableExternalOrientation = 0; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { hIvasRend->hExternalOrientationData->enableExternalOrientation[i] = 0; } +#endif } else { for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { +#ifdef API_5MS + /* just fix compilation issues, ToDo: change ext renderer also to 5ms */ + QuaternionInverse( orientation[i], &hIvasRend->hExternalOrientationData->Quaternion ); + + hIvasRend->hExternalOrientationData->enableHeadRotation = enableHeadRotation[i]; + hIvasRend->hExternalOrientationData->enableExternalOrientation = enableExternalOrientation[i]; + hIvasRend->hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation[i]; + hIvasRend->hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation[i]; +#else QuaternionInverse( orientation[i], &hIvasRend->hExternalOrientationData->Quaternions[i] ); hIvasRend->hExternalOrientationData->enableHeadRotation[i] = enableHeadRotation[i]; hIvasRend->hExternalOrientationData->enableExternalOrientation[i] = enableExternalOrientation[i]; hIvasRend->hExternalOrientationData->enableRotationInterpolation[i] = enableRotationInterpolation[i]; hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; +#endif } } @@ -4317,7 +4332,12 @@ ivas_error IVAS_REND_GetCombinedOrientation( { for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { +#ifdef API_5MS + /* fix compilation only,ToDo adapt ext renderer to 5ms , this functions looks stale anyway */ + pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternion; +#else pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternions[i]; +#endif } } @@ -4476,7 +4496,12 @@ static ivas_error rotateFrameMc( { for ( j = 0; j < 3; j++ ) { +#ifdef API_5MS + /* fix compiling only, ToDo adapt ext renderer to 5ms */ + Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[i][j]; +#else Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; +#endif } } else @@ -4593,7 +4618,12 @@ static ivas_error rotateFrameSba( { for ( l = 0; l < 3; l++ ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + Rmat[i][l] = ( *hCombinedOrientationData )->Rmat[i][l]; +#else Rmat[i][l] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][l]; +#endif } } else @@ -4731,14 +4761,23 @@ static ivas_error renderIsmToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { + if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) { combinedOrientationEnabled = 1; break; } } +#endif } @@ -4750,6 +4789,16 @@ static ivas_error renderIsmToBinauralRoom( { for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + /* at least this looks like it is adapted to 5ms already since it "loops" only over the first subframe, ToDo needs to be checked */ + if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation ) + { + for ( j = 0; j < 3; j++ ) + { + Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[i][j]; + } + } +#else if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] ) { for ( j = 0; j < 3; j++ ) @@ -4757,6 +4806,7 @@ static ivas_error renderIsmToBinauralRoom( Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; } } +#endif else { /* Set to identity */ @@ -5156,7 +5206,9 @@ static ivas_error renderMcToBinaural( IVAS_REND_AudioBuffer tmpRotBuffer; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; int16_t i; @@ -5173,6 +5225,14 @@ static ivas_error renderMcToBinaural( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } + +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5181,6 +5241,7 @@ static ivas_error renderMcToBinaural( break; } } +#endif } if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled @@ -5254,7 +5315,9 @@ static ivas_error renderMcToBinauralRoom( int16_t i; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { @@ -5269,6 +5332,13 @@ static ivas_error renderMcToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5277,6 +5347,7 @@ static ivas_error renderMcToBinauralRoom( break; } } +#endif } if ( ( mcInput->hReverb != NULL && outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) @@ -5349,7 +5420,9 @@ static ivas_error renderMcCustomLsToBinauralRoom( float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif push_wmops( "renderMcCustomLsToBinauralRoom" ); @@ -5364,6 +5437,13 @@ static ivas_error renderMcCustomLsToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compilin only, ToDo adapt renderer to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5372,6 +5452,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( break; } } +#endif } /* apply rotation */ @@ -5635,7 +5716,9 @@ static ivas_error renderSbaToBinaural( int16_t i; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif push_wmops( "renderSbaToBinaural" ); @@ -5648,6 +5731,13 @@ static ivas_error renderSbaToBinaural( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5656,6 +5746,7 @@ static ivas_error renderSbaToBinaural( break; } } +#endif } /* apply rotation */ @@ -5711,7 +5802,9 @@ static ivas_error renderSbaToBinauralRoom( float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif tmpRotBuffer = outAudio; /* avoid compilation warning */ @@ -5726,6 +5819,13 @@ static ivas_error renderSbaToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5734,6 +5834,7 @@ static ivas_error renderSbaToBinauralRoom( break; } } +#endif } /* apply rotation */ @@ -6201,8 +6302,14 @@ static ivas_error renderActiveInputsMasa( { for ( sf_idx = 0; sf_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; ++sf_idx ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + pCurrentInput->decDummy->hHeadTrackData->Quaternion = hIvasRend->headRotData.headPositions[sf_idx]; + pCurrentInput->decDummy->hHeadTrackData->Pos = hIvasRend->headRotData.Pos[sf_idx]; +#else pCurrentInput->decDummy->hHeadTrackData->Quaternions[sf_idx] = hIvasRend->headRotData.headPositions[sf_idx]; pCurrentInput->decDummy->hHeadTrackData->Pos[sf_idx] = hIvasRend->headRotData.Pos[sf_idx]; +#endif } } -- GitLab From 09102fb7438713ae6f0d3e71fa3032b413c73f97 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 15 Jun 2023 14:22:46 +0300 Subject: [PATCH 0195/1418] Fix binaural gain cache in relation to OMASA --- lib_rend/ivas_dirac_dec_binaural_functions.c | 38 ++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index fe2dc890b4..e418af9d52 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -69,7 +69,7 @@ #define ADAPT_HTPROTO_ROT_LIM_1 0.8f #ifdef MASA_AND_OBJECTS -#define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS + MAX_NUM_OBJECTS ) * 3 ) /* == max number of simultaneous directions * 3 */ +#define MAX_GAIN_CACHE_SIZE ( ( MASA_MAXIMUM_DIRECTIONS * 3 ) + MAX_NUM_OBJECTS ) /* == different calls to get gains */ #else #define MAX_GAIN_CACHE_SIZE 6 #endif @@ -814,6 +814,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric int16_t dirac_read_idx; float subFrameTotalEne[CLDFB_NO_CHANNELS_MAX]; PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_GAIN_CACHE_SIZE]; +#ifdef MASA_AND_OBJECTS + int16_t gainCacheBaseIndex; +#endif hDirAC = st_ivas->hDirAC; h = st_ivas->hDiracDecBin; @@ -952,6 +955,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric eleDeg = hDirAC->elevation[dirac_read_idx][bin]; ratio = hDirAC->energy_ratio1[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence[dirac_read_idx][bin]; +#ifdef MASA_AND_OBJECTS + gainCacheBaseIndex = 0; +#endif } #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format != MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_ISM_FORMAT && dirIndex < hDirAC->numParametricDirections ) ) /* For second of the two simultaneous directions */ @@ -970,6 +976,9 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric aziDeg = hDirAC->azimuth2[dirac_read_idx][bin]; eleDeg = hDirAC->elevation2[dirac_read_idx][bin]; spreadCoh = hDirAC->spreadCoherence2[dirac_read_idx][bin]; +#ifdef MASA_AND_OBJECTS + gainCacheBaseIndex = 3; +#endif } #ifdef MASA_AND_OBJECTS else /* For object directions of MASA_ISM_FORMAT */ @@ -989,6 +998,7 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric } ratio = st_ivas->hMasaIsmData->energy_ratio_ism[ismDirIndex][dirac_read_idx][bin]; spreadCoh = 0.0f; + gainCacheBaseIndex = 6 + ismDirIndex; } #endif @@ -1024,7 +1034,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric spreadCoh = max( spreadCoh, altSpreadCoh ); } +#ifdef MASA_AND_OBJECTS + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); +#else getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 )], isHeadtracked ); +#endif if ( h->renderStereoOutputInsteadOfBinaural ) { @@ -1067,7 +1081,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ +#ifdef MASA_AND_OBJECTS + getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); +#else getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 1 )], isHeadtracked ); +#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1077,7 +1095,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ +#ifdef MASA_AND_OBJECTS + getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); +#else getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[( dirIndex * 3 + 2 )], isHeadtracked ); +#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1293,7 +1315,12 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( int16_t dirac_read_idx; #endif DIRAC_DEC_BIN_HANDLE h; +#ifdef MASA_AND_OBJECTS + PARAMBIN_HRTF_GAIN_CACHE gainCache[MAX_NUM_OBJECTS]; + int16_t idx; +#else PARAMBIN_HRTF_GAIN_CACHE gainCache; +#endif h = st_ivas->hDiracDecBin; #ifdef MASA_AND_OBJECTS @@ -1320,7 +1347,14 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( dirac_read_idx = st_ivas->hDirAC->dirac_read_idx; #endif +#ifdef MASA_AND_OBJECTS + for ( idx = 0; idx < MAX_NUM_OBJECTS; idx++ ) + { + gainCache[idx].azi = -1000; /* Use -1000 as value for uninitialized cache. */ + } +#else gainCache.azi = -1000; /* Use -1000 as value for uninitialized cache. */ +#endif for ( bin = 0; bin < nBins; bin++ ) { @@ -1491,7 +1525,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( h->processMtxImPrev[chA][chB + 2][bin] = h->processMtxIm[chA][chB + 2][bin]; } - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache, isHeadtracked ); + getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, h->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); h->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; h->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; -- GitLab From 167aafc1b91d5e80f17084f9579de437b2483e75 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 15 Jun 2023 13:46:31 +0200 Subject: [PATCH 0196/1418] Add tests for 5ms renderer framing The feature is not implemented yet so they will fail --- tests/renderer/constants.py | 3 ++ tests/renderer/test_renderer.py | 68 ++++++++++++++++++++++----------- tests/renderer/utils.py | 4 ++ 3 files changed, 52 insertions(+), 23 deletions(-) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 877a1454c2..5780ee964b 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -200,6 +200,9 @@ HR_TRAJECTORIES_TO_TEST = [ "rotate_yaw_pitch_roll1", ] +""" 5ms framing """ +FRAMING_5MS_TO_TEST = [True, False] + """ Per-testcase xfail SNR thresholds (dB) """ pass_snr = dict() # not relevant for tests anymore, should be deprecated soon _pass_snr = { diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index 22f439c8b1..beed8e897b 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -35,24 +35,28 @@ from .utils import * @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics(test_info, in_fmt, out_fmt): - run_renderer(in_fmt, out_fmt) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ambisonics(test_info, in_fmt, out_fmt, framing_5ms): + run_renderer(in_fmt, out_fmt, framing_5ms=framing_5ms) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) -def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt): - run_renderer(in_fmt, out_fmt) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt, framing_5ms): + run_renderer(in_fmt, out_fmt, framing_5ms=framing_5ms) @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(test_info, in_fmt, out_fmt, trj_file): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, framing_5ms): run_renderer( in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + framing_5ms=framing_5ms, ) @@ -250,23 +254,26 @@ def test_ambisonics_binaural_headrotation_refveclev_vs_refvec( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel(test_info, in_fmt, out_fmt): - run_renderer(in_fmt, out_fmt) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_multichannel(test_info, in_fmt, out_fmt, framing_5ms): + run_renderer(in_fmt, out_fmt, framing_5ms=framing_5ms) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_static(test_info, in_fmt, out_fmt): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, framing_5ms): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") - run_renderer(in_fmt, out_fmt) + run_renderer(in_fmt, out_fmt, framing_5ms=framing_5ms) @pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) -def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, framing_5ms): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -275,12 +282,14 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + framing_5ms=framing_5ms, ) else: run_renderer( in_fmt, out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + framing_5ms=framing_5ms, ) @@ -318,28 +327,31 @@ def test_multichannel_binaural_headrotation_refvec_rotating(test_info, in_fmt, o @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:]) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism(test_info, in_fmt, out_fmt): - run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt]) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ism(test_info, in_fmt, out_fmt, framing_5ms): + run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], framing_5ms=framing_5ms) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_static(test_info, in_fmt, out_fmt): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ism_binaural_static(test_info, in_fmt, out_fmt, framing_5ms): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except: in_meta_files = None if out_fmt == "BINAURAL": - run_renderer(in_fmt, out_fmt, in_meta_files=in_meta_files) + run_renderer(in_fmt, out_fmt, in_meta_files=in_meta_files, framing_5ms=framing_5ms) else: - run_renderer(in_fmt, out_fmt, in_meta_files=in_meta_files) + run_renderer(in_fmt, out_fmt, in_meta_files=in_meta_files, framing_5ms=framing_5ms) @pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) -def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, framing_5ms): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] except: @@ -351,6 +363,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, + framing_5ms=framing_5ms, ) else: run_renderer( @@ -358,6 +371,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file): out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, + framing_5ms=framing_5ms, ) @@ -399,8 +413,9 @@ def test_ism_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA) -def test_masa(test_info, in_fmt, out_fmt): - run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt]) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_masa(test_info, in_fmt, out_fmt, framing_5ms): + run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt], framing_5ms=framing_5ms) """ Custom loudspeaker layouts """ @@ -408,8 +423,9 @@ def test_masa(test_info, in_fmt, out_fmt): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:]) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) -def test_custom_ls_input(test_info, in_layout, out_fmt): - run_renderer(CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt) +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_custom_ls_input(test_info, in_layout, out_fmt, framing_5ms): + run_renderer(CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, framing_5ms=framing_5ms) @pytest.mark.parametrize("out_fmt", CUSTOM_LS_TO_TEST) @@ -432,21 +448,25 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt): @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) -def test_custom_ls_input_binaural(test_info, in_layout, out_fmt): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_custom_ls_input_binaural(test_info, in_layout, out_fmt, framing_5ms): run_renderer( CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, + framing_5ms=framing_5ms, ) @pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST) @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) -def test_custom_ls_input_binaural_headrotation(test_info, in_layout, out_fmt, trj_file): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_custom_ls_input_binaural_headrotation(test_info, in_layout, out_fmt, trj_file, framing_5ms): run_renderer( CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), + framing_5ms=framing_5ms, ) @@ -455,11 +475,13 @@ def test_custom_ls_input_binaural_headrotation(test_info, in_layout, out_fmt, tr @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:]) @pytest.mark.parametrize("in_fmt", METADATA_SCENES_TO_TEST) -def test_metadata(test_info, in_fmt, out_fmt): +@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST) +def test_metadata(test_info, in_fmt, out_fmt, framing_5ms): run_renderer( "META", out_fmt, metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"), + framing_5ms=framing_5ms, ) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 356902ff47..ac5c57695a 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -114,6 +114,7 @@ def run_renderer( output_path_base: str = OUTPUT_PATH_CUT, binary_suffix: str = "", is_comparetest: Optional[bool] = False, + framing_5ms: Optional[bool] = False, ) -> Tuple[np.ndarray, int]: """CuT creation with standalone renderer""" if trj_file is not None: @@ -200,6 +201,9 @@ def run_renderer( if config_file is not None: cmd.extend(["-rc", str(config_file)]) + if framing_5ms: + cmd.extend(["-fr5"]) + run_cmd(cmd) return pyaudio3dtools.audiofile.readfile(out_file) -- GitLab From 52b5489763af0a72c31f3febebe5dcc6d9dcad83 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 13:55:13 +0200 Subject: [PATCH 0197/1418] fix compiling issues with API_5MS inactive --- apps/decoder.c | 10 +++++++--- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 3 +++ lib_dec/lib_dec.c | 10 ++++++++++ lib_rend/ivas_objectRenderer.c | 8 ++++++++ lib_rend/ivas_objectRenderer_hrFilt.c | 3 ++- lib_rend/ivas_rotation.c | 2 +- 7 files changed, 32 insertions(+), 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index d8f16e7768..d8229ce705 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2080,7 +2080,7 @@ static ivas_error decodeG192( } /* decode and get samples */ - if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -2858,7 +2858,7 @@ static ivas_error decodeVoIP( int16_t nOutSamples = 0; #ifndef API_5MS uint16_t nSamplesAvailableNext = 0; -#endif +#endif #ifdef DEBUG_JBM_CMD_OPTION nOutSamples = (int16_t) ( arg.output_Fs / 1000 * arg.frontendFetchSizeMs ); #else @@ -3325,7 +3325,11 @@ static ivas_error decodeVariableSpeed( fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); goto cleanup; } +#ifdef API_5MS IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ); +#else + IVAS_DEC_VoIP_SetScale( hIvasDec, scale ); +#endif } if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) @@ -3581,7 +3585,7 @@ static ivas_error decodeVariableSpeed( } /* decode and get samples */ - if ( ( error = IVAS_DEC_VoIP_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/lib_com/options.h b/lib_com/options.h index bee9901a56..9caeda123a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,6 +156,7 @@ #define FIX_XXX_JITTER_SBA_BINAURAL_GAIN #define FIX_XXX_HEADTRACKER_INIT +#define FIX_XXX_TDOBJRENDERER_INPUT #define API_5MS /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 2c0a05465c..8e6b0541db 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1645,6 +1645,9 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); n_samp_residual = 0; } +#else + n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); + n_samp_residual = hTcBuffer->n_samples_granularity - 1; #endif nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 351ddf8722..86d46fe2b0 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3655,6 +3655,7 @@ ivas_error IVAS_DEC_reconfigure( #ifdef API_5MS } #endif +#ifdef API_5MS if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) { @@ -3662,6 +3663,15 @@ ivas_error IVAS_DEC_reconfigure( } set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); +#else + if ( ( hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + + set_zero( hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif } else { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 842925d11a..9f39aa8b93 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -397,9 +397,17 @@ ivas_error TDREND_GetMix( { pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; pan_right = 1.f - pan_left; +#ifdef FIX_XXX_TDOBJRENDERER_INPUT + v_multc_acc( Src_p->InputFrame_p, pan_left, output_buf[0], subframe_length ); + v_multc_acc( Src_p->InputFrame_p, pan_right, output_buf[1], subframe_length ); +#else v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_left, output_buf[0], subframe_length ); v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length ); +#endif } +#ifdef FIX_XXX_TDOBJRENDERER_INPUT + Src_p->InputFrame_p += subframe_length; +#endif } /* Populate output variable */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6463261ec4..084da6550c 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -79,8 +79,9 @@ ivas_error TDREND_REND_RenderSourceHRFilt( v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); +#ifndef FIX_XXX_TDOBJRENDERER_INPUT Src_p->InputFrame_p += subframe_length; /* Increment input pointer */ - +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 184f382ee8..0997626bbb 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -1413,7 +1413,7 @@ void external_target_interpolation( #ifdef API_5MS if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == false ) #else - if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == false ) + if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternions[i] ) == false ) #endif { /* Target orientation is different from the previous target, update the values */ -- GitLab From c0f7678d6bb651ce2b856a32b854929c395f6664 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 15 Jun 2023 14:07:16 +0200 Subject: [PATCH 0198/1418] Copy CI yml from from other repo for easier editing --- .gitlab-ci-custom.yml | 1092 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1088 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 86c1f487e0..bef4bdb69e 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -1,4 +1,1088 @@ -include: - - project: $CUSTOM_CI_PROJECT - ref: $CUSTOM_CI_REF - file: $CUSTOM_CI_FILE +# include: +# - project: $CUSTOM_CI_PROJECT +# ref: $CUSTOM_CI_REF +# file: $CUSTOM_CI_FILE + +# Copied from ivas-ci:main + +variables: + # Variables as used in external repo (may be altered in value, see comments) + TESTV_DIR: "/usr/local/testv" + LTV_DIR: "/usr/local/ltv" + BUILD_OUTPUT: "build_output.txt" + EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test" + SANITIZER_TESTS: "CLANG1 CLANG2" + OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4" + OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3" + OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB" + EXIT_CODE_NON_BE: 123 + EXIT_CODE_FAIL: 1 + # Variables for FhG internal jobs + UPSTREAM_URL: "https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/" + INTERNAL_TESTV_DIR: "/testv" + INTERNAL_CI_REPO_CLONE_DIR: "ivas-internal-ci" + + +# This sets when pipelines are created. Jobs have more specific rules to restrict them. +workflow: + rules: + # see https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" + when: never + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' # Runs for merge requests + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Pushes to main + - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Scheduled in main + - if: $CI_PIPELINE_SOURCE == 'web' # Scheduled in main + + +stages: + - mirroring-pre-test + - build + - test + - compare + - validate + - mirroring-post-test + +# --------------------------------------------------------------- +# Generic script anchors +# --------------------------------------------------------------- + +# These can be used later on to do common tasks + +# Prints useful information for every job and should be used at the beginning of each job +.print-common-info: &print-common-info + - | + echo "Printing common information for build job." + echo "Current job is run on commit $CI_COMMIT_SHA" + echo "Commit time was $CI_COMMIT_TIMESTAMP" + date | xargs echo "System time is" + +.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) + +.mr-fetch-target-branch: &mr-fetch-target-branch + # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching + # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later + - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true + # needed when depth is lower than the number of commits in the branch + - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME + +.mr-get-target-commit: &mr-get-target-commit + # compare to last target branch commit before pipeline was created + - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H) + +# [INTERNAL] clone the ivas-internal-ci repo +.get-ivas-internal-ci-repo: &get-ivas-internal-ci-repo + - git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@$CI_SERVER_HOST/$CUSTOM_CI_PROJECT $INTERNAL_CI_REPO_CLONE_DIR + +# [INTERNAL] use this anchor to copy over the "old" internal testv/ files +.overwrite-testv-with-internal-ones: &overwrite-testv-with-internal-ones + - cp $INTERNAL_CI_REPO_CLONE_DIR/internal-testv/* scripts/testv/ + +# [INTERNAL] use for getting the sanitizer testvectors from ivas-internal-ci +.get-internal-ltv-signals: &get-internal-ltv-signals + # overwrite config + - cp $INTERNAL_CI_REPO_CLONE_DIR/scripts/ci_sanitizers_fhg_testv.json scripts/config/ci_linux_ltv.json + # copy files + - if [ ! -d "$LTV_DIR" ]; then mkdir -p $LTV_DIR; fi + - cp $INTERNAL_CI_REPO_CLONE_DIR/internal-ltv/* $LTV_DIR/ + +# --------------------------------------------------------------- +# Job templates +# --------------------------------------------------------------- + +# When designing templates, try not to use too much inheritance and +# if multiple templates and extended on, remember that on conflict, +# latest overwrites the parameter. + +# templates for rules +.rules-basis: + rules: + - if: $MIRROR_ACCESS_TOKEN # Don't run in the mirror update pipeline (only then MIRROR_ACCESS_TOKEN is defined) + when: never + - when: on_success + - if: $CI_PIPELINE_SOURCE == 'schedule' # Don't run in any scheduled pipelines by default (use schedule templates below to enable again for certain conditions) + when: never + - when: on_success + +.rules-merge-request: + extends: .rules-basis + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_PIPELINE_SOURCE == 'push' + when: never + +.rules-main-push: + extends: .rules-basis + rules: + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + +.rules-main-scheduled: + extends: .rules-basis + rules: + - if: $CI_PIPELINE_SOURCE == 'schedule' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + + +# templates to define stages and platforms + +# differs from forge -> we use docker image here +.test-job-linux: + tags: + - exec::docker + image: $CUSTOM_CI_REGISTRY/ubuntu_22.04:latest + +# differs from forge -> we use docker image here +.build-job-linux: + stage: build + # more time internally to accomodate for the shared runners + timeout: "4 minutes" + tags: + - exec::docker + image: $CUSTOM_CI_REGISTRY/ubuntu_22.04:latest + + +# template for test jobs on linux that need the TESTV_DIR +.test-job-linux-needs-testv-dir: + extends: .test-job-linux + tags: + - exec::docker + - res::ivas-testv + before_script: + - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi + - cp -r scripts/testv/* $TESTV_DIR/ + +# [INTERNAL] use the internal testvectors for self_test.prm items +.test-job-linux-needs-internal-testv-dir: + extends: .test-job-linux + tags: + - exec::docker + - res::ivas-testv + before_script: + - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi + # first copy external testvectors, then overwrite with internal ones + # this way, newly added vectors that have no internal pendent are not missing + - cp -r scripts/testv/* $TESTV_DIR/ + - cp -r $INTERNAL_TESTV_DIR/* $TESTV_DIR/ + +# [INTERNAL] copy "old" internal testvectors to scripts/testv to use them in self_test.prm-based test +.test-job-linux-with-internal-selftest-vectors: + extends: .test-job-linux + tags: + - exec::docker + - res::ivas-testv + before_script: + - cp -r $INTERNAL_TESTV_DIR/* ./scripts/testv/ + +# template for build jobs to include the check for warnings +.build-job-with-check-for-warnings: + extends: .build-job-linux + stage: build + allow_failure: + exit_codes: + - 123 + + +# --------------------------------------------------------------- +# Build jobs +# --------------------------------------------------------------- + +build-codec-linux-make: + extends: + - .build-job-with-check-for-warnings + - .rules-basis + script: + - *print-common-info + - make -j 2>&1 | tee $BUILD_OUTPUT + # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< + - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + +build-codec-linux-cmake: + extends: + - .build-job-with-check-for-warnings + - .rules-basis + script: + - *print-common-info + - mkdir build + - cd build + - cmake .. + - cd .. + - make -C build -j 2>&1 | tee $BUILD_OUTPUT + # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< + - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + +build-codec-instrumented-linux: + extends: + - .build-job-linux + - .rules-basis + script: + - *print-common-info + - bash ci/build_codec_instrumented_linux.sh + +# make sure that the codec builds with msan, asan and usan +build-codec-sanitizers-linux: + extends: + - .build-job-linux + - .rules-basis + script: + - *print-common-info + - bash ci/build_codec_sanitizers_linux.sh + + +# --------------------------------------------------------------- +# Test jobs for merge requests +# --------------------------------------------------------------- + +# test that runs all modes with 1s input signals +codec-smoke-test: + extends: + - .test-job-linux-needs-internal-testv-dir + - .rules-merge-request + timeout: "5 minutes" + stage: test + needs: [ "build-codec-linux-cmake" ] + script: + - *print-common-info + - bash ci/smoke_test.sh + ### analyze for failures + - if cat smoke_test_output.txt | grep -c "failed"; then echo "Smoke test without PLC failed"; exit 1; fi + - if cat smoke_test_output_plc.txt | grep -c "failed"; then echo "Smoke test with PLC failed"; exit 1; fi + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + when: always + paths: + - out/logs/ + - smoke_test_output.txt + - smoke_test_output_plc.txt + expose_as: 'Smoke test results' + + +# code selftest testvectors with memory-sanitizer binaries +msan-on-merge-request-linux: + extends: + - .test-job-linux + - .rules-merge-request + stage: test + needs: [ "build-codec-sanitizers-linux" ] + script: + - *print-common-info + - make clean + - make -j CLANG=1 + - python3 scripts/self_test.py --create | tee test_output.txt + - run_errors=$(cat test_output.txt | grep -ic "run errors") || true + - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang memory-sanitizer"; exit 1; fi + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + paths: + - scripts/ref/logs/ + - test_output.txt + expose_as: 'Msan selftest results' + + +# code selftest testvectors with address-sanitizer binaries +asan-on-merge-request-linux: + extends: + - .test-job-linux + - .rules-merge-request + stage: test + needs: [ "build-codec-sanitizers-linux" ] + script: + - *print-common-info + - make clean + - make -j CLANG=2 + - python3 scripts/self_test.py --create | tee test_output.txt + - run_errors=$(cat test_output.txt | grep -ic "run errors") || true + - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py with Clang address-sanitizer"; exit 1; fi + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + paths: + - scripts/ref/logs/ + - test_output.txt + expose_as: 'Asan selftest results' + +# test renderer executable +renderer-smoke-test: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-make"] + stage: test + script: + - make -j IVAS_rend + - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + when: always + paths: + - report-junit.xml + expose_as: "renderer make pytest results" + reports: + junit: + - report-junit.xml + +# test renderer executable with cmake + asan +renderer-asan: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-cmake"] + stage: test + script: + - python3 ci/disable_ram_counting.py + - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=asan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true + - cmake --build cmake-build -- -j + - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py + + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + when: always + paths: + - report-junit.xml + expose_as: "renderer asan pytest results" + reports: + junit: + - report-junit.xml + +# test renderer executable with cmake + msan +renderer-msan: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-cmake"] + stage: test + script: + - python3 ci/disable_ram_counting.py + - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=msan -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true + - cmake --build cmake-build -- -j + - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py + + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + when: always + paths: + - report-junit.xml + expose_as: "renderer msan pytest results" + reports: + junit: + - report-junit.xml + + +.merge-request-comparison-setup-codec: + &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons + - make clean + - mkdir build + - cd build + - cmake .. + - make -j + - mv IVAS_cod ../IVAS_cod_test + - mv IVAS_dec ../IVAS_dec_test + - mv IVAS_rend .. + - cd .. + - rm -rf build/* + + ### store the current commit hash + - source_branch_commit_sha=$(git rev-parse HEAD) + + ### checkout version to compare against + - *mr-fetch-target-branch + + - *mr-get-target-commit + - git checkout $target_commit + + ### build reference binaries + - cd build + - cmake .. + - make -j + - mv IVAS_cod ../IVAS_cod_ref + - mv IVAS_dec ../IVAS_dec_ref + - cd .. + + # rename test binaries back + - mv IVAS_cod_test IVAS_cod + - mv IVAS_dec_test IVAS_dec + +.merge-request-comparison-check: &merge-request-comparison-check + - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi + - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi + - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi + - exit 0 + +# compare renderer bitexactness between target and source branch +renderer-pytest-on-merge-request: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-make"] + # TODO: set reasonable timeout, will most likely take less + timeout: "20 minutes" + stage: compare + script: + - *print-common-info + + # some helper variables - "|| true" to prevent failures from grep not finding anything + - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[rend\(erer\)*[ -]*non[ -]*be\]") || true + # TODO: needs splitting the test between reference and cut generation + #- ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true + + # store the current commit hash + - source_branch_commit_sha=$(git rev-parse HEAD) + + - *mr-fetch-target-branch + - *mr-get-target-commit + - git checkout $target_commit + + # build reference binaries + - make -j IVAS_rend + - mv IVAS_rend IVAS_rend_ref + + # back to source branch + - git checkout $source_branch_commit_sha + - make clean + - make -j IVAS_rend + + # run test + - exit_code=0 + - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_be_comparison.py || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + + - *merge-request-comparison-check + + allow_failure: + exit_codes: + - 123 + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + when: always + paths: + - report-junit.xml + - report.html + expose_as: "pytest renderer results" + reports: + junit: + - report-junit.xml + +# compare bit exactness between target and source branch +# [INTERNAL] this uses our own testvectors internally! +ivas-pytest-on-merge-request: + extends: + - .test-job-linux + - .rules-merge-request + stage: compare + needs: ["build-codec-linux-cmake", "codec-smoke-test"] + timeout: "10 minutes" + script: + - *print-common-info + - *merge-request-comparison-setup-codec + - *get-ivas-internal-ci-repo + - *overwrite-testv-with-internal-ones + + # some helper variables - "|| true" to prevent failures from grep not finding anything + - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true + - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true + + ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there + - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi + + ### prepare pytest + # create short test vectors + - python3 tests/create_short_testvectors.py + # create references + - python3 -m pytest tests -v --update_ref 1 -m create_ref + - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2 + + ### Run test using branch scripts and input + - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi + + ### run pytest + - exit_code=0 + - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + + - *merge-request-comparison-check + + allow_failure: + exit_codes: + - 123 + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + when: always + paths: + - report-junit.xml + expose_as: "pytest ivas results" + reports: + junit: + - report-junit.xml + +# compare external renderer bitexactness between target and source branch +external-renderer-pytest-on-merge-request: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-make"] + # TODO: set reasonable timeout, will most likely take less + timeout: "20 minutes" + stage: compare + script: + - *print-common-info + + # some helper variables - "|| true" to prevent failures from grep not finding anything + - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[rend\(erer\)*[ -]*non[ -]*be\]") || true + # TODO: needs splitting the test between reference and cut generation + #- ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true + + # store the current commit hash + - source_branch_commit_sha=$(git rev-parse HEAD) + + - *mr-fetch-target-branch + - *mr-get-target-commit + - git checkout $target_commit + + # build reference binaries + - make -j IVAS_rend + - mv IVAS_rend IVAS_rend_ref + + # back to source branch + - git checkout $source_branch_commit_sha + - make clean + - make -j IVAS_rend + + # run test + - exit_code=0 + - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer_be_comparison.py || exit_code=$? + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + + - *merge-request-comparison-check + + allow_failure: + exit_codes: + - 123 + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results" + when: always + paths: + - report-junit.xml + - report.html + expose_as: "pytest external renderer results" + reports: + junit: + - report-junit.xml + +evs-pytest-on-merge-request: + extends: + - .test-job-linux + - .rules-merge-request + stage: compare + needs: ["build-codec-linux-cmake", "codec-smoke-test"] + timeout: "10 minutes" + script: + - *print-common-info + - *merge-request-comparison-setup-codec + - *get-ivas-internal-ci-repo + - *overwrite-testv-with-internal-ones + + # some helper variables - "|| true" to prevent failures from grep not finding anything + - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true + - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true + + ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there + - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi + + ### prepare pytest + # create references + - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm + + ### Run test using branch scripts and input + - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi + + ### run pytest for EVS cases + - exit_code=0 + - python3 -m pytest tests/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --junit-xml=report-junit-evs.xml || exit_code=$? + - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true + + - *merge-request-comparison-check + + allow_failure: + exit_codes: + - 123 + artifacts: + name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + when: always + paths: + - report-junit-evs.xml + expose_as: "pytest evs results" + reports: + junit: + - report-junit-evs.xml + +clang-format-check: + extends: + - .test-job-linux + - .rules-merge-request + variables: + ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix" + stage: validate + needs: [] + timeout: "5 minutes" + script: + # Set up variables. This can't be done in the "variables" section because variables are not expanded properly there + - PATCH_FILE_NAME="$ARTIFACT_BASE_NAME".patch + - > + INSTRUCTIONS_GITLAB="To fix formatting issues:\n + - download the diff patch available as artifact of this job\n + - unzip the artifact and place the patch file in the root directory of your local IVAS repo\n + - run: git apply $PATCH_FILE_NAME\n + - commit new changes" + - > + INSTRUCTIONS_README="To fix formatting issues:\n + - place the patch file in the root directory of your local IVAS repo\n + - run: git apply $PATCH_FILE_NAME\n + - commit new changes" + + - scripts/check-format.sh -af -p 8 || format_problems=$? + - if [ $format_problems == 0 ] ; then exit 0; fi + + - mkdir tmp-formatting-fix + - git diff > "tmp-formatting-fix/$PATCH_FILE_NAME" + + # Print instructions to job output + - echo -e "$INSTRUCTIONS_GITLAB" + + # Include readme in the artifact, in case someone misses the job printout (e.g. getting the artifact via MR interface) + - echo -e "$INSTRUCTIONS_README" > "tmp-formatting-fix/readme.txt" + + - exit $format_problems + artifacts: + paths: + - tmp-formatting-fix/ + when: on_failure + name: "$ARTIFACT_BASE_NAME" + expose_as: 'formatting patch' + + +# --------------------------------------------------------------- +# Test jobs for main branch +# --------------------------------------------------------------- + +# check bitexactness to EVS +# difference to forge: on the forge, this job runs only on pushes to main +# those are mirrored to our repo anyway, so no push-to-main triggers exist in +# our internal repo. Testing BE to EVS is probably only useful before moving a +# feature branch from internal to external repo. Therefore, this job internally +# runs on MR pipelines +be-2-evs-linux: + extends: + - .test-job-linux + # manual rules here to have .rules-main-push + run on MR + rules: + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + # this is different from the forge repo -> allow manual run of the EVS-BE test + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + when: manual + allow_failure: true + tags: + - be-2-evs-temp + stage: test + needs: [ "build-codec-linux-cmake" ] + timeout: "20 minutes" + script: + - *print-common-info + + - mkdir build + - cd build + - cmake .. + - make -j + - cd .. + + # copy over to never change the testvector dir + - cp -r $EVS_BE_TEST_DIR ./evs_be_test + - cp build/IVAS_cod ./evs_be_test/bin/EVS_cod + - cp build/IVAS_dec ./evs_be_test/bin/EVS_dec + + - cd evs_be_test + - python3 ../ci/run_evs_be_test.py + +codec-comparison-on-main-push: + extends: + - .test-job-linux + - .rules-main-push + stage: compare + needs: [ "build-codec-linux-cmake" ] + timeout: "30 minutes" # To be revisited + script: + - *print-common-info + - latest_commit=$(git rev-parse HEAD) # Latest commit + - *get-previous-merge-commit-sha # Stored in previous_merge_commit shell variable now + - echo "Comparing changes from $previous_merge_commit to $latest_commit" + - git --no-pager diff --stat $previous_merge_commit..$latest_commit + + # Rest is more or less placeholder adapted from MR self test. This should be replaced with more complex tests. + + ### build test binaries, initial clean for paranoia reasons + - make clean + - mkdir build + - cd build + - cmake .. + - make -j + - mv IVAS_cod ../IVAS_cod_test + - mv IVAS_dec ../IVAS_dec_test + - cd .. + - rm -rf build/* + + ### compare to the previous merge commit in the main branch + - git fetch origin main + - git checkout $previous_merge_commit + + ### build reference binaries + - cd build + - cmake .. + - make -j + - mv IVAS_cod ../IVAS_cod_ref + - mv IVAS_dec ../IVAS_dec_ref + - cd .. + + ### re-checkout the latest commit in the main branch + - git checkout $latest_commit + + # helper variable - "|| true" to prevent failures from grep not finding anything + - non_be_flag=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[non[ -]*be\]") || true + + ### prepare pytest + # create short test vectors + - python3 tests/create_short_testvectors.py + # rename test binaries back + - mv IVAS_cod_test IVAS_cod + - mv IVAS_dec_test IVAS_dec + # create references + - python3 -m pytest tests -v --update_ref 1 -m create_ref + - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2 + + ### run pytest + - exit_code=0 + - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$? + - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi + - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true + - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi + - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi; + allow_failure: + exit_codes: + - 123 + artifacts: + name: "main-push--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results" + when: always + paths: + - report-junit.xml + expose_as: 'Results of comparison to previous merge commit' + reports: + junit: report-junit.xml + + +# --------------------------------------------------------------- +# Scheduled jobs on main +# --------------------------------------------------------------- +.sanitizer-test-template: + extends: + - .test-job-linux + tags: + - sanitizer_test_main + stage: test + artifacts: + name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA" + when: always + paths: + - ep_015.g192 + - ./LOGS_PLC + - ./LOGS_noPLC + +sanitizer-test-mono: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MONO + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py mono mono --tests $SANITIZER_TESTS + +sanitizer-test-stereo: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_STEREO + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py stereo $OUT_FORMATS_CHANNEL_BASED --tests $SANITIZER_TESTS + +sanitizer-test-stereodmxevs: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_STEREODMXEVS + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py StereoDmxEVS mono --tests $SANITIZER_TESTS + +sanitizer-test-ism1: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_ISM1 + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py ISM1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS + +sanitizer-test-ism2: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_ISM2 + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py ISM2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS + +sanitizer-test-ism3: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_ISM3 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py ISM3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS + +sanitizer-test-ism4: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_ISM4 + timeout: "4 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py ISM4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS + +sanitizer-test-masa: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MASA + timeout: "2 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS + +sanitizer-test-mc-5_1: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MC51 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py 5_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-mc-5_1_2: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MC512 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py 5_1_2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-mc-5_1_4: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MC514 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py 5_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-mc-7_1: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MC71 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py 7_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-mc-7_1_4: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_MC714 + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py 7_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-sba: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_SBA + timeout: "4 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py SBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + +sanitizer-test-planarsba: + extends: .sanitizer-test-template + rules: + - if: $SANITIZER_TEST_PLANARSBA + timeout: "3 hours" + script: + - *get-ivas-internal-ci-repo + - *get-internal-ltv-signals + - ls -altr $LTV_DIR + - ls -altr + - cat scripts/config/ci_linux_ltv.json + - python3 ci/run_scheduled_sanitizer_test.py PlanarSBA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS + + +# GCOV/LCOV coverage analysis of self_test suite +coverage-test-on-main-scheduled: + extends: + - .test-job-linux-needs-internal-testv-dir + - .rules-main-scheduled + tags: + - coverage-test + stage: test + rules: + # only run in scheduled pipeline that passes this env vars + - if: $COVERAGE_TEST + script: + - *print-common-info + - make GCOV=1 -j + - python3 tests/create_short_testvectors.py + - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - python3 -m pytest tests/test_param_file.py -v -n 0 --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - lcov -c -d obj -o coverage.info + - genhtml coverage.info -o coverage + artifacts: + name: "main-coverage-sha-$CI_COMMIT_SHORT_SHA" + when: always + paths: + - coverage.info + - coverage + +# --------------------------------------------------------------- +# FhG internal - mirroring +# --------------------------------------------------------------- + +# Pull state of a branch on 3GPP repo, push to a mirror repo +.mirror-update: + extends: .test-job-linux + tags: + - host::r10499 + script: + # Set up git LFS for mirroring (see: https://github.com/git-lfs/git-lfs/issues/1762) + - git lfs install --skip-smudge --local + + # Select target branch: + # * if mirroring without testing, push to $CI_COMMIT_BRANCH at mirroring-pre-test stage + # * if mirroring with testing, push to: + # * $CI_COMMIT_BRANCH-mirror-untested at mirroring-pre-test stage + # * $CI_COMMIT_BRANCH at mirroring-post-test stage + - MIRROR_TARGET_BRANCH=$CI_COMMIT_BRANCH + - if [[ $MIRROR_TESTING == 'true' && $CI_JOB_STAGE == 'mirroring-pre-test' ]]; then MIRROR_TARGET_BRANCH="${CI_COMMIT_BRANCH}-mirror-untested"; fi + + # Check out or create mirror target branch - by default the runner checks out by commit hash, which results in detached head state + - git checkout -B $MIRROR_TARGET_BRANCH + + # Pull commits from upstream + - git pull --ff-only $UPSTREAM_URL $MIRROR_SOURCE_BRANCH + - git lfs fetch --all $UPSTREAM_URL $MIRROR_SOURCE_BRANCH + + # Push to mirror. Option `-o ci.skip` tells GitLab to skip CI for the pushed commits (testing already done in current pipeline if enabled) + - git push -o ci.skip "https://${GITLAB_USER_LOGIN}:${MIRROR_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${MIRROR_TARGET_BRANCH}" + +mirror-update-untested: + rules: + - if: $MIRROR_ACCESS_TOKEN + extends: + - .mirror-update + stage: mirroring-pre-test + +mirror-update-tested: + rules: + - if: $MIRROR_ACCESS_TOKEN && $MIRROR_TESTING == 'true' + extends: + - .mirror-update + stage: mirroring-post-test + + +# --------------------------------------------------------------- +# FhG internal - tests +# --------------------------------------------------------------- + +build-codec-debug-windows-vs2017: + extends: + - .rules-basis + tags: + - os::windows + stage: build + script: + - $ENV:PATH + - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee $BUILD_OUTPUT + - python ci/check_for_warnings.py $BUILD_OUTPUT + +build-codec-release-windows-vs2017: + extends: + - .rules-basis + tags: + - os::windows + stage: build + script: + - $ENV:PATH + - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee $BUILD_OUTPUT + - python ci/check_for_warnings.py $BUILD_OUTPUT -- GitLab From 426deb6a6d2599cd385df3e88559dcb9170b632c Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 15 Jun 2023 14:11:08 +0200 Subject: [PATCH 0199/1418] Allow less importnat CI jobs to fail (for now) --- .gitlab-ci-custom.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index bef4bdb69e..84aa4f65ba 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -217,6 +217,7 @@ build-codec-instrumented-linux: script: - *print-common-info - bash ci/build_codec_instrumented_linux.sh + allow_failure: true # TODO(sgi): Remove # make sure that the codec builds with msan, asan and usan build-codec-sanitizers-linux: @@ -254,6 +255,7 @@ codec-smoke-test: - smoke_test_output.txt - smoke_test_output_plc.txt expose_as: 'Smoke test results' + allow_failure: true # TODO(sgi): Remove # code selftest testvectors with memory-sanitizer binaries @@ -656,6 +658,7 @@ clang-format-check: when: on_failure name: "$ARTIFACT_BASE_NAME" expose_as: 'formatting patch' + allow_failure: true # TODO(sgi): Remove # --------------------------------------------------------------- -- GitLab From 94397413be32f288f0dc137bfc88c759d18d1014 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 15 Jun 2023 15:21:41 +0300 Subject: [PATCH 0200/1418] Remove todo-comments as the related values are in use. --- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e418af9d52..e4b70bf588 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -53,8 +53,8 @@ *------------------------------------------------------------------------*/ #define CLDFB_HALF_BIN_FREQUENCY_OFFSET 0.5f -#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) // ToDo: not used -#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) // ToDo: not used +#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN ( 2.0f ) +#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f ) #ifdef MASA_AND_OBJECTS #define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f ) -- GitLab From f104d3bbe0976522dd25f4d1232248ec8f3a1f2d Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 14:30:43 +0200 Subject: [PATCH 0201/1418] fix asan, put out at least zeroes for ParamUpmix in the JBM path --- lib_com/options.h | 1 + lib_dec/ivas_jbm_dec.c | 8 +++++++- lib_dec/ivas_sba_rendering_internal.c | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9caeda123a..6e3e1010c2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,6 +157,7 @@ #define FIX_XXX_JITTER_SBA_BINAURAL_GAIN #define FIX_XXX_HEADTRACKER_INIT #define FIX_XXX_TDOBJRENDERER_INPUT +#define FIX_XXX_ISM_SBA_ASAN #define API_5MS /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 8e6b0541db..310e787511 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -846,7 +846,13 @@ ivas_error ivas_jbm_dec_render( #ifdef API_5MS else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - return IVAS_ERR_NOT_IMPLEMENTED; + /* zero output for now, not yet implemented... */ + int16_t ch; + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + for ( ch = 0; ch < nchan_out; ch++ ) + { + set_zero( p_output[ch], *nSamplesRendered ); + } } #endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 6f3dd13b7a..8e92a1f622 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -365,15 +365,22 @@ void ivas_ism2sba_sf( for ( j = 0; j < sba_num_chans; j++ ) { g2 = hIsmRendererData->interpolator + offset; +#ifndef FIX_XXX_ISM_SBA_ASAN g1 = 1 - *g2; +#endif tc = buffer_in[i] + offset; out = buffer_out[j]; gain = hIsmRendererData->gains[i][j]; prev_gain = hIsmRendererData->prev_gains[i][j]; for ( k = 0; k < n_samples_to_render; k++ ) { +#ifdef FIX_XXX_ISM_SBA_ASAN + g1 = 1.0f - *g2; +#endif *( out++ ) += ( ( *( g2++ ) ) * gain + g1 * prev_gain ) * ( *( tc++ ) ); +#ifndef FIX_XXX_ISM_SBA_ASAN g1 = 1.0f - *g2; +#endif } } } -- GitLab From d4c03c2e3af4ef2360acd80400b16df8b161476c Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 15:08:55 +0200 Subject: [PATCH 0202/1418] make sure 7.1.4 br does not crash any longer, still ParamUpmix needs to be fully implemented in the JBM path --- apps/decoder.c | 7 ++++++- lib_dec/ivas_jbm_dec.c | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index d8229ce705..a8093c7a71 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -86,6 +86,7 @@ static #define JBM_FRONTEND_FETCH_FRAMESIZE_MS 20 #ifdef API_5MS #define HEADROTATION_FETCH_FRAMESIZE_MS 5 +#define DEFAULT_FETCH_FRAMESIZE_MS 20 #endif typedef struct @@ -1734,7 +1735,7 @@ static ivas_error decodeG192( } else { - nOutSamples = (int16_t) ( arg.output_Fs / 1000 * VARIABLE_SPEED_FETCH_FRAMESIZE_MS ); + nOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS ); vec_pos_len = 1; } /*------------------------------------------------------------------------------------------* @@ -2201,7 +2202,11 @@ cleanup: AudioFileWriter_close( &afWriter ); MasaFileWriter_close( &masaWriter ); +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING TsmScaleFileReader_close( &tsmScaleFileReader ); +#endif +#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) { IsmFileWriter_close( &ismWriters[i] ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 310e787511..c7d9996aab 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -477,6 +477,21 @@ ivas_error ivas_jbm_dec_tc( ivas_mono_stereo_downmix_mcmasa( st_ivas, output, output_frame ); } } +#ifdef API_5MS + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + + /* at least decode everything here, the rest is ToDo, for this we just output zeroes atm */ + ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); + + ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); + + if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } -- GitLab From 743072535e49363b36758ba473fb6ce216e94d5d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 15 Jun 2023 18:44:24 +0530 Subject: [PATCH 0203/1418] Address review comments --- lib_dec/ivas_sba_dec.c | 14 -------------- lib_dec/ivas_spar_md_dec.c | 27 ++++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index d4d55504cc..1a0e6b7166 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -113,7 +113,6 @@ ivas_error ivas_sba_dec_reconfigure( #ifdef VLBR_20MS_MD int16_t num_channels, num_md_sub_frames; - int16_t i, j, k; #endif RENDERER_TYPE old_renderer_type; @@ -198,19 +197,6 @@ ivas_error ivas_sba_dec_reconfigure( { return error; } - for ( i = 0; i < num_channels; i++ ) - { - for ( j = 0; j < num_channels; j++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - st_ivas->hSpar->hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0; - st_ivas->hSpar->hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0; - } - } - } } #endif 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 ); diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 9e381f6900..a3d3f8f66c 100755 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -107,7 +107,9 @@ static ivas_error ivas_spar_md_dec_matrix_open const int16_t num_md_sub_frames ) { int16_t i, j; - +#ifdef VLBR_20MS_MD + int16_t k; +#endif if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * num_md_sub_frames * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); @@ -244,7 +246,22 @@ static ivas_error ivas_spar_md_dec_matrix_open } } } +#ifdef VLBR_20MS_MD + for ( i = 0; i < num_channels; i++ ) + { + for ( j = 0; j < num_channels; j++ ) + { + for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) + { + hMdDec->spar_coeffs_prev.C_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_prev.P_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_tar.C_re[i][j][k] = 0.0f; + hMdDec->spar_coeffs_tar.P_re[i][j][k] = 0.0f; + } + } + } +#endif return IVAS_ERR_OK; } @@ -492,7 +509,11 @@ ivas_error ivas_spar_md_dec_init( const int16_t sba_order /* i : SBA order */ ) { +#ifdef VLBR_20MS_MD + int16_t i, j; +#else int16_t i, j, k; +#endif int16_t nchan_transport; float pFC[IVAS_MAX_NUM_BANDS], PR_minmax[2]; @@ -534,7 +555,7 @@ ivas_error ivas_spar_md_dec_init( set_s( hMdDec->base_band_age, 0, IVAS_MAX_NUM_BANDS ); hMdDec->spar_plc_num_lost_frames = 0; hMdDec->spar_plc_enable_fadeout_flag = 1; - +#ifndef VLBR_20MS_MD for ( i = 0; i < num_channels; i++ ) { for ( j = 0; j < num_channels; j++ ) @@ -578,7 +599,7 @@ ivas_error ivas_spar_md_dec_init( } } } - +#endif hMdDec->dtx_md_smoothing_cntr = 1; ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS ); -- GitLab From de03fd1e6595cc31021a4988dc827a9210142ffe Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 15:41:27 +0200 Subject: [PATCH 0204/1418] fix external orientation update rate --- apps/decoder.c | 34 +++++++++++++++++----------------- lib_rend/ivas_rotation.c | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index a8093c7a71..34527b8c82 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1783,45 +1783,45 @@ static ivas_error decodeG192( } } - if ( arg.enableExternalOrientation ) + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) { IVAS_QUATERNION Quaternion; - int8_t enableHeadRotation; - int8_t enableExternalOrientation; - int8_t enableRotationInterpolation; - int16_t numFramesToTargetOrientation; - - if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( externalOrientationFileReader ) ); + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); goto cleanup; } - if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } - /* Head-tracking input simulation */ - if ( arg.enableHeadRotation ) + if ( arg.enableExternalOrientation ) { IVAS_QUATERNION Quaternion; + int8_t enableHeadRotation; + int8_t enableExternalOrientation; + int8_t enableRotationInterpolation; + int16_t numFramesToTargetOrientation; - if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); + fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( externalOrientationFileReader ) ); goto cleanup; } - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 0997626bbb..efd281ce84 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -1434,7 +1434,7 @@ void external_target_interpolation( /* Calculate the interpolation increment and coefficient */ #ifdef API_5MS - hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); + hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation ); #else hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); #endif -- GitLab From b61cb8986ce97d473c30c3ce8eb1bca94ffcf33a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 15 Jun 2023 16:12:09 +0200 Subject: [PATCH 0205/1418] disable unused code --- lib_com/ivas_prot.h | 2 ++ lib_dec/ivas_dec.c | 2 ++ lib_dec/jbm_jb4sb.h | 4 ++-- lib_dec/jbm_pcmdsp_fifo.c | 2 ++ lib_dec/jbm_pcmdsp_fifo.h | 4 ++-- lib_dec/lib_dec.c | 7 +++++-- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 7d3042d861..0a56c5081e 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -308,10 +308,12 @@ void stereo_dmx_evs_close_encoder( STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ); +#ifndef API_5MS ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ ); +#endif ivas_error ivas_dec_setup( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index fd0bf5b530..3287ebbb47 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -32,6 +32,7 @@ #include #include "options.h" +#ifndef API_5MS #include "cnst.h" #include "ivas_cnst.h" #include "rom_com.h" @@ -755,3 +756,4 @@ ivas_error ivas_dec( pop_wmops(); return error; } +#endif \ No newline at end of file diff --git a/lib_dec/jbm_jb4sb.h b/lib_dec/jbm_jb4sb.h index 00f5ccbb40..599730975d 100644 --- a/lib_dec/jbm_jb4sb.h +++ b/lib_dec/jbm_jb4sb.h @@ -77,13 +77,13 @@ struct JB4_DATAUNIT int16_t partialCopyOffset; int16_t nextCoderType; }; - +#ifndef API_5MS typedef enum { JBM_RENDERER_NONE, JBM_RENDERER_IVAS, } JBM_RENDERER_TYPE; - +#endif typedef struct JB4_DATAUNIT *JB4_DATAUNIT_HANDLE; diff --git a/lib_dec/jbm_pcmdsp_fifo.c b/lib_dec/jbm_pcmdsp_fifo.c index a3e8936464..d3c93679fe 100644 --- a/lib_dec/jbm_pcmdsp_fifo.c +++ b/lib_dec/jbm_pcmdsp_fifo.c @@ -38,6 +38,7 @@ #include #include "options.h" +#ifndef API_5MS #include "prot.h" #include "ivas_prot.h" #ifdef DEBUGGING @@ -267,3 +268,4 @@ uint16_t pcmdsp_fifo_nReadableSamplesPerChannel( { return h->size; } +#endif \ No newline at end of file diff --git a/lib_dec/jbm_pcmdsp_fifo.h b/lib_dec/jbm_pcmdsp_fifo.h index b601cc2e0e..62ebc15d08 100644 --- a/lib_dec/jbm_pcmdsp_fifo.h +++ b/lib_dec/jbm_pcmdsp_fifo.h @@ -41,7 +41,7 @@ #include #include "options.h" - +#ifndef API_5MS /** Ringbuffer (FIFO) with fixed capacity for audio samples. */ struct PCMDSP_FIFO @@ -81,5 +81,5 @@ int16_t pcmdsp_fifo_write_zero( PCMDSP_FIFO_HANDLE h, uint16_t nSamplesPerChanne int16_t pcmdsp_fifo_read( PCMDSP_FIFO_HANDLE h, uint16_t nSamplesPerChannel, uint8_t *samples ); uint16_t pcmdsp_fifo_nReadableSamplesPerChannel( const PCMDSP_FIFO_HANDLE h ); - +#endif #endif /* JBM_PCMDSP_FIFO_H */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 86d46fe2b0..0def4c244d 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -123,7 +123,9 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas ); +#ifndef API_5MS static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec ); +#endif static ivas_error IVAS_DEC_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, int16_t *data ); static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples ); @@ -1985,7 +1987,7 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( return IVAS_ERR_OK; } -#ifdef VARIABLE_SPEED_DECODING +#if defined( VARIABLE_SPEED_DECODING ) || defined( API_5MS ) /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_SetScale( ) * @@ -3480,6 +3482,7 @@ static int16_t IVAS_DEC_VoIP_GetRenderGranularity( } +#ifndef API_5MS /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetRendererConfig() * @@ -3503,7 +3506,7 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( return rendererType; } - +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_reconfigure() -- GitLab From 7fb10d40a051ab031a939821cb5bfdbd1dfddb40 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 15 Jun 2023 17:49:42 +0200 Subject: [PATCH 0206/1418] Remove RENDERER_HEAD_POSITIONS_PER_FRAME - code compiles, but untested --- apps/renderer.c | 170 +++++++++++++++++++++++++++++------ lib_com/common_api_types.h | 2 + lib_com/options.h | 1 + lib_rend/ivas_prot_rend.h | 4 + lib_rend/ivas_rotation.c | 69 +++++++++++++++ lib_rend/ivas_stat_rend.h | 7 ++ lib_rend/lib_rend.c | 175 ++++++++++++++++++++++++++++++++++++- lib_rend/lib_rend.h | 21 ++++- 8 files changed, 418 insertions(+), 31 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 760065be91..9be54daca5 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -157,6 +157,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef LIB_REND_API_5MS + bool framing_5ms; +#endif } CmdlnArgs; typedef enum @@ -181,6 +184,9 @@ typedef enum CmdLnOptionId_inputGain, CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef LIB_REND_API_5MS + CmdLnOptionId_framing5ms, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -302,6 +308,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, +#ifdef LIB_REND_API_5MS + { + .id = CmdLnOptionId_framing5ms, + .match = "framing_5ms", + .matchShort = "fr5", + .description = "Process audio with 5 ms framing. Time resolution of metadata (e.g. ISM positions) remains unchanged w.r.t. 20 ms framing", + }, +#endif }; @@ -560,7 +574,9 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; +#ifndef LIB_REND_API_5MS IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif #ifdef WMOPS reset_wmops(); @@ -733,7 +749,13 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); + const int16_t frameSize_smpls = (int16_t) ( +#ifdef LIB_REND_API_5MS + ( args.framing_5ms ? 5 : 20 ) +#else + 20 +#endif + * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; @@ -1019,10 +1041,17 @@ int main( fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); } +#ifdef LIB_REND_API_5MS + ObjectPositionBuffer mtdBuffer; +#endif + while ( 1 ) { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; +#ifdef LIB_REND_API_5MS + const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; +#endif /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -1040,50 +1069,85 @@ int main( /* Convert from int to float and from interleaved to packed */ convertInputBuffer( inpInt16Buffer, numSamplesRead, frameSize_smpls, num_in_channels, inFloatBuffer ); - +#ifdef LIB_REND_API_5MS + if ( isCurrentFrameMultipleOf20ms ) + { +#else ObjectPositionBuffer mtdBuffer; - IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); +#endif + IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); - if ( referenceVectorReader != NULL ) - { - IVAS_VECTOR3 listenerPos, refPos; - if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPos, &refPos ) ) != IVAS_ERR_OK ) + if ( referenceVectorReader != NULL ) { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); + 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 ); + } } - if ( ( error = IVAS_REND_SetReferenceVector( hIvasRend, listenerPos, refPos ) ) != IVAS_ERR_OK ) + /* Read from reference rotation trajectory file if specified */ + if ( referenceRotReader != NULL ) { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + 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 ); + } } +#ifdef LIB_REND_API_5MS } - /* Read from reference rotation trajectory file if specified */ - if ( referenceRotReader != NULL ) +#endif + + /* Read from head rotation trajectory file if specified */ + if ( headRotReader != NULL ) { - IVAS_QUATERNION quaternion; - if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION headRot; + IVAS_VECTOR3 Pos; + + if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) { 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 ) + if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, headRot, Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "Error setting Reference Rotation: %s\n", ivas_error_to_string( error ) ); + fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - } - /* Read from head rotation trajectory file if specified */ - if ( headRotReader != NULL ) - { - IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; - - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + if ( !args.framing_5ms ) { - if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) + /* Skip over 3 following head positions - they are given on 5ms grid */ + for ( int16_t i = 0; i < 3; ++i ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } +#else + IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; + + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { + if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } @@ -1093,20 +1157,61 @@ int main( fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } else { +#ifdef LIB_REND_API_5MS + if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } +#else error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } /* Read from external orientation file if specified */ if ( externalOrientationFileReader != NULL ) { +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION quat; + int8_t enableHeadRotation; + int8_t enableExternalOrientation; + int8_t enableRotationInterpolation; + int16_t numFramesToTargetOrientation; + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quat, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( !args.framing_5ms ) + { + /* Skip over 3 following entries in file - they are given on 5ms grid */ + for ( int16_t i = 0; i < 3; ++i ) + { + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } +#else IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableHeadRotation[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableExternalOrientation[RENDERER_HEAD_POSITIONS_PER_FRAME]; @@ -1127,6 +1232,7 @@ int main( fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } /* Combine external orientations and head rotation */ @@ -1281,6 +1387,7 @@ int main( delayNumSamples -= (int16_t) outBufferSize; } + /* TODO(sgi): Masa output most likely broken with 5ms framing */ /* Write MASA metadata for MASA outputs */ if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) { @@ -1900,6 +2007,9 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); +#ifdef LIB_REND_API_5MS + args.framing_5ms = false; +#endif return args; } @@ -2029,6 +2139,12 @@ static void parseOption( exit( -1 ); } break; +#ifdef LIB_REND_API_5MS + case CmdLnOptionId_framing5ms: + assert( numOptionValues == 0 ); + args->framing_5ms = false; + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 2dc926dfc2..49c6f395fd 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -50,7 +50,9 @@ #define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #define IVAS_MAX_INPUT_LFE_CHANNELS 4 +#ifndef LIB_REND_API_5MS #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 +#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index bee9901a56..4a88b47d83 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,6 +157,7 @@ #define FIX_XXX_JITTER_SBA_BINAURAL_GAIN #define FIX_XXX_HEADTRACKER_INIT #define API_5MS +#define LIB_REND_API_5MS /* FhG: Adds 5ms framing capability to lib_rend */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 29a5ace8f4..8d987a3f3c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -857,7 +857,11 @@ ivas_error combine_external_and_head_orientations_rend( ); ivas_error combine_external_and_head_orientations( +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ +#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ +#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 184f382ee8..468d28b026 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -902,7 +902,11 @@ ivas_error combine_external_and_head_orientations_dec( #endif } #ifdef API_5MS +#ifdef LIB_REND_API_5MS return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#endif #else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); #endif @@ -932,8 +936,13 @@ ivas_error combine_external_and_head_orientations_rend( { if ( hHeadTrackData->headRotEnabled ) { +#ifdef LIB_REND_API_5MS + headRotQuaternions = &hHeadTrackData->headPosition; + listenerPos = &hHeadTrackData->Pos; +#else headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; +#endif } } else if ( hExtOrientationData != NULL ) @@ -971,7 +980,11 @@ ivas_error combine_external_and_head_orientations_rend( *------------------------------------------------------------------------*/ ivas_error combine_external_and_head_orientations( +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ +#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ +#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ @@ -994,7 +1007,11 @@ ivas_error combine_external_and_head_orientations( /* Form combined orientations or return if no data available */ if ( hCombinedOrientationData == NULL ) { +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) +#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1003,7 +1020,11 @@ ivas_error combine_external_and_head_orientations( return IVAS_ERR_OK; } } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion == NULL && hExtOrientationData == NULL ) +#else else if ( headRotQuaternions == NULL && hExtOrientationData == NULL ) +#endif { /* Reset the combined orientations and rotations */ hCombinedOrientationData->isInterpolationOngoing = FALSE; @@ -1037,11 +1058,19 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( hExtOrientationData == NULL && headRotQuaternion != NULL ) +#else else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) +#endif { /* Head rotation only */ #ifdef API_5MS +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion = *headRotQuaternions; +#endif #else if ( numHeadRotQuaternions >= 0 ) @@ -1130,7 +1159,11 @@ ivas_error combine_external_and_head_orientations( #endif } +#ifdef LIB_REND_API_5MS + if ( hExtOrientationData != NULL && headRotQuaternion != NULL ) +#else if ( hExtOrientationData != NULL && headRotQuaternions != NULL ) +#endif { /* Combine head and external orientations */ #ifdef API_5MS @@ -1140,11 +1173,19 @@ ivas_error combine_external_and_head_orientations( { if ( hExtOrientationData->enableExternalOrientation > 0 ) { +#ifdef LIB_REND_API_5MS + QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternion, &hCombinedOrientationData->Quaternion ); +#else QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternions, &hCombinedOrientationData->Quaternion ); +#endif } else { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion = *headRotQuaternions; +#endif } } /* Use the freezed head rotation */ @@ -1203,7 +1244,11 @@ ivas_error combine_external_and_head_orientations( #endif } +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) +#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) +#endif { /* Calculate the combined rotation matrix */ #ifdef API_5MS @@ -1243,14 +1288,22 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL ) +#else if ( headRotQuaternions != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData != NULL ) { if ( hExtOrientationData->enableHeadRotation > 0 ) { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; +#endif } else { @@ -1259,7 +1312,11 @@ ivas_error combine_external_and_head_orientations( } else { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; +#endif } hCombinedOrientationData->listenerPos = *listenerPos; @@ -1294,7 +1351,11 @@ ivas_error combine_external_and_head_orientations( } /* Check if combined orientation is enabled */ +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL && hExtOrientationData == NULL ) +#else if ( headRotQuaternions != NULL && hExtOrientationData == NULL ) +#endif { #ifdef API_5MS hCombinedOrientationData->enableCombinedOrientation = 1; @@ -1313,7 +1374,11 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion == NULL && hExtOrientationData != NULL ) +#else else if ( headRotQuaternions == NULL && hExtOrientationData != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 ) @@ -1338,7 +1403,11 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion != NULL && hExtOrientationData != NULL ) +#else else if ( headRotQuaternions != NULL && hExtOrientationData != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 || hExtOrientationData->enableHeadRotation > 0 ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 14de5e7d55..7306c45e99 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -248,9 +248,16 @@ typedef struct ivas_orient_trk_state_t typedef struct { int8_t headRotEnabled; +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION headPosition; + IVAS_VECTOR3 Pos; + float crossfade_5ms[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; + float crossfade_20ms[L_FRAME48k]; +#else IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif ivas_orient_trk_state_t *hOrientationTracker; } IVAS_REND_HeadRotData; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 89b51e7745..6f6b32de1b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -930,6 +930,25 @@ static ivas_error initHeadRotation( /* Head rotation is enabled by default */ hIvasRend->headRotData.headRotEnabled = 1; +#ifdef LIB_REND_API_5MS + /* Initialize 5ms crossfade */ + crossfade_len = L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ + tmp = 1.f / ( crossfade_len - 1 ); + for ( i = 0; i < crossfade_len; i++ ) + { + hIvasRend->headRotData.crossfade_5ms[i] = i * tmp; + } + /* Initialize 20ms crossfade */ + crossfade_len = L_FRAME48k; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ + tmp = 1.f / ( crossfade_len - 1 ); + for ( i = 0; i < crossfade_len; i++ ) + { + hIvasRend->headRotData.crossfade_20ms[i] = i * tmp; + } + + /* Initialize with unit quaternion */ + hIvasRend->headRotData.headPosition = quaternionInit(); +#else /* Initialize 5ms crossfade */ crossfade_len = L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME; tmp = 1.f / ( crossfade_len - 1 ); @@ -943,6 +962,7 @@ static ivas_error initHeadRotation( { hIvasRend->headRotData.headPositions[i] = quaternionInit(); } +#endif if ( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { @@ -4063,12 +4083,19 @@ 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 LIB_REND_API_5MS + const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ + const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#endif ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif IVAS_QUATERNION rotQuat; /* Validate function arguments */ @@ -4083,6 +4110,20 @@ ivas_error IVAS_REND_SetHeadRotation( return IVAS_ERR_INVALID_OUTPUT_FORMAT; } +#ifdef LIB_REND_API_5MS + /* check for Euler angle signaling */ + if ( headRot.w == -3.0f ) + { + Euler2Quat( deg2rad( headRot.x ), deg2rad( headRot.y ), deg2rad( headRot.z ), &rotQuat ); + } + else + { + rotQuat = headRot; + } + + ivas_orient_trk_Process( hIvasRend->headRotData.hOrientationTracker, rotQuat, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hIvasRend->headRotData.headPosition ); + hIvasRend->headRotData.Pos = Pos; +#else if ( headRot == NULL ) { hIvasRend->headRotData.headRotEnabled = 0; @@ -4106,10 +4147,27 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->headRotData.Pos[i] = Pos[i]; } } +#endif return IVAS_ERR_OK; } +#ifdef LIB_REND_API_5MS +ivas_error IVAS_REND_DisableHeadRotation( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ +) +{ + /* Validate function arguments */ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + hIvasRend->headRotData.headRotEnabled = 0; + return IVAS_ERR_OK; +} +#endif + /*-------------------------------------------------------------------* * IVAS_REND_SetOrientationTrackingMode() @@ -4237,15 +4295,24 @@ ivas_error IVAS_REND_SetReferenceVector( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetExternalOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *orientation, /* i : external orientation data */ +#ifdef LIB_REND_API_5MS + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ /* TODO(sgi): make independent of framing */ +#else int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif /* Validate function arguments */ if ( hIvasRend == NULL || hIvasRend->hExternalOrientationData == NULL ) @@ -4266,6 +4333,14 @@ ivas_error IVAS_REND_SetExternalOrientation( } else { +#ifdef LIB_REND_API_5MS + QuaternionInverse( *orientation, &hIvasRend->hExternalOrientationData->Quaternion ); + + hIvasRend->hExternalOrientationData->enableHeadRotation = enableHeadRotation; + hIvasRend->hExternalOrientationData->enableExternalOrientation = enableExternalOrientation; + hIvasRend->hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation; + hIvasRend->hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4285,6 +4360,7 @@ ivas_error IVAS_REND_SetExternalOrientation( hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; #endif } +#endif } return IVAS_ERR_OK; @@ -4321,7 +4397,9 @@ ivas_error IVAS_REND_GetCombinedOrientation( IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif if ( hIvasRend == NULL || pOrientation == NULL ) { @@ -4330,6 +4408,9 @@ ivas_error IVAS_REND_GetCombinedOrientation( if ( hIvasRend->hCombinedOrientationData != NULL ) { +#ifdef LIB_REND_API_5MS + *pOrientation = hIvasRend->hCombinedOrientationData->Quaternion; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4339,6 +4420,7 @@ ivas_error IVAS_REND_GetCombinedOrientation( pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternions[i]; #endif } +#endif } return IVAS_ERR_OK; @@ -4447,7 +4529,11 @@ static ivas_error rotateFrameMc( { int16_t i; int16_t j; +#ifdef LIB_REND_API_5MS + const float *crossfade; +#else int16_t subframe_idx, subframe_len; +#endif int16_t azimuth, elevation; int16_t is_planar_setup, lfe_idx; int16_t nchan; @@ -4462,6 +4548,21 @@ static ivas_error rotateFrameMc( push_wmops( "rotateFrameMc" ); +#ifdef LIB_REND_API_5MS + if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) + { + crossfade = headRotData->crossfade_20ms; + } + else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) + { + crossfade = headRotData->crossfade_5ms; + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); + } +#endif + if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK ) @@ -4486,10 +4587,13 @@ static ivas_error rotateFrameMc( gains[ch_in][ch_in] = 1.f; } +#ifndef LIB_REND_API_5MS + /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { +#endif for ( i = 0; i < 3; i++ ) { if ( hCombinedOrientationData != NULL ) @@ -4551,6 +4655,18 @@ static ivas_error rotateFrameMc( { for ( ch_in = 0; ch_in < nchan; ch_in++ ) { +#ifdef LIB_REND_API_5MS + writePtr = getSmplPtr( outAudio, ch_out, 0 ); + readPtr = getSmplPtr( inAudio, ch_in, 0 ); + /* crossfade with previous rotation gains */ + for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) + { + *writePtr++ += + ( *readPtr ) * ( ( 1 - crossfade[i] ) * gains_prev[ch_in][ch_out] ) + + ( *readPtr ) * ( crossfade[i] * gains[ch_in][ch_out] ); + readPtr++; + } +#else writePtr = getSmplPtr( outAudio, ch_out, subframe_idx * subframe_len ); readPtr = getSmplPtr( inAudio, ch_in, subframe_idx * subframe_len ); /* crossfade with previous rotation gains */ @@ -4561,6 +4677,7 @@ static ivas_error rotateFrameMc( ( *readPtr ) * ( headRotData->crossfade[i] * gains[ch_in][ch_out] ); readPtr++; } +#endif } } @@ -4569,7 +4686,9 @@ static ivas_error rotateFrameMc( { mvr2r( gains[i], gains_prev[i], nchan ); } +#ifndef LIB_REND_API_5MS } +#endif pop_wmops(); @@ -4588,7 +4707,11 @@ static ivas_error rotateFrameSba( int16_t i, l, n, m; int16_t m1, m2; int16_t shd_rot_max_order; +#ifdef LIB_REND_API_5MS + const float *crossfade; +#else int16_t subframe_idx, subframe_len; +#endif float *readPtr, *writePtr; rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; @@ -4597,15 +4720,33 @@ static ivas_error rotateFrameSba( push_wmops( "rotateFrameSba" ); +#ifdef LIB_REND_API_5MS + if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) + { + crossfade = headRotData->crossfade_20ms; + } + else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) + { + crossfade = headRotData->crossfade_5ms; + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); + } +#endif + if ( ( error = getAmbisonicsOrder( inConfig, &shd_rot_max_order ) ) != IVAS_ERR_OK ) { return error; } +#ifndef LIB_REND_API_5MS + /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { +#endif /* initialize rotation matrices with zeros */ for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) { @@ -4637,7 +4778,11 @@ static ivas_error rotateFrameSba( /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( gains, Rmat, shd_rot_max_order ); +#ifdef LIB_REND_API_5MS + for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) +#else for ( i = 0; i < subframe_len; i++ ) +#endif { /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ /* apply each angular-momentum block individually to save complexity. */ @@ -4654,16 +4799,27 @@ static ivas_error rotateFrameSba( for ( m = m1; m < m2; m++ ) { +#ifdef LIB_REND_API_5MS + readPtr = getSmplPtr( inAudio, m, i ); + /* crossfade with previous rotation gains */ + tmpRot[n - m1] += crossfade[i] * gains[n][m] * ( *readPtr ) + + ( 1 - crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#else readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); /* crossfade with previous rotation gains */ tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#endif } } /* write back the result */ for ( n = m1; n < m2; n++ ) { +#ifdef LIB_REND_API_5MS + writePtr = getSmplPtr( outAudio, n, i ); +#else writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i ); +#endif ( *writePtr ) = tmpRot[n - m1]; } m1 = m2; @@ -4691,7 +4847,9 @@ static ivas_error rotateFrameSba( { mvr2r( gains[i], gains_prev[i], HEADROT_SHMAT_DIM ); } +#ifndef LIB_REND_API_5MS } +#endif pop_wmops(); @@ -4734,7 +4892,9 @@ static ivas_error renderIsmToBinauralRoom( { int16_t i; int16_t azi_rot, ele_rot; +#ifndef LIB_REND_API_5MS int16_t subframe_idx, subframe_len; +#endif int16_t tmp; rotation_matrix Rmat; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4783,10 +4943,12 @@ static ivas_error renderIsmToBinauralRoom( if ( combinedOrientationEnabled ) { +#ifndef LIB_REND_API_5MS subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; // for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) for ( subframe_idx = 0; subframe_idx < 1; subframe_idx++ ) { +#endif for ( i = 0; i < 3; i++ ) { #ifdef API_5MS @@ -4814,8 +4976,10 @@ static ivas_error renderIsmToBinauralRoom( Rmat[i][i] = 1.0f; } } +#ifndef LIB_REND_API_5MS } (void) subframe_len; // avoid warning +#endif } /* TODO tmu : see issue #518 */ @@ -6300,6 +6464,10 @@ static ivas_error renderActiveInputsMasa( if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && pCurrentInput->decDummy->hHeadTrackData != NULL ) { +#ifdef LIB_REND_API_5MS + pCurrentInput->decDummy->hHeadTrackData->Quaternion = hIvasRend->headRotData.headPosition; + pCurrentInput->decDummy->hHeadTrackData->Pos = hIvasRend->headRotData.Pos; +#else for ( sf_idx = 0; sf_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; ++sf_idx ) { #ifdef API_5MS @@ -6311,6 +6479,7 @@ static ivas_error renderActiveInputsMasa( pCurrentInput->decDummy->hHeadTrackData->Pos[sf_idx] = hIvasRend->headRotData.Pos[sf_idx]; #endif } +#endif } if ( ( error = renderInputMasa( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index d8d6127b20..701e0d5062 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -247,9 +247,21 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef LIB_REND_API_5MS + const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ + const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#endif +); + +#ifdef LIB_REND_API_5MS +/* Head rotation becomes enabled by calling IVAS_REND_SetHeadRotation. Use this to disable. */ +ivas_error IVAS_REND_DisableHeadRotation( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ ); +#endif ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ @@ -280,10 +292,17 @@ ivas_error IVAS_REND_SetReferenceVector( ivas_error IVAS_REND_SetExternalOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *orientation, /* i : external orientation data */ +#ifdef LIB_REND_API_5MS + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ); ivas_error IVAS_REND_CombineHeadAndExternalOrientation( @@ -292,7 +311,7 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( ivas_error IVAS_REND_GetCombinedOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed orientation */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ); ivas_error IVAS_REND_GetMasaMetadata( -- GitLab From 8e498c6fa40a3026d045487608c62b1971c4d3f9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 15 Jun 2023 18:50:43 +0200 Subject: [PATCH 0207/1418] clang-format --- lib_dec/ivas_masa_dec.c | 80 +++++++-------- lib_dec/ivas_stat_dec.h | 2 +- lib_enc/ivas_ism_metadata_enc.c | 22 ++--- lib_enc/ivas_omasa_enc.c | 2 +- lib_rend/lib_rend.c | 166 ++++++++++++++++---------------- 5 files changed, 136 insertions(+), 136 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index bec64941b9..8499f4504a 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -605,10 +605,10 @@ ivas_error ivas_masa_decode( /*-------------------------------------------------------------------* - * ivas_masa_dec_open() - * - * - *-------------------------------------------------------------------*/ + * ivas_masa_dec_open() + * + * + *-------------------------------------------------------------------*/ ivas_error ivas_masa_dec_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ @@ -706,10 +706,10 @@ ivas_error ivas_masa_dec_open( /*-----------------------------------------------------------------------* - * ivas_masa_dec_close() - * - * close MASA decoder - *-----------------------------------------------------------------------*/ + * ivas_masa_dec_close() + * + * close MASA decoder + *-----------------------------------------------------------------------*/ void ivas_masa_dec_close( MASA_DECODER_HANDLE *hMasa_out /* i/o: MASA metadata structure */ @@ -771,10 +771,10 @@ void ivas_masa_dec_close( /*-------------------------------------------------------------------* - * ivas_masa_dec_config() - * - * Frame-by-frame configuration of MASA decoder - *-------------------------------------------------------------------*/ + * ivas_masa_dec_config() + * + * Frame-by-frame configuration of MASA decoder + *-------------------------------------------------------------------*/ static ivas_error ivas_masa_dec_config( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ @@ -884,10 +884,10 @@ static ivas_error ivas_masa_dec_config( /*-------------------------------------------------------------------* - * ivas_masa_prerender() - * - * Apply gaining and copying of transport signals when needed - *-------------------------------------------------------------------*/ + * ivas_masa_prerender() + * + * Apply gaining and copying of transport signals when needed + *-------------------------------------------------------------------*/ void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ @@ -915,8 +915,8 @@ void ivas_masa_prerender( /*-------------------------------------------------------------------* - * Local functions - *-------------------------------------------------------------------*/ + * Local functions + *-------------------------------------------------------------------*/ static void index_16bits( IVAS_QMETADATA_HANDLE hQMetaData, @@ -1074,7 +1074,7 @@ static ivas_error init_lfe_synth_data( int16_t slot_size; /* Ring buffer for the filterbank of the LFE synthesis. - * The filterbank is using moving average lowpass filter with the crossover of 120 Hz. */ + * The filterbank is using moving average lowpass filter with the crossover of 120 Hz. */ bufferSize = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES ); if ( ( hMasa->hMasaLfeSynth->lfeSynthRingBuffer = (float *) malloc( bufferSize * sizeof( float ) ) ) == NULL ) { @@ -1087,7 +1087,7 @@ static ivas_error init_lfe_synth_data( hMasa->hMasaLfeSynth->ringBufferSize = bufferSize; /* Ring buffer for additional lowpass filter for the LFE signal. - * Moving average lowpass filter with the crossover of 240 Hz. */ + * Moving average lowpass filter with the crossover of 240 Hz. */ bufferSize /= 2; if ( ( hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 = (float *) malloc( bufferSize * sizeof( float ) ) ) == NULL ) { @@ -1273,10 +1273,10 @@ static int16_t decode_lfe_to_total_energy_ratio( /*-------------------------------------------------------------------* - * ivas_masa_dec_reconfigure() - * - * Reconfigure IVAS MASA decoder - *-------------------------------------------------------------------*/ + * ivas_masa_dec_reconfigure() + * + * Reconfigure IVAS MASA decoder + *-------------------------------------------------------------------*/ ivas_error ivas_masa_dec_reconfigure( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ @@ -1319,8 +1319,8 @@ ivas_error ivas_masa_dec_reconfigure( /* possible reconfigure is done later */ /*-----------------------------------------------------------------* - * Allocate and initialize SCE/CPE and other handles - *-----------------------------------------------------------------*/ + * Allocate and initialize SCE/CPE and other handles + *-----------------------------------------------------------------*/ bit_stream = st_ivas->hSCE[0] != NULL ? st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream : st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream; @@ -1385,8 +1385,8 @@ ivas_error ivas_masa_dec_reconfigure( { #endif /*-----------------------------------------------------------------* - * TD Decorrelator - *-----------------------------------------------------------------*/ + * TD Decorrelator + *-----------------------------------------------------------------*/ if ( st_ivas->hDiracDecBin != NULL ) { @@ -1397,8 +1397,8 @@ ivas_error ivas_masa_dec_reconfigure( } /*-----------------------------------------------------------------* - * CLDFB instances - *-----------------------------------------------------------------*/ + * CLDFB instances + *-----------------------------------------------------------------*/ if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, st_ivas->nchan_transport, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { @@ -1406,8 +1406,8 @@ ivas_error ivas_masa_dec_reconfigure( } /*-----------------------------------------------------------------* - * Set-up MASA coding elements and bitrates - *-----------------------------------------------------------------*/ + * Set-up MASA coding elements and bitrates + *-----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS } #endif @@ -1467,10 +1467,10 @@ ivas_error ivas_masa_dec_reconfigure( /*-------------------------------------------------------------------* - * ivas_spar_param_to_masa_param_mapping() - * - * Determine MASA metadata from the SPAR metadata - *-------------------------------------------------------------------*/ + * ivas_spar_param_to_masa_param_mapping() + * + * Determine MASA metadata from the SPAR metadata + *-------------------------------------------------------------------*/ void ivas_spar_param_to_masa_param_mapping( Decoder_Struct *st_ivas, /* i/o: IVAS decoder struct */ @@ -2416,10 +2416,10 @@ static int16_t ivas_decode_masaism_metadata( /*-------------------------------------------------------------------* - * ivas_masa_ism_set_edited_objects() - * - * - *-------------------------------------------------------------------*/ + * ivas_masa_ism_set_edited_objects() + * + * + *-------------------------------------------------------------------*/ void ivas_masa_ism_set_edited_objects( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index a551ab7f9b..74a757f0b5 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1237,7 +1237,7 @@ typedef struct decoder_config_structure int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ float non_diegetic_pan_gain; /* non diegetic panning gain*/ int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ - int16_t Opt_ExternalOrientation; /* indiates whether external orientations are used */ + int16_t Opt_ExternalOrientation; /* indiates whether external orientations are used */ /* temp. development parameters */ #ifdef DEBUGGING diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 199fd99098..53f0dd7941 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -452,8 +452,8 @@ ivas_error ivas_ism_metadata_enc( if ( ism_metadata_flag_global ) { /*----------------------------------------------------------------* - * Metadata quantization and coding, loop over all objects - *----------------------------------------------------------------*/ + * Metadata quantization and coding, loop over all objects + *----------------------------------------------------------------*/ int16_t total_bits_metadata = 0; int16_t bits_metadata_ism = 0; @@ -529,8 +529,8 @@ ivas_error ivas_ism_metadata_enc( encode_angle_indices( hBstr, &( hIsmMetaData->position_angle ), hIsmMetaData->last_ism_metadata_flag, hSCE[0]->hCoreCoder[0]->ini_frame, idx_angle1_abs, idx_angle2_abs, &flag_abs_azimuth[ch], &flag_abs_elevation[ch] ); /*----------------------------------------------------------------* - * Quantize and encode radius, yaw, and pitch - *----------------------------------------------------------------*/ + * Quantize and encode radius, yaw, and pitch + *----------------------------------------------------------------*/ if ( ism_mode == ISM_MODE_DISC && ism_extended_metadata_flag ) { @@ -561,9 +561,9 @@ ivas_error ivas_ism_metadata_enc( } /*----------------------------------------------------------------* - * inter-object logic minimizing the use of several absolutely coded - * indexes in the same frame - *----------------------------------------------------------------*/ + * inter-object logic minimizing the use of several absolutely coded + * indexes in the same frame + *----------------------------------------------------------------*/ i = 0; while ( i == 0 || i < nchan_ism / INTER_OBJECT_PARAM_CHECK ) @@ -683,8 +683,8 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS /*----------------------------------------------------------------* - * Take into account the combined format bit-budget distribution - *----------------------------------------------------------------*/ + * Take into account the combined format bit-budget distribution + *----------------------------------------------------------------*/ if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { @@ -736,8 +736,8 @@ ivas_error ivas_ism_metadata_enc( #endif /*----------------------------------------------------------------* - * Configuration and decision about bitrates per channel - *----------------------------------------------------------------*/ + * Configuration and decision about bitrates per channel + *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS if ( ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 714054d977..c10ec862c5 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -731,7 +731,7 @@ void ivas_set_surplus_brate_enc( /*--------------------------------------------------------------------------* * ivas_omasa_ener_brate() * - * + * *--------------------------------------------------------------------------*/ /*! r: OMASA energy bitrate flag */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index fff3f11ce4..540072679f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4407,14 +4407,14 @@ static void renderBufferChannel( } static ivas_error rotateFrameMc( - IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ - LSSETUP_CUSTOM_STRUCT inCustomLs, /* i : Input Custom LS setup */ - const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + LSSETUP_CUSTOM_STRUCT inCustomLs, /* i : Input Custom LS setup */ + const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ - rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ - const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ - IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ + rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ + const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ + IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ ) { int16_t i; @@ -4544,12 +4544,12 @@ static ivas_error rotateFrameMc( } static ivas_error rotateFrameSba( - IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ - const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ - rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ - IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ + rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ + IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ ) { int16_t i, l, n, m; @@ -4734,97 +4734,97 @@ static ivas_error renderIsmToBinauralRoom( } - if ( combinedOrientationEnabled ) + if ( combinedOrientationEnabled ) + { + subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; + // for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) + for ( subframe_idx = 0; subframe_idx < 1; subframe_idx++ ) { - subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; - // for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) - for ( subframe_idx = 0; subframe_idx < 1; subframe_idx++ ) + for ( i = 0; i < 3; i++ ) { - for ( i = 0; i < 3; i++ ) + if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] ) { - if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] ) - { - for ( j = 0; j < 3; j++ ) - { - Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; - } - } - else + for ( j = 0; j < 3; j++ ) { - /* Set to identity */ - set_zero( Rmat[i], 3 ); - Rmat[i][i] = 1.0f; + Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; } } + else + { + /* Set to identity */ + set_zero( Rmat[i], 3 ); + Rmat[i][i] = 1.0f; + } } - (void) subframe_len; // avoid warning } + (void) subframe_len; // avoid warning + } - /* TODO tmu : see issue #518 */ - /* Possible optimization: less processing needed if position didn't change - * needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ - /* previous position gains */ - if ( combinedOrientationEnabled ) - { - rotateAziEle( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &azi_rot, &ele_rot, ismInput->rot_mat_prev, 0 ); - rotatedPos.azimuth = (float) azi_rot; - rotatedPos.elevation = (float) ele_rot; - } + /* TODO tmu : see issue #518 */ + /* Possible optimization: less processing needed if position didn't change + * needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ + /* previous position gains */ + if ( combinedOrientationEnabled ) + { + rotateAziEle( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &azi_rot, &ele_rot, ismInput->rot_mat_prev, 0 ); + rotatedPos.azimuth = (float) azi_rot; + rotatedPos.elevation = (float) ele_rot; + } - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, - ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->previousPos.azimuth, - ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->previousPos.elevation, - previousPanGains ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, + ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->previousPos.azimuth, + ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->previousPos.elevation, + previousPanGains ) ) != IVAS_ERR_OK ) + { + return error; + } - /* current position gains */ - if ( combinedOrientationEnabled ) - { - rotateAziEle( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, &azi_rot, &ele_rot, Rmat, 0 ); - rotatedPos.azimuth = (float) azi_rot; - rotatedPos.elevation = (float) ele_rot; - } + /* current position gains */ + if ( combinedOrientationEnabled ) + { + rotateAziEle( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, &azi_rot, &ele_rot, Rmat, 0 ); + rotatedPos.azimuth = (float) azi_rot; + rotatedPos.elevation = (float) ele_rot; + } - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, - ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->currentPos.azimuth, - ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->currentPos.elevation, - currentPanGains ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, + ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->currentPos.azimuth, + ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->currentPos.elevation, + currentPanGains ) ) != IVAS_ERR_OK ) + { + return error; + } - for ( i = 0; i < 3; i++ ) - { - mvr2r( Rmat[i], ismInput->rot_mat_prev[i], 3 ); - } + for ( i = 0; i < 3; i++ ) + { + mvr2r( Rmat[i], ismInput->rot_mat_prev[i], 3 ); + } - /* intermediate rendering to 7_1_4 */ - tmpMcBuffer = ismInput->base.inputBuffer; + /* intermediate rendering to 7_1_4 */ + tmpMcBuffer = ismInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + { + return error; + } - 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 ); + 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 ); - renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, tmpMcBuffer ); + renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, tmpMcBuffer ); - copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); + copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); - if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, + NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } - accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); + accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); - free( tmpMcBuffer.data ); + free( tmpMcBuffer.data ); pop_wmops(); return IVAS_ERR_OK; @@ -5165,7 +5165,7 @@ static ivas_error renderMcToBinaural( if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled - && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) + && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); -- GitLab From 47a77d838c82690a07ff23237b1d4511e4950545 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Fri, 16 Jun 2023 09:41:40 +0300 Subject: [PATCH 0208/1418] Remove empty head_rotation_file_reader files head_rotation_file_reader.c/.h were replaced with rotation_file_reader.c/.h, remove the empty files --- Workspace_msvc/lib_util.vcxproj | 2 -- lib_util/head_rotation_file_reader.c | 37 --------------------------- lib_util/head_rotation_file_reader.h | 38 ---------------------------- 3 files changed, 77 deletions(-) delete mode 100644 lib_util/head_rotation_file_reader.c delete mode 100644 lib_util/head_rotation_file_reader.h diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 9c68dbb36d..10a0a7a391 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -145,7 +145,6 @@ - @@ -171,7 +170,6 @@ - diff --git a/lib_util/head_rotation_file_reader.c b/lib_util/head_rotation_file_reader.c deleted file mode 100644 index c26a7b9156..0000000000 --- a/lib_util/head_rotation_file_reader.c +++ /dev/null @@ -1,37 +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 "head_rotation_file_reader.h" -#include -#include -#include -#include "prot.h" diff --git a/lib_util/head_rotation_file_reader.h b/lib_util/head_rotation_file_reader.h deleted file mode 100644 index d4a2af84e7..0000000000 --- a/lib_util/head_rotation_file_reader.h +++ /dev/null @@ -1,38 +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_HR_FILE_READER_H -#define IVAS_HR_FILE_READER_H - -#include "common_api_types.h" - -#endif /* IVAS_HR_FILE_READER_H */ -- GitLab From 63061134f0e7a6ee6a42c275aa70f37db2610aae Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Fri, 16 Jun 2023 09:16:27 +0200 Subject: [PATCH 0209/1418] Unify subframe pointer increment for TD renderer under FIX_550_FIRST_FRAME_ACCESS --- lib_rend/ivas_objectRenderer.c | 18 ++++++++++++++++++ lib_rend/ivas_objectRenderer_hrFilt.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2495bdb4ab..18022124c1 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -330,6 +330,19 @@ ivas_error ivas_td_binaural_renderer_unwrap( { return error; } + +#ifdef FIX_550_FIRST_FRAME_ACCESS + /* Advance subframe pointer */ + c_indx = 0; + for ( nS = 0; nS < num_src; nS++ ) + { + if ( !( ivas_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ + { + hBinRendererTd->Sources[c_indx]->InputFrame_p += subframe_length; + c_indx++; + } + } +#endif } if ( hReverb != NULL ) @@ -407,8 +420,13 @@ ivas_error TDREND_GetMix( { pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; pan_right = 1.f - pan_left; +#ifdef FIX_550_FIRST_FRAME_ACCESS + v_multc_acc( Src_p->InputFrame_p, pan_left, output_buf[0], subframe_length ); + v_multc_acc( Src_p->InputFrame_p, pan_right, output_buf[1], subframe_length ); +#else v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_left, output_buf[0], subframe_length ); v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length ); +#endif } } diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6463261ec4..930fb29a5b 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -79,7 +79,9 @@ ivas_error TDREND_REND_RenderSourceHRFilt( v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); +#ifndef FIX_550_FIRST_FRAME_ACCESS Src_p->InputFrame_p += subframe_length; /* Increment input pointer */ +#endif return IVAS_ERR_OK; -- GitLab From 6e1fe92ff2cf0a510017bb86ab4b6f72b3ffd7cd Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 09:37:32 +0200 Subject: [PATCH 0210/1418] [tmp] Revert "Remove RENDERER_HEAD_POSITIONS_PER_FRAME - code compiles, but untested" This reverts commit 7fb10d40a051ab031a939821cb5bfdbd1dfddb40. --- apps/renderer.c | 170 ++++++----------------------------- lib_com/common_api_types.h | 2 - lib_com/options.h | 1 - lib_rend/ivas_prot_rend.h | 4 - lib_rend/ivas_rotation.c | 69 --------------- lib_rend/ivas_stat_rend.h | 7 -- lib_rend/lib_rend.c | 175 +------------------------------------ lib_rend/lib_rend.h | 21 +---- 8 files changed, 31 insertions(+), 418 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 9be54daca5..760065be91 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -157,9 +157,6 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; -#ifdef LIB_REND_API_5MS - bool framing_5ms; -#endif } CmdlnArgs; typedef enum @@ -184,9 +181,6 @@ typedef enum CmdLnOptionId_inputGain, CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, -#ifdef LIB_REND_API_5MS - CmdLnOptionId_framing5ms, -#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -308,14 +302,6 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, -#ifdef LIB_REND_API_5MS - { - .id = CmdLnOptionId_framing5ms, - .match = "framing_5ms", - .matchShort = "fr5", - .description = "Process audio with 5 ms framing. Time resolution of metadata (e.g. ISM positions) remains unchanged w.r.t. 20 ms framing", - }, -#endif }; @@ -574,9 +560,7 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; -#ifndef LIB_REND_API_5MS IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; -#endif #ifdef WMOPS reset_wmops(); @@ -749,13 +733,7 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - const int16_t frameSize_smpls = (int16_t) ( -#ifdef LIB_REND_API_5MS - ( args.framing_5ms ? 5 : 20 ) -#else - 20 -#endif - * args.sampleRate / 1000 ); + const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; @@ -1041,17 +1019,10 @@ int main( fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); } -#ifdef LIB_REND_API_5MS - ObjectPositionBuffer mtdBuffer; -#endif - while ( 1 ) { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; -#ifdef LIB_REND_API_5MS - const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; -#endif /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -1069,85 +1040,50 @@ int main( /* Convert from int to float and from interleaved to packed */ convertInputBuffer( inpInt16Buffer, numSamplesRead, frameSize_smpls, num_in_channels, inFloatBuffer ); -#ifdef LIB_REND_API_5MS - if ( isCurrentFrameMultipleOf20ms ) - { -#else + ObjectPositionBuffer mtdBuffer; -#endif - IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); + IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); - if ( referenceVectorReader != NULL ) + if ( referenceVectorReader != NULL ) + { + IVAS_VECTOR3 listenerPos, refPos; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPos, &refPos ) ) != IVAS_ERR_OK ) { - 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 ); - } + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); } - /* Read from reference rotation trajectory file if specified */ - if ( referenceRotReader != NULL ) + if ( ( error = IVAS_REND_SetReferenceVector( hIvasRend, listenerPos, refPos ) ) != IVAS_ERR_OK ) { - IVAS_QUATERNION quaternion; - if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) - { - 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 ); - } + fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); } -#ifdef LIB_REND_API_5MS } -#endif - - /* Read from head rotation trajectory file if specified */ - if ( headRotReader != NULL ) + /* Read from reference rotation trajectory file if specified */ + if ( referenceRotReader != NULL ) { -#ifdef LIB_REND_API_5MS - IVAS_QUATERNION headRot; - IVAS_VECTOR3 Pos; - - if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, headRot, Pos ) ) != IVAS_ERR_OK ) + + if ( ( error = IVAS_REND_SetReferenceRotation( hIvasRend, quaternion ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); + fprintf( stderr, "Error setting Reference Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } + } - if ( !args.framing_5ms ) - { - /* Skip over 3 following head positions - they are given on 5ms grid */ - for ( int16_t i = 0; i < 3; ++i ) - { - if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } - } - } -#else - IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; + /* Read from head rotation trajectory file if specified */ + if ( headRotReader != NULL ) + { + IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) { - if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) - { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } @@ -1157,61 +1093,20 @@ int main( fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#endif } else { -#ifdef LIB_REND_API_5MS - if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } -#else error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#endif } /* Read from external orientation file if specified */ if ( externalOrientationFileReader != NULL ) { -#ifdef LIB_REND_API_5MS - IVAS_QUATERNION quat; - int8_t enableHeadRotation; - int8_t enableExternalOrientation; - int8_t enableRotationInterpolation; - int16_t numFramesToTargetOrientation; - - if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } - - if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quat, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } - - if ( !args.framing_5ms ) - { - /* Skip over 3 following entries in file - they are given on 5ms grid */ - for ( int16_t i = 0; i < 3; ++i ) - { - if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); - } - } - } -#else IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableHeadRotation[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableExternalOrientation[RENDERER_HEAD_POSITIONS_PER_FRAME]; @@ -1232,7 +1127,6 @@ int main( fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } -#endif } /* Combine external orientations and head rotation */ @@ -1387,7 +1281,6 @@ int main( delayNumSamples -= (int16_t) outBufferSize; } - /* TODO(sgi): Masa output most likely broken with 5ms framing */ /* Write MASA metadata for MASA outputs */ if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) { @@ -2007,9 +1900,6 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); -#ifdef LIB_REND_API_5MS - args.framing_5ms = false; -#endif return args; } @@ -2139,12 +2029,6 @@ static void parseOption( exit( -1 ); } break; -#ifdef LIB_REND_API_5MS - case CmdLnOptionId_framing5ms: - assert( numOptionValues == 0 ); - args->framing_5ms = false; - break; -#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 49c6f395fd..2dc926dfc2 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -50,9 +50,7 @@ #define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #define IVAS_MAX_INPUT_LFE_CHANNELS 4 -#ifndef LIB_REND_API_5MS #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 4a88b47d83..bee9901a56 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ #define FIX_XXX_JITTER_SBA_BINAURAL_GAIN #define FIX_XXX_HEADTRACKER_INIT #define API_5MS -#define LIB_REND_API_5MS /* FhG: Adds 5ms framing capability to lib_rend */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 8d987a3f3c..29a5ace8f4 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -857,11 +857,7 @@ ivas_error combine_external_and_head_orientations_rend( ); ivas_error combine_external_and_head_orientations( -#ifdef LIB_REND_API_5MS - IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ -#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ -#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 468d28b026..184f382ee8 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -902,11 +902,7 @@ ivas_error combine_external_and_head_orientations_dec( #endif } #ifdef API_5MS -#ifdef LIB_REND_API_5MS return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); -#else - return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); -#endif #else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); #endif @@ -936,13 +932,8 @@ ivas_error combine_external_and_head_orientations_rend( { if ( hHeadTrackData->headRotEnabled ) { -#ifdef LIB_REND_API_5MS - headRotQuaternions = &hHeadTrackData->headPosition; - listenerPos = &hHeadTrackData->Pos; -#else headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; -#endif } } else if ( hExtOrientationData != NULL ) @@ -980,11 +971,7 @@ ivas_error combine_external_and_head_orientations_rend( *------------------------------------------------------------------------*/ ivas_error combine_external_and_head_orientations( -#ifdef LIB_REND_API_5MS - IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ -#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ -#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ @@ -1007,11 +994,7 @@ ivas_error combine_external_and_head_orientations( /* Form combined orientations or return if no data available */ if ( hCombinedOrientationData == NULL ) { -#ifdef LIB_REND_API_5MS - if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) -#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1020,11 +1003,7 @@ ivas_error combine_external_and_head_orientations( return IVAS_ERR_OK; } } -#ifdef LIB_REND_API_5MS - else if ( headRotQuaternion == NULL && hExtOrientationData == NULL ) -#else else if ( headRotQuaternions == NULL && hExtOrientationData == NULL ) -#endif { /* Reset the combined orientations and rotations */ hCombinedOrientationData->isInterpolationOngoing = FALSE; @@ -1058,19 +1037,11 @@ ivas_error combine_external_and_head_orientations( } #endif } -#ifdef LIB_REND_API_5MS - else if ( hExtOrientationData == NULL && headRotQuaternion != NULL ) -#else else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) -#endif { /* Head rotation only */ #ifdef API_5MS -#ifdef LIB_REND_API_5MS - hCombinedOrientationData->Quaternion = *headRotQuaternion; -#else hCombinedOrientationData->Quaternion = *headRotQuaternions; -#endif #else if ( numHeadRotQuaternions >= 0 ) @@ -1159,11 +1130,7 @@ ivas_error combine_external_and_head_orientations( #endif } -#ifdef LIB_REND_API_5MS - if ( hExtOrientationData != NULL && headRotQuaternion != NULL ) -#else if ( hExtOrientationData != NULL && headRotQuaternions != NULL ) -#endif { /* Combine head and external orientations */ #ifdef API_5MS @@ -1173,19 +1140,11 @@ ivas_error combine_external_and_head_orientations( { if ( hExtOrientationData->enableExternalOrientation > 0 ) { -#ifdef LIB_REND_API_5MS - QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternion, &hCombinedOrientationData->Quaternion ); -#else QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternions, &hCombinedOrientationData->Quaternion ); -#endif } else { -#ifdef LIB_REND_API_5MS - hCombinedOrientationData->Quaternion = *headRotQuaternion; -#else hCombinedOrientationData->Quaternion = *headRotQuaternions; -#endif } } /* Use the freezed head rotation */ @@ -1244,11 +1203,7 @@ ivas_error combine_external_and_head_orientations( #endif } -#ifdef LIB_REND_API_5MS - if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) -#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) -#endif { /* Calculate the combined rotation matrix */ #ifdef API_5MS @@ -1288,22 +1243,14 @@ ivas_error combine_external_and_head_orientations( } #endif } -#ifdef LIB_REND_API_5MS - if ( headRotQuaternion != NULL ) -#else if ( headRotQuaternions != NULL ) -#endif { #ifdef API_5MS if ( hExtOrientationData != NULL ) { if ( hExtOrientationData->enableHeadRotation > 0 ) { -#ifdef LIB_REND_API_5MS - hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; -#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; -#endif } else { @@ -1312,11 +1259,7 @@ ivas_error combine_external_and_head_orientations( } else { -#ifdef LIB_REND_API_5MS - hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; -#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; -#endif } hCombinedOrientationData->listenerPos = *listenerPos; @@ -1351,11 +1294,7 @@ ivas_error combine_external_and_head_orientations( } /* Check if combined orientation is enabled */ -#ifdef LIB_REND_API_5MS - if ( headRotQuaternion != NULL && hExtOrientationData == NULL ) -#else if ( headRotQuaternions != NULL && hExtOrientationData == NULL ) -#endif { #ifdef API_5MS hCombinedOrientationData->enableCombinedOrientation = 1; @@ -1374,11 +1313,7 @@ ivas_error combine_external_and_head_orientations( } #endif } -#ifdef LIB_REND_API_5MS - else if ( headRotQuaternion == NULL && hExtOrientationData != NULL ) -#else else if ( headRotQuaternions == NULL && hExtOrientationData != NULL ) -#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 ) @@ -1403,11 +1338,7 @@ ivas_error combine_external_and_head_orientations( } #endif } -#ifdef LIB_REND_API_5MS - else if ( headRotQuaternion != NULL && hExtOrientationData != NULL ) -#else else if ( headRotQuaternions != NULL && hExtOrientationData != NULL ) -#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 || hExtOrientationData->enableHeadRotation > 0 ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 7306c45e99..14de5e7d55 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -248,16 +248,9 @@ typedef struct ivas_orient_trk_state_t typedef struct { int8_t headRotEnabled; -#ifdef LIB_REND_API_5MS - IVAS_QUATERNION headPosition; - IVAS_VECTOR3 Pos; - float crossfade_5ms[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; - float crossfade_20ms[L_FRAME48k]; -#else IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; -#endif ivas_orient_trk_state_t *hOrientationTracker; } IVAS_REND_HeadRotData; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6f6b32de1b..89b51e7745 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -930,25 +930,6 @@ static ivas_error initHeadRotation( /* Head rotation is enabled by default */ hIvasRend->headRotData.headRotEnabled = 1; -#ifdef LIB_REND_API_5MS - /* Initialize 5ms crossfade */ - crossfade_len = L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ - tmp = 1.f / ( crossfade_len - 1 ); - for ( i = 0; i < crossfade_len; i++ ) - { - hIvasRend->headRotData.crossfade_5ms[i] = i * tmp; - } - /* Initialize 20ms crossfade */ - crossfade_len = L_FRAME48k; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ - tmp = 1.f / ( crossfade_len - 1 ); - for ( i = 0; i < crossfade_len; i++ ) - { - hIvasRend->headRotData.crossfade_20ms[i] = i * tmp; - } - - /* Initialize with unit quaternion */ - hIvasRend->headRotData.headPosition = quaternionInit(); -#else /* Initialize 5ms crossfade */ crossfade_len = L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME; tmp = 1.f / ( crossfade_len - 1 ); @@ -962,7 +943,6 @@ static ivas_error initHeadRotation( { hIvasRend->headRotData.headPositions[i] = quaternionInit(); } -#endif if ( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { @@ -4083,19 +4063,12 @@ int16_t IVAS_REND_FeedRenderConfig( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetHeadRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -#ifdef LIB_REND_API_5MS - const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ - const IVAS_VECTOR3 Pos /* 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 orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ -#endif ) { -#ifndef LIB_REND_API_5MS int16_t i; -#endif IVAS_QUATERNION rotQuat; /* Validate function arguments */ @@ -4110,20 +4083,6 @@ ivas_error IVAS_REND_SetHeadRotation( return IVAS_ERR_INVALID_OUTPUT_FORMAT; } -#ifdef LIB_REND_API_5MS - /* check for Euler angle signaling */ - if ( headRot.w == -3.0f ) - { - Euler2Quat( deg2rad( headRot.x ), deg2rad( headRot.y ), deg2rad( headRot.z ), &rotQuat ); - } - else - { - rotQuat = headRot; - } - - ivas_orient_trk_Process( hIvasRend->headRotData.hOrientationTracker, rotQuat, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hIvasRend->headRotData.headPosition ); - hIvasRend->headRotData.Pos = Pos; -#else if ( headRot == NULL ) { hIvasRend->headRotData.headRotEnabled = 0; @@ -4147,27 +4106,10 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->headRotData.Pos[i] = Pos[i]; } } -#endif return IVAS_ERR_OK; } -#ifdef LIB_REND_API_5MS -ivas_error IVAS_REND_DisableHeadRotation( - IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ -) -{ - /* Validate function arguments */ - if ( hIvasRend == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - hIvasRend->headRotData.headRotEnabled = 0; - return IVAS_ERR_OK; -} -#endif - /*-------------------------------------------------------------------* * IVAS_REND_SetOrientationTrackingMode() @@ -4295,24 +4237,15 @@ ivas_error IVAS_REND_SetReferenceVector( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetExternalOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ -#ifdef LIB_REND_API_5MS - int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ - int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ - int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ - int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ /* TODO(sgi): make independent of framing */ -#else + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *orientation, /* i : external orientation data */ int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ -#endif ) { -#ifndef LIB_REND_API_5MS int16_t i; -#endif /* Validate function arguments */ if ( hIvasRend == NULL || hIvasRend->hExternalOrientationData == NULL ) @@ -4333,14 +4266,6 @@ ivas_error IVAS_REND_SetExternalOrientation( } else { -#ifdef LIB_REND_API_5MS - QuaternionInverse( *orientation, &hIvasRend->hExternalOrientationData->Quaternion ); - - hIvasRend->hExternalOrientationData->enableHeadRotation = enableHeadRotation; - hIvasRend->hExternalOrientationData->enableExternalOrientation = enableExternalOrientation; - hIvasRend->hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation; - hIvasRend->hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation; -#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4360,7 +4285,6 @@ ivas_error IVAS_REND_SetExternalOrientation( hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; #endif } -#endif } return IVAS_ERR_OK; @@ -4397,9 +4321,7 @@ ivas_error IVAS_REND_GetCombinedOrientation( IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ) { -#ifndef LIB_REND_API_5MS int16_t i; -#endif if ( hIvasRend == NULL || pOrientation == NULL ) { @@ -4408,9 +4330,6 @@ ivas_error IVAS_REND_GetCombinedOrientation( if ( hIvasRend->hCombinedOrientationData != NULL ) { -#ifdef LIB_REND_API_5MS - *pOrientation = hIvasRend->hCombinedOrientationData->Quaternion; -#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4420,7 +4339,6 @@ ivas_error IVAS_REND_GetCombinedOrientation( pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternions[i]; #endif } -#endif } return IVAS_ERR_OK; @@ -4529,11 +4447,7 @@ static ivas_error rotateFrameMc( { int16_t i; int16_t j; -#ifdef LIB_REND_API_5MS - const float *crossfade; -#else int16_t subframe_idx, subframe_len; -#endif int16_t azimuth, elevation; int16_t is_planar_setup, lfe_idx; int16_t nchan; @@ -4548,21 +4462,6 @@ static ivas_error rotateFrameMc( push_wmops( "rotateFrameMc" ); -#ifdef LIB_REND_API_5MS - if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) - { - crossfade = headRotData->crossfade_20ms; - } - else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) - { - crossfade = headRotData->crossfade_5ms; - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); - } -#endif - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK ) @@ -4587,13 +4486,10 @@ static ivas_error rotateFrameMc( gains[ch_in][ch_in] = 1.f; } -#ifndef LIB_REND_API_5MS - /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { -#endif for ( i = 0; i < 3; i++ ) { if ( hCombinedOrientationData != NULL ) @@ -4655,18 +4551,6 @@ static ivas_error rotateFrameMc( { for ( ch_in = 0; ch_in < nchan; ch_in++ ) { -#ifdef LIB_REND_API_5MS - writePtr = getSmplPtr( outAudio, ch_out, 0 ); - readPtr = getSmplPtr( inAudio, ch_in, 0 ); - /* crossfade with previous rotation gains */ - for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) - { - *writePtr++ += - ( *readPtr ) * ( ( 1 - crossfade[i] ) * gains_prev[ch_in][ch_out] ) + - ( *readPtr ) * ( crossfade[i] * gains[ch_in][ch_out] ); - readPtr++; - } -#else writePtr = getSmplPtr( outAudio, ch_out, subframe_idx * subframe_len ); readPtr = getSmplPtr( inAudio, ch_in, subframe_idx * subframe_len ); /* crossfade with previous rotation gains */ @@ -4677,7 +4561,6 @@ static ivas_error rotateFrameMc( ( *readPtr ) * ( headRotData->crossfade[i] * gains[ch_in][ch_out] ); readPtr++; } -#endif } } @@ -4686,9 +4569,7 @@ static ivas_error rotateFrameMc( { mvr2r( gains[i], gains_prev[i], nchan ); } -#ifndef LIB_REND_API_5MS } -#endif pop_wmops(); @@ -4707,11 +4588,7 @@ static ivas_error rotateFrameSba( int16_t i, l, n, m; int16_t m1, m2; int16_t shd_rot_max_order; -#ifdef LIB_REND_API_5MS - const float *crossfade; -#else int16_t subframe_idx, subframe_len; -#endif float *readPtr, *writePtr; rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; @@ -4720,33 +4597,15 @@ static ivas_error rotateFrameSba( push_wmops( "rotateFrameSba" ); -#ifdef LIB_REND_API_5MS - if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) - { - crossfade = headRotData->crossfade_20ms; - } - else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) - { - crossfade = headRotData->crossfade_5ms; - } - else - { - return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); - } -#endif - if ( ( error = getAmbisonicsOrder( inConfig, &shd_rot_max_order ) ) != IVAS_ERR_OK ) { return error; } -#ifndef LIB_REND_API_5MS - /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { -#endif /* initialize rotation matrices with zeros */ for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) { @@ -4778,11 +4637,7 @@ static ivas_error rotateFrameSba( /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( gains, Rmat, shd_rot_max_order ); -#ifdef LIB_REND_API_5MS - for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) -#else for ( i = 0; i < subframe_len; i++ ) -#endif { /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ /* apply each angular-momentum block individually to save complexity. */ @@ -4799,27 +4654,16 @@ static ivas_error rotateFrameSba( for ( m = m1; m < m2; m++ ) { -#ifdef LIB_REND_API_5MS - readPtr = getSmplPtr( inAudio, m, i ); - /* crossfade with previous rotation gains */ - tmpRot[n - m1] += crossfade[i] * gains[n][m] * ( *readPtr ) + - ( 1 - crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); -#else readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); /* crossfade with previous rotation gains */ tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); -#endif } } /* write back the result */ for ( n = m1; n < m2; n++ ) { -#ifdef LIB_REND_API_5MS - writePtr = getSmplPtr( outAudio, n, i ); -#else writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i ); -#endif ( *writePtr ) = tmpRot[n - m1]; } m1 = m2; @@ -4847,9 +4691,7 @@ static ivas_error rotateFrameSba( { mvr2r( gains[i], gains_prev[i], HEADROT_SHMAT_DIM ); } -#ifndef LIB_REND_API_5MS } -#endif pop_wmops(); @@ -4892,9 +4734,7 @@ static ivas_error renderIsmToBinauralRoom( { int16_t i; int16_t azi_rot, ele_rot; -#ifndef LIB_REND_API_5MS int16_t subframe_idx, subframe_len; -#endif int16_t tmp; rotation_matrix Rmat; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4943,12 +4783,10 @@ static ivas_error renderIsmToBinauralRoom( if ( combinedOrientationEnabled ) { -#ifndef LIB_REND_API_5MS subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; // for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) for ( subframe_idx = 0; subframe_idx < 1; subframe_idx++ ) { -#endif for ( i = 0; i < 3; i++ ) { #ifdef API_5MS @@ -4976,10 +4814,8 @@ static ivas_error renderIsmToBinauralRoom( Rmat[i][i] = 1.0f; } } -#ifndef LIB_REND_API_5MS } (void) subframe_len; // avoid warning -#endif } /* TODO tmu : see issue #518 */ @@ -6464,10 +6300,6 @@ static ivas_error renderActiveInputsMasa( if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && pCurrentInput->decDummy->hHeadTrackData != NULL ) { -#ifdef LIB_REND_API_5MS - pCurrentInput->decDummy->hHeadTrackData->Quaternion = hIvasRend->headRotData.headPosition; - pCurrentInput->decDummy->hHeadTrackData->Pos = hIvasRend->headRotData.Pos; -#else for ( sf_idx = 0; sf_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; ++sf_idx ) { #ifdef API_5MS @@ -6479,7 +6311,6 @@ static ivas_error renderActiveInputsMasa( pCurrentInput->decDummy->hHeadTrackData->Pos[sf_idx] = hIvasRend->headRotData.Pos[sf_idx]; #endif } -#endif } if ( ( error = renderInputMasa( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 701e0d5062..d8d6127b20 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -247,21 +247,9 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -#ifdef LIB_REND_API_5MS - const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ - const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ -#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ -#endif -); - -#ifdef LIB_REND_API_5MS -/* Head rotation becomes enabled by calling IVAS_REND_SetHeadRotation. Use this to disable. */ -ivas_error IVAS_REND_DisableHeadRotation( - IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ ); -#endif ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ @@ -292,17 +280,10 @@ ivas_error IVAS_REND_SetReferenceVector( ivas_error IVAS_REND_SetExternalOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *orientation, /* i : external orientation data */ -#ifdef LIB_REND_API_5MS - int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ - int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ - int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ - int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ -#else int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ -#endif ); ivas_error IVAS_REND_CombineHeadAndExternalOrientation( @@ -311,7 +292,7 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( ivas_error IVAS_REND_GetCombinedOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ + IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed orientation */ ); ivas_error IVAS_REND_GetMasaMetadata( -- GitLab From ffc8eb1a0f76e13a734dbe9056582957bf588105 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 09:39:16 +0200 Subject: [PATCH 0211/1418] Revert "[tmp] Revert "Remove RENDERER_HEAD_POSITIONS_PER_FRAME - code compiles, but untested"" This reverts commit 6e1fe92ff2cf0a510017bb86ab4b6f72b3ffd7cd. --- apps/renderer.c | 170 +++++++++++++++++++++++++++++------ lib_com/common_api_types.h | 2 + lib_com/options.h | 1 + lib_rend/ivas_prot_rend.h | 4 + lib_rend/ivas_rotation.c | 69 +++++++++++++++ lib_rend/ivas_stat_rend.h | 7 ++ lib_rend/lib_rend.c | 175 ++++++++++++++++++++++++++++++++++++- lib_rend/lib_rend.h | 21 ++++- 8 files changed, 418 insertions(+), 31 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 760065be91..9be54daca5 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -157,6 +157,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef LIB_REND_API_5MS + bool framing_5ms; +#endif } CmdlnArgs; typedef enum @@ -181,6 +184,9 @@ typedef enum CmdLnOptionId_inputGain, CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef LIB_REND_API_5MS + CmdLnOptionId_framing5ms, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -302,6 +308,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, +#ifdef LIB_REND_API_5MS + { + .id = CmdLnOptionId_framing5ms, + .match = "framing_5ms", + .matchShort = "fr5", + .description = "Process audio with 5 ms framing. Time resolution of metadata (e.g. ISM positions) remains unchanged w.r.t. 20 ms framing", + }, +#endif }; @@ -560,7 +574,9 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; +#ifndef LIB_REND_API_5MS IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif #ifdef WMOPS reset_wmops(); @@ -733,7 +749,13 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - const int16_t frameSize_smpls = (int16_t) ( 20 * args.sampleRate / 1000 ); + const int16_t frameSize_smpls = (int16_t) ( +#ifdef LIB_REND_API_5MS + ( args.framing_5ms ? 5 : 20 ) +#else + 20 +#endif + * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; @@ -1019,10 +1041,17 @@ int main( fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); } +#ifdef LIB_REND_API_5MS + ObjectPositionBuffer mtdBuffer; +#endif + while ( 1 ) { int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; +#ifdef LIB_REND_API_5MS + const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; +#endif /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -1040,50 +1069,85 @@ int main( /* Convert from int to float and from interleaved to packed */ convertInputBuffer( inpInt16Buffer, numSamplesRead, frameSize_smpls, num_in_channels, inFloatBuffer ); - +#ifdef LIB_REND_API_5MS + if ( isCurrentFrameMultipleOf20ms ) + { +#else ObjectPositionBuffer mtdBuffer; - IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); +#endif + IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); - if ( referenceVectorReader != NULL ) - { - IVAS_VECTOR3 listenerPos, refPos; - if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPos, &refPos ) ) != IVAS_ERR_OK ) + if ( referenceVectorReader != NULL ) { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); + 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 ); + } } - if ( ( error = IVAS_REND_SetReferenceVector( hIvasRend, listenerPos, refPos ) ) != IVAS_ERR_OK ) + /* Read from reference rotation trajectory file if specified */ + if ( referenceRotReader != NULL ) { - fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); - exit( -1 ); + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + 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 ); + } } +#ifdef LIB_REND_API_5MS } - /* Read from reference rotation trajectory file if specified */ - if ( referenceRotReader != NULL ) +#endif + + /* Read from head rotation trajectory file if specified */ + if ( headRotReader != NULL ) { - IVAS_QUATERNION quaternion; - if ( ( error = HeadRotationFileReading( referenceRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION headRot; + IVAS_VECTOR3 Pos; + + if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) { 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 ) + if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, headRot, Pos ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "Error setting Reference Rotation: %s\n", ivas_error_to_string( error ) ); + fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } - } - /* Read from head rotation trajectory file if specified */ - if ( headRotReader != NULL ) - { - IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; - - for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) + if ( !args.framing_5ms ) { - if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) + /* Skip over 3 following head positions - they are given on 5ms grid */ + for ( int16_t i = 0; i < 3; ++i ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &headRot, &Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } +#else + IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; + + for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { + if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } @@ -1093,20 +1157,61 @@ int main( fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } else { +#ifdef LIB_REND_API_5MS + if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } +#else error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } /* Read from external orientation file if specified */ if ( externalOrientationFileReader != NULL ) { +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION quat; + int8_t enableHeadRotation; + int8_t enableExternalOrientation; + int8_t enableRotationInterpolation; + int16_t numFramesToTargetOrientation; + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quat, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + + if ( !args.framing_5ms ) + { + /* Skip over 3 following entries in file - they are given on 5ms grid */ + for ( int16_t i = 0; i < 3; ++i ) + { + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quat, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "Error in External Orientation File Reading: %s\n", ivas_error_to_string( error ) ); + exit( -1 ); + } + } + } +#else IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableHeadRotation[RENDERER_HEAD_POSITIONS_PER_FRAME]; int8_t enableExternalOrientation[RENDERER_HEAD_POSITIONS_PER_FRAME]; @@ -1127,6 +1232,7 @@ int main( fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } +#endif } /* Combine external orientations and head rotation */ @@ -1281,6 +1387,7 @@ int main( delayNumSamples -= (int16_t) outBufferSize; } + /* TODO(sgi): Masa output most likely broken with 5ms framing */ /* Write MASA metadata for MASA outputs */ if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) { @@ -1900,6 +2007,9 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); +#ifdef LIB_REND_API_5MS + args.framing_5ms = false; +#endif return args; } @@ -2029,6 +2139,12 @@ static void parseOption( exit( -1 ); } break; +#ifdef LIB_REND_API_5MS + case CmdLnOptionId_framing5ms: + assert( numOptionValues == 0 ); + args->framing_5ms = false; + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 2dc926dfc2..49c6f395fd 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -50,7 +50,9 @@ #define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #define IVAS_MAX_INPUT_LFE_CHANNELS 4 +#ifndef LIB_REND_API_5MS #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 +#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index 6e3e1010c2..544100fb35 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,7 @@ #define FIX_XXX_TDOBJRENDERER_INPUT #define FIX_XXX_ISM_SBA_ASAN #define API_5MS +#define LIB_REND_API_5MS /* FhG: Adds 5ms framing capability to lib_rend */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 29a5ace8f4..8d987a3f3c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -857,7 +857,11 @@ ivas_error combine_external_and_head_orientations_rend( ); ivas_error combine_external_and_head_orientations( +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ +#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ +#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index efd281ce84..f01120ddc0 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -902,7 +902,11 @@ ivas_error combine_external_and_head_orientations_dec( #endif } #ifdef API_5MS +#ifdef LIB_REND_API_5MS return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#endif #else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); #endif @@ -932,8 +936,13 @@ ivas_error combine_external_and_head_orientations_rend( { if ( hHeadTrackData->headRotEnabled ) { +#ifdef LIB_REND_API_5MS + headRotQuaternions = &hHeadTrackData->headPosition; + listenerPos = &hHeadTrackData->Pos; +#else headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; +#endif } } else if ( hExtOrientationData != NULL ) @@ -971,7 +980,11 @@ ivas_error combine_external_and_head_orientations_rend( *------------------------------------------------------------------------*/ ivas_error combine_external_and_head_orientations( +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION *headRotQuaternion, /* i : quaternion for head rotation */ +#else IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ +#endif IVAS_VECTOR3 *listenerPos, /* i : listener position */ #ifndef API_5MS int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ @@ -994,7 +1007,11 @@ ivas_error combine_external_and_head_orientations( /* Form combined orientations or return if no data available */ if ( hCombinedOrientationData == NULL ) { +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) +#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1003,7 +1020,11 @@ ivas_error combine_external_and_head_orientations( return IVAS_ERR_OK; } } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion == NULL && hExtOrientationData == NULL ) +#else else if ( headRotQuaternions == NULL && hExtOrientationData == NULL ) +#endif { /* Reset the combined orientations and rotations */ hCombinedOrientationData->isInterpolationOngoing = FALSE; @@ -1037,11 +1058,19 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( hExtOrientationData == NULL && headRotQuaternion != NULL ) +#else else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) +#endif { /* Head rotation only */ #ifdef API_5MS +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion = *headRotQuaternions; +#endif #else if ( numHeadRotQuaternions >= 0 ) @@ -1130,7 +1159,11 @@ ivas_error combine_external_and_head_orientations( #endif } +#ifdef LIB_REND_API_5MS + if ( hExtOrientationData != NULL && headRotQuaternion != NULL ) +#else if ( hExtOrientationData != NULL && headRotQuaternions != NULL ) +#endif { /* Combine head and external orientations */ #ifdef API_5MS @@ -1140,11 +1173,19 @@ ivas_error combine_external_and_head_orientations( { if ( hExtOrientationData->enableExternalOrientation > 0 ) { +#ifdef LIB_REND_API_5MS + QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternion, &hCombinedOrientationData->Quaternion ); +#else QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternions, &hCombinedOrientationData->Quaternion ); +#endif } else { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion = *headRotQuaternions; +#endif } } /* Use the freezed head rotation */ @@ -1203,7 +1244,11 @@ ivas_error combine_external_and_head_orientations( #endif } +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL || hExtOrientationData != NULL ) +#else if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) +#endif { /* Calculate the combined rotation matrix */ #ifdef API_5MS @@ -1243,14 +1288,22 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL ) +#else if ( headRotQuaternions != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData != NULL ) { if ( hExtOrientationData->enableHeadRotation > 0 ) { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; +#endif } else { @@ -1259,7 +1312,11 @@ ivas_error combine_external_and_head_orientations( } else { +#ifdef LIB_REND_API_5MS + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternion; +#else hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; +#endif } hCombinedOrientationData->listenerPos = *listenerPos; @@ -1294,7 +1351,11 @@ ivas_error combine_external_and_head_orientations( } /* Check if combined orientation is enabled */ +#ifdef LIB_REND_API_5MS + if ( headRotQuaternion != NULL && hExtOrientationData == NULL ) +#else if ( headRotQuaternions != NULL && hExtOrientationData == NULL ) +#endif { #ifdef API_5MS hCombinedOrientationData->enableCombinedOrientation = 1; @@ -1313,7 +1374,11 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion == NULL && hExtOrientationData != NULL ) +#else else if ( headRotQuaternions == NULL && hExtOrientationData != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 ) @@ -1338,7 +1403,11 @@ ivas_error combine_external_and_head_orientations( } #endif } +#ifdef LIB_REND_API_5MS + else if ( headRotQuaternion != NULL && hExtOrientationData != NULL ) +#else else if ( headRotQuaternions != NULL && hExtOrientationData != NULL ) +#endif { #ifdef API_5MS if ( hExtOrientationData->enableExternalOrientation > 0 || hExtOrientationData->enableHeadRotation > 0 ) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 14de5e7d55..7306c45e99 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -248,9 +248,16 @@ typedef struct ivas_orient_trk_state_t typedef struct { int8_t headRotEnabled; +#ifdef LIB_REND_API_5MS + IVAS_QUATERNION headPosition; + IVAS_VECTOR3 Pos; + float crossfade_5ms[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; + float crossfade_20ms[L_FRAME48k]; +#else IVAS_QUATERNION headPositions[RENDERER_HEAD_POSITIONS_PER_FRAME]; IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; float crossfade[L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME]; +#endif ivas_orient_trk_state_t *hOrientationTracker; } IVAS_REND_HeadRotData; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 89b51e7745..6f6b32de1b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -930,6 +930,25 @@ static ivas_error initHeadRotation( /* Head rotation is enabled by default */ hIvasRend->headRotData.headRotEnabled = 1; +#ifdef LIB_REND_API_5MS + /* Initialize 5ms crossfade */ + crossfade_len = L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ + tmp = 1.f / ( crossfade_len - 1 ); + for ( i = 0; i < crossfade_len; i++ ) + { + hIvasRend->headRotData.crossfade_5ms[i] = i * tmp; + } + /* Initialize 20ms crossfade */ + crossfade_len = L_FRAME48k; /* TODO(sgi): @tmu why do we assume 48 kHz here? */ + tmp = 1.f / ( crossfade_len - 1 ); + for ( i = 0; i < crossfade_len; i++ ) + { + hIvasRend->headRotData.crossfade_20ms[i] = i * tmp; + } + + /* Initialize with unit quaternion */ + hIvasRend->headRotData.headPosition = quaternionInit(); +#else /* Initialize 5ms crossfade */ crossfade_len = L_FRAME48k / RENDERER_HEAD_POSITIONS_PER_FRAME; tmp = 1.f / ( crossfade_len - 1 ); @@ -943,6 +962,7 @@ static ivas_error initHeadRotation( { hIvasRend->headRotData.headPositions[i] = quaternionInit(); } +#endif if ( ( hIvasRend->headRotData.hOrientationTracker = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { @@ -4063,12 +4083,19 @@ 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 LIB_REND_API_5MS + const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ + const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#endif ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif IVAS_QUATERNION rotQuat; /* Validate function arguments */ @@ -4083,6 +4110,20 @@ ivas_error IVAS_REND_SetHeadRotation( return IVAS_ERR_INVALID_OUTPUT_FORMAT; } +#ifdef LIB_REND_API_5MS + /* check for Euler angle signaling */ + if ( headRot.w == -3.0f ) + { + Euler2Quat( deg2rad( headRot.x ), deg2rad( headRot.y ), deg2rad( headRot.z ), &rotQuat ); + } + else + { + rotQuat = headRot; + } + + ivas_orient_trk_Process( hIvasRend->headRotData.hOrientationTracker, rotQuat, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hIvasRend->headRotData.headPosition ); + hIvasRend->headRotData.Pos = Pos; +#else if ( headRot == NULL ) { hIvasRend->headRotData.headRotEnabled = 0; @@ -4106,10 +4147,27 @@ ivas_error IVAS_REND_SetHeadRotation( hIvasRend->headRotData.Pos[i] = Pos[i]; } } +#endif return IVAS_ERR_OK; } +#ifdef LIB_REND_API_5MS +ivas_error IVAS_REND_DisableHeadRotation( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ +) +{ + /* Validate function arguments */ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + hIvasRend->headRotData.headRotEnabled = 0; + return IVAS_ERR_OK; +} +#endif + /*-------------------------------------------------------------------* * IVAS_REND_SetOrientationTrackingMode() @@ -4237,15 +4295,24 @@ ivas_error IVAS_REND_SetReferenceVector( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetExternalOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *orientation, /* i : external orientation data */ +#ifdef LIB_REND_API_5MS + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ /* TODO(sgi): make independent of framing */ +#else int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif /* Validate function arguments */ if ( hIvasRend == NULL || hIvasRend->hExternalOrientationData == NULL ) @@ -4266,6 +4333,14 @@ ivas_error IVAS_REND_SetExternalOrientation( } else { +#ifdef LIB_REND_API_5MS + QuaternionInverse( *orientation, &hIvasRend->hExternalOrientationData->Quaternion ); + + hIvasRend->hExternalOrientationData->enableHeadRotation = enableHeadRotation; + hIvasRend->hExternalOrientationData->enableExternalOrientation = enableExternalOrientation; + hIvasRend->hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation; + hIvasRend->hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4285,6 +4360,7 @@ ivas_error IVAS_REND_SetExternalOrientation( hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; #endif } +#endif } return IVAS_ERR_OK; @@ -4321,7 +4397,9 @@ ivas_error IVAS_REND_GetCombinedOrientation( IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ) { +#ifndef LIB_REND_API_5MS int16_t i; +#endif if ( hIvasRend == NULL || pOrientation == NULL ) { @@ -4330,6 +4408,9 @@ ivas_error IVAS_REND_GetCombinedOrientation( if ( hIvasRend->hCombinedOrientationData != NULL ) { +#ifdef LIB_REND_API_5MS + *pOrientation = hIvasRend->hCombinedOrientationData->Quaternion; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { #ifdef API_5MS @@ -4339,6 +4420,7 @@ ivas_error IVAS_REND_GetCombinedOrientation( pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternions[i]; #endif } +#endif } return IVAS_ERR_OK; @@ -4447,7 +4529,11 @@ static ivas_error rotateFrameMc( { int16_t i; int16_t j; +#ifdef LIB_REND_API_5MS + const float *crossfade; +#else int16_t subframe_idx, subframe_len; +#endif int16_t azimuth, elevation; int16_t is_planar_setup, lfe_idx; int16_t nchan; @@ -4462,6 +4548,21 @@ static ivas_error rotateFrameMc( push_wmops( "rotateFrameMc" ); +#ifdef LIB_REND_API_5MS + if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) + { + crossfade = headRotData->crossfade_20ms; + } + else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) + { + crossfade = headRotData->crossfade_5ms; + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); + } +#endif + if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK ) @@ -4486,10 +4587,13 @@ static ivas_error rotateFrameMc( gains[ch_in][ch_in] = 1.f; } +#ifndef LIB_REND_API_5MS + /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { +#endif for ( i = 0; i < 3; i++ ) { if ( hCombinedOrientationData != NULL ) @@ -4551,6 +4655,18 @@ static ivas_error rotateFrameMc( { for ( ch_in = 0; ch_in < nchan; ch_in++ ) { +#ifdef LIB_REND_API_5MS + writePtr = getSmplPtr( outAudio, ch_out, 0 ); + readPtr = getSmplPtr( inAudio, ch_in, 0 ); + /* crossfade with previous rotation gains */ + for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) + { + *writePtr++ += + ( *readPtr ) * ( ( 1 - crossfade[i] ) * gains_prev[ch_in][ch_out] ) + + ( *readPtr ) * ( crossfade[i] * gains[ch_in][ch_out] ); + readPtr++; + } +#else writePtr = getSmplPtr( outAudio, ch_out, subframe_idx * subframe_len ); readPtr = getSmplPtr( inAudio, ch_in, subframe_idx * subframe_len ); /* crossfade with previous rotation gains */ @@ -4561,6 +4677,7 @@ static ivas_error rotateFrameMc( ( *readPtr ) * ( headRotData->crossfade[i] * gains[ch_in][ch_out] ); readPtr++; } +#endif } } @@ -4569,7 +4686,9 @@ static ivas_error rotateFrameMc( { mvr2r( gains[i], gains_prev[i], nchan ); } +#ifndef LIB_REND_API_5MS } +#endif pop_wmops(); @@ -4588,7 +4707,11 @@ static ivas_error rotateFrameSba( int16_t i, l, n, m; int16_t m1, m2; int16_t shd_rot_max_order; +#ifdef LIB_REND_API_5MS + const float *crossfade; +#else int16_t subframe_idx, subframe_len; +#endif float *readPtr, *writePtr; rotation_matrix Rmat; float tmpRot[2 * HEADROT_ORDER + 1]; @@ -4597,15 +4720,33 @@ static ivas_error rotateFrameSba( push_wmops( "rotateFrameSba" ); +#ifdef LIB_REND_API_5MS + if ( inAudio.config.numSamplesPerChannel == L_FRAME48k ) + { + crossfade = headRotData->crossfade_20ms; + } + else if ( inAudio.config.numSamplesPerChannel == L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES ) + { + crossfade = headRotData->crossfade_5ms; + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Only 5 and 20 ms framing is supported" ); + } +#endif + if ( ( error = getAmbisonicsOrder( inConfig, &shd_rot_max_order ) ) != IVAS_ERR_OK ) { return error; } +#ifndef LIB_REND_API_5MS + /* TODO(sgi): @tmu please review changes in this function */ /* subframe loop */ subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) { +#endif /* initialize rotation matrices with zeros */ for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) { @@ -4637,7 +4778,11 @@ static ivas_error rotateFrameSba( /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( gains, Rmat, shd_rot_max_order ); +#ifdef LIB_REND_API_5MS + for ( i = 0; i < inAudio.config.numSamplesPerChannel; i++ ) +#else for ( i = 0; i < subframe_len; i++ ) +#endif { /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ /* apply each angular-momentum block individually to save complexity. */ @@ -4654,16 +4799,27 @@ static ivas_error rotateFrameSba( for ( m = m1; m < m2; m++ ) { +#ifdef LIB_REND_API_5MS + readPtr = getSmplPtr( inAudio, m, i ); + /* crossfade with previous rotation gains */ + tmpRot[n - m1] += crossfade[i] * gains[n][m] * ( *readPtr ) + + ( 1 - crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#else readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); /* crossfade with previous rotation gains */ tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#endif } } /* write back the result */ for ( n = m1; n < m2; n++ ) { +#ifdef LIB_REND_API_5MS + writePtr = getSmplPtr( outAudio, n, i ); +#else writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i ); +#endif ( *writePtr ) = tmpRot[n - m1]; } m1 = m2; @@ -4691,7 +4847,9 @@ static ivas_error rotateFrameSba( { mvr2r( gains[i], gains_prev[i], HEADROT_SHMAT_DIM ); } +#ifndef LIB_REND_API_5MS } +#endif pop_wmops(); @@ -4734,7 +4892,9 @@ static ivas_error renderIsmToBinauralRoom( { int16_t i; int16_t azi_rot, ele_rot; +#ifndef LIB_REND_API_5MS int16_t subframe_idx, subframe_len; +#endif int16_t tmp; rotation_matrix Rmat; float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4783,10 +4943,12 @@ static ivas_error renderIsmToBinauralRoom( if ( combinedOrientationEnabled ) { +#ifndef LIB_REND_API_5MS subframe_len = ismInput->base.inputBuffer.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; // for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) for ( subframe_idx = 0; subframe_idx < 1; subframe_idx++ ) { +#endif for ( i = 0; i < 3; i++ ) { #ifdef API_5MS @@ -4814,8 +4976,10 @@ static ivas_error renderIsmToBinauralRoom( Rmat[i][i] = 1.0f; } } +#ifndef LIB_REND_API_5MS } (void) subframe_len; // avoid warning +#endif } /* TODO tmu : see issue #518 */ @@ -6300,6 +6464,10 @@ static ivas_error renderActiveInputsMasa( if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && pCurrentInput->decDummy->hHeadTrackData != NULL ) { +#ifdef LIB_REND_API_5MS + pCurrentInput->decDummy->hHeadTrackData->Quaternion = hIvasRend->headRotData.headPosition; + pCurrentInput->decDummy->hHeadTrackData->Pos = hIvasRend->headRotData.Pos; +#else for ( sf_idx = 0; sf_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; ++sf_idx ) { #ifdef API_5MS @@ -6311,6 +6479,7 @@ static ivas_error renderActiveInputsMasa( pCurrentInput->decDummy->hHeadTrackData->Pos[sf_idx] = hIvasRend->headRotData.Pos[sf_idx]; #endif } +#endif } if ( ( error = renderInputMasa( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index d8d6127b20..701e0d5062 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -247,9 +247,21 @@ int16_t IVAS_REND_FeedRenderConfig( ivas_error IVAS_REND_SetHeadRotation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef LIB_REND_API_5MS + const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ + const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ +#else const IVAS_QUATERNION headRot[RENDERER_HEAD_POSITIONS_PER_FRAME], /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME] /* i : listener positions for next rendering call */ +#endif +); + +#ifdef LIB_REND_API_5MS +/* Head rotation becomes enabled by calling IVAS_REND_SetHeadRotation. Use this to disable. */ +ivas_error IVAS_REND_DisableHeadRotation( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ ); +#endif ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ @@ -280,10 +292,17 @@ ivas_error IVAS_REND_SetReferenceVector( ivas_error IVAS_REND_SetExternalOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ IVAS_QUATERNION *orientation, /* i : external orientation data */ +#ifdef LIB_REND_API_5MS + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ); ivas_error IVAS_REND_CombineHeadAndExternalOrientation( @@ -292,7 +311,7 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( ivas_error IVAS_REND_GetCombinedOrientation( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed orientation */ + IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation */ ); ivas_error IVAS_REND_GetMasaMetadata( -- GitLab From 2cc42c0ad07941392da5a305308df7f6d11c509f Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 09:48:27 +0200 Subject: [PATCH 0212/1418] Fix concurrent access to the same file from different test cases --- tests/renderer/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index ac5c57695a..ebad130ca2 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -142,6 +142,10 @@ def run_renderer( else: config_name = "" + if framing_5ms: + framing_name = "_5ms_framing" + else: + framing_name = "" if not isinstance(out_fmt, str): @@ -166,7 +170,7 @@ def run_renderer( out_file = str( output_path_base.joinpath( - f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{name_extension}.wav" + f"{in_name}_to_{out_name}{trj_name}{non_diegetic_pan}{refrot_name}{refvec_name}{refveclev_name}{config_name}{framing_name}{name_extension}.wav" ) ) -- GitLab From cc07d42d5bc298aaba4e866cea9acfcd65a7fb7e Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Jun 2023 10:53:07 +0300 Subject: [PATCH 0213/1418] Adjust max indices for OMASA at 96 kbps --- 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 cfc353c1c1..07060b6dd9 100755 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -888,7 +888,7 @@ int16_t get_ivas_max_num_indices_metadata( } else if ( ivas_total_brate <= IVAS_96k ) { - return 240 + 100; + return 240 + 150; } else if ( ivas_total_brate <= IVAS_128k ) { -- GitLab From bc55845248974ad25b0a883544d30849e1be61a7 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 09:53:42 +0200 Subject: [PATCH 0214/1418] Allow warnings in Visual Studio build jobs --- .gitlab-ci-custom.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 84aa4f65ba..f3453eedff 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -1078,6 +1078,8 @@ build-codec-debug-windows-vs2017: - $ENV:PATH - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee $BUILD_OUTPUT - python ci/check_for_warnings.py $BUILD_OUTPUT + allow_failure: + exit_codes: 123 build-codec-release-windows-vs2017: extends: @@ -1089,3 +1091,5 @@ build-codec-release-windows-vs2017: - $ENV:PATH - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee $BUILD_OUTPUT - python ci/check_for_warnings.py $BUILD_OUTPUT + allow_failure: + exit_codes: 123 \ No newline at end of file -- GitLab From 11685f61025044c7ba7f342c3a0a91dd545a782f Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 10:23:27 +0200 Subject: [PATCH 0215/1418] Fix stack-use-after-scope in rotateFrameMc --- lib_rend/lib_rend.c | 67 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6f6b32de1b..b0472c96fc 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -741,7 +741,11 @@ static ivas_error getNumNonLfeChannelsInSpeakerLayout( static ivas_error getMcConfigValues( IVAS_REND_AudioConfig inConfig, +#ifdef LIB_REND_API_5MS + const LSSETUP_CUSTOM_STRUCT *pInCustomLs, +#else LSSETUP_CUSTOM_STRUCT inCustomLs, +#endif const float **azimuth, const float **elevation, int16_t *lfe_idx, @@ -754,6 +758,22 @@ static ivas_error getMcConfigValues( switch ( inConfig ) { case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: +#ifdef LIB_REND_API_5MS + *azimuth = (const float *) &pInCustomLs->ls_azimuth; + *elevation = (const float *) &pInCustomLs->ls_elevation; + if ( pInCustomLs->num_lfe > 0 ) + { + *lfe_idx = pInCustomLs->lfe_idx[0]; + } + for ( i = 0; i < pInCustomLs->num_spk; i++ ) + { + if ( pInCustomLs->ls_elevation[i] != 0 ) + { + *is_planar = 0; + break; + } + } +#else *azimuth = (const float *) &inCustomLs.ls_azimuth; *elevation = (const float *) &inCustomLs.ls_elevation; if ( inCustomLs.num_lfe > 0 ) @@ -768,6 +788,7 @@ static ivas_error getMcConfigValues( break; } } +#endif break; case IVAS_REND_AUDIO_CONFIG_MONO: case IVAS_REND_AUDIO_CONFIG_STEREO: @@ -4517,9 +4538,13 @@ static void renderBufferChannel( } static ivas_error rotateFrameMc( - IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ - LSSETUP_CUSTOM_STRUCT inCustomLs, /* i : Input Custom LS setup */ + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ +#ifdef LIB_REND_API_5MS + const LSSETUP_CUSTOM_STRUCT *pInCustomLs, /* i : Input Custom LS setup */ +#else + LSSETUP_CUSTOM_STRUCT inCustomLs, /* i : Input Custom LS setup */ +#endif const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ @@ -4572,10 +4597,20 @@ static ivas_error rotateFrameMc( } else { +#ifdef LIB_REND_API_5MS + nchan = pInCustomLs->num_spk + pInCustomLs->num_lfe; +#else nchan = inCustomLs.num_spk + inCustomLs.num_lfe; +#endif } - if ( ( error = getMcConfigValues( inConfig, inCustomLs, &ls_azimuth, &ls_elevation, &lfe_idx, &is_planar_setup ) ) != IVAS_ERR_OK ) + if ( ( error = getMcConfigValues( inConfig, +#ifdef LIB_REND_API_5MS + pInCustomLs, +#else + inCustomLs, +#endif + &ls_azimuth, &ls_elevation, &lfe_idx, &is_planar_setup ) ) != IVAS_ERR_OK ) { return error; } @@ -5431,7 +5466,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, + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, +#ifdef LIB_REND_API_5MS + &mcInput->customLsInput, +#else + mcInput->customLsInput, +#endif + mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { @@ -5534,7 +5575,13 @@ static ivas_error renderMcToBinauralRoom( 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, + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, +#ifdef LIB_REND_API_5MS + &mcInput->customLsInput, +#else + mcInput->customLsInput, +#endif + mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { @@ -5626,7 +5673,13 @@ static ivas_error renderMcCustomLsToBinauralRoom( 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, + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, mcInput->base.inConfig, +#ifdef LIB_REND_API_5MS + &mcInput->customLsInput, +#else + mcInput->customLsInput, +#endif + mcInput->base.ctx.pHeadRotData, mcInput->base.ctx.pCombinedOrientationData, mcInput->rot_gains_prev, mcInput->efapInWrapper.hEfap, tmpRotBuffer ) ) != IVAS_ERR_OK ) { -- GitLab From 8895083f0953edb5c74481c8bd1f17b0cde75618 Mon Sep 17 00:00:00 2001 From: advasila Date: Fri, 16 Jun 2023 13:12:39 +0300 Subject: [PATCH 0216/1418] fixes 24.4 TD case --- lib_com/ivas_prot.h | 9 +++++++++ lib_com/ivas_stereo_td_bit_alloc.c | 9 ++++++++- lib_com/options.h | 1 + lib_dec/ivas_cpe_dec.c | 3 +++ lib_dec/ivas_stereo_td_dec.c | 9 ++++++++- lib_enc/ivas_cpe_enc.c | 3 +++ lib_enc/ivas_stereo_td_enc.c | 9 ++++++++- 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 487afa699e..11bbdf2616 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -1967,6 +1967,9 @@ void stereo_td_init_dec( void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i: ISM mode in combined format */ +#endif #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ @@ -2019,6 +2022,9 @@ void tdm_ol_pitch_comparison( void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i: ISM mode in combined format */ +#endif #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ @@ -2038,6 +2044,9 @@ ivas_error signaling_enc_secondary( void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i: ISM mode in combined format */ +#endif #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index a2bbd93997..dfd004ab9b 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -75,7 +75,10 @@ void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ + const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i: ISM mode in combined format */ +#endif #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ @@ -140,7 +143,11 @@ void tdm_bit_alloc( /* secondary channel bitrate allocation based on the energy scaling ratio */ #ifdef MASA_AND_OBJECTS +#ifdef FIX_OMASA_24_4k + if ( ( ( ivas_format != MASA_ISM_FORMAT || ism_mode == ISM_MODE_NONE ) && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && coder_type > UNVOICED ) ) +#else if ( ( ivas_format != MASA_ISM_FORMAT && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && coder_type > UNVOICED ) ) +#endif #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) #endif diff --git a/lib_com/options.h b/lib_com/options.h index 5719fe9db0..0bf36cfed3 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,6 +168,7 @@ #define FIX_OMASA_STEREO_SWITCHING /* VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps */ #define FIX_OMASA_BRSW /* Nokia + VA: Fix missing init of OMASA metadata delay buffers, brsw-related init fixes */ #define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix +#define FIX_OMASA_24_4k /* Nokia: fix OMASA in TD mode at 24.4k */ #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index d15eb5b6a1..c72b8564e1 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -439,6 +439,9 @@ ivas_error ivas_cpe_dec( tdm_configure_dec( #ifdef MASA_AND_OBJECTS st_ivas->ivas_format, +#ifdef FIX_OMASA_24_4k + st_ivas->ism_mode, +#endif #endif hCPE, &tdm_ratio_idx, nb_bits_metadata ); diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 1b90885b0f..424570ec50 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -86,6 +86,9 @@ void stereo_td_init_dec( void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i : ISM mode in combined format */ +#endif #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ @@ -308,7 +311,11 @@ void tdm_configure_dec( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( ivas_format, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + tdm_bit_alloc( ivas_format, +#ifdef FIX_OMASA_24_4k + ism_mode, +#endif + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 92ef3e3ba7..95cf49d570 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -615,6 +615,9 @@ ivas_error ivas_cpe_enc( tdm_configure_enc( #ifdef MASA_AND_OBJECTS ivas_format, +#ifdef FIX_OMASA_24_4k + st_ivas->ism_mode, +#endif #endif hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 7124bb7171..b01be07253 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -312,6 +312,9 @@ ivas_error stereo_set_tdm( void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ +#ifdef FIX_OMASA_24_4k + const int16_t ism_mode, /* i : ISM mode in combined format */ +#endif #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ @@ -492,7 +495,11 @@ void tdm_configure_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( ivas_format, hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + tdm_bit_alloc( ivas_format, +#ifdef FIX_OMASA_24_4k + ism_mode, +#endif + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); -- GitLab From e1b789c6e73fba9bf90378a5764d03652008cf87 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 16 Jun 2023 13:33:03 +0300 Subject: [PATCH 0217/1418] Apply clang format --- lib_com/ivas_stereo_td_bit_alloc.c | 4 ++-- lib_dec/ivas_stereo_td_dec.c | 8 ++++---- lib_enc/ivas_stereo_td_enc.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index dfd004ab9b..345fef4b3a 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -75,9 +75,9 @@ void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS - const int16_t ivas_format, /* i : IVAS format */ + const int16_t ivas_format, /* i : IVAS format */ #ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i: ISM mode in combined format */ + const int16_t ism_mode, /* i: ISM mode in combined format */ #endif #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index 424570ec50..e90baa0dd8 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -87,7 +87,7 @@ void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i : ISM mode in combined format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ @@ -313,9 +313,9 @@ void tdm_configure_dec( #ifdef MASA_AND_OBJECTS tdm_bit_alloc( ivas_format, #ifdef FIX_OMASA_24_4k - ism_mode, -#endif - hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, + ism_mode, +#endif + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, tdm_inst_ratio_idx ); diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index b01be07253..071ef6d361 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -313,7 +313,7 @@ void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ #ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i : ISM mode in combined format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ @@ -495,11 +495,11 @@ void tdm_configure_enc( *----------------------------------------------------------------*/ #ifdef MASA_AND_OBJECTS - tdm_bit_alloc( ivas_format, + tdm_bit_alloc( ivas_format, #ifdef FIX_OMASA_24_4k ism_mode, -#endif - hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, +#endif + hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, sts[0]->bwidth, sts[1]->bwidth, sts[0]->flag_ACELP16k, hStereoTD->tdm_LRTD_flag, mod_ct, hStereoTD->tdm_inst_ratio_idx ); -- GitLab From ae80a29f3fd9691895257d905c4227992898e1ec Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 16 Jun 2023 20:27:02 +0200 Subject: [PATCH 0218/1418] Add IVAS_rend_ref to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a2f6a6b95f..1829cde3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ scripts/testv/*_cut*.pcm # default reference binary name IVAS_cod_ref IVAS_dec_ref +IVAS_rend_ref # Python files that pop up when running scripts __pycache__/ -- GitLab From b7b09e85d6fc2fa437905c1bd92fee1b069f77a1 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Mon, 19 Jun 2023 09:56:03 +0200 Subject: [PATCH 0219/1418] Actually enable 5ms mode when flag is set --- apps/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index 9be54daca5..73125900c1 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2142,7 +2142,7 @@ static void parseOption( #ifdef LIB_REND_API_5MS case CmdLnOptionId_framing5ms: assert( numOptionValues == 0 ); - args->framing_5ms = false; + args->framing_5ms = true; break; #endif default: -- GitLab From 03cc1fe55b6ee8b09ed6feff6e7379696c79642c Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Mon, 19 Jun 2023 11:22:36 +0200 Subject: [PATCH 0220/1418] Fix rendering too many subframes in TD rend --- lib_dec/ivas_objectRenderer_internal.c | 7 ++++++- lib_rend/ivas_objectRenderer.c | 19 ++++++++++++++++++- lib_rend/ivas_prot_rend.h | 3 +++ lib_rend/lib_rend.c | 4 ++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 3802c4fc09..567a91f4fb 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -95,7 +95,12 @@ ivas_error ivas_td_binaural_renderer( ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL, #endif - ism_md_subframe_update, output, output_frame ); + ism_md_subframe_update, output, output_frame +#ifdef LIB_REND_API_5MS + , + MAX_PARAM_SPATIAL_SUBFRAMES +#endif + ); } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 9f39aa8b93..346dbc695c 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -266,6 +266,10 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t ism_md_subframe_update, /* i: Number of subframes to delay ism metadata to sync with audio */ float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ +#ifdef LIB_REND_API_5MS + , + const int16_t num_subframes /* i : number of subframes to render */ +#endif ) { int16_t subframe_length; @@ -281,7 +285,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( p_reverb_signal[ch] = reverb_signal[ch]; } +#ifdef LIB_REND_API_5MS + subframe_length = output_frame / num_subframes; +#else subframe_length = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#endif c_indx = 0; for ( nS = 0; nS < num_src; nS++ ) @@ -294,7 +302,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( } } +#ifdef LIB_REND_API_5MS + for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ ) +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) +#endif { if ( subframe_idx == ism_md_subframe_update ) { @@ -696,7 +708,12 @@ ivas_error ivas_td_binaural_renderer_ext( ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->Quaternions : NULL, ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->listenerPos : NULL, #endif - ism_md_subframe_update_ext, p_output, output_frame ) ) != IVAS_ERR_OK ) + ism_md_subframe_update_ext, p_output, output_frame +#ifdef LIB_REND_API_5MS + , + 1 +#endif + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 8d987a3f3c..d96f5228f2 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -234,6 +234,9 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t ism_md_subframe_update, float *output[], /* i/o: SCE channels / Binaural synthesis */ const int16_t output_frame /* i : output frame length */ +#ifdef LIB_REND_API_5MS + ,const int16_t num_subframes /* i : number of subframes to render */ +#endif ); ivas_error ivas_td_binaural_renderer_ext( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index b0472c96fc..158110012f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -56,7 +56,11 @@ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) /* Frame size required when rendering to binaural */ +#ifdef LIB_REND_API_5MS +#define BINAURAL_RENDERING_FRAME_SIZE_MS 5 +#else #define BINAURAL_RENDERING_FRAME_SIZE_MS 20 +#endif /*-------------------------------------------------------------------* -- GitLab From 7f6ff11363698bb30ed211641bcc4427f8036af3 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Mon, 19 Jun 2023 22:38:25 +0300 Subject: [PATCH 0221/1418] Disable switch ISM_FB until fixed. --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 17d991b02e..6c21f34ee5 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ #define FIX_522_ISM_FIRST_SID /* VA: fix ISM decoder crash if first received frame is an SID */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ -#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ +//#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ -- GitLab From 1a5757ea6813d98bc56276fcd797e854558b3f0e Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 20 Jun 2023 08:26:50 +0200 Subject: [PATCH 0222/1418] try to fix BE for the external orientation, did not succeed, seems to be a deeper problem. Make self test summary more verbous --- apps/decoder.c | 2 +- lib_rend/ivas_rotation.c | 4 ++++ scripts/self_test.py | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/decoder.c b/apps/decoder.c index 34527b8c82..2d33228a3b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1819,7 +1819,7 @@ static ivas_error decodeG192( } - if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation * vec_pos_len ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index efd281ce84..faee209b70 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -795,7 +795,11 @@ ivas_error ivas_combined_orientation_open( /* Initialization */ ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; +#ifdef API_5MS + ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; +#else ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; +#endif ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; diff --git a/scripts/self_test.py b/scripts/self_test.py index d7118832db..321f83419b 100755 --- a/scripts/self_test.py +++ b/scripts/self_test.py @@ -186,6 +186,13 @@ class SelfTest(IvasScriptsCommon.IvasScript): "--dectest", help="Test decoder binary (default:{})".format(default_dec_test), ) + self.parser.add_argument( + "--list_conditions", + "-l", + help="List all comditions in the parameter file", + action="store_true", + default=False, + ) if shutil.which("valgrind"): self.valgrind = [ "valgrind", @@ -858,6 +865,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): # add the detailed results for this condition self.fail_results["detailedResults"].append(result_str) + self.fail_results["failed_modes"].append(mode) self.logger.progress( "Comparing conditions: {}/{} ({} running), {} failed ".format( self.stat["num_tests_done"], @@ -1140,6 +1148,11 @@ class SelfTest(IvasScriptsCommon.IvasScript): self.parse_args() + if self.args["list_conditions"] is True: + run_dict = self.parse_self_test_prm(self.args["test_prm"]) + for mode in run_dict.keys(): + self.logger.console(f"- {run_dict[mode]['cmd']['table_name']}") + return # create/update test vectors (export from SVN server if not existing) svn_action = None if not os.path.exists(TESTV_DIR): @@ -1540,6 +1553,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): "corrupt_test_conditions": {"cnt": 0, "conditions": []}, "diff_nsamples_conditions": {"cnt": 0, "conditions": []}, "detailedResults": [], + "failed_modes":[], } self.run_pesq = self.args["pesq"] failed_ref_conditions = {} @@ -1948,6 +1962,15 @@ class SelfTest(IvasScriptsCommon.IvasScript): for l in r: self.logger.info(l) + self.logger.info("\n\n") + self.logger.info("Summary of all tests") + self.logger.info("---------------------\n") + for mode in run_dict.keys(): + if mode in self.fail_results["failed_modes"]: + self.logger.info(f"[FAIL] {run_dict[mode]['cmd']['table_name']}") + else: + self.logger.info(f"[OK] {run_dict[mode]['cmd']['table_name']}") + if __name__ == "__main__": if sys.version_info[0] < 3 or sys.version_info[1] < 7: -- GitLab From 5f0f350b3761ef3ab6b232506ae1c6b270a883b8 Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 20 Jun 2023 08:54:06 +0200 Subject: [PATCH 0223/1418] 5ms API Squashed commit of the following: commit a019f87f21a295491b97c43a1c3122339d07bb27 Merge: 1a5757ea daca8536 Author: Stefan Bayer Date: Tue Jun 20 08:39:14 2023 +0200 Merge remote-tracking branch 'remotes/origin/main' into b_20230601_API_5ms_rendering_bay commit 1a5757ea6813d98bc56276fcd797e854558b3f0e Author: Stefan Bayer Date: Tue Jun 20 08:26:50 2023 +0200 try to fix BE for the external orientation, did not succeed, seems to be a deeper problem. Make self test summary more verbous commit b61cb8986ce97d473c30c3ce8eb1bca94ffcf33a Author: Stefan Bayer Date: Thu Jun 15 16:12:09 2023 +0200 disable unused code commit de03fd1e6595cc31021a4988dc827a9210142ffe Author: Stefan Bayer Date: Thu Jun 15 15:41:27 2023 +0200 fix external orientation update rate commit d4c03c2e3af4ef2360acd80400b16df8b161476c Author: Stefan Bayer Date: Thu Jun 15 15:08:55 2023 +0200 make sure 7.1.4 br does not crash any longer, still ParamUpmix needs to be fully implemented in the JBM path commit f104d3bbe0976522dd25f4d1232248ec8f3a1f2d Author: Stefan Bayer Date: Thu Jun 15 14:30:43 2023 +0200 fix asan, put out at least zeroes for ParamUpmix in the JBM path commit 52b5489763af0a72c31f3febebe5dcc6d9dcad83 Author: Stefan Bayer Date: Thu Jun 15 13:55:13 2023 +0200 fix compiling issues with API_5MS inactive commit 8d73b36a1595651fbf1f967b8ea516103181b76b Author: Stefan Bayer Date: Thu Jun 15 13:06:03 2023 +0200 fix compiling, re-add all 5ms API stuff that got lost in the latest merge from main commit 612455369970bcf8fe4192aedd3efd85ade44308 Merge: fde3a293 96ad022e Author: Stefan Bayer Date: Thu Jun 15 08:38:42 2023 +0200 Merge remote-tracking branch 'remotes/origin/main' into b_20230601_API_5ms_rendering_bay commit fde3a29385ef0720a21fb9ba897eada28c736ca9 Author: Stefan Bayer Date: Thu Jun 15 08:07:25 2023 +0200 temp fix for orientation tracking init commit 3a9743d05de925224ac0cda0453434498fd5b263 Author: Stefan Bayer Date: Wed Jun 14 07:11:37 2023 +0200 5ms API first step, not completely BE yet --- apps/decoder.c | 862 ++++++++++++++++--- lib_com/ivas_error.h | 5 + lib_com/ivas_prot.h | 6 +- lib_com/options.h | 5 + lib_dec/ivas_binRenderer_internal.c | 30 +- lib_dec/ivas_dec.c | 2 + lib_dec/ivas_dirac_dec.c | 42 +- lib_dec/ivas_init_dec.c | 20 +- lib_dec/ivas_ism_dec.c | 5 +- lib_dec/ivas_ism_param_dec.c | 37 +- lib_dec/ivas_ism_renderer.c | 28 + lib_dec/ivas_jbm_dec.c | 78 ++ lib_dec/ivas_masa_dec.c | 6 + lib_dec/ivas_mc_param_dec.c | 27 +- lib_dec/ivas_mct_dec.c | 5 +- lib_dec/ivas_objectRenderer_internal.c | 15 +- lib_dec/ivas_sba_dec.c | 6 +- lib_dec/ivas_sba_rendering_internal.c | 7 + lib_dec/ivas_spar_decoder.c | 4 + lib_dec/ivas_stat_dec.h | 4 + lib_dec/jbm_jb4sb.h | 4 +- lib_dec/jbm_pcmdsp_fifo.c | 2 + lib_dec/jbm_pcmdsp_fifo.h | 4 +- lib_dec/lib_dec.c | 735 ++++++++++++++-- lib_dec/lib_dec.h | 64 +- lib_rend/ivas_crend.c | 14 + lib_rend/ivas_dirac_dec_binaural_functions.c | 16 + lib_rend/ivas_objectRenderer.c | 19 +- lib_rend/ivas_objectRenderer_hrFilt.c | 3 +- lib_rend/ivas_rotation.c | 307 ++++++- lib_rend/ivas_stat_rend.h | 32 +- lib_rend/lib_rend.c | 119 ++- scripts/self_test.py | 23 + 33 files changed, 2275 insertions(+), 261 deletions(-) mode change 100755 => 100644 lib_com/options.h diff --git a/apps/decoder.c b/apps/decoder.c index e210ebe95e..71a296ed00 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -84,6 +84,10 @@ static #define VARIABLE_SPEED_FETCH_FRAMESIZE_MS 20 #endif #define JBM_FRONTEND_FETCH_FRAMESIZE_MS 20 +#ifdef API_5MS +#define HEADROTATION_FETCH_FRAMESIZE_MS 5 +#define DEFAULT_FETCH_FRAMESIZE_MS 20 +#endif typedef struct { @@ -122,7 +126,9 @@ typedef struct bool renderConfigEnabled; char *renderConfigFilename; IVAS_DEC_COMPLEXITY_LEVEL complexityLevel; - +#ifdef API_5MS + bool tsmEnabled; +#endif #ifdef DEBUGGING IVAS_DEC_FORCED_REND_MODE forcedRendMode; #ifdef DEBUG_FOA_AGC @@ -132,7 +138,9 @@ typedef struct bool noBadFrameDelay; #endif #ifdef VARIABLE_SPEED_DECODING +#ifndef API_5MS bool variableSpeedMode; +#endif bool tsmScaleFileEnabled; char *tsmScaleFileName; uint16_t tsmScale; @@ -395,8 +403,11 @@ int main( /*------------------------------------------------------------------------------------------* * Configure the decoder *------------------------------------------------------------------------------------------*/ +#ifdef API_5MS + if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) +#else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) - +#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -408,16 +419,17 @@ int main( if ( arg.voipMode ) { -#ifdef VARIABLE_SPEED_DECODING - if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, IVAS_DEC_VOIP_MODE_VOIP, 100, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) -#else +#ifdef API_5MS if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, IVAS_DEC_VOIP_MODE_VOIP, 100, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING else if ( arg.variableSpeedMode ) { @@ -428,6 +440,7 @@ int main( } } #endif +#endif #ifdef DEBUGGING /*-----------------------------------------------------------------* @@ -461,7 +474,11 @@ int main( IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits ); #ifdef VARIABLE_SPEED_DECODING +#ifdef API_5MS + if ( arg.tsmEnabled ) +#else if ( arg.variableSpeedMode ) +#endif { if ( arg.tsmScaleFileEnabled ) { @@ -639,6 +656,7 @@ int main( { error = decodeVoIP( arg, hBsReader, hIvasDec ); } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING else if ( arg.variableSpeedMode ) { @@ -646,6 +664,7 @@ int main( externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec ); } +#endif #endif else { @@ -882,10 +901,14 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; arg->Opt_non_diegetic_pan = 0; arg->non_diegetic_pan_gain = 0.f; - +#ifdef API_5MS + arg->tsmEnabled = false; +#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING +#ifndef API_5MS arg->variableSpeedMode = false; +#endif arg->tsmScale = 100; arg->tsmScaleFileEnabled = false; arg->tsmScaleFileName = NULL; @@ -1034,7 +1057,11 @@ static bool parseCmdlIVAS_dec( { i++; int32_t tmp = 100; +#ifdef API_5MS + arg->tsmEnabled = true; +#else arg->variableSpeedMode = true; +#endif if ( i < argc - 3 ) { if ( !is_digits_only( argv[i] ) ) @@ -1609,7 +1636,7 @@ static ivas_error initOnFirstGoodFrame( * * Read G.192 bitstream and decode in regular decoder *---------------------------------------------------------------------*/ - +#ifdef API_5MS static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, @@ -1634,20 +1661,58 @@ static ivas_error decodeG192( int16_t numInitialBadFrames = 0; /* Number of bad frames received until first good frame is decoded */ int16_t nOutChannels = 0; int16_t delayNumSamples = -1; - int16_t delayNumSamples_orig[3]; /* stores: overall delay, dec+rend delay, and binauralization delay */ + int16_t delayNumSamples_orig[3]; int16_t nOutSamples = 0; int32_t delayTimeScale = 0; ivas_error error = IVAS_ERR_UNKNOWN; uint16_t numObj = 0; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; - IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - + uint16_t nSamplesAvailableNext; + bool needNewFrame; + int16_t nSamplesRendered, nSamplesRendered_loop, nSamplesToRender; +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + TsmScaleFileReader *tsmScaleFileReader = NULL; + int16_t scale; +#endif +#endif IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; + IVAS_VECTOR3 Pos; + int16_t vec_pos_update, vec_pos_len; + + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { ismWriters[i] = NULL; } + /* we always start with needing a new frame */ + needNewFrame = true; + +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + /*------------------------------------------------------------------------------------------* + * Open TSM scale file or set global TSM scale + *------------------------------------------------------------------------------------------*/ + + if ( arg.tsmEnabled ) + { + if ( arg.tsmScaleFileEnabled ) + { + if ( ( tsmScaleFileReader = TsmScaleFileReader_open( arg.tsmScaleFileName ) ) == NULL ) + { + fprintf( stderr, "\nError: Can't open TSM scale file %s \n\n", arg.tsmScaleFileName ); + goto cleanup; + } + } + else + { + IVAS_DEC_VoIP_SetScale( hIvasDec, arg.tsmScale, arg.tsmScale ); + } + } +#endif +#endif + if ( !arg.quietModeEnabled ) { fprintf( stdout, "\n------ Running the decoder ------\n\n" ); @@ -1664,7 +1729,19 @@ static ivas_error decodeG192( reset_stack(); reset_wmops(); #endif + nSamplesAvailableNext = 0; + vec_pos_update = 0; + if ( arg.enableHeadRotation ) + { + nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS ); + vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; + } + else + { + nOutSamples = (int16_t) ( arg.output_Fs / 1000 * DEFAULT_FETCH_FRAMESIZE_MS ); + vec_pos_len = 1; + } /*------------------------------------------------------------------------------------------* * Loop for every packet (frame) of bitstream data * - Read the bitstream packet @@ -1674,42 +1751,10 @@ static ivas_error decodeG192( while ( 1 ) { - /* Read next frame */ - if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) - { - if ( error == IVAS_ERR_END_OF_FILE ) - { - break; - } - fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); - goto cleanup; - } - -#ifdef DEBUGGING - /* Random FEC simulation */ - if ( arg.FER > 0.0f ) - { - float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; - if ( ftmp <= arg.FER / 100.0f * 65535.0f ) - { - bfi = 1; - } - else - { - bfi = 0; - } - } -#endif - - /* Feed into decoder */ - if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } + /* Read next frame if not enough samples availble */ /* reference vector */ - if ( arg.enableReferenceVectorTracking ) + if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) { IVAS_VECTOR3 listenerPosition, referencePosition; if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) @@ -1724,14 +1769,14 @@ static ivas_error decodeG192( goto cleanup; } } + /* Reference rotation */ - if ( arg.enableReferenceRotation ) + if ( arg.enableReferenceRotation && vec_pos_update == 0 ) { IVAS_QUATERNION quaternion; if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) { - fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( refRotReader ) ); + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); goto cleanup; } @@ -1741,22 +1786,20 @@ static ivas_error decodeG192( goto cleanup; } } + /* Head-tracking input simulation */ if ( arg.enableHeadRotation ) { - IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_QUATERNION Quaternion; - for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) { - if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( headRotReader ) ); - goto cleanup; - } + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; } - if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, Pos ) ) != IVAS_ERR_OK ) + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -1765,35 +1808,97 @@ static ivas_error decodeG192( if ( arg.enableExternalOrientation ) { - IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableHeadRotation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; - int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_QUATERNION Quaternion; + int8_t enableHeadRotation; + int8_t enableExternalOrientation; + int8_t enableRotationInterpolation; + int16_t numFramesToTargetOrientation; - for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) { + fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( externalOrientationFileReader ) ); + goto cleanup; + } - if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) + + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation * vec_pos_len ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* decode and get samples */ + nSamplesRendered = 0; + nSamplesToRender = nOutSamples; + do + { + if ( needNewFrame ) + { +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + if ( arg.tsmScaleFileEnabled ) { - fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), - RotationFileReader_getFilePath( externalOrientationFileReader ) ); + if ( ( error = TsmScaleFileReader_readScale( tsmScaleFileReader, &scale ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); + goto cleanup; + } + IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ); + } +#endif +#endif + + if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) + { + if ( error == IVAS_ERR_END_OF_FILE ) + { + break; + } + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); goto cleanup; } - } - if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) +#ifdef DEBUGGING + /* Random FEC simulation */ + if ( arg.FER > 0.0f ) + { + float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; + if ( ftmp <= arg.FER / 100.0f * 65535.0f ) + { + bfi = 1; + } + else + { + bfi = 0; + } + } +#endif + + /* Feed into decoder */ + if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nOutChannels * nSamplesRendered, &nSamplesRendered_loop, &needNewFrame ); + nSamplesRendered += nSamplesRendered_loop; + nSamplesToRender -= nSamplesRendered_loop; + if ( error != IVAS_ERR_OK ) { - fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %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 ) + + } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK ); + + if ( error == IVAS_ERR_END_OF_FILE ) { - fprintf( stderr, "\nError: could not get samples from decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; + break; } /* Continue checking for first good frame until it is found */ @@ -1851,7 +1956,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 ) @@ -1901,6 +2006,7 @@ static ivas_error decodeG192( } frame++; + vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; if ( !arg.quietModeEnabled ) { fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); @@ -1912,60 +2018,576 @@ static ivas_error decodeG192( #endif } #ifdef WMOPS - update_mem(); update_wmops(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); +#endif #endif } - /*------------------------------------------------------------------------------------------* - * Add zeros at the end to have equal length of synthesized signals - *------------------------------------------------------------------------------------------*/ - - memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); - - if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); - goto cleanup; - } /*------------------------------------------------------------------------------------------* - * Printouts after decoding has finished + * Flush what is still left in the VoIP Buffers.... *------------------------------------------------------------------------------------------*/ - if ( !arg.quietModeEnabled ) + while ( nSamplesAvailableNext > 0 ) { - printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + int16_t nSamplesFlushed; - 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 ); - 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 ); - } - } + /* Feed into decoder */ - /* Print output metadata file name(s) */ - if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) - { - if ( bsFormat == IVAS_DEC_BS_OBJ ) + /* reference vector */ + if ( arg.enableReferenceVectorTracking ) { - for ( i = 0; i < numObj; i++ ) + IVAS_VECTOR3 listenerPosition, referencePosition; + if ( ( error = Vector3PairFileReader_read( referenceVectorReader, &listenerPosition, &referencePosition ) ) != IVAS_ERR_OK ) { - fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + 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; } - fprintf( stdout, "\n" ); } - else if ( bsFormat == IVAS_DEC_BS_MASA ) + /* Reference rotation */ + if ( arg.enableReferenceRotation ) { - fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); - } - } - - /*------------------------------------------------------------------------------------------* - * Close files and deallocate resources - *------------------------------------------------------------------------------------------*/ + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( refRotReader ) ); + goto cleanup; + } - decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + if ( ( error = IVAS_DEC_FeedRefRotData( hIvasDec, quaternion ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedRefRotData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternion; + + + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /* decode and get samples */ + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* Write current frame */ + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + + /* Write ISm metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; +#ifdef FIX_470_MASA_JBM_EXT + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + + frame++; + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); +#ifdef DEBUGGING + if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) + { + fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); + } +#endif + } + } + + /*------------------------------------------------------------------------------------------* + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ + + if ( !arg.quietModeEnabled ) + { + printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + + 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 ); + 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 ); + } + } + + /* Print output metadata file name(s) */ + if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + for ( i = 0; i < numObj; i++ ) + { + fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + } + fprintf( stdout, "\n" ); + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + } + } + + /* add zeros at the end to have equal length of synthesized signals */ + memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } + + /*------------------------------------------------------------------------------------------* + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ + + decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ + +cleanup: + + AudioFileWriter_close( &afWriter ); + MasaFileWriter_close( &masaWriter ); +#ifdef DEBUGGING +#ifdef VARIABLE_SPEED_DECODING + TsmScaleFileReader_close( &tsmScaleFileReader ); +#endif +#endif + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ ) + { + IsmFileWriter_close( &ismWriters[i] ); + } + + if ( decodingFailed && error == IVAS_ERR_OK ) + { + return IVAS_ERR_UNKNOWN; + } + + return error; +} +#else +static ivas_error decodeG192( + DecArguments arg, + BS_READER_HANDLE hBsReader, + RotFileReader *headRotReader, + RotFileReader *externalOrientationFileReader, + RotFileReader *refRotReader, + Vector3PairFileReader *referenceVectorReader, + IVAS_DEC_HANDLE hIvasDec, + int16_t *pcmBuf ) + +{ + bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */ + uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8]; + int16_t i, num_bits; + int16_t bfi = 0; +#ifdef DEBUGGING + int16_t fec_seed = 12558; /* FEC_SEED */ +#endif + AudioFileWriter *afWriter = NULL; + MasaFileWriter *masaWriter = NULL; + bool decodedGoodFrame = false; + int16_t numInitialBadFrames = 0; /* Number of bad frames received until first good frame is decoded */ + int16_t nOutChannels = 0; + int16_t delayNumSamples = -1; + int16_t delayNumSamples_orig[3]; /* stores: overall delay, dec+rend delay, and binauralization delay */ + int16_t nOutSamples = 0; + int32_t delayTimeScale = 0; + ivas_error error = IVAS_ERR_UNKNOWN; + uint16_t numObj = 0; + IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; + IVAS_VECTOR3 Pos[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS]; + for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) + { + ismWriters[i] = NULL; + } + + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "\n------ Running the decoder ------\n\n" ); + fprintf( stdout, "Frames processed: " ); + } + else + { + fprintf( stdout, "\n-- Start the decoder (quiet mode) --\n\n" ); + } + + delayNumSamples_orig[0] = -1; + +#ifdef WMOPS + reset_stack(); + reset_wmops(); +#endif + + /*------------------------------------------------------------------------------------------* + * Loop for every packet (frame) of bitstream data + * - Read the bitstream packet + * - Run the decoder + * - Write the synthesized signal into output file + *------------------------------------------------------------------------------------------*/ + + while ( 1 ) + { + /* Read next frame */ + if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) + { + if ( error == IVAS_ERR_END_OF_FILE ) + { + break; + } + fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); + goto cleanup; + } + +#ifdef DEBUGGING + /* Random FEC simulation */ + if ( arg.FER > 0.0f ) + { + float ftmp = (float) app_own_random( &fec_seed ) + 32768.0f; + if ( ftmp <= arg.FER / 100.0f * 65535.0f ) + { + bfi = 1; + } + else + { + bfi = 0; + } + } +#endif + + /* Feed into decoder */ + if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* 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; + } + } + /* Reference rotation */ + if ( arg.enableReferenceRotation ) + { + IVAS_QUATERNION quaternion; + if ( ( error = HeadRotationFileReading( refRotReader, &quaternion, NULL ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading reference rotation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_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; + } + } + /* Head-tracking input simulation */ + if ( arg.enableHeadRotation ) + { + IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( headRotReader ) ); + goto cleanup; + } + } + + if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternions, Pos ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + if ( arg.enableExternalOrientation ) + { + IVAS_QUATERNION Quaternions[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableHeadRotation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; + + for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) + { + + if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + RotationFileReader_getFilePath( externalOrientationFileReader ) ); + goto cleanup; + } + } + + if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternions, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData 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 ) + { + fprintf( stderr, "\nError: could not get samples from decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + /* Continue checking for first good frame until it is found */ + if ( !decodedGoodFrame ) + { + if ( ( error = IVAS_DEC_HasDecodedFirstGoodFrame( hIvasDec, &decodedGoodFrame ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_HasDecodedFirstGoodFrame, code: %d\n", error ); + goto cleanup; + } + + /* Once good frame decoded, catch up */ + if ( decodedGoodFrame ) + { + error = initOnFirstGoodFrame( + hIvasDec, + arg, + numInitialBadFrames, + nOutSamples, + delayNumSamples_orig, + &delayNumSamples, + &delayTimeScale, + &bsFormat, + &afWriter, + &masaWriter, + ismWriters, + &nOutChannels, + &numObj ); + if ( error != IVAS_ERR_OK ) + { + goto cleanup; + } + } + else + { + ++numInitialBadFrames; + } + } + + /* Write current frame */ + if ( decodedGoodFrame ) + { + if ( delayNumSamples < nOutSamples ) + { + if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nOutput audio file writer error\n" ); + goto cleanup; + } + delayNumSamples = 0; + } + else + { + delayNumSamples -= nOutSamples; + } + } + + /* Write ISM metadata to external file(s) */ + if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + for ( i = 0; i < numObj; ++i ) + { + IVAS_ISM_METADATA IsmMetadata; + + if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) ); + goto cleanup; + } + } + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; +#ifdef FIX_470_MASA_JBM_EXT + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) +#else + if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta ) ) != IVAS_ERR_OK ) +#endif + { + fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + goto cleanup; + } + } + } + + frame++; + if ( !arg.quietModeEnabled ) + { + fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame ); +#ifdef DEBUGGING + if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) ) + { + fprintf( stdout, "\n Decoding error: BER detected in frame %d !!!!!\n", frame - 1 ); + } +#endif + } +#ifdef WMOPS + update_mem(); + update_wmops(); +#endif + } + + /*------------------------------------------------------------------------------------------* + * Add zeros at the end to have equal length of synthesized signals + *------------------------------------------------------------------------------------------*/ + + memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); + + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); + goto cleanup; + } + + /*------------------------------------------------------------------------------------------* + * Printouts after decoding has finished + *------------------------------------------------------------------------------------------*/ + + if ( !arg.quietModeEnabled ) + { + printf( "\n\nDecoder+renderer delay: %4.2f ms (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[1] / (float) delayTimeScale, delayNumSamples_orig[1], delayTimeScale ); + + 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 ); + 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 ); + } + } + + /* Print output metadata file name(s) */ + if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + { + if ( bsFormat == IVAS_DEC_BS_OBJ ) + { + for ( i = 0; i < numObj; i++ ) + { + fprintf( stdout, "\nOutput metadata file: %s", IsmFileWriter_getFilePath( ismWriters[i] ) ); + } + fprintf( stdout, "\n" ); + } + else if ( bsFormat == IVAS_DEC_BS_MASA ) + { + fprintf( stdout, "\nOutput metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); + } + } + + /*------------------------------------------------------------------------------------------* + * Close files and deallocate resources + *------------------------------------------------------------------------------------------*/ + + decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */ cleanup: @@ -1983,6 +2605,7 @@ cleanup: return error; } +#endif #ifdef DEBUGGING /*---------------------------------------------------------------------* @@ -2254,7 +2877,9 @@ static ivas_error decodeVoIP( while ( 1 ) { int16_t nOutSamples = 0; +#ifndef API_5MS uint16_t nSamplesAvailableNext = 0; +#endif #ifdef DEBUG_JBM_CMD_OPTION nOutSamples = (int16_t) ( arg.output_Fs / 1000 * arg.frontendFetchSizeMs ); #else @@ -2311,7 +2936,11 @@ static ivas_error decodeVoIP( /* decode and get samples */ - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms, &nSamplesAvailableNext + if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms +#ifndef API_5MS + , + &nSamplesAvailableNext +#endif #ifdef SUPPORT_JBM_TRACEFILE , writeJbmTraceFileFrameWrapper, @@ -2519,6 +3148,7 @@ cleanup: #ifdef DEBUGGING +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING /*---------------------------------------------------------------------* * decodeVariableSpeed() @@ -2720,7 +3350,11 @@ static ivas_error decodeVariableSpeed( fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename ); goto cleanup; } +#ifdef API_5MS + IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ); +#else IVAS_DEC_VoIP_SetScale( hIvasDec, scale ); +#endif } if ( ( error = BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) ) != IVAS_ERR_OK ) @@ -2980,7 +3614,7 @@ static ivas_error decodeVariableSpeed( } /* decode and get samples */ - if ( ( error = IVAS_DEC_VoIP_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesAvailableNext, &nSamplesFlushed ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3119,7 +3753,7 @@ cleanup: return error; } #endif - +#endif /*---------------------------------------------------------------------* * parseForcedRendModeDec() diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index c86d947125..251be0d38a 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -94,6 +94,11 @@ typedef enum #ifdef VARIABLE_SPEED_DECODING IVAS_ERR_VS_FRAME_NEEDED, #endif +#ifdef API_5MS + IVAS_ERR_TSM_NOT_ENABLED, + IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, + IVAS_ERR_NEED_NEW_FRAME, +#endif #endif /*----------------------------------------* diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index ba48326231..9d7e6b5806 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -311,10 +311,12 @@ void stereo_dmx_evs_close_encoder( STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS /* i/o: Stereo downmix for EVS encoder handle */ ); +#ifndef API_5MS ivas_error ivas_dec( Decoder_Struct *st_ivas, /* i : IVAS decoder structure */ int16_t *data /* o : output synthesis signal */ ); +#endif ivas_error ivas_dec_setup( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ @@ -5172,8 +5174,10 @@ void ivas_binaural_cldfb_sf( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle */ +#ifndef API_5MS int16_t subframe_idx, /* i : subframe index */ - const int16_t numTimeSlots, /* i : number of time slots to process */ +#endif + const int16_t numTimeSlots, /* i: : number of time slots to process */ float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ diff --git a/lib_com/options.h b/lib_com/options.h old mode 100755 new mode 100644 index 8a4dc67706..c6d3a9c108 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,11 @@ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ +#define FIX_XXX_JITTER_SBA_BINAURAL_GAIN +#define FIX_XXX_HEADTRACKER_INIT +#define FIX_XXX_TDOBJRENDERER_INPUT +#define FIX_XXX_ISM_SBA_ASAN +#define API_5MS /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 5bd09236e0..efc3b11215 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -994,7 +994,11 @@ void ivas_binaural_cldfb( } /* Implement binaural rendering */ +#ifdef API_5MS + ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#else ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, JBM_CLDFB_SLOTS_IN_SUBFRAME, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) @@ -1086,8 +1090,11 @@ void ivas_binaural_cldfb_sf( } /* Implement binaural rendering */ +#ifdef API_5MS + ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); +#else ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - +#endif /* Implement CLDFB synthesis */ for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { @@ -1122,7 +1129,9 @@ void ivas_binaural_cldfb_sf( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ +#ifndef API_5MS int16_t subframe_idx, /* i : subframe index */ +#endif const int16_t numTimeSlots, /* i : number of time slots to render */ float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ @@ -1146,25 +1155,40 @@ void ivas_binRenderer( } /* Head rotation in HOA3 or CICPx */ - if ( - hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb ) +#ifdef API_5MS + if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation && hBinRenderer->rotInCldfb ) +#else + if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb ) +#endif { if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { /* Rotation in SHD (HOA3) */ if ( hCombinedOrientationData->shd_rot_max_order == -1 ) { +#ifdef API_5MS + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); +#else rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); +#endif } else if ( hCombinedOrientationData->shd_rot_max_order > 0 ) { +#ifdef API_5MS + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); +#else rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order ); +#endif } } else { /* Rotation in SD (CICPx) */ +#ifdef API_5MS + rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); +#else rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band ); +#endif } } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 02c74efa37..1f588ac2cc 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -32,6 +32,7 @@ #include #include "options.h" +#ifndef API_5MS #include "cnst.h" #include "ivas_cnst.h" #include "rom_com.h" @@ -760,3 +761,4 @@ ivas_error ivas_dec( pop_wmops(); return error; } +#endif \ No newline at end of file diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index fc24c8bdef..f692ef1931 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1053,7 +1053,11 @@ ivas_error ivas_dirac_dec_config( /* allocate transport channels*/ if ( flag_config == DIRAC_OPEN ) { +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { if ( st_ivas->ivas_format == SBA_FORMAT ) { @@ -2261,12 +2265,12 @@ void ivas_dirac_dec( *------------------------------------------------------------------------*/ void ivas_dirac_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const int16_t nchan_transport, /* i : number of transport channels */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const int16_t nchan_transport, /* i : number of transport channels */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { int16_t slots_to_render, first_sf, last_sf, subframe_idx; @@ -2323,7 +2327,7 @@ void ivas_dirac_dec_render( } } - *nSamplesAvailable = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; return; } @@ -2447,9 +2451,17 @@ void ivas_dirac_dec_render_sf( set_zero( onset_filter_subframe, hDirAC->num_freq_bands ); } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] ) +#endif { +#ifdef API_5MS + p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[0][0]; +#else p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[subframe_idx][0][0]; +#endif if ( st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) { @@ -2513,7 +2525,11 @@ void ivas_dirac_dec_render_sf( set_zero( surCohRatio, hDirAC->num_freq_bands ); } } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 ) +#endif { ivas_dirac_dec_compute_directional_responses( hDirAC, st_ivas->hVBAPdata, @@ -2606,7 +2622,11 @@ void ivas_dirac_dec_render_sf( if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) +#endif { protoSignalComputation_shd( Cldfb_RealBuffer, Cldfb_ImagBuffer, hDirAC->h_output_synthesis_psd_state.proto_direct_buffer_f, @@ -2837,8 +2857,12 @@ void ivas_dirac_dec_render_sf( ivas_dirac_dec_compute_diffuse_proto( hDirAC, slot_idx ); } - /*Compute PSDs*/ +/*Compute PSDs*/ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 ) +#endif { ivas_dirac_dec_output_synthesis_process_slot( reference_power, p_onset_filter, @@ -2929,7 +2953,9 @@ void ivas_dirac_dec_render_sf( /* Perform binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, st_ivas->hCombinedOrientationData, +#ifndef API_5MS subframe_idx, +#endif hDirAC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 3c0370c880..f23bac7367 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -618,6 +618,12 @@ ivas_error ivas_init_decoder_front( { return error; } +#ifdef FIX_XXX_HEADTRACKER_INIT + if ( ( error = ivas_orient_trk_SetTrackingType( st_ivas->hHeadTrackData->OrientationTracker, st_ivas->hDecoderConfig->orientation_tracking ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif } /*-------------------------------------------------------------------* @@ -786,6 +792,7 @@ ivas_error ivas_init_decoder( } } +#ifndef FIX_XXX_HEADTRACKER_INIT /*-----------------------------------------------------------------* * Set head/orientation tracking *-----------------------------------------------------------------*/ @@ -797,7 +804,7 @@ ivas_error ivas_init_decoder( return error; } } - +#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ @@ -1289,7 +1296,9 @@ ivas_error ivas_init_decoder( } } +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1332,7 +1341,9 @@ ivas_error ivas_init_decoder( st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns; +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1436,8 +1447,11 @@ ivas_error ivas_init_decoder( /*-----------------------------------------------------------------* * Allocate and initialize JBM struct + buffer *-----------------------------------------------------------------*/ - +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active && st_ivas->hTcBuffer == NULL ) +#endif { /* no module has yet open the TC buffer, open a default one */ n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); @@ -1448,6 +1462,7 @@ ivas_error ivas_init_decoder( } } +#ifndef API_5MS if ( st_ivas->hTcBuffer == NULL ) { /* we need the handle anyway, but without the buffer*/ @@ -1456,6 +1471,7 @@ ivas_error ivas_init_decoder( return error; } } +#endif #ifdef FIX_470_MASA_JBM_EXT if ( st_ivas->hJbmMetadata == NULL ) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 6da3c05e75..64c00effb7 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -119,7 +119,9 @@ static ivas_error ivas_ism_bitrate_switching( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hDirAC != NULL && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) ) @@ -290,8 +292,9 @@ static ivas_error ivas_ism_bitrate_switching( /*-----------------------------------------------------------------* * Reconfigure TC buffer *-----------------------------------------------------------------*/ - +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 2497f5ab98..f73b40b666 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -516,7 +516,11 @@ ivas_error ivas_param_ism_dec_open( if ( !( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) { /* Initialize Param ISM Rendering handle */ +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) +#else if ( st_ivas->hDecoderConfig->voip_active ) +#endif { if ( ( error = ivas_param_ism_rendering_init( hDirAC->hParamIsmRendering, hOutSetup, st_ivas->nchan_transport, MAX_JBM_CLDFB_TIMESLOTS, output_config ) ) != IVAS_ERR_OK ) { @@ -568,7 +572,9 @@ ivas_error ivas_param_ism_dec_open( st_ivas->hDirAC = hDirAC; +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE ) { @@ -582,7 +588,31 @@ ivas_error ivas_param_ism_dec_open( } else { +#ifdef API_5MS + int16_t n_slots_to_alloc; + if ( st_ivas->hDecoderConfig->tsm_active == 1 ) + { + n_slots_to_alloc = MAX_JBM_CLDFB_TIMESLOTS; + } + else + { + n_slots_to_alloc = CLDFB_SLOTS_PER_SUBFRAME * MAX_PARAM_SPATIAL_SUBFRAMES; + } + if ( ( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); + } + set_zero( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc, n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands ); + + if ( ( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc = (float *) malloc( n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); + } + set_zero( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc, n_slots_to_alloc * nchan_transport * hDirAC->num_freq_bands ); +#else if ( ( hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hDirAC->num_freq_bands * sizeof( float ) ) ) == NULL ) + { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } @@ -593,6 +623,7 @@ ivas_error ivas_param_ism_dec_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM JBM Rendering handle\n" ) ); } set_zero( hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc, MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hDirAC->num_freq_bands ); +#endif } if ( st_ivas->hTcBuffer == NULL ) { @@ -616,11 +647,13 @@ ivas_error ivas_param_ism_dec_open( } } } +#ifndef API_5MS else { hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc = NULL; hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc = NULL; } +#endif pop_wmops(); return error; @@ -1362,7 +1395,7 @@ void ivas_param_ism_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ) { @@ -1444,7 +1477,7 @@ void ivas_param_ism_dec_render( } } - *nSamplesAvailable = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hDirAC->num_slots - hDirAC->slots_rendered ) * slot_size; return; } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 77563629ae..037f4a8b50 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -82,7 +82,11 @@ ivas_error ivas_ism_renderer_open( set_f( st_ivas->hIsmRendererData->gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); } +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) +#else if ( st_ivas->hDecoderConfig->voip_active ) +#endif { init_interpolator_length = NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_CLDFB_TIMESLOTS * CLDFB_SLOT_NS ); interpolator_length = (uint16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); @@ -155,9 +159,17 @@ void ivas_ism_render( else { /* Combined rotation: rotate the object positions depending the head and external orientations */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) +#endif { +#ifdef API_5MS + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat, st_ivas->hIntSetup.is_planar_setup ); +#else rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); +#endif } else { @@ -238,7 +250,11 @@ void ivas_ism_render_sf( set_f( output_f[i], 0.0f, n_samples_to_render ); } +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation ) +#else if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) +#endif { ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, @@ -250,9 +266,17 @@ void ivas_ism_render_sf( { /* Combined rotation: rotate the object positions depending the head and external orientations */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) +#endif { +#ifdef API_5MS + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat, st_ivas->hIntSetup.is_planar_setup ); +#else rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); +#endif if ( st_ivas->hEFAPdata != NULL ) { efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP ); @@ -281,7 +305,11 @@ void ivas_ism_render_sf( } /* update here only in case of head rotation */ +#ifdef API_5MS + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation == 1 ) +#else if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) +#endif { st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 858d78ab28..42c834c70f 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -476,6 +476,21 @@ ivas_error ivas_jbm_dec_tc( ivas_mono_stereo_downmix_mcmasa( st_ivas, output, output_frame ); } } +#ifdef API_5MS + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + + /* at least decode everything here, the rest is ToDo, for this we just output zeroes atm */ + ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); + + ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); + + if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } @@ -848,6 +863,18 @@ ivas_error ivas_jbm_dec_render( { ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); } +#ifdef API_5MS + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + /* zero output for now, not yet implemented... */ + int16_t ch; + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + for ( ch = 0; ch < nchan_out; ch++ ) + { + set_zero( p_output[ch], *nSamplesRendered ); + } + } +#endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { int16_t offset = st_ivas->hDirAC->slots_rendered * st_ivas->hDirAC->slot_size; @@ -1417,6 +1444,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } } } +#ifdef API_5MS + else if ( st_ivas->ivas_format == MONO_FORMAT && st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) + { + num_tc = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; + } +#endif return num_tc; } @@ -1570,9 +1603,26 @@ ivas_error ivas_jbm_dec_tc_buffer_open( } else { +#ifdef API_5MS + int16_t n_samp_full, n_samp_residual; +#else int16_t n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); int16_t n_samp_residual = hTcBuffer->n_samples_granularity - 1; +#endif int32_t offset; +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { + n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); + n_samp_residual = hTcBuffer->n_samples_granularity - 1; + } + else + { + n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + n_samp_residual = 0; + } +#endif + nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; @@ -1676,8 +1726,21 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure( /* realloc buffers */ free( hTcBuffer->tc_buffer ); +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { + n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); + n_samp_residual = hTcBuffer->n_samples_granularity - 1; + } + else + { + n_samp_full = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + n_samp_residual = 0; + } +#else n_samp_full = ( NS2SA( st_ivas->hDecoderConfig->output_Fs, MAX_JBM_L_FRAME_NS ) + hTcBuffer->n_samples_granularity - 1 ); n_samp_residual = hTcBuffer->n_samples_granularity - 1; +#endif nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; @@ -1859,9 +1922,24 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: +#ifdef API_5MS + buffer_mode = TC_BUFFER_MODE_RENDERER; + break; + case RENDERER_NON_DIEGETIC_DOWNMIX: + if ( st_ivas->ivas_format == MONO_FORMAT ) + { + buffer_mode = TC_BUFFER_MODE_BUFFER; + } + else + { + buffer_mode = TC_BUFFER_MODE_RENDERER; + } + break; +#else case RENDERER_NON_DIEGETIC_DOWNMIX: buffer_mode = TC_BUFFER_MODE_RENDERER; break; +#endif case RENDERER_MC_PARAMMC: if ( st_ivas->hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 0576fe8121..bc519c5766 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -384,7 +384,11 @@ ivas_error ivas_masa_dec_open( st_ivas->hMasa = hMasa; /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC ) +#endif { int16_t nchan_to_allocate; TC_BUFFER_MODE buffer_mode; @@ -1076,7 +1080,9 @@ ivas_error ivas_masa_dec_reconfigure( ivas_masa_set_elements( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp ); +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_transport; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 32fbf135ba..16159ad005 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -459,7 +459,11 @@ ivas_error ivas_param_mc_dec_open( ivas_param_mc_dec_init( hParamMC, nchan_transport, nchan_out_cov ); +#ifdef API_5MS + if ( hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) +#else if ( st_ivas->hDecoderConfig->voip_active && hParamMC->synthesis_conf != PARAM_MC_SYNTH_MONO_STEREO ) +#endif { if ( ( hParamMC->Cldfb_RealBuffer_tc = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * nchan_transport * hParamMC->num_freq_bands * sizeof( float ) ) ) == NULL ) { @@ -1537,11 +1541,11 @@ void ivas_param_mc_dec_digest_tc( *------------------------------------------------------------------------*/ void ivas_param_mc_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { PARAM_MC_DEC_HANDLE hParamMC; @@ -1751,7 +1755,10 @@ void ivas_param_mc_dec_render( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { ivas_binRenderer( st_ivas->hBinRenderer, - st_ivas->hCombinedOrientationData, subframe_idx, + st_ivas->hCombinedOrientationData, +#ifndef API_5MS + subframe_idx, +#endif hParamMC->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); } @@ -1807,7 +1814,7 @@ void ivas_param_mc_dec_render( param_mc_update_mixing_matrices( hParamMC, hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_transport, nchan_out_cov ); } hParamMC->subframes_rendered = last_sf; - *nSamplesAvailable = ( hParamMC->num_slots - hParamMC->slots_rendered ) * NS2SA( output_Fs, CLDFB_SLOT_NS ); + *nSamplesAvailableNext = ( hParamMC->num_slots - hParamMC->slots_rendered ) * NS2SA( output_Fs, CLDFB_SLOT_NS ); pop_wmops(); return; @@ -1828,7 +1835,7 @@ void ivas_param_mc_dec( PARAM_MC_DEC_HANDLE hParamMC; float Cldfb_RealBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - uint16_t nSamplesAsked, nSamplesAvailable, nSamplesRendered; + uint16_t nSamplesAsked, nSamplesAvailableNext, nSamplesRendered; hParamMC = st_ivas->hParamMC; assert( hParamMC ); @@ -1840,10 +1847,10 @@ void ivas_param_mc_dec( nSamplesAsked = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); ivas_param_mc_dec_digest_tc( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS, output_f ); - ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailable, output_f ); + ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailableNext, output_f ); #ifdef DEBUGGING assert( nSamplesRendered == nSamplesAsked ); - assert( nSamplesAvailable == 0 ); + assert( nSamplesAvailableNext == 0 ); #endif /* set handle pointers back to NULL */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 51d6856987..e52f30e9d0 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -726,7 +726,9 @@ static ivas_error ivas_mc_dec_reconfig( /* side effect of the renderer selection can be a changed internal config */ ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active ) +#endif { /* transfer subframe info from DirAC or ParamMC to central tc buffer */ if ( last_mc_mode == MC_MODE_PARAMMC ) @@ -1259,8 +1261,9 @@ static ivas_error ivas_mc_dec_reconfig( /*-----------------------------------------------------------------* * Reconfigure TC buffer *-----------------------------------------------------------------*/ - +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_full_new; DECODER_TC_BUFFER_HANDLE hTcBuffer; diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 3be8a2c62e..3802c4fc09 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -86,9 +86,15 @@ ivas_error ivas_td_binaural_renderer( st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, +#ifdef API_5MS + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->Quaternion : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos : NULL, +#else ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL, +#endif ism_md_subframe_update, output, output_frame ); } @@ -178,10 +184,17 @@ ivas_error ivas_td_binaural_renderer_sf( } /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, + ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation : 0, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->Quaternion : NULL, + ( st_ivas->hCombinedOrientationData != NULL ) ? &st_ivas->hCombinedOrientationData->listenerPos : NULL ); +#else TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] : 0, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL ); +#endif if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { @@ -192,7 +205,7 @@ ivas_error ivas_td_binaural_renderer_sf( } /* Render subframe */ - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm ) ) != IVAS_ERR_OK ) + if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 22258a9365..50bb1b3ddf 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -348,7 +348,9 @@ ivas_error ivas_sba_dec_reconfigure( * JBM TC buffer *-----------------------------------------------------------------*/ +#ifndef API_5MS if ( st_ivas->hDecoderConfig->voip_active == 1 ) +#endif { int16_t tc_nchan_to_allocate; int16_t tc_nchan_tc; @@ -472,7 +474,7 @@ void ivas_sba_dec_render( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ float *output_f[] /* o : rendered time signal */ ) { @@ -539,7 +541,7 @@ void ivas_sba_dec_render( } } - *nSamplesAvailable = ( hSpar->num_slots - hSpar->slots_rendered ) * slot_size; + *nSamplesAvailableNext = ( hSpar->num_slots - hSpar->slots_rendered ) * slot_size; return; } diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index 6f3dd13b7a..8e92a1f622 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -365,15 +365,22 @@ void ivas_ism2sba_sf( for ( j = 0; j < sba_num_chans; j++ ) { g2 = hIsmRendererData->interpolator + offset; +#ifndef FIX_XXX_ISM_SBA_ASAN g1 = 1 - *g2; +#endif tc = buffer_in[i] + offset; out = buffer_out[j]; gain = hIsmRendererData->gains[i][j]; prev_gain = hIsmRendererData->prev_gains[i][j]; for ( k = 0; k < n_samples_to_render; k++ ) { +#ifdef FIX_XXX_ISM_SBA_ASAN + g1 = 1.0f - *g2; +#endif *( out++ ) += ( ( *( g2++ ) ) * gain + g1 * prev_gain ) * ( *( tc++ ) ); +#ifndef FIX_XXX_ISM_SBA_ASAN g1 = 1.0f - *g2; +#endif } } } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 9d4d67393f..df60891a58 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -213,7 +213,11 @@ ivas_error ivas_spar_dec_open( } /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { int16_t nchan_to_allocate; int16_t nchan_tc; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 315cfbad66..941ff4e6d4 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1194,7 +1194,11 @@ typedef struct decoder_config_structure #ifdef DEBUGGING int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ #endif +#ifdef API_5MS + int16_t tsm_active; +#else int16_t voip_active; +#endif int16_t Opt_delay_comp; /* flag indicating delay compensation active */ } DECODER_CONFIG, *DECODER_CONFIG_HANDLE; diff --git a/lib_dec/jbm_jb4sb.h b/lib_dec/jbm_jb4sb.h index 00f5ccbb40..599730975d 100644 --- a/lib_dec/jbm_jb4sb.h +++ b/lib_dec/jbm_jb4sb.h @@ -77,13 +77,13 @@ struct JB4_DATAUNIT int16_t partialCopyOffset; int16_t nextCoderType; }; - +#ifndef API_5MS typedef enum { JBM_RENDERER_NONE, JBM_RENDERER_IVAS, } JBM_RENDERER_TYPE; - +#endif typedef struct JB4_DATAUNIT *JB4_DATAUNIT_HANDLE; diff --git a/lib_dec/jbm_pcmdsp_fifo.c b/lib_dec/jbm_pcmdsp_fifo.c index a3e8936464..d3c93679fe 100644 --- a/lib_dec/jbm_pcmdsp_fifo.c +++ b/lib_dec/jbm_pcmdsp_fifo.c @@ -38,6 +38,7 @@ #include #include "options.h" +#ifndef API_5MS #include "prot.h" #include "ivas_prot.h" #ifdef DEBUGGING @@ -267,3 +268,4 @@ uint16_t pcmdsp_fifo_nReadableSamplesPerChannel( { return h->size; } +#endif \ No newline at end of file diff --git a/lib_dec/jbm_pcmdsp_fifo.h b/lib_dec/jbm_pcmdsp_fifo.h index b601cc2e0e..62ebc15d08 100644 --- a/lib_dec/jbm_pcmdsp_fifo.h +++ b/lib_dec/jbm_pcmdsp_fifo.h @@ -41,7 +41,7 @@ #include #include "options.h" - +#ifndef API_5MS /** Ringbuffer (FIFO) with fixed capacity for audio samples. */ struct PCMDSP_FIFO @@ -81,5 +81,5 @@ int16_t pcmdsp_fifo_write_zero( PCMDSP_FIFO_HANDLE h, uint16_t nSamplesPerChanne int16_t pcmdsp_fifo_read( PCMDSP_FIFO_HANDLE h, uint16_t nSamplesPerChannel, uint8_t *samples ); uint16_t pcmdsp_fifo_nReadableSamplesPerChannel( const PCMDSP_FIFO_HANDLE h ); - +#endif #endif /* JBM_PCMDSP_FIFO_H */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5cc4bdd9b9..1e4dd48a60 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -53,11 +53,16 @@ struct IVAS_DEC_VOIP { uint16_t nSamplesFrame; /* Total number of samples in a frame (includes number of channels) */ JB4_HANDLE hJBM; +#ifndef API_5MS PCMDSP_APA_HANDLE hTimeScaler; +#endif uint16_t lastDecodedWasActive; - float *apaExecBuffer; /* Buffer for APA scaling */ +#ifndef API_5MS + float *apaExecBuffer; /* Buffer for APA scaling */ +#endif JB4_DATAUNIT_HANDLE hCurrentDataUnit; /* Points to the currently processed data unit */ uint16_t *bs_conversion_buf; /* Buffer for bitstream conversion from packed to serial */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING IVAS_DEC_VOIP_MODE voipMode; uint16_t speedFac; @@ -67,6 +72,7 @@ struct IVAS_DEC_VOIP PCMDSP_FIFO_HANDLE hFifoOut; uint8_t nTransportChannelsOld; uint16_t nSamplesAvailableNext; +#endif #ifdef SUPPORT_JBM_TRACEFILE IVAS_JBM_TRACE_DATA JbmTraceData; #endif @@ -84,8 +90,20 @@ struct IVAS_DEC bool hasDecodedFirstGoodFrame; /* False on init. Gets set to true after first good frame has been decoded -> all bitstream information is known from that point on */ bool isInitialized; - int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ - bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ + int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ + bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ +#ifdef API_5MS + bool Opt_TSM; /* flag indicating TSM mode*/ + int16_t tsm_scale; /* scale for TSM operation */ + int16_t tsm_max_scaling; + float *apaExecBuffer; /* Buffer for APA scaling */ + PCMDSP_APA_HANDLE hTimeScaler; + bool needNewFrame; + bool hasBeenFedFrame; + uint16_t nSamplesAvailableNext; + int16_t nSamplesRendered; + int16_t nTransportChannelsOld; +#endif int16_t amrwb_rfc4867_flag; /* MIME from rfc4867 is used */ int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ int16_t prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ @@ -105,8 +123,10 @@ static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSampl static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas ); +#ifndef API_5MS static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec ); -static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); +#endif +static ivas_error IVAS_DEC_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ); static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, int16_t *data ); static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples ); static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf ); @@ -143,6 +163,18 @@ ivas_error IVAS_DEC_Open( } hIvasDec = *phIvasDec; hIvasDec->hVoIP = NULL; +#ifdef API_5MS + hIvasDec->apaExecBuffer = NULL; + hIvasDec->hTimeScaler = NULL; + hIvasDec->Opt_TSM = false; + hIvasDec->tsm_scale = 100; + hIvasDec->needNewFrame = false; + hIvasDec->nTransportChannelsOld = 0; + hIvasDec->nSamplesAvailableNext = 0; + hIvasDec->nSamplesRendered = 0; + hIvasDec->nSamplesFrame = 0; + hIvasDec->hasBeenFedFrame = false; +#endif hIvasDec->hasBeenFedFirstGoodFrame = false; hIvasDec->hasDecodedFirstGoodFrame = false; hIvasDec->isInitialized = false; @@ -238,8 +270,11 @@ static void init_decoder_config( hDecoderConfig->orientation_tracking = HEAD_ORIENT_TRK_NONE; hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; - +#ifdef API_5MS + hDecoderConfig->tsm_active = 0; +#else hDecoderConfig->voip_active = 0; +#endif hDecoderConfig->Opt_delay_comp = 0; @@ -277,6 +312,14 @@ void IVAS_DEC_Close( ( *phIvasDec )->st_ivas = NULL; } +#ifdef API_5MS + apa_exit( &( *phIvasDec )->hTimeScaler ); + + if ( ( *phIvasDec )->apaExecBuffer != NULL ) + { + free( ( *phIvasDec )->apaExecBuffer ); + } +#endif free( *phIvasDec ); *phIvasDec = NULL; phIvasDec = NULL; @@ -404,9 +447,12 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const uint32_t sampleRate, /* i : output sampling frequency */ + const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ +#ifdef API_5MS + const int16_t tsmEnabled, /* i : enable TSM */ +#endif 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 */ @@ -483,6 +529,16 @@ ivas_error IVAS_DEC_Configure( hIvasDec->st_ivas->ivas_format = MONO_FORMAT; } +#ifdef API_5MS + hDecoderConfig->tsm_active = tsmEnabled; + hIvasDec->Opt_TSM = tsmEnabled; + hIvasDec->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + hIvasDec->nSamplesAvailableNext = 0; + hIvasDec->nSamplesRendered = 0; + hIvasDec->tsm_scale = 100; + hIvasDec->tsm_max_scaling = 100; +#endif + return error; } @@ -497,9 +553,11 @@ ivas_error IVAS_DEC_Configure( ivas_error IVAS_DEC_EnableVoIP( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING const IVAS_DEC_VOIP_MODE voipMode, /* i : VoIP or variable speed */ const uint16_t speedFac, /* i : speed factor for variable speed */ +#endif #endif const int16_t jbmSafetyMargin, /* i : allowed delay reserve for JBM, in milliseconds */ const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ @@ -519,7 +577,12 @@ ivas_error IVAS_DEC_EnableVoIP( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; hIvasDec->Opt_VOIP = 1; +#ifdef API_5MS + hIvasDec->Opt_TSM = 1; + hDecoderConfig->tsm_active = 1; +#else hDecoderConfig->voip_active = 1; +#endif if ( hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL ) { @@ -545,12 +608,15 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->lastDecodedWasActive = 0; hIvasDec->hVoIP->hCurrentDataUnit = NULL; +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING hIvasDec->hVoIP->voipMode = voipMode; hIvasDec->hVoIP->speedFac = speedFac; hIvasDec->hVoIP->needNewFrame = false; +#endif #endif hIvasDec->hVoIP->nSamplesFrame = (uint16_t) ( hDecoderConfig->output_Fs / FRAMES_PER_SEC ); +#ifndef API_5MS hIvasDec->hVoIP->nSamplesAvailableNext = 0; hIvasDec->hVoIP->rendererType = JBM_RENDERER_NONE; hIvasDec->hVoIP->hFifoOut = NULL; @@ -558,6 +624,7 @@ ivas_error IVAS_DEC_EnableVoIP( /* postpone init of the buffers until we know the real number of TCs*/ hIvasDec->hVoIP->apaExecBuffer = NULL; hIvasDec->hVoIP->nTransportChannelsOld = 0; +#endif #define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ @@ -570,10 +637,12 @@ ivas_error IVAS_DEC_EnableVoIP( } /* initialize JBM */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING hIvasDec->hVoIP->hJBM = NULL; if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VOIP ) { +#endif #endif if ( ( error = JB4_Create( &hIvasDec->hVoIP->hJBM ) != IVAS_ERR_OK ) != IVAS_ERR_OK ) { @@ -583,10 +652,13 @@ ivas_error IVAS_DEC_EnableVoIP( { return IVAS_ERR_FAILED_ALLOC; } +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING } #endif +#endif +#ifndef API_5MS /* postpone init of time scaler and output FIFO until we know the real number of TCs */ hIvasDec->hVoIP->hTimeScaler = NULL; #ifdef VARIABLE_SPEED_DECODING @@ -595,7 +667,7 @@ ivas_error IVAS_DEC_EnableVoIP( hIvasDec->hVoIP->needNewFrame = true; } #endif - +#endif return error; } @@ -639,9 +711,13 @@ ivas_error IVAS_DEC_FeedFrame_Serial( { hIvasDec->st_ivas->hDecoderConfig->ivas_total_brate = ACELP_8k00; } +#ifdef API_5MS + hIvasDec->isInitialized = true; +#endif } - +#ifndef API_5MS hIvasDec->isInitialized = true; +#endif } if ( !bfi ) /* TODO(mcjbm): Is this ok for bfi == 2 (partial frame)? Is there enough info to fully configure decoder? */ @@ -683,11 +759,18 @@ ivas_error IVAS_DEC_FeedFrame_Serial( st->use_partial_copy = 1; } +#ifdef API_5MS + hIvasDec->needNewFrame = false; + hIvasDec->hasBeenFedFrame = true; + hIvasDec->nSamplesRendered = 0; + hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; +#else #ifdef VARIABLE_SPEED_DECODING if ( hIvasDec->hVoIP != NULL && hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) { hIvasDec->hVoIP->needNewFrame = false; } +#endif #endif return error; @@ -699,7 +782,7 @@ ivas_error IVAS_DEC_FeedFrame_Serial( * * Main function to decode to PCM data *---------------------------------------------------------------------*/ - +#ifndef API_5MS ivas_error IVAS_DEC_GetSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ @@ -745,6 +828,136 @@ ivas_error IVAS_DEC_GetSamples( return error; } +#else +ivas_error IVAS_DEC_GetSamples( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t nSamplesAsked, /* i: number of samples wanted by the caller */ + 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 */ + int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ + bool *needNewFrame /* indication that the decoder needs a new frame */ +) +{ + Decoder_Struct *st_ivas; + ivas_error error; + int16_t nOutSamplesElse, result, nSamplesToRender; + uint16_t nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; + uint8_t nTransportChannels, nOutChannels; + error = IVAS_ERR_OK; + nSamplesRendered = 0; + nOutChannels = 0; + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + st_ivas = hIvasDec->st_ivas; + + if ( !hIvasDec->hasBeenFedFrame && hIvasDec->nSamplesAvailableNext == 0 ) + { + /* no frame was fed, do nothing but ask for a frame */ + *needNewFrame = true; + *nOutSamples = 0; + hIvasDec->needNewFrame = true; + return error; + } + + /* check if we are still at the beginning with bad frames, put out zeroes, keep track of subframes */ + if ( !hIvasDec->isInitialized && hIvasDec->st_ivas->bfi ) + { + hIvasDec->hasBeenFedFrame = false; + set_s( pcmBuf, 0, hIvasDec->st_ivas->hDecoderConfig->nchan_out * nSamplesAsked ); + hIvasDec->nSamplesRendered += nSamplesAsked; + *nOutSamples = nSamplesAsked; + hIvasDec->nSamplesAvailableNext -= nSamplesAsked; + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + hIvasDec->needNewFrame = true; + *needNewFrame = true; + } + } + else + { + /* check if we need to run the setup function, tc decoding and feeding the renderer */ + if ( !hIvasDec->isInitialized || hIvasDec->hasBeenFedFrame ) + { + int16_t nResidualSamples, nSamplesTcsScaled; + /* setup */ + if ( ( error = IVAS_DEC_Setup( hIvasDec, &l_ts, &nTransportChannels, &nOutChannels, &nSamplesRendered_loop, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + if ( nTransportChannels != hIvasDec->nTransportChannelsOld ) + { + IVAS_DEC_reconfigure( hIvasDec, nTransportChannels, l_ts ); + } + /* decode TCs only */ + if ( ( error = IVAS_DEC_GetTcSamples( hIvasDec, hIvasDec->apaExecBuffer, &nOutSamplesElse ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( hIvasDec->Opt_TSM ) + { + if ( apa_set_scale( hIvasDec->hTimeScaler, hIvasDec->tsm_scale ) != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + result = apa_exec( hIvasDec->hTimeScaler, hIvasDec->apaExecBuffer, hIvasDec->nSamplesFrame * nTransportChannels, (uint16_t) hIvasDec->tsm_max_scaling, hIvasDec->apaExecBuffer, &nTimeScalerOutSamples ); + if ( result != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + assert( nTimeScalerOutSamples <= APA_BUF ); + } + else + { + nTimeScalerOutSamples = hIvasDec->nSamplesFrame * nTransportChannels; + } + nSamplesTcsScaled = nTimeScalerOutSamples / nTransportChannels; + + /* render IVAS frames */ + + + if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + + if ( hIvasDec->Opt_TSM ) + { + /* feed residual samples to TSM for the next call */ + if ( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (uint16_t) nResidualSamples ) != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + } + hIvasDec->hasBeenFedFrame = false; + } + /* render IVAS frames directly to the output buffer */ + nSamplesToRender = nSamplesAsked - nSamplesRendered; + if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &hIvasDec->nSamplesAvailableNext, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + nSamplesToRender -= nSamplesRendered_loop; + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + *needNewFrame = true; + hIvasDec->needNewFrame = true; + } + else + { + *needNewFrame = false; + } + } + + *nOutSamples = nSamplesRendered; + + return error; +} +#endif /*---------------------------------------------------------------------* @@ -1144,15 +1357,26 @@ ivas_error IVAS_DEC_GetMasaMetadata( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedHeadTrackData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 Pos /* i : listener position */ +#else IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ IVAS_VECTOR3 *Pos /* i : listener position */ +#endif ) { HEAD_TRACK_DATA_HANDLE hHeadTrackData; +#ifndef API_5MS int16_t i; +#endif +#ifdef API_5MS + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) +#else if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || orientation == NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1165,6 +1389,18 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } /* Move head-tracking data to the decoder handle */ +#ifdef API_5MS + /* check for Euler angle signaling */ + if ( orientation.w == -3.0f ) + { + Euler2Quat( deg2rad( orientation.x ), deg2rad( orientation.y ), deg2rad( orientation.z ), &orientation ); + } + + ivas_orient_trk_Process( hHeadTrackData->OrientationTracker, orientation, FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES, &hHeadTrackData->Quaternion ); + hHeadTrackData->Pos.x = Pos.x; + hHeadTrackData->Pos.y = Pos.y; + hHeadTrackData->Pos.z = Pos.z; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { /* check for Euler angle signaling */ @@ -1180,6 +1416,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData( } hIvasDec->st_ivas->hHeadTrackData->num_quaternions = 0; +#endif return IVAS_ERR_OK; } @@ -1244,18 +1481,32 @@ ivas_error IVAS_DEC_FeedRefVectorData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedExternalOrientationData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : external orientation data */ + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else IVAS_QUATERNION *orientation, /* i : external orientation data */ int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ) { EXTERNAL_ORIENTATION_HANDLE hExternalOrientationData; +#ifndef API_5MS int16_t i; +#endif +#ifdef API_5MS + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) +#else if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || orientation == NULL ) +#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -1268,6 +1519,14 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( } /* Move external orientation data to the decoder handle (invert orientations) */ +#ifdef API_5MS + QuaternionInverse( orientation, &hExternalOrientationData->Quaternion ); + + hExternalOrientationData->enableHeadRotation = enableHeadRotation; + hExternalOrientationData->enableExternalOrientation = enableExternalOrientation; + hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation; + hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { QuaternionInverse( orientation[i], &hExternalOrientationData->Quaternions[i] ); @@ -1277,6 +1536,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData( hExternalOrientationData->enableRotationInterpolation[i] = enableRotationInterpolation[i]; hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; } +#endif return IVAS_ERR_OK; } @@ -1740,8 +2000,7 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( return IVAS_ERR_OK; } -#ifdef VARIABLE_SPEED_DECODING -#ifdef DEBUGGING +#if defined( VARIABLE_SPEED_DECODING ) || defined( API_5MS ) /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_SetScale( ) * @@ -1750,20 +2009,218 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( ivas_error IVAS_DEC_VoIP_SetScale( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const int16_t scale /* i : TSM scale to set */ +#ifdef API_5MS + const int16_t maxScaling, +#endif + const int16_t scale /* i : TSM scale to set */ ) { ivas_error error; error = IVAS_ERR_OK; +#ifdef API_5MS + if ( hIvasDec->Opt_TSM == false ) + { + return IVAS_ERR_TSM_NOT_ENABLED; + } + else + { + hIvasDec->tsm_scale = scale; + hIvasDec->tsm_max_scaling = maxScaling; + } +#else hIvasDec->hVoIP->speedFac = scale; +#endif return error; } #endif + + +#ifdef API_5MS +/*---------------------------------------------------------------------* + * IVAS_DEC_VoIP_GetSamples( ) + * + * Main function to decode one frame in VoIP + *---------------------------------------------------------------------*/ + +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 */ + 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 + , + JbmTraceFileWriterFn jbmWriterFn, + void *jbmWriter +#endif + +) +{ + Decoder_Struct *st_ivas; + DECODER_CONFIG_HANDLE hDecoderConfig; + IVAS_DEC_VOIP *hVoIP; + uint32_t extBufferedTime_ms, scale, maxScaling; +#ifndef API_5MS + uint16_t nTimeScalerOutSamples; +#endif + JB4_DATAUNIT_HANDLE dataUnit; +#ifndef API_5MS + int16_t nOutSamplesElse; +#endif + uint16_t extBufferedSamples; + int16_t timeScalingDone; + int16_t result; + ivas_error error; + int16_t nSamplesRendered; + uint16_t nSamplesTcsScaled; + uint8_t nTransportChannels; + uint8_t nOutChannels; + + error = IVAS_ERR_OK; + + st_ivas = hIvasDec->st_ivas; + hDecoderConfig = st_ivas->hDecoderConfig; + hVoIP = hIvasDec->hVoIP; + timeScalingDone = 0; + + nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; + nTransportChannels = 0; + nSamplesTcsScaled = hVoIP->nSamplesFrame; + nSamplesRendered = 0; + + if ( nSamplesPerChannel == 0 ) + { + return IVAS_ERR_WRONG_PARAMS; + } + + /* make sure that the FIFO after decoder/scaler contains at least one sound card frame (i.e. 20ms) */ + while ( nSamplesRendered < nSamplesPerChannel ) + { + if ( hIvasDec->nSamplesAvailableNext == 0 ) + { + int16_t nSamplesBuffered; + nSamplesBuffered = 0; + if ( hIvasDec->hasBeenFedFirstGoodFrame ) + { + IVAS_DEC_GetBufferedNumberOfSamples( hIvasDec, &nSamplesBuffered ); + } + extBufferedSamples = nSamplesRendered + nSamplesBuffered; + + extBufferedTime_ms = extBufferedSamples * 1000 / hDecoderConfig->output_Fs; + + dataUnit = NULL; + + + /* pop one access unit from the jitter buffer */ + result = JB4_PopDataUnit( hVoIP->hJBM, systemTimestamp_ms, extBufferedTime_ms, &dataUnit, &scale, &maxScaling ); + if ( result != 0 ) + { + return IVAS_ERR_UNKNOWN; + } + + + maxScaling = maxScaling * hDecoderConfig->output_Fs / 1000; + /* avoid time scaling multiple times in one sound card slot */ + if ( scale != 100U ) + { + if ( timeScalingDone ) + { + scale = 100; + } + else + { + timeScalingDone = 1; + } + } + + /* limit scale to range supported by time scaler */ + if ( scale < APA_MIN_SCALE ) + { + scale = APA_MIN_SCALE; + } + else if ( scale > APA_MAX_SCALE ) + { + scale = APA_MAX_SCALE; + } + + IVAS_DEC_VoIP_SetScale( hIvasDec, (int16_t) maxScaling, (int16_t) scale ); + + /* copy bitstream into decoder state */ + if ( dataUnit ) + { + hIvasDec->hVoIP->hCurrentDataUnit = dataUnit; + + bsCompactToSerial( dataUnit->data, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize ); + IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, dataUnit->dataSize, 0 ); + } + else if ( hIvasDec->hasDecodedFirstGoodFrame ) + { + /* Decoder has been initialized with first good frame - do PLC */ + IVAS_DEC_FeedFrame_Serial( hIvasDec, hIvasDec->hVoIP->bs_conversion_buf, 0, 1 ); + } + +#ifdef SUPPORT_JBM_TRACEFILE + /* jbmWriterFn and jbmWriter may be NULL if tracefile writing was not requested on CLI */ + if ( jbmWriterFn != NULL && jbmWriter != NULL ) + { + /* write JBM trace data entry */ + store_JbmData( hVoIP, dataUnit, systemTimestamp_ms, extBufferedSamples, hDecoderConfig->output_Fs ); + if ( ( jbmWriterFn( &hVoIP->JbmTraceData, jbmWriter ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError writing JBM Trace data to file\n" ); + return IVAS_ERR_UNKNOWN; + } + } #endif + if ( dataUnit ) + { + if ( dataUnit->partial_frame != 0 ) + { + hVoIP->lastDecodedWasActive = 1; + } + else + { + hVoIP->lastDecodedWasActive = !dataUnit->silenceIndicator; + } + /* data unit memory is no longer used */ + JB4_FreeDataUnit( hVoIP->hJBM, dataUnit ); + } + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + hIvasDec->nSamplesAvailableNext = hIvasDec->nSamplesFrame; + hIvasDec->nSamplesRendered = 0; + } + } + /* decode */ + if ( !hIvasDec->hasBeenFedFirstGoodFrame ) + { + /* codec mode to use not known yet - simply output silence */ + /* directly set output zero */ + int16_t nSamplesToZero = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); + set_s( pcmBuf + nSamplesRendered * nOutChannels, 0, nSamplesToZero * nOutChannels ); + nSamplesRendered += nSamplesToZero; + hIvasDec->nSamplesRendered += nSamplesToZero; + hIvasDec->nSamplesAvailableNext -= nSamplesToZero; + } + else + { + int16_t nSamplesToRender, nSamplesRendered_loop; + bool tmp; + nSamplesToRender = nSamplesPerChannel - nSamplesRendered; + /* render IVAS frames directly to the output buffer */ + if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, pcmBuf + nSamplesRendered * nOutChannels, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK ) + { + return error; + } + nSamplesRendered += nSamplesRendered_loop; + } + } + return error; +} +#else /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetSamples( ) * @@ -1969,7 +2426,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( nSamplesRendered += nSamplesRendered_loop; if ( nTransportChannels != hVoIP->nTransportChannelsOld ) { - IVAS_DEC_VoIP_reconfigure( hIvasDec, nTransportChannels, l_ts ); + IVAS_DEC_reconfigure( hIvasDec, nTransportChannels, l_ts ); } /* decode TCs only */ @@ -2149,6 +2606,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples( return error; } +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_Flush( ) @@ -2156,25 +2614,34 @@ ivas_error IVAS_DEC_VoIP_GetSamples( * Function to flush remaining audio in VoIP *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_Flush( +ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_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 */ - uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ - int16_t *nSamplesFlushed /* o : number of samples flushed */ +#ifndef API_5MS + uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#endif + int16_t *nSamplesFlushed /* o : number of samples flushed */ ) { ivas_error error; IVAS_DEC_VOIP *hVoIP; +#ifndef API_5MS int16_t rendererPcmBuf[( MAX_OUTPUT_CHANNELS * L_FRAME_MAX * APA_MAX_SCALE ) / 100]; +#endif uint16_t nSamplesToRender; uint16_t nSamplesFlushedLocal; error = IVAS_ERR_OK; hVoIP = hIvasDec->hVoIP; +#ifdef API_5MS + *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); +#else *nSamplesFlushed = min( nSamplesPerChannel, hVoIP->nSamplesAvailableNext ); +#endif +#ifndef API_5MS if ( hVoIP->rendererType == JBM_RENDERER_NONE ) { /* fetch a user-specified number of samples from FIFO */ @@ -2187,6 +2654,7 @@ ivas_error IVAS_DEC_VoIP_Flush( } else { + nSamplesToRender = (uint16_t) *nSamplesFlushed; /* render IVAS frames */ if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hVoIP->nSamplesAvailableNext, rendererPcmBuf ) ) != IVAS_ERR_OK ) @@ -2207,7 +2675,15 @@ ivas_error IVAS_DEC_VoIP_Flush( *nSamplesAvailableNext = hVoIP->nSamplesAvailableNext; *nSamplesFlushed = (int16_t) nSamplesFlushedLocal; } +#else + nSamplesToRender = (uint16_t) *nSamplesFlushed; + /* render IVAS frames */ + if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, pcmBuf ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif return error; } @@ -2222,7 +2698,11 @@ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked ) { +#ifdef API_5MS + return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); +#else return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->hVoIP->nSamplesAvailableNext < nSamplesAsked ) ); +#endif } @@ -2261,6 +2741,7 @@ static void IVAS_DEC_Close_VoIP( { JB4_Destroy( &hVoIP->hJBM ); +#ifndef API_5MS apa_exit( &hVoIP->hTimeScaler ); pcmdsp_fifo_destroy( &hVoIP->hFifoOut ); @@ -2269,7 +2750,7 @@ static void IVAS_DEC_Close_VoIP( { free( hVoIP->apaExecBuffer ); } - +#endif if ( hVoIP->bs_conversion_buf != NULL ) { #define WMC_TOOL_SKIP @@ -2598,15 +3079,23 @@ static ivas_error printConfigInfo_dec( } } +#ifdef API_5MS + /*-----------------------------------------------------------------* + * Print VoIP mode info + *-----------------------------------------------------------------*/ + if ( st_ivas->hDecoderConfig->tsm_active ) + { + fprintf( stdout, "TSM mode: ON\n" ); + } +#else /*-----------------------------------------------------------------* * Print VoIP mode info *-----------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->voip_active ) { fprintf( stdout, "VoIP mode: ON\n" ); } - +#endif return IVAS_ERR_OK; } @@ -3006,6 +3495,7 @@ static int16_t IVAS_DEC_VoIP_GetRenderGranularity( } +#ifndef API_5MS /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetRendererConfig() * @@ -3029,7 +3519,7 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( return rendererType; } - +#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_reconfigure() @@ -3037,64 +3527,103 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( * *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_reconfigure( +ivas_error IVAS_DEC_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts ) { IVAS_DEC_VOIP *hVoIP; +#ifdef API_5MS + int16_t apa_buffer_size; +#endif + ivas_error error; + hVoIP = hIvasDec->hVoIP; +#ifdef API_5MS + apa_buffer_size = hIvasDec->nSamplesFrame; +#endif +#ifdef API_5MS + if ( hIvasDec->apaExecBuffer == NULL ) +#else if ( hIvasDec->hVoIP->hTimeScaler == NULL ) +#endif { - +#ifndef API_5MS uint16_t wss, css; float startQuality; +#endif DECODER_CONFIG_HANDLE hDecoderConfig; +#ifdef API_5MS + if ( hIvasDec->Opt_TSM ) + { + uint16_t wss, css; + float startQuality; + + startQuality = 1.0f; + apa_buffer_size = APA_BUF_PER_CHANNEL; +#else #ifdef VARIABLE_SPEED_DECODING startQuality = hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ? -2.0f : 1.0f; #else startQuality = 1.0f; +#endif #endif - /* get current renderer type*/ - hVoIP->rendererType = IVAS_DEC_VoIP_GetRendererConfig( hIvasDec ); - hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; - if ( hDecoderConfig->output_Fs == 8000 ) - { - wss = 1; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 16000 ) - { - wss = 2; - css = 1; - } - else if ( hDecoderConfig->output_Fs == 32000 ) - { - wss = 4; - css = 2; - } - else if ( hDecoderConfig->output_Fs == 48000 ) - { - wss = 6; - css = 3; - } - else - { - return IVAS_ERR_INIT_ERROR; - } + /* get current renderer type*/ +#ifndef API_5MS + hVoIP->rendererType = IVAS_DEC_VoIP_GetRendererConfig( hIvasDec ); +#endif + hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; - if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); + if ( hDecoderConfig->output_Fs == 8000 ) + { + wss = 1; + css = 1; + } + else if ( hDecoderConfig->output_Fs == 16000 ) + { + wss = 2; + css = 1; + } + else if ( hDecoderConfig->output_Fs == 32000 ) + { + wss = 4; + css = 2; + } + else if ( hDecoderConfig->output_Fs == 48000 ) + { + wss = 6; + css = 3; + } + else + { + return IVAS_ERR_INIT_ERROR; + } +#ifndef API_5MS + if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif +#ifdef API_5MS + if ( apa_init( &hIvasDec->hTimeScaler, + nTransportChannels ) != IVAS_ERR_OK || + apa_set_rate( hIvasDec->hTimeScaler, hDecoderConfig->output_Fs ) != 0 || + apa_set_complexity_options( hIvasDec->hTimeScaler, wss, css ) != 0 || + apa_set_quality( hIvasDec->hTimeScaler, startQuality, 4, 4 ) != 0 || + apa_set_renderer_granularity( hIvasDec->hTimeScaler, l_ts ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } +#else if ( apa_init( &hIvasDec->hVoIP->hTimeScaler, nTransportChannels ) != IVAS_ERR_OK || apa_set_rate( hIvasDec->hVoIP->hTimeScaler, hDecoderConfig->output_Fs ) != 0 || @@ -3104,51 +3633,101 @@ ivas_error IVAS_DEC_VoIP_reconfigure( { return IVAS_ERR_INIT_ERROR; } +#endif - if ( hVoIP->hFifoOut == NULL && hVoIP->rendererType == JBM_RENDERER_NONE ) - { - /* we still need the FIFO out buffer */ - if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || - pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) +#ifndef API_5MS + if ( hVoIP->hFifoOut == NULL && hVoIP->rendererType == JBM_RENDERER_NONE ) { - return IVAS_ERR_INIT_ERROR; + /* we still need the FIFO out buffer */ + if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || + pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } } - } #ifdef VARIABLE_SPEED_DECODING - else if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) - { - if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || - pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + else if ( hIvasDec->hVoIP->voipMode == IVAS_DEC_VOIP_MODE_VARIABLE_SPEED ) { - return IVAS_ERR_INIT_ERROR; + if ( pcmdsp_fifo_create( &hIvasDec->hVoIP->hFifoOut ) != 0 || + pcmdsp_fifo_init( hIvasDec->hVoIP->hFifoOut, (uint16_t) ( hDecoderConfig->output_Fs * 4 / FRAMES_PER_SEC ) /* 4 frames */, hDecoderConfig->nchan_out, sizeof( int16_t ) ) != 0 ) + { + return IVAS_ERR_INIT_ERROR; + } } - } +#endif #endif - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) - { - if ( apa_set_evs_compat_mode( hIvasDec->hVoIP->hTimeScaler, true ) != 0 ) + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) { - return IVAS_ERR_INIT_ERROR; +#ifdef API_5MS + if ( apa_set_evs_compat_mode( hIvasDec->hTimeScaler, true ) != 0 ) +#else + if ( apa_set_evs_compat_mode( hIvasDec->hVoIP->hTimeScaler, true ) != 0 ) +#endif + { + return IVAS_ERR_INIT_ERROR; + } } +#ifdef API_5MS + } +#endif +#ifdef API_5MS + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); +#else + if ( ( hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) + + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } + + set_zero( hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif } else { - if ( apa_reconfigure( hVoIP->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#ifdef API_5MS + if ( hIvasDec->Opt_TSM ) { - return IVAS_ERR_INIT_ERROR; + if ( apa_reconfigure( hIvasDec->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#else + if ( apa_reconfigure( hVoIP->hTimeScaler, nTransportChannels, l_ts ) != 0 ) +#endif + { + return IVAS_ERR_INIT_ERROR; + } +#ifdef API_5MS + apa_buffer_size = APA_BUF_PER_CHANNEL; } - +#endif /* realloc apa_exe_buffer */ +#ifdef API_5MS + free( hIvasDec->apaExecBuffer ); + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); +#else free( hIvasDec->hVoIP->apaExecBuffer ); if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } set_zero( hIvasDec->hVoIP->apaExecBuffer, APA_BUF_PER_CHANNEL * nTransportChannels ); +#endif } + +#ifdef API_5MS + hIvasDec->nTransportChannelsOld = nTransportChannels; +#else hIvasDec->hVoIP->nTransportChannelsOld = (uint8_t) nTransportChannels; +#endif error = IVAS_ERR_OK; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index ebcdd099c8..7d2afa166e 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -84,7 +84,7 @@ typedef enum _IVAS_DEC_COMPLEXITY_LEVEL IVAS_DEC_COMPLEXITY_LEVEL_THREE = 3 } IVAS_DEC_COMPLEXITY_LEVEL; - +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING typedef enum { @@ -92,6 +92,7 @@ typedef enum IVAS_DEC_VOIP_MODE_VARIABLE_SPEED = 1 } IVAS_DEC_VOIP_MODE; #endif +#endif #ifdef DEBUGGING typedef enum _IVAS_DEC_FORCED_REND_MODE @@ -141,11 +142,14 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ +#ifdef API_5MS + const int16_t tsmEnabled, /* i : enable TSM */ +#endif 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 */ const int16_t enableExternalOrientation, /* i : enable external orientations */ - const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ + const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ @@ -169,9 +173,17 @@ ivas_error IVAS_DEC_FeedFrame_Serial( /*! r: decoder error code */ ivas_error IVAS_DEC_GetSamples( +#ifdef API_5MS + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t nSamplesAsked, /* i: number of samples wanted by the caller */ + 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 */ + int16_t *nOutSamples, /* o : number of samples per channel written to output buffer */ + bool *needNewFrame /* indication that the decoder needs a new frame */ +#else IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ 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 */ int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ +#endif ); /*! r: error code */ @@ -197,8 +209,13 @@ ivas_error IVAS_DEC_GetMasaMetadata( /*! r: error code */ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *orientation, /* i : head-tracking data */ - IVAS_VECTOR3 *Pos /* i : listener position */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 Pos /* i : listener position */ +#else + IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 *Pos /* i : listener position */ +#endif ); /*! r: error code */ @@ -216,11 +233,19 @@ ivas_error IVAS_DEC_FeedRefVectorData( /*! r: error code */ ivas_error IVAS_DEC_FeedExternalOrientationData( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ - int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ - int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ - int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ - int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#ifdef API_5MS + IVAS_QUATERNION orientation, /* i : external orientation data */ + int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#else + IVAS_QUATERNION *orientation, /* i : external orientation data */ + int8_t *enableHeadRotation, /* i : flag to enable head rotation for this frame */ + int8_t *enableExternalOrientation, /* i : flag to enable external orientation for this frame */ + int8_t *enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ + int16_t *numFramesToTargetOrientation /* i : number of frames until target orientation is reached */ +#endif ); /*! r: error code */ @@ -234,6 +259,13 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( const bool qBit /* i : Q bit for AMR-WB IO */ ); +#ifdef API_5MS +ivas_error IVAS_DEC_VoIP_SetScale( + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + const int16_t maxScaling, /* i : maximum allowed TSM scale */ + const int16_t scale /* i : TSM scale to set */ +); +#else #ifdef VARIABLE_SPEED_DECODING #ifdef DEBUGGING /*! r: error code */ @@ -243,25 +275,31 @@ ivas_error IVAS_DEC_VoIP_SetScale( ); #endif #endif +#endif /*! 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 */ 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 */ + const uint32_t systemTimestamp_ms /* i : current system timestamp */ +#ifndef API_5MS + , uint16_t *sampleAvailableNext /* o : samples available for the next call */ +#endif #ifdef SUPPORT_JBM_TRACEFILE , JbmTraceFileWriterFn jbmWriterFn, void* jbmWriter #endif ); -ivas_error IVAS_DEC_VoIP_Flush( +ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_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 */ - uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#ifndef API_5MS + uint16_t *nSamplesAvailableNext, /* o : number of samples still available */ +#endif int16_t *nSamplesFlushed /* o : number of samples flushed */ ); @@ -270,9 +308,11 @@ ivas_error IVAS_DEC_VoIP_Flush( /*! r: error code */ ivas_error IVAS_DEC_EnableVoIP( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ +#ifndef API_5MS #ifdef VARIABLE_SPEED_DECODING const IVAS_DEC_VOIP_MODE voipMode, /* i : VoIP or variable speed */ const uint16_t speedFac, /* i : speed factor for variable speed */ +#endif #endif const int16_t jbmSafetyMargin, /* i : allowed delay reserve for JBM, in milliseconds */ const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index b2b4887499..e5bdd05ed1 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1348,6 +1348,12 @@ ivas_error ivas_rend_crendProcess( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + if ( hCombinedOrientationData->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( hCombinedOrientationData->enableCombinedOrientation[subframe_idx] != 0 ) @@ -1356,6 +1362,7 @@ ivas_error ivas_rend_crendProcess( break; } } +#endif } push_wmops( "ivas_rend_crendProcess" ); @@ -1470,6 +1477,12 @@ ivas_error ivas_rend_crendProcessSubframe( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + if ( hCombinedOrientationData->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( hCombinedOrientationData->enableCombinedOrientation[subframe_idx] != 0 ) @@ -1478,6 +1491,7 @@ ivas_error ivas_rend_crendProcessSubframe( break; } } +#endif } push_wmops( "ivas_rend_crendProcessSubframe" ); diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 4616993f79..c9aaf13a49 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -235,7 +235,11 @@ ivas_error ivas_dirac_dec_init_binaural_data( st_ivas->hDiracDecBin = hBinaural; /* allocate transport channels*/ +#ifdef API_5MS + if ( st_ivas->hTcBuffer == NULL ) +#else if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) +#endif { int16_t nchan_to_allocate; @@ -672,7 +676,11 @@ static void ivas_dirac_dec_binaural_internal( { for ( j = 0; j < 3; j++ ) { +#ifdef API_5MS + Rmat[i][j] = hCombinedOrientationData->Rmat[i][j]; +#else Rmat[i][j] = hCombinedOrientationData->Rmat[subframe][i][j]; +#endif } } @@ -685,7 +693,11 @@ static void ivas_dirac_dec_binaural_internal( } ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matrices( st_ivas, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, Rmat, subframe, +#ifdef API_5MS + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation > 0 ); +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); +#endif if ( st_ivas->ivas_format == ISM_FORMAT ) { @@ -701,7 +713,11 @@ static void ivas_dirac_dec_binaural_internal( } ivas_dirac_dec_binaural_determine_processing_matrices( st_ivas, max_band_decorr, Rmat, +#ifdef API_5MS + hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation > 0 ); +#else hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0 ); +#endif ivas_dirac_dec_binaural_process_output( st_ivas, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, subframe ); st_ivas->hDirAC->hDiffuseDist = NULL; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2ba225b2f1..ddd75c28d1 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -301,8 +301,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( TDREND_Update_object_positions( hBinRendererTd, num_src, ivas_format, hIsmMetaData ); } /* Update the listener's location/orientation */ +#ifdef API_5MS + TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? *enableCombinedOrientation : 0, ( Quaternions != NULL ) ? Quaternions : NULL, ( Pos != NULL ) ? Pos : NULL ); +#else TDREND_Update_listener_orientation( hBinRendererTd, ( enableCombinedOrientation != NULL ) ? enableCombinedOrientation[subframe_idx] : 0, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); - +#endif if ( hReverb != NULL ) { if ( ( error = ivas_reverb_process( hReverb, transport_config, 0, output, p_reverb_signal, subframe_idx ) ) != IVAS_ERR_OK ) @@ -393,9 +396,17 @@ ivas_error TDREND_GetMix( { pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; pan_right = 1.f - pan_left; +#ifdef FIX_XXX_TDOBJRENDERER_INPUT + v_multc_acc( Src_p->InputFrame_p, pan_left, output_buf[0], subframe_length ); + v_multc_acc( Src_p->InputFrame_p, pan_right, output_buf[1], subframe_length ); +#else v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_left, output_buf[0], subframe_length ); v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length ); +#endif } +#ifdef FIX_XXX_TDOBJRENDERER_INPUT + Src_p->InputFrame_p += subframe_length; +#endif } /* Populate output variable */ @@ -675,9 +686,15 @@ ivas_error ivas_td_binaural_renderer_ext( } if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, +#ifdef API_5MS + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->enableCombinedOrientation : NULL, + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->Quaternion : NULL, + ( hCombinedOrientationData != NULL ) ? &( *hCombinedOrientationData )->listenerPos : NULL, +#else ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->enableCombinedOrientation : NULL, ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->Quaternions : NULL, ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->listenerPos : NULL, +#endif ism_md_subframe_update_ext, p_output, output_frame ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6463261ec4..084da6550c 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -79,8 +79,9 @@ ivas_error TDREND_REND_RenderSourceHRFilt( v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); +#ifndef FIX_XXX_TDOBJRENDERER_INPUT Src_p->InputFrame_p += subframe_length; /* Increment input pointer */ - +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 2cd2744b5a..0c4114ce2a 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -48,10 +48,15 @@ * Local funtion declarations *-----------------------------------------------------------------------*/ +#ifdef API_5MS +static ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, IVAS_VECTOR3 *listenerPos, EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); + +static void external_target_interpolation( EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); +#else static ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, IVAS_VECTOR3 *listenerPos, int16_t numHeadRotQuaternions, EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); static void external_target_interpolation( EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const int16_t i ); - +#endif static bool are_orientations_same( const IVAS_QUATERNION *orientation1, const IVAS_QUATERNION *orientation2 ); @@ -75,7 +80,9 @@ ivas_error ivas_headTrack_open( } /* Initialization */ +#ifndef API_5MS ( *hHeadTrackData )->num_quaternions = 0; +#endif ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f; ( *hHeadTrackData )->lrSwitchedCurrent = 0; ( *hHeadTrackData )->lrSwitchedNext = 0; @@ -295,7 +302,11 @@ void rotateFrame_shd( /* calculate ambisonics rotation matrices for the previous and current frames */ SHrotmatgen( SHrotmat_prev, hCombinedOrientationData->Rmat_prev, shd_rot_max_order ); +#ifdef API_5MS + SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat, shd_rot_max_order ); +#else SHrotmatgen( SHrotmat, hCombinedOrientationData->Rmat[subframe_idx], shd_rot_max_order ); +#endif for ( i = 0; i < subframe_len; i++ ) { @@ -347,7 +358,11 @@ void rotateFrame_shd( /* move Rmat to Rmat_prev */ for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + mvr2r( hCombinedOrientationData->Rmat[i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#else mvr2r( hCombinedOrientationData->Rmat[subframe_idx][i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#endif } return; @@ -435,7 +450,11 @@ void rotateFrame_sd( /* gains for current subframe rotation */ +#ifdef API_5MS + rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat, hTransSetup.is_planar_setup ); +#else rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hCombinedOrientationData->Rmat[subframe_idx], hTransSetup.is_planar_setup ); +#endif if ( hEFAPdata != NULL && ( hTransSetup.ls_azimuth[ch_in_woLFE] != azimuth || hTransSetup.ls_elevation[ch_in_woLFE] != elevation ) ) { efap_determine_gains( hEFAPdata, tmp_gains, azimuth, elevation, EFAP_MODE_EFAP ); @@ -472,7 +491,11 @@ void rotateFrame_sd( /* move Rmat to Rmat_prev */ for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + mvr2r( hCombinedOrientationData->Rmat[i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#else mvr2r( hCombinedOrientationData->Rmat[subframe_idx][i], hCombinedOrientationData->Rmat_prev[i], 3 ); +#endif } /* copy to output */ @@ -701,7 +724,9 @@ ivas_error ivas_external_orientation_open( EXTERNAL_ORIENTATION_HANDLE *hExtOrientationData /* o : external orientation handle */ ) { +#ifndef API_5MS int16_t i; +#endif IVAS_QUATERNION identity; identity.w = 1.0f; @@ -714,6 +739,13 @@ ivas_error ivas_external_orientation_open( } /* Enable head rotation and disable external orientation as default */ +#ifdef API_5MS + ( *hExtOrientationData )->enableHeadRotation = 1; + ( *hExtOrientationData )->enableExternalOrientation = 0; + ( *hExtOrientationData )->enableRotationInterpolation = 0; + ( *hExtOrientationData )->numFramesToTargetOrientation = 0; + ( *hExtOrientationData )->Quaternion = identity; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { ( *hExtOrientationData )->enableHeadRotation[i] = 1; @@ -722,7 +754,7 @@ ivas_error ivas_external_orientation_open( ( *hExtOrientationData )->numFramesToTargetOrientation[i] = 0; ( *hExtOrientationData )->Quaternions[i] = identity; } - +#endif return IVAS_ERR_OK; } @@ -759,7 +791,10 @@ ivas_error ivas_combined_orientation_open( COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData /* o : combined orientation handle */ ) { - int16_t i, j; +#ifndef API_5MS + int16_t i; +#endif + int16_t j; IVAS_QUATERNION identity; IVAS_VECTOR3 origo; @@ -776,7 +811,11 @@ ivas_error ivas_combined_orientation_open( /* Initialization */ ( *hCombinedOrientationData )->interpolationCoefficient = 1.0f; ( *hCombinedOrientationData )->interpolationIncrement = 1.0f; +#ifdef API_5MS + ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 2000; +#else ( *hCombinedOrientationData )->maximumFramesToTargetOrientation = 500; +#endif ( *hCombinedOrientationData )->lrSwitchedNext = 0; ( *hCombinedOrientationData )->lrSwitchedCurrent = 0; ( *hCombinedOrientationData )->lrSwitchInterpVal = 0.0f; @@ -784,6 +823,19 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->Quaternions_ext_interpolation_start = identity; ( *hCombinedOrientationData )->Quaternions_ext_interpolation_target = identity; +#ifdef API_5MS + ( *hCombinedOrientationData )->enableCombinedOrientation = 0; + ( *hCombinedOrientationData )->Quaternion = identity; + ( *hCombinedOrientationData )->Quaternion_prev_headRot = identity; + ( *hCombinedOrientationData )->Quaternion_prev_extOrientation = identity; + ( *hCombinedOrientationData )->listenerPos = origo; + + for ( j = 0; j < 3; j++ ) + { + set_zero( ( *hCombinedOrientationData )->Rmat[j], 3 ); + ( *hCombinedOrientationData )->Rmat[j][j] = 1.0f; + } +#else /* Initialise orientations to identity */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { @@ -799,7 +851,7 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->Rmat[i][j][j] = 1.0f; } } - +#endif for ( j = 0; j < 3; j++ ) { set_zero( ( *hCombinedOrientationData )->Rmat_prev[j], 3 ); @@ -851,19 +903,29 @@ ivas_error combine_external_and_head_orientations_dec( { IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; +#ifndef API_5MS int16_t numHeadRotQuaternions = 0; +#endif if ( hHeadTrackData != NULL ) { +#ifdef API_5MS + headRotQuaternions = &hHeadTrackData->Quaternion; + listenerPos = &hHeadTrackData->Pos; +#else numHeadRotQuaternions = hHeadTrackData->num_quaternions; if ( hHeadTrackData->num_quaternions >= 0 ) { headRotQuaternions = hHeadTrackData->Quaternions; listenerPos = hHeadTrackData->Pos; } +#endif } - +#ifdef API_5MS + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); +#endif } @@ -881,8 +943,10 @@ ivas_error combine_external_and_head_orientations_rend( { IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; +#ifndef API_5MS int16_t numHeadRotQuaternions = 0; int16_t i; +#endif if ( hHeadTrackData != NULL ) { @@ -895,6 +959,13 @@ ivas_error combine_external_and_head_orientations_rend( else if ( hExtOrientationData != NULL ) { /* Head rotation data not available, use the freezed value or disable */ +#ifdef API_5MS + if ( hExtOrientationData->enableHeadRotation != 2 ) + { + hExtOrientationData->enableHeadRotation = 0; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableHeadRotation[i] != 2 ) @@ -902,9 +973,13 @@ ivas_error combine_external_and_head_orientations_rend( hExtOrientationData->enableHeadRotation[i] = 0; } } +#endif } - +#ifdef API_5MS + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, hExtOrientationData, hCombinedOrientationData ); +#else return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); +#endif } @@ -915,15 +990,20 @@ ivas_error combine_external_and_head_orientations_rend( * NOTE that the external orientations are inversed. *------------------------------------------------------------------------*/ -static ivas_error combine_external_and_head_orientations( - IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ - IVAS_VECTOR3 *listenerPos, /* i : listener position */ - int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ - EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ +ivas_error combine_external_and_head_orientations( + IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ + IVAS_VECTOR3 *listenerPos, /* i : listener position */ +#ifndef API_5MS + int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ +#endif + EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { - int16_t i, j; +#ifndef API_5MS + int16_t i; +#endif + int16_t j; IVAS_QUATERNION identity; IVAS_VECTOR3 origo; @@ -951,6 +1031,18 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->interpolationIncrement = 1.0f; hCombinedOrientationData->Quaternions_ext_interpolation_start = identity; hCombinedOrientationData->Quaternions_ext_interpolation_target = identity; +#ifdef API_5MS + + hCombinedOrientationData->enableCombinedOrientation = 0; + hCombinedOrientationData->Quaternion = identity; + hCombinedOrientationData->listenerPos = origo; + + for ( j = 0; j < 3; j++ ) + { + set_zero( hCombinedOrientationData->Rmat[j], 3 ); + hCombinedOrientationData->Rmat[j][j] = 1.0f; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hCombinedOrientationData->enableCombinedOrientation[i] = 0; @@ -963,10 +1055,15 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Rmat[i][j][j] = 1.0f; } } +#endif } else if ( hExtOrientationData == NULL && headRotQuaternions != NULL ) { /* Head rotation only */ +#ifdef API_5MS + hCombinedOrientationData->Quaternion = *headRotQuaternions; + +#else if ( numHeadRotQuaternions >= 0 ) { for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) @@ -974,11 +1071,47 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; } } +#endif } if ( hExtOrientationData != NULL ) { /* External orientations */ +#ifdef API_5MS + + if ( hExtOrientationData->enableRotationInterpolation == 1 && hExtOrientationData->enableExternalOrientation > 0 ) + { + if ( hCombinedOrientationData->isInterpolationOngoing == TRUE && hCombinedOrientationData->interpolationCoefficient <= 1.0f && are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == true ) + { + /* Continue interpolation */ + QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternion ); + hCombinedOrientationData->interpolationCoefficient += hCombinedOrientationData->interpolationIncrement; + } + else + { + /* Stop interpolation or check for new interpolation */ + hCombinedOrientationData->isInterpolationOngoing = FALSE; + hCombinedOrientationData->interpolationCoefficient = 1.0f; + hCombinedOrientationData->interpolationIncrement = 1.0f; + external_target_interpolation( hExtOrientationData, hCombinedOrientationData ); + } + } + else + { + /* Interpolation disabled, use the current orientation values */ + + /* Use the most recent external orientation */ + if ( hExtOrientationData->enableExternalOrientation == 1 ) + { + hCombinedOrientationData->Quaternion = hExtOrientationData->Quaternion; + } + /* Use the freezed external orientation */ + else if ( hExtOrientationData->enableExternalOrientation == 2 ) + { + hCombinedOrientationData->Quaternion = hCombinedOrientationData->Quaternion_prev_extOrientation; + } + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableRotationInterpolation[i] == 1 && hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1014,11 +1147,46 @@ static ivas_error combine_external_and_head_orientations( } } } +#endif } if ( hExtOrientationData != NULL && headRotQuaternions != NULL ) { /* Combine head and external orientations */ +#ifdef API_5MS + + /* Use the most recent head rotation */ + if ( hExtOrientationData->enableHeadRotation == 1 ) + { + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternion, *headRotQuaternions, &hCombinedOrientationData->Quaternion ); + } + else + { + hCombinedOrientationData->Quaternion = *headRotQuaternions; + } + } + /* Use the freezed head rotation */ + else if ( hExtOrientationData->enableHeadRotation == 2 ) + { + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + QuaternionProduct( hCombinedOrientationData->Quaternion, hCombinedOrientationData->Quaternion_prev_headRot, &hCombinedOrientationData->Quaternion ); + } + else + { + hCombinedOrientationData->Quaternion = hCombinedOrientationData->Quaternion_prev_headRot; + } + } + + /* Reset the combined orientations to identity */ + if ( hExtOrientationData->enableHeadRotation == 0 && hExtOrientationData->enableExternalOrientation == 0 ) + { + hCombinedOrientationData->Quaternion = identity; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { /* Use the most recent head rotation */ @@ -1052,20 +1220,36 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions[i] = identity; } } +#endif } if ( headRotQuaternions != NULL || hExtOrientationData != NULL ) { /* Calculate the combined rotation matrix */ +#ifdef API_5MS + QuatToRotMat( hCombinedOrientationData->Quaternion, hCombinedOrientationData->Rmat ); +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { QuatToRotMat( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Rmat[i] ); } +#endif } /* Save the current orientations */ if ( hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + hCombinedOrientationData->Quaternion_prev_extOrientation = hCombinedOrientationData->Quaternion; + } + else + { + hCombinedOrientationData->Quaternion_prev_extOrientation = identity; + } + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1077,9 +1261,29 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions_prev_extOrientation[i] = identity; } } +#endif } if ( headRotQuaternions != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData != NULL ) + { + if ( hExtOrientationData->enableHeadRotation > 0 ) + { + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; + } + else + { + hCombinedOrientationData->Quaternion_prev_headRot = identity; + } + } + else + { + hCombinedOrientationData->Quaternion_prev_headRot = *headRotQuaternions; + } + hCombinedOrientationData->listenerPos = *listenerPos; + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData != NULL ) @@ -1106,11 +1310,16 @@ static ivas_error combine_external_and_head_orientations( } hCombinedOrientationData->listenerPos[i] = listenerPos[i]; } +#endif } /* Check if combined orientation is enabled */ if ( headRotQuaternions != NULL && hExtOrientationData == NULL ) { +#ifdef API_5MS + hCombinedOrientationData->enableCombinedOrientation = 1; + +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( numHeadRotQuaternions >= 0 ) @@ -1122,9 +1331,20 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else if ( headRotQuaternions == NULL && hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 ) + { + hCombinedOrientationData->enableCombinedOrientation = 1; + } + else + { + hCombinedOrientationData->enableCombinedOrientation = 0; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1136,9 +1356,20 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else if ( headRotQuaternions != NULL && hExtOrientationData != NULL ) { +#ifdef API_5MS + if ( hExtOrientationData->enableExternalOrientation > 0 || hExtOrientationData->enableHeadRotation > 0 ) + { + hCombinedOrientationData->enableCombinedOrientation = 1; + } + else + { + hCombinedOrientationData->enableCombinedOrientation = 0; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 || ( hExtOrientationData->enableHeadRotation[i] > 0 && numHeadRotQuaternions >= 0 ) ) @@ -1150,13 +1381,18 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#endif } else { +#ifdef API_5MS + hCombinedOrientationData->enableCombinedOrientation = 0; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hCombinedOrientationData->enableCombinedOrientation[i] = 0; } +#endif } return IVAS_ERR_OK; @@ -1169,36 +1405,69 @@ static ivas_error combine_external_and_head_orientations( * *------------------------------------------------------------------------*/ -static void external_target_interpolation( - EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */ - const int16_t i ) +void external_target_interpolation( + EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ +#ifndef API_5MS + , + const int16_t i +#endif +) { /* Sanity check for number of frames */ +#ifdef API_5MS + hExtOrientationData->numFramesToTargetOrientation = min( hExtOrientationData->numFramesToTargetOrientation, hCombinedOrientationData->maximumFramesToTargetOrientation ); + hExtOrientationData->numFramesToTargetOrientation = max( hExtOrientationData->numFramesToTargetOrientation, 0 ); +#else hExtOrientationData->numFramesToTargetOrientation[i] = min( hExtOrientationData->numFramesToTargetOrientation[i], hCombinedOrientationData->maximumFramesToTargetOrientation ); hExtOrientationData->numFramesToTargetOrientation[i] = max( hExtOrientationData->numFramesToTargetOrientation[i], 0 ); +#endif /* Interpolate from the current orientation to the target orientation */ +#ifdef API_5MS + if ( hExtOrientationData->numFramesToTargetOrientation > 0 ) +#else if ( hExtOrientationData->numFramesToTargetOrientation[i] > 0 ) +#endif { +#ifdef API_5MS + if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternion ) == false ) +#else if ( are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternions[i] ) == false ) +#endif { /* Target orientation is different from the previous target, update the values */ /* Set the received orientation as the target */ +#ifdef API_5MS + hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternion; +#else hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternions[i]; +#endif /* Use the most recent external orientation as the starting orientation */ +#ifdef API_5MS + hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternion_prev_extOrientation; +#else hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternions_prev_extOrientation[i]; +#endif /* Calculate the interpolation increment and coefficient */ +#ifdef API_5MS + hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation ); +#else hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); +#endif hCombinedOrientationData->interpolationCoefficient = hCombinedOrientationData->interpolationIncrement; } /* Interpolate */ hCombinedOrientationData->isInterpolationOngoing = TRUE; +#ifdef API_5MS + QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternion ); +#else QuaternionSlerp( hCombinedOrientationData->Quaternions_ext_interpolation_start, hCombinedOrientationData->Quaternions_ext_interpolation_target, hCombinedOrientationData->interpolationCoefficient, &hCombinedOrientationData->Quaternions[i] ); +#endif hCombinedOrientationData->interpolationCoefficient += hCombinedOrientationData->interpolationIncrement; } else @@ -1207,7 +1476,11 @@ static void external_target_interpolation( hCombinedOrientationData->isInterpolationOngoing = FALSE; hCombinedOrientationData->interpolationCoefficient = 1.0f; hCombinedOrientationData->interpolationIncrement = 1.0f; +#ifdef API_5MS + hCombinedOrientationData->Quaternion = hExtOrientationData->Quaternion; +#else hCombinedOrientationData->Quaternions[i] = hExtOrientationData->Quaternions[i]; +#endif } return; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c763630325..14de5e7d55 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -257,9 +257,14 @@ typedef struct typedef struct ivas_binaural_head_track_struct { +#ifdef API_5MS + IVAS_QUATERNION Quaternion; + IVAS_VECTOR3 Pos; +#else int16_t num_quaternions; IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_VECTOR3 Pos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif float Rmat[3][3]; float Rmat_prev[3][3]; @@ -281,12 +286,19 @@ typedef struct ivas_binaural_head_track_struct typedef struct ivas_external_orientation_struct { +#ifdef API_5MS + int8_t enableHeadRotation; /* 0 - disable, 1 - enable, 2 - freeze to previous rotation */ + int8_t enableExternalOrientation; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ + int8_t enableRotationInterpolation; /* 0 - disable, 1 - enable */ + int16_t numFramesToTargetOrientation; /* Number of frames until target orientation is reached */ + IVAS_QUATERNION Quaternion; /* External orientation in quaternions */ +#else int8_t enableHeadRotation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous rotation */ int8_t enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ int8_t enableRotationInterpolation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable */ int16_t numFramesToTargetOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* Number of frames until target orientation is reached */ IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; /* External orientation in quaternions */ - +#endif } EXTERNAL_ORIENTATION_DATA, *EXTERNAL_ORIENTATION_HANDLE; /*----------------------------------------------------------------------------------* @@ -295,7 +307,11 @@ typedef struct ivas_external_orientation_struct typedef struct ivas_combined_orientation_struct { +#ifdef API_5MS + int16_t enableCombinedOrientation; +#else int16_t enableCombinedOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif float interpolationCoefficient; float interpolationIncrement; int16_t maximumFramesToTargetOrientation; @@ -303,17 +319,31 @@ typedef struct ivas_combined_orientation_struct uint8_t lrSwitchedCurrent; float lrSwitchInterpVal; bool isInterpolationOngoing; +#ifdef API_5MS + IVAS_QUATERNION Quaternion; + IVAS_QUATERNION Quaternion_prev_headRot; + IVAS_QUATERNION Quaternion_prev_extOrientation; +#else IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION Quaternions_prev_headRot[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION Quaternions_prev_extOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif IVAS_QUATERNION Quaternions_ext_interpolation_start; IVAS_QUATERNION Quaternions_ext_interpolation_target; +#ifdef API_5MS + float Rmat[3][3]; +#else float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3]; +#endif float Rmat_prev[3][3]; float chEneIIR[2][MASA_FREQUENCY_BANDS]; /* independent of the format. MASA bands are suitable for the task and readily available in ROM. */ float procChEneIIR[2][MASA_FREQUENCY_BANDS]; int16_t shd_rot_max_order; +#ifdef API_5MS + IVAS_VECTOR3 listenerPos; +#else IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4e75d5fea8..89b51e7745 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2583,8 +2583,11 @@ static DecoderDummy *initDecoderDummy( decDummy->hDecoderConfig->output_Fs = sampleRate; decDummy->hDecoderConfig->nchan_out = numOutChannels; decDummy->hDecoderConfig->Opt_Headrotation = 0; +#ifdef API_5MS + decDummy->hDecoderConfig->tsm_active = 0; +#else decDummy->hDecoderConfig->voip_active = 0; - +#endif decDummy->hBinRenderer = NULL; decDummy->hEFAPdata = NULL; decDummy->hCrendWrapper = NULL; @@ -2616,6 +2619,12 @@ static DecoderDummy *initDecoderDummy( set_zero( decDummy->hHeadTrackData->chEneIIR[1], MASA_FREQUENCY_BANDS ); set_zero( decDummy->hHeadTrackData->procChEneIIR[0], MASA_FREQUENCY_BANDS ); set_zero( decDummy->hHeadTrackData->procChEneIIR[1], MASA_FREQUENCY_BANDS ); +#ifdef API_5MS + decDummy->hHeadTrackData->Quaternion.w = 1.0f; + decDummy->hHeadTrackData->Quaternion.x = 0.0f; + decDummy->hHeadTrackData->Quaternion.y = 0.0f; + decDummy->hHeadTrackData->Quaternion.z = 0.0f; +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { decDummy->hHeadTrackData->Quaternions[i].w = 1.0f; @@ -2623,7 +2632,7 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData->Quaternions[i].y = 0.0f; decDummy->hHeadTrackData->Quaternions[i].z = 0.0f; } - decDummy->hHeadTrackData->num_quaternions = 0; +#endif decDummy->hHeadTrackData->lrSwitchInterpVal = 0.0f; decDummy->hHeadTrackData->lrSwitchedCurrent = 0; decDummy->hHeadTrackData->lrSwitchedNext = 0; @@ -4246,21 +4255,35 @@ ivas_error IVAS_REND_SetExternalOrientation( if ( orientation == NULL ) { +#ifdef API_5MS + hIvasRend->hExternalOrientationData->enableExternalOrientation = 0; +#else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { hIvasRend->hExternalOrientationData->enableExternalOrientation[i] = 0; } +#endif } else { for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { +#ifdef API_5MS + /* just fix compilation issues, ToDo: change ext renderer also to 5ms */ + QuaternionInverse( orientation[i], &hIvasRend->hExternalOrientationData->Quaternion ); + + hIvasRend->hExternalOrientationData->enableHeadRotation = enableHeadRotation[i]; + hIvasRend->hExternalOrientationData->enableExternalOrientation = enableExternalOrientation[i]; + hIvasRend->hExternalOrientationData->enableRotationInterpolation = enableRotationInterpolation[i]; + hIvasRend->hExternalOrientationData->numFramesToTargetOrientation = numFramesToTargetOrientation[i]; +#else QuaternionInverse( orientation[i], &hIvasRend->hExternalOrientationData->Quaternions[i] ); hIvasRend->hExternalOrientationData->enableHeadRotation[i] = enableHeadRotation[i]; hIvasRend->hExternalOrientationData->enableExternalOrientation[i] = enableExternalOrientation[i]; hIvasRend->hExternalOrientationData->enableRotationInterpolation[i] = enableRotationInterpolation[i]; hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[i] = numFramesToTargetOrientation[i]; +#endif } } @@ -4309,7 +4332,12 @@ ivas_error IVAS_REND_GetCombinedOrientation( { for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) { +#ifdef API_5MS + /* fix compilation only,ToDo adapt ext renderer to 5ms , this functions looks stale anyway */ + pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternion; +#else pOrientation[i] = hIvasRend->hCombinedOrientationData->Quaternions[i]; +#endif } } @@ -4468,7 +4496,12 @@ static ivas_error rotateFrameMc( { for ( j = 0; j < 3; j++ ) { +#ifdef API_5MS + /* fix compiling only, ToDo adapt ext renderer to 5ms */ + Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[i][j]; +#else Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; +#endif } } else @@ -4585,7 +4618,12 @@ static ivas_error rotateFrameSba( { for ( l = 0; l < 3; l++ ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + Rmat[i][l] = ( *hCombinedOrientationData )->Rmat[i][l]; +#else Rmat[i][l] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][l]; +#endif } } else @@ -4723,14 +4761,23 @@ static ivas_error renderIsmToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { + if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) { combinedOrientationEnabled = 1; break; } } +#endif } @@ -4742,6 +4789,16 @@ static ivas_error renderIsmToBinauralRoom( { for ( i = 0; i < 3; i++ ) { +#ifdef API_5MS + /* at least this looks like it is adapted to 5ms already since it "loops" only over the first subframe, ToDo needs to be checked */ + if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation ) + { + for ( j = 0; j < 3; j++ ) + { + Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[i][j]; + } + } +#else if ( hCombinedOrientationData != NULL && ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] ) { for ( j = 0; j < 3; j++ ) @@ -4749,6 +4806,7 @@ static ivas_error renderIsmToBinauralRoom( Rmat[i][j] = ( *hCombinedOrientationData )->Rmat[subframe_idx][i][j]; } } +#endif else { /* Set to identity */ @@ -5148,7 +5206,9 @@ static ivas_error renderMcToBinaural( IVAS_REND_AudioBuffer tmpRotBuffer; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; int16_t i; @@ -5165,6 +5225,14 @@ static ivas_error renderMcToBinaural( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } + +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5173,6 +5241,7 @@ static ivas_error renderMcToBinaural( break; } } +#endif } if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled @@ -5246,7 +5315,9 @@ static ivas_error renderMcToBinauralRoom( int16_t i; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { @@ -5261,6 +5332,13 @@ static ivas_error renderMcToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5269,6 +5347,7 @@ static ivas_error renderMcToBinauralRoom( break; } } +#endif } if ( ( mcInput->hReverb != NULL && outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) @@ -5341,7 +5420,9 @@ static ivas_error renderMcCustomLsToBinauralRoom( float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif push_wmops( "renderMcCustomLsToBinauralRoom" ); @@ -5356,6 +5437,13 @@ static ivas_error renderMcCustomLsToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compilin only, ToDo adapt renderer to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5364,6 +5452,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( break; } } +#endif } /* apply rotation */ @@ -5627,7 +5716,9 @@ static ivas_error renderSbaToBinaural( int16_t i; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif push_wmops( "renderSbaToBinaural" ); @@ -5640,6 +5731,13 @@ static ivas_error renderSbaToBinaural( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5648,6 +5746,7 @@ static ivas_error renderSbaToBinaural( break; } } +#endif } /* apply rotation */ @@ -5703,7 +5802,9 @@ static ivas_error renderSbaToBinauralRoom( float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; +#ifndef API_5MS int16_t subframe_idx; +#endif tmpRotBuffer = outAudio; /* avoid compilation warning */ @@ -5718,6 +5819,13 @@ static ivas_error renderSbaToBinauralRoom( combinedOrientationEnabled = 0; if ( hCombinedOrientationData != NULL ) { +#ifdef API_5MS + /* fix compiling only, ToDo ext renderer needs to adapted to 5ms */ + if ( ( *hCombinedOrientationData )->enableCombinedOrientation != 0 ) + { + combinedOrientationEnabled = 1; + } +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { if ( ( *hCombinedOrientationData )->enableCombinedOrientation[subframe_idx] != 0 ) @@ -5726,6 +5834,7 @@ static ivas_error renderSbaToBinauralRoom( break; } } +#endif } /* apply rotation */ @@ -6193,8 +6302,14 @@ static ivas_error renderActiveInputsMasa( { for ( sf_idx = 0; sf_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; ++sf_idx ) { +#ifdef API_5MS + /* fix compilation only, ToDo adapt ext renderer to 5ms */ + pCurrentInput->decDummy->hHeadTrackData->Quaternion = hIvasRend->headRotData.headPositions[sf_idx]; + pCurrentInput->decDummy->hHeadTrackData->Pos = hIvasRend->headRotData.Pos[sf_idx]; +#else pCurrentInput->decDummy->hHeadTrackData->Quaternions[sf_idx] = hIvasRend->headRotData.headPositions[sf_idx]; pCurrentInput->decDummy->hHeadTrackData->Pos[sf_idx] = hIvasRend->headRotData.Pos[sf_idx]; +#endif } } diff --git a/scripts/self_test.py b/scripts/self_test.py index d7118832db..321f83419b 100755 --- a/scripts/self_test.py +++ b/scripts/self_test.py @@ -186,6 +186,13 @@ class SelfTest(IvasScriptsCommon.IvasScript): "--dectest", help="Test decoder binary (default:{})".format(default_dec_test), ) + self.parser.add_argument( + "--list_conditions", + "-l", + help="List all comditions in the parameter file", + action="store_true", + default=False, + ) if shutil.which("valgrind"): self.valgrind = [ "valgrind", @@ -858,6 +865,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): # add the detailed results for this condition self.fail_results["detailedResults"].append(result_str) + self.fail_results["failed_modes"].append(mode) self.logger.progress( "Comparing conditions: {}/{} ({} running), {} failed ".format( self.stat["num_tests_done"], @@ -1140,6 +1148,11 @@ class SelfTest(IvasScriptsCommon.IvasScript): self.parse_args() + if self.args["list_conditions"] is True: + run_dict = self.parse_self_test_prm(self.args["test_prm"]) + for mode in run_dict.keys(): + self.logger.console(f"- {run_dict[mode]['cmd']['table_name']}") + return # create/update test vectors (export from SVN server if not existing) svn_action = None if not os.path.exists(TESTV_DIR): @@ -1540,6 +1553,7 @@ class SelfTest(IvasScriptsCommon.IvasScript): "corrupt_test_conditions": {"cnt": 0, "conditions": []}, "diff_nsamples_conditions": {"cnt": 0, "conditions": []}, "detailedResults": [], + "failed_modes":[], } self.run_pesq = self.args["pesq"] failed_ref_conditions = {} @@ -1948,6 +1962,15 @@ class SelfTest(IvasScriptsCommon.IvasScript): for l in r: self.logger.info(l) + self.logger.info("\n\n") + self.logger.info("Summary of all tests") + self.logger.info("---------------------\n") + for mode in run_dict.keys(): + if mode in self.fail_results["failed_modes"]: + self.logger.info(f"[FAIL] {run_dict[mode]['cmd']['table_name']}") + else: + self.logger.info(f"[OK] {run_dict[mode]['cmd']['table_name']}") + if __name__ == "__main__": if sys.version_info[0] < 3 or sys.version_info[1] < 7: -- GitLab From 43982584c91aefd85c71a829190c91d57238146a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Tue, 20 Jun 2023 09:57:09 +0200 Subject: [PATCH 0224/1418] fix Linux comppile and instrumentation problems, clang-format --- lib_com/ivas_error.h | 10 +++++----- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 6 +++--- lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_ism_param_dec.c | 10 +++++----- lib_dec/ivas_sba_dec.c | 10 +++++----- lib_dec/jbm_pcmdsp_fifo.c | 2 +- lib_dec/lib_dec.c | 25 +++++++++---------------- lib_rend/ivas_stat_rend.h | 2 +- 9 files changed, 30 insertions(+), 38 deletions(-) diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 251be0d38a..63914dda53 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -86,6 +86,11 @@ typedef enum IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, +#ifdef API_5MS + IVAS_ERR_TSM_NOT_ENABLED, + IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, + IVAS_ERR_NEED_NEW_FRAME, +#endif #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION @@ -94,11 +99,6 @@ typedef enum #ifdef VARIABLE_SPEED_DECODING IVAS_ERR_VS_FRAME_NEEDED, #endif -#ifdef API_5MS - IVAS_ERR_TSM_NOT_ENABLED, - IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, - IVAS_ERR_NEED_NEW_FRAME, -#endif #endif /*----------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index c6d3a9c108..34ad115fe2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,7 +166,6 @@ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ -#define FIX_XXX_JITTER_SBA_BINAURAL_GAIN #define FIX_XXX_HEADTRACKER_INIT #define FIX_XXX_TDOBJRENDERER_INPUT #define FIX_XXX_ISM_SBA_ASAN diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index efc3b11215..02ef041bc1 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1127,10 +1127,10 @@ void ivas_binaural_cldfb_sf( *-------------------------------------------------------------------------*/ void ivas_binRenderer( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined head and external orientation handle*/ #ifndef API_5MS - int16_t subframe_idx, /* i : subframe index */ + int16_t subframe_idx, /* i : subframe index */ #endif const int16_t numTimeSlots, /* i : number of time slots to render */ float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 1f588ac2cc..f9277264ea 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -761,4 +761,4 @@ ivas_error ivas_dec( pop_wmops(); return error; } -#endif \ No newline at end of file +#endif diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index f73b40b666..7a243dc266 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1392,11 +1392,11 @@ static void ivas_ism_param_dec_render_sf( *-------------------------------------------------------------------------*/ void ivas_param_ism_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { int16_t ch, slots_to_render, first_sf, last_sf, subframe_idx; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 50bb1b3ddf..23c4d90387 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -471,11 +471,11 @@ ivas_error ivas_sba_dec_digest_tc( *-------------------------------------------------------------------*/ void ivas_sba_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ - float *output_f[] /* o : rendered time signal */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailableNext, /* o : number of CLDFB slots still to render */ + float *output_f[] /* o : rendered time signal */ ) { int16_t slots_to_render, first_sf, last_sf, subframe_idx; diff --git a/lib_dec/jbm_pcmdsp_fifo.c b/lib_dec/jbm_pcmdsp_fifo.c index d3c93679fe..ad0a860944 100644 --- a/lib_dec/jbm_pcmdsp_fifo.c +++ b/lib_dec/jbm_pcmdsp_fifo.c @@ -268,4 +268,4 @@ uint16_t pcmdsp_fifo_nReadableSamplesPerChannel( { return h->size; } -#endif \ No newline at end of file +#endif diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 1e4dd48a60..5fbbee3df3 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -837,7 +837,6 @@ ivas_error IVAS_DEC_GetSamples( bool *needNewFrame /* indication that the decoder needs a new frame */ ) { - Decoder_Struct *st_ivas; ivas_error error; int16_t nOutSamplesElse, result, nSamplesToRender; uint16_t nSamplesRendered, nSamplesRendered_loop, l_ts, nTimeScalerOutSamples; @@ -850,7 +849,6 @@ ivas_error IVAS_DEC_GetSamples( { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - st_ivas = hIvasDec->st_ivas; if ( !hIvasDec->hasBeenFedFrame && hIvasDec->nSamplesAvailableNext == 0 ) { @@ -1362,8 +1360,8 @@ ivas_error IVAS_DEC_FeedHeadTrackData( IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ IVAS_VECTOR3 Pos /* i : listener position */ #else - IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ - IVAS_VECTOR3 *Pos /* i : listener position */ + IVAS_QUATERNION *orientation, /* i : head-tracking data, listener orientation */ + IVAS_VECTOR3 *Pos /* i : listener position */ #endif ) { @@ -2062,20 +2060,12 @@ ivas_error IVAS_DEC_VoIP_GetSamples( DECODER_CONFIG_HANDLE hDecoderConfig; IVAS_DEC_VOIP *hVoIP; uint32_t extBufferedTime_ms, scale, maxScaling; -#ifndef API_5MS - uint16_t nTimeScalerOutSamples; -#endif JB4_DATAUNIT_HANDLE dataUnit; -#ifndef API_5MS - int16_t nOutSamplesElse; -#endif uint16_t extBufferedSamples; int16_t timeScalingDone; int16_t result; ivas_error error; int16_t nSamplesRendered; - uint16_t nSamplesTcsScaled; - uint8_t nTransportChannels; uint8_t nOutChannels; error = IVAS_ERR_OK; @@ -2086,8 +2076,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( timeScalingDone = 0; nOutChannels = (uint8_t) st_ivas->hDecoderConfig->nchan_out; - nTransportChannels = 0; - nSamplesTcsScaled = hVoIP->nSamplesFrame; nSamplesRendered = 0; if ( nSamplesPerChannel == 0 ) @@ -2625,8 +2613,8 @@ ivas_error IVAS_DEC_Flush( ) { ivas_error error; - IVAS_DEC_VOIP *hVoIP; #ifndef API_5MS + IVAS_DEC_VOIP *hVoIP; int16_t rendererPcmBuf[( MAX_OUTPUT_CHANNELS * L_FRAME_MAX * APA_MAX_SCALE ) / 100]; #endif uint16_t nSamplesToRender; @@ -2634,7 +2622,9 @@ ivas_error IVAS_DEC_Flush( error = IVAS_ERR_OK; +#ifndef API_5MS hVoIP = hIvasDec->hVoIP; +#endif #ifdef API_5MS *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); #else @@ -3533,15 +3523,18 @@ ivas_error IVAS_DEC_reconfigure( const uint16_t l_ts ) { +#ifndef API_5MS IVAS_DEC_VOIP *hVoIP; +#endif #ifdef API_5MS int16_t apa_buffer_size; #endif ivas_error error; - +#ifndef API_5MS hVoIP = hIvasDec->hVoIP; +#endif #ifdef API_5MS apa_buffer_size = hIvasDec->nSamplesFrame; #endif diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 14de5e7d55..bd0aa1151c 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -291,7 +291,7 @@ typedef struct ivas_external_orientation_struct int8_t enableExternalOrientation; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ int8_t enableRotationInterpolation; /* 0 - disable, 1 - enable */ int16_t numFramesToTargetOrientation; /* Number of frames until target orientation is reached */ - IVAS_QUATERNION Quaternion; /* External orientation in quaternions */ + IVAS_QUATERNION Quaternion; /* External orientation in quaternions */ #else int8_t enableHeadRotation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous rotation */ int8_t enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; /* 0 - disable, 1 - enable, 2 - freeze to previous orientation */ -- GitLab From ccd8dbb85b39d0a1f1b30c18442d730b0bb6378e Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Tue, 20 Jun 2023 12:02:47 +0200 Subject: [PATCH 0225/1418] Fix msan issue in crend --- lib_com/options.h | 1 + lib_debug/debug.h | 19 ++++++++++++++++ lib_rend/ivas_crend.c | 23 +++++++++++++++++++- lib_rend/ivas_prot_rend.h | 3 +++ lib_rend/lib_rend.c | 46 ++++++++++++++++++++++++++++++++++----- 5 files changed, 85 insertions(+), 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 544100fb35..fe524ca6a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ #define FIX_XXX_ISM_SBA_ASAN #define API_5MS #define LIB_REND_API_5MS /* FhG: Adds 5ms framing capability to lib_rend */ +#define SGI_DBG /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_debug/debug.h b/lib_debug/debug.h index 3d59cb00a0..3cfe128d98 100644 --- a/lib_debug/debug.h +++ b/lib_debug/debug.h @@ -36,6 +36,9 @@ #include "options.h" #include #include +#ifdef SGI_DBG +#include +#endif #ifdef DEBUG_SBA #include "sba_debug.h" #endif @@ -97,6 +100,22 @@ int16_t dbgwrite( const char *const filename #endif ); +#ifdef SGI_DBG +inline static void sgi_dbgwrite( + const float *const buffer, + const int16_t count, + const char *const filename ) +{ + float tmp[960]; + + for ( int i = 0; i < count; ++i ) + { + tmp[i] = buffer[i] / INT16_MAX; + } + + dbgwrite( tmp, sizeof( float ), count, 1, filename ); +} +#endif void dbgwrite_mat_repeat( float *buffer, /* i : write buffer */ diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e5bdd05ed1..2aa19296dd 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1332,9 +1332,18 @@ ivas_error ivas_rend_crendProcess( IVAS_OUTPUT_SETUP_HANDLE hIntSetup, EFAP_HANDLE hEFAPdata, float *output[], /* i/o: input/output audio channels */ - const int32_t output_Fs ) + const int32_t output_Fs +#ifdef LIB_REND_API_5MS + , + const int16_t num_subframes /* i : number of subframes to render */ +#endif +) { +#ifdef LIB_REND_API_5MS + int16_t i, subframe_idx, subframe_len; +#else int16_t i, subframe_idx, output_frame, subframe_len; +#endif int16_t nchan_out; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; float *p_pcm_tmp[BINAURAL_CHANNELS]; @@ -1379,15 +1388,23 @@ ivas_error ivas_rend_crendProcess( return error; } +#ifdef LIB_REND_API_5MS + subframe_len = (int16_t) output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES; +#else output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); subframe_len = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#endif for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { p_pcm_tmp[i] = pcm_tmp[i]; } +#ifdef LIB_REND_API_5MS + for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ ) +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) +#endif { if ( hDecoderConfig && combinedOrientationEnabled ) { @@ -1432,7 +1449,11 @@ ivas_error ivas_rend_crendProcess( /* move to output */ for ( i = 0; i < nchan_out; i++ ) { +#ifdef LIB_REND_API_5MS + mvr2r( pcm_tmp[i], output[i], num_subframes * subframe_len ); +#else mvr2r( pcm_tmp[i], output[i], output_frame ); +#endif } pop_wmops(); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d96f5228f2..812c6575ad 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -509,6 +509,9 @@ ivas_error ivas_rend_crendProcess( EFAP_HANDLE hEFAPdata, float *output[], /* i/o: input/output audio channels */ const int32_t output_Fs +#ifdef LIB_REND_API_5MS + ,const int16_t num_subframes /* i : number of subframes to render */ +#endif ); ivas_error ivas_rend_crendProcessSubframe( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 158110012f..e8f4843ade 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5078,7 +5078,12 @@ static ivas_error renderIsmToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *ismInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -5493,10 +5498,19 @@ static ivas_error renderMcToBinaural( /* call CREND */ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } + +#ifdef SGI_DBG + sgi_dbgwrite( p_tmpRendBuffer[0], outAudio.config.numSamplesPerChannel, "res/p_tmpRendBuffer.pcm" ); +#endif } accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); @@ -5602,7 +5616,12 @@ static ivas_error renderMcToBinauralRoom( /* call CREND */ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -5712,7 +5731,12 @@ static ivas_error renderMcCustomLsToBinauralRoom( /* call CREND */ if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, - p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -5996,7 +6020,12 @@ static ivas_error renderSbaToBinaural( /* call CREND */ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *sbaInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } @@ -6097,7 +6126,12 @@ static ivas_error renderSbaToBinauralRoom( /* call CREND */ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) + NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate +#ifdef LIB_REND_API_5MS + , + *sbaInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel +#endif + ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 3ac4d187461327e099adc47006eef7e99472b882 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 20 Jun 2023 13:16:18 +0200 Subject: [PATCH 0226/1418] - fix setting of "is_ism_flag" in CPE - activate ISM_FB --- lib_com/options.h | 2 +- lib_enc/ivas_cpe_enc.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6c21f34ee5..17d991b02e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ #define FIX_522_ISM_FIRST_SID /* VA: fix ISM decoder crash if first received frame is an SID */ #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ -//#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ +#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index bb6db6d9a4..86e85b34e7 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -990,7 +990,13 @@ ivas_error create_cpe_enc( #ifdef IND_LIST_DYN 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, +#ifdef MASA_AND_OBJECTS + ISM_MODE_NONE +#else + st_ivas->ism_mode +#endif + ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From ed8d75678abbae0293c36c80be0c54ab0d50652c Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Tue, 20 Jun 2023 13:29:49 +0200 Subject: [PATCH 0227/1418] Fix msan issues --- lib_com/ivas_prot.h | 3 + lib_dec/ivas_dirac_dec.c | 8 +++ lib_rend/ivas_dirac_dec_binaural_functions.c | 7 +++ lib_rend/ivas_prot_rend.h | 3 + lib_rend/lib_rend.c | 62 +++++++++++++++----- 5 files changed, 67 insertions(+), 16 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 0a56c5081e..4c61d6bf7c 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3605,6 +3605,9 @@ void ivas_dirac_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport /* i : number of transport channels */ +#ifdef LIB_REND_API_5MS + ,const int16_t num_subframes /* i : number of subframes to render */ +#endif ); void ivas_dirac_dec_render( diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 19f99cad4e..6394a90566 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2205,6 +2205,10 @@ void ivas_dirac_dec( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport /* i : number of transport channels */ +#ifdef LIB_REND_API_5MS + , + const int16_t num_subframes /* i : number of subframes to render */ +#endif ) { int16_t subframe_idx; @@ -2234,7 +2238,11 @@ void ivas_dirac_dec( ivas_dirac_dec_set_md_map( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS ); +#ifdef LIB_REND_API_5MS + for ( subframe_idx = 0; subframe_idx < num_subframes; subframe_idx++ ) +#else for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) +#endif { ivas_dirac_dec_render_sf( st_ivas, output_f_local, nchan_transport, NULL, NULL ); for ( n = 0; n < nchan_out; n++ ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index c698ad1d3f..7456b9d7aa 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -423,6 +423,9 @@ void ivas_dirac_dec_binaural( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport /* i : number of transport channels */ +#ifdef LIB_REND_API_5MS + ,const int16_t num_subframes /* i : number of subframes to render */ +#endif ) { int16_t subframe; @@ -475,7 +478,11 @@ void ivas_dirac_dec_binaural( generate_masking_noise_lb_dirac( st->hFdCngDec->hFdCngCom, st_ivas->hTcBuffer->tc[nchan_transport], DEFAULT_JBM_CLDFB_TIMESLOTS, st->cna_dirac_flag && st->flag_cna ); } +#ifdef LIB_REND_API_5MS + for ( subframe = 0; subframe < num_subframes; subframe++ ) +#else for ( subframe = 0; subframe < MAX_PARAM_SPATIAL_SUBFRAMES; subframe++ ) +#endif { int16_t n_samples_sf = slot_size * st_ivas->hDirAC->subframe_nbslots[subframe]; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 812c6575ad..2308848a40 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -154,6 +154,9 @@ void ivas_dirac_dec_binaural( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i : combined orientation handle */ float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t nchan_transport /* i : number of transport channels */ +#ifdef LIB_REND_API_5MS + ,const int16_t num_subframes /* i : number of subframes to render */ +#endif ); void ivas_dirac_dec_binaural_render( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e8f4843ade..6a5656d0a4 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4925,6 +4925,16 @@ static ivas_error renderIsmToBinaural( return IVAS_ERR_OK; } +#ifdef LIB_REND_API_5MS +static int16_t num_subframes_in_buffer( const IVAS_REND_AudioBuffer *buffer, int32_t sampleRate ) +{ +#ifdef DEBUGGING + assert( buffer->config.numSamplesPerChannel % (sampleRate / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES) == 0 ); +#endif + return buffer->config.numSamplesPerChannel / (sampleRate / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES); +} +#endif + static ivas_error renderIsmToBinauralRoom( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) @@ -5081,9 +5091,9 @@ static ivas_error renderIsmToBinauralRoom( NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *ismInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *ismInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -5501,9 +5511,9 @@ static ivas_error renderMcToBinaural( NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *mcInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -5619,9 +5629,9 @@ static ivas_error renderMcToBinauralRoom( NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *mcInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -5734,9 +5744,9 @@ static ivas_error renderMcCustomLsToBinauralRoom( p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *mcInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *mcInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -6023,9 +6033,9 @@ static ivas_error renderSbaToBinaural( NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *sbaInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -6129,9 +6139,9 @@ static ivas_error renderSbaToBinauralRoom( NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate #ifdef LIB_REND_API_5MS , - *sbaInput->base.ctx.pOutSampleRate / FRAMES_PER_SEC / outAudio.config.numSamplesPerChannel + num_subframes_in_buffer( &outAudio, *sbaInput->base.ctx.pOutSampleRate ) #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } @@ -6300,11 +6310,21 @@ static void renderMasaToMc( if ( masaInput->decDummy->renderer_type == RENDERER_STEREO_PARAMETRIC ) { - ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); + ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels +#ifdef LIB_REND_API_5MS + , + num_subframes_in_buffer( &outAudio, *masaInput->base.ctx.pOutSampleRate ) +#endif + ); } else { - ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); + ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels +#ifdef LIB_REND_API_5MS + , + num_subframes_in_buffer( &outAudio, *masaInput->base.ctx.pOutSampleRate ) +#endif + ); } accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); @@ -6321,7 +6341,12 @@ static void renderMasaToSba( copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hDirAC ); - ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); + ivas_dirac_dec( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels +#ifdef LIB_REND_API_5MS + , + num_subframes_in_buffer( &outAudio, *masaInput->base.ctx.pOutSampleRate ) +#endif + ); accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); @@ -6337,7 +6362,12 @@ static void renderMasaToBinaural( copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hDirAC ); - ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); + ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels +#ifdef LIB_REND_API_5MS + , + num_subframes_in_buffer( &outAudio, *masaInput->base.ctx.pOutSampleRate ) +#endif + ); accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); -- GitLab From 54b8badada65cb8251eb8d1e8c3dc4a051bbf04a Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 20 Jun 2023 13:37:53 +0200 Subject: [PATCH 0228/1418] intorduce funtions stereo_mode_combined_format_enc()/stereo_mode_combined_format_dec() make the code easier to read --- lib_dec/ivas_cpe_dec.c | 78 ++++++++++++++++++++---------- lib_enc/ivas_cpe_enc.c | 105 ++++++++++++++++++++++++++++------------- 2 files changed, 123 insertions(+), 60 deletions(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 989bc40b41..bc0bb3c5b4 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -52,6 +52,10 @@ static void read_stereo_mode_and_bwidth( CPE_DEC_HANDLE hCPE, const Decoder_Struct *st_ivas ); +#ifdef FIX_OMASA_STEREO_SWITCHING +static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); +#endif + /*--------------------------------------------------------------------------* * ivas_cpe_dec() @@ -98,9 +102,6 @@ ivas_error ivas_cpe_dec( sts[0]->BER_detect |= st_ivas->BER_detect; sts[1]->BER_detect |= st_ivas->BER_detect; -#ifdef FIX_OMASA_STEREO_SWITCHING - element_brate_ref = hCPE->element_brate; -#endif #ifdef FIX_OMASA_STEREO_SWITCHING element_brate_ref = hCPE->element_brate; @@ -109,31 +110,11 @@ ivas_error ivas_cpe_dec( /*------------------------------------------------------------------* * Read stereo technology info & audio bandwidth *-----------------------------------------------------------------*/ -#ifdef FIX_OMASA_STEREO_SWITCHING - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && - ( ( st_ivas->nchan_ism == 3 && ivas_total_brate == IVAS_96k ) || - ( st_ivas->nchan_ism == 4 && ivas_total_brate == IVAS_128k ) ) ) - { - /* read OMASA stereo mode signalling */ - if ( get_next_indice( sts[0], NBITS_ELEMENT_MODE ) ) - { - hCPE->element_mode = IVAS_CPE_MDCT; - } - else - { - hCPE->element_mode = IVAS_CPE_DFT; - } - if ( hCPE->element_mode == IVAS_CPE_MDCT ) - { - hCPE->element_brate = IVAS_64k; - hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); - } - } - } +#ifdef FIX_OMASA_STEREO_SWITCHING + stereo_mode_combined_format_dec( st_ivas, hCPE ); #endif + read_stereo_mode_and_bwidth( hCPE, st_ivas ); /*----------------------------------------------------------------* @@ -1168,3 +1149,48 @@ static void read_stereo_mode_and_bwidth( return; } + + +#ifdef FIX_OMASA_STEREO_SWITCHING +/*------------------------------------------------------------------------- + * stereo_mode_combined_format_dec() + * + * Set stereo format in a combined format + *-------------------------------------------------------------------------*/ + +static void stereo_mode_combined_format_dec( + const Decoder_Struct *st_ivas, /* i : decoder main structure */ + CPE_DEC_HANDLE hCPE /* i/o: CPE handle */ +) +{ + int32_t element_brate_ref; + + if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) + { + element_brate_ref = hCPE->element_brate; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && + ( ( st_ivas->nchan_ism == 3 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_96k ) || + ( st_ivas->nchan_ism == 4 && st_ivas->hDecoderConfig->ivas_total_brate == IVAS_128k ) ) ) + { + /* read OMASA stereo mode signalling */ + if ( get_next_indice( hCPE->hCoreCoder[0], NBITS_ELEMENT_MODE ) ) + { + hCPE->element_mode = IVAS_CPE_MDCT; + } + else + { + hCPE->element_mode = IVAS_CPE_DFT; + } + + if ( hCPE->element_mode == IVAS_CPE_MDCT ) + { + hCPE->element_brate = IVAS_64k; + hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); + } + } + } + + return; +} +#endif diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 86e85b34e7..84f28f28be 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -45,6 +45,15 @@ #include "wmc_auto.h" +#ifdef FIX_OMASA_STEREO_SWITCHING +/*--------------------------------------------------------------------------* + * Local function prototypes + *--------------------------------------------------------------------------*/ + +static void stereo_mode_combined_format_enc( const Encoder_Struct *st_ivas, CPE_ENC_HANDLE hCPE ); +#endif + + /*-------------------------------------------------------------------* * ivas_cpe_enc() * @@ -176,42 +185,11 @@ ivas_error ivas_cpe_enc( { hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } -#ifdef FIX_OMASA_STEREO_SWITCHING - if ( ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && - ( ( hEncoderConfig->nchan_ism == 3 && ivas_total_brate == IVAS_96k ) || - ( hEncoderConfig->nchan_ism == 4 && ivas_total_brate == IVAS_128k ) ) ) - { - if ( hCPE->element_brate + hCPE->brate_surplus > IVAS_64k ) - { - st_ivas->hMasa->data.omasa_stereo_sw_cnt = 0; - } - else - { - st_ivas->hMasa->data.omasa_stereo_sw_cnt++; - st_ivas->hMasa->data.omasa_stereo_sw_cnt = min( st_ivas->hMasa->data.omasa_stereo_sw_cnt, OMASA_STEREO_SW_CNT_MAX ); - } - if ( st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) - { - hCPE->element_mode = IVAS_CPE_MDCT; - hCPE->element_brate = IVAS_64k; - hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); - } - - /* write OMASA stereo mode signalling */ - if ( hCPE->element_mode == IVAS_CPE_MDCT ) - { - push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 1, NBITS_ELEMENT_MODE ); - } - else - { - push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 0, NBITS_ELEMENT_MODE ); - } - } - } +#ifdef FIX_OMASA_STEREO_SWITCHING + stereo_mode_combined_format_enc( st_ivas, hCPE ); #endif + if ( ( error = front_vad( hCPE, NULL, hEncoderConfig, &hCPE->hFrontVad[0], st_ivas->hMCT != NULL, input_frame, vad_flag_dtx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, vad_hover_flag, band_energies_LR, NULL, NULL ) ) != IVAS_ERR_OK ) { return error; @@ -1232,3 +1210,62 @@ void destroy_cpe_enc( return; } + + +#ifdef FIX_OMASA_STEREO_SWITCHING +/*------------------------------------------------------------------------- + * stereo_mode_combined_format_enc() + * + * Set stereo format in a combined format + *-------------------------------------------------------------------------*/ + +static void stereo_mode_combined_format_enc( + const Encoder_Struct *st_ivas, /* i : encoder main structure */ + CPE_ENC_HANDLE hCPE /* i/o: CPE handle */ +) +{ + ENCODER_CONFIG_HANDLE hEncoderConfig; + int32_t element_brate_ref; + + hEncoderConfig = st_ivas->hEncoderConfig; + + if ( hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) + { + element_brate_ref = hCPE->element_brate; + + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && + ( ( hEncoderConfig->nchan_ism == 3 && hEncoderConfig->ivas_total_brate == IVAS_96k ) || + ( hEncoderConfig->nchan_ism == 4 && hEncoderConfig->ivas_total_brate == IVAS_128k ) ) ) + { + if ( hCPE->element_brate + hCPE->brate_surplus > IVAS_64k ) + { + st_ivas->hMasa->data.omasa_stereo_sw_cnt = 0; + } + else + { + st_ivas->hMasa->data.omasa_stereo_sw_cnt++; + st_ivas->hMasa->data.omasa_stereo_sw_cnt = min( st_ivas->hMasa->data.omasa_stereo_sw_cnt, OMASA_STEREO_SW_CNT_MAX ); + } + + if ( st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) + { + hCPE->element_mode = IVAS_CPE_MDCT; + hCPE->element_brate = IVAS_64k; + hCPE->brate_surplus -= ( hCPE->element_brate - element_brate_ref ); + } + + /* write OMASA stereo mode signalling */ + if ( hCPE->element_mode == IVAS_CPE_MDCT ) + { + push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 1, NBITS_ELEMENT_MODE ); + } + else + { + push_indice( hCPE->hCoreCoder[0]->hBstr, IND_SMODE_OMASA, 0, NBITS_ELEMENT_MODE ); + } + } + } + + return; +} +#endif -- GitLab From e28b3e16c201fb0ce772b6a91e68f692ed9be873 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Tue, 20 Jun 2023 13:58:01 +0200 Subject: [PATCH 0229/1418] Fix memleak --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index fe524ca6a1..7eb54cd66d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ #define FIX_XXX_ISM_SBA_ASAN #define API_5MS #define LIB_REND_API_5MS /* FhG: Adds 5ms framing capability to lib_rend */ +#define LIB_REND_FIX_HRTFPARAMBIN_MEMLEAK #define SGI_DBG /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6a5656d0a4..942b8c546f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2803,6 +2803,12 @@ static void freeDecoderDummy( { free( pDecDummy->hCombinedOrientationData ); } +#ifdef LIB_REND_FIX_HRTFPARAMBIN_MEMLEAK + if ( pDecDummy->hHrtfParambin != NULL ) + { + free( pDecDummy->hHrtfParambin ); + } +#endif ivas_render_config_close( &pDecDummy->hRenderConfig ); -- GitLab From 4a43f57b7bef7696ef73dbeb96174471f252c1bc Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 20 Jun 2023 15:15:01 +0200 Subject: [PATCH 0230/1418] clan-format --- lib_dec/lib_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 849cc416b4..e6b4f977f8 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2579,7 +2579,7 @@ static ivas_error printConfigInfo_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MC_FORMAT ) #else - else /* MC_FORMAT */ + else /* MC_FORMAT */ #endif { if ( ( error = get_channel_config( st_ivas->transport_config, &config_str[0] ) ) != IVAS_ERR_OK ) -- GitLab From 76739e9ac24b91f33b83dbee984304a49384d059 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 20 Jun 2023 16:56:20 +0300 Subject: [PATCH 0231/1418] Use previous subframe for starting external orientation interpolation. Fix frozen orientations. --- lib_com/options.h | 1 + lib_rend/ivas_rotation.c | 88 +++++++++++++++++++++++++++++++++++++++ lib_rend/ivas_stat_rend.h | 8 ++++ 3 files changed, 97 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8a4dc67706..a375892ae8 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ +#define FIX_570_SF_EXT_ORIENTATION /* Nokia: Issue 570: Use correct subframe for external orientations interpolation */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 2cd2744b5a..c113f23672 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -789,8 +789,10 @@ ivas_error ivas_combined_orientation_open( { ( *hCombinedOrientationData )->enableCombinedOrientation[i] = 0; ( *hCombinedOrientationData )->Quaternions[i] = identity; +#ifndef FIX_570_SF_EXT_ORIENTATION ( *hCombinedOrientationData )->Quaternions_prev_headRot[i] = identity; ( *hCombinedOrientationData )->Quaternions_prev_extOrientation[i] = identity; +#endif ( *hCombinedOrientationData )->listenerPos[i] = origo; for ( j = 0; j < 3; j++ ) @@ -799,6 +801,11 @@ ivas_error ivas_combined_orientation_open( ( *hCombinedOrientationData )->Rmat[i][j][j] = 1.0f; } } +#ifdef FIX_570_SF_EXT_ORIENTATION + ( *hCombinedOrientationData )->Quaternion_prev_extOrientation = identity; + ( *hCombinedOrientationData )->Quaternion_frozen_ext = identity; + ( *hCombinedOrientationData )->Quaternion_frozen_head = identity; +#endif for ( j = 0; j < 3; j++ ) { @@ -811,6 +818,11 @@ ivas_error ivas_combined_orientation_open( set_zero( ( *hCombinedOrientationData )->procChEneIIR[0], MASA_FREQUENCY_BANDS ); set_zero( ( *hCombinedOrientationData )->procChEneIIR[1], MASA_FREQUENCY_BANDS ); +#ifdef FIX_570_SF_EXT_ORIENTATION + ( *hCombinedOrientationData )->isExtOrientationFrozen = 0; + ( *hCombinedOrientationData )->isHeadRotationFrozen = 0; +#endif + return IVAS_ERR_OK; } @@ -981,6 +993,23 @@ static ivas_error combine_external_and_head_orientations( /* External orientations */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifdef FIX_570_SF_EXT_ORIENTATION + /* Check for frozen external orientation */ + if ( hExtOrientationData->enableExternalOrientation[i] == 2 ) + { + if ( hCombinedOrientationData->isExtOrientationFrozen != 1 ) + { + hCombinedOrientationData->Quaternion_frozen_ext = hExtOrientationData->Quaternions[i]; + hCombinedOrientationData->isExtOrientationFrozen = 1; + } + } + else + { + hCombinedOrientationData->Quaternion_frozen_ext = identity; + hCombinedOrientationData->isExtOrientationFrozen = 0; + } +#endif + if ( hExtOrientationData->enableRotationInterpolation[i] == 1 && hExtOrientationData->enableExternalOrientation[i] > 0 ) { if ( hCombinedOrientationData->isInterpolationOngoing == TRUE && hCombinedOrientationData->interpolationCoefficient <= 1.0f && are_orientations_same( &hCombinedOrientationData->Quaternions_ext_interpolation_target, &hExtOrientationData->Quaternions[i] ) == true ) @@ -1010,7 +1039,11 @@ static ivas_error combine_external_and_head_orientations( /* Use the freezed external orientation */ else if ( hExtOrientationData->enableExternalOrientation[i] == 2 ) { +#ifdef FIX_570_SF_EXT_ORIENTATION + hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_ext; +#else hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternions_prev_extOrientation[i]; +#endif } } } @@ -1021,6 +1054,22 @@ static ivas_error combine_external_and_head_orientations( /* Combine head and external orientations */ for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifdef FIX_570_SF_EXT_ORIENTATION + /* Check for frozen head rotation */ + if ( hExtOrientationData->enableHeadRotation[i] == 2 && numHeadRotQuaternions >= 0 ) + { + if ( hCombinedOrientationData->isHeadRotationFrozen != 1 ) + { + hCombinedOrientationData->Quaternion_frozen_head = headRotQuaternions[i]; + hCombinedOrientationData->isHeadRotationFrozen = 1; + } + } + else + { + hCombinedOrientationData->Quaternion_frozen_head = identity; + hCombinedOrientationData->isHeadRotationFrozen = 0; + } +#endif /* Use the most recent head rotation */ if ( hExtOrientationData->enableHeadRotation[i] == 1 && numHeadRotQuaternions >= 0 ) { @@ -1038,11 +1087,19 @@ static ivas_error combine_external_and_head_orientations( { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) { +#ifdef FIX_570_SF_EXT_ORIENTATION + QuaternionProduct( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternion_frozen_head, &hCombinedOrientationData->Quaternions[i] ); +#else QuaternionProduct( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternions_prev_headRot[i], &hCombinedOrientationData->Quaternions[i] ); +#endif } else { +#ifdef FIX_570_SF_EXT_ORIENTATION + hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_head; +#else hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternions_prev_headRot[i]; +#endif } } @@ -1066,6 +1123,16 @@ static ivas_error combine_external_and_head_orientations( /* Save the current orientations */ if ( hExtOrientationData != NULL ) { +#ifdef FIX_570_SF_EXT_ORIENTATION + if ( hExtOrientationData->enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES - 1] > 0 ) + { + hCombinedOrientationData->Quaternion_prev_extOrientation = hCombinedOrientationData->Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES - 1]; + } + else + { + hCombinedOrientationData->Quaternion_prev_extOrientation = identity; + } +#else for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { if ( hExtOrientationData->enableExternalOrientation[i] > 0 ) @@ -1077,11 +1144,13 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions_prev_extOrientation[i] = identity; } } +#endif } if ( headRotQuaternions != NULL ) { for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { +#ifndef FIX_570_SF_EXT_ORIENTATION if ( hExtOrientationData != NULL ) { if ( hExtOrientationData->enableHeadRotation[i] > 0 && numHeadRotQuaternions >= 0 ) @@ -1104,6 +1173,7 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->Quaternions_prev_headRot[i] = identity; } } +#endif hCombinedOrientationData->listenerPos[i] = listenerPos[i]; } } @@ -1189,7 +1259,25 @@ static void external_target_interpolation( hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternions[i]; /* Use the most recent external orientation as the starting orientation */ +#ifdef FIX_570_SF_EXT_ORIENTATION + if ( hExtOrientationData->enableExternalOrientation[i] == 1 ) + { + if ( i > 0 ) + { + hCombinedOrientationData->Quaternions_ext_interpolation_start = hExtOrientationData->Quaternions[i - 1]; + } + else + { + hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternion_prev_extOrientation; + } + } + else if ( hExtOrientationData->enableExternalOrientation[i] == 2 ) + { + hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternion_frozen_ext; + } +#else hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternions_prev_extOrientation[i]; +#endif /* Calculate the interpolation increment and coefficient */ hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES ); diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c763630325..8ed74b1e2c 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -304,8 +304,12 @@ typedef struct ivas_combined_orientation_struct float lrSwitchInterpVal; bool isInterpolationOngoing; IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; +#ifdef FIX_570_SF_EXT_ORIENTATION + IVAS_QUATERNION Quaternion_prev_extOrientation; +#else IVAS_QUATERNION Quaternions_prev_headRot[MAX_PARAM_SPATIAL_SUBFRAMES]; IVAS_QUATERNION Quaternions_prev_extOrientation[MAX_PARAM_SPATIAL_SUBFRAMES]; +#endif IVAS_QUATERNION Quaternions_ext_interpolation_start; IVAS_QUATERNION Quaternions_ext_interpolation_target; float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3]; @@ -314,6 +318,10 @@ typedef struct ivas_combined_orientation_struct float procChEneIIR[2][MASA_FREQUENCY_BANDS]; int16_t shd_rot_max_order; IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_QUATERNION Quaternion_frozen_ext; + IVAS_QUATERNION Quaternion_frozen_head; + int8_t isExtOrientationFrozen; + int8_t isHeadRotationFrozen; } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; -- GitLab From 2ea956e53bc3b2f089b88c234fbb3061a4457875 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 21 Jun 2023 15:17:23 +1000 Subject: [PATCH 0232/1418] fixes for errors in SPLIT CLDFB out format --- .../split_renderer_config_pcm_1dof.txt | 2 +- .../split_renderer_config_pcm_2dof.txt | 2 +- .../split_renderer_config_pcm_3dof.txt | 2 +- .../split_renderer_config_pcm_3dof_hq.txt | 3 +- .../sample_split_rend_script_ivas_enc_dec.py | 4 +-- .../sample_split_rend_script_ivas_rend.py | 2 +- lib_rend/lib_rend.c | 33 +++++++++++++------ 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt index f70f7e67ce..d956b90ce6 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_1dof.txt @@ -1,5 +1,5 @@ [SPLITREND] -BITRATE = 50000; +BITRATE = 256000; DOF = 1; HQMODE = 0; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt index 5bf2217ded..d8eb266458 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_2dof.txt @@ -1,5 +1,5 @@ [SPLITREND] -BITRATE = 50000; +BITRATE = 384000; DOF = 2; HQMODE = 0; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt index 193bc890a4..e8c9088862 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof.txt @@ -1,5 +1,5 @@ [SPLITREND] -BITRATE = 70000; +BITRATE = 512000; DOF = 3; HQMODE = 0; diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt index e559a44f33..6b33fc28cd 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_pcm_3dof_hq.txt @@ -1,7 +1,8 @@ [SPLITREND] -BITRATE = 70000; +BITRATE = 768000; DOF = 3; HQMODE = 1; +CODEC = 1; [GENERAL] RENDERER = CREND; diff --git a/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py b/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py index 4cfd0f32d1..7de05dba01 100644 --- a/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py +++ b/Workspace_msvc/sample_split_rend_script_ivas_enc_dec.py @@ -7,7 +7,7 @@ import os ## dimension of following 2 arrays should be same, that is for each file name there should be a tag file_names = [ -'../scripts/testv/test_HOA3.wav' +'../scripts/testv/stv3OA48c.wav' ]; file_tags = [ 'test_HOA3' @@ -91,7 +91,7 @@ def generate_split_rend_lis_items(file_dir, exe_dir, out_dir): dec_exe, '-RENDER_CONFIG', renderers[rend][1], '-t', hr_pre_file, - 'SPLIT_BINAURAL', + 'BINAURAL_SPLIT_CLDFB', '48', file_pkt, bs_file_out diff --git a/Workspace_msvc/sample_split_rend_script_ivas_rend.py b/Workspace_msvc/sample_split_rend_script_ivas_rend.py index c6ccd8e422..12ed4e09b3 100644 --- a/Workspace_msvc/sample_split_rend_script_ivas_rend.py +++ b/Workspace_msvc/sample_split_rend_script_ivas_rend.py @@ -7,7 +7,7 @@ import os ## dimension of following 2 arrays should be same, that is for each file name there should be a tag file_names = [ -'../scripts/testv/test_HOA3.wav' +'../scripts/testv/stv3OA48c.wav' ]; file_tags = [ 'test_HOA3' diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1647424486..0db8bdc162 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3255,12 +3255,12 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN } else { - IVAS_REND_AudioBufferConfig bufConfig; + IVAS_REND_AudioBufferConfig bufConfig2; - bufConfig.numSamplesPerChannel = 0; - bufConfig.numChannels = 0; - bufConfig.is_cldfb = 0; - pSplitRendEncBuffer->config = bufConfig; + bufConfig2.numSamplesPerChannel = 0; + bufConfig2.numChannels = 0; + bufConfig2.is_cldfb = 0; + pSplitRendEncBuffer->config = bufConfig2; pSplitRendEncBuffer->data = NULL; } @@ -4289,7 +4289,7 @@ ivas_error IVAS_REND_GetDelay( { int32_t lc3plusDelaySamples; IVAS_LC3PLUS_DEC_GetDelay( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec, &lc3plusDelaySamples ); - max_latency_ns = max( max_latency_ns, roundf( lc3plusDelaySamples * 1000000000.f / *timeScale ) ); + max_latency_ns = max( max_latency_ns, (int32_t) roundf( lc3plusDelaySamples * 1000000000.f / *timeScale ) ); } else { @@ -6233,7 +6233,7 @@ static ivas_error splitBinLc3plusDecode( } /* Read LC3plus bitstream size info */ lc3plusBitrateId = ivas_split_rend_bitstream_read_int32( bits, 8 ); - lc3plusBitstreamSize = ivas_get_lc3plus_size_from_id( lc3plusBitrateId, pose_correction ); + lc3plusBitstreamSize = ivas_get_lc3plus_size_from_id( (int8_t) lc3plusBitrateId, pose_correction ); #ifdef SPLIT_REND_LC3PLUS_HBR_DBG if ( lc3plusBitstreamSize == -1 ) { @@ -6559,7 +6559,9 @@ static ivas_error renderSbaToSplitBinaural( #endif ivas_split_rend_bits_t bits; int16_t low_res_pre_rend_rot, max_band; - +#ifdef SPLIT_REND_LC3PLUS + int16_t td_input; +#endif low_res_pre_rend_rot = 1; //( *sbaInput->base.ctx.pSplitRendBitRate == SPLIT_REND_768k ) ? 0 : 1; @@ -6597,6 +6599,9 @@ static ivas_error renderSbaToSplitBinaural( low_res_pre_rend_rot ); #endif max_band = sbaInput->cldfbRendWrapper.hCldfbRend->max_band; +#ifdef SPLIT_REND_LC3PLUS + td_input = 0; +#endif } else #endif @@ -6610,6 +6615,9 @@ static ivas_error renderSbaToSplitBinaural( { accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); } +#ifdef SPLIT_REND_LC3PLUS + td_input = 1; +#endif } /*SPLIT pre rendering MD and CLDFB coding*/ @@ -6628,7 +6636,7 @@ static ivas_error renderSbaToSplitBinaural( tmpCrendBuffer, low_res_pre_rend_rot, #ifdef SPLIT_REND_LC3PLUS - 1, + td_input, #endif ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); @@ -6871,7 +6879,12 @@ static ivas_error renderInputSba( inAudio = sbaInput->base.inputBuffer; +#ifdef SPLIT_REND_LC3PLUS + if ( ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) && + ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ) +#else if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) +#endif { /* Mismatch between the number of input samples vs number of requested output samples - currently not allowed */ return IVAS_ERR_INVALID_BUFFER_SIZE; @@ -7316,7 +7329,7 @@ ivas_error IVAS_REND_GetSamples( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000, + ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, 1, -- GitLab From 43747a1f8487b5987f6f9188437d254b35262b34 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 21 Jun 2023 08:12:48 +0200 Subject: [PATCH 0233/1418] remove obsolete define --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 543bc7e451..b4773b1615 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,7 +150,6 @@ #ifdef IND_LIST_DYN #define FIX_545_ASSERT /* VA: fix issue 545, replace assert() with warning message when hitting memory limit in the buffer of indices */ #endif -#define FIX_ITD_CNG /* Eri: Fix for CNG ITD */ #define FIX_383_CLEAN_UP /* Dlb : Clean up of unused functions */ #define FIX_532_ISM_MD_INACTIVE /* VA: issue 532: improve MD coding in ISM inactive frames */ -- GitLab From 7b5d298261aaa07a3bff07771f0cda7a2956021d Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Wed, 21 Jun 2023 09:34:44 +0300 Subject: [PATCH 0234/1418] Save the previous ext rotation from the ext data and not from the combined orientation data --- lib_rend/ivas_rotation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index c113f23672..205fc271d0 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -1126,7 +1126,7 @@ static ivas_error combine_external_and_head_orientations( #ifdef FIX_570_SF_EXT_ORIENTATION if ( hExtOrientationData->enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES - 1] > 0 ) { - hCombinedOrientationData->Quaternion_prev_extOrientation = hCombinedOrientationData->Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES - 1]; + hCombinedOrientationData->Quaternion_prev_extOrientation = hExtOrientationData->Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES - 1]; } else { -- GitLab From 926dddd71f71da0be0357d789bd2a34cd554ba1a Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 21 Jun 2023 10:37:30 +0300 Subject: [PATCH 0235/1418] Consolidate switches within OMASA --- lib_com/cnst.h | 2 +- lib_com/ivas_cnst.h | 4 +-- lib_com/ivas_prot.h | 31 +++++++--------------- lib_com/ivas_stereo_td_bit_alloc.c | 6 ----- lib_com/options.h | 4 --- lib_dec/ivas_cpe_dec.c | 14 ++++------ lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_masa_dec.c | 2 -- lib_dec/ivas_omasa_dec.c | 38 +-------------------------- lib_dec/ivas_stat_dec.h | 13 +++++----- lib_dec/ivas_stereo_td_dec.c | 4 --- lib_enc/ivas_cpe_enc.c | 14 ++++------ lib_enc/ivas_enc.c | 41 +++++------------------------- lib_enc/ivas_ism_enc.c | 24 +++-------------- lib_enc/ivas_ism_metadata_enc.c | 17 +++---------- lib_enc/ivas_masa_enc.c | 10 -------- lib_enc/ivas_omasa_enc.c | 2 -- lib_enc/ivas_stat_enc.h | 2 -- lib_enc/ivas_stereo_td_enc.c | 4 --- 19 files changed, 44 insertions(+), 190 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 9881b9d038..0f20b0a647 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -263,7 +263,7 @@ enum{ enum { IND_IVAS_FORMAT, -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS IND_SMODE_OMASA, #endif IND_SMODE, diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3d5ee66a48..a6e80bb1a5 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -363,7 +363,7 @@ typedef enum #ifdef MASA_AND_OBJECTS #define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM no meta / inactive frames */ #define BITS_ISM_INACTIVE ( BRATE_ISM_INACTIVE / FRAMES_PER_SEC ) -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS #define ADJUST_ISM_BRATE_NEG 6000 #define ADJUST_ISM_BRATE_POS 8000 #endif @@ -1280,7 +1280,7 @@ enum #define MASA_STEREO_MIN_BITRATE IVAS_24k4 #ifdef MASA_AND_OBJECTS #define MAXIMUM_OMASA_FREQ_BANDS 8 /* Corresponds to maximum number of coding bands at 32 kbps */ -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS #define OMASA_STEREO_SW_CNT_MAX 100 #define OMASA_STEREO_SW_CNT_MAX2 5 #endif diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f339361592..52ed50f3b9 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -969,7 +969,7 @@ ivas_error ivas_ism_enc( float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ const int16_t input_frame, /* i : input frame length per channel */ int16_t *nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS , const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif @@ -992,14 +992,10 @@ ivas_error ivas_ism_metadata_enc( const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ #ifdef MASA_AND_OBJECTS - ,const float lp_noise_CPE /* i : LP filterend total noise estimation */ -#ifdef OMASA_ENERGIES , - const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif -#ifdef FIX_OMASA_STEREO_SWITCHING - ,int16_t *omasa_stereo_sw_cnt -#endif + const float lp_noise_CPE, /* i : LP filterend total noise estimation */ + const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ + int16_t *omasa_stereo_sw_cnt #endif ); @@ -1988,9 +1984,7 @@ void stereo_td_init_dec( void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i: ISM mode in combined format */ -#endif + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ @@ -2043,9 +2037,7 @@ void tdm_ol_pitch_comparison( void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i: ISM mode in combined format */ -#endif + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ @@ -2065,9 +2057,7 @@ ivas_error signaling_enc_secondary( void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k - const int16_t ism_mode, /* i: ISM mode in combined format */ -#endif + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ @@ -5108,12 +5098,9 @@ ivas_error ivas_masa_encode( ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS], /* i : ISM metadata handle */ const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ - const int16_t ism_imp /* i : importance of separated object */ -#ifdef OMASA_ENERGIES - , + const int16_t ism_imp, /* i : importance of separated object */ const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif -#endif ); void ivas_masa_estimate_energy( @@ -5761,7 +5748,7 @@ void set_ism_importance_interformat( int16_t ism_imp[] /* o : ISM importance flags */ ); -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS /*! r: flag for using less bitrate for objects in OMASA */ int16_t ivas_omasa_ener_brate( const int16_t nchan_ism, /* i : number of ISMs */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 345fef4b3a..b09cfd5384 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -76,9 +76,7 @@ void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k const int16_t ism_mode, /* i: ISM mode in combined format */ -#endif #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ @@ -143,11 +141,7 @@ void tdm_bit_alloc( /* secondary channel bitrate allocation based on the energy scaling ratio */ #ifdef MASA_AND_OBJECTS -#ifdef FIX_OMASA_24_4k if ( ( ( ivas_format != MASA_ISM_FORMAT || ism_mode == ISM_MODE_NONE ) && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && ism_mode != ISM_MODE_NONE && coder_type > UNVOICED ) ) -#else - if ( ( ivas_format != MASA_ISM_FORMAT && ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) ) || ( ivas_format == MASA_ISM_FORMAT && coder_type > UNVOICED ) ) -#endif #else if ( ( coder_type != UNVOICED ) || tdm_LRTD_flag == 1 ) #endif diff --git a/lib_com/options.h b/lib_com/options.h index 17d991b02e..2ce5ec26a2 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,11 +172,7 @@ #define MASA_AND_OBJECTS /* Nokia: Combination of MASA and objects */ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ -#define OMASA_ENERGIES -#define FIX_OMASA_STEREO_SWITCHING /* VA: introduce Unified/MDCT stereo switching for 3ISM @96 kbps and 4ISM @128 kbps */ -#define FIX_OMASA_BRSW /* Nokia + VA: Fix missing init of OMASA metadata delay buffers, brsw-related init fixes */ #define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix -#define FIX_OMASA_24_4k /* Nokia: fix OMASA in TD mode at 24.4k */ #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index bc0bb3c5b4..45dfa3a0aa 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -52,7 +52,7 @@ static void read_stereo_mode_and_bwidth( CPE_DEC_HANDLE hCPE, const Decoder_Struct *st_ivas ); -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS static void stereo_mode_combined_format_dec( const Decoder_Struct *st_ivas, CPE_DEC_HANDLE hCPE ); #endif @@ -83,9 +83,7 @@ ivas_error ivas_cpe_dec( ivas_error error; #ifdef MASA_AND_OBJECTS int32_t cpe_brate; -#ifdef FIX_OMASA_STEREO_SWITCHING int32_t element_brate_ref; -#endif #endif error = IVAS_ERR_OK; @@ -103,7 +101,7 @@ ivas_error ivas_cpe_dec( sts[0]->BER_detect |= st_ivas->BER_detect; sts[1]->BER_detect |= st_ivas->BER_detect; -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS element_brate_ref = hCPE->element_brate; #endif @@ -111,7 +109,7 @@ ivas_error ivas_cpe_dec( * Read stereo technology info & audio bandwidth *-----------------------------------------------------------------*/ -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS stereo_mode_combined_format_dec( st_ivas, hCPE ); #endif @@ -420,9 +418,7 @@ ivas_error ivas_cpe_dec( tdm_configure_dec( #ifdef MASA_AND_OBJECTS st_ivas->ivas_format, -#ifdef FIX_OMASA_24_4k st_ivas->ism_mode, -#endif #endif hCPE, &tdm_ratio_idx, nb_bits_metadata ); @@ -570,7 +566,7 @@ ivas_error ivas_cpe_dec( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { hCPE->element_brate = element_brate_ref; @@ -1151,7 +1147,7 @@ static void read_stereo_mode_and_bwidth( } -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * stereo_mode_combined_format_dec() * diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index ce637a3c2b..adb7e1006d 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -957,7 +957,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef FIX_OMASA_BRSW +#ifdef MASA_AND_OBJECTS /* if we start in ISM_MODE_NONE in MASA_ISM, that appears as normal MASA, but we may change to a mode with ISMs */ st_ivas->ism_extmeta_active = -1; st_ivas->ism_extmeta_cnt = 0; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index b82f696e1e..0790b94244 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -266,14 +266,12 @@ ivas_error ivas_masa_decode( #endif } } -#ifdef OMASA_ENERGIES st_ivas->flag_omasa_brate = 0; if ( st_ivas->nchan_ism >= 3 && ivas_total_brate == IVAS_128k ) { st_ivas->flag_omasa_brate = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read ) += 1; } -#endif } } #endif diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index b8aba3bacc..b419da1b59 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -55,9 +55,7 @@ ivas_error ivas_masa_ism_data_open( { MASA_ISM_DATA_HANDLE hMasaIsmData; int16_t ch, bin; -#ifdef FIX_OMASA_BRSW int16_t sf, obj_idx; -#endif if ( ( hMasaIsmData = (MASA_ISM_DATA_HANDLE) malloc( sizeof( MASA_ISM_DATA ) ) ) == NULL ) { @@ -86,7 +84,6 @@ ivas_error ivas_masa_ism_data_open( hMasaIsmData->q_azimuth_old[ch] = 0.0f; } -#ifdef FIX_OMASA_BRSW for ( obj_idx = 0; obj_idx < MAX_NUM_OBJECTS; obj_idx++ ) { set_s( hMasaIsmData->azimuth_ism[obj_idx], 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); @@ -98,7 +95,6 @@ ivas_error ivas_masa_ism_data_open( } set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); -#endif st_ivas->hMasaIsmData = hMasaIsmData; @@ -155,10 +151,7 @@ ivas_error ivas_omasa_dec_config( ISM_MODE ism_mode_old; IVAS_FORMAT ivas_format_orig; ivas_error error; - -#ifdef FIX_OMASA_BRSW RENDERER_TYPE old_renderer_type; -#endif /* initializations */ ism_total_brate = 0; @@ -179,13 +172,11 @@ ivas_error ivas_omasa_dec_config( /* set ism_mode of current frame */ st_ivas->ism_mode = ivas_omasa_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); -#ifdef FIX_OMASA_BRSW /*-----------------------------------------------------------------* * Renderer selection *-----------------------------------------------------------------*/ old_renderer_type = st_ivas->renderer_type; -#endif /* MASA reconfig. */ cpe_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); @@ -272,28 +263,8 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#ifndef FIX_OMASA_BRSW -#ifdef FIX_417_TD_DECORR_BRATE_SW - /* TD Decorrelator */ - if ( st_ivas->hDiracDecBin != NULL ) - { - if ( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin->hTdDecorr ), &( st_ivas->hDiracDecBin->useTdDecorr ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif - - /* CLDFB instances */ - if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif - st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; -#ifdef FIX_OMASA_BRSW /*-----------------------------------------------------------------* * Renderer selection *-----------------------------------------------------------------*/ @@ -322,7 +293,6 @@ ivas_error ivas_omasa_dec_config( } } } -#endif /* objects renderer reconfig. */ if ( st_ivas->ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hIsmRendererData != NULL ) @@ -394,8 +364,6 @@ ivas_error ivas_omasa_dec_config( } } -#ifdef FIX_OMASA_BRSW -#ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -407,7 +375,6 @@ ivas_error ivas_omasa_dec_config( return error; } } -#endif /*-----------------------------------------------------------------* * CLDFB instances @@ -417,7 +384,6 @@ ivas_error ivas_omasa_dec_config( { return error; } -#endif } return IVAS_ERR_OK; @@ -483,7 +449,7 @@ void ivas_set_surplus_brate_dec( st_ivas->hSCE[n]->element_brate = element_brate[n]; *ism_total_brate += ivas_interformat_brate( ISM_MASA_MODE_DISC, st_ivas->nchan_ism, st_ivas->hSCE[n]->element_brate, st_ivas->hIsmMetaData[n]->ism_imp, brate_limit_flag ); -#ifdef OMASA_ENERGIES + if ( ism_imp[n] > 1 && st_ivas->flag_omasa_brate == 1 && brate_limit_flag >= 0 ) { *ism_total_brate -= ADJUST_ISM_BRATE_NEG; @@ -493,8 +459,6 @@ void ivas_set_surplus_brate_dec( { *ism_total_brate += ADJUST_ISM_BRATE_POS; } - -#endif } st_ivas->hCPE[0]->brate_surplus = ism_total_brate_ref - *ism_total_brate; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 6bf14a6a38..d52cf0dc4f 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1381,17 +1381,16 @@ typedef struct Decoder_Struct RENDER_CONFIG_DATA *hRenderConfig; /* Renderer config pointer */ int32_t binaural_latency_ns; /* binauralization latency in ns */ #ifdef MASA_AND_OBJECTS - MASA_ISM_DATA_HANDLE hMasaIsmData; /* MASA_ISM rendering structure */ + MASA_ISM_DATA_HANDLE hMasaIsmData; /* MASA_ISM rendering structure */ EXTERNAL_ORIENTATION_HANDLE hExtOrientationData; /* External orientation data structure */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData; /* Combined external and head orientation data structure */ - uint8_t editing_ism_enabled; /* Todo Nokia: Temporary, used until proper ISM control available */ - int16_t index_of_edited_ism; /* Todo Nokia: Temporary, used until proper ISM control available */ - int16_t azimuth_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ - int16_t elevation_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ -#ifdef OMASA_ENERGIES + uint8_t editing_ism_enabled; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t index_of_edited_ism; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t azimuth_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t elevation_edited; /* Todo Nokia: Temporary, used until proper ISM control available */ + int16_t flag_omasa_brate; -#endif #endif /* JBM module */ diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index e90baa0dd8..ed25bd1f81 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -86,9 +86,7 @@ void stereo_td_init_dec( void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ @@ -312,9 +310,7 @@ void tdm_configure_dec( #ifdef MASA_AND_OBJECTS tdm_bit_alloc( ivas_format, -#ifdef FIX_OMASA_24_4k ism_mode, -#endif hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &hStereoTD->tdm_low_rate_mode, sts[1]->coder_type, *tdm_ratio_idx, hStereoTD->tdm_Pitch_reuse_flag, diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 84f28f28be..2631a7ca3e 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -45,7 +45,7 @@ #include "wmc_auto.h" -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS /*--------------------------------------------------------------------------* * Local function prototypes *--------------------------------------------------------------------------*/ @@ -112,9 +112,7 @@ ivas_error ivas_cpe_enc( ivas_error error; #ifdef MASA_AND_OBJECTS int32_t cpe_brate; -#ifdef FIX_OMASA_STEREO_SWITCHING int32_t element_brate_ref; -#endif #endif error = IVAS_ERR_OK; @@ -128,7 +126,7 @@ ivas_error ivas_cpe_enc( ivas_format = hEncoderConfig->ivas_format; input_Fs = hEncoderConfig->input_Fs; ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS element_brate_ref = hCPE->element_brate; #endif @@ -186,7 +184,7 @@ ivas_error ivas_cpe_enc( hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate ); } -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS stereo_mode_combined_format_enc( st_ivas, hCPE ); #endif @@ -590,9 +588,7 @@ ivas_error ivas_cpe_enc( tdm_configure_enc( #ifdef MASA_AND_OBJECTS ivas_format, -#ifdef FIX_OMASA_24_4k st_ivas->ism_mode, -#endif #endif hCPE, Etot_last, tdm_SM_or_LRTD_Pri, tdm_ratio_idx, tdm_ratio_idx_SM, attack_flag[0], nb_bits_metadata ); @@ -747,7 +743,7 @@ ivas_error ivas_cpe_enc( hCPE->last_element_brate = hCPE->element_brate; hCPE->last_element_mode = hCPE->element_mode; -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT ) { hCPE->element_brate = element_brate_ref; @@ -1212,7 +1208,7 @@ void destroy_cpe_enc( } -#ifdef FIX_OMASA_STEREO_SWITCHING +#ifdef MASA_AND_OBJECTS /*------------------------------------------------------------------------- * stereo_mode_combined_format_enc() * diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 3898b44fc5..51f7269cc1 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -186,7 +186,7 @@ ivas_error ivas_enc( /* Core coding of Stereo DMX */ if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS , 0 #endif @@ -199,7 +199,7 @@ ivas_error ivas_enc( { /* Analysis, decision about bitrates per channel & core coding */ if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, nb_bits_metadata -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS , 0 #endif @@ -246,11 +246,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 -#endif -#ifdef OMASA_ENERGIES - , - 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0,0 #endif ) ) != IVAS_ERR_OK ) { @@ -298,11 +294,9 @@ ivas_error ivas_enc( { float data_separated_object[L_FRAME48k]; int16_t idx_separated_object; -#ifdef OMASA_ENERGIES int16_t flag_omasa_ener_brate; flag_omasa_ener_brate = 0; -#endif if ( ( error = ivas_omasa_enc_config( st_ivas ) ) != IVAS_ERR_OK ) { @@ -344,29 +338,17 @@ ivas_error ivas_enc( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { - if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1] -#ifdef OMASA_ENERGIES - , - 0 -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1],0 ) ) != IVAS_ERR_OK ) { return error; } } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { -#ifdef OMASA_ENERGIES flag_omasa_ener_brate = ivas_omasa_ener_brate( st_ivas->hEncoderConfig->nchan_ism, ivas_total_brate, data_f, input_frame ); -#endif /* Analysis, decision about bitrates per channel & core coding */ - if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1] -#ifdef OMASA_ENERGIES - , - flag_omasa_ener_brate -#endif - ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, data_f, input_frame, &nb_bits_metadata[1], flag_omasa_ener_brate ) ) != IVAS_ERR_OK ) { return error; } @@ -386,12 +368,7 @@ ivas_error ivas_enc( /* Encode MASA parameters and write MASA metadata bitstream */ if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, nb_bits_metadata, st_ivas->nchan_transport, ivas_format, ivas_total_brate, st_ivas->hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1, - st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp -#ifdef OMASA_ENERGIES - , - flag_omasa_ener_brate -#endif - ) ) != IVAS_ERR_OK ) + st_ivas->ism_mode, hEncoderConfig->nchan_ism, st_ivas->hIsmMetaData, idx_separated_object, st_ivas->hOMasa, st_ivas->hIsmMetaData[0]->ism_imp, flag_omasa_ener_brate ) ) != IVAS_ERR_OK ) { return error; } @@ -481,11 +458,7 @@ ivas_error ivas_enc( if ( ( error = ivas_masa_encode( st_ivas->hMasa, st_ivas->hQMetaData, hMetaData, &nb_bits_metadata[0], st_ivas->nchan_transport, ivas_format, ivas_total_brate, 0, -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0 -#endif -#ifdef OMASA_ENERGIES - , - 0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0, 0 #endif ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index a4943c3a7d..60f3d62da2 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -53,7 +53,7 @@ ivas_error ivas_ism_enc( float data[MAX_NUM_OBJECTS][L_FRAME48k], /* i : input signal */ const int16_t input_frame, /* i : input frame length per channel */ int16_t *nb_bits_metadata /* i : number of metadata bits */ -#ifdef OMASA_ENERGIES +#ifdef MASA_AND_OBJECTS , const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif @@ -256,16 +256,7 @@ ivas_error ivas_ism_enc( { #ifdef MASA_AND_OBJECTS ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, 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, -1 -#ifdef OMASA_ENERGIES - , - 0 -#endif -#ifdef FIX_OMASA_STEREO_SWITCHING - , - NULL -#endif - ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1,0,NULL ); #else ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, 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 ); #endif @@ -289,16 +280,7 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, 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, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0 -#ifdef OMASA_ENERGIES - , - flag_omasa_ener_brate -#endif -#ifdef FIX_OMASA_STEREO_SWITCHING - , - st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL -#endif - ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0, flag_omasa_ener_brate ,st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL ); if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 53f0dd7941..07925a603a 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -191,16 +191,10 @@ ivas_error ivas_ism_metadata_enc( const int16_t ism_extended_metadata_flag /* i : Extended metadata flag */ #ifdef MASA_AND_OBJECTS , - const float lp_noise_CPE -#ifdef OMASA_ENERGIES - , - const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ -#endif -#ifdef FIX_OMASA_STEREO_SWITCHING - , + const float lp_noise_CPE, + const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ int16_t *omasa_stereo_sw_cnt #endif -#endif ) { int16_t i, ch, nb_bits_start = 0; @@ -703,7 +697,7 @@ ivas_error ivas_ism_metadata_enc( for ( ch = 0; ch < nchan_ism; ch++ ) { *ism_total_brate += ivas_interformat_brate( ism_mode, nchan_ism, hSCE[ch]->element_brate, ism_imp[ch], brate_limit_flag ); -#ifdef OMASA_ENERGIES + if ( ism_imp[ch] > 1 && flag_omasa_ener_brate == 1 && brate_limit_flag >= 0 ) { *ism_total_brate -= ADJUST_ISM_BRATE_NEG; @@ -713,11 +707,9 @@ ivas_error ivas_ism_metadata_enc( { *ism_total_brate += ADJUST_ISM_BRATE_POS; } - -#endif } ism_metadata_flag_global = 1; -#ifdef FIX_OMASA_STEREO_SWITCHING + if ( ism_mode == ISM_MASA_MODE_DISC ) { brate_limit_flag = 0; @@ -731,7 +723,6 @@ ivas_error ivas_ism_metadata_enc( *omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; } } -#endif } #endif diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index ea01bf0dc9..7c3557332d 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -181,10 +181,8 @@ ivas_error ivas_masa_enc_open( #ifdef MASA_AND_OBJECTS hMasa->data.lp_noise_CPE = -1; -#ifdef FIX_OMASA_STEREO_SWITCHING hMasa->data.omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; hMasa->data.omasa_stereo_sw_cnt2 = OMASA_STEREO_SW_CNT_MAX2; -#endif #endif st_ivas->hMasa = hMasa; @@ -246,11 +244,9 @@ ivas_error ivas_masa_encode( const int16_t idx_separated_object, /* i : index of the separated object */ OMASA_ENC_HANDLE hOMasa, /* i : OMASA encoder handle */ const int16_t ism_imp /* i : importance of separated object */ -#ifdef OMASA_ENERGIES , const int16_t flag_omasa_ener_brate /* i : less bitrate for objects in OMASA flag */ #endif -#endif ) { MASA_DIRECTIONAL_SPATIAL_META *h_orig_metadata; @@ -466,13 +462,11 @@ ivas_error ivas_masa_encode( #endif } -#ifdef OMASA_ENERGIES if ( ivas_total_brate == IVAS_128k && nchan_ism >= 3 ) { push_next_indice( hMetaData, flag_omasa_ener_brate, 1 ); hQMetaData->metadata_max_bits -= 1; } -#endif } } else @@ -966,11 +960,7 @@ ivas_error ivas_masa_enc_config( #ifdef MASA_AND_OBJECTS if ( ivas_format == MASA_ISM_FORMAT && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { -#ifdef FIX_OMASA_STEREO_SWITCHING if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT || st_ivas->hMasa->data.omasa_stereo_sw_cnt < OMASA_STEREO_SW_CNT_MAX ) -#else - if ( st_ivas->hCPE[0]->element_mode == IVAS_CPE_DFT ) -#endif { st_ivas->hMasa->data.lp_noise_CPE = st_ivas->hCPE[0]->hCoreCoder[0]->lp_noise; } diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index c10ec862c5..d7bbe7bb6b 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -727,7 +727,6 @@ void ivas_set_surplus_brate_enc( } -#ifdef OMASA_ENERGIES /*--------------------------------------------------------------------------* * ivas_omasa_ener_brate() * @@ -771,7 +770,6 @@ int16_t ivas_omasa_ener_brate( return flag_omasa_ener_brate; } -#endif /*--------------------------------------------------------------------------* diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index c8c78d41b5..bc92b581aa 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -787,10 +787,8 @@ typedef struct ivas_masa_encoder_data_struct float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; int16_t nchan_ism; float lp_noise_CPE; /* LP filterend total noise estimation */ -#ifdef FIX_OMASA_STEREO_SWITCHING int16_t omasa_stereo_sw_cnt; int16_t omasa_stereo_sw_cnt2; -#endif #endif int16_t num_Cldfb_instances; diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 071ef6d361..35b2bd1b49 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -312,9 +312,7 @@ ivas_error stereo_set_tdm( void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ -#ifdef FIX_OMASA_24_4k const int16_t ism_mode, /* i : ISM mode in combined format */ -#endif #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ @@ -496,9 +494,7 @@ void tdm_configure_enc( #ifdef MASA_AND_OBJECTS tdm_bit_alloc( ivas_format, -#ifdef FIX_OMASA_24_4k ism_mode, -#endif hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus, hStereoTD->tdm_lp_reuse_flag, &( sts[0]->total_brate ), &( sts[1]->total_brate ), &( hStereoTD->tdm_low_rate_mode ), sts[1]->coder_type, tdm_ratio_bit_alloc_idx, hStereoTD->tdm_Pitch_reuse_flag, -- GitLab From e14f1c10f3c7011bd4b71a528abbc8e748dc58f7 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 21 Jun 2023 11:37:54 +0300 Subject: [PATCH 0236/1418] Apply clang format --- lib_com/ivas_stereo_td_bit_alloc.c | 2 +- lib_dec/ivas_stereo_td_dec.c | 2 +- lib_dec/lib_dec.c | 2 +- lib_enc/ivas_enc.c | 4 ++-- lib_enc/ivas_ism_enc.c | 4 ++-- lib_enc/ivas_ism_metadata_enc.c | 2 +- lib_enc/ivas_stereo_td_enc.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index b09cfd5384..823c1b1944 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -76,7 +76,7 @@ void tdm_bit_alloc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i: ISM mode in combined format */ + const int16_t ism_mode, /* i: ISM mode in combined format */ #endif const int32_t element_brate_wo_meta, /* i : element bitrate without metadata */ const int16_t tdm_lp_reuse_flag, /* i : LPC reusage flag */ diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index ed25bd1f81..3b654960c1 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -86,7 +86,7 @@ void stereo_td_init_dec( void tdm_configure_dec( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i : ISM mode in combined format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ int16_t *tdm_ratio_idx, /* o : ratio index */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 849cc416b4..e6b4f977f8 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2579,7 +2579,7 @@ static ivas_error printConfigInfo_dec( #ifdef MASA_AND_OBJECTS else if ( st_ivas->ivas_format == MC_FORMAT ) #else - else /* MC_FORMAT */ + else /* MC_FORMAT */ #endif { if ( ( error = get_channel_config( st_ivas->transport_config, &config_str[0] ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 51f7269cc1..8c58bdc083 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -246,7 +246,7 @@ ivas_error ivas_enc( ivas_total_brate, hEncoderConfig->Opt_DTX_ON, st_ivas->nchan_transport == 2 ? st_ivas->hCPE[0]->element_mode : -1 #ifdef MASA_AND_OBJECTS , - ISM_MODE_NONE, -1, NULL, -1, NULL, 0,0 + ISM_MODE_NONE, -1, NULL, -1, NULL, 0, 0 #endif ) ) != IVAS_ERR_OK ) { @@ -338,7 +338,7 @@ ivas_error ivas_enc( } else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) { - if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1],0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_ism_enc( st_ivas, &data_separated_object, input_frame, &nb_bits_metadata[1], 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 60f3d62da2..3e0dd47585 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -256,7 +256,7 @@ ivas_error ivas_ism_enc( { #ifdef MASA_AND_OBJECTS ivas_ism_metadata_enc( &st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, nchan_transport_ism, 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, -1,0,NULL ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag, -1, 0, NULL ); #else ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, 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 ); #endif @@ -280,7 +280,7 @@ ivas_error ivas_ism_enc( ism_total_brate_ref = ism_total_brate; ivas_ism_metadata_enc( &ism_total_brate, nchan_ism, nchan_transport_ism, 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, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0, flag_omasa_ener_brate ,st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL ); + nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag, st_ivas->hMasa != NULL ? st_ivas->hMasa->data.lp_noise_CPE : 0, flag_omasa_ener_brate, st_ivas->hMasa != NULL ? &( st_ivas->hMasa->data.omasa_stereo_sw_cnt ) : NULL ); if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 9c0bb9ddc3..ea865461c4 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -192,7 +192,7 @@ ivas_error ivas_ism_metadata_enc( #ifdef MASA_AND_OBJECTS , const float lp_noise_CPE, - const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ + const int16_t flag_omasa_ener_brate, /* i : less bitrate for objects in OMASA flag */ int16_t *omasa_stereo_sw_cnt #endif ) diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 35b2bd1b49..e11c0e7ebd 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -312,7 +312,7 @@ ivas_error stereo_set_tdm( void tdm_configure_enc( #ifdef MASA_AND_OBJECTS const int16_t ivas_format, /* i : IVAS format */ - const int16_t ism_mode, /* i : ISM mode in combined format */ + const int16_t ism_mode, /* i : ISM mode in combined format */ #endif CPE_ENC_HANDLE hCPE, /* i : CPE encoder structure */ const float Etot_last[CPE_CHANNELS], /* i/o: Energy of last frame */ -- GitLab From 88da52080109e0f265da649562d96f1450d7b5b4 Mon Sep 17 00:00:00 2001 From: Remco Stoutjesdijk Date: Wed, 21 Jun 2023 18:18:40 +0200 Subject: [PATCH 0237/1418] propagate current output config to internal config --- lib_dec/ivas_output_config.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 16787b63cd..1b82adb84d 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -104,11 +104,19 @@ void ivas_renderer_select( else { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + *internal_config = output_config; +#else *internal_config = AUDIO_CONFIG_BINAURAL; +#endif // FIX_571_REVERB_NOT_ACTIVATED_ISM } #else *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + *internal_config = output_config; +#else *internal_config = AUDIO_CONFIG_BINAURAL; +#endif // FIX_571_REVERB_NOT_ACTIVATED_ISM #endif } else -- GitLab From b93c3030d30f0312d71b84954bf6c696e640b6d8 Mon Sep 17 00:00:00 2001 From: Remco Stoutjesdijk Date: Wed, 21 Jun 2023 18:19:09 +0200 Subject: [PATCH 0238/1418] add compiler define for 571 --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index c13f313a91..b17b2a14d6 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -152,6 +152,7 @@ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ +#define FIX_571_REVERB_NOT_ACTIVATED_ISM /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab From 7e473c0eb54db1a0023e060c2ea39441de8484e8 Mon Sep 17 00:00:00 2001 From: Remco Stoutjesdijk Date: Wed, 21 Jun 2023 18:33:30 +0200 Subject: [PATCH 0239/1418] clangd whispering --- lib_dec/ivas_output_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 1b82adb84d..385a5103df 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -113,7 +113,7 @@ void ivas_renderer_select( #else *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - *internal_config = output_config; + *internal_config = output_config; #else *internal_config = AUDIO_CONFIG_BINAURAL; #endif // FIX_571_REVERB_NOT_ACTIVATED_ISM -- GitLab From a53ad499ccb7ae26c047b2189475d5ac646f9cfb Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 21 Jun 2023 21:24:10 +0300 Subject: [PATCH 0240/1418] Set correct value in MASA external renderer for numParametricDirections --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 540072679f..6f88d3a37b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5880,7 +5880,7 @@ static void copyMasaMetadataToDiracRenderer( int16_t meta_write_index; #ifdef MASA_AND_OBJECTS - hDirAC->numParametricDirections = meta->descriptive_meta.numberOfDirections; + hDirAC->numParametricDirections = meta->descriptive_meta.numberOfDirections + 1; #endif hDirAC->numSimultaneousDirections = meta->descriptive_meta.numberOfDirections + 1; -- GitLab From a54695e79a99dd2687ca5d0386b7fd51b187e0cf Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Wed, 21 Jun 2023 21:34:48 +0300 Subject: [PATCH 0241/1418] Apply clang format --- lib_enc/ivas_init_enc.c | 1 - lib_enc/ivas_omasa_enc.c | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 2266f40206..32403a9b31 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -597,7 +597,6 @@ ivas_error ivas_init_encoder( { return error; } - } if ( ( error = ivas_qmetadata_open( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 4792f64759..7b8206de4b 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -253,15 +253,11 @@ ivas_error ivas_omasa_enc_config( /* re-write IVAS format signalling - actual 'ism_mode' was not known before */ if ( st_ivas->nSCE > 0 ) { - reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, - st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot - ); + reset_indices_enc( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr, st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->nb_bits_tot ); } else { - reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, - st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->nb_bits_tot - ); + reset_indices_enc( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr, st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->nb_bits_tot ); } ivas_write_format( st_ivas ); -- GitLab From bb5621654e47bc8454a2752c16e047f4859ebdf5 Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 22 Jun 2023 15:42:57 +1000 Subject: [PATCH 0242/1418] cross connection to CLDFB codec in ISM split rendering mode --- ...t_renderer_config_768_1dof_hoa_lc3plus.txt | 2 +- lib_com/options.h | 2 ++ lib_rend/ivas_objectRenderer.c | 5 ++++ lib_rend/lib_rend.c | 24 ++++++++++++++++--- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt index 9de2dad1a0..498c6add9b 100644 --- a/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt +++ b/Workspace_msvc/renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt @@ -2,7 +2,7 @@ BITRATE = 768000; DOF = 1; HQMODE = 0; -CODEC = 1 +CODEC = 1; [GENERAL] RENDERER = CREND; diff --git a/lib_com/options.h b/lib_com/options.h index 30e4a8fe4f..05896ce86d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -181,6 +181,8 @@ //#define SPLIT_REND_WITH_HEAD_ROT_DEBUG // only for debugging purposes //#define DBG_WAV_WRITER +#define SPLIT_REND_CLDFB_ISM + #define SPLIT_SIN_SCALING_AND_EXTRAPOL_LIMIT #define SPLIT_REND_ZERO_OUT_YAW_D diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 8fb3497458..f7e4201a5f 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -548,6 +548,11 @@ ivas_error ivas_td_binaural_open_ext( transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT; + +#ifdef SPLIT_REND_WITH_HEAD_ROT + hTransSetup.ls_azimuth = NULL; + hTransSetup.ls_elevation = NULL; +#endif #ifdef TD_TDREND_FIX_NULLPTR_ACCESS if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 0db8bdc162..74bef54eb0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3237,7 +3237,14 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, - 0, 0 ); + + 0, +#ifdef SPLIT_REND_CLDFB_ISM + ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 +#else + 0 +#endif + ); if ( error != IVAS_ERR_OK ) { return error; @@ -3855,7 +3862,9 @@ ivas_error IVAS_REND_AddInput( /* Hack to override default split rendering codec from Dolby CLDFB to LC3plus. This will not be necessary once the split rendering codec becomes selectable by the lib user. */ closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer ); +#ifndef SPLIT_REND_CLDFB_ISM hIvasRend->hRendererConfig->split_rend_config.codec = IVAS_SPLIT_REND_CODEC_LC3PLUS; +#endif if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK ) { return error; @@ -7308,7 +7317,11 @@ ivas_error IVAS_REND_GetSamples( #endif #ifdef SPLIT_REND_LC3PLUS - if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB + if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB +#ifdef SPLIT_REND_CLDFB_ISM + || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif + ) /* The condition below is a temp fix for differences in procesing paths between split rendering of SBA and ISM. Should be unified */ && hIvasRend->inputsIsm[0].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) { @@ -7333,7 +7346,12 @@ ivas_error IVAS_REND_GetSamples( tmpBinaural, 1, 1, - 0 ); +#ifdef SPLIT_REND_CLDFB_ISM + ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 +#else + 0 +#endif + ); if ( error != IVAS_ERR_OK ) { return error; -- GitLab From a970429255bb7fbcfc38960814c3991cc0ff3da0 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Jun 2023 10:44:42 +0200 Subject: [PATCH 0243/1418] Activates reverb for parametric ISM --- lib_dec/ivas_output_config.c | 4 ++-- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 385a5103df..e60a48a10c 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -108,7 +108,7 @@ void ivas_renderer_select( *internal_config = output_config; #else *internal_config = AUDIO_CONFIG_BINAURAL; -#endif // FIX_571_REVERB_NOT_ACTIVATED_ISM +#endif } #else *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; @@ -116,7 +116,7 @@ void ivas_renderer_select( *internal_config = output_config; #else *internal_config = AUDIO_CONFIG_BINAURAL; -#endif // FIX_571_REVERB_NOT_ACTIVATED_ISM +#endif #endif } else diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 4616993f79..1f3ac58318 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1378,7 +1378,11 @@ static void ivas_dirac_dec_binaural_process_output( offsetSamples = 0; nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) +#endif { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); @@ -1445,7 +1449,11 @@ static void ivas_dirac_dec_binaural_process_output( } } +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) +#endif { /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); -- GitLab From ca0d689454648d46a0e5296e381ec30f427352cc Mon Sep 17 00:00:00 2001 From: rtyag Date: Thu, 22 Jun 2023 18:53:45 +1000 Subject: [PATCH 0244/1418] adding cross connections in ISM mode in IVAS decoder --- lib_com/common_api_types.h | 1 + lib_dec/ivas_init_dec.c | 16 ++++++++++++++-- lib_rend/ivas_splitRendererPre.c | 7 +++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 506547144d..714b7db0b2 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -115,6 +115,7 @@ typedef enum { IVAS_SPLIT_REND_CODEC_LCLD, IVAS_SPLIT_REND_CODEC_LC3PLUS, + IVAS_SPLIT_REND_CODEC_NONE } IVAS_SPLIT_REND_CODEC; #endif diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index a94dcfafb9..fb731bdeaf 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1282,21 +1282,33 @@ ivas_error ivas_init_decoder( } #ifdef SPLIT_REND_LC3PLUS +#ifdef SPLIT_REND_CLDFB_ISM + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) +#else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) +#endif { ivas_renderSplitGetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->splitBinRend.splitrend.multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis ); /* Split rendering with ISMs only supported with LC3plus */ +#ifndef SPLIT_REND_CLDFB_ISM assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ); - +#endif #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING error = #endif ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, &st_ivas->hRenderConfig->split_rend_config, - hDecoderConfig->output_Fs, 0, 0 ); + hDecoderConfig->output_Fs, 0, +#ifdef SPLIT_REND_CLDFB_ISM + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 +#else + 0 +#endif + ); #ifdef FIX_SPLIT_REND_OPEN_ERROR_HANDLING if ( error != IVAS_ERR_OK ) diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index da1c8b9bca..9fccbb8ec6 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -2005,6 +2005,13 @@ static ivas_error ivas_renderMultiTDBinToSplitBinaural( } #endif } +#ifdef SPLIT_REND_LC3PLUS + else + { + pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; + pBits->codec = IVAS_SPLIT_REND_CODEC_NONE; + } +#endif /*zero pad*/ bit_len = SplitRendBitRate / FRAMES_PER_SEC; -- GitLab From f91e7283c98ebb1896765342243d76b9b44e2932 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Thu, 22 Jun 2023 11:41:02 +0200 Subject: [PATCH 0245/1418] Checking in a few draft chunks of code --- lib_com/options.h | 2 + lib_dec/ivas_jbm_dec.c | 75 ++++++++++++++++++++++++++++++++ lib_dec/ivas_mc_paramupmix_dec.c | 32 ++++++++++++++ 3 files changed, 109 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index e51736a79f..46bb929d94 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,6 +151,8 @@ #define FIX_545_ASSERT /* VA: fix issue 545, replace assert() with warning message when hitting memory limit in the buffer of indices */ #endif +#define JBM_PARAMUPMIX + #define FIX_383_CLEAN_UP /* Dlb : Clean up of unused functions */ #define FIX_532_ISM_MD_INACTIVE /* VA: issue 532: improve MD coding in ISM inactive frames */ #define FIX_547_NAN_IGF_DEC /* FhG: issue 547: fix possible nan in IGF decoder */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 6871747db6..a0e3cb243b 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -350,6 +350,81 @@ ivas_error ivas_jbm_dec_tc( } } } +#ifdef JBM_PARAMUPMIX + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch ); + + ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] ); + + if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + + mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); + + ivas_mc_paramupmix_dec( st_ivas, output ); + + /* HP filtering */ + for ( n = 0; n < st_ivas->nchan_transport; n++ ) + { + if ( n != LFE_CHANNEL ) + { + hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + } + + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + { + ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); + } + + /* Rendering */ + if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + { + ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); + } +#if 0 + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, + st_ivas->hCombinedOrientationData, + &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + + ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); + } + else if ( st_ivas->renderer_type == RENDERER_MC ) + { + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + { + ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); + } + else + { + ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, output_frame, p_output, p_output ); + } + } + else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) + { + ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); + } + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) + { + if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } + + ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); + } +#endif + } +#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { /* read Parametric MC parameters from the bitstream */ diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 6447c2f456..709ec3d531 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -307,6 +307,10 @@ ivas_error ivas_mc_paramupmix_dec_open( int16_t nchan_transport; uint16_t i; ivas_error error; +#ifdef JBM_PARAMUPMIX + int16_t num_channels_internal; + num_channels_internal = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; +#endif error = IVAS_ERR_OK; @@ -356,6 +360,34 @@ ivas_error ivas_mc_paramupmix_dec_open( set_zero( hMCParamUpmix->pcm_delay[i], 240 ); } +#ifdef JBM_PARAMUPMIX + /* allocate transport channels*/ + if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) + { + int16_t nchan_to_allocate; + int16_t nchan_tc; + TC_BUFFER_MODE buffer_mode; + + buffer_mode = TC_BUFFER_MODE_RENDERER; + nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + nchan_to_allocate = num_channels_internal; + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) + { + buffer_mode = TC_BUFFER_MODE_BUFFER; + nchan_tc = st_ivas->hDecoderConfig->nchan_out; + nchan_to_allocate = nchan_tc; + } + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { + nchan_to_allocate = 2 * BINAURAL_CHANNELS; + } + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif + st_ivas->hMCParamUpmix = hMCParamUpmix; return error; -- GitLab From 818a23392f07d0ea0413d1c2fbe0ae532d7a1a3d Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Jun 2023 12:44:53 +0200 Subject: [PATCH 0246/1418] Reverted change in switching modes in ivas_dirac_dec_binaural_process_output function --- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1f3ac58318..4616993f79 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1378,11 +1378,7 @@ static void ivas_dirac_dec_binaural_process_output( offsetSamples = 0; nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); @@ -1449,11 +1445,7 @@ static void ivas_dirac_dec_binaural_process_output( } } -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); -- GitLab From 9f73d76fec97023ff03c24537504e4b65173ded0 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Thu, 22 Jun 2023 12:47:00 +0200 Subject: [PATCH 0247/1418] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_dec/ivas_output_config.c | 12 ++++++++++++ lib_rend/lib_rend.c | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e60a48a10c..f1e7c65a64 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -135,7 +135,11 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -147,7 +151,11 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == SBA_FORMAT ) { *internal_config = AUDIO_CONFIG_HOA3; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } @@ -183,7 +191,11 @@ void ivas_renderer_select( if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { *internal_config = output_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4e75d5fea8..d9ab18ebc5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2489,7 +2489,11 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), output_config ); +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC; } -- GitLab From bdf5c51afb02038d1c27a726f106b218543796ab Mon Sep 17 00:00:00 2001 From: rtyag Date: Fri, 23 Jun 2023 15:31:08 +1000 Subject: [PATCH 0248/1418] bug fixes in BINAURAL_SPLIT_PCM format --- .../sample_split_rend_script_ivas_rend_ism.py | 151 ++++++++++++++++++ apps/decoder.c | 8 + lib_dec/ivas_dec.c | 7 +- 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 Workspace_msvc/sample_split_rend_script_ivas_rend_ism.py diff --git a/Workspace_msvc/sample_split_rend_script_ivas_rend_ism.py b/Workspace_msvc/sample_split_rend_script_ivas_rend_ism.py new file mode 100644 index 0000000000..a6bd2c04a4 --- /dev/null +++ b/Workspace_msvc/sample_split_rend_script_ivas_rend_ism.py @@ -0,0 +1,151 @@ +from scipy.io.wavfile import read, write +from scipy import signal +import subprocess +import numpy as np +import sys +import os + +## dimension of following 2 arrays should be same, that is for each file name there should be a tag +file_names = [ +'../scripts/testv/stv4ISM48s.wav' +]; +ism_md_file_names = [ +'../scripts/testv/stvISM1.csv', +'../scripts/testv/stvISM2.csv', +'../scripts/testv/stvISM3.csv', +'../scripts/testv/stvISM4.csv' +]; +file_tags = [ +'test_ISM' +]; + +## dimension of following 3 arrays should be same, that is for each pre file there should be a post file and a tag +pre_hr_file_names = [ +'trajectories/pre-renderer_pose_files/pre_yaw20static.csv' +]; +post_hr_file_names = [ +'trajectories/post-renderer_pose_files/post_0static.csv' +]; +hr_file_tags = [ +'yaw20static' +]; + +renderers = [ +('crend_768_1dof', 'renderer_configs/split_renderer_config_768_1dof.txt', '0'), +('crend_pcm_1dof', 'renderer_configs/split_renderer_config_pcm_1dof.txt', '1'), +('crend_512_2dof', 'renderer_configs/split_renderer_config_512_2dof.txt', '0'), +('crend_pcm_2dof', 'renderer_configs/split_renderer_config_pcm_2dof.txt', '1'), +('crend_384_3dof', 'renderer_configs/split_renderer_config_384_3dof.txt', '0'), +('crend_pcm_3dof', 'renderer_configs/split_renderer_config_pcm_3dof.txt', '1'), +('crend_384_3dof_hq', 'renderer_configs/split_renderer_config_384_3dof_hq.txt', '0'), +('crend_pcm_3dof_hq', 'renderer_configs/split_renderer_config_pcm_3dof_hq.txt', '1'), +('crend_lc3plus_1dof', 'renderer_configs/split_renderer_config_768_1dof_hoa_lc3plus.txt', '0')]; + +split_md_file_name = 'split_md.bin'; + +split_rend_file_outs = ['recons_out_pos0.wav', + 'recons_out_pos1.wav', + 'recons_out_pos2.wav', + 'rotated_ref_pos0.wav', + 'rotated_ref_pos1.wav', + 'rotated_ref_pos2.wav', + 'rotated_ref_RefPos.wav', + 'split_rend_MD_bitrate.txt'] + + +def check_and_makedir(dir_path): + if not os.path.exists(dir_path): + try: + os.makedirs(dir_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise # raises the error again + + +def generate_split_rend_lis_items(file_dir, exe_dir, out_dir): + check_and_makedir(out_dir); + for idx in range(0, len(file_tags)): + for hr_idx in range(0, len(hr_file_tags)): + for rend in range(0, len(renderers)): + filename = file_names[idx]; + file_in = os.path.join(file_dir, filename); + rend_exe = os.path.join(exe_dir, 'IVAS_rend.exe'); + if renderers[rend][2] == '0': + bs_file_out_name = '_'.join([file_tags[idx], 'out.pkt']); + bs_file_out = os.path.join(out_dir, bs_file_out_name); + out_fmt = 'BINAURAL_SPLIT_CLDFB'; + else: + bs_file_out_name = '_'.join([file_tags[idx], 'out.wav']); + bs_file_out = os.path.join(out_dir, bs_file_out_name); + out_fmt = 'BINAURAL_SPLIT_PCM'; + md_out_arg = ['-om', split_md_file_name]; + md_in_arg = ['-im', split_md_file_name]; + file_out_name = '_'.join([file_tags[idx], renderers[rend][0], 'out.wav']); + file_out = os.path.join(out_dir, file_out_name); + + print(file_in) + print(bs_file_out) + print(file_out) + + hr_pre_file_name = pre_hr_file_names[hr_idx]; + hr_pre_file = os.path.join(file_dir, hr_pre_file_name); + hr_post_file_name = post_hr_file_names[hr_idx]; + hr_post_file = os.path.join(file_dir, hr_post_file_name); + + pre_rend_cmd = [ + rend_exe, + '-rc', renderers[rend][1], + md_out_arg[0], md_out_arg[1], + '-i', file_in, + '-if', 'ISM4', + '-im', ism_md_file_names[0], ism_md_file_names[1], ism_md_file_names[2], ism_md_file_names[3], + '-o', bs_file_out, + '-of', out_fmt, + '-fs', '48', + '-tf', hr_pre_file, + ] + + + print(pre_rend_cmd) + test_status = subprocess.call(pre_rend_cmd, shell=False) + + + post_rend_cmd = [ + rend_exe, + md_in_arg[0], md_in_arg[1], + '-i', bs_file_out, + '-if', out_fmt, + '-o', file_out, + '-of', 'BINAURAL', + '-fs', '48', + '-tf', hr_post_file, + ] + + + print(post_rend_cmd) + test_status = subprocess.call(post_rend_cmd, shell=False) + + if os.path.exists(bs_file_out): + os.remove(bs_file_out); + + if os.path.exists(split_md_file_name): + os.remove(split_md_file_name); + + + for fo in split_rend_file_outs: + file_old = os.path.join(os. getcwd(), fo); + file_out_name = '_'.join([file_tags[idx], hr_file_tags[hr_idx], renderers[rend][0], fo]); + file_new = os.path.join(out_dir, file_out_name); + if os.path.exists(file_old): + os.rename(file_old, file_new); + + +def main(argv): + print('USAGE : python generate_split_rend_lis_items.py file_dir exe_dir out_dir') + if len(argv) < 3: + return print(len(argv)) + return generate_split_rend_lis_items(*argv[1:]) + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) \ No newline at end of file diff --git a/apps/decoder.c b/apps/decoder.c index 25b1fdd405..fbf14cd1ce 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1338,6 +1338,13 @@ static ivas_error initOnFirstGoodFrame( fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); return error; } +#ifdef SPLIT_REND_CLDFB_ISM + if ( ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) || + ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CLDFB ) ) + { + pFullDelayNumSamples[0] = 0; + } +#endif if ( !arg.delayCompensationEnabled ) { @@ -1345,6 +1352,7 @@ static ivas_error initOnFirstGoodFrame( } *pRemainingDelayNumSamples = pFullDelayNumSamples[0]; + if ( ( error = IVAS_DEC_GetNumOutputChannels( hIvasDec, pNumOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetNumOutputChannels, code: %d\n", error ); diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 61435787cf..bb7e2878bd 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -44,7 +44,6 @@ #endif #include "wmc_auto.h" - /*--------------------------------------------------------------------------* * ivas_dec() * @@ -245,7 +244,12 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { #ifdef SPLIT_REND_LC3PLUS +#ifdef SPLIT_REND_CLDFB_ISM + if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) +#endif { ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ); } @@ -652,6 +656,7 @@ ivas_error ivas_dec( hSplitBinRend = &st_ivas->splitBinRend; max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, -- GitLab From cab49d5ed8a6c9a30758310ecbd5a22686e2c64a Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 23 Jun 2023 09:34:54 +0200 Subject: [PATCH 0249/1418] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1f3ac58318..87bc40298d 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1379,7 +1379,7 @@ static void ivas_dirac_dec_binaural_process_output( nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif @@ -1450,7 +1450,7 @@ static void ivas_dirac_dec_binaural_process_output( } #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) #endif -- GitLab From 14f026d0aad392c49504be9a7db21f0ce6be13fd Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Fri, 23 Jun 2023 14:06:38 +0200 Subject: [PATCH 0250/1418] Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration --- lib_dec/ivas_binRenderer_internal.c | 8 ++++++++ lib_dec/ivas_output_config.c | 16 ++++++++-------- lib_rend/ivas_dirac_dec_binaural_functions.c | 8 -------- lib_rend/ivas_reverb.c | 8 ++++++++ lib_rend/lib_rend.c | 4 ---- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 5bd09236e0..b3c31a9794 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -723,7 +723,11 @@ ivas_error ivas_binRenderer_open( } /* Allocate memories needed for reverb module */ +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, @@ -731,7 +735,11 @@ ivas_error ivas_binRenderer_open( &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + RENDERER_BINAURAL_FASTCONV, +#else RENDERER_BINAURAL_FASTCONV_ROOM, +#endif st_ivas->hHrtfFastConv, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f1e7c65a64..94e22ea419 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -82,7 +82,11 @@ void ivas_renderer_select( { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -135,11 +139,7 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -191,11 +191,7 @@ void ivas_renderer_select( if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { *internal_config = output_config; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { *renderer_type = RENDERER_BINAURAL_PARAMETRIC; } @@ -207,7 +203,11 @@ void ivas_renderer_select( else { *internal_config = transport_config; +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { #ifdef DEBUGGING if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 87bc40298d..4616993f79 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -1378,11 +1378,7 @@ static void ivas_dirac_dec_binaural_process_output( offsetSamples = 0; nSlots = st_ivas->hDirAC->subframe_nbslots[subframe]; -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Process second / room effect part of binaural output when needed */ ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm ); @@ -1449,11 +1445,7 @@ static void ivas_dirac_dec_binaural_process_output( } } -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -#else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) -#endif { /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */ v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX ); diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 6374b6812e..cfea5594a1 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1813,7 +1813,11 @@ ivas_error ivas_binaural_reverb_open( set_f( hReverb->preDelayBufferImag[k], 0.0f, hReverb->numBins ); } +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) +#endif { if ( !roomAcoustics->override ) { @@ -1900,7 +1904,11 @@ ivas_error ivas_binaural_reverb_open( } else { +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if (renderer_type == RENDERER_BINAURAL_FASTCONV ) +#else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) +#endif { ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, hHrtfFastConv->fastconvReverberationTimes, hHrtfFastConv->fastconvReverberationEneCorrections ); ivas_binaural_reverb_setPreDelay( hReverb, 10 ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d9ab18ebc5..4e75d5fea8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2489,11 +2489,7 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), output_config ); -#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#else if ( output_config == AUDIO_CONFIG_BINAURAL ) -#endif { decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC; } -- GitLab From 41bdcfbb47a625c584e1ea062e4a8523b1ae0e97 Mon Sep 17 00:00:00 2001 From: Michael Schug Date: Fri, 23 Jun 2023 14:50:50 +0200 Subject: [PATCH 0251/1418] small changes to let the decoder run with -vs command line (without meaningful output): increased tc buffer channels to 12, disabled full ivas_mc_paramumix_dec function for jbm --- lib_dec/ivas_jbm_dec.c | 8 +++++++- lib_dec/ivas_mc_paramupmix_dec.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9690f9a61b..b7cbd47e58 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -381,7 +381,7 @@ ivas_error ivas_jbm_dec_tc( mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); - ivas_mc_paramupmix_dec( st_ivas, output ); + //ivas_mc_paramupmix_dec( st_ivas, output ); /* HP filtering */ for ( n = 0; n < st_ivas->nchan_transport; n++ ) @@ -919,6 +919,12 @@ ivas_error ivas_jbm_dec_render( ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc, p_output ); } } +#ifdef JBM_PARAMUPMIX + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + } +#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 709ec3d531..62bf88caf9 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -370,7 +370,7 @@ ivas_error ivas_mc_paramupmix_dec_open( buffer_mode = TC_BUFFER_MODE_RENDERER; nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - nchan_to_allocate = num_channels_internal; + nchan_to_allocate = nchan_tc; if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) { buffer_mode = TC_BUFFER_MODE_BUFFER; -- GitLab From 5033c9e2996529bf41659c950a5b7275bff4159d Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 23 Jun 2023 16:22:25 +0200 Subject: [PATCH 0252/1418] rename parameter --- lib_dec/ivas_masa_dec.c | 10 +++++----- lib_enc/ivas_masa_enc.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index a0f44e2345..10d90e9ee7 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -107,6 +107,7 @@ ivas_error ivas_masa_decode( int16_t obj; int16_t i, ch, ism_imp; int16_t dirac_bs_md_write_idx; + int32_t masa_total_brate; dirac_bs_md_write_idx = 0; ism_imp = 0; @@ -350,16 +351,15 @@ ivas_error ivas_masa_decode( #endif #ifdef MASA_AND_OBJECTS - int32_t total_brate; - total_brate = ivas_total_brate; + masa_total_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { - total_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); + masa_total_brate = calculate_cpe_brate_MASA_ISM( st_ivas->ism_mode, ivas_total_brate, st_ivas->nchan_ism ); } - if ( total_brate >= IVAS_384k ) + if ( masa_total_brate >= IVAS_384k ) { - if ( total_brate >= IVAS_512k ) + if ( masa_total_brate >= IVAS_512k ) #else if ( ivas_total_brate >= IVAS_384k ) { diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 7c3557332d..443c086a2a 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -254,6 +254,7 @@ ivas_error ivas_masa_encode( int16_t masa_sid_descriptor; #ifdef MASA_AND_OBJECTS int16_t low_bitrate_mode; + int32_t masa_total_brate; #endif masa_sid_descriptor = -1; @@ -538,16 +539,15 @@ ivas_error ivas_masa_encode( /* Encode metadata */ #ifdef MASA_AND_OBJECTS - int32_t total_brate; - total_brate = ivas_total_brate; + masa_total_brate = ivas_total_brate; if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MASA_MODE_DISC ) { - total_brate = calculate_cpe_brate_MASA_ISM( ism_mode, ivas_total_brate, nchan_ism ); + masa_total_brate = calculate_cpe_brate_MASA_ISM( ism_mode, ivas_total_brate, nchan_ism ); } - if ( total_brate >= IVAS_384k ) + if ( masa_total_brate >= IVAS_384k ) { - if ( total_brate >= IVAS_512k ) + if ( masa_total_brate >= IVAS_512k ) { ivas_qmetadata_enc_encode_hr_384_512( hMetaData, hQMetaData, 16, 4 ); } -- GitLab From f19dad68c49bb00819ff14d1c54ee534556f3f53 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sun, 25 Jun 2023 18:11:42 +0200 Subject: [PATCH 0253/1418] Correct length of unit impulse filter used for initialization --- lib_rend/ivas_objectRenderer_sources.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 456b406b1d..ac16efab30 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -674,7 +674,11 @@ void TDREND_SRC_Init( /* Reset memory buffers */ Src_p->itd = 0; Src_p->previtd = 0; +#ifdef FIX_550_FIRST_FRAME_ACCESS + Src_p->filterlength = 1; /* Init to unit impulse of length 1 */ +#else Src_p->filterlength = -1; +#endif set_f( Src_p->mem_itd, 0.0f, ITD_MEM_LEN ); set_f( Src_p->mem_hrf_left, 0.0f, SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 ); set_f( Src_p->mem_hrf_right, 0.0f, SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 ); -- GitLab From 3009ea05bb67367cf225476e6097d79c30d7e418 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Sun, 25 Jun 2023 19:39:04 +0200 Subject: [PATCH 0254/1418] Add initialization of Gain for gain interpolation --- lib_rend/ivas_objectRenderer_sources.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 3408eb23fb..87cf52ad10 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -689,6 +689,9 @@ void TDREND_SRC_Init( Src_p->hrf_right_prev[0] = 1; Src_p->azim_prev = 0.0f; Src_p->elev_prev = 0.0f; +#ifdef FIX_550_FIRST_FRAME_ACCESS + Src_p->Gain = 1; +#endif Src_p->prevGain = 1.0f; return; -- GitLab From 41ae1af907acf4c7abf9781bda9b99880bd273db Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Mon, 26 Jun 2023 12:58:48 +0530 Subject: [PATCH 0255/1418] Resolved warnings introduced by merge to main --- apps/decoder.c | 11 ++++++--- lib_com/ivas_prot.h | 4 +-- lib_dec/ivas_binRenderer_internal.c | 10 ++++++++ lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_dirac_dec.c | 19 ++++++++++++--- lib_rend/ivas_crend.c | 2 +- lib_rend/ivas_objectRenderer.c | 26 +++++++++++++++++--- lib_rend/lib_rend.c | 38 ++++++++++++++++++++++++----- 8 files changed, 92 insertions(+), 20 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index a8299f8786..6308e9c245 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2004,13 +2004,16 @@ static ivas_error decodeG192( { for ( i = 0; i < IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { - fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), + if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), #ifdef EXTERNAL_ORIENTATIONS - RotationFileReader_getFilePath( headRotReader ) ); + RotationFileReader_getFilePath( headRotReader ) ); #else - HeadRotationFileReader_getFilePath( headRotReader ) ); + HeadRotationFileReader_getFilePath( headRotReader ) ); #endif - goto cleanup; + goto cleanup; + } } } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 6f23927720..0bc3419b31 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4960,7 +4960,7 @@ void ivas_quantise_real_values( float *quant, const int16_t dim ); - +#ifndef FIX_SPLIT_REND_MERGE ivas_error ivas_deindex_real_index( const int16_t *index, const int16_t q_levels, @@ -4968,7 +4968,7 @@ ivas_error ivas_deindex_real_index( const float max_value, float *quant, const int16_t num_ch_dim2 ); - +#endif void ivas_spar_get_uniform_quant_strat( ivas_spar_md_com_cfg *pSpar_md_com_cfg, const int16_t table_idx diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 1d83e95709..51b5ad0349 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1368,8 +1368,13 @@ void ivas_binaural_cldfb_sf( { float Cldfb_RealBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_INTERN_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#ifdef FIX_SPLIT_REND_MERGE + float Cldfb_RealBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer_Binaural[1][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#else float Cldfb_RealBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_Binaural[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; +#endif int16_t slot_idx, subframeIdx, index_slot, idx_in, idx_lfe, maxBand, ch; int16_t slot_size, slots_to_render, first_sf, last_sf; int16_t slot_index_start, slot_index_start_cldfb; @@ -1440,8 +1445,13 @@ void ivas_binaural_cldfb_sf( for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[subframeIdx]; slot_idx++ ) { +#ifdef FIX_SPLIT_REND_MERGE + RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[0][ch][slot_idx]; + ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[0][ch][slot_idx]; +#else RealBuffer[slot_idx] = Cldfb_RealBuffer_Binaural[ch][slot_idx]; ImagBuffer[slot_idx] = Cldfb_ImagBuffer_Binaural[ch][slot_idx]; +#endif } cldfbSynthesis( RealBuffer, ImagBuffer, &( output_f[ch][slot_index_start_cldfb * maxBand] ), maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], st_ivas->cldfbSynDec[ch] ); diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index b4df3610b7..34135ae57c 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -287,7 +287,7 @@ ivas_error ivas_dec( else { #endif - if ( ( error = ivas_td_binaural_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 910d4d27ec..9039d22b0d 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -3148,7 +3148,10 @@ void ivas_dirac_dec_render_sf( } ivas_dirac_dec_output_synthesis_get_interpolator( &hDirAC->h_output_synthesis_psd_params, hDirAC->subframe_nbslots[subframe_idx] ); - +#ifndef FIX_SPLIT_REND_MERGE +#ifdef FIX_SPLIT_REND_MERGE + index_slot = subframe_idx * hDirAC->subframe_nbslots[subframe_idx]; +#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { /* Perform binaural rendering */ @@ -3180,7 +3183,11 @@ void ivas_dirac_dec_render_sf( for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) #endif { +#ifdef FIX_SPLIT_REND_MERGE + for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots[subframe_idx]; slot_idx++ ) +#else for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots; slot_idx++ ) +#endif { for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { @@ -3210,6 +3217,7 @@ void ivas_dirac_dec_render_sf( #endif } } +#endif #ifndef FIX_393_459_460_SBA_MD if ( hDirAC->hConfig->dec_param_estim == FALSE ) { @@ -3336,8 +3344,13 @@ void ivas_dirac_dec_render_sf( for ( i = 0; i < hDirAC->subframe_nbslots[subframe_idx]; i++ ) { - RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; - ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; +#ifdef FIX_SPLIT_REND_MERGE + RealBuffer[i] = Cldfb_RealBuffer_Binaural[0][ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[0][ch][i]; +#else + RealBuffer[i] = Cldfb_RealBuffer_Binaural[ch][i]; + ImagBuffer[i] = Cldfb_ImagBuffer_Binaural[ch][i]; +#endif } cldfbSynthesis( RealBuffer, diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index f5dff1cdbe..621bb1af9e 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1689,7 +1689,7 @@ ivas_error ivas_rend_crendProcess( if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { - if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, output, pcm_tmp, output_Fs, subframe_idx + if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, output, p_pcm_tmp, output_Fs, subframe_idx #ifdef SPLIT_REND_WITH_HEAD_ROT , pos_idx diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 7863f2fb9f..3b8943f9cd 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -743,6 +743,9 @@ void ObjRenderIvasFrame_splitBinaural( int32_t i; float tmpProcessing[MAX_NUM_OBJECTS][L_FRAME48k]; float tmpBinaural[MAX_HEAD_ROT_POSES * 2][L_FRAME48k]; +#ifdef FIX_SPLIT_REND_MERGE + float *p_tmpProcessing[MAX_NUM_OBJECTS]; +#endif int16_t pos_idx; IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; @@ -811,18 +814,35 @@ void ObjRenderIvasFrame_splitBinaural( } } } - +#ifdef FIX_SPLIT_REND_MERGE + for ( i = 0; i < BINAURAL_CHANNELS; i++ ) + { + p_tmpProcessing[i] = tmpProcessing[i]; + } +#endif /* Render */ if ( pos_idx == 0 ) { - ivas_td_binaural_renderer( st_ivas, tmpProcessing, output_frame ); + ivas_td_binaural_renderer( st_ivas, +#ifdef FIX_SPLIT_REND_MERGE + p_tmpProcessing, +#else + tmpProcessing +#endif + output_frame ); } else { /* Tmp swap renderer handles for rendering call */ tmpTdRendHandle = st_ivas->hBinRendererTd; st_ivas->hBinRendererTd = st_ivas->splitBinRend.splitrend.hTdRendHandles[pos_idx - 1]; - ivas_td_binaural_renderer( st_ivas, tmpProcessing, output_frame ); + ivas_td_binaural_renderer( st_ivas, +#ifdef FIX_SPLIT_REND_MERGE + p_tmpProcessing, +#else + tmpProcessing +#endif + output_frame ); st_ivas->hBinRendererTd = tmpTdRendHandle; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 1798462927..540ab2a915 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7200,13 +7200,21 @@ static ivas_error renderSbaToMultiBinaural( float out[][L_FRAME48k] ) { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; +#ifdef FIX_SPLIT_REND_MERGE + float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; +#endif int16_t i, pos_idx; IVAS_REND_HeadRotData HeadRotDataLocal; ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; - +#ifdef FIX_SPLIT_REND_MERGE + for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) + { + p_tmpCrendBuffer[i] = tmpCrendBuffer[i]; + } +#endif push_wmops( "renderSbaToMultiBinaural" ); HeadRotDataLocal = *sbaInput->base.ctx.pHeadRotData; @@ -7241,10 +7249,10 @@ static ivas_error renderSbaToMultiBinaural( rotateFrameSba( sbaInput->base.inputBuffer, sbaInput->base.inConfig, + &HeadRotDataLocal, #ifdef FIX_SPLIT_REND_MERGE sbaInput->base.ctx.pCombinedOrientationData, #endif - &HeadRotDataLocal, sbaInput->rot_gains_prev[pos_idx], tmpRotBuffer ); @@ -7253,7 +7261,13 @@ static ivas_error renderSbaToMultiBinaural( assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); /* call CREND */ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate, + NULL, NULL, NULL, NULL, +#ifdef FIX_SPLIT_REND_MERGE + p_tmpCrendBuffer, +#else + tmpCrendBuffer +#endif + *sbaInput->base.ctx.pOutSampleRate, pos_idx ) ) != IVAS_ERR_OK ) { return error; @@ -7453,7 +7467,13 @@ renderSbaToBinaural( #endif { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - +#ifdef FIX_SPLIT_REND_MERGE + float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; + for ( int16_t i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) + { + p_tmpCrendBuffer[i] = tmpCrendBuffer[i]; + } +#endif tmpRotBuffer = sbaInput->base.inputBuffer; tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); @@ -7478,7 +7498,13 @@ renderSbaToBinaural( free( tmpRotBuffer.data ); /* call CREND */ if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate + NULL, NULL, NULL, NULL, +#ifdef FIX_SPLIT_REND_MERGE + p_tmpCrendBuffer, +#else + tmpCrendBuffer, +#endif + *sbaInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , 0 @@ -8488,7 +8514,7 @@ ivas_error IVAS_REND_GetSamples( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, 1, -- GitLab From 8a2aca499c0ac4f0caa6e9b1d61f779712c59e87 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 26 Jun 2023 09:45:12 +0200 Subject: [PATCH 0256/1418] Add FIX_550_FIRST_FRAME_ACCESS_ALT to integrate non-diegetic panning with TD renderer filter states and ITD to handle transitions properly --- lib_com/ivas_cnst.h | 8 ++++ lib_com/options.h | 1 + lib_rend/ivas_objectRenderer.c | 14 ++++++ lib_rend/ivas_objectRenderer_mix.c | 4 ++ lib_rend/ivas_objectRenderer_sources.c | 63 ++++++++++++++++++-------- 5 files changed, 72 insertions(+), 18 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index c43692ea91..0f13eac005 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1555,14 +1555,22 @@ typedef enum typedef enum { TDREND_POSTYPE_ABSOLUTE, /* The source position is in absolute coordinates */ +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT + TDREND_POSTYPE_NON_DIEGETIC /* The source position is non-diegetic */ +#else TDREND_POSTYPE_RELATIVE_TO_LISTENER /* The source position is relative to the listener */ +#endif } TDREND_PosType_t; typedef enum { TDREND_PLAYSTATUS_INITIAL, +#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT TDREND_PLAYSTATUS_PLAYING, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC +#else + TDREND_PLAYSTATUS_PLAYING +#endif } TDREND_PlayStatus_t; typedef enum diff --git a/lib_com/options.h b/lib_com/options.h index 9254ab412a..661c8beab4 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,7 @@ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define FIX_550_FIRST_FRAME_ACCESS /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */ +#define FIX_550_FIRST_FRAME_ACCESS_ALT /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index d19c605f59..1c035d377d 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -291,6 +291,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE; c_indx++; } +#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT #ifdef FIX_550_FIRST_FRAME_ACCESS if ( ivas_format == ISM_FORMAT ) { @@ -303,6 +304,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); } } +#endif #endif } @@ -378,7 +380,9 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; +#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT float pan_left, pan_right; +#endif int16_t subframe_update_flag; subframe_update_flag = subframe_idx == ism_md_subframe_update; @@ -415,6 +419,7 @@ ivas_error TDREND_GetMix( error = TDREND_REND_RenderSourceHRFilt( Src_p, hrf_left_delta, hrf_right_delta, intp_count, output_buf, subframe_length ); } +#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT if ( ( SrcRend_p->InputAvailable == TRUE ) && ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ) ) { pan_left = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; @@ -427,6 +432,7 @@ ivas_error TDREND_GetMix( v_multc_acc( &Src_p->InputFrame_p[subframe_idx * subframe_length], pan_right, output_buf[1], subframe_length ); #endif } +#endif } /* Populate output variable */ @@ -503,14 +509,22 @@ void TDREND_Update_object_positions( Pos[1] = hIsmMetaData[nS]->azimuth / 90.f; Pos[2] = 0; TDREND_MIX_SRC_SetPos( hBinRendererTd, nS, Pos ); +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT + hBinRendererTd->Sources[nS]->SrcSpatial_p->PosType = TDREND_POSTYPE_NON_DIEGETIC; +#else #ifndef FIX_550_FIRST_FRAME_ACCESS TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC ); +#endif #endif } else { +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT + hBinRendererTd->Sources[nS]->SrcSpatial_p->PosType = TDREND_POSTYPE_ABSOLUTE; +#else #ifndef FIX_550_FIRST_FRAME_ACCESS TDREND_MIX_SRC_SetPlayState( hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING ); +#endif #endif } TDREND_MIX_SRC_SetDir( hBinRendererTd, nS, Dir ); diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 509d22d320..e218002345 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -309,7 +309,11 @@ ivas_error TDREND_MIX_AddSrc( } else { +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT + if ( ( PosType < TDREND_POSTYPE_ABSOLUTE ) || ( PosType > TDREND_POSTYPE_NON_DIEGETIC ) ) +#else if ( ( PosType < TDREND_POSTYPE_ABSOLUTE ) || ( PosType > TDREND_POSTYPE_RELATIVE_TO_LISTENER ) ) +#endif { return ( IVAS_ERROR( IVAS_ERR_INTERNAL, "Invalid position type!\n" ) ); } diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 87cf52ad10..fc955d7fe9 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -218,7 +218,11 @@ static void TDREND_SRC_REND_Init( /* Internal state */ SrcRend_p->InputAvailable = FALSE; +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT + SrcRend_p->PlayStatus = TDREND_PLAYSTATUS_PLAYING; +#else SrcRend_p->PlayStatus = TDREND_PLAYSTATUS_INITIAL; +#endif /* SrcGain */ for ( nC = 0; nC < SPAT_BIN_MAX_INPUT_CHANNELS; nC++ ) { @@ -277,6 +281,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( *filterlength = HrFiltSet_p->FiltLength; +#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT /* 1. Map source pos to the coordinate system of the listener */ switch ( SrcSpatial_p->PosType ) { @@ -296,6 +301,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); break; } +#else + if ( SrcSpatial_p->PosType == TDREND_POSTYPE_ABSOLUTE ) + { + + /* Absolute position */ + TDREND_SPATIAL_VecMapToNewCoordSystem( SrcSpatial_p->Pos_p, Listener_p->Pos, Listener_p->Front, Listener_p->Up, Listener_p->Right, ListRelPos, ListRelPosAbs ); +#endif ListRelDist = TDREND_SPATIAL_VecNorm( ListRelPos ); @@ -351,25 +363,40 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( azim_delta = ( azim_delta > 180.0f ) ? ( azim_delta - 360 ) : ( ( azim_delta < -180.0f ) ? ( azim_delta + 360 ) : ( azim_delta ) ); /* map to -180:180 range */ *intp_count = min( MAX_INTERPOLATION_STEPS, max( (int16_t) ( fabsf( azim_delta ) * MAX_ANGULAR_STEP_INV ), (int16_t) ( fabsf( elev_delta ) * MAX_ANGULAR_STEP_INV ) ) ); +#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT +} +else /* TDREND_POSTYPE_NON_DIEGETIC */ +{ + *itd = 0; + *Gain = 1.0f; + set_f( hrf_left, 0.0f, *filterlength ); + set_f( hrf_right, 0.0f, *filterlength ); + hrf_left[0] = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; + hrf_right[0] = 1.f - hrf_left[0]; + *intp_count = MAX_INTERPOLATION_STEPS; + Src_p->elev_prev = 0; + Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ +} +#endif - if ( ( *intp_count > 0 ) && subframe_update_flag ) - { - /* Set deltas for interpolation */ - v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); - v_multc( hrf_left_delta, 1.0f / *intp_count, hrf_left_delta, *filterlength ); - v_sub( hrf_right, hrf_right_prev, hrf_right_delta, *filterlength ); - v_multc( hrf_right_delta, 1.0f / *intp_count, hrf_right_delta, *filterlength ); - } - else - { - /* No interpolation, just set the new filters and reset deltas */ - mvr2r( hrf_left, hrf_left_prev, *filterlength ); - mvr2r( hrf_right, hrf_right_prev, *filterlength ); - set_f( hrf_left_delta, 0.0f, *filterlength ); - set_f( hrf_right_delta, 0.0f, *filterlength ); - } +if ( ( *intp_count > 0 ) && subframe_update_flag ) +{ + /* Set deltas for interpolation */ + v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); + v_multc( hrf_left_delta, 1.0f / *intp_count, hrf_left_delta, *filterlength ); + v_sub( hrf_right, hrf_right_prev, hrf_right_delta, *filterlength ); + v_multc( hrf_right_delta, 1.0f / *intp_count, hrf_right_delta, *filterlength ); +} +else +{ + /* No interpolation, just set the new filters and reset deltas */ + mvr2r( hrf_left, hrf_left_prev, *filterlength ); + mvr2r( hrf_right, hrf_right_prev, *filterlength ); + set_f( hrf_left_delta, 0.0f, *filterlength ); + set_f( hrf_right_delta, 0.0f, *filterlength ); +} - return; +return; } @@ -677,7 +704,7 @@ void TDREND_SRC_Init( #ifdef FIX_550_FIRST_FRAME_ACCESS Src_p->filterlength = 1; /* Init to unit impulse of length 1 */ #else - Src_p->filterlength = -1; + Src_p->filterlength = -1; #endif set_f( Src_p->mem_itd, 0.0f, ITD_MEM_LEN ); set_f( Src_p->mem_hrf_left, 0.0f, SFX_SPAT_BIN_MAX_FILTER_LENGTH - 1 ); -- GitLab From 1134a718542767b40d3ac76e6858e17f29d4752a Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Mon, 26 Jun 2023 15:44:15 +0530 Subject: [PATCH 0257/1418] Minor modificationa --- apps/renderer.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 4c024a3f68..3836732124 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1002,37 +1002,6 @@ int main( } else #endif - { - - if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", audioFilePath ); - exit( -1 ); - } - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - /*if split renderer is running in post renderer mode*/ - if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ) - { - error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath ); - if ( error != IVAS_ERR_OK ) - { - fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath ); - exit( -1 ); - } - audioReader = NULL; - } - else -#endif - { - - if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK ) - { - fprintf( stderr, "Error opening file: %s\n", audioFilePath ); - exit( -1 ); - } - } { if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK ) { -- GitLab From 446ffb36f67698191cafedd2662111329b0229d7 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Mon, 26 Jun 2023 15:36:51 +0200 Subject: [PATCH 0258/1418] Check-in beginning of ivas_jbm_dec_feed_tc_to_renderer operation --- lib_dec/ivas_jbm_dec.c | 6 +++ lib_dec/ivas_mc_paramupmix_dec.c | 88 ++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b7cbd47e58..b5e2cbdbbe 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -670,6 +670,12 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); } +#ifdef JBM_PARAMUPMIX + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + ivas_param_upmix_dec_decorr_subframes( st_ivas ); + } +#endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f ); diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 62bf88caf9..30ab30653d 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -427,7 +427,95 @@ void ivas_mc_paramupmix_dec_close( return; } +#ifdef JBM_PARAMUPMIX +/*------------------------------------------------------------------------- + * ivas_param_upmix_dec_decorr_subframes() + * + * + *------------------------------------------------------------------------*/ +static void paramupmix_td_decorr_process_jbm( + ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ + float *pcm_in[], /* i : input audio channels */ + float **pp_out_pcm, /* o : output audio channels */ + const int16_t output_frame /* i : output frame length */ +) +{ + int16_t j, k; + int16_t offset; + float in_duck_gain[L_FRAME48k], out_duck_gain[L_FRAME48k]; + + offset = (int16_t) ( output_frame * FRAMES_PER_SEC * IVAS_DECORR_PARM_LOOKAHEAD_TAU ); + + /* Look-ahead delay */ + for ( k = 0; k < MC_PARAMUPMIX_COMBINATIONS; k++ ) + { + mvr2r( pcm_in[k], pp_out_pcm[k], output_frame ); + delay_signal( pp_out_pcm[k], output_frame, hTdDecorr[k]->look_ahead_buf, offset ); + + /* In ducking gains */ + if ( hTdDecorr[k]->ducking_flag ) + { + ivas_td_decorr_get_ducking_gains( hTdDecorr[k]->pTrans_det, pcm_in[k], in_duck_gain, out_duck_gain, output_frame, 0 ); + + for ( j = 0; j < output_frame; j++ ) + { + pp_out_pcm[k][j] = pp_out_pcm[k][j] * in_duck_gain[j]; + } + } + + /* All pass delay section */ + ivas_td_decorr_APD_iir_filter( &hTdDecorr[k]->APD_filt_state[0], pp_out_pcm[k], hTdDecorr[k]->num_apd_sections, output_frame ); + + /* Out ducking gains */ + if ( hTdDecorr[k]->ducking_flag ) + { + for ( j = 0; j < output_frame; j++ ) + { + pp_out_pcm[k][j] = pp_out_pcm[k][j] * out_duck_gain[j]; + } + } + } + + return; +} + +void ivas_param_upmix_dec_decorr_subframes( + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ +) +{ + MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; + int16_t i, ch; + int32_t output_Fs; + int16_t output_frame; + float Pcm_decorr[MC_PARAMUPMIX_COMBINATIONS][L_FRAME48k]; /* decorrelated channels */ + float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ + float *p_tc[MC_PARAMUPMIX_MAX_INPUT_CHANS]; + + hMCParamUpmix = st_ivas->hMCParamUpmix; + assert( hMCParamUpmix ); + + push_wmops( "ivas_param_upmix_dec_decorr_subframes" ); + + output_Fs = st_ivas->hDecoderConfig->output_Fs; + output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); + for ( ch = 0; ch < MC_PARAMUPMIX_MAX_INPUT_CHANS; ch++ ) + { + p_tc[ch] = st_ivas->hTcBuffer->tc[ch]; + } + + for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) + { + pPcm_temp[i] = p_tc[8+i]; /* decorrelated */ + } + + paramupmix_td_decorr_process_jbm( hMCParamUpmix->hTdDecorr, &( p_tc[4] ), pPcm_temp, output_frame ); + + pop_wmops(); + + return; +} +#endif /*****************************************************************************************/ /* local functions */ -- GitLab From dcfcedfbff71d625d57d32b30e8f03e2e104241e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 26 Jun 2023 15:39:21 +0200 Subject: [PATCH 0259/1418] Add fix FIX_569_TD_FILTER_LENGTH to truncate the filters if a model file produces filters longer than SFX_SPAT_BIN_MAX_FILTER_LENGTH --- lib_com/options.h | 1 + lib_rend/ivas_objectRenderer_hrFilt.c | 14 +++++++++++--- lib_rend/ivas_objectRenderer_sources.c | 8 ++++++++ lib_rend/ivas_prot_rend.h | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index dbe71e39f1..c6e8cc0002 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,6 +158,7 @@ #define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ +#define FIX_569_TD_FILTER_LENGTH /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model. */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6463261ec4..0df5df6fcd 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -97,16 +97,24 @@ void GetFilterFromAngle( TDREND_HRFILT_FiltSet_t *HrFiltSet_p, /* i/o: HR filter set structure */ const float Elev, /* i : Elevation, degrees */ float Azim, /* i : Azimuth, degrees */ - float *hrf_left, /* o : Left HR filter */ - float *hrf_right, /* o : Right HR filter */ - int16_t *itd /* o : ITD value */ +#ifdef FIX_569_TD_FILTER_LENGTH + const int16_t filterlength, /* i : Filter length */ +#endif + float *hrf_left, /* o : Left HR filter */ + float *hrf_right, /* o : Right HR filter */ + int16_t *itd /* o : ITD value */ ) { GenerateFilter( Elev, Azim, &HrFiltSet_p->ModelParams, &HrFiltSet_p->ModelEval ); +#ifdef FIX_569_TD_FILTER_LENGTH + mvr2r( HrFiltSet_p->ModelEval.hrfModL, hrf_left, filterlength ); + mvr2r( HrFiltSet_p->ModelEval.hrfModR, hrf_right, filterlength ); +#else mvr2r( HrFiltSet_p->ModelEval.hrfModL, hrf_left, HrFiltSet_p->ModelParams.K ); mvr2r( HrFiltSet_p->ModelEval.hrfModR, hrf_right, HrFiltSet_p->ModelParams.K ); +#endif /* 4. Evaluate the ITD */ if ( HrFiltSet_p->ModelParams.UseItdModel ) { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 8debd6619b..8b4b910c5b 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -275,7 +275,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Listener_p = hBinRendererTd->Listener_p; HrFiltSet_p = hBinRendererTd->HrFiltSet_p; +#ifdef FIX_569_TD_FILTER_LENGTH + *filterlength = min( HrFiltSet_p->FiltLength, SFX_SPAT_BIN_MAX_FILTER_LENGTH ); +#else *filterlength = HrFiltSet_p->FiltLength; +#endif /* 1. Map source pos to the coordinate system of the listener */ switch ( SrcSpatial_p->PosType ) @@ -312,7 +316,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Azim = -1.0f * _180_OVER_PI * (float) atan2f( ListRelPos[1], ListRelPos[0] ); } +#ifdef FIX_569_TD_FILTER_LENGTH + GetFilterFromAngle( HrFiltSet_p, Elev, Azim, *filterlength, hrf_left, hrf_right, itd ); +#else GetFilterFromAngle( HrFiltSet_p, Elev, Azim, hrf_left, hrf_right, itd ); +#endif /* 6. Evaluate the directional and distance gains */ /* Directional gain */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 803a612502..c031392226 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -314,6 +314,9 @@ void GetFilterFromAngle( TDREND_HRFILT_FiltSet_t *HrFiltSet_p, /* i/o: HR filter set structure */ const float Elev, /* i : Elevation, degrees */ float Azim, /* i : Azimuth, degrees */ +#ifdef FIX_569_TD_FILTER_LENGTH + const int16_t filterlength, /* i : Filter length */ +#endif float *LeftFilter, /* o : Left HR filter */ float *RightFilter, /* o : Right HR filter */ int16_t *itd /* o : ITD value */ -- GitLab From b5b72fcfc4cc79c1918b59082fee1451460213cc Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 15:52:07 +0200 Subject: [PATCH 0260/1418] Add External Renderer CommanLine Option -sync_mc_delay / -smd --- apps/renderer.c | 28 ++++++++++++++++++ lib_com/options.h | 2 +- lib_rend/ivas_objectRenderer.c | 12 ++++++-- lib_rend/ivas_prot_rend.h | 3 ++ lib_rend/ivas_stat_rend.h | 1 - lib_rend/lib_rend.c | 53 ++++++++++++++++++++++++++++++---- lib_rend/lib_rend.h | 3 ++ 7 files changed, 93 insertions(+), 9 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 760065be91..ac643d058f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -157,6 +157,9 @@ typedef struct float lfeConfigElevation; bool lfeCustomRoutingEnabled; char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH]; +#ifdef FIX_488_SYNC_DELAY + int16_t syncMdDelay; +#endif } CmdlnArgs; typedef enum @@ -181,6 +184,9 @@ typedef enum CmdLnOptionId_inputGain, CmdLnOptionId_referenceVectorFile, CmdLnOptionId_exteriorOrientationFile, +#ifdef FIX_488_SYNC_DELAY + CmdLnOptionId_syncMdDelay, +#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -302,6 +308,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "exof", .description = "External orientation trajectory file for simulation of external orientations", }, +#ifdef FIX_488_SYNC_DELAY + { + .id = CmdLnOptionId_syncMdDelay, + .match = "sync_md_delay", + .matchShort = "smd", + .description = "Metadata Synchronization Delay in ms", + }, +#endif }; @@ -1236,7 +1250,11 @@ int main( } } +#ifdef FIX_488_SYNC_DELAY + if ( IVAS_REND_GetSamples( hIvasRend, args.syncMdDelay, outBuffer ) != IVAS_ERR_OK ) +#else if ( IVAS_REND_GetSamples( hIvasRend, outBuffer ) != IVAS_ERR_OK ) +#endif { fprintf( stderr, "Error in getting samples\n" ); exit( -1 ); @@ -1900,6 +1918,10 @@ static CmdlnArgs defaultArgs( args.lfeCustomRoutingEnabled = false; clearString( args.inLfePanningMatrixFile ); + +#ifdef FIX_488_SYNC_DELAY + args.syncMdDelay = 0; +#endif return args; } @@ -2029,6 +2051,12 @@ static void parseOption( exit( -1 ); } break; +#ifdef FIX_488_SYNC_DELAY + case CmdLnOptionId_syncMdDelay: + assert( numOptionValues == 1 ); + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / 5 ); + break; +#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; diff --git a/lib_com/options.h b/lib_com/options.h index dbe71e39f1..21b695350c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,7 @@ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ - +#define FIX_488_SYNC_DELAY /* Eri: Issue 488: Waveform and MD desynchronized in external renderer */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2ba225b2f1..a87d48af60 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -615,8 +615,11 @@ ivas_error ivas_td_binaural_renderer_ext( const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ 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_488_SYNC_DELAY + const ism_md_subframe_update_ext, +#endif + const int16_t output_frame, /* i : output frame length */ + float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ) { ISM_METADATA_FRAME hIsmMetaDataFrame; @@ -627,7 +630,9 @@ ivas_error ivas_td_binaural_renderer_ext( IVAS_REND_AudioConfigType inConfigType; AUDIO_CONFIG transport_config; ivas_error error; +#ifndef FIX_488_SYNC_DELAY int16_t ism_md_subframe_update_ext; +#endif float *p_output[MAX_OUTPUT_CHANNELS]; int16_t ch; @@ -641,7 +646,10 @@ ivas_error ivas_td_binaural_renderer_ext( inConfigType = getAudioConfigType( inConfig ); lfe_idx = LFE_CHANNEL; hIsmMetaData[0] = NULL; + +#ifndef FIX_488_SYNC_DELAY ism_md_subframe_update_ext = 0; +#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 803a612502..3355d06429 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -252,6 +252,9 @@ ivas_error ivas_td_binaural_renderer_ext( const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ ); diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c763630325..199f5fe435 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -342,7 +342,6 @@ typedef struct ivas_render_config_t #endif ivas_roomAcoustics_t roomAcoustics; float directivity[3]; - } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; typedef struct ivas_rev_delay_line_t diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 4e75d5fea8..594df91bf3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4662,6 +4662,9 @@ static ivas_error rotateFrameSba( static ivas_error renderIsmToBinaural( const input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4677,6 +4680,9 @@ static ivas_error renderIsmToBinaural( ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + ism_md_subframe_update_ext, +#endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) { @@ -4833,6 +4839,9 @@ static ivas_error renderIsmToBinauralRoom( static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { #ifdef JBM_TSM_ON_TCS @@ -4859,6 +4868,9 @@ static ivas_error renderIsmToBinauralReverb( ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + ism_md_subframe_update_ext, +#endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { @@ -5006,6 +5018,9 @@ static ivas_error renderIsmToMasa( static ivas_error renderInputIsm( input_ism *ismInput, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif const IVAS_REND_AudioConfig outConfig, const IVAS_REND_AudioBuffer outAudio ) { @@ -5036,13 +5051,21 @@ static ivas_error renderInputIsm( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: +#ifdef FIX_488_SYNC_DELAY + error = renderIsmToBinaural( ismInput, ism_md_subframe_update_ext, outAudio ); +#else error = renderIsmToBinaural( ismInput, outAudio ); +#endif break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: +#ifdef FIX_488_SYNC_DELAY + error = renderIsmToBinauralReverb( ismInput, ism_md_subframe_update_ext, outAudio ); +#else error = renderIsmToBinauralReverb( ismInput, outAudio ); +#endif break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -5065,6 +5088,9 @@ static ivas_error renderInputIsm( static ivas_error renderActiveInputsIsm( IVAS_REND_HANDLE hIvasRend, +#ifdef FIX_488_SYNC_DELAY + const int16_t ism_md_subframe_update_ext, +#endif IVAS_REND_AudioBuffer outAudio ) { int16_t i; @@ -5078,8 +5104,11 @@ static ivas_error renderActiveInputsIsm( /* Skip inactive inputs */ continue; } - +#ifdef FIX_488_SYNC_DELAY + if ( ( error = renderInputIsm( pCurrentInput, ism_md_subframe_update_ext, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -5184,7 +5213,11 @@ static ivas_error renderMcToBinaural( if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, NULL, - mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + mcInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + NULL, +#endif + mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -5277,7 +5310,11 @@ static ivas_error renderMcToBinauralRoom( if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, mcInput->base.inConfig, &mcInput->customLsInput, mcInput->base.ctx.pCombinedOrientationData, - NULL, mcInput->hReverb, mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) + NULL, mcInput->hReverb, +#ifdef FIX_488_SYNC_DELAY + NULL, +#endif + mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { return error; } @@ -6359,7 +6396,10 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_GetSamples( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t sync_md_delay, +#endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ) { @@ -6432,8 +6472,11 @@ ivas_error IVAS_REND_GetSamples( /* Clear output buffer */ set_zero( outAudio.data, outAudio.config.numChannels * outAudio.config.numSamplesPerChannel ); - +#ifdef FIX_488_SYNC_DELAY + if ( ( error = renderActiveInputsIsm( hIvasRend, sync_md_delay, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderActiveInputsIsm( hIvasRend, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 88e96d2916..6f9a633329 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -320,6 +320,9 @@ ivas_error IVAS_REND_GetNumAllObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ +#ifdef FIX_488_SYNC_DELAY + const int16_t sync_md_delay, +#endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ); -- GitLab From 3127c8444d7aaec4c783b7fed4ec5c472ba3cd91 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 16:02:04 +0200 Subject: [PATCH 0261/1418] Cleanup --- lib_rend/lib_rend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 594df91bf3..e077e3a0e8 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5215,7 +5215,7 @@ static ivas_error renderMcToBinaural( NULL, mcInput->hReverb, #ifdef FIX_488_SYNC_DELAY - NULL, + 0, #endif mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { @@ -5312,7 +5312,7 @@ static ivas_error renderMcToBinauralRoom( mcInput->base.ctx.pCombinedOrientationData, NULL, mcInput->hReverb, #ifdef FIX_488_SYNC_DELAY - NULL, + 0, #endif mcInput->base.inputBuffer.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) { -- GitLab From 70bd727e460627e0e56e1cdc1e10fa66d77f1e5b Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 16:59:58 +0200 Subject: [PATCH 0262/1418] Cleanup to move the md_subframe_update variable into ism_input structure --- apps/renderer.c | 3 ++- lib_rend/ivas_objectRenderer.c | 2 +- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/lib_rend.c | 35 +++++++++++----------------------- lib_rend/lib_rend.h | 2 +- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index ac643d058f..a2453fd238 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2054,7 +2054,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / 5 ); + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1/50/4*1000) subframe index */ + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES * 1000 ) ); break; #endif default: diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index a87d48af60..1e7fe9b907 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -616,7 +616,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const ism_md_subframe_update_ext, + const ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 3355d06429..ef7350611e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -253,7 +253,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, + const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e077e3a0e8..edf18082f1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -123,6 +123,9 @@ typedef struct float nonDiegeticPanGain; OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif } input_ism; typedef struct @@ -4662,9 +4665,6 @@ static ivas_error rotateFrameSba( static ivas_error renderIsmToBinaural( const input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif IVAS_REND_AudioBuffer outAudio ) { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -4681,7 +4681,7 @@ static ivas_error renderIsmToBinaural( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ism_md_subframe_update_ext, + ismInput->ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) @@ -4839,9 +4839,6 @@ static ivas_error renderIsmToBinauralRoom( static ivas_error renderIsmToBinauralReverb( input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif IVAS_REND_AudioBuffer outAudio ) { #ifdef JBM_TSM_ON_TCS @@ -4869,7 +4866,7 @@ static ivas_error renderIsmToBinauralReverb( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ism_md_subframe_update_ext, + ismInput->ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) @@ -5018,9 +5015,6 @@ static ivas_error renderIsmToMasa( static ivas_error renderInputIsm( input_ism *ismInput, -#ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, -#endif const IVAS_REND_AudioConfig outConfig, const IVAS_REND_AudioBuffer outAudio ) { @@ -5051,21 +5045,13 @@ static ivas_error renderInputIsm( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: -#ifdef FIX_488_SYNC_DELAY - error = renderIsmToBinaural( ismInput, ism_md_subframe_update_ext, outAudio ); -#else error = renderIsmToBinaural( ismInput, outAudio ); -#endif break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: -#ifdef FIX_488_SYNC_DELAY - error = renderIsmToBinauralReverb( ismInput, ism_md_subframe_update_ext, outAudio ); -#else error = renderIsmToBinauralReverb( ismInput, outAudio ); -#endif break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -5089,7 +5075,7 @@ static ivas_error renderInputIsm( static ivas_error renderActiveInputsIsm( IVAS_REND_HANDLE hIvasRend, #ifdef FIX_488_SYNC_DELAY - const int16_t ism_md_subframe_update_ext, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio ) { @@ -5105,10 +5091,11 @@ static ivas_error renderActiveInputsIsm( continue; } #ifdef FIX_488_SYNC_DELAY - if ( ( error = renderInputIsm( pCurrentInput, ism_md_subframe_update_ext, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) -#else - if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) + /* Metadata Delay in subframes to sync with audio delay */ + pCurrentInput->ism_md_subframe_update_ext = sync_md_delay; #endif + if ( ( error = renderInputIsm( pCurrentInput, hIvasRend->outputConfig, outAudio ) ) != IVAS_ERR_OK ) + { return error; } @@ -6398,7 +6385,7 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t sync_md_delay, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 6f9a633329..9f7edd9d7d 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -321,7 +321,7 @@ ivas_error IVAS_REND_GetNumAllObjects( ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ #ifdef FIX_488_SYNC_DELAY - const int16_t sync_md_delay, + const int16_t sync_md_delay, /* i: Metadata Delay in subframes to sync with audio delay */ #endif IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ ); -- GitLab From 464034c3bed991645567d2d51038d7d59d5e8f41 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:01:35 +0200 Subject: [PATCH 0263/1418] Cleanup --- lib_rend/ivas_stat_rend.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 199f5fe435..c763630325 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -342,6 +342,7 @@ typedef struct ivas_render_config_t #endif ivas_roomAcoustics_t roomAcoustics; float directivity[3]; + } RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE; typedef struct ivas_rev_delay_line_t -- GitLab From df59e93537aca0454eef191af92c5d198559cb9f Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:18:42 +0200 Subject: [PATCH 0264/1418] Adjust the quantization for 5ms subframe --- apps/renderer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index a2453fd238..b063e70ee7 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2054,8 +2054,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - /* Metadata Delay to sync with audio delay converted from ms to 5ms (1/50/4*1000) subframe index */ - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES * 1000 ) ); + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); break; #endif default: -- GitLab From d00ea6ca948bea8fcd28f42ea9f97ce31d06fb6d Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Mon, 26 Jun 2023 17:25:02 +0200 Subject: [PATCH 0265/1418] Information for the default value is added --- apps/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index b063e70ee7..f72234bf2a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -313,7 +313,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", - .description = "Metadata Synchronization Delay in ms", + .description = "Metadata Synchronization Delay in ms, Default is 0", }, #endif }; -- GitLab From 4fc681566ec254913badd85613091bca1830a1ef Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 26 Jun 2023 22:11:22 +0200 Subject: [PATCH 0266/1418] potential fix for overflow on ramp_up_flag --- lib_com/options.h | 2 +- lib_enc/stat_enc.h | 4 ++++ lib_enc/transient_detection.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e4d3a06b58..5705744830 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ - +#define FIX_583_CLANG_TRANS_DET /* FhG: Issue 583: clang left shift on ramp_up_flag in transient detector */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 4a47761f9c..2e7924f371 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -124,7 +124,11 @@ typedef struct float firState1; float firState2; +#ifdef FIX_583_CLANG_TRANS_DET + uint16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */ +#else int16_t ramp_up_flag; /* bit map flags to indicate a ramp up in beginning of TCX frame */ +#endif } SubblockEnergies; diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c index 1f8b36819f..112a4d274f 100644 --- a/lib_enc/transient_detection.c +++ b/lib_enc/transient_detection.c @@ -241,7 +241,11 @@ void RunTransientDetection( UpdateDelayBuffer( filteredInput, length, &hTranDet->delayBuffer ); /* compute ramp up flag */ +#ifdef FIX_583_CLANG_TRANS_DET + pSubblockEnergies->ramp_up_flag = ((pSubblockEnergies->ramp_up_flag << 1) & 0x0003); +#else pSubblockEnergies->ramp_up_flag = pSubblockEnergies->ramp_up_flag << 1; +#endif e0 = dotp( filteredInput + length / 2, filteredInput + length / 2, pSubblockEnergies->pDelayBuffer->nSubblockSize / 2 ) + 0.5f * MIN_BLOCK_ENERGY; e1 = pSubblockEnergies->subblockNrg[pSubblockEnergies->nDelay + 4] - e0; if ( e1 > e0 ) -- GitLab From 7047e4555aed5bf0ce27fec7fc4f285e903f78a9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 26 Jun 2023 22:24:54 +0200 Subject: [PATCH 0267/1418] formatting --- lib_enc/transient_detection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c index 112a4d274f..3b345b7333 100644 --- a/lib_enc/transient_detection.c +++ b/lib_enc/transient_detection.c @@ -242,7 +242,7 @@ void RunTransientDetection( /* compute ramp up flag */ #ifdef FIX_583_CLANG_TRANS_DET - pSubblockEnergies->ramp_up_flag = ((pSubblockEnergies->ramp_up_flag << 1) & 0x0003); + pSubblockEnergies->ramp_up_flag = ( ( pSubblockEnergies->ramp_up_flag << 1 ) & 0x0003 ); #else pSubblockEnergies->ramp_up_flag = pSubblockEnergies->ramp_up_flag << 1; #endif -- GitLab From 02752ab741cda5213e56c5124b770ba151a163c0 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Tue, 27 Jun 2023 10:04:12 +0530 Subject: [PATCH 0268/1418] Changes to make renderer pytest bit-exact --- lib_com/options.h | 4 +- lib_dec/ivas_binRenderer_internal.c | 378 +++++++++++++++++++++++- lib_rend/ivas_prot_rend.h | 10 + lib_rend/ivas_reverb.c | 4 +- lib_rend/ivas_rom_binaural_crend_head.c | 1 - lib_rend/ivas_rotation.c | 105 +++++++ lib_rend/lib_rend.c | 131 +++++++- 7 files changed, 624 insertions(+), 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 0f8fc1df7f..21e60152c8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -141,10 +141,10 @@ #define DISABLE_ADAP_RES_COD_TMP /* temporary fix for IVAS-403, disables adaptive residual coding */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ +#define FIX_BIT_EXACT /* fix for bit-inexactness in splitrendering renderer pytest*/ #define USE_HRIR_128_METH5_IRC_53_Q10_SYML_ITRP1_48000 /* Dolby (Orange, FhG) : Contribution 36 - SBA HRIR update */ #define UPDATE_SBA_FILTER /* Dolby (Orange, FhG) : Contribution 36 - SBA HRIR update */ - #define VARIABLE_SPEED_DECODING /* variable speed decoding employing the JBM functioniality; move to DEBUGGING after build for disabled is fixed */ /*#define FIX_XXX_JBM_FIFO_BUFFER */ /* FhG: prevent wraparound of a length identifier in cause of large frames and many channels*/ @@ -180,7 +180,7 @@ #define ISM_FB // 1ISM 24.4 kbps: change SWB to FB coding #define ISM_25k6_HZ_CORE // 1ISM 48 kbps: change ACELP/TCX 16 kHz core to TCX only 25.6 kHz core -#define FIX_SPLIT_REND_MERGE +#define FIX_SPLIT_REND_MERGE /* Resolving the compilation warnings after splitrenderer main updation */ #define SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 51b5ad0349..3bea0235aa 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1464,8 +1464,375 @@ void ivas_binaural_cldfb_sf( return; } +#endif +#ifdef FIX_BIT_EXACT +/*------------------------------------------------------------------------- + * ivas_binaural_reverb_processFrame() + * + * Compute the reverberation - room effect + *------------------------------------------------------------------------*/ + +void ivas_binaural_reverb_processFrame( + REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ + const int16_t numInChannels, /* i : num inputs to be processed */ + float inReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real, Comment: This change swaps two first dimensions as first dimension is not constant. */ + float inImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ + float outReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ + float outImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ + const uint8_t offsetSamplesIO /* i : number of offset samples */ +) +{ + /* Declare the required variables */ + int16_t idx, bin, ch, sample, invertSampleIndex, tapIdx, *phaseShiftTypePr; + float **tapRealPr, **tapImagPr; + + /* 1) Rotate the data in the loop buffer of the reverberator. + * Notice that the audio at the loop buffers is at time-inverted order + * for convolution purposes later on. */ + for ( bin = 0; bin < hReverb->numBins; bin++ ) + { + /* Move the data forwards by blockSize (i.e. by the frame size of 16 CLDFB slots) */ + mvr2r( hReverb->loopBufReal[bin], hReverb->loopBufReal[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); + mvr2r( hReverb->loopBufImag[bin], hReverb->loopBufImag[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); + + /* Add the data from the end of the loop to the beginning, with an attenuation factor + * according to RT60. This procedure generates an IIR decaying response. The response + * is decorrelated later on. */ + v_multc( hReverb->loopBufReal[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufReal[bin], hReverb->blockSize ); + v_multc( hReverb->loopBufImag[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufImag[bin], hReverb->blockSize ); + } + + /* 2) Apply the determined pre-delay to the input audio, and add the delayed audio to the loop. */ + idx = hReverb->preDelayBufferIndex; + for ( sample = 0; sample < hReverb->blockSize; sample++ ) + { + uint16_t sampleWithOffset; + sampleWithOffset = sample + offsetSamplesIO; + invertSampleIndex = hReverb->blockSize - sample - 1; + for ( bin = 0; bin < hReverb->numBins; bin++ ) + { + /* Add from pre-delay buffer a sample to the loop buffer, in a time-inverted order. + * Also apply the spectral gains determined for the reverberation */ + hReverb->loopBufReal[bin][invertSampleIndex] += hReverb->preDelayBufferReal[idx][bin] * hReverb->reverbEqGains[bin]; + hReverb->loopBufImag[bin][invertSampleIndex] += hReverb->preDelayBufferImag[idx][bin] * hReverb->reverbEqGains[bin]; + hReverb->preDelayBufferReal[idx][bin] = 0.0f; + hReverb->preDelayBufferImag[idx][bin] = 0.0f; + } + + /* Add every second input channel as is to the pre-delay buffer, and every second input channel with + * 90 degrees phase shift to reduce energy imbalances between coherent and incoherent sounds */ + for ( ch = 0; ch < numInChannels; ch++ ) + { + if ( ch % 2 ) + { + v_add( hReverb->preDelayBufferReal[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); + v_add( hReverb->preDelayBufferImag[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); + } + else + { + v_sub( hReverb->preDelayBufferReal[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); + v_add( hReverb->preDelayBufferImag[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); + } + } + idx = ( idx + 1 ) % hReverb->preDelayBufferLength; + } + hReverb->preDelayBufferIndex = idx; + + /* 3) Perform the filtering/decorrelating, using complex and sparse FIR filtering */ + for ( bin = 0; bin < hReverb->numBins; bin++ ) + { + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + /* These tap pointers have been determined to point to the loop buffer at sparse locations */ + tapRealPr = hReverb->tapPointersReal[bin][ch]; + tapImagPr = hReverb->tapPointersImag[bin][ch]; + phaseShiftTypePr = hReverb->tapPhaseShiftType[bin][ch]; + + /* Flush output */ + set_f( hReverb->outputBufferReal[bin][ch], 0.0f, hReverb->blockSize ); + set_f( hReverb->outputBufferImag[bin][ch], 0.0f, hReverb->blockSize ); + + /* Add from temporally decaying sparse tap locations the audio to the output. */ + for ( tapIdx = 0; tapIdx < hReverb->taps[bin][ch]; tapIdx++ ) + { + switch ( phaseShiftTypePr[tapIdx] ) + { + case 0: /* 0 degrees phase */ + v_add( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); + v_add( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); + break; + case 1: /* 90 degrees phase */ + v_sub( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); + v_add( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); + break; + case 2: /* 180 degrees phase */ + v_sub( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); + v_sub( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); + break; + default: /* 270 degrees phase */ + v_add( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); + v_sub( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); + break; + } + } + } + + /* Generate diffuse field binaural coherence by mixing the incoherent reverberated channels with pre-defined gains */ + if ( bin <= hReverb->highestBinauralCoherenceBin ) + { + if ( hReverb->useBinauralCoherence ) + { + for ( sample = 0; sample < hReverb->blockSize; sample++ ) + { + float leftRe, rightRe, leftIm, rightIm; + + leftRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][1][sample]; + rightRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][0][sample]; + leftIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][1][sample]; + rightIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][0][sample]; + + hReverb->outputBufferReal[bin][0][sample] = leftRe; + hReverb->outputBufferReal[bin][1][sample] = rightRe; + hReverb->outputBufferImag[bin][0][sample] = leftIm; + hReverb->outputBufferImag[bin][1][sample] = rightIm; + } + } + } + } + + /* 4) Write data to output */ + for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) + { + for ( sample = 0; sample < hReverb->blockSize; sample++ ) + { + uint16_t sampleWithOffset; + + sampleWithOffset = sample + offsetSamplesIO; + /* Audio was in the temporally inverted order for convolution, re-invert audio to output */ + invertSampleIndex = hReverb->blockSize - sample - 1; + + for ( bin = 0; bin < hReverb->numBins; bin++ ) + { + outReal[ch][sampleWithOffset][bin] = hReverb->outputBufferReal[bin][ch][invertSampleIndex]; + outImag[ch][sampleWithOffset][bin] = hReverb->outputBufferImag[bin][ch][invertSampleIndex]; + } + for ( ; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) + { + outReal[ch][sampleWithOffset][bin] = 0.0f; + outImag[ch][sampleWithOffset][bin] = 0.0f; + } + } + } + + return; +} +void ivas_binRenderer_2( + BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ + HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, +#endif +#ifdef SPLIT_REND_WITH_HEAD_ROT + float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ + float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ +#else + float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ + float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ +#endif + float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ + float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ +) +{ + int16_t chIdx, k; +#ifdef SPLIT_REND_WITH_HEAD_ROT + int16_t pos_idx, num_poses; +#endif + int16_t numTimeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; + + push_wmops( "fastconv_binaural_rendering" ); +#ifdef SPLIT_REND_WITH_HEAD_ROT + num_poses = hBinRenderer->numPoses; #endif + /* Compute Convolution */ + /* memory reset for the binaural output */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { + set_zero( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); + set_zero( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); + } + } + } +#else + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { + set_zero( Cldfb_RealBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); + set_zero( Cldfb_ImagBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); + } + } +#endif + + /* Head rotation in HOA3 or CICPx */ + if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) + { + if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) + { + /* Rotation in SHD (HOA3) */ + 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, MAX_PARAM_SPATIAL_SUBFRAMES, 3 ); + } + else if ( hHeadTrackData->shd_rot_max_order > 0 ) + { + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hHeadTrackData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, MAX_PARAM_SPATIAL_SUBFRAMES, hHeadTrackData->shd_rot_max_order ); + } + } + else + { + /* Rotation in SD (CICPx) */ + rotateFrame_sd_cldfb_2( hHeadTrackData, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, hBinRenderer->conv_band ); + } + } + + /* HOA decoding to CICP19 if needed*/ + if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && hBinRenderer->nInChannels != 16 ) + { + ivas_sba2mc_cldfb( *( hBinRenderer->hInputSetup ), RealBuffer, ImagBuffer, hBinRenderer->nInChannels, hBinRenderer->conv_band, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer->hoa_dec_mtx ); + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], RealBuffer, ImagBuffer, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer, 0 ); +#else + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ); +#endif + +#ifdef SPLIT_REND_WITH_HEAD_ROT + /*TODO : move this to a separate function*/ + if ( pMultiBinPoseData->num_poses > 1 ) + { + IVAS_QUATERNION Quaternions_rel, Quaternions_abs, *Quaternions_ref; + float Rmat_local[3][3]; + + if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) + { + Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; + Quaternions_rel.w = -3.0f; /*euler*/ + Quaternions_abs.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + + for ( pos_idx = 1; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + Quaternions_rel.x = pMultiBinPoseData->relative_head_poses[pos_idx][0] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + Quaternions_rel.y = pMultiBinPoseData->relative_head_poses[pos_idx][1] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + Quaternions_rel.z = pMultiBinPoseData->relative_head_poses[pos_idx][2] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; + Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; + Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; + + + QuatToRotMat( Quaternions_rel, Rmat_local ); + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, MAX_PARAM_SPATIAL_SUBFRAMES, 3 ); + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + pos_idx +#endif + ); + } + +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + if ( hPostRendHeadTrackData != NULL ) + { + IVAS_QUATERNION *Quaternions_new1; + IVAS_QUATERNION Quaternions_new; + Quaternions_new1 = &hPostRendHeadTrackData->Quaternions[hPostRendHeadTrackData->num_quaternions++]; + Quaternions_new.w = -3.0f; /*euler*/ + Quat2EulerDegree( *Quaternions_new1, &Quaternions_new.z, &Quaternions_new.y, &Quaternions_new.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quaternions_rel.x = Quaternions_new.x - Quaternions_abs.x; + Quaternions_rel.y = Quaternions_new.y - Quaternions_abs.y; + Quaternions_rel.z = Quaternions_new.z - Quaternions_abs.z; + Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; + Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; + Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; + + QuatToRotMat( Quaternions_rel, Rmat_local ); + rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); + ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[num_poses], Cldfb_ImagBuffer_Binaural[num_poses], RealBuffer, ImagBuffer, hBinRenderer +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + num_poses +#endif + ); + } +#endif + } + } +#endif + + + /* Obtain the binaural dmx and compute the reverb */ + if ( hBinRenderer->hReverb != NULL ) + { + float reverbRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float reverbIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float inRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + float inIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; + + ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm ); + + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { + set_zero( reverbRe[chIdx][k], hBinRenderer->max_band ); + set_zero( reverbIm[chIdx][k], hBinRenderer->max_band ); + } + } + + ivas_binaural_reverb_processFrame( hBinRenderer->hReverb, BINAURAL_CHANNELS, inRe, inIm, reverbRe, reverbIm, 0u ); + + /* Add the conv module and reverb module output */ + for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + for ( k = 0; k < numTimeSlots; k++ ) + { +#ifdef SPLIT_REND_WITH_HEAD_ROT + for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) + { + /* Combine first and second parts to generate binaural output signal with room effect */ + v_add( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); + v_add( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); + } +#else + /* Combine first and second parts to generate binaural output signal with room effect */ + v_add( Cldfb_RealBuffer_Binaural[chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); + v_add( Cldfb_ImagBuffer_Binaural[chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); +#endif + } + } + } + + pop_wmops(); + + return; +} +#endif /*------------------------------------------------------------------------- * ivas_binRenderer() * @@ -1757,7 +2124,14 @@ void ivas_rend_CldfbMultiBinRendProcess( head_track_post.shd_rot_max_order = -1; head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); #endif - +#ifdef FIX_BIT_EXACT + ivas_binRenderer_2( hCldfbRend, &head_track, + pMultiBinPoseData, +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + &head_track_post, +#endif + Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); +#else ivas_binRenderer( hCldfbRend, &head_track, pMultiBinPoseData, #ifdef FIX_SPLIT_REND_MERGE @@ -1769,7 +2143,7 @@ void ivas_rend_CldfbMultiBinRendProcess( #endif Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); - +#endif for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) { for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 58ad1875bc..eea0ea6147 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -957,7 +957,17 @@ void rotateFrame_shd_cldfb( const int16_t numTimeSlots, /* i : number of time slots to process */ const int16_t shd_rot_max_order /* i : split-order rotation method */ ); +#ifdef FIX_BIT_EXACT +void rotateFrame_sd_cldfb_2( + HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ + float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ + float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain imag part */ + const IVAS_OUTPUT_SETUP_HANDLE hOutputSetup, /* i : output format setup number of channels */ + const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ + const int16_t nb_band /* i : number of CLDFB bands to process */ +); +#endif void rotateFrame_sd_cldfb( #ifdef EXTERNAL_ORIENTATIONS float Rmat[3][3], /* i : real-space rotation matrix */ diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index e5f0a0ac96..f92f0b2fa6 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1609,9 +1609,8 @@ ivas_error ivas_reverb_process( return IVAS_ERR_OK; } - /*------------------------------------------------------------------------- - * ivas_binaural_reverb_processFrame() + * ivas_binaural_reverb_processSubFrame() * * Compute the reverberation - room effect *------------------------------------------------------------------------*/ @@ -1770,7 +1769,6 @@ void ivas_binaural_reverb_processSubframe( return; } - /*------------------------------------------------------------------------- * ivas_binaural_reverb_open() * diff --git a/lib_rend/ivas_rom_binaural_crend_head.c b/lib_rend/ivas_rom_binaural_crend_head.c index 36465a65c0..f2dbe4206a 100644 --- a/lib_rend/ivas_rom_binaural_crend_head.c +++ b/lib_rend/ivas_rom_binaural_crend_head.c @@ -57,7 +57,6 @@ #ifdef USE_HRIR_128_METH5_IRC_53_Q10_SYML_ITRP1_48000 - /********************** CRendBin_Combined_HRIR **********************/ #ifdef UPDATE_SBA_FILTER diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index b9da6cba38..f71f82a6d2 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -692,7 +692,112 @@ void rotateFrame_shd_cldfb( return; } +#ifdef FIX_BIT_EXACT +void rotateFrame_sd_cldfb_2( + HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ + float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ + float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain imag part */ + const IVAS_OUTPUT_SETUP_HANDLE hOutputSetup, /* i : output format setup number of channels */ + const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ + const int16_t nb_band /* i : number of CLDFB bands to process */ +) +{ + int16_t iBlock, iBand, m, n; + float gains[MAX_CICP_CHANNELS - 1][MAX_CICP_CHANNELS - 1]; + int16_t azimuth, elevation; + float Rmat[3][3]; + float g1; + float realRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; + float imagRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; + float *p_realRot, *p_imagRot; + float *p_real, *p_imag; + int16_t nInChannels; + int16_t isPlanar; + + push_wmops( "rotateFrame_sd_cldfb" ); + + nInChannels = hOutputSetup->nchan_out_woLFE; + isPlanar = 1; + for ( n = 0; n < nInChannels; n++ ) + { + if ( hOutputSetup->ls_elevation[n] != 0 ) + { + isPlanar = 0; + break; + } + } + + /* Get next quaternion and calculate rotation matrix */ + QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], Rmat ); + + /* rotation of Euler angles */ + for ( n = 0; n < nInChannels; n++ ) + { + rotateAziEle( hOutputSetup->ls_azimuth[n], hOutputSetup->ls_elevation[n], &azimuth, &elevation, Rmat, isPlanar ); + if ( hEFAPdata != NULL && ( hOutputSetup->ls_azimuth[n] != azimuth || hOutputSetup->ls_elevation[n] != elevation ) ) + { + efap_determine_gains( hEFAPdata, gains[n], azimuth, elevation, EFAP_MODE_EFAP ); + } + else + { + set_zero( gains[n], nInChannels ); + gains[n][n] = 1.0f; + } + } + + /* Apply panning gains by mtx multiplication*/ + for ( n = 0; n < nInChannels; n++ ) + { + set_zero( realRot[n], MAX_PARAM_SPATIAL_SUBFRAMES * nb_band ); + set_zero( imagRot[n], MAX_PARAM_SPATIAL_SUBFRAMES * nb_band ); + for ( m = 0; m < nInChannels; m++ ) + { + g1 = gains[m][n]; + p_realRot = realRot[n]; + p_imagRot = imagRot[n]; + if ( g1 > 0.f ) + { + for ( iBlock = 0; iBlock < MAX_PARAM_SPATIAL_SUBFRAMES; iBlock++ ) + { + p_real = Cldfb_RealBuffer[m][iBlock]; + p_imag = Cldfb_ImagBuffer[m][iBlock]; + for ( iBand = 0; iBand < nb_band; iBand++ ) + { + *( p_realRot ) = *p_realRot + g1 * *( p_real++ ); + *( p_imagRot ) = *p_imagRot + g1 * *( p_imag++ ); + p_realRot++; + p_imagRot++; + } + } + } + } + } + for ( n = 0; n < nInChannels; n++ ) + { + p_realRot = realRot[n]; + p_imagRot = imagRot[n]; + for ( iBlock = 0; iBlock < MAX_PARAM_SPATIAL_SUBFRAMES; iBlock++ ) + { + p_real = Cldfb_RealBuffer[n][iBlock]; + p_imag = Cldfb_ImagBuffer[n][iBlock]; + for ( iBand = 0; iBand < nb_band; iBand++ ) + { + *( p_real++ ) = *( p_realRot++ ); + *( p_imag++ ) = *( p_imagRot++ ); + } + for ( ; iBand < CLDFB_NO_CHANNELS_MAX; iBand++ ) + { + *( p_real++ ) = 0.f; + *( p_imag++ ) = 0.f; + } + } + } + pop_wmops(); + + return; +} +#endif /*------------------------------------------------------------------------- * rotateFrame_sd_cldfb() diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 540ab2a915..c66dad8627 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5753,7 +5753,128 @@ static ivas_error rotateFrameSba( return IVAS_ERR_OK; } +#ifdef FIX_BIT_EXACT +static ivas_error rotateFrameSba_2( + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ + rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ + IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ +) +{ + int16_t i, l, n, m; + int16_t m1, m2; + int16_t shd_rot_max_order; + int16_t subframe_idx, subframe_len; +#ifdef SBA_CREND_ROT_OPT + float *writePtr; +#else + float *readPtr, *writePtr; +#endif + rotation_matrix Rmat; + float tmpRot[2 * HEADROT_ORDER + 1]; + rotation_gains gains; + ivas_error error; +#ifdef SBA_CREND_ROT_OPT + int16_t idx; + float val, cf, oneminuscf; +#endif + + push_wmops( "rotateFrameSba" ); + if ( ( error = getAmbisonicsOrder( inConfig, &shd_rot_max_order ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* subframe loop */ + subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; + for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) + { + /* initialize rotation matrices with zeros */ + for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) + { + set_zero( gains[i], HEADROT_SHMAT_DIM ); + } + + /* Get next quaternion and calculate rotation matrix */ + QuatToRotMat( headRotData->headPositions[subframe_idx], Rmat ); + + /* calculate ambisonics rotation matrices for the previous and current frames */ + SHrotmatgen( gains, Rmat, shd_rot_max_order ); + + for ( i = 0; i < subframe_len; i++ ) + { +#ifdef SBA_CREND_ROT_OPT + idx = subframe_idx * subframe_len + i; + cf = headRotData->crossfade[i]; + oneminuscf = 1 - cf; +#endif + /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ + /* apply each angular-momentum block individually to save complexity. */ + + /* loop over l blocks */ + m1 = 1; + m2 = 4; + for ( l = 1; l <= shd_rot_max_order; l++ ) + { + /* compute mtx-vector product for this l */ + for ( n = m1; n < m2; n++ ) + { + tmpRot[n - m1] = 0.f; + + for ( m = m1; m < m2; m++ ) + { +#ifdef SBA_CREND_ROT_OPT + val = inAudio.data[m * inAudio.config.numSamplesPerChannel + idx]; + /* crossfade with previous rotation gains */ + tmpRot[n - m1] += ( cf * gains[n][m] * val + oneminuscf * gains_prev[n][m] * val ); +#else + readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); + /* crossfade with previous rotation gains */ + tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + + ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); +#endif + } + } + /* 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; + } + } + + /*unoptimized code for reference (full matrix multiplication)*/ + // for ( n = 0; n < nchan; n++ ) + // { + // tmpRot[n] = 0.f; + // + // for ( m = 0; m < nchan; m++ ) + // { + // tmpRot[n] += SHrotmat[n][m] * output[m][i]; + // } + // } + // for ( n = 0; n < nchan; n++ ) + // { + // output[n][i] = tmpRot[n]; + // } + + /* move SHrotmat to SHrotmat_prev */ + for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) + { + mvr2r( gains[i], gains_prev[i], HEADROT_SHMAT_DIM ); + } + } + + pop_wmops(); + + return IVAS_ERR_OK; +} +#endif static ivas_error renderIsmToBinaural( const input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) @@ -7247,6 +7368,14 @@ static ivas_error renderSbaToMultiBinaural( mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); + +#ifdef FIX_BIT_EXACT + rotateFrameSba_2( sbaInput->base.inputBuffer, + sbaInput->base.inConfig, + &HeadRotDataLocal, + sbaInput->rot_gains_prev[pos_idx], + tmpRotBuffer ); +#else rotateFrameSba( sbaInput->base.inputBuffer, sbaInput->base.inConfig, &HeadRotDataLocal, @@ -7255,7 +7384,7 @@ static ivas_error renderSbaToMultiBinaural( #endif sbaInput->rot_gains_prev[pos_idx], tmpRotBuffer ); - +#endif copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); -- GitLab From 75ca5d1f55693e9f1690a40d25b80bcbe8648c98 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Tue, 27 Jun 2023 09:09:12 +0300 Subject: [PATCH 0269/1418] Remove duplicate code --- lib_dec/ivas_ism_renderer.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index bc5170b4c6..9c4479374d 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -365,7 +365,6 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( set_f( st_ivas->hIsmRendererData->prev_gains[i], 0.0f, MAX_OUTPUT_CHANNELS ); } -#ifdef MASA_AND_OBJECTS // Todo OMASA JBM: This needs touches for VOIP path at least. Current version is mostly an adapted copy from ivas_ism_renderer_open() if ( st_ivas->hDecoderConfig->voip_active ) { @@ -378,13 +377,6 @@ ivas_error ivas_masa_ism_separate_object_renderer_open( interpolator_length = init_interpolator_length; } st_ivas->hIsmRendererData->interpolator = (float *) malloc( sizeof( float ) * init_interpolator_length ); - for ( i = 0; i < interpolator_length; i++ ) - { - st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length - 1 ); - } -#else - interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif for ( i = 0; i < interpolator_length; i++ ) { -- GitLab From 6bde25918afe43640ecf55a23b865816f7acdbd8 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Tue, 27 Jun 2023 09:39:57 +0200 Subject: [PATCH 0270/1418] Small Fix --- lib_rend/ivas_objectRenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1e7fe9b907..6ff2c005eb 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -616,7 +616,7 @@ ivas_error ivas_td_binaural_renderer_ext( const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY - const ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ + const int16_t ism_md_subframe_update_ext, /* i: Metadata Delay in subframes to sync with audio delay */ #endif const int16_t output_frame, /* i : output frame length */ float output[][L_FRAME48k] /* i/o: SCE channels / Binaural synthesis */ -- GitLab From 198a7b7f4368bd144d797abc61b1b75c9637e103 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Tue, 27 Jun 2023 16:05:56 +0530 Subject: [PATCH 0271/1418] Minor change that was missed while updating --- lib_rend/ivas_output_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 972670ce27..d6a873d26d 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -95,6 +95,9 @@ int16_t audioCfg2channels( case AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif + case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + nchan_out = 2; break; case AUDIO_CONFIG_ISM1: -- GitLab From 205565636a0293b176fd0616b74842d4d57fa5d0 Mon Sep 17 00:00:00 2001 From: rhb Date: Tue, 27 Jun 2023 13:41:57 +0200 Subject: [PATCH 0272/1418] fix clang error about applying offset to NULL pointer --- lib_com/options.h | 2 +- lib_enc/ivas_stereo_mdct_stereo_enc.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 lib_com/options.h diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index e4d3a06b58..04aa796704 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,7 @@ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ - +#define FIX_581_CLANG_OFFSET_TO_NULL /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index b8ab5398ec..3d277e241d 100755 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -1133,15 +1133,29 @@ void initMdctStereoEncData( set_s( hStereoMdct->mdct_stereo_mode, -1, 2 ); /*Initialize sfb parameteres for TCX20 */ +#ifdef FIX_581_CLANG_OFFSET_TO_NULL + stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_NORM] : NULL, &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt ); +#else stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_NORM], &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt ); +#endif /*Initialize sfb parameteres for TCX10 */ +#ifdef FIX_581_CLANG_OFFSET_TO_NULL + stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_SHORT] : NULL, + &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt ); +#else stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_SHORT], &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt ); +#endif /*Initialize sfb parameteres for transitions */ +#ifdef FIX_581_CLANG_OFFSET_TO_NULL + stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_TRAN] : NULL, + &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt ); +#else stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, &hIgfGrid[IGF_GRID_LB_TRAN], &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt ); +#endif set_s( hStereoMdct->IGFStereoMode, -1, 2 ); -- GitLab From a6f99e5ed901153dc87edba9819b1d0ae3348ad0 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 27 Jun 2023 14:21:46 +0200 Subject: [PATCH 0273/1418] Corrected object metadata description in readme.txt --- readme.txt | 7 +- .../trajectories/full-circle-T15.0-w0.0.csv | 6000 ++++++++--------- 2 files changed, 3005 insertions(+), 3002 deletions(-) diff --git a/readme.txt b/readme.txt index 21a5a19e79..6ae443abf3 100644 --- a/readme.txt +++ b/readme.txt @@ -384,12 +384,15 @@ stvISM4.csv These are comma separated files (csv) which indicate the per object position in the format: -frame azimuth, elevation, radius, spread, gain, yaw, pitch, non-diegetic +azimuth, elevation, radius, spread, gain, yaw, pitch, non-diegetic + +Example metadata line with default values: +0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0 with the following meaning: | Parameter | format, value range | meaning --------------------------------------------------------------------------------------------------- -| azimuth | float, [-180,180] | azimuth; positive indicates left; default: 0 +| azimuth | float, [-180,180] | azimuth or panning; positive indicates left; default: 0 --------------------------------------------------------------------------------------------------- | elevation | float, [-90,90] | elevation; positive indicates up; default: 0 --------------------------------------------------------------------------------------------------- diff --git a/scripts/trajectories/full-circle-T15.0-w0.0.csv b/scripts/trajectories/full-circle-T15.0-w0.0.csv index 6963663747..0894809fd1 100644 --- a/scripts/trajectories/full-circle-T15.0-w0.0.csv +++ b/scripts/trajectories/full-circle-T15.0-w0.0.csv @@ -1,3000 +1,3000 @@ - 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.000000 +0, 1.000000, 0.000000, 0.000000, 0.000000 +1, 1.000000, 0.000000, 0.000000, 0.000000 +2, 1.000000, 0.000000, 0.000000, 0.000000 +3, 1.000000, 0.000000, 0.000000, 0.000000 +4, 1.000000, 0.000000, 0.000000, 0.000000 +5, 1.000000, 0.000000, 0.000000, 0.000000 +6, 1.000000, 0.000000, 0.000000, 0.000000 +7, 1.000000, 0.000000, 0.000000, 0.000000 +8, 1.000000, 0.000000, 0.000000, 0.000000 +9, 1.000000, 0.000000, 0.000000, 0.000000 +10, 1.000000, 0.000000, 0.000000, 0.000000 +11, 1.000000, 0.000000, 0.000000, 0.000000 +12, 1.000000, 0.000000, 0.000000, 0.000000 +13, 1.000000, 0.000000, 0.000000, 0.000000 +14, 1.000000, 0.000000, 0.000000, 0.000000 +15, 1.000000, 0.000000, 0.000000, 0.000000 +16, 1.000000, 0.000000, 0.000000, 0.000000 +17, 1.000000, 0.000000, 0.000000, 0.000000 +18, 1.000000, 0.000000, 0.000000, 0.000000 +19, 1.000000, 0.000000, 0.000000, 0.000000 +20, 1.000000, 0.000000, 0.000000, 0.000000 +21, 1.000000, 0.000000, 0.000000, 0.000000 +22, 1.000000, 0.000000, 0.000000, 0.000000 +23, 1.000000, 0.000000, 0.000000, 0.000000 +24, 1.000000, 0.000000, 0.000000, 0.000000 +25, 1.000000, 0.000000, 0.000000, 0.000000 +26, 1.000000, 0.000000, 0.000000, 0.000000 +27, 1.000000, 0.000000, 0.000000, 0.000000 +28, 1.000000, 0.000000, 0.000000, 0.000000 +29, 1.000000, 0.000000, 0.000000, 0.000000 +30, 1.000000, 0.000000, 0.000000, 0.000000 +31, 1.000000, 0.000000, 0.000000, 0.000000 +32, 1.000000, 0.000000, 0.000000, 0.000000 +33, 1.000000, 0.000000, 0.000000, 0.000000 +34, 1.000000, 0.000000, 0.000000, 0.000000 +35, 1.000000, 0.000000, 0.000000, 0.000000 +36, 1.000000, 0.000000, 0.000000, 0.000000 +37, 1.000000, 0.000000, 0.000000, 0.000000 +38, 1.000000, 0.000000, 0.000000, 0.000000 +39, 1.000000, 0.000000, 0.000000, 0.000000 +40, 1.000000, 0.000000, 0.000000, 0.000000 +41, 1.000000, 0.000000, 0.000000, 0.000000 +42, 1.000000, 0.000000, 0.000000, 0.000000 +43, 1.000000, 0.000000, 0.000000, 0.000000 +44, 1.000000, 0.000000, 0.000000, 0.000000 +45, 1.000000, 0.000000, 0.000000, 0.000000 +46, 1.000000, 0.000000, 0.000000, 0.000000 +47, 1.000000, 0.000000, 0.000000, 0.000000 +48, 1.000000, 0.000000, 0.000000, 0.000000 +49, 1.000000, 0.000000, 0.000000, 0.000000 +50, 1.000000, 0.000000, 0.000000, 0.000000 +51, 1.000000, 0.000000, 0.000000, 0.000000 +52, 1.000000, 0.000000, 0.000000, 0.000000 +53, 1.000000, 0.000000, 0.000000, 0.000000 +54, 1.000000, 0.000000, 0.000000, 0.000000 +55, 1.000000, 0.000000, 0.000000, 0.000000 +56, 1.000000, 0.000000, 0.000000, 0.000000 +57, 1.000000, 0.000000, 0.000000, 0.000000 +58, 1.000000, 0.000000, 0.000000, 0.000000 +59, 1.000000, 0.000000, 0.000000, 0.000000 +60, 1.000000, 0.000000, 0.000000, 0.000000 +61, 1.000000, 0.000000, 0.000000, 0.000000 +62, 1.000000, 0.000000, 0.000000, 0.000000 +63, 1.000000, 0.000000, 0.000000, 0.000000 +64, 1.000000, 0.000000, 0.000000, 0.000000 +65, 1.000000, 0.000000, 0.000000, 0.000000 +66, 1.000000, 0.000000, 0.000000, 0.000000 +67, 1.000000, 0.000000, 0.000000, 0.000000 +68, 1.000000, 0.000000, 0.000000, 0.000000 +69, 1.000000, 0.000000, 0.000000, 0.000000 +70, 1.000000, 0.000000, 0.000000, 0.000000 +71, 1.000000, 0.000000, 0.000000, 0.000000 +72, 1.000000, 0.000000, 0.000000, 0.000000 +73, 1.000000, 0.000000, 0.000000, 0.000000 +74, 1.000000, 0.000000, 0.000000, 0.000000 +75, 1.000000, 0.000000, 0.000000, 0.000000 +76, 1.000000, 0.000000, 0.000000, 0.000000 +77, 1.000000, 0.000000, 0.000000, 0.000000 +78, 1.000000, 0.000000, 0.000000, 0.000000 +79, 1.000000, 0.000000, 0.000000, 0.000000 +80, 1.000000, 0.000000, 0.000000, 0.000000 +81, 1.000000, 0.000000, 0.000000, 0.000000 +82, 1.000000, 0.000000, 0.000000, 0.000000 +83, 1.000000, 0.000000, 0.000000, 0.000000 +84, 1.000000, 0.000000, 0.000000, 0.000000 +85, 1.000000, 0.000000, 0.000000, 0.000000 +86, 1.000000, 0.000000, 0.000000, 0.000000 +87, 1.000000, 0.000000, 0.000000, 0.000000 +88, 1.000000, 0.000000, 0.000000, 0.000000 +89, 1.000000, 0.000000, 0.000000, 0.000000 +90, 1.000000, 0.000000, 0.000000, 0.000000 +91, 1.000000, 0.000000, 0.000000, 0.000000 +92, 1.000000, 0.000000, 0.000000, 0.000000 +93, 1.000000, 0.000000, 0.000000, 0.000000 +94, 1.000000, 0.000000, 0.000000, 0.000000 +95, 1.000000, 0.000000, 0.000000, 0.000000 +96, 1.000000, 0.000000, 0.000000, 0.000000 +97, 1.000000, 0.000000, 0.000000, 0.000000 +98, 1.000000, 0.000000, 0.000000, 0.000000 +99, 1.000000, 0.000000, 0.000000, 0.000000 +100, 1.000000, 0.000000, 0.000000, 0.000000 +101, 1.000000, 0.000000, 0.000000, 0.000000 +102, 1.000000, 0.000000, 0.000000, 0.000000 +103, 1.000000, 0.000000, 0.000000, 0.000000 +104, 1.000000, 0.000000, 0.000000, 0.000000 +105, 1.000000, 0.000000, 0.000000, 0.000000 +106, 1.000000, 0.000000, 0.000000, 0.000000 +107, 1.000000, 0.000000, 0.000000, 0.000000 +108, 1.000000, 0.000000, 0.000000, 0.000000 +109, 1.000000, 0.000000, 0.000000, 0.000000 +110, 1.000000, 0.000000, 0.000000, 0.000000 +111, 1.000000, 0.000000, 0.000000, 0.000000 +112, 1.000000, 0.000000, 0.000000, 0.000000 +113, 1.000000, 0.000000, 0.000000, 0.000000 +114, 1.000000, 0.000000, 0.000000, 0.000000 +115, 1.000000, 0.000000, 0.000000, 0.000000 +116, 1.000000, 0.000000, 0.000000, 0.000000 +117, 1.000000, 0.000000, 0.000000, 0.000000 +118, 1.000000, 0.000000, 0.000000, 0.000000 +119, 1.000000, 0.000000, 0.000000, 0.000000 +120, 1.000000, 0.000000, 0.000000, 0.000000 +121, 1.000000, 0.000000, 0.000000, 0.000000 +122, 1.000000, 0.000000, 0.000000, 0.000000 +123, 1.000000, 0.000000, 0.000000, 0.000000 +124, 1.000000, 0.000000, 0.000000, 0.000000 +125, 1.000000, 0.000000, 0.000000, 0.000000 +126, 1.000000, 0.000000, 0.000000, 0.000000 +127, 1.000000, 0.000000, 0.000000, 0.000000 +128, 1.000000, 0.000000, 0.000000, 0.000000 +129, 1.000000, 0.000000, 0.000000, 0.000000 +130, 1.000000, 0.000000, 0.000000, 0.000000 +131, 1.000000, 0.000000, 0.000000, 0.000000 +132, 1.000000, 0.000000, 0.000000, 0.000000 +133, 1.000000, 0.000000, 0.000000, 0.000000 +134, 1.000000, 0.000000, 0.000000, 0.000000 +135, 1.000000, 0.000000, 0.000000, 0.000000 +136, 1.000000, 0.000000, 0.000000, 0.000000 +137, 1.000000, 0.000000, 0.000000, 0.000000 +138, 1.000000, 0.000000, 0.000000, 0.000000 +139, 1.000000, 0.000000, 0.000000, 0.000000 +140, 1.000000, 0.000000, 0.000000, 0.000000 +141, 1.000000, 0.000000, 0.000000, 0.000000 +142, 1.000000, 0.000000, 0.000000, 0.000000 +143, 1.000000, 0.000000, 0.000000, 0.000000 +144, 1.000000, 0.000000, 0.000000, 0.000000 +145, 1.000000, 0.000000, 0.000000, 0.000000 +146, 1.000000, 0.000000, 0.000000, 0.000000 +147, 1.000000, 0.000000, 0.000000, 0.000000 +148, 1.000000, 0.000000, 0.000000, 0.000000 +149, 1.000000, 0.000000, 0.000000, 0.000000 +150, 1.000000, 0.000000, 0.000000, 0.000000 +151, 1.000000, 0.000000, 0.000000, 0.000000 +152, 1.000000, 0.000000, 0.000000, 0.000000 +153, 1.000000, 0.000000, 0.000000, 0.000000 +154, 1.000000, 0.000000, 0.000000, 0.000000 +155, 1.000000, 0.000000, 0.000000, 0.000000 +156, 1.000000, 0.000000, 0.000000, 0.000000 +157, 1.000000, 0.000000, 0.000000, 0.000000 +158, 1.000000, 0.000000, 0.000000, 0.000000 +159, 1.000000, 0.000000, 0.000000, 0.000000 +160, 1.000000, 0.000000, 0.000000, 0.000000 +161, 1.000000, 0.000000, 0.000000, 0.000000 +162, 1.000000, 0.000000, 0.000000, 0.000000 +163, 1.000000, 0.000000, 0.000000, 0.000000 +164, 1.000000, 0.000000, 0.000000, 0.000000 +165, 1.000000, 0.000000, 0.000000, 0.000000 +166, 1.000000, 0.000000, 0.000000, 0.000000 +167, 1.000000, 0.000000, 0.000000, 0.000000 +168, 1.000000, 0.000000, 0.000000, 0.000000 +169, 1.000000, 0.000000, 0.000000, 0.000000 +170, 1.000000, 0.000000, 0.000000, 0.000000 +171, 1.000000, 0.000000, 0.000000, 0.000000 +172, 1.000000, 0.000000, 0.000000, 0.000000 +173, 1.000000, 0.000000, 0.000000, 0.000000 +174, 1.000000, 0.000000, 0.000000, 0.000000 +175, 1.000000, 0.000000, 0.000000, 0.000000 +176, 1.000000, 0.000000, 0.000000, 0.000000 +177, 1.000000, 0.000000, 0.000000, 0.000000 +178, 1.000000, 0.000000, 0.000000, 0.000000 +179, 1.000000, 0.000000, 0.000000, 0.000000 +180, 1.000000, 0.000000, 0.000000, 0.000000 +181, 1.000000, 0.000000, 0.000000, 0.000000 +182, 1.000000, 0.000000, 0.000000, 0.000000 +183, 1.000000, 0.000000, 0.000000, 0.000000 +184, 1.000000, 0.000000, 0.000000, 0.000000 +185, 1.000000, 0.000000, 0.000000, 0.000000 +186, 1.000000, 0.000000, 0.000000, 0.000000 +187, 1.000000, 0.000000, 0.000000, 0.000000 +188, 1.000000, 0.000000, 0.000000, 0.000000 +189, 1.000000, 0.000000, 0.000000, 0.000000 +190, 1.000000, 0.000000, 0.000000, 0.000000 +191, 1.000000, 0.000000, 0.000000, 0.000000 +192, 1.000000, 0.000000, 0.000000, 0.000000 +193, 1.000000, 0.000000, 0.000000, 0.000000 +194, 1.000000, 0.000000, 0.000000, 0.000000 +195, 1.000000, 0.000000, 0.000000, 0.000000 +196, 1.000000, 0.000000, 0.000000, 0.000000 +197, 1.000000, 0.000000, 0.000000, 0.000000 +198, 1.000000, 0.000000, 0.000000, 0.000000 +199, 1.000000, 0.000000, 0.000000, 0.000000 +200, 1.000000, 0.000000, 0.000000, 0.000000 +201, 1.000000, 0.000000, 0.000000, 0.000000 +202, 1.000000, 0.000000, 0.000000, 0.000000 +203, 1.000000, 0.000000, 0.000000, 0.000000 +204, 1.000000, 0.000000, 0.000000, 0.000000 +205, 1.000000, 0.000000, 0.000000, 0.000000 +206, 1.000000, 0.000000, 0.000000, 0.000000 +207, 1.000000, 0.000000, 0.000000, 0.000000 +208, 1.000000, 0.000000, 0.000000, 0.000000 +209, 1.000000, 0.000000, 0.000000, 0.000000 +210, 1.000000, 0.000000, 0.000000, 0.000000 +211, 1.000000, 0.000000, 0.000000, 0.000000 +212, 1.000000, 0.000000, 0.000000, 0.000000 +213, 1.000000, 0.000000, 0.000000, 0.000000 +214, 1.000000, 0.000000, 0.000000, 0.000000 +215, 1.000000, 0.000000, 0.000000, 0.000000 +216, 1.000000, 0.000000, 0.000000, 0.000000 +217, 1.000000, 0.000000, 0.000000, 0.000000 +218, 1.000000, 0.000000, 0.000000, 0.000000 +219, 1.000000, 0.000000, 0.000000, 0.000000 +220, 1.000000, 0.000000, 0.000000, 0.000000 +221, 1.000000, 0.000000, 0.000000, 0.000000 +222, 1.000000, 0.000000, 0.000000, 0.000000 +223, 1.000000, 0.000000, 0.000000, 0.000000 +224, 1.000000, 0.000000, 0.000000, 0.000000 +225, 1.000000, 0.000000, 0.000000, 0.000000 +226, 1.000000, 0.000000, 0.000000, 0.000000 +227, 1.000000, 0.000000, 0.000000, 0.000000 +228, 1.000000, 0.000000, 0.000000, 0.000000 +229, 1.000000, 0.000000, 0.000000, 0.000000 +230, 1.000000, 0.000000, 0.000000, 0.000000 +231, 1.000000, 0.000000, 0.000000, 0.000000 +232, 1.000000, 0.000000, 0.000000, 0.000000 +233, 1.000000, 0.000000, 0.000000, 0.000000 +234, 1.000000, 0.000000, 0.000000, 0.000000 +235, 1.000000, 0.000000, 0.000000, 0.000000 +236, 1.000000, 0.000000, 0.000000, 0.000000 +237, 1.000000, 0.000000, 0.000000, 0.000000 +238, 1.000000, 0.000000, 0.000000, 0.000000 +239, 1.000000, 0.000000, 0.000000, 0.000000 +240, 1.000000, 0.000000, 0.000000, 0.000000 +241, 1.000000, 0.000000, 0.000000, 0.000000 +242, 1.000000, 0.000000, 0.000000, 0.000000 +243, 1.000000, 0.000000, 0.000000, 0.000000 +244, 1.000000, 0.000000, 0.000000, 0.000000 +245, 1.000000, 0.000000, 0.000000, 0.000000 +246, 1.000000, 0.000000, 0.000000, 0.000000 +247, 1.000000, 0.000000, 0.000000, 0.000000 +248, 1.000000, 0.000000, 0.000000, 0.000000 +249, 1.000000, 0.000000, 0.000000, 0.000000 +250, 1.000000, 0.000000, 0.000000, 0.000000 +251, 1.000000, 0.000000, 0.000000, 0.000000 +252, 1.000000, 0.000000, 0.000000, 0.000000 +253, 1.000000, 0.000000, 0.000000, 0.000000 +254, 1.000000, 0.000000, 0.000000, 0.000000 +255, 1.000000, 0.000000, 0.000000, 0.000000 +256, 1.000000, 0.000000, 0.000000, 0.000000 +257, 1.000000, 0.000000, 0.000000, 0.000000 +258, 1.000000, 0.000000, 0.000000, 0.000000 +259, 1.000000, 0.000000, 0.000000, 0.000000 +260, 1.000000, 0.000000, 0.000000, 0.000000 +261, 1.000000, 0.000000, 0.000000, 0.000000 +262, 1.000000, 0.000000, 0.000000, 0.000000 +263, 1.000000, 0.000000, 0.000000, 0.000000 +264, 1.000000, 0.000000, 0.000000, 0.000000 +265, 1.000000, 0.000000, 0.000000, 0.000000 +266, 1.000000, 0.000000, 0.000000, 0.000000 +267, 1.000000, 0.000000, 0.000000, 0.000000 +268, 1.000000, 0.000000, 0.000000, 0.000000 +269, 1.000000, 0.000000, 0.000000, 0.000000 +270, 1.000000, 0.000000, 0.000000, 0.000000 +271, 1.000000, 0.000000, 0.000000, 0.000000 +272, 1.000000, 0.000000, 0.000000, 0.000000 +273, 1.000000, 0.000000, 0.000000, 0.000000 +274, 1.000000, 0.000000, 0.000000, 0.000000 +275, 1.000000, 0.000000, 0.000000, 0.000000 +276, 1.000000, 0.000000, 0.000000, 0.000000 +277, 1.000000, 0.000000, 0.000000, 0.000000 +278, 1.000000, 0.000000, 0.000000, 0.000000 +279, 1.000000, 0.000000, 0.000000, 0.000000 +280, 1.000000, 0.000000, 0.000000, 0.000000 +281, 1.000000, 0.000000, 0.000000, 0.000000 +282, 1.000000, 0.000000, 0.000000, 0.000000 +283, 1.000000, 0.000000, 0.000000, 0.000000 +284, 1.000000, 0.000000, 0.000000, 0.000000 +285, 1.000000, 0.000000, 0.000000, 0.000000 +286, 1.000000, 0.000000, 0.000000, 0.000000 +287, 1.000000, 0.000000, 0.000000, 0.000000 +288, 1.000000, 0.000000, 0.000000, 0.000000 +289, 1.000000, 0.000000, 0.000000, 0.000000 +290, 1.000000, 0.000000, 0.000000, 0.000000 +291, 1.000000, 0.000000, 0.000000, 0.000000 +292, 1.000000, 0.000000, 0.000000, 0.000000 +293, 1.000000, 0.000000, 0.000000, 0.000000 +294, 1.000000, 0.000000, 0.000000, 0.000000 +295, 1.000000, 0.000000, 0.000000, 0.000000 +296, 1.000000, 0.000000, 0.000000, 0.000000 +297, 1.000000, 0.000000, 0.000000, 0.000000 +298, 1.000000, 0.000000, 0.000000, 0.000000 +299, 1.000000, 0.000000, 0.000000, 0.000000 +300, 1.000000, 0.000000, 0.000000, 0.000000 +301, 1.000000, 0.000000, 0.000000, 0.000000 +302, 1.000000, 0.000000, 0.000000, 0.000000 +303, 1.000000, 0.000000, 0.000000, 0.000000 +304, 1.000000, 0.000000, 0.000000, 0.000000 +305, 1.000000, 0.000000, 0.000000, 0.000000 +306, 1.000000, 0.000000, 0.000000, 0.000000 +307, 1.000000, 0.000000, 0.000000, 0.000000 +308, 1.000000, 0.000000, 0.000000, 0.000000 +309, 1.000000, 0.000000, 0.000000, 0.000000 +310, 1.000000, 0.000000, 0.000000, 0.000000 +311, 1.000000, 0.000000, 0.000000, 0.000000 +312, 1.000000, 0.000000, 0.000000, 0.000000 +313, 1.000000, 0.000000, 0.000000, 0.000000 +314, 1.000000, 0.000000, 0.000000, 0.000000 +315, 1.000000, 0.000000, 0.000000, 0.000000 +316, 1.000000, 0.000000, 0.000000, 0.000000 +317, 1.000000, 0.000000, 0.000000, 0.000000 +318, 1.000000, 0.000000, 0.000000, 0.000000 +319, 1.000000, 0.000000, 0.000000, 0.000000 +320, 1.000000, 0.000000, 0.000000, 0.000000 +321, 1.000000, 0.000000, 0.000000, 0.000000 +322, 1.000000, 0.000000, 0.000000, 0.000000 +323, 1.000000, 0.000000, 0.000000, 0.000000 +324, 1.000000, 0.000000, 0.000000, 0.000000 +325, 1.000000, 0.000000, 0.000000, 0.000000 +326, 1.000000, 0.000000, 0.000000, 0.000000 +327, 1.000000, 0.000000, 0.000000, 0.000000 +328, 1.000000, 0.000000, 0.000000, 0.000000 +329, 1.000000, 0.000000, 0.000000, 0.000000 +330, 1.000000, 0.000000, 0.000000, 0.000000 +331, 1.000000, 0.000000, 0.000000, 0.000000 +332, 1.000000, 0.000000, 0.000000, 0.000000 +333, 1.000000, 0.000000, 0.000000, 0.000000 +334, 1.000000, 0.000000, 0.000000, 0.000000 +335, 1.000000, 0.000000, 0.000000, 0.000000 +336, 1.000000, 0.000000, 0.000000, 0.000000 +337, 1.000000, 0.000000, 0.000000, 0.000000 +338, 1.000000, 0.000000, 0.000000, 0.000000 +339, 1.000000, 0.000000, 0.000000, 0.000000 +340, 1.000000, 0.000000, 0.000000, 0.000000 +341, 1.000000, 0.000000, 0.000000, 0.000000 +342, 1.000000, 0.000000, 0.000000, 0.000000 +343, 1.000000, 0.000000, 0.000000, 0.000000 +344, 1.000000, 0.000000, 0.000000, 0.000000 +345, 1.000000, 0.000000, 0.000000, 0.000000 +346, 1.000000, 0.000000, 0.000000, 0.000000 +347, 1.000000, 0.000000, 0.000000, 0.000000 +348, 1.000000, 0.000000, 0.000000, 0.000000 +349, 1.000000, 0.000000, 0.000000, 0.000000 +350, 1.000000, 0.000000, 0.000000, 0.000000 +351, 1.000000, 0.000000, 0.000000, 0.000000 +352, 1.000000, 0.000000, 0.000000, 0.000000 +353, 1.000000, 0.000000, 0.000000, 0.000000 +354, 1.000000, 0.000000, 0.000000, 0.000000 +355, 1.000000, 0.000000, 0.000000, 0.000000 +356, 1.000000, 0.000000, 0.000000, 0.000000 +357, 1.000000, 0.000000, 0.000000, 0.000000 +358, 1.000000, 0.000000, 0.000000, 0.000000 +359, 1.000000, 0.000000, 0.000000, 0.000000 +360, 1.000000, 0.000000, 0.000000, 0.000000 +361, 1.000000, 0.000000, 0.000000, 0.000000 +362, 1.000000, 0.000000, 0.000000, 0.000000 +363, 1.000000, 0.000000, 0.000000, 0.000000 +364, 1.000000, 0.000000, 0.000000, 0.000000 +365, 1.000000, 0.000000, 0.000000, 0.000000 +366, 1.000000, 0.000000, 0.000000, 0.000000 +367, 1.000000, 0.000000, 0.000000, 0.000000 +368, 1.000000, 0.000000, 0.000000, 0.000000 +369, 1.000000, 0.000000, 0.000000, 0.000000 +370, 1.000000, 0.000000, 0.000000, 0.000000 +371, 1.000000, 0.000000, 0.000000, 0.000000 +372, 1.000000, 0.000000, 0.000000, 0.000000 +373, 1.000000, 0.000000, 0.000000, 0.000000 +374, 1.000000, 0.000000, 0.000000, 0.000000 +375, 1.000000, 0.000000, 0.000000, 0.000000 +376, 1.000000, 0.000000, 0.000000, 0.000000 +377, 1.000000, 0.000000, 0.000000, 0.000000 +378, 1.000000, 0.000000, 0.000000, 0.000000 +379, 1.000000, 0.000000, 0.000000, 0.000000 +380, 1.000000, 0.000000, 0.000000, 0.000000 +381, 1.000000, 0.000000, 0.000000, 0.000000 +382, 1.000000, 0.000000, 0.000000, 0.000000 +383, 1.000000, 0.000000, 0.000000, 0.000000 +384, 1.000000, 0.000000, 0.000000, 0.000000 +385, 1.000000, 0.000000, 0.000000, 0.000000 +386, 1.000000, 0.000000, 0.000000, 0.000000 +387, 1.000000, 0.000000, 0.000000, 0.000000 +388, 1.000000, 0.000000, 0.000000, 0.000000 +389, 1.000000, 0.000000, 0.000000, 0.000000 +390, 1.000000, 0.000000, 0.000000, 0.000000 +391, 1.000000, 0.000000, 0.000000, 0.000000 +392, 1.000000, 0.000000, 0.000000, 0.000000 +393, 1.000000, 0.000000, 0.000000, 0.000000 +394, 1.000000, 0.000000, 0.000000, 0.000000 +395, 1.000000, 0.000000, 0.000000, 0.000000 +396, 1.000000, 0.000000, 0.000000, 0.000000 +397, 1.000000, 0.000000, 0.000000, 0.000000 +398, 1.000000, 0.000000, 0.000000, 0.000000 +399, 1.000000, 0.000000, 0.000000, 0.000000 +400, 1.000000, 0.000000, 0.000000, 0.000000 +401, 1.000000, 0.000000, 0.000000, 0.000000 +402, 1.000000, 0.000000, 0.000000, 0.000000 +403, 1.000000, 0.000000, 0.000000, 0.000000 +404, 1.000000, 0.000000, 0.000000, 0.000000 +405, 1.000000, 0.000000, 0.000000, 0.000000 +406, 1.000000, 0.000000, 0.000000, 0.000000 +407, 1.000000, 0.000000, 0.000000, 0.000000 +408, 1.000000, 0.000000, 0.000000, 0.000000 +409, 1.000000, 0.000000, 0.000000, 0.000000 +410, 1.000000, 0.000000, 0.000000, 0.000000 +411, 1.000000, 0.000000, 0.000000, 0.000000 +412, 1.000000, 0.000000, 0.000000, 0.000000 +413, 1.000000, 0.000000, 0.000000, 0.000000 +414, 1.000000, 0.000000, 0.000000, 0.000000 +415, 1.000000, 0.000000, 0.000000, 0.000000 +416, 1.000000, 0.000000, 0.000000, 0.000000 +417, 1.000000, 0.000000, 0.000000, 0.000000 +418, 1.000000, 0.000000, 0.000000, 0.000000 +419, 1.000000, 0.000000, 0.000000, 0.000000 +420, 1.000000, 0.000000, 0.000000, 0.000000 +421, 1.000000, 0.000000, 0.000000, 0.000000 +422, 1.000000, 0.000000, 0.000000, 0.000000 +423, 1.000000, 0.000000, 0.000000, 0.000000 +424, 1.000000, 0.000000, 0.000000, 0.000000 +425, 1.000000, 0.000000, 0.000000, 0.000000 +426, 1.000000, 0.000000, 0.000000, 0.000000 +427, 1.000000, 0.000000, 0.000000, 0.000000 +428, 1.000000, 0.000000, 0.000000, 0.000000 +429, 1.000000, 0.000000, 0.000000, 0.000000 +430, 1.000000, 0.000000, 0.000000, 0.000000 +431, 1.000000, 0.000000, 0.000000, 0.000000 +432, 1.000000, 0.000000, 0.000000, 0.000000 +433, 1.000000, 0.000000, 0.000000, 0.000000 +434, 1.000000, 0.000000, 0.000000, 0.000000 +435, 1.000000, 0.000000, 0.000000, 0.000000 +436, 1.000000, 0.000000, 0.000000, 0.000000 +437, 1.000000, 0.000000, 0.000000, 0.000000 +438, 1.000000, 0.000000, 0.000000, 0.000000 +439, 1.000000, 0.000000, 0.000000, 0.000000 +440, 1.000000, 0.000000, 0.000000, 0.000000 +441, 1.000000, 0.000000, 0.000000, 0.000000 +442, 1.000000, 0.000000, 0.000000, 0.000000 +443, 1.000000, 0.000000, 0.000000, 0.000000 +444, 1.000000, 0.000000, 0.000000, 0.000000 +445, 1.000000, 0.000000, 0.000000, 0.000000 +446, 1.000000, 0.000000, 0.000000, 0.000000 +447, 1.000000, 0.000000, 0.000000, 0.000000 +448, 1.000000, 0.000000, 0.000000, 0.000000 +449, 1.000000, 0.000000, 0.000000, 0.000000 +450, 1.000000, 0.000000, 0.000000, 0.000000 +451, 1.000000, 0.000000, 0.000000, 0.000000 +452, 1.000000, 0.000000, 0.000000, 0.000000 +453, 1.000000, 0.000000, 0.000000, 0.000000 +454, 1.000000, 0.000000, 0.000000, 0.000000 +455, 1.000000, 0.000000, 0.000000, 0.000000 +456, 1.000000, 0.000000, 0.000000, 0.000000 +457, 1.000000, 0.000000, 0.000000, 0.000000 +458, 1.000000, 0.000000, 0.000000, 0.000000 +459, 1.000000, 0.000000, 0.000000, 0.000000 +460, 1.000000, 0.000000, 0.000000, 0.000000 +461, 1.000000, 0.000000, 0.000000, 0.000000 +462, 1.000000, 0.000000, 0.000000, 0.000000 +463, 1.000000, 0.000000, 0.000000, 0.000000 +464, 1.000000, 0.000000, 0.000000, 0.000000 +465, 1.000000, 0.000000, 0.000000, 0.000000 +466, 1.000000, 0.000000, 0.000000, 0.000000 +467, 1.000000, 0.000000, 0.000000, 0.000000 +468, 1.000000, 0.000000, 0.000000, 0.000000 +469, 1.000000, 0.000000, 0.000000, 0.000000 +470, 1.000000, 0.000000, 0.000000, 0.000000 +471, 1.000000, 0.000000, 0.000000, 0.000000 +472, 1.000000, 0.000000, 0.000000, 0.000000 +473, 1.000000, 0.000000, 0.000000, 0.000000 +474, 1.000000, 0.000000, 0.000000, 0.000000 +475, 1.000000, 0.000000, 0.000000, 0.000000 +476, 1.000000, 0.000000, 0.000000, 0.000000 +477, 1.000000, 0.000000, 0.000000, 0.000000 +478, 1.000000, 0.000000, 0.000000, 0.000000 +479, 1.000000, 0.000000, 0.000000, 0.000000 +480, 1.000000, 0.000000, 0.000000, 0.000000 +481, 1.000000, 0.000000, 0.000000, 0.000000 +482, 1.000000, 0.000000, 0.000000, 0.000000 +483, 1.000000, 0.000000, 0.000000, 0.000000 +484, 1.000000, 0.000000, 0.000000, 0.000000 +485, 1.000000, 0.000000, 0.000000, 0.000000 +486, 1.000000, 0.000000, 0.000000, 0.000000 +487, 1.000000, 0.000000, 0.000000, 0.000000 +488, 1.000000, 0.000000, 0.000000, 0.000000 +489, 1.000000, 0.000000, 0.000000, 0.000000 +490, 1.000000, 0.000000, 0.000000, 0.000000 +491, 1.000000, 0.000000, 0.000000, 0.000000 +492, 1.000000, 0.000000, 0.000000, 0.000000 +493, 1.000000, 0.000000, 0.000000, 0.000000 +494, 1.000000, 0.000000, 0.000000, 0.000000 +495, 1.000000, 0.000000, 0.000000, 0.000000 +496, 1.000000, 0.000000, 0.000000, 0.000000 +497, 1.000000, 0.000000, 0.000000, 0.000000 +498, 1.000000, 0.000000, 0.000000, 0.000000 +499, 1.000000, 0.000000, 0.000000, 0.000000 +500, 1.000000, 0.000000, 0.000000, 0.000000 +501, 1.000000, 0.000000, 0.000000, 0.000000 +502, 1.000000, 0.000000, 0.000000, 0.000000 +503, 1.000000, 0.000000, 0.000000, 0.000000 +504, 1.000000, 0.000000, 0.000000, 0.000000 +505, 1.000000, 0.000000, 0.000000, 0.000000 +506, 1.000000, 0.000000, 0.000000, 0.000000 +507, 1.000000, 0.000000, 0.000000, 0.000000 +508, 1.000000, 0.000000, 0.000000, 0.000000 +509, 1.000000, 0.000000, 0.000000, 0.000000 +510, 1.000000, 0.000000, 0.000000, 0.000000 +511, 1.000000, 0.000000, 0.000000, 0.000000 +512, 1.000000, 0.000000, 0.000000, 0.000000 +513, 1.000000, 0.000000, 0.000000, 0.000000 +514, 1.000000, 0.000000, 0.000000, 0.000000 +515, 1.000000, 0.000000, 0.000000, 0.000000 +516, 1.000000, 0.000000, 0.000000, 0.000000 +517, 1.000000, 0.000000, 0.000000, 0.000000 +518, 1.000000, 0.000000, 0.000000, 0.000000 +519, 1.000000, 0.000000, 0.000000, 0.000000 +520, 1.000000, 0.000000, 0.000000, 0.000000 +521, 1.000000, 0.000000, 0.000000, 0.000000 +522, 1.000000, 0.000000, 0.000000, 0.000000 +523, 1.000000, 0.000000, 0.000000, 0.000000 +524, 1.000000, 0.000000, 0.000000, 0.000000 +525, 1.000000, 0.000000, 0.000000, 0.000000 +526, 1.000000, 0.000000, 0.000000, 0.000000 +527, 1.000000, 0.000000, 0.000000, 0.000000 +528, 1.000000, 0.000000, 0.000000, 0.000000 +529, 1.000000, 0.000000, 0.000000, 0.000000 +530, 1.000000, 0.000000, 0.000000, 0.000000 +531, 1.000000, 0.000000, 0.000000, 0.000000 +532, 1.000000, 0.000000, 0.000000, 0.000000 +533, 1.000000, 0.000000, 0.000000, 0.000000 +534, 1.000000, 0.000000, 0.000000, 0.000000 +535, 1.000000, 0.000000, 0.000000, 0.000000 +536, 1.000000, 0.000000, 0.000000, 0.000000 +537, 1.000000, 0.000000, 0.000000, 0.000000 +538, 1.000000, 0.000000, 0.000000, 0.000000 +539, 1.000000, 0.000000, 0.000000, 0.000000 +540, 1.000000, 0.000000, 0.000000, 0.000000 +541, 1.000000, 0.000000, 0.000000, 0.000000 +542, 1.000000, 0.000000, 0.000000, 0.000000 +543, 1.000000, 0.000000, 0.000000, 0.000000 +544, 1.000000, 0.000000, 0.000000, 0.000000 +545, 1.000000, 0.000000, 0.000000, 0.000000 +546, 1.000000, 0.000000, 0.000000, 0.000000 +547, 1.000000, 0.000000, 0.000000, 0.000000 +548, 1.000000, 0.000000, 0.000000, 0.000000 +549, 1.000000, 0.000000, 0.000000, 0.000000 +550, 1.000000, 0.000000, 0.000000, 0.000000 +551, 1.000000, 0.000000, 0.000000, 0.000000 +552, 1.000000, 0.000000, 0.000000, 0.000000 +553, 1.000000, 0.000000, 0.000000, 0.000000 +554, 1.000000, 0.000000, 0.000000, 0.000000 +555, 1.000000, 0.000000, 0.000000, 0.000000 +556, 1.000000, 0.000000, 0.000000, 0.000000 +557, 1.000000, 0.000000, 0.000000, 0.000000 +558, 1.000000, 0.000000, 0.000000, 0.000000 +559, 1.000000, 0.000000, 0.000000, 0.000000 +560, 1.000000, 0.000000, 0.000000, 0.000000 +561, 1.000000, 0.000000, 0.000000, 0.000000 +562, 1.000000, 0.000000, 0.000000, 0.000000 +563, 1.000000, 0.000000, 0.000000, 0.000000 +564, 1.000000, 0.000000, 0.000000, 0.000000 +565, 1.000000, 0.000000, 0.000000, 0.000000 +566, 1.000000, 0.000000, 0.000000, 0.000000 +567, 1.000000, 0.000000, 0.000000, 0.000000 +568, 1.000000, 0.000000, 0.000000, 0.000000 +569, 1.000000, 0.000000, 0.000000, 0.000000 +570, 1.000000, 0.000000, 0.000000, 0.000000 +571, 1.000000, 0.000000, 0.000000, 0.000000 +572, 1.000000, 0.000000, 0.000000, 0.000000 +573, 1.000000, 0.000000, 0.000000, 0.000000 +574, 1.000000, 0.000000, 0.000000, 0.000000 +575, 1.000000, 0.000000, 0.000000, 0.000000 +576, 1.000000, 0.000000, 0.000000, 0.000000 +577, 1.000000, 0.000000, 0.000000, 0.000000 +578, 1.000000, 0.000000, 0.000000, 0.000000 +579, 1.000000, 0.000000, 0.000000, 0.000000 +580, 1.000000, 0.000000, 0.000000, 0.000000 +581, 1.000000, 0.000000, 0.000000, 0.000000 +582, 1.000000, 0.000000, 0.000000, 0.000000 +583, 1.000000, 0.000000, 0.000000, 0.000000 +584, 1.000000, 0.000000, 0.000000, 0.000000 +585, 1.000000, 0.000000, 0.000000, 0.000000 +586, 1.000000, 0.000000, 0.000000, 0.000000 +587, 1.000000, 0.000000, 0.000000, 0.000000 +588, 1.000000, 0.000000, 0.000000, 0.000000 +589, 1.000000, 0.000000, 0.000000, 0.000000 +590, 1.000000, 0.000000, 0.000000, 0.000000 +591, 1.000000, 0.000000, 0.000000, 0.000000 +592, 1.000000, 0.000000, 0.000000, 0.000000 +593, 1.000000, 0.000000, 0.000000, 0.000000 +594, 1.000000, 0.000000, 0.000000, 0.000000 +595, 1.000000, 0.000000, 0.000000, 0.000000 +596, 1.000000, 0.000000, 0.000000, 0.000000 +597, 1.000000, 0.000000, 0.000000, 0.000000 +598, 1.000000, 0.000000, 0.000000, 0.000000 +599, 1.000000, 0.000000, 0.000000, 0.000000 +600, 1.000000, 0.000000, 0.000000, 0.000000 +601, 1.000000, 0.000000, 0.000000, 0.000000 +602, 1.000000, 0.000000, 0.000000, 0.000000 +603, 1.000000, 0.000000, 0.000000, 0.000000 +604, 1.000000, 0.000000, 0.000000, 0.000000 +605, 1.000000, 0.000000, 0.000000, 0.000000 +606, 1.000000, 0.000000, 0.000000, 0.000000 +607, 1.000000, 0.000000, 0.000000, 0.000000 +608, 1.000000, 0.000000, 0.000000, 0.000000 +609, 1.000000, 0.000000, 0.000000, 0.000000 +610, 1.000000, 0.000000, 0.000000, 0.000000 +611, 1.000000, 0.000000, 0.000000, 0.000000 +612, 1.000000, 0.000000, 0.000000, 0.000000 +613, 1.000000, 0.000000, 0.000000, 0.000000 +614, 1.000000, 0.000000, 0.000000, 0.000000 +615, 1.000000, 0.000000, 0.000000, 0.000000 +616, 1.000000, 0.000000, 0.000000, 0.000000 +617, 1.000000, 0.000000, 0.000000, 0.000000 +618, 1.000000, 0.000000, 0.000000, 0.000000 +619, 1.000000, 0.000000, 0.000000, 0.000000 +620, 1.000000, 0.000000, 0.000000, 0.000000 +621, 1.000000, 0.000000, 0.000000, 0.000000 +622, 1.000000, 0.000000, 0.000000, 0.000000 +623, 1.000000, 0.000000, 0.000000, 0.000000 +624, 1.000000, 0.000000, 0.000000, 0.000000 +625, 1.000000, 0.000000, 0.000000, 0.000000 +626, 1.000000, 0.000000, 0.000000, 0.000000 +627, 1.000000, 0.000000, 0.000000, 0.000000 +628, 1.000000, 0.000000, 0.000000, 0.000000 +629, 1.000000, 0.000000, 0.000000, 0.000000 +630, 1.000000, 0.000000, 0.000000, 0.000000 +631, 1.000000, 0.000000, 0.000000, 0.000000 +632, 1.000000, 0.000000, 0.000000, 0.000000 +633, 1.000000, 0.000000, 0.000000, 0.000000 +634, 1.000000, 0.000000, 0.000000, 0.000000 +635, 1.000000, 0.000000, 0.000000, 0.000000 +636, 1.000000, 0.000000, 0.000000, 0.000000 +637, 1.000000, 0.000000, 0.000000, 0.000000 +638, 1.000000, 0.000000, 0.000000, 0.000000 +639, 1.000000, 0.000000, 0.000000, 0.000000 +640, 1.000000, 0.000000, 0.000000, 0.000000 +641, 1.000000, 0.000000, 0.000000, 0.000000 +642, 1.000000, 0.000000, 0.000000, 0.000000 +643, 1.000000, 0.000000, 0.000000, 0.000000 +644, 1.000000, 0.000000, 0.000000, 0.000000 +645, 1.000000, 0.000000, 0.000000, 0.000000 +646, 1.000000, 0.000000, 0.000000, 0.000000 +647, 1.000000, 0.000000, 0.000000, 0.000000 +648, 1.000000, 0.000000, 0.000000, 0.000000 +649, 1.000000, 0.000000, 0.000000, 0.000000 +650, 1.000000, 0.000000, 0.000000, 0.000000 +651, 1.000000, 0.000000, 0.000000, 0.000000 +652, 1.000000, 0.000000, 0.000000, 0.000000 +653, 1.000000, 0.000000, 0.000000, 0.000000 +654, 1.000000, 0.000000, 0.000000, 0.000000 +655, 1.000000, 0.000000, 0.000000, 0.000000 +656, 1.000000, 0.000000, 0.000000, 0.000000 +657, 1.000000, 0.000000, 0.000000, 0.000000 +658, 1.000000, 0.000000, 0.000000, 0.000000 +659, 1.000000, 0.000000, 0.000000, 0.000000 +660, 1.000000, 0.000000, 0.000000, 0.000000 +661, 1.000000, 0.000000, 0.000000, 0.000000 +662, 1.000000, 0.000000, 0.000000, 0.000000 +663, 1.000000, 0.000000, 0.000000, 0.000000 +664, 1.000000, 0.000000, 0.000000, 0.000000 +665, 1.000000, 0.000000, 0.000000, 0.000000 +666, 1.000000, 0.000000, 0.000000, 0.000000 +667, 1.000000, 0.000000, 0.000000, 0.000000 +668, 1.000000, 0.000000, 0.000000, 0.000000 +669, 1.000000, 0.000000, 0.000000, 0.000000 +670, 1.000000, 0.000000, 0.000000, 0.000000 +671, 1.000000, 0.000000, 0.000000, 0.000000 +672, 1.000000, 0.000000, 0.000000, 0.000000 +673, 1.000000, 0.000000, 0.000000, 0.000000 +674, 1.000000, 0.000000, 0.000000, 0.000000 +675, 1.000000, 0.000000, 0.000000, 0.000000 +676, 1.000000, 0.000000, 0.000000, 0.000000 +677, 1.000000, 0.000000, 0.000000, 0.000000 +678, 1.000000, 0.000000, 0.000000, 0.000000 +679, 1.000000, 0.000000, 0.000000, 0.000000 +680, 1.000000, 0.000000, 0.000000, 0.000000 +681, 1.000000, 0.000000, 0.000000, 0.000000 +682, 1.000000, 0.000000, 0.000000, 0.000000 +683, 1.000000, 0.000000, 0.000000, 0.000000 +684, 1.000000, 0.000000, 0.000000, 0.000000 +685, 1.000000, 0.000000, 0.000000, 0.000000 +686, 1.000000, 0.000000, 0.000000, 0.000000 +687, 1.000000, 0.000000, 0.000000, 0.000000 +688, 1.000000, 0.000000, 0.000000, 0.000000 +689, 1.000000, 0.000000, 0.000000, 0.000000 +690, 1.000000, 0.000000, 0.000000, 0.000000 +691, 1.000000, 0.000000, 0.000000, 0.000000 +692, 1.000000, 0.000000, 0.000000, 0.000000 +693, 1.000000, 0.000000, 0.000000, 0.000000 +694, 1.000000, 0.000000, 0.000000, 0.000000 +695, 1.000000, 0.000000, 0.000000, 0.000000 +696, 1.000000, 0.000000, 0.000000, 0.000000 +697, 1.000000, 0.000000, 0.000000, 0.000000 +698, 1.000000, 0.000000, 0.000000, 0.000000 +699, 1.000000, 0.000000, 0.000000, 0.000000 +700, 1.000000, 0.000000, 0.000000, 0.000000 +701, 1.000000, 0.000000, 0.000000, 0.000000 +702, 1.000000, 0.000000, 0.000000, 0.000000 +703, 1.000000, 0.000000, 0.000000, 0.000000 +704, 1.000000, 0.000000, 0.000000, 0.000000 +705, 1.000000, 0.000000, 0.000000, 0.000000 +706, 1.000000, 0.000000, 0.000000, 0.000000 +707, 1.000000, 0.000000, 0.000000, 0.000000 +708, 1.000000, 0.000000, 0.000000, 0.000000 +709, 1.000000, 0.000000, 0.000000, 0.000000 +710, 1.000000, 0.000000, 0.000000, 0.000000 +711, 1.000000, 0.000000, 0.000000, 0.000000 +712, 1.000000, 0.000000, 0.000000, 0.000000 +713, 1.000000, 0.000000, 0.000000, 0.000000 +714, 1.000000, 0.000000, 0.000000, 0.000000 +715, 1.000000, 0.000000, 0.000000, 0.000000 +716, 1.000000, 0.000000, 0.000000, 0.000000 +717, 1.000000, 0.000000, 0.000000, 0.000000 +718, 1.000000, 0.000000, 0.000000, 0.000000 +719, 1.000000, 0.000000, 0.000000, 0.000000 +720, 1.000000, 0.000000, 0.000000, 0.000000 +721, 1.000000, 0.000000, 0.000000, 0.000000 +722, 1.000000, 0.000000, 0.000000, 0.000000 +723, 1.000000, 0.000000, 0.000000, 0.000000 +724, 1.000000, 0.000000, 0.000000, 0.000000 +725, 1.000000, 0.000000, 0.000000, 0.000000 +726, 1.000000, 0.000000, 0.000000, 0.000000 +727, 1.000000, 0.000000, 0.000000, 0.000000 +728, 1.000000, 0.000000, 0.000000, 0.000000 +729, 1.000000, 0.000000, 0.000000, 0.000000 +730, 1.000000, 0.000000, 0.000000, 0.000000 +731, 1.000000, 0.000000, 0.000000, 0.000000 +732, 1.000000, 0.000000, 0.000000, 0.000000 +733, 1.000000, 0.000000, 0.000000, 0.000000 +734, 1.000000, 0.000000, 0.000000, 0.000000 +735, 1.000000, 0.000000, 0.000000, 0.000000 +736, 1.000000, 0.000000, 0.000000, 0.000000 +737, 1.000000, 0.000000, 0.000000, 0.000000 +738, 1.000000, 0.000000, 0.000000, 0.000000 +739, 1.000000, 0.000000, 0.000000, 0.000000 +740, 1.000000, 0.000000, 0.000000, 0.000000 +741, 1.000000, 0.000000, 0.000000, 0.000000 +742, 1.000000, 0.000000, 0.000000, 0.000000 +743, 1.000000, 0.000000, 0.000000, 0.000000 +744, 1.000000, 0.000000, 0.000000, 0.000000 +745, 1.000000, 0.000000, 0.000000, 0.000000 +746, 1.000000, 0.000000, 0.000000, 0.000000 +747, 1.000000, 0.000000, 0.000000, 0.000000 +748, 1.000000, 0.000000, 0.000000, 0.000000 +749, 1.000000, 0.000000, 0.000000, 0.000000 +750, 1.000000, 0.000000, 0.000000, 0.000000 +751, 1.000000, 0.000000, 0.000000, 0.000000 +752, 1.000000, 0.000000, 0.000000, 0.000000 +753, 1.000000, 0.000000, 0.000000, 0.000000 +754, 1.000000, 0.000000, 0.000000, 0.000000 +755, 1.000000, 0.000000, 0.000000, 0.000000 +756, 1.000000, 0.000000, 0.000000, 0.000000 +757, 1.000000, 0.000000, 0.000000, 0.000000 +758, 1.000000, 0.000000, 0.000000, 0.000000 +759, 1.000000, 0.000000, 0.000000, 0.000000 +760, 1.000000, 0.000000, 0.000000, 0.000000 +761, 1.000000, 0.000000, 0.000000, 0.000000 +762, 1.000000, 0.000000, 0.000000, 0.000000 +763, 1.000000, 0.000000, 0.000000, 0.000000 +764, 1.000000, 0.000000, 0.000000, 0.000000 +765, 1.000000, 0.000000, 0.000000, 0.000000 +766, 1.000000, 0.000000, 0.000000, 0.000000 +767, 1.000000, 0.000000, 0.000000, 0.000000 +768, 1.000000, 0.000000, 0.000000, 0.000000 +769, 1.000000, 0.000000, 0.000000, 0.000000 +770, 1.000000, 0.000000, 0.000000, 0.000000 +771, 1.000000, 0.000000, 0.000000, 0.000000 +772, 1.000000, 0.000000, 0.000000, 0.000000 +773, 1.000000, 0.000000, 0.000000, 0.000000 +774, 1.000000, 0.000000, 0.000000, 0.000000 +775, 1.000000, 0.000000, 0.000000, 0.000000 +776, 1.000000, 0.000000, 0.000000, 0.000000 +777, 1.000000, 0.000000, 0.000000, 0.000000 +778, 1.000000, 0.000000, 0.000000, 0.000000 +779, 1.000000, 0.000000, 0.000000, 0.000000 +780, 1.000000, 0.000000, 0.000000, 0.000000 +781, 1.000000, 0.000000, 0.000000, 0.000000 +782, 1.000000, 0.000000, 0.000000, 0.000000 +783, 1.000000, 0.000000, 0.000000, 0.000000 +784, 1.000000, 0.000000, 0.000000, 0.000000 +785, 1.000000, 0.000000, 0.000000, 0.000000 +786, 1.000000, 0.000000, 0.000000, 0.000000 +787, 1.000000, 0.000000, 0.000000, 0.000000 +788, 1.000000, 0.000000, 0.000000, 0.000000 +789, 1.000000, 0.000000, 0.000000, 0.000000 +790, 1.000000, 0.000000, 0.000000, 0.000000 +791, 1.000000, 0.000000, 0.000000, 0.000000 +792, 1.000000, 0.000000, 0.000000, 0.000000 +793, 1.000000, 0.000000, 0.000000, 0.000000 +794, 1.000000, 0.000000, 0.000000, 0.000000 +795, 1.000000, 0.000000, 0.000000, 0.000000 +796, 1.000000, 0.000000, 0.000000, 0.000000 +797, 1.000000, 0.000000, 0.000000, 0.000000 +798, 1.000000, 0.000000, 0.000000, 0.000000 +799, 1.000000, 0.000000, 0.000000, 0.000000 +800, 1.000000, 0.000000, 0.000000, 0.000000 +801, 1.000000, 0.000000, 0.000000, 0.000000 +802, 1.000000, 0.000000, 0.000000, 0.000000 +803, 1.000000, 0.000000, 0.000000, 0.000000 +804, 1.000000, 0.000000, 0.000000, 0.000000 +805, 1.000000, 0.000000, 0.000000, 0.000000 +806, 1.000000, 0.000000, 0.000000, 0.000000 +807, 1.000000, 0.000000, 0.000000, 0.000000 +808, 1.000000, 0.000000, 0.000000, 0.000000 +809, 1.000000, 0.000000, 0.000000, 0.000000 +810, 1.000000, 0.000000, 0.000000, 0.000000 +811, 1.000000, 0.000000, 0.000000, 0.000000 +812, 1.000000, 0.000000, 0.000000, 0.000000 +813, 1.000000, 0.000000, 0.000000, 0.000000 +814, 1.000000, 0.000000, 0.000000, 0.000000 +815, 1.000000, 0.000000, 0.000000, 0.000000 +816, 1.000000, 0.000000, 0.000000, 0.000000 +817, 1.000000, 0.000000, 0.000000, 0.000000 +818, 1.000000, 0.000000, 0.000000, 0.000000 +819, 1.000000, 0.000000, 0.000000, 0.000000 +820, 1.000000, 0.000000, 0.000000, 0.000000 +821, 1.000000, 0.000000, 0.000000, 0.000000 +822, 1.000000, 0.000000, 0.000000, 0.000000 +823, 1.000000, 0.000000, 0.000000, 0.000000 +824, 1.000000, 0.000000, 0.000000, 0.000000 +825, 1.000000, 0.000000, 0.000000, 0.000000 +826, 1.000000, 0.000000, 0.000000, 0.000000 +827, 1.000000, 0.000000, 0.000000, 0.000000 +828, 1.000000, 0.000000, 0.000000, 0.000000 +829, 1.000000, 0.000000, 0.000000, 0.000000 +830, 1.000000, 0.000000, 0.000000, 0.000000 +831, 1.000000, 0.000000, 0.000000, 0.000000 +832, 1.000000, 0.000000, 0.000000, 0.000000 +833, 1.000000, 0.000000, 0.000000, 0.000000 +834, 1.000000, 0.000000, 0.000000, 0.000000 +835, 1.000000, 0.000000, 0.000000, 0.000000 +836, 1.000000, 0.000000, 0.000000, 0.000000 +837, 1.000000, 0.000000, 0.000000, 0.000000 +838, 1.000000, 0.000000, 0.000000, 0.000000 +839, 1.000000, 0.000000, 0.000000, 0.000000 +840, 1.000000, 0.000000, 0.000000, 0.000000 +841, 1.000000, 0.000000, 0.000000, 0.000000 +842, 1.000000, 0.000000, 0.000000, 0.000000 +843, 1.000000, 0.000000, 0.000000, 0.000000 +844, 1.000000, 0.000000, 0.000000, 0.000000 +845, 1.000000, 0.000000, 0.000000, 0.000000 +846, 1.000000, 0.000000, 0.000000, 0.000000 +847, 1.000000, 0.000000, 0.000000, 0.000000 +848, 1.000000, 0.000000, 0.000000, 0.000000 +849, 1.000000, 0.000000, 0.000000, 0.000000 +850, 1.000000, 0.000000, 0.000000, 0.000000 +851, 1.000000, 0.000000, 0.000000, 0.000000 +852, 1.000000, 0.000000, 0.000000, 0.000000 +853, 1.000000, 0.000000, 0.000000, 0.000000 +854, 1.000000, 0.000000, 0.000000, 0.000000 +855, 1.000000, 0.000000, 0.000000, 0.000000 +856, 1.000000, 0.000000, 0.000000, 0.000000 +857, 1.000000, 0.000000, 0.000000, 0.000000 +858, 1.000000, 0.000000, 0.000000, 0.000000 +859, 1.000000, 0.000000, 0.000000, 0.000000 +860, 1.000000, 0.000000, 0.000000, 0.000000 +861, 1.000000, 0.000000, 0.000000, 0.000000 +862, 1.000000, 0.000000, 0.000000, 0.000000 +863, 1.000000, 0.000000, 0.000000, 0.000000 +864, 1.000000, 0.000000, 0.000000, 0.000000 +865, 1.000000, 0.000000, 0.000000, 0.000000 +866, 1.000000, 0.000000, 0.000000, 0.000000 +867, 1.000000, 0.000000, 0.000000, 0.000000 +868, 1.000000, 0.000000, 0.000000, 0.000000 +869, 1.000000, 0.000000, 0.000000, 0.000000 +870, 1.000000, 0.000000, 0.000000, 0.000000 +871, 1.000000, 0.000000, 0.000000, 0.000000 +872, 1.000000, 0.000000, 0.000000, 0.000000 +873, 1.000000, 0.000000, 0.000000, 0.000000 +874, 1.000000, 0.000000, 0.000000, 0.000000 +875, 1.000000, 0.000000, 0.000000, 0.000000 +876, 1.000000, 0.000000, 0.000000, 0.000000 +877, 1.000000, 0.000000, 0.000000, 0.000000 +878, 1.000000, 0.000000, 0.000000, 0.000000 +879, 1.000000, 0.000000, 0.000000, 0.000000 +880, 1.000000, 0.000000, 0.000000, 0.000000 +881, 1.000000, 0.000000, 0.000000, 0.000000 +882, 1.000000, 0.000000, 0.000000, 0.000000 +883, 1.000000, 0.000000, 0.000000, 0.000000 +884, 1.000000, 0.000000, 0.000000, 0.000000 +885, 1.000000, 0.000000, 0.000000, 0.000000 +886, 1.000000, 0.000000, 0.000000, 0.000000 +887, 1.000000, 0.000000, 0.000000, 0.000000 +888, 1.000000, 0.000000, 0.000000, 0.000000 +889, 1.000000, 0.000000, 0.000000, 0.000000 +890, 1.000000, 0.000000, 0.000000, 0.000000 +891, 1.000000, 0.000000, 0.000000, 0.000000 +892, 1.000000, 0.000000, 0.000000, 0.000000 +893, 1.000000, 0.000000, 0.000000, 0.000000 +894, 1.000000, 0.000000, 0.000000, 0.000000 +895, 1.000000, 0.000000, 0.000000, 0.000000 +896, 1.000000, 0.000000, 0.000000, 0.000000 +897, 1.000000, 0.000000, 0.000000, 0.000000 +898, 1.000000, 0.000000, 0.000000, 0.000000 +899, 1.000000, 0.000000, 0.000000, 0.000000 +900, 1.000000, 0.000000, 0.000000, 0.000000 +901, 1.000000, 0.000000, 0.000000, 0.000000 +902, 1.000000, 0.000000, 0.000000, 0.000000 +903, 1.000000, 0.000000, 0.000000, 0.000000 +904, 1.000000, 0.000000, 0.000000, 0.000000 +905, 1.000000, 0.000000, 0.000000, 0.000000 +906, 1.000000, 0.000000, 0.000000, 0.000000 +907, 1.000000, 0.000000, 0.000000, 0.000000 +908, 1.000000, 0.000000, 0.000000, 0.000000 +909, 1.000000, 0.000000, 0.000000, 0.000000 +910, 1.000000, 0.000000, 0.000000, 0.000000 +911, 1.000000, 0.000000, 0.000000, 0.000000 +912, 1.000000, 0.000000, 0.000000, 0.000000 +913, 1.000000, 0.000000, 0.000000, 0.000000 +914, 1.000000, 0.000000, 0.000000, 0.000000 +915, 1.000000, 0.000000, 0.000000, 0.000000 +916, 1.000000, 0.000000, 0.000000, 0.000000 +917, 1.000000, 0.000000, 0.000000, 0.000000 +918, 1.000000, 0.000000, 0.000000, 0.000000 +919, 1.000000, 0.000000, 0.000000, 0.000000 +920, 1.000000, 0.000000, 0.000000, 0.000000 +921, 1.000000, 0.000000, 0.000000, 0.000000 +922, 1.000000, 0.000000, 0.000000, 0.000000 +923, 1.000000, 0.000000, 0.000000, 0.000000 +924, 1.000000, 0.000000, 0.000000, 0.000000 +925, 1.000000, 0.000000, 0.000000, 0.000000 +926, 1.000000, 0.000000, 0.000000, 0.000000 +927, 1.000000, 0.000000, 0.000000, 0.000000 +928, 1.000000, 0.000000, 0.000000, 0.000000 +929, 1.000000, 0.000000, 0.000000, 0.000000 +930, 1.000000, 0.000000, 0.000000, 0.000000 +931, 1.000000, 0.000000, 0.000000, 0.000000 +932, 1.000000, 0.000000, 0.000000, 0.000000 +933, 1.000000, 0.000000, 0.000000, 0.000000 +934, 1.000000, 0.000000, 0.000000, 0.000000 +935, 1.000000, 0.000000, 0.000000, 0.000000 +936, 1.000000, 0.000000, 0.000000, 0.000000 +937, 1.000000, 0.000000, 0.000000, 0.000000 +938, 1.000000, 0.000000, 0.000000, 0.000000 +939, 1.000000, 0.000000, 0.000000, 0.000000 +940, 1.000000, 0.000000, 0.000000, 0.000000 +941, 1.000000, 0.000000, 0.000000, 0.000000 +942, 1.000000, 0.000000, 0.000000, 0.000000 +943, 1.000000, 0.000000, 0.000000, 0.000000 +944, 1.000000, 0.000000, 0.000000, 0.000000 +945, 1.000000, 0.000000, 0.000000, 0.000000 +946, 1.000000, 0.000000, 0.000000, 0.000000 +947, 1.000000, 0.000000, 0.000000, 0.000000 +948, 1.000000, 0.000000, 0.000000, 0.000000 +949, 1.000000, 0.000000, 0.000000, 0.000000 +950, 1.000000, 0.000000, 0.000000, 0.000000 +951, 1.000000, 0.000000, 0.000000, 0.000000 +952, 1.000000, 0.000000, 0.000000, 0.000000 +953, 1.000000, 0.000000, 0.000000, 0.000000 +954, 1.000000, 0.000000, 0.000000, 0.000000 +955, 1.000000, 0.000000, 0.000000, 0.000000 +956, 1.000000, 0.000000, 0.000000, 0.000000 +957, 1.000000, 0.000000, 0.000000, 0.000000 +958, 1.000000, 0.000000, 0.000000, 0.000000 +959, 1.000000, 0.000000, 0.000000, 0.000000 +960, 1.000000, 0.000000, 0.000000, 0.000000 +961, 1.000000, 0.000000, 0.000000, 0.000000 +962, 1.000000, 0.000000, 0.000000, 0.000000 +963, 1.000000, 0.000000, 0.000000, 0.000000 +964, 1.000000, 0.000000, 0.000000, 0.000000 +965, 1.000000, 0.000000, 0.000000, 0.000000 +966, 1.000000, 0.000000, 0.000000, 0.000000 +967, 1.000000, 0.000000, 0.000000, 0.000000 +968, 1.000000, 0.000000, 0.000000, 0.000000 +969, 1.000000, 0.000000, 0.000000, 0.000000 +970, 1.000000, 0.000000, 0.000000, 0.000000 +971, 1.000000, 0.000000, 0.000000, 0.000000 +972, 1.000000, 0.000000, 0.000000, 0.000000 +973, 1.000000, 0.000000, 0.000000, 0.000000 +974, 1.000000, 0.000000, 0.000000, 0.000000 +975, 1.000000, 0.000000, 0.000000, 0.000000 +976, 1.000000, 0.000000, 0.000000, 0.000000 +977, 1.000000, 0.000000, 0.000000, 0.000000 +978, 1.000000, 0.000000, 0.000000, 0.000000 +979, 1.000000, 0.000000, 0.000000, 0.000000 +980, 1.000000, 0.000000, 0.000000, 0.000000 +981, 1.000000, 0.000000, 0.000000, 0.000000 +982, 1.000000, 0.000000, 0.000000, 0.000000 +983, 1.000000, 0.000000, 0.000000, 0.000000 +984, 1.000000, 0.000000, 0.000000, 0.000000 +985, 1.000000, 0.000000, 0.000000, 0.000000 +986, 1.000000, 0.000000, 0.000000, 0.000000 +987, 1.000000, 0.000000, 0.000000, 0.000000 +988, 1.000000, 0.000000, 0.000000, 0.000000 +989, 1.000000, 0.000000, 0.000000, 0.000000 +990, 1.000000, 0.000000, 0.000000, 0.000000 +991, 1.000000, 0.000000, 0.000000, 0.000000 +992, 1.000000, 0.000000, 0.000000, 0.000000 +993, 1.000000, 0.000000, 0.000000, 0.000000 +994, 1.000000, 0.000000, 0.000000, 0.000000 +995, 1.000000, 0.000000, 0.000000, 0.000000 +996, 1.000000, 0.000000, 0.000000, 0.000000 +997, 1.000000, 0.000000, 0.000000, 0.000000 +998, 1.000000, 0.000000, 0.000000, 0.000000 +999, 1.000000, 0.000000, 0.000000, 0.000000 +1000, 1.000000, 0.000000, 0.000000, 0.000000 +1001, 1.000000, 0.000000, 0.000000, 0.000000 +1002, 1.000000, 0.000000, 0.000000, 0.000000 +1003, 1.000000, 0.000000, 0.000000, 0.000000 +1004, 1.000000, 0.000000, 0.000000, 0.000000 +1005, 1.000000, 0.000000, 0.000000, 0.000000 +1006, 1.000000, 0.000000, 0.000000, 0.000000 +1007, 1.000000, 0.000000, 0.000000, 0.000000 +1008, 1.000000, 0.000000, 0.000000, 0.000000 +1009, 1.000000, 0.000000, 0.000000, 0.000000 +1010, 1.000000, 0.000000, 0.000000, 0.000000 +1011, 1.000000, 0.000000, 0.000000, 0.000000 +1012, 1.000000, 0.000000, 0.000000, 0.000000 +1013, 1.000000, 0.000000, 0.000000, 0.000000 +1014, 1.000000, 0.000000, 0.000000, 0.000000 +1015, 1.000000, 0.000000, 0.000000, 0.000000 +1016, 1.000000, 0.000000, 0.000000, 0.000000 +1017, 1.000000, 0.000000, 0.000000, 0.000000 +1018, 1.000000, 0.000000, 0.000000, 0.000000 +1019, 1.000000, 0.000000, 0.000000, 0.000000 +1020, 1.000000, 0.000000, 0.000000, 0.000000 +1021, 1.000000, 0.000000, 0.000000, 0.000000 +1022, 1.000000, 0.000000, 0.000000, 0.000000 +1023, 1.000000, 0.000000, 0.000000, 0.000000 +1024, 1.000000, 0.000000, 0.000000, 0.000000 +1025, 1.000000, 0.000000, 0.000000, 0.000000 +1026, 1.000000, 0.000000, 0.000000, 0.000000 +1027, 1.000000, 0.000000, 0.000000, 0.000000 +1028, 1.000000, 0.000000, 0.000000, 0.000000 +1029, 1.000000, 0.000000, 0.000000, 0.000000 +1030, 1.000000, 0.000000, 0.000000, 0.000000 +1031, 1.000000, 0.000000, 0.000000, 0.000000 +1032, 1.000000, 0.000000, 0.000000, 0.000000 +1033, 1.000000, 0.000000, 0.000000, 0.000000 +1034, 1.000000, 0.000000, 0.000000, 0.000000 +1035, 1.000000, 0.000000, 0.000000, 0.000000 +1036, 1.000000, 0.000000, 0.000000, 0.000000 +1037, 1.000000, 0.000000, 0.000000, 0.000000 +1038, 1.000000, 0.000000, 0.000000, 0.000000 +1039, 1.000000, 0.000000, 0.000000, 0.000000 +1040, 1.000000, 0.000000, 0.000000, 0.000000 +1041, 1.000000, 0.000000, 0.000000, 0.000000 +1042, 1.000000, 0.000000, 0.000000, 0.000000 +1043, 1.000000, 0.000000, 0.000000, 0.000000 +1044, 1.000000, 0.000000, 0.000000, 0.000000 +1045, 1.000000, 0.000000, 0.000000, 0.000000 +1046, 1.000000, 0.000000, 0.000000, 0.000000 +1047, 1.000000, 0.000000, 0.000000, 0.000000 +1048, 1.000000, 0.000000, 0.000000, 0.000000 +1049, 1.000000, 0.000000, 0.000000, 0.000000 +1050, 1.000000, 0.000000, 0.000000, 0.000000 +1051, 1.000000, 0.000000, 0.000000, 0.000000 +1052, 1.000000, 0.000000, 0.000000, 0.000000 +1053, 1.000000, 0.000000, 0.000000, 0.000000 +1054, 1.000000, 0.000000, 0.000000, 0.000000 +1055, 1.000000, 0.000000, 0.000000, 0.000000 +1056, 1.000000, 0.000000, 0.000000, 0.000000 +1057, 1.000000, 0.000000, 0.000000, 0.000000 +1058, 1.000000, 0.000000, 0.000000, 0.000000 +1059, 1.000000, 0.000000, 0.000000, 0.000000 +1060, 1.000000, 0.000000, 0.000000, 0.000000 +1061, 1.000000, 0.000000, 0.000000, 0.000000 +1062, 1.000000, 0.000000, 0.000000, 0.000000 +1063, 1.000000, 0.000000, 0.000000, 0.000000 +1064, 1.000000, 0.000000, 0.000000, 0.000000 +1065, 1.000000, 0.000000, 0.000000, 0.000000 +1066, 1.000000, 0.000000, 0.000000, 0.000000 +1067, 1.000000, 0.000000, 0.000000, 0.000000 +1068, 1.000000, 0.000000, 0.000000, 0.000000 +1069, 1.000000, 0.000000, 0.000000, 0.000000 +1070, 1.000000, 0.000000, 0.000000, 0.000000 +1071, 1.000000, 0.000000, 0.000000, 0.000000 +1072, 1.000000, 0.000000, 0.000000, 0.000000 +1073, 1.000000, 0.000000, 0.000000, 0.000000 +1074, 1.000000, 0.000000, 0.000000, 0.000000 +1075, 1.000000, 0.000000, 0.000000, 0.000000 +1076, 1.000000, 0.000000, 0.000000, 0.000000 +1077, 1.000000, 0.000000, 0.000000, 0.000000 +1078, 1.000000, 0.000000, 0.000000, 0.000000 +1079, 1.000000, 0.000000, 0.000000, 0.000000 +1080, 1.000000, 0.000000, 0.000000, 0.000000 +1081, 1.000000, 0.000000, 0.000000, 0.000000 +1082, 1.000000, 0.000000, 0.000000, 0.000000 +1083, 1.000000, 0.000000, 0.000000, 0.000000 +1084, 1.000000, 0.000000, 0.000000, 0.000000 +1085, 1.000000, 0.000000, 0.000000, 0.000000 +1086, 1.000000, 0.000000, 0.000000, 0.000000 +1087, 1.000000, 0.000000, 0.000000, 0.000000 +1088, 1.000000, 0.000000, 0.000000, 0.000000 +1089, 1.000000, 0.000000, 0.000000, 0.000000 +1090, 1.000000, 0.000000, 0.000000, 0.000000 +1091, 1.000000, 0.000000, 0.000000, 0.000000 +1092, 1.000000, 0.000000, 0.000000, 0.000000 +1093, 1.000000, 0.000000, 0.000000, 0.000000 +1094, 1.000000, 0.000000, 0.000000, 0.000000 +1095, 1.000000, 0.000000, 0.000000, 0.000000 +1096, 1.000000, 0.000000, 0.000000, 0.000000 +1097, 1.000000, 0.000000, 0.000000, 0.000000 +1098, 1.000000, 0.000000, 0.000000, 0.000000 +1099, 1.000000, 0.000000, 0.000000, 0.000000 +1100, 1.000000, 0.000000, 0.000000, 0.000000 +1101, 1.000000, 0.000000, 0.000000, 0.000000 +1102, 1.000000, 0.000000, 0.000000, 0.000000 +1103, 1.000000, 0.000000, 0.000000, 0.000000 +1104, 1.000000, 0.000000, 0.000000, 0.000000 +1105, 1.000000, 0.000000, 0.000000, 0.000000 +1106, 1.000000, 0.000000, 0.000000, 0.000000 +1107, 1.000000, 0.000000, 0.000000, 0.000000 +1108, 1.000000, 0.000000, 0.000000, 0.000000 +1109, 1.000000, 0.000000, 0.000000, 0.000000 +1110, 1.000000, 0.000000, 0.000000, 0.000000 +1111, 1.000000, 0.000000, 0.000000, 0.000000 +1112, 1.000000, 0.000000, 0.000000, 0.000000 +1113, 1.000000, 0.000000, 0.000000, 0.000000 +1114, 1.000000, 0.000000, 0.000000, 0.000000 +1115, 1.000000, 0.000000, 0.000000, 0.000000 +1116, 1.000000, 0.000000, 0.000000, 0.000000 +1117, 1.000000, 0.000000, 0.000000, 0.000000 +1118, 1.000000, 0.000000, 0.000000, 0.000000 +1119, 1.000000, 0.000000, 0.000000, 0.000000 +1120, 1.000000, 0.000000, 0.000000, 0.000000 +1121, 1.000000, 0.000000, 0.000000, 0.000000 +1122, 1.000000, 0.000000, 0.000000, 0.000000 +1123, 1.000000, 0.000000, 0.000000, 0.000000 +1124, 1.000000, 0.000000, 0.000000, 0.000000 +1125, 1.000000, 0.000000, 0.000000, 0.000000 +1126, 1.000000, 0.000000, 0.000000, 0.000000 +1127, 1.000000, 0.000000, 0.000000, 0.000000 +1128, 1.000000, 0.000000, 0.000000, 0.000000 +1129, 1.000000, 0.000000, 0.000000, 0.000000 +1130, 1.000000, 0.000000, 0.000000, 0.000000 +1131, 1.000000, 0.000000, 0.000000, 0.000000 +1132, 1.000000, 0.000000, 0.000000, 0.000000 +1133, 1.000000, 0.000000, 0.000000, 0.000000 +1134, 1.000000, 0.000000, 0.000000, 0.000000 +1135, 1.000000, 0.000000, 0.000000, 0.000000 +1136, 1.000000, 0.000000, 0.000000, 0.000000 +1137, 1.000000, 0.000000, 0.000000, 0.000000 +1138, 1.000000, 0.000000, 0.000000, 0.000000 +1139, 1.000000, 0.000000, 0.000000, 0.000000 +1140, 1.000000, 0.000000, 0.000000, 0.000000 +1141, 1.000000, 0.000000, 0.000000, 0.000000 +1142, 1.000000, 0.000000, 0.000000, 0.000000 +1143, 1.000000, 0.000000, 0.000000, 0.000000 +1144, 1.000000, 0.000000, 0.000000, 0.000000 +1145, 1.000000, 0.000000, 0.000000, 0.000000 +1146, 1.000000, 0.000000, 0.000000, 0.000000 +1147, 1.000000, 0.000000, 0.000000, 0.000000 +1148, 1.000000, 0.000000, 0.000000, 0.000000 +1149, 1.000000, 0.000000, 0.000000, 0.000000 +1150, 1.000000, 0.000000, 0.000000, 0.000000 +1151, 1.000000, 0.000000, 0.000000, 0.000000 +1152, 1.000000, 0.000000, 0.000000, 0.000000 +1153, 1.000000, 0.000000, 0.000000, 0.000000 +1154, 1.000000, 0.000000, 0.000000, 0.000000 +1155, 1.000000, 0.000000, 0.000000, 0.000000 +1156, 1.000000, 0.000000, 0.000000, 0.000000 +1157, 1.000000, 0.000000, 0.000000, 0.000000 +1158, 1.000000, 0.000000, 0.000000, 0.000000 +1159, 1.000000, 0.000000, 0.000000, 0.000000 +1160, 1.000000, 0.000000, 0.000000, 0.000000 +1161, 1.000000, 0.000000, 0.000000, 0.000000 +1162, 1.000000, 0.000000, 0.000000, 0.000000 +1163, 1.000000, 0.000000, 0.000000, 0.000000 +1164, 1.000000, 0.000000, 0.000000, 0.000000 +1165, 1.000000, 0.000000, 0.000000, 0.000000 +1166, 1.000000, 0.000000, 0.000000, 0.000000 +1167, 1.000000, 0.000000, 0.000000, 0.000000 +1168, 1.000000, 0.000000, 0.000000, 0.000000 +1169, 1.000000, 0.000000, 0.000000, 0.000000 +1170, 1.000000, 0.000000, 0.000000, 0.000000 +1171, 1.000000, 0.000000, 0.000000, 0.000000 +1172, 1.000000, 0.000000, 0.000000, 0.000000 +1173, 1.000000, 0.000000, 0.000000, 0.000000 +1174, 1.000000, 0.000000, 0.000000, 0.000000 +1175, 1.000000, 0.000000, 0.000000, 0.000000 +1176, 1.000000, 0.000000, 0.000000, 0.000000 +1177, 1.000000, 0.000000, 0.000000, 0.000000 +1178, 1.000000, 0.000000, 0.000000, 0.000000 +1179, 1.000000, 0.000000, 0.000000, 0.000000 +1180, 1.000000, 0.000000, 0.000000, 0.000000 +1181, 1.000000, 0.000000, 0.000000, 0.000000 +1182, 1.000000, 0.000000, 0.000000, 0.000000 +1183, 1.000000, 0.000000, 0.000000, 0.000000 +1184, 1.000000, 0.000000, 0.000000, 0.000000 +1185, 1.000000, 0.000000, 0.000000, 0.000000 +1186, 1.000000, 0.000000, 0.000000, 0.000000 +1187, 1.000000, 0.000000, 0.000000, 0.000000 +1188, 1.000000, 0.000000, 0.000000, 0.000000 +1189, 1.000000, 0.000000, 0.000000, 0.000000 +1190, 1.000000, 0.000000, 0.000000, 0.000000 +1191, 1.000000, 0.000000, 0.000000, 0.000000 +1192, 1.000000, 0.000000, 0.000000, 0.000000 +1193, 1.000000, 0.000000, 0.000000, 0.000000 +1194, 1.000000, 0.000000, 0.000000, 0.000000 +1195, 1.000000, 0.000000, 0.000000, 0.000000 +1196, 1.000000, 0.000000, 0.000000, 0.000000 +1197, 1.000000, 0.000000, 0.000000, 0.000000 +1198, 1.000000, 0.000000, 0.000000, 0.000000 +1199, 1.000000, 0.000000, 0.000000, 0.000000 +1200, 1.000000, 0.000000, 0.000000, 0.000000 +1201, 1.000000, 0.000000, 0.000000, 0.000000 +1202, 1.000000, 0.000000, 0.000000, 0.000000 +1203, 1.000000, 0.000000, 0.000000, 0.000000 +1204, 1.000000, 0.000000, 0.000000, 0.000000 +1205, 1.000000, 0.000000, 0.000000, 0.000000 +1206, 1.000000, 0.000000, 0.000000, 0.000000 +1207, 1.000000, 0.000000, 0.000000, 0.000000 +1208, 1.000000, 0.000000, 0.000000, 0.000000 +1209, 1.000000, 0.000000, 0.000000, 0.000000 +1210, 1.000000, 0.000000, 0.000000, 0.000000 +1211, 1.000000, 0.000000, 0.000000, 0.000000 +1212, 1.000000, 0.000000, 0.000000, 0.000000 +1213, 1.000000, 0.000000, 0.000000, 0.000000 +1214, 1.000000, 0.000000, 0.000000, 0.000000 +1215, 1.000000, 0.000000, 0.000000, 0.000000 +1216, 1.000000, 0.000000, 0.000000, 0.000000 +1217, 1.000000, 0.000000, 0.000000, 0.000000 +1218, 1.000000, 0.000000, 0.000000, 0.000000 +1219, 1.000000, 0.000000, 0.000000, 0.000000 +1220, 1.000000, 0.000000, 0.000000, 0.000000 +1221, 1.000000, 0.000000, 0.000000, 0.000000 +1222, 1.000000, 0.000000, 0.000000, 0.000000 +1223, 1.000000, 0.000000, 0.000000, 0.000000 +1224, 1.000000, 0.000000, 0.000000, 0.000000 +1225, 1.000000, 0.000000, 0.000000, 0.000000 +1226, 1.000000, 0.000000, 0.000000, 0.000000 +1227, 1.000000, 0.000000, 0.000000, 0.000000 +1228, 1.000000, 0.000000, 0.000000, 0.000000 +1229, 1.000000, 0.000000, 0.000000, 0.000000 +1230, 1.000000, 0.000000, 0.000000, 0.000000 +1231, 1.000000, 0.000000, 0.000000, 0.000000 +1232, 1.000000, 0.000000, 0.000000, 0.000000 +1233, 1.000000, 0.000000, 0.000000, 0.000000 +1234, 1.000000, 0.000000, 0.000000, 0.000000 +1235, 1.000000, 0.000000, 0.000000, 0.000000 +1236, 1.000000, 0.000000, 0.000000, 0.000000 +1237, 1.000000, 0.000000, 0.000000, 0.000000 +1238, 1.000000, 0.000000, 0.000000, 0.000000 +1239, 1.000000, 0.000000, 0.000000, 0.000000 +1240, 1.000000, 0.000000, 0.000000, 0.000000 +1241, 1.000000, 0.000000, 0.000000, 0.000000 +1242, 1.000000, 0.000000, 0.000000, 0.000000 +1243, 1.000000, 0.000000, 0.000000, 0.000000 +1244, 1.000000, 0.000000, 0.000000, 0.000000 +1245, 1.000000, 0.000000, 0.000000, 0.000000 +1246, 1.000000, 0.000000, 0.000000, 0.000000 +1247, 1.000000, 0.000000, 0.000000, 0.000000 +1248, 1.000000, 0.000000, 0.000000, 0.000000 +1249, 1.000000, 0.000000, 0.000000, 0.000000 +1250, 1.000000, 0.000000, 0.000000, 0.000000 +1251, 1.000000, 0.000000, 0.000000, 0.000000 +1252, 1.000000, 0.000000, 0.000000, 0.000000 +1253, 1.000000, 0.000000, 0.000000, 0.000000 +1254, 1.000000, 0.000000, 0.000000, 0.000000 +1255, 1.000000, 0.000000, 0.000000, 0.000000 +1256, 1.000000, 0.000000, 0.000000, 0.000000 +1257, 1.000000, 0.000000, 0.000000, 0.000000 +1258, 1.000000, 0.000000, 0.000000, 0.000000 +1259, 1.000000, 0.000000, 0.000000, 0.000000 +1260, 1.000000, 0.000000, 0.000000, 0.000000 +1261, 1.000000, 0.000000, 0.000000, 0.000000 +1262, 1.000000, 0.000000, 0.000000, 0.000000 +1263, 1.000000, 0.000000, 0.000000, 0.000000 +1264, 1.000000, 0.000000, 0.000000, 0.000000 +1265, 1.000000, 0.000000, 0.000000, 0.000000 +1266, 1.000000, 0.000000, 0.000000, 0.000000 +1267, 1.000000, 0.000000, 0.000000, 0.000000 +1268, 1.000000, 0.000000, 0.000000, 0.000000 +1269, 1.000000, 0.000000, 0.000000, 0.000000 +1270, 1.000000, 0.000000, 0.000000, 0.000000 +1271, 1.000000, 0.000000, 0.000000, 0.000000 +1272, 1.000000, 0.000000, 0.000000, 0.000000 +1273, 1.000000, 0.000000, 0.000000, 0.000000 +1274, 1.000000, 0.000000, 0.000000, 0.000000 +1275, 1.000000, 0.000000, 0.000000, 0.000000 +1276, 1.000000, 0.000000, 0.000000, 0.000000 +1277, 1.000000, 0.000000, 0.000000, 0.000000 +1278, 1.000000, 0.000000, 0.000000, 0.000000 +1279, 1.000000, 0.000000, 0.000000, 0.000000 +1280, 1.000000, 0.000000, 0.000000, 0.000000 +1281, 1.000000, 0.000000, 0.000000, 0.000000 +1282, 1.000000, 0.000000, 0.000000, 0.000000 +1283, 1.000000, 0.000000, 0.000000, 0.000000 +1284, 1.000000, 0.000000, 0.000000, 0.000000 +1285, 1.000000, 0.000000, 0.000000, 0.000000 +1286, 1.000000, 0.000000, 0.000000, 0.000000 +1287, 1.000000, 0.000000, 0.000000, 0.000000 +1288, 1.000000, 0.000000, 0.000000, 0.000000 +1289, 1.000000, 0.000000, 0.000000, 0.000000 +1290, 1.000000, 0.000000, 0.000000, 0.000000 +1291, 1.000000, 0.000000, 0.000000, 0.000000 +1292, 1.000000, 0.000000, 0.000000, 0.000000 +1293, 1.000000, 0.000000, 0.000000, 0.000000 +1294, 1.000000, 0.000000, 0.000000, 0.000000 +1295, 1.000000, 0.000000, 0.000000, 0.000000 +1296, 1.000000, 0.000000, 0.000000, 0.000000 +1297, 1.000000, 0.000000, 0.000000, 0.000000 +1298, 1.000000, 0.000000, 0.000000, 0.000000 +1299, 1.000000, 0.000000, 0.000000, 0.000000 +1300, 1.000000, 0.000000, 0.000000, 0.000000 +1301, 1.000000, 0.000000, 0.000000, 0.000000 +1302, 1.000000, 0.000000, 0.000000, 0.000000 +1303, 1.000000, 0.000000, 0.000000, 0.000000 +1304, 1.000000, 0.000000, 0.000000, 0.000000 +1305, 1.000000, 0.000000, 0.000000, 0.000000 +1306, 1.000000, 0.000000, 0.000000, 0.000000 +1307, 1.000000, 0.000000, 0.000000, 0.000000 +1308, 1.000000, 0.000000, 0.000000, 0.000000 +1309, 1.000000, 0.000000, 0.000000, 0.000000 +1310, 1.000000, 0.000000, 0.000000, 0.000000 +1311, 1.000000, 0.000000, 0.000000, 0.000000 +1312, 1.000000, 0.000000, 0.000000, 0.000000 +1313, 1.000000, 0.000000, 0.000000, 0.000000 +1314, 1.000000, 0.000000, 0.000000, 0.000000 +1315, 1.000000, 0.000000, 0.000000, 0.000000 +1316, 1.000000, 0.000000, 0.000000, 0.000000 +1317, 1.000000, 0.000000, 0.000000, 0.000000 +1318, 1.000000, 0.000000, 0.000000, 0.000000 +1319, 1.000000, 0.000000, 0.000000, 0.000000 +1320, 1.000000, 0.000000, 0.000000, 0.000000 +1321, 1.000000, 0.000000, 0.000000, 0.000000 +1322, 1.000000, 0.000000, 0.000000, 0.000000 +1323, 1.000000, 0.000000, 0.000000, 0.000000 +1324, 1.000000, 0.000000, 0.000000, 0.000000 +1325, 1.000000, 0.000000, 0.000000, 0.000000 +1326, 1.000000, 0.000000, 0.000000, 0.000000 +1327, 1.000000, 0.000000, 0.000000, 0.000000 +1328, 1.000000, 0.000000, 0.000000, 0.000000 +1329, 1.000000, 0.000000, 0.000000, 0.000000 +1330, 1.000000, 0.000000, 0.000000, 0.000000 +1331, 1.000000, 0.000000, 0.000000, 0.000000 +1332, 1.000000, 0.000000, 0.000000, 0.000000 +1333, 1.000000, 0.000000, 0.000000, 0.000000 +1334, 1.000000, 0.000000, 0.000000, 0.000000 +1335, 1.000000, 0.000000, 0.000000, 0.000000 +1336, 1.000000, 0.000000, 0.000000, 0.000000 +1337, 1.000000, 0.000000, 0.000000, 0.000000 +1338, 1.000000, 0.000000, 0.000000, 0.000000 +1339, 1.000000, 0.000000, 0.000000, 0.000000 +1340, 1.000000, 0.000000, 0.000000, 0.000000 +1341, 1.000000, 0.000000, 0.000000, 0.000000 +1342, 1.000000, 0.000000, 0.000000, 0.000000 +1343, 1.000000, 0.000000, 0.000000, 0.000000 +1344, 1.000000, 0.000000, 0.000000, 0.000000 +1345, 1.000000, 0.000000, 0.000000, 0.000000 +1346, 1.000000, 0.000000, 0.000000, 0.000000 +1347, 1.000000, 0.000000, 0.000000, 0.000000 +1348, 1.000000, 0.000000, 0.000000, 0.000000 +1349, 1.000000, 0.000000, 0.000000, 0.000000 +1350, 1.000000, 0.000000, 0.000000, 0.000000 +1351, 1.000000, 0.000000, 0.000000, 0.000000 +1352, 1.000000, 0.000000, 0.000000, 0.000000 +1353, 1.000000, 0.000000, 0.000000, 0.000000 +1354, 1.000000, 0.000000, 0.000000, 0.000000 +1355, 1.000000, 0.000000, 0.000000, 0.000000 +1356, 1.000000, 0.000000, 0.000000, 0.000000 +1357, 1.000000, 0.000000, 0.000000, 0.000000 +1358, 1.000000, 0.000000, 0.000000, 0.000000 +1359, 1.000000, 0.000000, 0.000000, 0.000000 +1360, 1.000000, 0.000000, 0.000000, 0.000000 +1361, 1.000000, 0.000000, 0.000000, 0.000000 +1362, 1.000000, 0.000000, 0.000000, 0.000000 +1363, 1.000000, 0.000000, 0.000000, 0.000000 +1364, 1.000000, 0.000000, 0.000000, 0.000000 +1365, 1.000000, 0.000000, 0.000000, 0.000000 +1366, 1.000000, 0.000000, 0.000000, 0.000000 +1367, 1.000000, 0.000000, 0.000000, 0.000000 +1368, 1.000000, 0.000000, 0.000000, 0.000000 +1369, 1.000000, 0.000000, 0.000000, 0.000000 +1370, 1.000000, 0.000000, 0.000000, 0.000000 +1371, 1.000000, 0.000000, 0.000000, 0.000000 +1372, 1.000000, 0.000000, 0.000000, 0.000000 +1373, 1.000000, 0.000000, 0.000000, 0.000000 +1374, 1.000000, 0.000000, 0.000000, 0.000000 +1375, 1.000000, 0.000000, 0.000000, 0.000000 +1376, 1.000000, 0.000000, 0.000000, 0.000000 +1377, 1.000000, 0.000000, 0.000000, 0.000000 +1378, 1.000000, 0.000000, 0.000000, 0.000000 +1379, 1.000000, 0.000000, 0.000000, 0.000000 +1380, 1.000000, 0.000000, 0.000000, 0.000000 +1381, 1.000000, 0.000000, 0.000000, 0.000000 +1382, 1.000000, 0.000000, 0.000000, 0.000000 +1383, 1.000000, 0.000000, 0.000000, 0.000000 +1384, 1.000000, 0.000000, 0.000000, 0.000000 +1385, 1.000000, 0.000000, 0.000000, 0.000000 +1386, 1.000000, 0.000000, 0.000000, 0.000000 +1387, 1.000000, 0.000000, 0.000000, 0.000000 +1388, 1.000000, 0.000000, 0.000000, 0.000000 +1389, 1.000000, 0.000000, 0.000000, 0.000000 +1390, 1.000000, 0.000000, 0.000000, 0.000000 +1391, 1.000000, 0.000000, 0.000000, 0.000000 +1392, 1.000000, 0.000000, 0.000000, 0.000000 +1393, 1.000000, 0.000000, 0.000000, 0.000000 +1394, 1.000000, 0.000000, 0.000000, 0.000000 +1395, 1.000000, 0.000000, 0.000000, 0.000000 +1396, 1.000000, 0.000000, 0.000000, 0.000000 +1397, 1.000000, 0.000000, 0.000000, 0.000000 +1398, 1.000000, 0.000000, 0.000000, 0.000000 +1399, 1.000000, 0.000000, 0.000000, 0.000000 +1400, 1.000000, 0.000000, 0.000000, 0.000000 +1401, 1.000000, 0.000000, 0.000000, 0.000000 +1402, 1.000000, 0.000000, 0.000000, 0.000000 +1403, 1.000000, 0.000000, 0.000000, 0.000000 +1404, 1.000000, 0.000000, 0.000000, 0.000000 +1405, 1.000000, 0.000000, 0.000000, 0.000000 +1406, 1.000000, 0.000000, 0.000000, 0.000000 +1407, 1.000000, 0.000000, 0.000000, 0.000000 +1408, 1.000000, 0.000000, 0.000000, 0.000000 +1409, 1.000000, 0.000000, 0.000000, 0.000000 +1410, 1.000000, 0.000000, 0.000000, 0.000000 +1411, 1.000000, 0.000000, 0.000000, 0.000000 +1412, 1.000000, 0.000000, 0.000000, 0.000000 +1413, 1.000000, 0.000000, 0.000000, 0.000000 +1414, 1.000000, 0.000000, 0.000000, 0.000000 +1415, 1.000000, 0.000000, 0.000000, 0.000000 +1416, 1.000000, 0.000000, 0.000000, 0.000000 +1417, 1.000000, 0.000000, 0.000000, 0.000000 +1418, 1.000000, 0.000000, 0.000000, 0.000000 +1419, 1.000000, 0.000000, 0.000000, 0.000000 +1420, 1.000000, 0.000000, 0.000000, 0.000000 +1421, 1.000000, 0.000000, 0.000000, 0.000000 +1422, 1.000000, 0.000000, 0.000000, 0.000000 +1423, 1.000000, 0.000000, 0.000000, 0.000000 +1424, 1.000000, 0.000000, 0.000000, 0.000000 +1425, 1.000000, 0.000000, 0.000000, 0.000000 +1426, 1.000000, 0.000000, 0.000000, 0.000000 +1427, 1.000000, 0.000000, 0.000000, 0.000000 +1428, 1.000000, 0.000000, 0.000000, 0.000000 +1429, 1.000000, 0.000000, 0.000000, 0.000000 +1430, 1.000000, 0.000000, 0.000000, 0.000000 +1431, 1.000000, 0.000000, 0.000000, 0.000000 +1432, 1.000000, 0.000000, 0.000000, 0.000000 +1433, 1.000000, 0.000000, 0.000000, 0.000000 +1434, 1.000000, 0.000000, 0.000000, 0.000000 +1435, 1.000000, 0.000000, 0.000000, 0.000000 +1436, 1.000000, 0.000000, 0.000000, 0.000000 +1437, 1.000000, 0.000000, 0.000000, 0.000000 +1438, 1.000000, 0.000000, 0.000000, 0.000000 +1439, 1.000000, 0.000000, 0.000000, 0.000000 +1440, 1.000000, 0.000000, 0.000000, 0.000000 +1441, 1.000000, 0.000000, 0.000000, 0.000000 +1442, 1.000000, 0.000000, 0.000000, 0.000000 +1443, 1.000000, 0.000000, 0.000000, 0.000000 +1444, 1.000000, 0.000000, 0.000000, 0.000000 +1445, 1.000000, 0.000000, 0.000000, 0.000000 +1446, 1.000000, 0.000000, 0.000000, 0.000000 +1447, 1.000000, 0.000000, 0.000000, 0.000000 +1448, 1.000000, 0.000000, 0.000000, 0.000000 +1449, 1.000000, 0.000000, 0.000000, 0.000000 +1450, 1.000000, 0.000000, 0.000000, 0.000000 +1451, 1.000000, 0.000000, 0.000000, 0.000000 +1452, 1.000000, 0.000000, 0.000000, 0.000000 +1453, 1.000000, 0.000000, 0.000000, 0.000000 +1454, 1.000000, 0.000000, 0.000000, 0.000000 +1455, 1.000000, 0.000000, 0.000000, 0.000000 +1456, 1.000000, 0.000000, 0.000000, 0.000000 +1457, 1.000000, 0.000000, 0.000000, 0.000000 +1458, 1.000000, 0.000000, 0.000000, 0.000000 +1459, 1.000000, 0.000000, 0.000000, 0.000000 +1460, 1.000000, 0.000000, 0.000000, 0.000000 +1461, 1.000000, 0.000000, 0.000000, 0.000000 +1462, 1.000000, 0.000000, 0.000000, 0.000000 +1463, 1.000000, 0.000000, 0.000000, 0.000000 +1464, 1.000000, 0.000000, 0.000000, 0.000000 +1465, 1.000000, 0.000000, 0.000000, 0.000000 +1466, 1.000000, 0.000000, 0.000000, 0.000000 +1467, 1.000000, 0.000000, 0.000000, 0.000000 +1468, 1.000000, 0.000000, 0.000000, 0.000000 +1469, 1.000000, 0.000000, 0.000000, 0.000000 +1470, 1.000000, 0.000000, 0.000000, 0.000000 +1471, 1.000000, 0.000000, 0.000000, 0.000000 +1472, 1.000000, 0.000000, 0.000000, 0.000000 +1473, 1.000000, 0.000000, 0.000000, 0.000000 +1474, 1.000000, 0.000000, 0.000000, 0.000000 +1475, 1.000000, 0.000000, 0.000000, 0.000000 +1476, 1.000000, 0.000000, 0.000000, 0.000000 +1477, 1.000000, 0.000000, 0.000000, 0.000000 +1478, 1.000000, 0.000000, 0.000000, 0.000000 +1479, 1.000000, 0.000000, 0.000000, 0.000000 +1480, 1.000000, 0.000000, 0.000000, 0.000000 +1481, 1.000000, 0.000000, 0.000000, 0.000000 +1482, 1.000000, 0.000000, 0.000000, 0.000000 +1483, 1.000000, 0.000000, 0.000000, 0.000000 +1484, 1.000000, 0.000000, 0.000000, 0.000000 +1485, 1.000000, 0.000000, 0.000000, 0.000000 +1486, 1.000000, 0.000000, 0.000000, 0.000000 +1487, 1.000000, 0.000000, 0.000000, 0.000000 +1488, 1.000000, 0.000000, 0.000000, 0.000000 +1489, 1.000000, 0.000000, 0.000000, 0.000000 +1490, 1.000000, 0.000000, 0.000000, 0.000000 +1491, 1.000000, 0.000000, 0.000000, 0.000000 +1492, 1.000000, 0.000000, 0.000000, 0.000000 +1493, 1.000000, 0.000000, 0.000000, 0.000000 +1494, 1.000000, 0.000000, 0.000000, 0.000000 +1495, 1.000000, 0.000000, 0.000000, 0.000000 +1496, 1.000000, 0.000000, 0.000000, 0.000000 +1497, 1.000000, 0.000000, 0.000000, 0.000000 +1498, 1.000000, 0.000000, 0.000000, 0.000000 +1499, 1.000000, 0.000000, 0.000000, 0.000000 +1500, 1.000000, 0.000000, 0.000000, 0.000000 +1501, 1.000000, 0.000000, 0.000000, 0.000000 +1502, 1.000000, 0.000000, 0.000000, 0.000000 +1503, 1.000000, 0.000000, 0.000000, 0.000000 +1504, 1.000000, 0.000000, 0.000000, 0.000000 +1505, 1.000000, 0.000000, 0.000000, 0.000000 +1506, 1.000000, 0.000000, 0.000000, 0.000000 +1507, 1.000000, 0.000000, 0.000000, 0.000000 +1508, 1.000000, 0.000000, 0.000000, 0.000000 +1509, 1.000000, 0.000000, 0.000000, 0.000000 +1510, 1.000000, 0.000000, 0.000000, 0.000000 +1511, 1.000000, 0.000000, 0.000000, 0.000000 +1512, 1.000000, 0.000000, 0.000000, 0.000000 +1513, 1.000000, 0.000000, 0.000000, 0.000000 +1514, 1.000000, 0.000000, 0.000000, 0.000000 +1515, 1.000000, 0.000000, 0.000000, 0.000000 +1516, 1.000000, 0.000000, 0.000000, 0.000000 +1517, 1.000000, 0.000000, 0.000000, 0.000000 +1518, 1.000000, 0.000000, 0.000000, 0.000000 +1519, 1.000000, 0.000000, 0.000000, 0.000000 +1520, 1.000000, 0.000000, 0.000000, 0.000000 +1521, 1.000000, 0.000000, 0.000000, 0.000000 +1522, 1.000000, 0.000000, 0.000000, 0.000000 +1523, 1.000000, 0.000000, 0.000000, 0.000000 +1524, 1.000000, 0.000000, 0.000000, 0.000000 +1525, 1.000000, 0.000000, 0.000000, 0.000000 +1526, 1.000000, 0.000000, 0.000000, 0.000000 +1527, 1.000000, 0.000000, 0.000000, 0.000000 +1528, 1.000000, 0.000000, 0.000000, 0.000000 +1529, 1.000000, 0.000000, 0.000000, 0.000000 +1530, 1.000000, 0.000000, 0.000000, 0.000000 +1531, 1.000000, 0.000000, 0.000000, 0.000000 +1532, 1.000000, 0.000000, 0.000000, 0.000000 +1533, 1.000000, 0.000000, 0.000000, 0.000000 +1534, 1.000000, 0.000000, 0.000000, 0.000000 +1535, 1.000000, 0.000000, 0.000000, 0.000000 +1536, 1.000000, 0.000000, 0.000000, 0.000000 +1537, 1.000000, 0.000000, 0.000000, 0.000000 +1538, 1.000000, 0.000000, 0.000000, 0.000000 +1539, 1.000000, 0.000000, 0.000000, 0.000000 +1540, 1.000000, 0.000000, 0.000000, 0.000000 +1541, 1.000000, 0.000000, 0.000000, 0.000000 +1542, 1.000000, 0.000000, 0.000000, 0.000000 +1543, 1.000000, 0.000000, 0.000000, 0.000000 +1544, 1.000000, 0.000000, 0.000000, 0.000000 +1545, 1.000000, 0.000000, 0.000000, 0.000000 +1546, 1.000000, 0.000000, 0.000000, 0.000000 +1547, 1.000000, 0.000000, 0.000000, 0.000000 +1548, 1.000000, 0.000000, 0.000000, 0.000000 +1549, 1.000000, 0.000000, 0.000000, 0.000000 +1550, 1.000000, 0.000000, 0.000000, 0.000000 +1551, 1.000000, 0.000000, 0.000000, 0.000000 +1552, 1.000000, 0.000000, 0.000000, 0.000000 +1553, 1.000000, 0.000000, 0.000000, 0.000000 +1554, 1.000000, 0.000000, 0.000000, 0.000000 +1555, 1.000000, 0.000000, 0.000000, 0.000000 +1556, 1.000000, 0.000000, 0.000000, 0.000000 +1557, 1.000000, 0.000000, 0.000000, 0.000000 +1558, 1.000000, 0.000000, 0.000000, 0.000000 +1559, 1.000000, 0.000000, 0.000000, 0.000000 +1560, 1.000000, 0.000000, 0.000000, 0.000000 +1561, 1.000000, 0.000000, 0.000000, 0.000000 +1562, 1.000000, 0.000000, 0.000000, 0.000000 +1563, 1.000000, 0.000000, 0.000000, 0.000000 +1564, 1.000000, 0.000000, 0.000000, 0.000000 +1565, 1.000000, 0.000000, 0.000000, 0.000000 +1566, 1.000000, 0.000000, 0.000000, 0.000000 +1567, 1.000000, 0.000000, 0.000000, 0.000000 +1568, 1.000000, 0.000000, 0.000000, 0.000000 +1569, 1.000000, 0.000000, 0.000000, 0.000000 +1570, 1.000000, 0.000000, 0.000000, 0.000000 +1571, 1.000000, 0.000000, 0.000000, 0.000000 +1572, 1.000000, 0.000000, 0.000000, 0.000000 +1573, 1.000000, 0.000000, 0.000000, 0.000000 +1574, 1.000000, 0.000000, 0.000000, 0.000000 +1575, 1.000000, 0.000000, 0.000000, 0.000000 +1576, 1.000000, 0.000000, 0.000000, 0.000000 +1577, 1.000000, 0.000000, 0.000000, 0.000000 +1578, 1.000000, 0.000000, 0.000000, 0.000000 +1579, 1.000000, 0.000000, 0.000000, 0.000000 +1580, 1.000000, 0.000000, 0.000000, 0.000000 +1581, 1.000000, 0.000000, 0.000000, 0.000000 +1582, 1.000000, 0.000000, 0.000000, 0.000000 +1583, 1.000000, 0.000000, 0.000000, 0.000000 +1584, 1.000000, 0.000000, 0.000000, 0.000000 +1585, 1.000000, 0.000000, 0.000000, 0.000000 +1586, 1.000000, 0.000000, 0.000000, 0.000000 +1587, 1.000000, 0.000000, 0.000000, 0.000000 +1588, 1.000000, 0.000000, 0.000000, 0.000000 +1589, 1.000000, 0.000000, 0.000000, 0.000000 +1590, 1.000000, 0.000000, 0.000000, 0.000000 +1591, 1.000000, 0.000000, 0.000000, 0.000000 +1592, 1.000000, 0.000000, 0.000000, 0.000000 +1593, 1.000000, 0.000000, 0.000000, 0.000000 +1594, 1.000000, 0.000000, 0.000000, 0.000000 +1595, 1.000000, 0.000000, 0.000000, 0.000000 +1596, 1.000000, 0.000000, 0.000000, 0.000000 +1597, 1.000000, 0.000000, 0.000000, 0.000000 +1598, 1.000000, 0.000000, 0.000000, 0.000000 +1599, 1.000000, 0.000000, 0.000000, 0.000000 +1600, 1.000000, 0.000000, 0.000000, 0.000000 +1601, 1.000000, 0.000000, 0.000000, 0.000000 +1602, 1.000000, 0.000000, 0.000000, 0.000000 +1603, 1.000000, 0.000000, 0.000000, 0.000000 +1604, 1.000000, 0.000000, 0.000000, 0.000000 +1605, 1.000000, 0.000000, 0.000000, 0.000000 +1606, 1.000000, 0.000000, 0.000000, 0.000000 +1607, 1.000000, 0.000000, 0.000000, 0.000000 +1608, 1.000000, 0.000000, 0.000000, 0.000000 +1609, 1.000000, 0.000000, 0.000000, 0.000000 +1610, 1.000000, 0.000000, 0.000000, 0.000000 +1611, 1.000000, 0.000000, 0.000000, 0.000000 +1612, 1.000000, 0.000000, 0.000000, 0.000000 +1613, 1.000000, 0.000000, 0.000000, 0.000000 +1614, 1.000000, 0.000000, 0.000000, 0.000000 +1615, 1.000000, 0.000000, 0.000000, 0.000000 +1616, 1.000000, 0.000000, 0.000000, 0.000000 +1617, 1.000000, 0.000000, 0.000000, 0.000000 +1618, 1.000000, 0.000000, 0.000000, 0.000000 +1619, 1.000000, 0.000000, 0.000000, 0.000000 +1620, 1.000000, 0.000000, 0.000000, 0.000000 +1621, 1.000000, 0.000000, 0.000000, 0.000000 +1622, 1.000000, 0.000000, 0.000000, 0.000000 +1623, 1.000000, 0.000000, 0.000000, 0.000000 +1624, 1.000000, 0.000000, 0.000000, 0.000000 +1625, 1.000000, 0.000000, 0.000000, 0.000000 +1626, 1.000000, 0.000000, 0.000000, 0.000000 +1627, 1.000000, 0.000000, 0.000000, 0.000000 +1628, 1.000000, 0.000000, 0.000000, 0.000000 +1629, 1.000000, 0.000000, 0.000000, 0.000000 +1630, 1.000000, 0.000000, 0.000000, 0.000000 +1631, 1.000000, 0.000000, 0.000000, 0.000000 +1632, 1.000000, 0.000000, 0.000000, 0.000000 +1633, 1.000000, 0.000000, 0.000000, 0.000000 +1634, 1.000000, 0.000000, 0.000000, 0.000000 +1635, 1.000000, 0.000000, 0.000000, 0.000000 +1636, 1.000000, 0.000000, 0.000000, 0.000000 +1637, 1.000000, 0.000000, 0.000000, 0.000000 +1638, 1.000000, 0.000000, 0.000000, 0.000000 +1639, 1.000000, 0.000000, 0.000000, 0.000000 +1640, 1.000000, 0.000000, 0.000000, 0.000000 +1641, 1.000000, 0.000000, 0.000000, 0.000000 +1642, 1.000000, 0.000000, 0.000000, 0.000000 +1643, 1.000000, 0.000000, 0.000000, 0.000000 +1644, 1.000000, 0.000000, 0.000000, 0.000000 +1645, 1.000000, 0.000000, 0.000000, 0.000000 +1646, 1.000000, 0.000000, 0.000000, 0.000000 +1647, 1.000000, 0.000000, 0.000000, 0.000000 +1648, 1.000000, 0.000000, 0.000000, 0.000000 +1649, 1.000000, 0.000000, 0.000000, 0.000000 +1650, 1.000000, 0.000000, 0.000000, 0.000000 +1651, 1.000000, 0.000000, 0.000000, 0.000000 +1652, 1.000000, 0.000000, 0.000000, 0.000000 +1653, 1.000000, 0.000000, 0.000000, 0.000000 +1654, 1.000000, 0.000000, 0.000000, 0.000000 +1655, 1.000000, 0.000000, 0.000000, 0.000000 +1656, 1.000000, 0.000000, 0.000000, 0.000000 +1657, 1.000000, 0.000000, 0.000000, 0.000000 +1658, 1.000000, 0.000000, 0.000000, 0.000000 +1659, 1.000000, 0.000000, 0.000000, 0.000000 +1660, 1.000000, 0.000000, 0.000000, 0.000000 +1661, 1.000000, 0.000000, 0.000000, 0.000000 +1662, 1.000000, 0.000000, 0.000000, 0.000000 +1663, 1.000000, 0.000000, 0.000000, 0.000000 +1664, 1.000000, 0.000000, 0.000000, 0.000000 +1665, 1.000000, 0.000000, 0.000000, 0.000000 +1666, 1.000000, 0.000000, 0.000000, 0.000000 +1667, 1.000000, 0.000000, 0.000000, 0.000000 +1668, 1.000000, 0.000000, 0.000000, 0.000000 +1669, 1.000000, 0.000000, 0.000000, 0.000000 +1670, 1.000000, 0.000000, 0.000000, 0.000000 +1671, 1.000000, 0.000000, 0.000000, 0.000000 +1672, 1.000000, 0.000000, 0.000000, 0.000000 +1673, 1.000000, 0.000000, 0.000000, 0.000000 +1674, 1.000000, 0.000000, 0.000000, 0.000000 +1675, 1.000000, 0.000000, 0.000000, 0.000000 +1676, 1.000000, 0.000000, 0.000000, 0.000000 +1677, 1.000000, 0.000000, 0.000000, 0.000000 +1678, 1.000000, 0.000000, 0.000000, 0.000000 +1679, 1.000000, 0.000000, 0.000000, 0.000000 +1680, 1.000000, 0.000000, 0.000000, 0.000000 +1681, 1.000000, 0.000000, 0.000000, 0.000000 +1682, 1.000000, 0.000000, 0.000000, 0.000000 +1683, 1.000000, 0.000000, 0.000000, 0.000000 +1684, 1.000000, 0.000000, 0.000000, 0.000000 +1685, 1.000000, 0.000000, 0.000000, 0.000000 +1686, 1.000000, 0.000000, 0.000000, 0.000000 +1687, 1.000000, 0.000000, 0.000000, 0.000000 +1688, 1.000000, 0.000000, 0.000000, 0.000000 +1689, 1.000000, 0.000000, 0.000000, 0.000000 +1690, 1.000000, 0.000000, 0.000000, 0.000000 +1691, 1.000000, 0.000000, 0.000000, 0.000000 +1692, 1.000000, 0.000000, 0.000000, 0.000000 +1693, 1.000000, 0.000000, 0.000000, 0.000000 +1694, 1.000000, 0.000000, 0.000000, 0.000000 +1695, 1.000000, 0.000000, 0.000000, 0.000000 +1696, 1.000000, 0.000000, 0.000000, 0.000000 +1697, 1.000000, 0.000000, 0.000000, 0.000000 +1698, 1.000000, 0.000000, 0.000000, 0.000000 +1699, 1.000000, 0.000000, 0.000000, 0.000000 +1700, 1.000000, 0.000000, 0.000000, 0.000000 +1701, 1.000000, 0.000000, 0.000000, 0.000000 +1702, 1.000000, 0.000000, 0.000000, 0.000000 +1703, 1.000000, 0.000000, 0.000000, 0.000000 +1704, 1.000000, 0.000000, 0.000000, 0.000000 +1705, 1.000000, 0.000000, 0.000000, 0.000000 +1706, 1.000000, 0.000000, 0.000000, 0.000000 +1707, 1.000000, 0.000000, 0.000000, 0.000000 +1708, 1.000000, 0.000000, 0.000000, 0.000000 +1709, 1.000000, 0.000000, 0.000000, 0.000000 +1710, 1.000000, 0.000000, 0.000000, 0.000000 +1711, 1.000000, 0.000000, 0.000000, 0.000000 +1712, 1.000000, 0.000000, 0.000000, 0.000000 +1713, 1.000000, 0.000000, 0.000000, 0.000000 +1714, 1.000000, 0.000000, 0.000000, 0.000000 +1715, 1.000000, 0.000000, 0.000000, 0.000000 +1716, 1.000000, 0.000000, 0.000000, 0.000000 +1717, 1.000000, 0.000000, 0.000000, 0.000000 +1718, 1.000000, 0.000000, 0.000000, 0.000000 +1719, 1.000000, 0.000000, 0.000000, 0.000000 +1720, 1.000000, 0.000000, 0.000000, 0.000000 +1721, 1.000000, 0.000000, 0.000000, 0.000000 +1722, 1.000000, 0.000000, 0.000000, 0.000000 +1723, 1.000000, 0.000000, 0.000000, 0.000000 +1724, 1.000000, 0.000000, 0.000000, 0.000000 +1725, 1.000000, 0.000000, 0.000000, 0.000000 +1726, 1.000000, 0.000000, 0.000000, 0.000000 +1727, 1.000000, 0.000000, 0.000000, 0.000000 +1728, 1.000000, 0.000000, 0.000000, 0.000000 +1729, 1.000000, 0.000000, 0.000000, 0.000000 +1730, 1.000000, 0.000000, 0.000000, 0.000000 +1731, 1.000000, 0.000000, 0.000000, 0.000000 +1732, 1.000000, 0.000000, 0.000000, 0.000000 +1733, 1.000000, 0.000000, 0.000000, 0.000000 +1734, 1.000000, 0.000000, 0.000000, 0.000000 +1735, 1.000000, 0.000000, 0.000000, 0.000000 +1736, 1.000000, 0.000000, 0.000000, 0.000000 +1737, 1.000000, 0.000000, 0.000000, 0.000000 +1738, 1.000000, 0.000000, 0.000000, 0.000000 +1739, 1.000000, 0.000000, 0.000000, 0.000000 +1740, 1.000000, 0.000000, 0.000000, 0.000000 +1741, 1.000000, 0.000000, 0.000000, 0.000000 +1742, 1.000000, 0.000000, 0.000000, 0.000000 +1743, 1.000000, 0.000000, 0.000000, 0.000000 +1744, 1.000000, 0.000000, 0.000000, 0.000000 +1745, 1.000000, 0.000000, 0.000000, 0.000000 +1746, 1.000000, 0.000000, 0.000000, 0.000000 +1747, 1.000000, 0.000000, 0.000000, 0.000000 +1748, 1.000000, 0.000000, 0.000000, 0.000000 +1749, 1.000000, 0.000000, 0.000000, 0.000000 +1750, 1.000000, 0.000000, 0.000000, 0.000000 +1751, 1.000000, 0.000000, 0.000000, 0.000000 +1752, 1.000000, 0.000000, 0.000000, 0.000000 +1753, 1.000000, 0.000000, 0.000000, 0.000000 +1754, 1.000000, 0.000000, 0.000000, 0.000000 +1755, 1.000000, 0.000000, 0.000000, 0.000000 +1756, 1.000000, 0.000000, 0.000000, 0.000000 +1757, 1.000000, 0.000000, 0.000000, 0.000000 +1758, 1.000000, 0.000000, 0.000000, 0.000000 +1759, 1.000000, 0.000000, 0.000000, 0.000000 +1760, 1.000000, 0.000000, 0.000000, 0.000000 +1761, 1.000000, 0.000000, 0.000000, 0.000000 +1762, 1.000000, 0.000000, 0.000000, 0.000000 +1763, 1.000000, 0.000000, 0.000000, 0.000000 +1764, 1.000000, 0.000000, 0.000000, 0.000000 +1765, 1.000000, 0.000000, 0.000000, 0.000000 +1766, 1.000000, 0.000000, 0.000000, 0.000000 +1767, 1.000000, 0.000000, 0.000000, 0.000000 +1768, 1.000000, 0.000000, 0.000000, 0.000000 +1769, 1.000000, 0.000000, 0.000000, 0.000000 +1770, 1.000000, 0.000000, 0.000000, 0.000000 +1771, 1.000000, 0.000000, 0.000000, 0.000000 +1772, 1.000000, 0.000000, 0.000000, 0.000000 +1773, 1.000000, 0.000000, 0.000000, 0.000000 +1774, 1.000000, 0.000000, 0.000000, 0.000000 +1775, 1.000000, 0.000000, 0.000000, 0.000000 +1776, 1.000000, 0.000000, 0.000000, 0.000000 +1777, 1.000000, 0.000000, 0.000000, 0.000000 +1778, 1.000000, 0.000000, 0.000000, 0.000000 +1779, 1.000000, 0.000000, 0.000000, 0.000000 +1780, 1.000000, 0.000000, 0.000000, 0.000000 +1781, 1.000000, 0.000000, 0.000000, 0.000000 +1782, 1.000000, 0.000000, 0.000000, 0.000000 +1783, 1.000000, 0.000000, 0.000000, 0.000000 +1784, 1.000000, 0.000000, 0.000000, 0.000000 +1785, 1.000000, 0.000000, 0.000000, 0.000000 +1786, 1.000000, 0.000000, 0.000000, 0.000000 +1787, 1.000000, 0.000000, 0.000000, 0.000000 +1788, 1.000000, 0.000000, 0.000000, 0.000000 +1789, 1.000000, 0.000000, 0.000000, 0.000000 +1790, 1.000000, 0.000000, 0.000000, 0.000000 +1791, 1.000000, 0.000000, 0.000000, 0.000000 +1792, 1.000000, 0.000000, 0.000000, 0.000000 +1793, 1.000000, 0.000000, 0.000000, 0.000000 +1794, 1.000000, 0.000000, 0.000000, 0.000000 +1795, 1.000000, 0.000000, 0.000000, 0.000000 +1796, 1.000000, 0.000000, 0.000000, 0.000000 +1797, 1.000000, 0.000000, 0.000000, 0.000000 +1798, 1.000000, 0.000000, 0.000000, 0.000000 +1799, 1.000000, 0.000000, 0.000000, 0.000000 +1800, 1.000000, 0.000000, 0.000000, 0.000000 +1801, 1.000000, 0.000000, 0.000000, 0.000000 +1802, 1.000000, 0.000000, 0.000000, 0.000000 +1803, 1.000000, 0.000000, 0.000000, 0.000000 +1804, 1.000000, 0.000000, 0.000000, 0.000000 +1805, 1.000000, 0.000000, 0.000000, 0.000000 +1806, 1.000000, 0.000000, 0.000000, 0.000000 +1807, 1.000000, 0.000000, 0.000000, 0.000000 +1808, 1.000000, 0.000000, 0.000000, 0.000000 +1809, 1.000000, 0.000000, 0.000000, 0.000000 +1810, 1.000000, 0.000000, 0.000000, 0.000000 +1811, 1.000000, 0.000000, 0.000000, 0.000000 +1812, 1.000000, 0.000000, 0.000000, 0.000000 +1813, 1.000000, 0.000000, 0.000000, 0.000000 +1814, 1.000000, 0.000000, 0.000000, 0.000000 +1815, 1.000000, 0.000000, 0.000000, 0.000000 +1816, 1.000000, 0.000000, 0.000000, 0.000000 +1817, 1.000000, 0.000000, 0.000000, 0.000000 +1818, 1.000000, 0.000000, 0.000000, 0.000000 +1819, 1.000000, 0.000000, 0.000000, 0.000000 +1820, 1.000000, 0.000000, 0.000000, 0.000000 +1821, 1.000000, 0.000000, 0.000000, 0.000000 +1822, 1.000000, 0.000000, 0.000000, 0.000000 +1823, 1.000000, 0.000000, 0.000000, 0.000000 +1824, 1.000000, 0.000000, 0.000000, 0.000000 +1825, 1.000000, 0.000000, 0.000000, 0.000000 +1826, 1.000000, 0.000000, 0.000000, 0.000000 +1827, 1.000000, 0.000000, 0.000000, 0.000000 +1828, 1.000000, 0.000000, 0.000000, 0.000000 +1829, 1.000000, 0.000000, 0.000000, 0.000000 +1830, 1.000000, 0.000000, 0.000000, 0.000000 +1831, 1.000000, 0.000000, 0.000000, 0.000000 +1832, 1.000000, 0.000000, 0.000000, 0.000000 +1833, 1.000000, 0.000000, 0.000000, 0.000000 +1834, 1.000000, 0.000000, 0.000000, 0.000000 +1835, 1.000000, 0.000000, 0.000000, 0.000000 +1836, 1.000000, 0.000000, 0.000000, 0.000000 +1837, 1.000000, 0.000000, 0.000000, 0.000000 +1838, 1.000000, 0.000000, 0.000000, 0.000000 +1839, 1.000000, 0.000000, 0.000000, 0.000000 +1840, 1.000000, 0.000000, 0.000000, 0.000000 +1841, 1.000000, 0.000000, 0.000000, 0.000000 +1842, 1.000000, 0.000000, 0.000000, 0.000000 +1843, 1.000000, 0.000000, 0.000000, 0.000000 +1844, 1.000000, 0.000000, 0.000000, 0.000000 +1845, 1.000000, 0.000000, 0.000000, 0.000000 +1846, 1.000000, 0.000000, 0.000000, 0.000000 +1847, 1.000000, 0.000000, 0.000000, 0.000000 +1848, 1.000000, 0.000000, 0.000000, 0.000000 +1849, 1.000000, 0.000000, 0.000000, 0.000000 +1850, 1.000000, 0.000000, 0.000000, 0.000000 +1851, 1.000000, 0.000000, 0.000000, 0.000000 +1852, 1.000000, 0.000000, 0.000000, 0.000000 +1853, 1.000000, 0.000000, 0.000000, 0.000000 +1854, 1.000000, 0.000000, 0.000000, 0.000000 +1855, 1.000000, 0.000000, 0.000000, 0.000000 +1856, 1.000000, 0.000000, 0.000000, 0.000000 +1857, 1.000000, 0.000000, 0.000000, 0.000000 +1858, 1.000000, 0.000000, 0.000000, 0.000000 +1859, 1.000000, 0.000000, 0.000000, 0.000000 +1860, 1.000000, 0.000000, 0.000000, 0.000000 +1861, 1.000000, 0.000000, 0.000000, 0.000000 +1862, 1.000000, 0.000000, 0.000000, 0.000000 +1863, 1.000000, 0.000000, 0.000000, 0.000000 +1864, 1.000000, 0.000000, 0.000000, 0.000000 +1865, 1.000000, 0.000000, 0.000000, 0.000000 +1866, 1.000000, 0.000000, 0.000000, 0.000000 +1867, 1.000000, 0.000000, 0.000000, 0.000000 +1868, 1.000000, 0.000000, 0.000000, 0.000000 +1869, 1.000000, 0.000000, 0.000000, 0.000000 +1870, 1.000000, 0.000000, 0.000000, 0.000000 +1871, 1.000000, 0.000000, 0.000000, 0.000000 +1872, 1.000000, 0.000000, 0.000000, 0.000000 +1873, 1.000000, 0.000000, 0.000000, 0.000000 +1874, 1.000000, 0.000000, 0.000000, 0.000000 +1875, 1.000000, 0.000000, 0.000000, 0.000000 +1876, 1.000000, 0.000000, 0.000000, 0.000000 +1877, 1.000000, 0.000000, 0.000000, 0.000000 +1878, 1.000000, 0.000000, 0.000000, 0.000000 +1879, 1.000000, 0.000000, 0.000000, 0.000000 +1880, 1.000000, 0.000000, 0.000000, 0.000000 +1881, 1.000000, 0.000000, 0.000000, 0.000000 +1882, 1.000000, 0.000000, 0.000000, 0.000000 +1883, 1.000000, 0.000000, 0.000000, 0.000000 +1884, 1.000000, 0.000000, 0.000000, 0.000000 +1885, 1.000000, 0.000000, 0.000000, 0.000000 +1886, 1.000000, 0.000000, 0.000000, 0.000000 +1887, 1.000000, 0.000000, 0.000000, 0.000000 +1888, 1.000000, 0.000000, 0.000000, 0.000000 +1889, 1.000000, 0.000000, 0.000000, 0.000000 +1890, 1.000000, 0.000000, 0.000000, 0.000000 +1891, 1.000000, 0.000000, 0.000000, 0.000000 +1892, 1.000000, 0.000000, 0.000000, 0.000000 +1893, 1.000000, 0.000000, 0.000000, 0.000000 +1894, 1.000000, 0.000000, 0.000000, 0.000000 +1895, 1.000000, 0.000000, 0.000000, 0.000000 +1896, 1.000000, 0.000000, 0.000000, 0.000000 +1897, 1.000000, 0.000000, 0.000000, 0.000000 +1898, 1.000000, 0.000000, 0.000000, 0.000000 +1899, 1.000000, 0.000000, 0.000000, 0.000000 +1900, 1.000000, 0.000000, 0.000000, 0.000000 +1901, 1.000000, 0.000000, 0.000000, 0.000000 +1902, 1.000000, 0.000000, 0.000000, 0.000000 +1903, 1.000000, 0.000000, 0.000000, 0.000000 +1904, 1.000000, 0.000000, 0.000000, 0.000000 +1905, 1.000000, 0.000000, 0.000000, 0.000000 +1906, 1.000000, 0.000000, 0.000000, 0.000000 +1907, 1.000000, 0.000000, 0.000000, 0.000000 +1908, 1.000000, 0.000000, 0.000000, 0.000000 +1909, 1.000000, 0.000000, 0.000000, 0.000000 +1910, 1.000000, 0.000000, 0.000000, 0.000000 +1911, 1.000000, 0.000000, 0.000000, 0.000000 +1912, 1.000000, 0.000000, 0.000000, 0.000000 +1913, 1.000000, 0.000000, 0.000000, 0.000000 +1914, 1.000000, 0.000000, 0.000000, 0.000000 +1915, 1.000000, 0.000000, 0.000000, 0.000000 +1916, 1.000000, 0.000000, 0.000000, 0.000000 +1917, 1.000000, 0.000000, 0.000000, 0.000000 +1918, 1.000000, 0.000000, 0.000000, 0.000000 +1919, 1.000000, 0.000000, 0.000000, 0.000000 +1920, 1.000000, 0.000000, 0.000000, 0.000000 +1921, 1.000000, 0.000000, 0.000000, 0.000000 +1922, 1.000000, 0.000000, 0.000000, 0.000000 +1923, 1.000000, 0.000000, 0.000000, 0.000000 +1924, 1.000000, 0.000000, 0.000000, 0.000000 +1925, 1.000000, 0.000000, 0.000000, 0.000000 +1926, 1.000000, 0.000000, 0.000000, 0.000000 +1927, 1.000000, 0.000000, 0.000000, 0.000000 +1928, 1.000000, 0.000000, 0.000000, 0.000000 +1929, 1.000000, 0.000000, 0.000000, 0.000000 +1930, 1.000000, 0.000000, 0.000000, 0.000000 +1931, 1.000000, 0.000000, 0.000000, 0.000000 +1932, 1.000000, 0.000000, 0.000000, 0.000000 +1933, 1.000000, 0.000000, 0.000000, 0.000000 +1934, 1.000000, 0.000000, 0.000000, 0.000000 +1935, 1.000000, 0.000000, 0.000000, 0.000000 +1936, 1.000000, 0.000000, 0.000000, 0.000000 +1937, 1.000000, 0.000000, 0.000000, 0.000000 +1938, 1.000000, 0.000000, 0.000000, 0.000000 +1939, 1.000000, 0.000000, 0.000000, 0.000000 +1940, 1.000000, 0.000000, 0.000000, 0.000000 +1941, 1.000000, 0.000000, 0.000000, 0.000000 +1942, 1.000000, 0.000000, 0.000000, 0.000000 +1943, 1.000000, 0.000000, 0.000000, 0.000000 +1944, 1.000000, 0.000000, 0.000000, 0.000000 +1945, 1.000000, 0.000000, 0.000000, 0.000000 +1946, 1.000000, 0.000000, 0.000000, 0.000000 +1947, 1.000000, 0.000000, 0.000000, 0.000000 +1948, 1.000000, 0.000000, 0.000000, 0.000000 +1949, 1.000000, 0.000000, 0.000000, 0.000000 +1950, 1.000000, 0.000000, 0.000000, 0.000000 +1951, 1.000000, 0.000000, 0.000000, 0.000000 +1952, 1.000000, 0.000000, 0.000000, 0.000000 +1953, 1.000000, 0.000000, 0.000000, 0.000000 +1954, 1.000000, 0.000000, 0.000000, 0.000000 +1955, 1.000000, 0.000000, 0.000000, 0.000000 +1956, 1.000000, 0.000000, 0.000000, 0.000000 +1957, 1.000000, 0.000000, 0.000000, 0.000000 +1958, 1.000000, 0.000000, 0.000000, 0.000000 +1959, 1.000000, 0.000000, 0.000000, 0.000000 +1960, 1.000000, 0.000000, 0.000000, 0.000000 +1961, 1.000000, 0.000000, 0.000000, 0.000000 +1962, 1.000000, 0.000000, 0.000000, 0.000000 +1963, 1.000000, 0.000000, 0.000000, 0.000000 +1964, 1.000000, 0.000000, 0.000000, 0.000000 +1965, 1.000000, 0.000000, 0.000000, 0.000000 +1966, 1.000000, 0.000000, 0.000000, 0.000000 +1967, 1.000000, 0.000000, 0.000000, 0.000000 +1968, 1.000000, 0.000000, 0.000000, 0.000000 +1969, 1.000000, 0.000000, 0.000000, 0.000000 +1970, 1.000000, 0.000000, 0.000000, 0.000000 +1971, 1.000000, 0.000000, 0.000000, 0.000000 +1972, 1.000000, 0.000000, 0.000000, 0.000000 +1973, 1.000000, 0.000000, 0.000000, 0.000000 +1974, 1.000000, 0.000000, 0.000000, 0.000000 +1975, 1.000000, 0.000000, 0.000000, 0.000000 +1976, 1.000000, 0.000000, 0.000000, 0.000000 +1977, 1.000000, 0.000000, 0.000000, 0.000000 +1978, 1.000000, 0.000000, 0.000000, 0.000000 +1979, 1.000000, 0.000000, 0.000000, 0.000000 +1980, 1.000000, 0.000000, 0.000000, 0.000000 +1981, 1.000000, 0.000000, 0.000000, 0.000000 +1982, 1.000000, 0.000000, 0.000000, 0.000000 +1983, 1.000000, 0.000000, 0.000000, 0.000000 +1984, 1.000000, 0.000000, 0.000000, 0.000000 +1985, 1.000000, 0.000000, 0.000000, 0.000000 +1986, 1.000000, 0.000000, 0.000000, 0.000000 +1987, 1.000000, 0.000000, 0.000000, 0.000000 +1988, 1.000000, 0.000000, 0.000000, 0.000000 +1989, 1.000000, 0.000000, 0.000000, 0.000000 +1990, 1.000000, 0.000000, 0.000000, 0.000000 +1991, 1.000000, 0.000000, 0.000000, 0.000000 +1992, 1.000000, 0.000000, 0.000000, 0.000000 +1993, 1.000000, 0.000000, 0.000000, 0.000000 +1994, 1.000000, 0.000000, 0.000000, 0.000000 +1995, 1.000000, 0.000000, 0.000000, 0.000000 +1996, 1.000000, 0.000000, 0.000000, 0.000000 +1997, 1.000000, 0.000000, 0.000000, 0.000000 +1998, 1.000000, 0.000000, 0.000000, 0.000000 +1999, 1.000000, 0.000000, 0.000000, 0.000000 +2000, 1.000000, 0.000000, 0.000000, 0.000000 +2001, 1.000000, 0.000000, 0.000000, 0.000000 +2002, 1.000000, 0.000000, 0.000000, 0.000000 +2003, 1.000000, 0.000000, 0.000000, 0.000000 +2004, 1.000000, 0.000000, 0.000000, 0.000000 +2005, 1.000000, 0.000000, 0.000000, 0.000000 +2006, 1.000000, 0.000000, 0.000000, 0.000000 +2007, 1.000000, 0.000000, 0.000000, 0.000000 +2008, 1.000000, 0.000000, 0.000000, 0.000000 +2009, 1.000000, 0.000000, 0.000000, 0.000000 +2010, 1.000000, 0.000000, 0.000000, 0.000000 +2011, 1.000000, 0.000000, 0.000000, 0.000000 +2012, 1.000000, 0.000000, 0.000000, 0.000000 +2013, 1.000000, 0.000000, 0.000000, 0.000000 +2014, 1.000000, 0.000000, 0.000000, 0.000000 +2015, 1.000000, 0.000000, 0.000000, 0.000000 +2016, 1.000000, 0.000000, 0.000000, 0.000000 +2017, 1.000000, 0.000000, 0.000000, 0.000000 +2018, 1.000000, 0.000000, 0.000000, 0.000000 +2019, 1.000000, 0.000000, 0.000000, 0.000000 +2020, 1.000000, 0.000000, 0.000000, 0.000000 +2021, 1.000000, 0.000000, 0.000000, 0.000000 +2022, 1.000000, 0.000000, 0.000000, 0.000000 +2023, 1.000000, 0.000000, 0.000000, 0.000000 +2024, 1.000000, 0.000000, 0.000000, 0.000000 +2025, 1.000000, 0.000000, 0.000000, 0.000000 +2026, 1.000000, 0.000000, 0.000000, 0.000000 +2027, 1.000000, 0.000000, 0.000000, 0.000000 +2028, 1.000000, 0.000000, 0.000000, 0.000000 +2029, 1.000000, 0.000000, 0.000000, 0.000000 +2030, 1.000000, 0.000000, 0.000000, 0.000000 +2031, 1.000000, 0.000000, 0.000000, 0.000000 +2032, 1.000000, 0.000000, 0.000000, 0.000000 +2033, 1.000000, 0.000000, 0.000000, 0.000000 +2034, 1.000000, 0.000000, 0.000000, 0.000000 +2035, 1.000000, 0.000000, 0.000000, 0.000000 +2036, 1.000000, 0.000000, 0.000000, 0.000000 +2037, 1.000000, 0.000000, 0.000000, 0.000000 +2038, 1.000000, 0.000000, 0.000000, 0.000000 +2039, 1.000000, 0.000000, 0.000000, 0.000000 +2040, 1.000000, 0.000000, 0.000000, 0.000000 +2041, 1.000000, 0.000000, 0.000000, 0.000000 +2042, 1.000000, 0.000000, 0.000000, 0.000000 +2043, 1.000000, 0.000000, 0.000000, 0.000000 +2044, 1.000000, 0.000000, 0.000000, 0.000000 +2045, 1.000000, 0.000000, 0.000000, 0.000000 +2046, 1.000000, 0.000000, 0.000000, 0.000000 +2047, 1.000000, 0.000000, 0.000000, 0.000000 +2048, 1.000000, 0.000000, 0.000000, 0.000000 +2049, 1.000000, 0.000000, 0.000000, 0.000000 +2050, 1.000000, 0.000000, 0.000000, 0.000000 +2051, 1.000000, 0.000000, 0.000000, 0.000000 +2052, 1.000000, 0.000000, 0.000000, 0.000000 +2053, 1.000000, 0.000000, 0.000000, 0.000000 +2054, 1.000000, 0.000000, 0.000000, 0.000000 +2055, 1.000000, 0.000000, 0.000000, 0.000000 +2056, 1.000000, 0.000000, 0.000000, 0.000000 +2057, 1.000000, 0.000000, 0.000000, 0.000000 +2058, 1.000000, 0.000000, 0.000000, 0.000000 +2059, 1.000000, 0.000000, 0.000000, 0.000000 +2060, 1.000000, 0.000000, 0.000000, 0.000000 +2061, 1.000000, 0.000000, 0.000000, 0.000000 +2062, 1.000000, 0.000000, 0.000000, 0.000000 +2063, 1.000000, 0.000000, 0.000000, 0.000000 +2064, 1.000000, 0.000000, 0.000000, 0.000000 +2065, 1.000000, 0.000000, 0.000000, 0.000000 +2066, 1.000000, 0.000000, 0.000000, 0.000000 +2067, 1.000000, 0.000000, 0.000000, 0.000000 +2068, 1.000000, 0.000000, 0.000000, 0.000000 +2069, 1.000000, 0.000000, 0.000000, 0.000000 +2070, 1.000000, 0.000000, 0.000000, 0.000000 +2071, 1.000000, 0.000000, 0.000000, 0.000000 +2072, 1.000000, 0.000000, 0.000000, 0.000000 +2073, 1.000000, 0.000000, 0.000000, 0.000000 +2074, 1.000000, 0.000000, 0.000000, 0.000000 +2075, 1.000000, 0.000000, 0.000000, 0.000000 +2076, 1.000000, 0.000000, 0.000000, 0.000000 +2077, 1.000000, 0.000000, 0.000000, 0.000000 +2078, 1.000000, 0.000000, 0.000000, 0.000000 +2079, 1.000000, 0.000000, 0.000000, 0.000000 +2080, 1.000000, 0.000000, 0.000000, 0.000000 +2081, 1.000000, 0.000000, 0.000000, 0.000000 +2082, 1.000000, 0.000000, 0.000000, 0.000000 +2083, 1.000000, 0.000000, 0.000000, 0.000000 +2084, 1.000000, 0.000000, 0.000000, 0.000000 +2085, 1.000000, 0.000000, 0.000000, 0.000000 +2086, 1.000000, 0.000000, 0.000000, 0.000000 +2087, 1.000000, 0.000000, 0.000000, 0.000000 +2088, 1.000000, 0.000000, 0.000000, 0.000000 +2089, 1.000000, 0.000000, 0.000000, 0.000000 +2090, 1.000000, 0.000000, 0.000000, 0.000000 +2091, 1.000000, 0.000000, 0.000000, 0.000000 +2092, 1.000000, 0.000000, 0.000000, 0.000000 +2093, 1.000000, 0.000000, 0.000000, 0.000000 +2094, 1.000000, 0.000000, 0.000000, 0.000000 +2095, 1.000000, 0.000000, 0.000000, 0.000000 +2096, 1.000000, 0.000000, 0.000000, 0.000000 +2097, 1.000000, 0.000000, 0.000000, 0.000000 +2098, 1.000000, 0.000000, 0.000000, 0.000000 +2099, 1.000000, 0.000000, 0.000000, 0.000000 +2100, 1.000000, 0.000000, 0.000000, 0.000000 +2101, 1.000000, 0.000000, 0.000000, 0.000000 +2102, 1.000000, 0.000000, 0.000000, 0.000000 +2103, 1.000000, 0.000000, 0.000000, 0.000000 +2104, 1.000000, 0.000000, 0.000000, 0.000000 +2105, 1.000000, 0.000000, 0.000000, 0.000000 +2106, 1.000000, 0.000000, 0.000000, 0.000000 +2107, 1.000000, 0.000000, 0.000000, 0.000000 +2108, 1.000000, 0.000000, 0.000000, 0.000000 +2109, 1.000000, 0.000000, 0.000000, 0.000000 +2110, 1.000000, 0.000000, 0.000000, 0.000000 +2111, 1.000000, 0.000000, 0.000000, 0.000000 +2112, 1.000000, 0.000000, 0.000000, 0.000000 +2113, 1.000000, 0.000000, 0.000000, 0.000000 +2114, 1.000000, 0.000000, 0.000000, 0.000000 +2115, 1.000000, 0.000000, 0.000000, 0.000000 +2116, 1.000000, 0.000000, 0.000000, 0.000000 +2117, 1.000000, 0.000000, 0.000000, 0.000000 +2118, 1.000000, 0.000000, 0.000000, 0.000000 +2119, 1.000000, 0.000000, 0.000000, 0.000000 +2120, 1.000000, 0.000000, 0.000000, 0.000000 +2121, 1.000000, 0.000000, 0.000000, 0.000000 +2122, 1.000000, 0.000000, 0.000000, 0.000000 +2123, 1.000000, 0.000000, 0.000000, 0.000000 +2124, 1.000000, 0.000000, 0.000000, 0.000000 +2125, 1.000000, 0.000000, 0.000000, 0.000000 +2126, 1.000000, 0.000000, 0.000000, 0.000000 +2127, 1.000000, 0.000000, 0.000000, 0.000000 +2128, 1.000000, 0.000000, 0.000000, 0.000000 +2129, 1.000000, 0.000000, 0.000000, 0.000000 +2130, 1.000000, 0.000000, 0.000000, 0.000000 +2131, 1.000000, 0.000000, 0.000000, 0.000000 +2132, 1.000000, 0.000000, 0.000000, 0.000000 +2133, 1.000000, 0.000000, 0.000000, 0.000000 +2134, 1.000000, 0.000000, 0.000000, 0.000000 +2135, 1.000000, 0.000000, 0.000000, 0.000000 +2136, 1.000000, 0.000000, 0.000000, 0.000000 +2137, 1.000000, 0.000000, 0.000000, 0.000000 +2138, 1.000000, 0.000000, 0.000000, 0.000000 +2139, 1.000000, 0.000000, 0.000000, 0.000000 +2140, 1.000000, 0.000000, 0.000000, 0.000000 +2141, 1.000000, 0.000000, 0.000000, 0.000000 +2142, 1.000000, 0.000000, 0.000000, 0.000000 +2143, 1.000000, 0.000000, 0.000000, 0.000000 +2144, 1.000000, 0.000000, 0.000000, 0.000000 +2145, 1.000000, 0.000000, 0.000000, 0.000000 +2146, 1.000000, 0.000000, 0.000000, 0.000000 +2147, 1.000000, 0.000000, 0.000000, 0.000000 +2148, 1.000000, 0.000000, 0.000000, 0.000000 +2149, 1.000000, 0.000000, 0.000000, 0.000000 +2150, 1.000000, 0.000000, 0.000000, 0.000000 +2151, 1.000000, 0.000000, 0.000000, 0.000000 +2152, 1.000000, 0.000000, 0.000000, 0.000000 +2153, 1.000000, 0.000000, 0.000000, 0.000000 +2154, 1.000000, 0.000000, 0.000000, 0.000000 +2155, 1.000000, 0.000000, 0.000000, 0.000000 +2156, 1.000000, 0.000000, 0.000000, 0.000000 +2157, 1.000000, 0.000000, 0.000000, 0.000000 +2158, 1.000000, 0.000000, 0.000000, 0.000000 +2159, 1.000000, 0.000000, 0.000000, 0.000000 +2160, 1.000000, 0.000000, 0.000000, 0.000000 +2161, 1.000000, 0.000000, 0.000000, 0.000000 +2162, 1.000000, 0.000000, 0.000000, 0.000000 +2163, 1.000000, 0.000000, 0.000000, 0.000000 +2164, 1.000000, 0.000000, 0.000000, 0.000000 +2165, 1.000000, 0.000000, 0.000000, 0.000000 +2166, 1.000000, 0.000000, 0.000000, 0.000000 +2167, 1.000000, 0.000000, 0.000000, 0.000000 +2168, 1.000000, 0.000000, 0.000000, 0.000000 +2169, 1.000000, 0.000000, 0.000000, 0.000000 +2170, 1.000000, 0.000000, 0.000000, 0.000000 +2171, 1.000000, 0.000000, 0.000000, 0.000000 +2172, 1.000000, 0.000000, 0.000000, 0.000000 +2173, 1.000000, 0.000000, 0.000000, 0.000000 +2174, 1.000000, 0.000000, 0.000000, 0.000000 +2175, 1.000000, 0.000000, 0.000000, 0.000000 +2176, 1.000000, 0.000000, 0.000000, 0.000000 +2177, 1.000000, 0.000000, 0.000000, 0.000000 +2178, 1.000000, 0.000000, 0.000000, 0.000000 +2179, 1.000000, 0.000000, 0.000000, 0.000000 +2180, 1.000000, 0.000000, 0.000000, 0.000000 +2181, 1.000000, 0.000000, 0.000000, 0.000000 +2182, 1.000000, 0.000000, 0.000000, 0.000000 +2183, 1.000000, 0.000000, 0.000000, 0.000000 +2184, 1.000000, 0.000000, 0.000000, 0.000000 +2185, 1.000000, 0.000000, 0.000000, 0.000000 +2186, 1.000000, 0.000000, 0.000000, 0.000000 +2187, 1.000000, 0.000000, 0.000000, 0.000000 +2188, 1.000000, 0.000000, 0.000000, 0.000000 +2189, 1.000000, 0.000000, 0.000000, 0.000000 +2190, 1.000000, 0.000000, 0.000000, 0.000000 +2191, 1.000000, 0.000000, 0.000000, 0.000000 +2192, 1.000000, 0.000000, 0.000000, 0.000000 +2193, 1.000000, 0.000000, 0.000000, 0.000000 +2194, 1.000000, 0.000000, 0.000000, 0.000000 +2195, 1.000000, 0.000000, 0.000000, 0.000000 +2196, 1.000000, 0.000000, 0.000000, 0.000000 +2197, 1.000000, 0.000000, 0.000000, 0.000000 +2198, 1.000000, 0.000000, 0.000000, 0.000000 +2199, 1.000000, 0.000000, 0.000000, 0.000000 +2200, 1.000000, 0.000000, 0.000000, 0.000000 +2201, 1.000000, 0.000000, 0.000000, 0.000000 +2202, 1.000000, 0.000000, 0.000000, 0.000000 +2203, 1.000000, 0.000000, 0.000000, 0.000000 +2204, 1.000000, 0.000000, 0.000000, 0.000000 +2205, 1.000000, 0.000000, 0.000000, 0.000000 +2206, 1.000000, 0.000000, 0.000000, 0.000000 +2207, 1.000000, 0.000000, 0.000000, 0.000000 +2208, 1.000000, 0.000000, 0.000000, 0.000000 +2209, 1.000000, 0.000000, 0.000000, 0.000000 +2210, 1.000000, 0.000000, 0.000000, 0.000000 +2211, 1.000000, 0.000000, 0.000000, 0.000000 +2212, 1.000000, 0.000000, 0.000000, 0.000000 +2213, 1.000000, 0.000000, 0.000000, 0.000000 +2214, 1.000000, 0.000000, 0.000000, 0.000000 +2215, 1.000000, 0.000000, 0.000000, 0.000000 +2216, 1.000000, 0.000000, 0.000000, 0.000000 +2217, 1.000000, 0.000000, 0.000000, 0.000000 +2218, 1.000000, 0.000000, 0.000000, 0.000000 +2219, 1.000000, 0.000000, 0.000000, 0.000000 +2220, 1.000000, 0.000000, 0.000000, 0.000000 +2221, 1.000000, 0.000000, 0.000000, 0.000000 +2222, 1.000000, 0.000000, 0.000000, 0.000000 +2223, 1.000000, 0.000000, 0.000000, 0.000000 +2224, 1.000000, 0.000000, 0.000000, 0.000000 +2225, 1.000000, 0.000000, 0.000000, 0.000000 +2226, 1.000000, 0.000000, 0.000000, 0.000000 +2227, 1.000000, 0.000000, 0.000000, 0.000000 +2228, 1.000000, 0.000000, 0.000000, 0.000000 +2229, 1.000000, 0.000000, 0.000000, 0.000000 +2230, 1.000000, 0.000000, 0.000000, 0.000000 +2231, 1.000000, 0.000000, 0.000000, 0.000000 +2232, 1.000000, 0.000000, 0.000000, 0.000000 +2233, 1.000000, 0.000000, 0.000000, 0.000000 +2234, 1.000000, 0.000000, 0.000000, 0.000000 +2235, 1.000000, 0.000000, 0.000000, 0.000000 +2236, 1.000000, 0.000000, 0.000000, 0.000000 +2237, 1.000000, 0.000000, 0.000000, 0.000000 +2238, 1.000000, 0.000000, 0.000000, 0.000000 +2239, 1.000000, 0.000000, 0.000000, 0.000000 +2240, 1.000000, 0.000000, 0.000000, 0.000000 +2241, 1.000000, 0.000000, 0.000000, 0.000000 +2242, 1.000000, 0.000000, 0.000000, 0.000000 +2243, 1.000000, 0.000000, 0.000000, 0.000000 +2244, 1.000000, 0.000000, 0.000000, 0.000000 +2245, 1.000000, 0.000000, 0.000000, 0.000000 +2246, 1.000000, 0.000000, 0.000000, 0.000000 +2247, 1.000000, 0.000000, 0.000000, 0.000000 +2248, 1.000000, 0.000000, 0.000000, 0.000000 +2249, 1.000000, 0.000000, 0.000000, 0.000000 +2250, 1.000000, 0.000000, 0.000000, 0.000000 +2251, 1.000000, 0.000000, 0.000000, 0.000000 +2252, 1.000000, 0.000000, 0.000000, 0.000000 +2253, 1.000000, 0.000000, 0.000000, 0.000000 +2254, 1.000000, 0.000000, 0.000000, 0.000000 +2255, 1.000000, 0.000000, 0.000000, 0.000000 +2256, 1.000000, 0.000000, 0.000000, 0.000000 +2257, 1.000000, 0.000000, 0.000000, 0.000000 +2258, 1.000000, 0.000000, 0.000000, 0.000000 +2259, 1.000000, 0.000000, 0.000000, 0.000000 +2260, 1.000000, 0.000000, 0.000000, 0.000000 +2261, 1.000000, 0.000000, 0.000000, 0.000000 +2262, 1.000000, 0.000000, 0.000000, 0.000000 +2263, 1.000000, 0.000000, 0.000000, 0.000000 +2264, 1.000000, 0.000000, 0.000000, 0.000000 +2265, 1.000000, 0.000000, 0.000000, 0.000000 +2266, 1.000000, 0.000000, 0.000000, 0.000000 +2267, 1.000000, 0.000000, 0.000000, 0.000000 +2268, 1.000000, 0.000000, 0.000000, 0.000000 +2269, 1.000000, 0.000000, 0.000000, 0.000000 +2270, 1.000000, 0.000000, 0.000000, 0.000000 +2271, 1.000000, 0.000000, 0.000000, 0.000000 +2272, 1.000000, 0.000000, 0.000000, 0.000000 +2273, 1.000000, 0.000000, 0.000000, 0.000000 +2274, 1.000000, 0.000000, 0.000000, 0.000000 +2275, 1.000000, 0.000000, 0.000000, 0.000000 +2276, 1.000000, 0.000000, 0.000000, 0.000000 +2277, 1.000000, 0.000000, 0.000000, 0.000000 +2278, 1.000000, 0.000000, 0.000000, 0.000000 +2279, 1.000000, 0.000000, 0.000000, 0.000000 +2280, 1.000000, 0.000000, 0.000000, 0.000000 +2281, 1.000000, 0.000000, 0.000000, 0.000000 +2282, 1.000000, 0.000000, 0.000000, 0.000000 +2283, 1.000000, 0.000000, 0.000000, 0.000000 +2284, 1.000000, 0.000000, 0.000000, 0.000000 +2285, 1.000000, 0.000000, 0.000000, 0.000000 +2286, 1.000000, 0.000000, 0.000000, 0.000000 +2287, 1.000000, 0.000000, 0.000000, 0.000000 +2288, 1.000000, 0.000000, 0.000000, 0.000000 +2289, 1.000000, 0.000000, 0.000000, 0.000000 +2290, 1.000000, 0.000000, 0.000000, 0.000000 +2291, 1.000000, 0.000000, 0.000000, 0.000000 +2292, 1.000000, 0.000000, 0.000000, 0.000000 +2293, 1.000000, 0.000000, 0.000000, 0.000000 +2294, 1.000000, 0.000000, 0.000000, 0.000000 +2295, 1.000000, 0.000000, 0.000000, 0.000000 +2296, 1.000000, 0.000000, 0.000000, 0.000000 +2297, 1.000000, 0.000000, 0.000000, 0.000000 +2298, 1.000000, 0.000000, 0.000000, 0.000000 +2299, 1.000000, 0.000000, 0.000000, 0.000000 +2300, 1.000000, 0.000000, 0.000000, 0.000000 +2301, 1.000000, 0.000000, 0.000000, 0.000000 +2302, 1.000000, 0.000000, 0.000000, 0.000000 +2303, 1.000000, 0.000000, 0.000000, 0.000000 +2304, 1.000000, 0.000000, 0.000000, 0.000000 +2305, 1.000000, 0.000000, 0.000000, 0.000000 +2306, 1.000000, 0.000000, 0.000000, 0.000000 +2307, 1.000000, 0.000000, 0.000000, 0.000000 +2308, 1.000000, 0.000000, 0.000000, 0.000000 +2309, 1.000000, 0.000000, 0.000000, 0.000000 +2310, 1.000000, 0.000000, 0.000000, 0.000000 +2311, 1.000000, 0.000000, 0.000000, 0.000000 +2312, 1.000000, 0.000000, 0.000000, 0.000000 +2313, 1.000000, 0.000000, 0.000000, 0.000000 +2314, 1.000000, 0.000000, 0.000000, 0.000000 +2315, 1.000000, 0.000000, 0.000000, 0.000000 +2316, 1.000000, 0.000000, 0.000000, 0.000000 +2317, 1.000000, 0.000000, 0.000000, 0.000000 +2318, 1.000000, 0.000000, 0.000000, 0.000000 +2319, 1.000000, 0.000000, 0.000000, 0.000000 +2320, 1.000000, 0.000000, 0.000000, 0.000000 +2321, 1.000000, 0.000000, 0.000000, 0.000000 +2322, 1.000000, 0.000000, 0.000000, 0.000000 +2323, 1.000000, 0.000000, 0.000000, 0.000000 +2324, 1.000000, 0.000000, 0.000000, 0.000000 +2325, 1.000000, 0.000000, 0.000000, 0.000000 +2326, 1.000000, 0.000000, 0.000000, 0.000000 +2327, 1.000000, 0.000000, 0.000000, 0.000000 +2328, 1.000000, 0.000000, 0.000000, 0.000000 +2329, 1.000000, 0.000000, 0.000000, 0.000000 +2330, 1.000000, 0.000000, 0.000000, 0.000000 +2331, 1.000000, 0.000000, 0.000000, 0.000000 +2332, 1.000000, 0.000000, 0.000000, 0.000000 +2333, 1.000000, 0.000000, 0.000000, 0.000000 +2334, 1.000000, 0.000000, 0.000000, 0.000000 +2335, 1.000000, 0.000000, 0.000000, 0.000000 +2336, 1.000000, 0.000000, 0.000000, 0.000000 +2337, 1.000000, 0.000000, 0.000000, 0.000000 +2338, 1.000000, 0.000000, 0.000000, 0.000000 +2339, 1.000000, 0.000000, 0.000000, 0.000000 +2340, 1.000000, 0.000000, 0.000000, 0.000000 +2341, 1.000000, 0.000000, 0.000000, 0.000000 +2342, 1.000000, 0.000000, 0.000000, 0.000000 +2343, 1.000000, 0.000000, 0.000000, 0.000000 +2344, 1.000000, 0.000000, 0.000000, 0.000000 +2345, 1.000000, 0.000000, 0.000000, 0.000000 +2346, 1.000000, 0.000000, 0.000000, 0.000000 +2347, 1.000000, 0.000000, 0.000000, 0.000000 +2348, 1.000000, 0.000000, 0.000000, 0.000000 +2349, 1.000000, 0.000000, 0.000000, 0.000000 +2350, 1.000000, 0.000000, 0.000000, 0.000000 +2351, 1.000000, 0.000000, 0.000000, 0.000000 +2352, 1.000000, 0.000000, 0.000000, 0.000000 +2353, 1.000000, 0.000000, 0.000000, 0.000000 +2354, 1.000000, 0.000000, 0.000000, 0.000000 +2355, 1.000000, 0.000000, 0.000000, 0.000000 +2356, 1.000000, 0.000000, 0.000000, 0.000000 +2357, 1.000000, 0.000000, 0.000000, 0.000000 +2358, 1.000000, 0.000000, 0.000000, 0.000000 +2359, 1.000000, 0.000000, 0.000000, 0.000000 +2360, 1.000000, 0.000000, 0.000000, 0.000000 +2361, 1.000000, 0.000000, 0.000000, 0.000000 +2362, 1.000000, 0.000000, 0.000000, 0.000000 +2363, 1.000000, 0.000000, 0.000000, 0.000000 +2364, 1.000000, 0.000000, 0.000000, 0.000000 +2365, 1.000000, 0.000000, 0.000000, 0.000000 +2366, 1.000000, 0.000000, 0.000000, 0.000000 +2367, 1.000000, 0.000000, 0.000000, 0.000000 +2368, 1.000000, 0.000000, 0.000000, 0.000000 +2369, 1.000000, 0.000000, 0.000000, 0.000000 +2370, 1.000000, 0.000000, 0.000000, 0.000000 +2371, 1.000000, 0.000000, 0.000000, 0.000000 +2372, 1.000000, 0.000000, 0.000000, 0.000000 +2373, 1.000000, 0.000000, 0.000000, 0.000000 +2374, 1.000000, 0.000000, 0.000000, 0.000000 +2375, 1.000000, 0.000000, 0.000000, 0.000000 +2376, 1.000000, 0.000000, 0.000000, 0.000000 +2377, 1.000000, 0.000000, 0.000000, 0.000000 +2378, 1.000000, 0.000000, 0.000000, 0.000000 +2379, 1.000000, 0.000000, 0.000000, 0.000000 +2380, 1.000000, 0.000000, 0.000000, 0.000000 +2381, 1.000000, 0.000000, 0.000000, 0.000000 +2382, 1.000000, 0.000000, 0.000000, 0.000000 +2383, 1.000000, 0.000000, 0.000000, 0.000000 +2384, 1.000000, 0.000000, 0.000000, 0.000000 +2385, 1.000000, 0.000000, 0.000000, 0.000000 +2386, 1.000000, 0.000000, 0.000000, 0.000000 +2387, 1.000000, 0.000000, 0.000000, 0.000000 +2388, 1.000000, 0.000000, 0.000000, 0.000000 +2389, 1.000000, 0.000000, 0.000000, 0.000000 +2390, 1.000000, 0.000000, 0.000000, 0.000000 +2391, 1.000000, 0.000000, 0.000000, 0.000000 +2392, 1.000000, 0.000000, 0.000000, 0.000000 +2393, 1.000000, 0.000000, 0.000000, 0.000000 +2394, 1.000000, 0.000000, 0.000000, 0.000000 +2395, 1.000000, 0.000000, 0.000000, 0.000000 +2396, 1.000000, 0.000000, 0.000000, 0.000000 +2397, 1.000000, 0.000000, 0.000000, 0.000000 +2398, 1.000000, 0.000000, 0.000000, 0.000000 +2399, 1.000000, 0.000000, 0.000000, 0.000000 +2400, 1.000000, 0.000000, 0.000000, 0.000000 +2401, 1.000000, 0.000000, 0.000000, 0.000000 +2402, 1.000000, 0.000000, 0.000000, 0.000000 +2403, 1.000000, 0.000000, 0.000000, 0.000000 +2404, 1.000000, 0.000000, 0.000000, 0.000000 +2405, 1.000000, 0.000000, 0.000000, 0.000000 +2406, 1.000000, 0.000000, 0.000000, 0.000000 +2407, 1.000000, 0.000000, 0.000000, 0.000000 +2408, 1.000000, 0.000000, 0.000000, 0.000000 +2409, 1.000000, 0.000000, 0.000000, 0.000000 +2410, 1.000000, 0.000000, 0.000000, 0.000000 +2411, 1.000000, 0.000000, 0.000000, 0.000000 +2412, 1.000000, 0.000000, 0.000000, 0.000000 +2413, 1.000000, 0.000000, 0.000000, 0.000000 +2414, 1.000000, 0.000000, 0.000000, 0.000000 +2415, 1.000000, 0.000000, 0.000000, 0.000000 +2416, 1.000000, 0.000000, 0.000000, 0.000000 +2417, 1.000000, 0.000000, 0.000000, 0.000000 +2418, 1.000000, 0.000000, 0.000000, 0.000000 +2419, 1.000000, 0.000000, 0.000000, 0.000000 +2420, 1.000000, 0.000000, 0.000000, 0.000000 +2421, 1.000000, 0.000000, 0.000000, 0.000000 +2422, 1.000000, 0.000000, 0.000000, 0.000000 +2423, 1.000000, 0.000000, 0.000000, 0.000000 +2424, 1.000000, 0.000000, 0.000000, 0.000000 +2425, 1.000000, 0.000000, 0.000000, 0.000000 +2426, 1.000000, 0.000000, 0.000000, 0.000000 +2427, 1.000000, 0.000000, 0.000000, 0.000000 +2428, 1.000000, 0.000000, 0.000000, 0.000000 +2429, 1.000000, 0.000000, 0.000000, 0.000000 +2430, 1.000000, 0.000000, 0.000000, 0.000000 +2431, 1.000000, 0.000000, 0.000000, 0.000000 +2432, 1.000000, 0.000000, 0.000000, 0.000000 +2433, 1.000000, 0.000000, 0.000000, 0.000000 +2434, 1.000000, 0.000000, 0.000000, 0.000000 +2435, 1.000000, 0.000000, 0.000000, 0.000000 +2436, 1.000000, 0.000000, 0.000000, 0.000000 +2437, 1.000000, 0.000000, 0.000000, 0.000000 +2438, 1.000000, 0.000000, 0.000000, 0.000000 +2439, 1.000000, 0.000000, 0.000000, 0.000000 +2440, 1.000000, 0.000000, 0.000000, 0.000000 +2441, 1.000000, 0.000000, 0.000000, 0.000000 +2442, 1.000000, 0.000000, 0.000000, 0.000000 +2443, 1.000000, 0.000000, 0.000000, 0.000000 +2444, 1.000000, 0.000000, 0.000000, 0.000000 +2445, 1.000000, 0.000000, 0.000000, 0.000000 +2446, 1.000000, 0.000000, 0.000000, 0.000000 +2447, 1.000000, 0.000000, 0.000000, 0.000000 +2448, 1.000000, 0.000000, 0.000000, 0.000000 +2449, 1.000000, 0.000000, 0.000000, 0.000000 +2450, 1.000000, 0.000000, 0.000000, 0.000000 +2451, 1.000000, 0.000000, 0.000000, 0.000000 +2452, 1.000000, 0.000000, 0.000000, 0.000000 +2453, 1.000000, 0.000000, 0.000000, 0.000000 +2454, 1.000000, 0.000000, 0.000000, 0.000000 +2455, 1.000000, 0.000000, 0.000000, 0.000000 +2456, 1.000000, 0.000000, 0.000000, 0.000000 +2457, 1.000000, 0.000000, 0.000000, 0.000000 +2458, 1.000000, 0.000000, 0.000000, 0.000000 +2459, 1.000000, 0.000000, 0.000000, 0.000000 +2460, 1.000000, 0.000000, 0.000000, 0.000000 +2461, 1.000000, 0.000000, 0.000000, 0.000000 +2462, 1.000000, 0.000000, 0.000000, 0.000000 +2463, 1.000000, 0.000000, 0.000000, 0.000000 +2464, 1.000000, 0.000000, 0.000000, 0.000000 +2465, 1.000000, 0.000000, 0.000000, 0.000000 +2466, 1.000000, 0.000000, 0.000000, 0.000000 +2467, 1.000000, 0.000000, 0.000000, 0.000000 +2468, 1.000000, 0.000000, 0.000000, 0.000000 +2469, 1.000000, 0.000000, 0.000000, 0.000000 +2470, 1.000000, 0.000000, 0.000000, 0.000000 +2471, 1.000000, 0.000000, 0.000000, 0.000000 +2472, 1.000000, 0.000000, 0.000000, 0.000000 +2473, 1.000000, 0.000000, 0.000000, 0.000000 +2474, 1.000000, 0.000000, 0.000000, 0.000000 +2475, 1.000000, 0.000000, 0.000000, 0.000000 +2476, 1.000000, 0.000000, 0.000000, 0.000000 +2477, 1.000000, 0.000000, 0.000000, 0.000000 +2478, 1.000000, 0.000000, 0.000000, 0.000000 +2479, 1.000000, 0.000000, 0.000000, 0.000000 +2480, 1.000000, 0.000000, 0.000000, 0.000000 +2481, 1.000000, 0.000000, 0.000000, 0.000000 +2482, 1.000000, 0.000000, 0.000000, 0.000000 +2483, 1.000000, 0.000000, 0.000000, 0.000000 +2484, 1.000000, 0.000000, 0.000000, 0.000000 +2485, 1.000000, 0.000000, 0.000000, 0.000000 +2486, 1.000000, 0.000000, 0.000000, 0.000000 +2487, 1.000000, 0.000000, 0.000000, 0.000000 +2488, 1.000000, 0.000000, 0.000000, 0.000000 +2489, 1.000000, 0.000000, 0.000000, 0.000000 +2490, 1.000000, 0.000000, 0.000000, 0.000000 +2491, 1.000000, 0.000000, 0.000000, 0.000000 +2492, 1.000000, 0.000000, 0.000000, 0.000000 +2493, 1.000000, 0.000000, 0.000000, 0.000000 +2494, 1.000000, 0.000000, 0.000000, 0.000000 +2495, 1.000000, 0.000000, 0.000000, 0.000000 +2496, 1.000000, 0.000000, 0.000000, 0.000000 +2497, 1.000000, 0.000000, 0.000000, 0.000000 +2498, 1.000000, 0.000000, 0.000000, 0.000000 +2499, 1.000000, 0.000000, 0.000000, 0.000000 +2500, 1.000000, 0.000000, 0.000000, 0.000000 +2501, 1.000000, 0.000000, 0.000000, 0.000000 +2502, 1.000000, 0.000000, 0.000000, 0.000000 +2503, 1.000000, 0.000000, 0.000000, 0.000000 +2504, 1.000000, 0.000000, 0.000000, 0.000000 +2505, 1.000000, 0.000000, 0.000000, 0.000000 +2506, 1.000000, 0.000000, 0.000000, 0.000000 +2507, 1.000000, 0.000000, 0.000000, 0.000000 +2508, 1.000000, 0.000000, 0.000000, 0.000000 +2509, 1.000000, 0.000000, 0.000000, 0.000000 +2510, 1.000000, 0.000000, 0.000000, 0.000000 +2511, 1.000000, 0.000000, 0.000000, 0.000000 +2512, 1.000000, 0.000000, 0.000000, 0.000000 +2513, 1.000000, 0.000000, 0.000000, 0.000000 +2514, 1.000000, 0.000000, 0.000000, 0.000000 +2515, 1.000000, 0.000000, 0.000000, 0.000000 +2516, 1.000000, 0.000000, 0.000000, 0.000000 +2517, 1.000000, 0.000000, 0.000000, 0.000000 +2518, 1.000000, 0.000000, 0.000000, 0.000000 +2519, 1.000000, 0.000000, 0.000000, 0.000000 +2520, 1.000000, 0.000000, 0.000000, 0.000000 +2521, 1.000000, 0.000000, 0.000000, 0.000000 +2522, 1.000000, 0.000000, 0.000000, 0.000000 +2523, 1.000000, 0.000000, 0.000000, 0.000000 +2524, 1.000000, 0.000000, 0.000000, 0.000000 +2525, 1.000000, 0.000000, 0.000000, 0.000000 +2526, 1.000000, 0.000000, 0.000000, 0.000000 +2527, 1.000000, 0.000000, 0.000000, 0.000000 +2528, 1.000000, 0.000000, 0.000000, 0.000000 +2529, 1.000000, 0.000000, 0.000000, 0.000000 +2530, 1.000000, 0.000000, 0.000000, 0.000000 +2531, 1.000000, 0.000000, 0.000000, 0.000000 +2532, 1.000000, 0.000000, 0.000000, 0.000000 +2533, 1.000000, 0.000000, 0.000000, 0.000000 +2534, 1.000000, 0.000000, 0.000000, 0.000000 +2535, 1.000000, 0.000000, 0.000000, 0.000000 +2536, 1.000000, 0.000000, 0.000000, 0.000000 +2537, 1.000000, 0.000000, 0.000000, 0.000000 +2538, 1.000000, 0.000000, 0.000000, 0.000000 +2539, 1.000000, 0.000000, 0.000000, 0.000000 +2540, 1.000000, 0.000000, 0.000000, 0.000000 +2541, 1.000000, 0.000000, 0.000000, 0.000000 +2542, 1.000000, 0.000000, 0.000000, 0.000000 +2543, 1.000000, 0.000000, 0.000000, 0.000000 +2544, 1.000000, 0.000000, 0.000000, 0.000000 +2545, 1.000000, 0.000000, 0.000000, 0.000000 +2546, 1.000000, 0.000000, 0.000000, 0.000000 +2547, 1.000000, 0.000000, 0.000000, 0.000000 +2548, 1.000000, 0.000000, 0.000000, 0.000000 +2549, 1.000000, 0.000000, 0.000000, 0.000000 +2550, 1.000000, 0.000000, 0.000000, 0.000000 +2551, 1.000000, 0.000000, 0.000000, 0.000000 +2552, 1.000000, 0.000000, 0.000000, 0.000000 +2553, 1.000000, 0.000000, 0.000000, 0.000000 +2554, 1.000000, 0.000000, 0.000000, 0.000000 +2555, 1.000000, 0.000000, 0.000000, 0.000000 +2556, 1.000000, 0.000000, 0.000000, 0.000000 +2557, 1.000000, 0.000000, 0.000000, 0.000000 +2558, 1.000000, 0.000000, 0.000000, 0.000000 +2559, 1.000000, 0.000000, 0.000000, 0.000000 +2560, 1.000000, 0.000000, 0.000000, 0.000000 +2561, 1.000000, 0.000000, 0.000000, 0.000000 +2562, 1.000000, 0.000000, 0.000000, 0.000000 +2563, 1.000000, 0.000000, 0.000000, 0.000000 +2564, 1.000000, 0.000000, 0.000000, 0.000000 +2565, 1.000000, 0.000000, 0.000000, 0.000000 +2566, 1.000000, 0.000000, 0.000000, 0.000000 +2567, 1.000000, 0.000000, 0.000000, 0.000000 +2568, 1.000000, 0.000000, 0.000000, 0.000000 +2569, 1.000000, 0.000000, 0.000000, 0.000000 +2570, 1.000000, 0.000000, 0.000000, 0.000000 +2571, 1.000000, 0.000000, 0.000000, 0.000000 +2572, 1.000000, 0.000000, 0.000000, 0.000000 +2573, 1.000000, 0.000000, 0.000000, 0.000000 +2574, 1.000000, 0.000000, 0.000000, 0.000000 +2575, 1.000000, 0.000000, 0.000000, 0.000000 +2576, 1.000000, 0.000000, 0.000000, 0.000000 +2577, 1.000000, 0.000000, 0.000000, 0.000000 +2578, 1.000000, 0.000000, 0.000000, 0.000000 +2579, 1.000000, 0.000000, 0.000000, 0.000000 +2580, 1.000000, 0.000000, 0.000000, 0.000000 +2581, 1.000000, 0.000000, 0.000000, 0.000000 +2582, 1.000000, 0.000000, 0.000000, 0.000000 +2583, 1.000000, 0.000000, 0.000000, 0.000000 +2584, 1.000000, 0.000000, 0.000000, 0.000000 +2585, 1.000000, 0.000000, 0.000000, 0.000000 +2586, 1.000000, 0.000000, 0.000000, 0.000000 +2587, 1.000000, 0.000000, 0.000000, 0.000000 +2588, 1.000000, 0.000000, 0.000000, 0.000000 +2589, 1.000000, 0.000000, 0.000000, 0.000000 +2590, 1.000000, 0.000000, 0.000000, 0.000000 +2591, 1.000000, 0.000000, 0.000000, 0.000000 +2592, 1.000000, 0.000000, 0.000000, 0.000000 +2593, 1.000000, 0.000000, 0.000000, 0.000000 +2594, 1.000000, 0.000000, 0.000000, 0.000000 +2595, 1.000000, 0.000000, 0.000000, 0.000000 +2596, 1.000000, 0.000000, 0.000000, 0.000000 +2597, 1.000000, 0.000000, 0.000000, 0.000000 +2598, 1.000000, 0.000000, 0.000000, 0.000000 +2599, 1.000000, 0.000000, 0.000000, 0.000000 +2600, 1.000000, 0.000000, 0.000000, 0.000000 +2601, 1.000000, 0.000000, 0.000000, 0.000000 +2602, 1.000000, 0.000000, 0.000000, 0.000000 +2603, 1.000000, 0.000000, 0.000000, 0.000000 +2604, 1.000000, 0.000000, 0.000000, 0.000000 +2605, 1.000000, 0.000000, 0.000000, 0.000000 +2606, 1.000000, 0.000000, 0.000000, 0.000000 +2607, 1.000000, 0.000000, 0.000000, 0.000000 +2608, 1.000000, 0.000000, 0.000000, 0.000000 +2609, 1.000000, 0.000000, 0.000000, 0.000000 +2610, 1.000000, 0.000000, 0.000000, 0.000000 +2611, 1.000000, 0.000000, 0.000000, 0.000000 +2612, 1.000000, 0.000000, 0.000000, 0.000000 +2613, 1.000000, 0.000000, 0.000000, 0.000000 +2614, 1.000000, 0.000000, 0.000000, 0.000000 +2615, 1.000000, 0.000000, 0.000000, 0.000000 +2616, 1.000000, 0.000000, 0.000000, 0.000000 +2617, 1.000000, 0.000000, 0.000000, 0.000000 +2618, 1.000000, 0.000000, 0.000000, 0.000000 +2619, 1.000000, 0.000000, 0.000000, 0.000000 +2620, 1.000000, 0.000000, 0.000000, 0.000000 +2621, 1.000000, 0.000000, 0.000000, 0.000000 +2622, 1.000000, 0.000000, 0.000000, 0.000000 +2623, 1.000000, 0.000000, 0.000000, 0.000000 +2624, 1.000000, 0.000000, 0.000000, 0.000000 +2625, 1.000000, 0.000000, 0.000000, 0.000000 +2626, 1.000000, 0.000000, 0.000000, 0.000000 +2627, 1.000000, 0.000000, 0.000000, 0.000000 +2628, 1.000000, 0.000000, 0.000000, 0.000000 +2629, 1.000000, 0.000000, 0.000000, 0.000000 +2630, 1.000000, 0.000000, 0.000000, 0.000000 +2631, 1.000000, 0.000000, 0.000000, 0.000000 +2632, 1.000000, 0.000000, 0.000000, 0.000000 +2633, 1.000000, 0.000000, 0.000000, 0.000000 +2634, 1.000000, 0.000000, 0.000000, 0.000000 +2635, 1.000000, 0.000000, 0.000000, 0.000000 +2636, 1.000000, 0.000000, 0.000000, 0.000000 +2637, 1.000000, 0.000000, 0.000000, 0.000000 +2638, 1.000000, 0.000000, 0.000000, 0.000000 +2639, 1.000000, 0.000000, 0.000000, 0.000000 +2640, 1.000000, 0.000000, 0.000000, 0.000000 +2641, 1.000000, 0.000000, 0.000000, 0.000000 +2642, 1.000000, 0.000000, 0.000000, 0.000000 +2643, 1.000000, 0.000000, 0.000000, 0.000000 +2644, 1.000000, 0.000000, 0.000000, 0.000000 +2645, 1.000000, 0.000000, 0.000000, 0.000000 +2646, 1.000000, 0.000000, 0.000000, 0.000000 +2647, 1.000000, 0.000000, 0.000000, 0.000000 +2648, 1.000000, 0.000000, 0.000000, 0.000000 +2649, 1.000000, 0.000000, 0.000000, 0.000000 +2650, 1.000000, 0.000000, 0.000000, 0.000000 +2651, 1.000000, 0.000000, 0.000000, 0.000000 +2652, 1.000000, 0.000000, 0.000000, 0.000000 +2653, 1.000000, 0.000000, 0.000000, 0.000000 +2654, 1.000000, 0.000000, 0.000000, 0.000000 +2655, 1.000000, 0.000000, 0.000000, 0.000000 +2656, 1.000000, 0.000000, 0.000000, 0.000000 +2657, 1.000000, 0.000000, 0.000000, 0.000000 +2658, 1.000000, 0.000000, 0.000000, 0.000000 +2659, 1.000000, 0.000000, 0.000000, 0.000000 +2660, 1.000000, 0.000000, 0.000000, 0.000000 +2661, 1.000000, 0.000000, 0.000000, 0.000000 +2662, 1.000000, 0.000000, 0.000000, 0.000000 +2663, 1.000000, 0.000000, 0.000000, 0.000000 +2664, 1.000000, 0.000000, 0.000000, 0.000000 +2665, 1.000000, 0.000000, 0.000000, 0.000000 +2666, 1.000000, 0.000000, 0.000000, 0.000000 +2667, 1.000000, 0.000000, 0.000000, 0.000000 +2668, 1.000000, 0.000000, 0.000000, 0.000000 +2669, 1.000000, 0.000000, 0.000000, 0.000000 +2670, 1.000000, 0.000000, 0.000000, 0.000000 +2671, 1.000000, 0.000000, 0.000000, 0.000000 +2672, 1.000000, 0.000000, 0.000000, 0.000000 +2673, 1.000000, 0.000000, 0.000000, 0.000000 +2674, 1.000000, 0.000000, 0.000000, 0.000000 +2675, 1.000000, 0.000000, 0.000000, 0.000000 +2676, 1.000000, 0.000000, 0.000000, 0.000000 +2677, 1.000000, 0.000000, 0.000000, 0.000000 +2678, 1.000000, 0.000000, 0.000000, 0.000000 +2679, 1.000000, 0.000000, 0.000000, 0.000000 +2680, 1.000000, 0.000000, 0.000000, 0.000000 +2681, 1.000000, 0.000000, 0.000000, 0.000000 +2682, 1.000000, 0.000000, 0.000000, 0.000000 +2683, 1.000000, 0.000000, 0.000000, 0.000000 +2684, 1.000000, 0.000000, 0.000000, 0.000000 +2685, 1.000000, 0.000000, 0.000000, 0.000000 +2686, 1.000000, 0.000000, 0.000000, 0.000000 +2687, 1.000000, 0.000000, 0.000000, 0.000000 +2688, 1.000000, 0.000000, 0.000000, 0.000000 +2689, 1.000000, 0.000000, 0.000000, 0.000000 +2690, 1.000000, 0.000000, 0.000000, 0.000000 +2691, 1.000000, 0.000000, 0.000000, 0.000000 +2692, 1.000000, 0.000000, 0.000000, 0.000000 +2693, 1.000000, 0.000000, 0.000000, 0.000000 +2694, 1.000000, 0.000000, 0.000000, 0.000000 +2695, 1.000000, 0.000000, 0.000000, 0.000000 +2696, 1.000000, 0.000000, 0.000000, 0.000000 +2697, 1.000000, 0.000000, 0.000000, 0.000000 +2698, 1.000000, 0.000000, 0.000000, 0.000000 +2699, 1.000000, 0.000000, 0.000000, 0.000000 +2700, 1.000000, 0.000000, 0.000000, 0.000000 +2701, 1.000000, 0.000000, 0.000000, 0.000000 +2702, 1.000000, 0.000000, 0.000000, 0.000000 +2703, 1.000000, 0.000000, 0.000000, 0.000000 +2704, 1.000000, 0.000000, 0.000000, 0.000000 +2705, 1.000000, 0.000000, 0.000000, 0.000000 +2706, 1.000000, 0.000000, 0.000000, 0.000000 +2707, 1.000000, 0.000000, 0.000000, 0.000000 +2708, 1.000000, 0.000000, 0.000000, 0.000000 +2709, 1.000000, 0.000000, 0.000000, 0.000000 +2710, 1.000000, 0.000000, 0.000000, 0.000000 +2711, 1.000000, 0.000000, 0.000000, 0.000000 +2712, 1.000000, 0.000000, 0.000000, 0.000000 +2713, 1.000000, 0.000000, 0.000000, 0.000000 +2714, 1.000000, 0.000000, 0.000000, 0.000000 +2715, 1.000000, 0.000000, 0.000000, 0.000000 +2716, 1.000000, 0.000000, 0.000000, 0.000000 +2717, 1.000000, 0.000000, 0.000000, 0.000000 +2718, 1.000000, 0.000000, 0.000000, 0.000000 +2719, 1.000000, 0.000000, 0.000000, 0.000000 +2720, 1.000000, 0.000000, 0.000000, 0.000000 +2721, 1.000000, 0.000000, 0.000000, 0.000000 +2722, 1.000000, 0.000000, 0.000000, 0.000000 +2723, 1.000000, 0.000000, 0.000000, 0.000000 +2724, 1.000000, 0.000000, 0.000000, 0.000000 +2725, 1.000000, 0.000000, 0.000000, 0.000000 +2726, 1.000000, 0.000000, 0.000000, 0.000000 +2727, 1.000000, 0.000000, 0.000000, 0.000000 +2728, 1.000000, 0.000000, 0.000000, 0.000000 +2729, 1.000000, 0.000000, 0.000000, 0.000000 +2730, 1.000000, 0.000000, 0.000000, 0.000000 +2731, 1.000000, 0.000000, 0.000000, 0.000000 +2732, 1.000000, 0.000000, 0.000000, 0.000000 +2733, 1.000000, 0.000000, 0.000000, 0.000000 +2734, 1.000000, 0.000000, 0.000000, 0.000000 +2735, 1.000000, 0.000000, 0.000000, 0.000000 +2736, 1.000000, 0.000000, 0.000000, 0.000000 +2737, 1.000000, 0.000000, 0.000000, 0.000000 +2738, 1.000000, 0.000000, 0.000000, 0.000000 +2739, 1.000000, 0.000000, 0.000000, 0.000000 +2740, 1.000000, 0.000000, 0.000000, 0.000000 +2741, 1.000000, 0.000000, 0.000000, 0.000000 +2742, 1.000000, 0.000000, 0.000000, 0.000000 +2743, 1.000000, 0.000000, 0.000000, 0.000000 +2744, 1.000000, 0.000000, 0.000000, 0.000000 +2745, 1.000000, 0.000000, 0.000000, 0.000000 +2746, 1.000000, 0.000000, 0.000000, 0.000000 +2747, 1.000000, 0.000000, 0.000000, 0.000000 +2748, 1.000000, 0.000000, 0.000000, 0.000000 +2749, 1.000000, 0.000000, 0.000000, 0.000000 +2750, 1.000000, 0.000000, 0.000000, 0.000000 +2751, 1.000000, 0.000000, 0.000000, 0.000000 +2752, 1.000000, 0.000000, 0.000000, 0.000000 +2753, 1.000000, 0.000000, 0.000000, 0.000000 +2754, 1.000000, 0.000000, 0.000000, 0.000000 +2755, 1.000000, 0.000000, 0.000000, 0.000000 +2756, 1.000000, 0.000000, 0.000000, 0.000000 +2757, 1.000000, 0.000000, 0.000000, 0.000000 +2758, 1.000000, 0.000000, 0.000000, 0.000000 +2759, 1.000000, 0.000000, 0.000000, 0.000000 +2760, 1.000000, 0.000000, 0.000000, 0.000000 +2761, 1.000000, 0.000000, 0.000000, 0.000000 +2762, 1.000000, 0.000000, 0.000000, 0.000000 +2763, 1.000000, 0.000000, 0.000000, 0.000000 +2764, 1.000000, 0.000000, 0.000000, 0.000000 +2765, 1.000000, 0.000000, 0.000000, 0.000000 +2766, 1.000000, 0.000000, 0.000000, 0.000000 +2767, 1.000000, 0.000000, 0.000000, 0.000000 +2768, 1.000000, 0.000000, 0.000000, 0.000000 +2769, 1.000000, 0.000000, 0.000000, 0.000000 +2770, 1.000000, 0.000000, 0.000000, 0.000000 +2771, 1.000000, 0.000000, 0.000000, 0.000000 +2772, 1.000000, 0.000000, 0.000000, 0.000000 +2773, 1.000000, 0.000000, 0.000000, 0.000000 +2774, 1.000000, 0.000000, 0.000000, 0.000000 +2775, 1.000000, 0.000000, 0.000000, 0.000000 +2776, 1.000000, 0.000000, 0.000000, 0.000000 +2777, 1.000000, 0.000000, 0.000000, 0.000000 +2778, 1.000000, 0.000000, 0.000000, 0.000000 +2779, 1.000000, 0.000000, 0.000000, 0.000000 +2780, 1.000000, 0.000000, 0.000000, 0.000000 +2781, 1.000000, 0.000000, 0.000000, 0.000000 +2782, 1.000000, 0.000000, 0.000000, 0.000000 +2783, 1.000000, 0.000000, 0.000000, 0.000000 +2784, 1.000000, 0.000000, 0.000000, 0.000000 +2785, 1.000000, 0.000000, 0.000000, 0.000000 +2786, 1.000000, 0.000000, 0.000000, 0.000000 +2787, 1.000000, 0.000000, 0.000000, 0.000000 +2788, 1.000000, 0.000000, 0.000000, 0.000000 +2789, 1.000000, 0.000000, 0.000000, 0.000000 +2790, 1.000000, 0.000000, 0.000000, 0.000000 +2791, 1.000000, 0.000000, 0.000000, 0.000000 +2792, 1.000000, 0.000000, 0.000000, 0.000000 +2793, 1.000000, 0.000000, 0.000000, 0.000000 +2794, 1.000000, 0.000000, 0.000000, 0.000000 +2795, 1.000000, 0.000000, 0.000000, 0.000000 +2796, 1.000000, 0.000000, 0.000000, 0.000000 +2797, 1.000000, 0.000000, 0.000000, 0.000000 +2798, 1.000000, 0.000000, 0.000000, 0.000000 +2799, 1.000000, 0.000000, 0.000000, 0.000000 +2800, 1.000000, 0.000000, 0.000000, 0.000000 +2801, 1.000000, 0.000000, 0.000000, 0.000000 +2802, 1.000000, 0.000000, 0.000000, 0.000000 +2803, 1.000000, 0.000000, 0.000000, 0.000000 +2804, 1.000000, 0.000000, 0.000000, 0.000000 +2805, 1.000000, 0.000000, 0.000000, 0.000000 +2806, 1.000000, 0.000000, 0.000000, 0.000000 +2807, 1.000000, 0.000000, 0.000000, 0.000000 +2808, 1.000000, 0.000000, 0.000000, 0.000000 +2809, 1.000000, 0.000000, 0.000000, 0.000000 +2810, 1.000000, 0.000000, 0.000000, 0.000000 +2811, 1.000000, 0.000000, 0.000000, 0.000000 +2812, 1.000000, 0.000000, 0.000000, 0.000000 +2813, 1.000000, 0.000000, 0.000000, 0.000000 +2814, 1.000000, 0.000000, 0.000000, 0.000000 +2815, 1.000000, 0.000000, 0.000000, 0.000000 +2816, 1.000000, 0.000000, 0.000000, 0.000000 +2817, 1.000000, 0.000000, 0.000000, 0.000000 +2818, 1.000000, 0.000000, 0.000000, 0.000000 +2819, 1.000000, 0.000000, 0.000000, 0.000000 +2820, 1.000000, 0.000000, 0.000000, 0.000000 +2821, 1.000000, 0.000000, 0.000000, 0.000000 +2822, 1.000000, 0.000000, 0.000000, 0.000000 +2823, 1.000000, 0.000000, 0.000000, 0.000000 +2824, 1.000000, 0.000000, 0.000000, 0.000000 +2825, 1.000000, 0.000000, 0.000000, 0.000000 +2826, 1.000000, 0.000000, 0.000000, 0.000000 +2827, 1.000000, 0.000000, 0.000000, 0.000000 +2828, 1.000000, 0.000000, 0.000000, 0.000000 +2829, 1.000000, 0.000000, 0.000000, 0.000000 +2830, 1.000000, 0.000000, 0.000000, 0.000000 +2831, 1.000000, 0.000000, 0.000000, 0.000000 +2832, 1.000000, 0.000000, 0.000000, 0.000000 +2833, 1.000000, 0.000000, 0.000000, 0.000000 +2834, 1.000000, 0.000000, 0.000000, 0.000000 +2835, 1.000000, 0.000000, 0.000000, 0.000000 +2836, 1.000000, 0.000000, 0.000000, 0.000000 +2837, 1.000000, 0.000000, 0.000000, 0.000000 +2838, 1.000000, 0.000000, 0.000000, 0.000000 +2839, 1.000000, 0.000000, 0.000000, 0.000000 +2840, 1.000000, 0.000000, 0.000000, 0.000000 +2841, 1.000000, 0.000000, 0.000000, 0.000000 +2842, 1.000000, 0.000000, 0.000000, 0.000000 +2843, 1.000000, 0.000000, 0.000000, 0.000000 +2844, 1.000000, 0.000000, 0.000000, 0.000000 +2845, 1.000000, 0.000000, 0.000000, 0.000000 +2846, 1.000000, 0.000000, 0.000000, 0.000000 +2847, 1.000000, 0.000000, 0.000000, 0.000000 +2848, 1.000000, 0.000000, 0.000000, 0.000000 +2849, 1.000000, 0.000000, 0.000000, 0.000000 +2850, 1.000000, 0.000000, 0.000000, 0.000000 +2851, 1.000000, 0.000000, 0.000000, 0.000000 +2852, 1.000000, 0.000000, 0.000000, 0.000000 +2853, 1.000000, 0.000000, 0.000000, 0.000000 +2854, 1.000000, 0.000000, 0.000000, 0.000000 +2855, 1.000000, 0.000000, 0.000000, 0.000000 +2856, 1.000000, 0.000000, 0.000000, 0.000000 +2857, 1.000000, 0.000000, 0.000000, 0.000000 +2858, 1.000000, 0.000000, 0.000000, 0.000000 +2859, 1.000000, 0.000000, 0.000000, 0.000000 +2860, 1.000000, 0.000000, 0.000000, 0.000000 +2861, 1.000000, 0.000000, 0.000000, 0.000000 +2862, 1.000000, 0.000000, 0.000000, 0.000000 +2863, 1.000000, 0.000000, 0.000000, 0.000000 +2864, 1.000000, 0.000000, 0.000000, 0.000000 +2865, 1.000000, 0.000000, 0.000000, 0.000000 +2866, 1.000000, 0.000000, 0.000000, 0.000000 +2867, 1.000000, 0.000000, 0.000000, 0.000000 +2868, 1.000000, 0.000000, 0.000000, 0.000000 +2869, 1.000000, 0.000000, 0.000000, 0.000000 +2870, 1.000000, 0.000000, 0.000000, 0.000000 +2871, 1.000000, 0.000000, 0.000000, 0.000000 +2872, 1.000000, 0.000000, 0.000000, 0.000000 +2873, 1.000000, 0.000000, 0.000000, 0.000000 +2874, 1.000000, 0.000000, 0.000000, 0.000000 +2875, 1.000000, 0.000000, 0.000000, 0.000000 +2876, 1.000000, 0.000000, 0.000000, 0.000000 +2877, 1.000000, 0.000000, 0.000000, 0.000000 +2878, 1.000000, 0.000000, 0.000000, 0.000000 +2879, 1.000000, 0.000000, 0.000000, 0.000000 +2880, 1.000000, 0.000000, 0.000000, 0.000000 +2881, 1.000000, 0.000000, 0.000000, 0.000000 +2882, 1.000000, 0.000000, 0.000000, 0.000000 +2883, 1.000000, 0.000000, 0.000000, 0.000000 +2884, 1.000000, 0.000000, 0.000000, 0.000000 +2885, 1.000000, 0.000000, 0.000000, 0.000000 +2886, 1.000000, 0.000000, 0.000000, 0.000000 +2887, 1.000000, 0.000000, 0.000000, 0.000000 +2888, 1.000000, 0.000000, 0.000000, 0.000000 +2889, 1.000000, 0.000000, 0.000000, 0.000000 +2890, 1.000000, 0.000000, 0.000000, 0.000000 +2891, 1.000000, 0.000000, 0.000000, 0.000000 +2892, 1.000000, 0.000000, 0.000000, 0.000000 +2893, 1.000000, 0.000000, 0.000000, 0.000000 +2894, 1.000000, 0.000000, 0.000000, 0.000000 +2895, 1.000000, 0.000000, 0.000000, 0.000000 +2896, 1.000000, 0.000000, 0.000000, 0.000000 +2897, 1.000000, 0.000000, 0.000000, 0.000000 +2898, 1.000000, 0.000000, 0.000000, 0.000000 +2899, 1.000000, 0.000000, 0.000000, 0.000000 +2900, 1.000000, 0.000000, 0.000000, 0.000000 +2901, 1.000000, 0.000000, 0.000000, 0.000000 +2902, 1.000000, 0.000000, 0.000000, 0.000000 +2903, 1.000000, 0.000000, 0.000000, 0.000000 +2904, 1.000000, 0.000000, 0.000000, 0.000000 +2905, 1.000000, 0.000000, 0.000000, 0.000000 +2906, 1.000000, 0.000000, 0.000000, 0.000000 +2907, 1.000000, 0.000000, 0.000000, 0.000000 +2908, 1.000000, 0.000000, 0.000000, 0.000000 +2909, 1.000000, 0.000000, 0.000000, 0.000000 +2910, 1.000000, 0.000000, 0.000000, 0.000000 +2911, 1.000000, 0.000000, 0.000000, 0.000000 +2912, 1.000000, 0.000000, 0.000000, 0.000000 +2913, 1.000000, 0.000000, 0.000000, 0.000000 +2914, 1.000000, 0.000000, 0.000000, 0.000000 +2915, 1.000000, 0.000000, 0.000000, 0.000000 +2916, 1.000000, 0.000000, 0.000000, 0.000000 +2917, 1.000000, 0.000000, 0.000000, 0.000000 +2918, 1.000000, 0.000000, 0.000000, 0.000000 +2919, 1.000000, 0.000000, 0.000000, 0.000000 +2920, 1.000000, 0.000000, 0.000000, 0.000000 +2921, 1.000000, 0.000000, 0.000000, 0.000000 +2922, 1.000000, 0.000000, 0.000000, 0.000000 +2923, 1.000000, 0.000000, 0.000000, 0.000000 +2924, 1.000000, 0.000000, 0.000000, 0.000000 +2925, 1.000000, 0.000000, 0.000000, 0.000000 +2926, 1.000000, 0.000000, 0.000000, 0.000000 +2927, 1.000000, 0.000000, 0.000000, 0.000000 +2928, 1.000000, 0.000000, 0.000000, 0.000000 +2929, 1.000000, 0.000000, 0.000000, 0.000000 +2930, 1.000000, 0.000000, 0.000000, 0.000000 +2931, 1.000000, 0.000000, 0.000000, 0.000000 +2932, 1.000000, 0.000000, 0.000000, 0.000000 +2933, 1.000000, 0.000000, 0.000000, 0.000000 +2934, 1.000000, 0.000000, 0.000000, 0.000000 +2935, 1.000000, 0.000000, 0.000000, 0.000000 +2936, 1.000000, 0.000000, 0.000000, 0.000000 +2937, 1.000000, 0.000000, 0.000000, 0.000000 +2938, 1.000000, 0.000000, 0.000000, 0.000000 +2939, 1.000000, 0.000000, 0.000000, 0.000000 +2940, 1.000000, 0.000000, 0.000000, 0.000000 +2941, 1.000000, 0.000000, 0.000000, 0.000000 +2942, 1.000000, 0.000000, 0.000000, 0.000000 +2943, 1.000000, 0.000000, 0.000000, 0.000000 +2944, 1.000000, 0.000000, 0.000000, 0.000000 +2945, 1.000000, 0.000000, 0.000000, 0.000000 +2946, 1.000000, 0.000000, 0.000000, 0.000000 +2947, 1.000000, 0.000000, 0.000000, 0.000000 +2948, 1.000000, 0.000000, 0.000000, 0.000000 +2949, 1.000000, 0.000000, 0.000000, 0.000000 +2950, 1.000000, 0.000000, 0.000000, 0.000000 +2951, 1.000000, 0.000000, 0.000000, 0.000000 +2952, 1.000000, 0.000000, 0.000000, 0.000000 +2953, 1.000000, 0.000000, 0.000000, 0.000000 +2954, 1.000000, 0.000000, 0.000000, 0.000000 +2955, 1.000000, 0.000000, 0.000000, 0.000000 +2956, 1.000000, 0.000000, 0.000000, 0.000000 +2957, 1.000000, 0.000000, 0.000000, 0.000000 +2958, 1.000000, 0.000000, 0.000000, 0.000000 +2959, 1.000000, 0.000000, 0.000000, 0.000000 +2960, 1.000000, 0.000000, 0.000000, 0.000000 +2961, 1.000000, 0.000000, 0.000000, 0.000000 +2962, 1.000000, 0.000000, 0.000000, 0.000000 +2963, 1.000000, 0.000000, 0.000000, 0.000000 +2964, 1.000000, 0.000000, 0.000000, 0.000000 +2965, 1.000000, 0.000000, 0.000000, 0.000000 +2966, 1.000000, 0.000000, 0.000000, 0.000000 +2967, 1.000000, 0.000000, 0.000000, 0.000000 +2968, 1.000000, 0.000000, 0.000000, 0.000000 +2969, 1.000000, 0.000000, 0.000000, 0.000000 +2970, 1.000000, 0.000000, 0.000000, 0.000000 +2971, 1.000000, 0.000000, 0.000000, 0.000000 +2972, 1.000000, 0.000000, 0.000000, 0.000000 +2973, 1.000000, 0.000000, 0.000000, 0.000000 +2974, 1.000000, 0.000000, 0.000000, 0.000000 +2975, 1.000000, 0.000000, 0.000000, 0.000000 +2976, 1.000000, 0.000000, 0.000000, 0.000000 +2977, 1.000000, 0.000000, 0.000000, 0.000000 +2978, 1.000000, 0.000000, 0.000000, 0.000000 +2979, 1.000000, 0.000000, 0.000000, 0.000000 +2980, 1.000000, 0.000000, 0.000000, 0.000000 +2981, 1.000000, 0.000000, 0.000000, 0.000000 +2982, 1.000000, 0.000000, 0.000000, 0.000000 +2983, 1.000000, 0.000000, 0.000000, 0.000000 +2984, 1.000000, 0.000000, 0.000000, 0.000000 +2985, 1.000000, 0.000000, 0.000000, 0.000000 +2986, 1.000000, 0.000000, 0.000000, 0.000000 +2987, 1.000000, 0.000000, 0.000000, 0.000000 +2988, 1.000000, 0.000000, 0.000000, 0.000000 +2989, 1.000000, 0.000000, 0.000000, 0.000000 +2990, 1.000000, 0.000000, 0.000000, 0.000000 +2991, 1.000000, 0.000000, 0.000000, 0.000000 +2992, 1.000000, 0.000000, 0.000000, 0.000000 +2993, 1.000000, 0.000000, 0.000000, 0.000000 +2994, 1.000000, 0.000000, 0.000000, 0.000000 +2995, 1.000000, 0.000000, 0.000000, 0.000000 +2996, 1.000000, 0.000000, 0.000000, 0.000000 +2997, 1.000000, 0.000000, 0.000000, 0.000000 +2998, 1.000000, 0.000000, 0.000000, 0.000000 +2999, 1.000000, 0.000000, 0.000000, 0.000000 -- GitLab From b7b6982af85e90f02b720d4874bf50da47106556 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Tue, 27 Jun 2023 14:55:37 +0200 Subject: [PATCH 0274/1418] Move quantization of delay to lower level --- apps/renderer.c | 13 ++++++++++--- lib_rend/lib_rend.c | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index f72234bf2a..557c626871 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -313,7 +313,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_syncMdDelay, .match = "sync_md_delay", .matchShort = "smd", - .description = "Metadata Synchronization Delay in ms, Default is 0", + .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)", }, #endif }; @@ -1400,6 +1400,13 @@ int main( fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); +#ifdef FIX_488_SYNC_DELAY + if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) floor( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); + } +#endif + #ifdef DEBUGGING int32_t cnt_frames_limited, noClipping; if ( ( cnt_frames_limited = IVAS_REND_GetCntFramesLimited( hIvasRend ) ) > 0 ) @@ -2054,8 +2061,8 @@ static void parseOption( #ifdef FIX_488_SYNC_DELAY case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); - /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ - args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); + /* Metadata Delay to sync with audio delay in ms */ + args->syncMdDelay = (int16_t) strtof( optionValues[0], NULL ); break; #endif default: diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index edf18082f1..a7d091e0b2 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4669,9 +4669,14 @@ static ivas_error renderIsmToBinaural( { float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; - +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif push_wmops( "renderIsmToBinaural" ); - +#ifdef FIX_488_SYNC_DELAY + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, @@ -4681,7 +4686,7 @@ static ivas_error renderIsmToBinaural( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, + ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpTDRendBuffer ) ) != IVAS_ERR_OK ) @@ -4846,6 +4851,9 @@ static ivas_error renderIsmToBinauralReverb( #endif float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; +#ifdef FIX_488_SYNC_DELAY + int16_t ism_md_subframe_update_ext; +#endif #ifdef JBM_TSM_ON_TCS float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; @@ -4857,6 +4865,10 @@ static ivas_error renderIsmToBinauralReverb( push_wmops( "renderIsmToBinauralRoom" ); +#ifdef FIX_488_SYNC_DELAY + /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */ + ism_md_subframe_update_ext = floor( ismInput->ism_md_subframe_update_ext / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ); +#endif copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, @@ -4866,7 +4878,7 @@ static ivas_error renderIsmToBinauralReverb( &ismInput->currentPos, ismInput->hReverb, #ifdef FIX_488_SYNC_DELAY - ismInput->ism_md_subframe_update_ext, + ism_md_subframe_update_ext, #endif outAudio.config.numSamplesPerChannel, tmpRendBuffer ) ) != IVAS_ERR_OK ) -- GitLab From a7aa869de840c9e4cab0011793d0595a48ab2b03 Mon Sep 17 00:00:00 2001 From: Michael Schug Date: Tue, 27 Jun 2023 16:42:57 +0200 Subject: [PATCH 0275/1418] upmix working with subframes used in jbm decoder path; fixed number of tc buffer channels to 12 also for other than 7_1_4 configurations --- lib_com/ivas_prot.h | 16 ++ lib_dec/ivas_jbm_dec.c | 116 ++++++------ lib_dec/ivas_mc_paramupmix_dec.c | 297 ++++++++++++++++++++++++++++++- lib_dec/ivas_stat_dec.h | 3 + 4 files changed, 372 insertions(+), 60 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 34226e640c..6014794be5 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3877,6 +3877,22 @@ void ivas_mc_paramupmix_dec_read_BS( int16_t *nb_bits /* o : number of bits written */ ); +#ifdef JBM_PARAMUPMIX +void ivas_mc_paramupmix_dec_digest_tc( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ +); + +void ivas_mc_paramupmix_dec_render( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + float *input_f[], /* i: core-coder transport channels */ + float *output_f[] /* i/o: synthesized core-coder transport channels */ +); +#endif + void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ const int16_t lfe_index, /* i : channel index of LFE */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b5e2cbdbbe..c86739c323 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -381,65 +381,23 @@ ivas_error ivas_jbm_dec_tc( mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame ); - //ivas_mc_paramupmix_dec( st_ivas, output ); - - /* HP filtering */ - for ( n = 0; n < st_ivas->nchan_transport; n++ ) - { - if ( n != LFE_CHANNEL ) - { - hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); - } - } - - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) - { - ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); - } - - /* Rendering */ - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) - { - ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); - } -#if 0 /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, - st_ivas->hCombinedOrientationData, - &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); - } - else if ( st_ivas->renderer_type == RENDERER_MC ) + if ( st_ivas->renderer_type == RENDERER_MC ) { - if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) { + /* HP filtering */ + for ( n = 0; n < st_ivas->nchan_transport; n++ ) + { + if ( n != LFE_CHANNEL ) + { + hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); + } + } ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); } - else - { - ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, output_frame, p_output, p_output ); - } } - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { - if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) - { - return error; - } - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); - } -#endif } #endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -673,7 +631,7 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( #ifdef JBM_PARAMUPMIX else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - ivas_param_upmix_dec_decorr_subframes( st_ivas ); + ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots ); } #endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -928,7 +886,51 @@ ivas_error ivas_jbm_dec_render( #ifdef JBM_PARAMUPMIX else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + ivas_mc_paramupmix_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_tc, p_output ); + + /* HP filtering */ + for ( n = 0; n < st_ivas->nchan_transport; n++ ) + { + if ( n != LFE_CHANNEL ) + { + hp20( p_output[n], *nSamplesRendered, st_ivas->mem_hp20_out[n], output_Fs ); + } + } + + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + { + ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); + } + + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, + st_ivas->hCombinedOrientationData, + &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_output, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) + { + return error; + } + + ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); + } + else if ( st_ivas->renderer_type == RENDERER_MC ) + { + ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, *nSamplesRendered, p_output, p_output ); + } + else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) + { + ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); + } + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) + { + if ( ( ivas_td_binaural_renderer( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) + { + return error; + } + + ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); + } } #endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -1489,6 +1491,12 @@ int16_t ivas_jbm_dec_get_num_tc_channels( num_tc = st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; } } +#ifdef JBM_PARAMUPMIX + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) + { + num_tc = MC_PARAMUPMIX_MAX_INPUT_CHANS; + } +#endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { if ( st_ivas->hOutSetup.separateChannelEnabled ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 30ab30653d..d23be11bf5 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -55,6 +55,14 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_mod_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t ch ); +#ifdef JBM_PARAMUPMIX +static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch ); + +static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); + +static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas ); +#endif + static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float pcm_in[][L_FRAME48k], float **pp_out_pcm, const int16_t output_frame ); static int huff_read( Decoder_State *st, const int16_t ( *ht )[2] ); @@ -292,6 +300,99 @@ void ivas_mc_paramupmix_dec( } +#ifdef JBM_PARAMUPMIX +void ivas_mc_paramupmix_dec_digest_tc( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ +) +{ + MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; + hMCParamUpmix = st_ivas->hMCParamUpmix; + assert( hMCParamUpmix ); + + push_wmops( "ivas_mc_paramupmix_dec_digest_tc" ); + + ivas_param_upmix_dec_decorr_subframes( st_ivas ); + + /* adapt subframes */ + ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); + + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); + + pop_wmops(); +} + + +void ivas_mc_paramupmix_dec_render( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + float *input_f[], /* i: core-coder transport channels */ + float *output_f[] /* i/o: synthesized core-coder transport channels */ +) +{ + int16_t slots_to_render, first_sf, last_sf, subframe_idx; + uint16_t slot_size, ch; + float *output_f_local[MAX_OUTPUT_CHANNELS]; + MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; + hMCParamUpmix = st_ivas->hMCParamUpmix; + assert( hMCParamUpmix ); + + push_wmops( "ivas_mc_paramupmix_dec_render" ); + + for ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) + { + output_f_local[ch] = output_f[ch]; + } + + slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); + + /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ + slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, nSamplesAsked / slot_size ); + *nSamplesRendered = slots_to_render * slot_size; + first_sf = st_ivas->hTcBuffer->subframes_rendered; + last_sf = first_sf; + + for ( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) + { + mvr2r( input_f[ch], output_f_local[ch], *nSamplesRendered); + } + + while ( slots_to_render > 0 ) + { + slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; + last_sf++; + } +#ifdef DEBUGGING + assert( slots_to_render == 0 ); +#endif + + for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) + { + int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; + + ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local ); + for ( ch = 0; ch < MAX_OUTPUT_CHANNELS; ch++ ) + { + output_f_local[ch] += n_samples_sf; + } + } + + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) + { + mvr2r( hMCParamUpmix->alphas[ch], hMCParamUpmix->alpha_prev[ch], IVAS_MAX_NUM_BANDS ); + mvr2r( hMCParamUpmix->betas[ch], hMCParamUpmix->beta_prev[ch], IVAS_MAX_NUM_BANDS ); + } + + *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; + + pop_wmops(); +} +#endif + + + /*------------------------------------------------------------------------- * ivas_mc_paramupmix_dec_open() * @@ -307,10 +408,6 @@ ivas_error ivas_mc_paramupmix_dec_open( int16_t nchan_transport; uint16_t i; ivas_error error; -#ifdef JBM_PARAMUPMIX - int16_t num_channels_internal; - num_channels_internal = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; -#endif error = IVAS_ERR_OK; @@ -385,6 +482,11 @@ ivas_error ivas_mc_paramupmix_dec_open( { return error; } + if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); + } + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } #endif @@ -421,6 +523,12 @@ void ivas_mc_paramupmix_dec_close( free( ( *hMCParamUpmix )->pcm_delay[i] ); } } +#ifdef JBM_PARAMUPMIX + if ( ( *hMCParamUpmix )->param_interpolator != NULL ) + { + free( ( *hMCParamUpmix )->param_interpolator ); + } +#endif free( *hMCParamUpmix ); *hMCParamUpmix = NULL; @@ -479,7 +587,7 @@ static void paramupmix_td_decorr_process_jbm( return; } -void ivas_param_upmix_dec_decorr_subframes( +static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { @@ -487,7 +595,6 @@ void ivas_param_upmix_dec_decorr_subframes( int16_t i, ch; int32_t output_Fs; int16_t output_frame; - float Pcm_decorr[MC_PARAMUPMIX_COMBINATIONS][L_FRAME48k]; /* decorrelated channels */ float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ float *p_tc[MC_PARAMUPMIX_MAX_INPUT_CHANS]; @@ -584,6 +691,184 @@ static void ps_pred_process( return; } +#ifdef JBM_PARAMUPMIX +static void ps_pred_process_sf( + MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, + DECODER_TC_BUFFER_HANDLE hTcBuffer, + float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* in/out */ + float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* in/out */ + float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], + float *param_interpol, + const int16_t ch ) +{ + float vmre, vmim, vsre, vsim; + int16_t iqmf, ipar, ismp, iismp; + float alpha_smp, beta_smp; + float *alpha1, *alpha2; + float *beta1, *beta2; + float *alpha_prev = hMCParamUpmix->alpha_prev[ch]; + float *beta_prev = hMCParamUpmix->beta_prev[ch]; + + const int16_t qmf_to_par_band[] = { + 0, 1, 2, 3, 4, 5, 5, 6, 6, 7, + 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, + 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 + }; + + for ( iqmf = 0; iqmf < CLDFB_NO_CHANNELS_MAX; iqmf++ ) + { + /* For changing no of parameter bands (ipar1 != ipar2), TIGGER_FRAMING assumed */ + ipar = qmf_to_par_band[iqmf]; + alpha1 = alpha_prev; + beta1 = beta_prev; + + ismp = 0; + alpha2 = hMCParamUpmix->alphas[ch]; + beta2 = hMCParamUpmix->betas[ch]; + alpha_smp = alpha1[ipar]; + beta_smp = beta1[ipar]; + + for ( iismp = 0; iismp < hTcBuffer->subframe_nbslots[hTcBuffer->subframes_rendered]; iismp++ ) + { + alpha_smp = alpha1[ipar] + ( alpha2[ipar] - alpha1[ipar] ) * param_interpol[iismp]; + beta_smp = beta1[ipar] + ( beta2[ipar] - beta1[ipar] ) * param_interpol[iismp]; + + vmre = qmf_mod_re[ismp][iqmf]; + vmim = qmf_mod_im[ismp][iqmf]; + vsre = qmf_side_re[ismp][iqmf]; + vsim = qmf_side_im[ismp][iqmf]; + + qmf_side_re[ismp][iqmf] = alpha_smp * vmre + beta_smp * vsre; + qmf_side_im[ismp][iqmf] = alpha_smp * vmim + beta_smp * vsim; + + ismp++; + } + } + + return; +} + + +static void ivas_mc_paramupmix_dec_sf( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ +) +{ + int16_t i, ch, slot_idx, k; + float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ + /*CLDFB*/ + float Cldfb_RealBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float Cldfb_ImagBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + int16_t noparamupmix_delay, n_samples_rendered; + MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; + hMCParamUpmix = st_ivas->hMCParamUpmix; + assert( hMCParamUpmix ); + + push_wmops( "ivas_mc_paramupmix_dec_sf" ); + + for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) + { + pPcm_temp[2 * i] = output_f[i + 4]; /* un-decorrelated */ + pPcm_temp[2 * i + 1] = output_f[i + 8]; /* decorrelated */ + } + + /* CLDFB Analysis*/ + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS * 2; ch++ ) + { + /* slot loop for gathering the input data */ + for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) + { + cldfbAnalysis_ts( &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * slot_idx] ), Cldfb_RealBuffer[ch][slot_idx], Cldfb_ImagBuffer[ch][slot_idx], hMCParamUpmix->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + } + } + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) + { + ps_pred_process_sf( hMCParamUpmix, + st_ivas->hTcBuffer, + Cldfb_RealBuffer[2 * ch], /* in/out */ + Cldfb_ImagBuffer[2 * ch], + Cldfb_RealBuffer[2 * ch + 1], /* in/out decorr */ + Cldfb_ImagBuffer[2 * ch + 1], + &hMCParamUpmix->param_interpolator[st_ivas->hTcBuffer->slots_rendered], + ch ); + + /*-- m, s -> l, r ----------------------------*/ + for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) + { + for ( k = 0; k < CLDFB_NO_CHANNELS_MAX; k++ ) + { + float qlre = Cldfb_RealBuffer[2 * ch][slot_idx][k]; + float qlim = Cldfb_ImagBuffer[2 * ch][slot_idx][k]; + float qrre = Cldfb_RealBuffer[2 * ch + 1][slot_idx][k]; + float qrim = Cldfb_ImagBuffer[2 * ch + 1][slot_idx][k]; + + Cldfb_RealBuffer[2 * ch][slot_idx][k] = qlre + qrre; + Cldfb_ImagBuffer[2 * ch][slot_idx][k] = qlim + qrim; + Cldfb_RealBuffer[2 * ch + 1][slot_idx][k] = qlre - qrre; + Cldfb_ImagBuffer[2 * ch + 1][slot_idx][k] = qlim - qrim; + } + } + } + /* boxes = { 0 1 2 3 [4 6] [5 7] [8 10] [9 11] }; */ + pPcm_temp[0] = output_f[4]; + pPcm_temp[1] = output_f[6]; + pPcm_temp[2] = output_f[5]; + pPcm_temp[3] = output_f[7]; + pPcm_temp[4] = output_f[8]; + pPcm_temp[5] = output_f[10]; + pPcm_temp[6] = output_f[9]; + pPcm_temp[7] = output_f[11]; + + /* CLDFB synthesis */ + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS * 2; ch++ ) + { + for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) + { + float *ptr_im[1], *ptr_re[1]; + ptr_re[0] = Cldfb_RealBuffer[ch][slot_idx]; + ptr_im[0] = Cldfb_ImagBuffer[ch][slot_idx]; + + cldfbSynthesis( ptr_re, ptr_im, &( pPcm_temp[ch][hMCParamUpmix->num_freq_bands * slot_idx] ), + hMCParamUpmix->num_freq_bands, st_ivas->cldfbSynDec[ch] ); + } + } + /* adjust delay of other channels */ + noparamupmix_delay = NS2SA( st_ivas->hDecoderConfig->output_Fs, IVAS_FB_DEC_DELAY_NS ); + n_samples_rendered = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered] * hMCParamUpmix->num_freq_bands; + if (n_samples_rendered > noparamupmix_delay) + { + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) + { + float tmp_buf[L_SUBFRAME5MS_48k]; + mvr2r( &output_f[ch][n_samples_rendered - noparamupmix_delay], tmp_buf, noparamupmix_delay ); + mvr2r( output_f[ch], &output_f[ch][noparamupmix_delay], n_samples_rendered - noparamupmix_delay ); + mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], noparamupmix_delay ); + mvr2r( tmp_buf, hMCParamUpmix->pcm_delay[ch], noparamupmix_delay ); + } + } + else + { + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) + { + float tmp_buf[L_SUBFRAME5MS_48k]; + mvr2r( &output_f[ch][0], tmp_buf, n_samples_rendered ); + mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], n_samples_rendered ); + mvr2r( &hMCParamUpmix->pcm_delay[ch][n_samples_rendered], &hMCParamUpmix->pcm_delay[ch][0], noparamupmix_delay - n_samples_rendered ); + mvr2r( tmp_buf, &hMCParamUpmix->pcm_delay[ch][noparamupmix_delay-n_samples_rendered], n_samples_rendered ); + } + } + + st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; + st_ivas->hTcBuffer->subframes_rendered++; + + pop_wmops(); +} +#endif + static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], /* i/o: SPAR Covar. decoder handle */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 315cfbad66..697a577c87 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -802,6 +802,9 @@ typedef struct ivas_mc_paramupmix_dec_data_structure int32_t beta_quant[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS]; int16_t first_frame; float *pcm_delay[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS]; +#ifdef JBM_PARAMUPMIX + float *param_interpolator; +#endif } MC_PARAMUPMIX_DEC_DATA, *MC_PARAMUPMIX_DEC_HANDLE; -- GitLab From 7af9067f41063fd71377f0436a04e5c07f23718b Mon Sep 17 00:00:00 2001 From: Ke Zhao Date: Wed, 28 Jun 2023 16:48:23 +1000 Subject: [PATCH 0276/1418] Update SBA CLDFB-domain HRTFs --- lib_com/ivas_cnst.h | 5 + lib_com/options.h | 1 + lib_dec/ivas_binRenderer_internal.c | 35 + lib_rend/ivas_rom_binauralRenderer.c | 7059 ++++++++++++++++++++++++++ lib_rend/ivas_rom_binauralRenderer.h | 15 + lib_rend/ivas_stat_rend.h | 17 + lib_util/hrtf_file_reader.c | 102 + 7 files changed, 7234 insertions(+) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3f5065e6bf..74522f10ee 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1510,6 +1510,11 @@ typedef enum #define BINAURAL_MAXBANDS 60 /* Max number of bands */ #define BINAURAL_CONVBANDS 50 /* Bands upto which convolution is performed */ #define BINAURAL_NTAPS 5 + +#ifdef UPDATE_FASTCONV_SBA_FILTER +#define BINAURAL_NTAPS_SBA 3 +#endif + #define BINAURAL_NTAPS_MAX 96 #define HRTF_SH_ORDER 3 diff --git a/lib_com/options.h b/lib_com/options.h index 86ff4ca1d2..5de98c1a11 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ +#define UPDATE_FASTCONV_SBA_FILTER /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 5bd09236e0..cc855055ec 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -180,7 +180,18 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( hBinRenderer->ivas_format == SBA_FORMAT ) + { + hBinRenConvModule->numTaps = BINAURAL_NTAPS_SBA; + } + else + { + hBinRenConvModule->numTaps = BINAURAL_NTAPS; + } +#else hBinRenConvModule->numTaps = BINAURAL_NTAPS; +#endif /* Use fixed order filtering */ bandIdx = 0; @@ -429,6 +440,29 @@ static ivas_error ivas_binaural_hrtf_open( mvr2r( rightBRIRImag[i][j], HrtfFastConv->rightBRIRImag[i][j], BINAURAL_NTAPS_MAX ); } +#ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { + mvr2r( leftHRIRReal_HOA3[i][j], HrtfFastConv->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( leftHRIRImag_HOA3[i][j], HrtfFastConv->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRReal_HOA3[i][j], HrtfFastConv->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRImag_HOA3[i][j], HrtfFastConv->rightHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); + } + for ( j = 0; j < 9; j++ ) + { + mvr2r( leftHRIRReal_HOA2[i][j], HrtfFastConv->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( leftHRIRImag_HOA2[i][j], HrtfFastConv->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRReal_HOA2[i][j], HrtfFastConv->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRImag_HOA2[i][j], HrtfFastConv->rightHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); + } + for ( j = 0; j < 4; j++ ) + { + mvr2r( leftHRIRReal_FOA[i][j], HrtfFastConv->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( leftHRIRImag_FOA[i][j], HrtfFastConv->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRReal_FOA[i][j], HrtfFastConv->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); + mvr2r( rightHRIRImag_FOA[i][j], HrtfFastConv->rightHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); + } +#else for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { mvr2r( leftHRIRReal_HOA3[i][j], HrtfFastConv->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS ); @@ -450,6 +484,7 @@ static ivas_error ivas_binaural_hrtf_open( mvr2r( rightHRIRReal_FOA[i][j], HrtfFastConv->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS ); mvr2r( rightHRIRImag_FOA[i][j], HrtfFastConv->rightHRIRImag_FOA[i][j], BINAURAL_NTAPS ); } +#endif } mvr2r( fastconvReverberationTimes, HrtfFastConv->fastconvReverberationTimes, CLDFB_NO_CHANNELS_MAX ); diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index 7c7c2c694e..2aea03c406 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -56,6 +56,7 @@ +#ifndef UPDATE_FASTCONV_SBA_FILTER const float FASTCONV_HOA3_latency_s = 0.000666667f; const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS]= { @@ -3673,8 +3674,3628 @@ const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS]= } }; +#else +const float FASTCONV_HOA3_latency_s = 0.000020833f; +const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +{ + { + {+0.353305f, +0.566845f, +0.200116f}, + {+0.451504f, -0.563006f, +0.083565f}, + {+0.022092f, +0.111945f, -0.003135f}, + {+0.047133f, +0.000194f, -0.000386f}, + {+0.039375f, -0.036049f, -0.015307f}, + {+0.013502f, -0.004406f, +0.016833f}, + {-0.050267f, +0.058356f, +0.017434f}, + {-0.013681f, +0.080836f, -0.019699f}, + {-0.037136f, +0.024371f, +0.052200f}, + {+0.050122f, -0.078803f, -0.019790f}, + {-0.004565f, +0.007656f, -0.001338f}, + {+0.009821f, -0.051585f, -0.003219f}, + {-0.003833f, -0.023411f, -0.003160f}, + {+0.007736f, -0.042621f, +0.010291f}, + {+0.014210f, -0.003392f, -0.001270f}, + {-0.005609f, +0.001063f, +0.001854f} + }, + { + {+0.011160f, -0.509237f, -0.132176f}, + {+0.142996f, -0.819544f, +0.093135f}, + {+0.003358f, +0.077333f, -0.008548f}, + {+0.004495f, +0.024167f, +0.025614f}, + {+0.020911f, +0.057490f, +0.024558f}, + {+0.020938f, +0.024631f, +0.022840f}, + {-0.049990f, -0.113634f, -0.053590f}, + {+0.010020f, +0.210234f, +0.026992f}, + {-0.094579f, -0.407023f, -0.103353f}, + {+0.038956f, +0.088489f, +0.058039f}, + {+0.002875f, +0.015645f, -0.000778f}, + {+0.020714f, +0.104784f, +0.070444f}, + {-0.008794f, +0.002924f, +0.009615f}, + {+0.004361f, -0.056762f, +0.007070f}, + {+0.010128f, +0.073116f, +0.035032f}, + {-0.005641f, -0.006012f, -0.000245f} + }, + { + {-0.192410f, -0.206164f, -0.191132f}, + {-0.278956f, +0.236216f, -0.253095f}, + {-0.002616f, +0.068222f, +0.000710f}, + {-0.043976f, +0.107663f, +0.006000f}, + {-0.022830f, +0.121862f, +0.008267f}, + {+0.007646f, +0.104913f, -0.016048f}, + {+0.008805f, -0.278895f, +0.005919f}, + {+0.015200f, +0.180293f, +0.037960f}, + {-0.037987f, -0.531186f, -0.053722f}, + {-0.053411f, +0.405963f, -0.066106f}, + {+0.004225f, +0.049392f, -0.020098f}, + {-0.032849f, +0.404382f, -0.057080f}, + {-0.020343f, +0.025697f, +0.003018f}, + {+0.000399f, -0.049237f, +0.005564f}, + {-0.018895f, +0.170897f, -0.004768f}, + {-0.014229f, +0.049740f, -0.026663f} + }, + { + {-0.062917f, +0.511673f, +0.062418f}, + {-0.164174f, +1.090974f, +0.108397f}, + {+0.009127f, +0.065188f, -0.003083f}, + {-0.018593f, +0.081738f, -0.000771f}, + {-0.020686f, +0.093603f, +0.012011f}, + {+0.000826f, +0.118498f, -0.001498f}, + {+0.025996f, -0.307659f, -0.023797f}, + {-0.008194f, +0.054598f, -0.009722f}, + {+0.040351f, -0.445888f, -0.056326f}, + {-0.030847f, +0.708631f, +0.081623f}, + {+0.002063f, +0.033938f, -0.025075f}, + {-0.027403f, +0.458795f, -0.033429f}, + {-0.021373f, -0.007009f, -0.010388f}, + {-0.002090f, -0.031407f, +0.008158f}, + {-0.028475f, +0.071069f, -0.046847f}, + {-0.007602f, +0.116385f, +0.002531f} + }, + { + {+0.114739f, +0.069536f, +0.170911f}, + {+0.106068f, +0.653946f, +0.186091f}, + {+0.032435f, +0.023922f, +0.003440f}, + {+0.048701f, +0.139999f, -0.053329f}, + {+0.008680f, +0.251941f, -0.071200f}, + {-0.004397f, +0.120323f, +0.000310f}, + {+0.025654f, -0.324361f, -0.006461f}, + {-0.004810f, +0.061858f, -0.007597f}, + {+0.097919f, -0.641143f, +0.015289f}, + {+0.011357f, +0.557580f, +0.143138f}, + {+0.004726f, -0.016709f, +0.000434f}, + {+0.013229f, +0.166606f, +0.093126f}, + {-0.007411f, +0.011792f, -0.021547f}, + {-0.005396f, -0.034575f, +0.011453f}, + {+0.010644f, +0.011719f, -0.021909f}, + {+0.005419f, +0.030988f, +0.043631f} + }, + { + {+0.066623f, -0.089947f, +0.096291f}, + {+0.228582f, +0.462839f, +0.023355f}, + {+0.030597f, +0.055459f, +0.010541f}, + {+0.104887f, +0.337465f, -0.003674f}, + {+0.072691f, +0.405228f, -0.038864f}, + {+0.004864f, +0.081470f, -0.022241f}, + {+0.026067f, -0.215427f, +0.055659f}, + {+0.015556f, +0.034465f, -0.026853f}, + {+0.081559f, -0.329728f, +0.167841f}, + {+0.004434f, +0.224966f, -0.027520f}, + {+0.000854f, -0.017986f, +0.001169f}, + {-0.017103f, +0.022207f, +0.026879f}, + {+0.016949f, +0.070641f, -0.004353f}, + {-0.006585f, -0.086138f, -0.004695f}, + {+0.059412f, +0.107209f, +0.004895f}, + {+0.005676f, -0.059162f, +0.003180f} + }, + { + {-0.248577f, +0.462186f, -0.044825f}, + {+0.092220f, +0.576619f, +0.031483f}, + {-0.018552f, +0.118241f, -0.000190f}, + {+0.024038f, +0.192235f, +0.076006f}, + {+0.073463f, +0.111697f, +0.085309f}, + {+0.045418f, +0.052428f, -0.014128f}, + {+0.004341f, -0.088144f, -0.002830f}, + {+0.058183f, -0.067481f, +0.003537f}, + {-0.112838f, +0.181474f, -0.013812f}, + {+0.051144f, +0.057123f, +0.036471f}, + {-0.002310f, -0.009489f, -0.002928f}, + {-0.036815f, +0.070367f, +0.013190f}, + {+0.025238f, +0.001933f, +0.022381f}, + {+0.011799f, -0.070089f, -0.017261f}, + {+0.079383f, -0.005050f, +0.042259f}, + {+0.027513f, -0.031781f, -0.014727f} + }, + { + {-0.588729f, +0.069942f, -0.118192f}, + {-0.336864f, -0.087523f, -0.133178f}, + {-0.091818f, +0.000222f, -0.031435f}, + {-0.240072f, -0.209090f, -0.026656f}, + {-0.106536f, -0.210008f, -0.006949f}, + {+0.086566f, +0.077574f, -0.013942f}, + {+0.036640f, -0.012230f, +0.021355f}, + {+0.059977f, -0.024737f, +0.017673f}, + {-0.214469f, +0.026100f, -0.046140f}, + {+0.016107f, -0.082852f, -0.011968f}, + {-0.003608f, +0.021470f, +0.008749f}, + {-0.046323f, -0.010871f, -0.015628f}, + {-0.008214f, -0.079699f, -0.002987f}, + {+0.052373f, +0.029312f, +0.014086f}, + {+0.018742f, -0.113603f, +0.010455f}, + {+0.059520f, +0.032936f, +0.004294f} + }, + { + {-0.672439f, -0.199370f, +0.003424f}, + {-0.631922f, -0.138094f, -0.043549f}, + {-0.130748f, -0.058055f, -0.001266f}, + {-0.452933f, -0.003480f, -0.056408f}, + {-0.285057f, +0.030036f, -0.056968f}, + {+0.110275f, -0.011467f, +0.016793f}, + {+0.065972f, +0.005614f, +0.004420f}, + {-0.003151f, +0.047883f, +0.002061f}, + {-0.163084f, -0.130815f, +0.001810f}, + {-0.019555f, -0.025290f, -0.023258f}, + {-0.018781f, +0.034389f, +0.006142f}, + {-0.002509f, -0.046479f, -0.009162f}, + {-0.041047f, -0.024011f, -0.016940f}, + {+0.065623f, +0.027310f, +0.010505f}, + {-0.073560f, +0.039971f, -0.029159f}, + {+0.062876f, +0.006797f, +0.012019f} + }, + { + {-0.543455f, +0.059523f, +0.064094f}, + {-0.700107f, +0.080270f, +0.041520f}, + {-0.154990f, -0.009275f, +0.018360f}, + {-0.474326f, +0.126377f, -0.003035f}, + {-0.327360f, +0.114048f, -0.014833f}, + {+0.071241f, -0.058994f, +0.004572f}, + {+0.087784f, +0.000125f, -0.001107f}, + {-0.094160f, -0.038960f, -0.011917f}, + {-0.019089f, +0.055284f, +0.038765f}, + {-0.023647f, +0.039958f, +0.003588f}, + {-0.043021f, -0.013443f, -0.008032f}, + {+0.077825f, +0.044990f, +0.010103f}, + {-0.040861f, +0.021619f, +0.002193f}, + {+0.044745f, -0.030859f, -0.007951f}, + {-0.123807f, +0.055927f, -0.012492f}, + {+0.025663f, -0.034745f, +0.003611f} + }, + { + {-0.336060f, +0.028886f, +0.031505f}, + {-0.587287f, -0.009083f, +0.042775f}, + {-0.182505f, +0.025753f, +0.007772f}, + {-0.327915f, -0.064183f, +0.035026f}, + {-0.233666f, -0.067260f, +0.031214f}, + {-0.007323f, +0.030500f, -0.014877f}, + {+0.086165f, +0.005866f, -0.002682f}, + {-0.157983f, -0.017671f, -0.007972f}, + {+0.103610f, +0.038997f, +0.019660f}, + {-0.007681f, -0.004657f, +0.015128f}, + {-0.055812f, -0.017923f, -0.003300f}, + {+0.143968f, +0.013845f, +0.008347f}, + {-0.017716f, -0.004963f, +0.006287f}, + {+0.008786f, -0.012160f, -0.007210f}, + {-0.121102f, -0.034578f, +0.019391f}, + {-0.032193f, +0.031317f, -0.010154f} + }, + { + {-0.153248f, -0.008370f, -0.009310f}, + {-0.402033f, +0.000118f, +0.012937f}, + {-0.199763f, -0.006595f, +0.001228f}, + {-0.128842f, +0.004526f, +0.020419f}, + {-0.092842f, -0.010605f, +0.021993f}, + {-0.077909f, +0.025349f, -0.002895f}, + {+0.057392f, -0.008479f, -0.003710f}, + {-0.165419f, +0.022789f, +0.007822f}, + {+0.148908f, -0.037324f, -0.013709f}, + {+0.011296f, -0.018097f, +0.005621f}, + {-0.055136f, +0.008613f, +0.006635f}, + {+0.160576f, -0.015557f, -0.006131f}, + {+0.014844f, -0.003364f, +0.000064f}, + {-0.027453f, -0.001660f, +0.003786f}, + {-0.097934f, -0.032125f, +0.013700f}, + {-0.074549f, +0.020854f, -0.006292f} + }, + { + {-0.021458f, -0.031294f, -0.015786f}, + {-0.225566f, -0.016671f, -0.005476f}, + {-0.179128f, -0.006436f, +0.000989f}, + {+0.030888f, -0.004116f, -0.001010f}, + {+0.023526f, +0.004404f, -0.002301f}, + {-0.113727f, -0.001584f, +0.014207f}, + {+0.006187f, +0.003628f, -0.000322f}, + {-0.130415f, +0.000132f, +0.008388f}, + {+0.133114f, -0.001415f, -0.020106f}, + {+0.026233f, +0.006894f, -0.005590f}, + {-0.046982f, +0.011852f, +0.003518f}, + {+0.124161f, +0.003790f, -0.005992f}, + {+0.039303f, -0.005121f, -0.003574f}, + {-0.061746f, +0.020157f, -0.000385f}, + {-0.073801f, +0.016410f, -0.009153f}, + {-0.089034f, -0.008662f, +0.006612f} + }, + { + {+0.079072f, +0.039673f, -0.003004f}, + {-0.077618f, +0.033045f, -0.007328f}, + {-0.090967f, +0.027848f, +0.000971f}, + {+0.121511f, -0.002007f, -0.010039f}, + {+0.095609f, +0.005944f, -0.008880f}, + {-0.100415f, -0.015820f, +0.006869f}, + {-0.060544f, -0.012856f, +0.004470f}, + {-0.077695f, +0.001667f, -0.001003f}, + {+0.092912f, +0.018201f, -0.005273f}, + {+0.040823f, +0.014455f, -0.004325f}, + {-0.030102f, +0.002197f, -0.002719f}, + {+0.043620f, -0.016980f, -0.000122f}, + {+0.041014f, +0.001499f, -0.001303f}, + {-0.088431f, +0.009078f, -0.001327f}, + {-0.051030f, +0.024992f, -0.008833f}, + {-0.091055f, -0.011437f, +0.003728f} + }, + { + {+0.165755f, -0.020564f, +0.004876f}, + {+0.050384f, -0.037239f, -0.000994f}, + {+0.070084f, -0.036144f, -0.001750f}, + {+0.168503f, -0.016906f, -0.008961f}, + {+0.141507f, -0.014408f, -0.005947f}, + {-0.022796f, -0.010807f, -0.007047f}, + {-0.126569f, +0.016739f, +0.005274f}, + {-0.026827f, -0.017151f, -0.002196f}, + {+0.045512f, +0.004295f, +0.005991f}, + {+0.054896f, -0.008311f, +0.001754f}, + {-0.003645f, -0.010307f, -0.002009f}, + {-0.057176f, +0.014805f, +0.004774f}, + {+0.011072f, +0.010642f, -0.000248f}, + {-0.108885f, -0.004650f, +0.007771f}, + {-0.039664f, -0.018793f, +0.005550f}, + {-0.092338f, -0.000767f, -0.000795f} + }, + { + {+0.239774f, +0.007034f, +0.002631f}, + {+0.158490f, +0.023748f, +0.003698f}, + {+0.270403f, +0.044381f, -0.006888f}, + {+0.208319f, +0.016522f, -0.001863f}, + {+0.188853f, +0.017009f, -0.001321f}, + {+0.109689f, +0.039932f, -0.010880f}, + {-0.162224f, -0.011965f, +0.002284f}, + {+0.008275f, +0.010941f, +0.003208f}, + {-0.008632f, -0.022468f, +0.003767f}, + {+0.062087f, -0.004201f, +0.001503f}, + {+0.024938f, +0.010189f, +0.000489f}, + {-0.144572f, -0.021004f, +0.007356f}, + {-0.046268f, -0.010126f, +0.001327f}, + {-0.126844f, -0.020412f, +0.005586f}, + {-0.049688f, -0.012221f, +0.009513f}, + {-0.100800f, -0.001133f, +0.001097f} + }, + { + {+0.298828f, -0.005793f, -0.001373f}, + {+0.237768f, -0.008765f, +0.003046f}, + {+0.449357f, -0.047352f, -0.004642f}, + {+0.250753f, -0.004865f, -0.001957f}, + {+0.245484f, -0.010819f, -0.000881f}, + {+0.249706f, -0.049408f, -0.003961f}, + {-0.136738f, -0.008753f, -0.001855f}, + {+0.025853f, +0.003385f, +0.004139f}, + {-0.065934f, +0.022501f, -0.003288f}, + {+0.057527f, +0.008394f, -0.002717f}, + {+0.046206f, -0.004855f, +0.002123f}, + {-0.183725f, +0.015903f, +0.001405f}, + {-0.114051f, +0.012348f, +0.005264f}, + {-0.129436f, +0.010088f, -0.004805f}, + {-0.071460f, +0.022939f, +0.001488f}, + {-0.119149f, +0.009223f, +0.000555f} + }, + { + {+0.346011f, +0.008343f, -0.002521f}, + {+0.286535f, -0.000576f, -0.000480f}, + {+0.541635f, +0.014116f, +0.002290f}, + {+0.286228f, +0.009795f, -0.003869f}, + {+0.299965f, +0.009735f, -0.003167f}, + {+0.328736f, +0.018968f, +0.006082f}, + {-0.037520f, +0.034439f, -0.002184f}, + {+0.042204f, -0.003541f, +0.000630f}, + {-0.115659f, -0.004656f, -0.004969f}, + {+0.039051f, -0.003041f, -0.004257f}, + {+0.056424f, +0.001120f, +0.003167f}, + {-0.144869f, +0.019123f, -0.003415f}, + {-0.166286f, -0.018086f, +0.003983f}, + {-0.101679f, +0.021538f, -0.005021f}, + {-0.078280f, -0.006671f, -0.006794f}, + {-0.140047f, -0.004747f, -0.001252f} + }, + { + {+0.388388f, -0.009881f, -0.001847f}, + {+0.316128f, -0.000090f, -0.004009f}, + {+0.513290f, +0.035603f, +0.000300f}, + {+0.296513f, -0.005786f, -0.000267f}, + {+0.333378f, -0.007221f, -0.002877f}, + {+0.295424f, +0.041070f, +0.003600f}, + {+0.114311f, -0.042170f, +0.000214f}, + {+0.081378f, -0.006284f, -0.003240f}, + {-0.150267f, -0.005614f, +0.000485f}, + {+0.005390f, +0.000214f, -0.000390f}, + {+0.064645f, +0.002835f, +0.002892f}, + {-0.026756f, -0.044985f, +0.000392f}, + {-0.170480f, -0.001979f, -0.000156f}, + {-0.050780f, -0.025790f, +0.003317f}, + {-0.047515f, -0.026029f, -0.004739f}, + {-0.153995f, -0.004894f, +0.001183f} + }, + { + {+0.430636f, +0.009808f, -0.001195f}, + {+0.343293f, +0.010478f, -0.003913f}, + {+0.388765f, -0.049553f, -0.008265f}, + {+0.266407f, -0.016789f, +0.000864f}, + {+0.328141f, -0.007654f, -0.002512f}, + {+0.155445f, -0.060858f, -0.009380f}, + {+0.269010f, +0.026881f, -0.000978f}, + {+0.158656f, +0.025362f, -0.003743f}, + {-0.171832f, +0.002756f, +0.006554f}, + {-0.043647f, -0.009482f, +0.003918f}, + {+0.090667f, -0.001476f, -0.001048f}, + {+0.132548f, +0.036105f, +0.003022f}, + {-0.106351f, +0.024154f, -0.000421f}, + {-0.000521f, +0.009705f, +0.007542f}, + {+0.019829f, +0.036619f, +0.006700f}, + {-0.155900f, +0.002824f, +0.004883f} + }, + { + {+0.471455f, -0.008296f, -0.001200f}, + {+0.377731f, -0.016768f, +0.000590f}, + {+0.234888f, +0.026343f, -0.008776f}, + {+0.198215f, +0.029257f, -0.004797f}, + {+0.279113f, +0.015431f, -0.003236f}, + {-0.033581f, +0.032760f, -0.011351f}, + {+0.370767f, -0.006318f, -0.006828f}, + {+0.266209f, -0.029783f, -0.001410f}, + {-0.185419f, +0.012636f, +0.005498f}, + {-0.100533f, +0.019010f, +0.003209f}, + {+0.151097f, -0.010446f, -0.007094f}, + {+0.274631f, -0.012724f, -0.003901f}, + {+0.013966f, -0.029859f, -0.001195f}, + {+0.031705f, +0.010192f, +0.002683f}, + {+0.102880f, -0.011055f, +0.011106f}, + {-0.143777f, +0.006427f, +0.002026f} + }, + { + {+0.505485f, +0.006321f, -0.001405f}, + {+0.419164f, +0.009705f, +0.004024f}, + {+0.115231f, -0.006245f, -0.000430f}, + {+0.110599f, -0.013787f, -0.006578f}, + {+0.197526f, -0.015552f, -0.000736f}, + {-0.208411f, -0.008219f, +0.002566f}, + {+0.381442f, -0.001142f, -0.007728f}, + {+0.371664f, +0.016115f, -0.002975f}, + {-0.191819f, -0.017185f, -0.004447f}, + {-0.147317f, -0.015855f, -0.001243f}, + {+0.239821f, +0.029217f, -0.008681f}, + {+0.348287f, +0.007454f, -0.010181f}, + {+0.149521f, +0.030650f, -0.003365f}, + {+0.048588f, -0.006717f, -0.005355f}, + {+0.186826f, -0.010831f, -0.001024f}, + {-0.115953f, +0.001790f, -0.004618f} + }, + { + {+0.527959f, -0.004605f, -0.000793f}, + {+0.465933f, +0.000734f, +0.000648f}, + {+0.058769f, +0.003399f, +0.003980f}, + {+0.020939f, +0.002500f, +0.001602f}, + {+0.102989f, +0.023640f, +0.000907f}, + {-0.330754f, +0.015227f, +0.013490f}, + {+0.293504f, +0.012966f, +0.002367f}, + {+0.435673f, -0.007769f, -0.006056f}, + {-0.189456f, -0.010551f, -0.008519f}, + {-0.165864f, -0.001568f, -0.003516f}, + {+0.320806f, -0.034715f, -0.000873f}, + {+0.324855f, -0.004016f, -0.002288f}, + {+0.248230f, -0.023651f, -0.001117f}, + {+0.067435f, -0.016300f, -0.003833f}, + {+0.272913f, -0.007587f, -0.015541f}, + {-0.076620f, -0.021772f, -0.003143f} + }, + { + {+0.537963f, +0.000122f, -0.000129f}, + {+0.521439f, +0.006120f, -0.005687f}, + {+0.059349f, +0.002731f, +0.001179f}, + {-0.063524f, -0.015179f, +0.008462f}, + {+0.018295f, -0.018831f, -0.001086f}, + {-0.382316f, -0.020820f, +0.008228f}, + {+0.133723f, -0.051158f, +0.007642f}, + {+0.427333f, -0.004801f, -0.004396f}, + {-0.189172f, +0.025571f, +0.003440f}, + {-0.153064f, +0.017940f, +0.000618f}, + {+0.344855f, +0.000841f, +0.007255f}, + {+0.204120f, -0.035702f, +0.007554f}, + {+0.269414f, -0.005639f, +0.002449f}, + {+0.098719f, +0.013856f, +0.002962f}, + {+0.355359f, +0.040342f, -0.012703f}, + {-0.043435f, +0.014923f, +0.004398f} + }, + { + {+0.539918f, +0.002520f, -0.000803f}, + {+0.586780f, -0.022878f, -0.005664f}, + {+0.088465f, -0.012487f, -0.000009f}, + {-0.133857f, +0.024436f, +0.005429f}, + {-0.038815f, +0.004600f, -0.001199f}, + {-0.354019f, -0.005760f, -0.002225f}, + {-0.035479f, +0.061479f, -0.003852f}, + {+0.333448f, +0.030542f, -0.002292f}, + {-0.214917f, +0.009773f, +0.013046f}, + {-0.126578f, -0.010093f, +0.005470f}, + {+0.286447f, +0.044878f, +0.001444f}, + {+0.026257f, +0.067149f, +0.001093f}, + {+0.208042f, +0.035382f, -0.000884f}, + {+0.140716f, -0.000405f, +0.001329f}, + {+0.398750f, -0.026334f, +0.002502f}, + {-0.035058f, +0.007558f, +0.005919f} + }, + { + {+0.542223f, +0.000691f, -0.001439f}, + {+0.649673f, +0.023205f, +0.000535f}, + {+0.109219f, +0.005980f, +0.002282f}, + {-0.171779f, -0.010220f, -0.000656f}, + {-0.066150f, +0.005365f, +0.002547f}, + {-0.254746f, +0.041005f, -0.002026f}, + {-0.138924f, -0.008674f, -0.012149f}, + {+0.169249f, -0.044112f, -0.002599f}, + {-0.272638f, -0.040677f, +0.004640f}, + {-0.110153f, -0.006462f, +0.003434f}, + {+0.169903f, -0.042984f, -0.010056f}, + {-0.132794f, -0.036153f, -0.009130f}, + {+0.102112f, -0.031703f, -0.006139f}, + {+0.188913f, +0.004870f, -0.004839f}, + {+0.357390f, -0.030371f, +0.006291f}, + {-0.051114f, -0.020551f, -0.000894f} + }, + { + {+0.551847f, -0.004875f, -0.000679f}, + {+0.690272f, -0.004312f, +0.004016f}, + {+0.095639f, +0.010071f, +0.002809f}, + {-0.161818f, -0.013824f, -0.000790f}, + {-0.076081f, +0.002390f, +0.004308f}, + {-0.122361f, -0.040035f, +0.004601f}, + {-0.144006f, -0.036671f, -0.003198f}, + {-0.024466f, +0.039610f, -0.000882f}, + {-0.331827f, +0.020929f, -0.006635f}, + {-0.113319f, +0.007876f, -0.000927f}, + {+0.048322f, +0.009251f, -0.008004f}, + {-0.207982f, -0.015726f, -0.004350f}, + {+0.006949f, +0.009330f, -0.004246f}, + {+0.233905f, -0.014811f, -0.005355f}, + {+0.223143f, +0.054998f, -0.002434f}, + {-0.070208f, +0.002186f, -0.004895f} + }, + { + {+0.570043f, +0.005432f, +0.000103f}, + {+0.699360f, -0.014398f, -0.000427f}, + {+0.048501f, -0.018143f, +0.001306f}, + {-0.107295f, +0.023902f, +0.003671f}, + {-0.082584f, -0.006076f, +0.001731f}, + {-0.005834f, +0.019340f, +0.006865f}, + {-0.085415f, +0.035831f, +0.009933f}, + {-0.202459f, -0.035934f, +0.000303f}, + {-0.353113f, +0.015051f, -0.004263f}, + {-0.130123f, -0.004257f, -0.001776f}, + {-0.043254f, -0.003167f, +0.001496f}, + {-0.189334f, +0.031601f, +0.007634f}, + {-0.040215f, +0.005301f, +0.001534f}, + {+0.256999f, +0.008098f, -0.001598f}, + {+0.036347f, -0.049036f, -0.008301f}, + {-0.070389f, +0.011544f, -0.000794f} + }, + { + {+0.593416f, -0.005649f, +0.000278f}, + {+0.688298f, +0.007364f, -0.005463f}, + {-0.008044f, +0.018190f, -0.001207f}, + {-0.030689f, -0.015365f, +0.004543f}, + {-0.091891f, +0.004696f, -0.000919f}, + {+0.064670f, +0.007573f, +0.000965f}, + {-0.030187f, +0.002153f, +0.010834f}, + {-0.331404f, +0.015975f, +0.000858f}, + {-0.323976f, -0.025164f, +0.004961f}, + {-0.148829f, -0.000188f, +0.000078f}, + {-0.101305f, +0.006103f, +0.005181f}, + {-0.115300f, -0.016832f, +0.010749f}, + {-0.032766f, -0.011589f, +0.005290f}, + {+0.239406f, +0.007974f, +0.000705f}, + {-0.145255f, +0.023713f, -0.004941f}, + {-0.046369f, -0.012177f, +0.003695f} + }, + { + {+0.616579f, +0.002929f, -0.000295f}, + {+0.676588f, +0.004629f, -0.003842f}, + {-0.043537f, -0.004766f, -0.003324f}, + {+0.044220f, +0.013845f, +0.003072f}, + {-0.101856f, +0.006437f, +0.001748f}, + {+0.092523f, -0.007377f, -0.006975f}, + {-0.023470f, -0.026713f, -0.000479f}, + {-0.400554f, +0.001062f, +0.004867f}, + {-0.261565f, +0.014128f, +0.007944f}, + {-0.159121f, +0.002751f, +0.002980f}, + {-0.138765f, -0.008950f, +0.004189f}, + {-0.034625f, -0.000481f, +0.002727f}, + {+0.012613f, +0.005909f, +0.003331f}, + {+0.175748f, -0.024801f, -0.000902f}, + {-0.281594f, -0.008334f, +0.003990f}, + {-0.007054f, +0.002604f, +0.002155f} + }, + { + {+0.635179f, -0.002823f, -0.001148f}, + {+0.674199f, -0.007986f, +0.000991f}, + {-0.041014f, -0.013849f, -0.001185f}, + {+0.104750f, -0.003964f, +0.000987f}, + {-0.107619f, +0.003736f, +0.004502f}, + {+0.101204f, -0.003739f, -0.008397f}, + {-0.064575f, +0.021388f, -0.009658f}, + {-0.422196f, -0.004265f, +0.008954f}, + {-0.190975f, -0.003688f, +0.002622f}, + {-0.155793f, +0.001509f, +0.003088f}, + {-0.169274f, +0.008874f, +0.002289f}, + {+0.023162f, -0.001981f, -0.005597f}, + {+0.073018f, -0.010252f, -0.000970f}, + {+0.080452f, +0.024265f, -0.002891f}, + {-0.363635f, +0.004698f, +0.010523f}, + {+0.035663f, -0.006812f, -0.001722f} + }, + { + {+0.647447f, +0.003124f, -0.000778f}, + {+0.678396f, -0.001222f, +0.002175f}, + {-0.008003f, +0.018788f, +0.004232f}, + {+0.153771f, +0.006824f, -0.001505f}, + {-0.102284f, -0.006283f, +0.000369f}, + {+0.107854f, +0.015766f, -0.002536f}, + {-0.127703f, -0.002824f, -0.007472f}, + {-0.415367f, -0.005027f, +0.007128f}, + {-0.124975f, +0.011994f, -0.001327f}, + {-0.135698f, +0.002841f, +0.000522f}, + {-0.197083f, -0.008952f, +0.000525f}, + {+0.049410f, +0.008433f, -0.005306f}, + {+0.128034f, +0.008755f, -0.002993f}, + {-0.020098f, -0.017083f, -0.001266f}, + {-0.399229f, -0.010519f, +0.009961f}, + {+0.073610f, +0.013100f, -0.000219f} + }, + { + {+0.653287f, -0.000651f, -0.000132f}, + {+0.682914f, +0.002014f, -0.000124f}, + {+0.032972f, -0.005837f, +0.006215f}, + {+0.202805f, -0.008225f, -0.002812f}, + {-0.078083f, -0.005921f, -0.003749f}, + {+0.111320f, -0.004540f, +0.003693f}, + {-0.194460f, +0.001719f, +0.000738f}, + {-0.388630f, -0.001712f, +0.002133f}, + {-0.064250f, -0.011691f, -0.000978f}, + {-0.097911f, -0.010340f, -0.000589f}, + {-0.217935f, +0.002537f, -0.000189f}, + {+0.043003f, -0.001190f, -0.000648f}, + {+0.160424f, -0.006445f, -0.003025f}, + {-0.102796f, +0.011222f, +0.001449f}, + {-0.392994f, +0.003832f, +0.004205f}, + {+0.101814f, -0.004741f, +0.002529f} + }, + { + {+0.655085f, -0.000496f, -0.000073f}, + {+0.685269f, +0.000562f, -0.000824f}, + {+0.064749f, -0.008716f, +0.000371f}, + {+0.258268f, +0.016126f, -0.002727f}, + {-0.038467f, +0.019915f, -0.001374f}, + {+0.101519f, -0.013031f, +0.001724f}, + {-0.262717f, -0.010913f, +0.005785f}, + {-0.340935f, +0.010917f, -0.000109f}, + {-0.005117f, +0.011670f, -0.001141f}, + {-0.047975f, +0.015016f, +0.000510f}, + {-0.227673f, +0.001545f, +0.000844f}, + {+0.006815f, -0.010613f, +0.001679f}, + {+0.158152f, -0.002971f, -0.001763f}, + {-0.154604f, -0.004393f, +0.003495f}, + {-0.341946f, +0.012918f, +0.000060f}, + {+0.123129f, -0.003187f, +0.000554f} + }, + { + {+0.657162f, +0.001154f, -0.000704f}, + {+0.686405f, -0.001174f, +0.000024f}, + {+0.087607f, -0.002335f, -0.004967f}, + {+0.314889f, -0.015378f, -0.000770f}, + {-0.001549f, -0.013009f, +0.003904f}, + {+0.077871f, +0.011151f, -0.003120f}, + {-0.333383f, +0.022033f, +0.004891f}, + {-0.273704f, -0.019370f, +0.000308f}, + {+0.054701f, -0.011371f, -0.002150f}, + {+0.003312f, -0.012026f, +0.002061f}, + {-0.228798f, -0.001402f, +0.001592f}, + {-0.048684f, +0.018229f, +0.000520f}, + {+0.117088f, +0.012634f, -0.000896f}, + {-0.173410f, +0.001735f, +0.003820f}, + {-0.247906f, -0.029903f, +0.000682f}, + {+0.148293f, -0.000926f, -0.003582f} + }, + { + {+0.663635f, +0.002010f, -0.001316f}, + {+0.689882f, -0.000220f, +0.000110f}, + {+0.108949f, +0.013447f, -0.002013f}, + {+0.358661f, +0.009695f, +0.001033f}, + {+0.013352f, -0.004281f, +0.004550f}, + {+0.049096f, -0.001505f, -0.002637f}, + {-0.398463f, -0.021957f, -0.000327f}, + {-0.196600f, +0.019778f, +0.001903f}, + {+0.110988f, +0.014423f, -0.001867f}, + {+0.045870f, +0.004558f, +0.001576f}, + {-0.228188f, +0.000097f, +0.001476f}, + {-0.105835f, -0.015244f, -0.001995f}, + {+0.044580f, -0.021539f, -0.001382f}, + {-0.164082f, +0.001655f, +0.001885f}, + {-0.126620f, +0.032568f, +0.003705f}, + {+0.185481f, +0.013419f, -0.004184f} + }, + { + {+0.675624f, -0.004827f, -0.000839f}, + {+0.700179f, -0.002102f, -0.000678f}, + {+0.128613f, -0.006572f, +0.002141f}, + {+0.378743f, +0.002887f, +0.000648f}, + {+0.004220f, +0.012669f, +0.000801f}, + {+0.022440f, +0.000653f, +0.000869f}, + {-0.441665f, +0.002210f, -0.002042f}, + {-0.124814f, -0.014411f, +0.002833f}, + {+0.153596f, -0.007894f, -0.000675f}, + {+0.077085f, -0.001217f, -0.000703f}, + {-0.231308f, -0.000725f, +0.002147f}, + {-0.147273f, +0.003213f, -0.002198f}, + {-0.042268f, +0.020842f, -0.002800f}, + {-0.133721f, -0.009739f, +0.001057f}, + {-0.003152f, -0.021386f, +0.003714f}, + {+0.229253f, -0.015325f, -0.001319f} + }, + { + {+0.689875f, +0.004735f, +0.000183f}, + {+0.720017f, +0.006167f, -0.000699f}, + {+0.141755f, -0.003516f, +0.000834f}, + {+0.376706f, -0.006807f, -0.001713f}, + {-0.011000f, -0.005016f, -0.001618f}, + {+0.000647f, -0.004137f, +0.002283f}, + {-0.454292f, +0.009561f, +0.002281f}, + {-0.069428f, +0.004651f, +0.001574f}, + {+0.172906f, +0.000456f, -0.000712f}, + {+0.102160f, +0.005230f, -0.001608f}, + {-0.237600f, -0.001176f, +0.003651f}, + {-0.166513f, +0.006046f, +0.001258f}, + {-0.123162f, -0.009523f, -0.000972f}, + {-0.093037f, +0.007808f, +0.000738f}, + {+0.101706f, +0.008107f, -0.001772f}, + {+0.261899f, +0.005910f, +0.000263f} + }, + { + {+0.701449f, -0.001309f, +0.000513f}, + {+0.747852f, -0.007083f, -0.000295f}, + {+0.146674f, +0.002063f, -0.002067f}, + {+0.365508f, +0.004005f, -0.003093f}, + {-0.009820f, -0.003073f, -0.001694f}, + {-0.014954f, +0.005079f, +0.001243f}, + {-0.444057f, -0.005273f, +0.005170f}, + {-0.030220f, -0.001713f, -0.001402f}, + {+0.167308f, +0.005594f, -0.001307f}, + {+0.126894f, -0.005843f, -0.001163f}, + {-0.239461f, +0.006087f, +0.002206f}, + {-0.171030f, -0.001130f, +0.003837f}, + {-0.185728f, +0.008176f, +0.002303f}, + {-0.053859f, -0.008398f, -0.000003f}, + {+0.180213f, -0.012225f, -0.006311f}, + {+0.267399f, +0.003688f, -0.000070f} + }, + { + {+0.707682f, -0.001614f, -0.000417f}, + {+0.778938f, +0.006537f, -0.000334f}, + {+0.145291f, +0.002890f, -0.001284f}, + {+0.359528f, +0.005062f, -0.001469f}, + {+0.019378f, +0.015221f, -0.000076f}, + {-0.021977f, -0.000916f, +0.000266f}, + {-0.425305f, -0.000822f, +0.003160f}, + {+0.002113f, +0.007052f, -0.002427f}, + {+0.143996f, -0.006679f, -0.001487f}, + {+0.153276f, +0.008199f, -0.000318f}, + {-0.224106f, +0.002607f, -0.000957f}, + {-0.172702f, -0.005631f, +0.001975f}, + {-0.227595f, -0.009189f, +0.001906f}, + {-0.024550f, +0.006878f, +0.000998f}, + {+0.231993f, +0.016149f, -0.003555f}, + {+0.242520f, -0.012045f, -0.001170f} + }, + { + {+0.709804f, +0.000997f, -0.001515f}, + {+0.808027f, -0.005290f, -0.000583f}, + {+0.139809f, +0.000435f, +0.000818f}, + {+0.365924f, -0.006226f, +0.001737f}, + {+0.071369f, -0.017742f, +0.003060f}, + {-0.017802f, -0.003027f, +0.000621f}, + {-0.407651f, -0.000451f, +0.000175f}, + {+0.034591f, -0.007791f, -0.002030f}, + {+0.114950f, +0.006228f, -0.001120f}, + {+0.179490f, -0.006128f, +0.000795f}, + {-0.183246f, -0.015768f, -0.000773f}, + {-0.177035f, +0.003531f, -0.000696f}, + {-0.250400f, +0.001355f, +0.001108f}, + {-0.008187f, +0.000159f, +0.001456f}, + {+0.254611f, -0.001384f, -0.000532f}, + {+0.198496f, +0.013948f, -0.002759f} + }, + { + {+0.710823f, +0.002381f, -0.001069f}, + {+0.831214f, +0.003447f, -0.000878f}, + {+0.132056f, -0.007797f, -0.000969f}, + {+0.382880f, -0.001094f, +0.000711f}, + {+0.129160f, +0.007502f, +0.002763f}, + {-0.003161f, +0.000767f, -0.000443f}, + {-0.392711f, +0.006305f, +0.000815f}, + {+0.067053f, +0.011901f, -0.000327f}, + {+0.090742f, -0.003835f, -0.000996f}, + {+0.202084f, +0.000560f, -0.000195f}, + {-0.122322f, +0.020924f, +0.002535f}, + {-0.182462f, +0.002778f, +0.000258f}, + {-0.259161f, +0.001293f, +0.002195f}, + {+0.000645f, -0.003627f, -0.000469f}, + {+0.248733f, -0.007401f, -0.001654f}, + {+0.153178f, -0.008546f, -0.003483f} + }, + { + {+0.712186f, -0.002003f, +0.000341f}, + {+0.846788f, -0.001521f, -0.001394f}, + {+0.124294f, +0.003415f, -0.004317f}, + {+0.406372f, -0.002613f, -0.002804f}, + {+0.179207f, -0.002493f, -0.001438f}, + {+0.017437f, -0.004122f, -0.002593f}, + {-0.378082f, -0.002349f, +0.002279f}, + {+0.093160f, -0.004321f, +0.001305f}, + {+0.077016f, -0.001502f, +0.000076f}, + {+0.220676f, -0.001245f, -0.002361f}, + {-0.057208f, -0.011096f, +0.003599f}, + {-0.185276f, -0.001151f, +0.002614f}, + {-0.259729f, -0.001827f, +0.003455f}, + {+0.012127f, +0.000504f, -0.003413f}, + {+0.221948f, +0.010321f, -0.003531f}, + {+0.118717f, -0.000242f, -0.001468f} + }, + { + {+0.713662f, -0.000828f, +0.000545f}, + {+0.855438f, +0.002950f, -0.000977f}, + {+0.115830f, +0.005727f, -0.002674f}, + {+0.431080f, +0.008386f, -0.003025f}, + {+0.218522f, +0.008054f, -0.003300f}, + {+0.036091f, +0.008702f, -0.001428f}, + {-0.359216f, +0.001218f, +0.000904f}, + {+0.107642f, -0.001544f, +0.000220f}, + {+0.072571f, -0.000752f, +0.000715f}, + {+0.237634f, +0.007061f, -0.001792f}, + {-0.001551f, +0.003678f, +0.000322f}, + {-0.181633f, -0.003122f, +0.001514f}, + {-0.255564f, -0.003731f, +0.002293f}, + {+0.032826f, +0.012636f, -0.002484f}, + {+0.185211f, -0.004024f, -0.002705f}, + {+0.094101f, -0.001623f, +0.001061f} + }, + { + {+0.715808f, +0.001447f, -0.000564f}, + {+0.858599f, -0.000128f, -0.000166f}, + {+0.099314f, +0.001041f, +0.001297f}, + {+0.448457f, -0.007760f, -0.000064f}, + {+0.248826f, -0.008996f, -0.001277f}, + {+0.041985f, -0.000319f, +0.000791f}, + {-0.330901f, -0.006650f, -0.000552f}, + {+0.113746f, +0.002963f, -0.001774f}, + {+0.073588f, -0.000327f, +0.000159f}, + {+0.253601f, -0.004683f, +0.000245f}, + {+0.041369f, -0.004973f, -0.002735f}, + {-0.166731f, -0.003863f, -0.000533f}, + {-0.246518f, -0.001268f, -0.000049f}, + {+0.057814f, -0.010629f, +0.001615f}, + {+0.147641f, +0.004485f, +0.000244f}, + {+0.070521f, +0.005007f, +0.001670f} + }, + { + {+0.720382f, +0.001583f, -0.001168f}, + {+0.858507f, -0.001602f, -0.000561f}, + {+0.067329f, -0.015190f, +0.000273f}, + {+0.450274f, -0.005070f, +0.000753f}, + {+0.271109f, +0.002256f, -0.000399f}, + {+0.028488f, -0.011815f, -0.001154f}, + {-0.292330f, +0.012166f, +0.000199f}, + {+0.120202f, +0.001560f, -0.002785f}, + {+0.077618f, +0.000385f, -0.000057f}, + {+0.267478f, -0.001019f, -0.000455f}, + {+0.074822f, +0.008817f, -0.002528f}, + {-0.138952f, +0.011104f, +0.000590f}, + {-0.231196f, +0.009528f, +0.001492f}, + {+0.074656f, -0.000989f, +0.002061f}, + {+0.113858f, -0.008628f, +0.000648f}, + {+0.041189f, -0.009773f, +0.000867f} + }, + { + {+0.728412f, -0.003781f, -0.000442f}, + {+0.858915f, +0.000641f, -0.001243f}, + {+0.021588f, +0.015568f, -0.003718f}, + {+0.435021f, +0.011190f, -0.002580f}, + {+0.286107f, +0.000454f, -0.002042f}, + {-0.001012f, +0.010763f, -0.004584f}, + {-0.248323f, -0.011164f, +0.001788f}, + {+0.134196f, -0.006281f, -0.001978f}, + {+0.082702f, +0.001367f, -0.001190f}, + {+0.278772f, +0.000302f, -0.002741f}, + {+0.102933f, -0.009391f, +0.000025f}, + {-0.103537f, -0.008673f, +0.002139f}, + {-0.211947f, -0.006496f, +0.004418f}, + {+0.077185f, +0.005220f, -0.000312f}, + {+0.087037f, +0.006765f, -0.000943f}, + {+0.005530f, +0.010882f, -0.000993f} + }, + { + {+0.738976f, +0.002329f, +0.000136f}, + {+0.861896f, -0.000932f, -0.002377f}, + {-0.029402f, -0.003271f, -0.002468f}, + {+0.408989f, -0.003243f, -0.003584f}, + {+0.293612f, +0.002313f, -0.002730f}, + {-0.038002f, -0.000412f, -0.002803f}, + {-0.206194f, +0.003320f, +0.000488f}, + {+0.155421f, +0.006078f, -0.001116f}, + {+0.087818f, +0.003223f, -0.001518f}, + {+0.285833f, +0.006231f, -0.001960f}, + {+0.128249f, +0.001074f, +0.000243f}, + {-0.068575f, +0.002940f, +0.000700f}, + {-0.191804f, -0.003014f, +0.002724f}, + {+0.067942f, -0.005643f, -0.002245f}, + {+0.068213f, -0.000980f, -0.001053f}, + {-0.030778f, -0.002407f, -0.000036f} + }, + { + {+0.750300f, +0.000058f, -0.000825f}, + {+0.866279f, -0.001749f, -0.003432f}, + {-0.078123f, -0.003921f, +0.005991f}, + {+0.379010f, -0.005518f, +0.002243f}, + {+0.292486f, -0.009941f, +0.001947f}, + {-0.075433f, -0.005336f, +0.005378f}, + {-0.170771f, -0.002341f, -0.003169f}, + {+0.177886f, -0.005886f, -0.000679f}, + {+0.091281f, -0.005785f, +0.001198f}, + {+0.285767f, -0.012433f, +0.005156f}, + {+0.152796f, +0.004962f, -0.005079f}, + {-0.040112f, -0.002644f, -0.001940f}, + {-0.171647f, +0.007661f, -0.004705f}, + {+0.053028f, -0.000873f, -0.001571f}, + {+0.054373f, -0.002064f, +0.001211f}, + {-0.062123f, +0.000837f, +0.004082f} + }, + { + {+0.760695f, +0.000187f, -0.002580f}, + {+0.869383f, +0.005374f, -0.001979f}, + {-0.118984f, -0.003432f, +0.014567f}, + {+0.349914f, +0.003949f, +0.011712f}, + {+0.283867f, +0.008607f, +0.011966f}, + {-0.106829f, -0.003798f, +0.012953f}, + {-0.143863f, +0.007735f, -0.004012f}, + {+0.195900f, +0.004792f, +0.000560f}, + {+0.091845f, +0.002959f, +0.004936f}, + {+0.279043f, +0.006225f, +0.015628f}, + {+0.177000f, -0.001330f, -0.012704f}, + {-0.021476f, +0.006516f, -0.001630f}, + {-0.154239f, +0.000969f, -0.011998f}, + {+0.037152f, +0.007671f, +0.004251f}, + {+0.041126f, +0.001005f, +0.004482f}, + {-0.085797f, -0.005363f, +0.006097f} + } +}; +const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +{ + { + {-0.191323f, +0.550462f, -0.164703f}, + {-0.179339f, +0.105827f, +0.022109f}, + {-0.016317f, +0.069138f, -0.026386f}, + {-0.031302f, +0.044550f, -0.011983f}, + {-0.011873f, -0.049933f, +0.022817f}, + {+0.002100f, -0.025417f, +0.008917f}, + {+0.008673f, +0.072165f, -0.030658f}, + {+0.009984f, -0.046099f, +0.014260f}, + {-0.017932f, +0.200113f, -0.071972f}, + {-0.009948f, -0.076380f, +0.035799f}, + {+0.000500f, +0.013211f, -0.007415f}, + {-0.005467f, -0.017109f, +0.007909f}, + {-0.001381f, -0.024397f, +0.011565f}, + {+0.001735f, -0.017167f, +0.009148f}, + {-0.006994f, -0.015041f, +0.007364f}, + {-0.000274f, +0.004190f, -0.001467f} + }, + { + {-0.330036f, +0.333647f, -0.215680f}, + {-0.446962f, -0.557076f, -0.195252f}, + {-0.017152f, +0.086610f, -0.016060f}, + {-0.053984f, +0.030859f, -0.007361f}, + {-0.031663f, -0.050397f, +0.030580f}, + {+0.013130f, +0.075028f, +0.055072f}, + {+0.035680f, +0.080722f, -0.037346f}, + {+0.011258f, -0.044042f, +0.013548f}, + {+0.004710f, +0.152351f, -0.099878f}, + {-0.054304f, -0.216938f, -0.014289f}, + {+0.014461f, +0.090558f, +0.026436f}, + {-0.019523f, -0.056800f, -0.001967f}, + {-0.012667f, -0.065948f, -0.004877f}, + {-0.011111f, -0.088384f, -0.022179f}, + {-0.018869f, -0.025704f, +0.006997f}, + {+0.000817f, +0.008300f, +0.000651f} + }, + { + {-0.096856f, -0.591788f, +0.084769f}, + {-0.247542f, -1.016515f, -0.073842f}, + {-0.000574f, +0.046908f, -0.004371f}, + {-0.019540f, +0.031177f, -0.013825f}, + {-0.037796f, +0.124420f, -0.041797f}, + {-0.007360f, +0.192733f, +0.007619f}, + {+0.072377f, -0.160383f, +0.061576f}, + {-0.003711f, +0.021943f, -0.004227f}, + {+0.112964f, -0.363004f, +0.093285f}, + {-0.056746f, -0.090813f, -0.072980f}, + {+0.006103f, +0.134417f, +0.008866f}, + {-0.005326f, -0.101653f, +0.016759f}, + {-0.002749f, -0.090650f, +0.006843f}, + {-0.000089f, -0.179843f, +0.016051f}, + {+0.001814f, -0.087437f, +0.037078f}, + {+0.005267f, -0.010738f, +0.007098f} + }, + { + {+0.063555f, -0.411417f, +0.075756f}, + {+0.093014f, -0.372322f, +0.077805f}, + {+0.007107f, +0.054992f, -0.008311f}, + {+0.033886f, +0.080359f, -0.013428f}, + {+0.014436f, +0.207733f, -0.015885f}, + {-0.013408f, +0.128849f, -0.020860f}, + {+0.024255f, -0.374328f, -0.023256f}, + {-0.002134f, +0.023939f, +0.000696f}, + {+0.058983f, -0.666227f, -0.050398f}, + {-0.014357f, -0.059836f, -0.078919f}, + {-0.009066f, +0.055606f, -0.025373f}, + {-0.008234f, -0.193844f, -0.040018f}, + {+0.010778f, -0.088365f, +0.004018f}, + {+0.007190f, -0.141067f, +0.033486f}, + {+0.015950f, -0.182801f, -0.014037f}, + {-0.004549f, -0.103305f, -0.035896f} + }, + { + {+0.019484f, -0.338410f, +0.083536f}, + {+0.202040f, -0.634536f, +0.185332f}, + {+0.007949f, -0.067812f, +0.047529f}, + {+0.048582f, -0.153833f, +0.075433f}, + {+0.054773f, -0.008273f, +0.058696f}, + {+0.024929f, -0.021715f, +0.041866f}, + {-0.026392f, -0.170362f, -0.104628f}, + {+0.014816f, -0.001719f, +0.003760f}, + {-0.050384f, -0.474129f, -0.111890f}, + {+0.050928f, -0.326828f, +0.037272f}, + {-0.005968f, +0.019903f, -0.009428f}, + {-0.002366f, -0.233633f, -0.019586f}, + {+0.014235f, -0.074982f, -0.008001f}, + {-0.003852f, +0.000864f, -0.026540f}, + {+0.024596f, -0.140123f, -0.045292f}, + {+0.007335f, -0.140212f, -0.016737f} + }, + { + {-0.203259f, -0.677311f, +0.036974f}, + {-0.017307f, -0.878070f, +0.170118f}, + {-0.043215f, -0.181813f, +0.012035f}, + {-0.067120f, -0.199982f, +0.078357f}, + {-0.003334f, -0.005382f, +0.060963f}, + {+0.037369f, -0.095076f, +0.002797f}, + {-0.007145f, +0.024172f, -0.016239f}, + {+0.025809f, +0.035193f, +0.010462f}, + {-0.123278f, -0.317455f, +0.005941f}, + {+0.071780f, -0.152842f, +0.115403f}, + {-0.009047f, +0.007435f, -0.015219f}, + {+0.009240f, -0.131025f, +0.037457f}, + {+0.010330f, -0.013791f, +0.019556f}, + {+0.018073f, +0.051639f, -0.007415f}, + {+0.023065f, +0.024816f, +0.028060f}, + {+0.023145f, -0.072535f, +0.012653f} + }, + { + {-0.363585f, -0.196908f, -0.132849f}, + {-0.400794f, +0.061111f, -0.146774f}, + {-0.088996f, -0.035461f, -0.039728f}, + {-0.248102f, +0.210034f, -0.044008f}, + {-0.136603f, +0.269455f, -0.014678f}, + {+0.039867f, -0.056544f, -0.018785f}, + {+0.012335f, -0.061064f, +0.014746f}, + {+0.001640f, +0.021263f, +0.019567f}, + {-0.164395f, -0.120409f, -0.065761f}, + {+0.005008f, +0.124444f, +0.002355f}, + {-0.006089f, -0.036166f, +0.003168f}, + {+0.008972f, -0.027316f, -0.008811f}, + {-0.026456f, +0.074066f, -0.007831f}, + {+0.036264f, -0.025445f, +0.017552f}, + {-0.046783f, +0.110385f, +0.011511f}, + {+0.016634f, -0.063190f, +0.003470f} + }, + { + {-0.140043f, +0.331564f, +0.031879f}, + {-0.418213f, +0.323867f, -0.026950f}, + {-0.066524f, +0.078043f, +0.003209f}, + {-0.275295f, +0.106284f, -0.069212f}, + {-0.205855f, +0.059809f, -0.074823f}, + {+0.024267f, +0.018141f, +0.016347f}, + {+0.021686f, -0.056152f, +0.012278f}, + {-0.065157f, -0.071098f, -0.001681f}, + {-0.025332f, +0.159594f, +0.013561f}, + {-0.029475f, +0.035218f, -0.023811f}, + {-0.011328f, -0.030605f, +0.007685f}, + {+0.054740f, +0.020295f, +0.000302f}, + {-0.047455f, +0.027854f, -0.019731f}, + {+0.022053f, -0.039858f, +0.012679f}, + {-0.116347f, -0.040132f, -0.032026f}, + {-0.007321f, -0.043491f, +0.015668f} + }, + { + {+0.232420f, -0.042183f, +0.090352f}, + {-0.143907f, -0.128870f, +0.081606f}, + {-0.019255f, -0.008481f, +0.025359f}, + {-0.079364f, -0.195197f, +0.009060f}, + {-0.092435f, -0.165349f, -0.007306f}, + {-0.037358f, +0.066958f, +0.009347f}, + {+0.002010f, -0.000201f, -0.007048f}, + {-0.118479f, -0.000141f, -0.016298f}, + {+0.131479f, -0.025371f, +0.046423f}, + {-0.013254f, -0.056073f, +0.007964f}, + {-0.020421f, +0.014051f, -0.008057f}, + {+0.102505f, -0.044999f, +0.012472f}, + {-0.028717f, -0.037569f, +0.002612f}, + {-0.021286f, +0.036718f, -0.008001f}, + {-0.110557f, -0.093273f, -0.012580f}, + {-0.060924f, +0.023756f, -0.000190f} + }, + { + {+0.533983f, -0.079000f, +0.018330f}, + {+0.217748f, -0.012931f, +0.048151f}, + {+0.025802f, -0.036354f, +0.006267f}, + {+0.205140f, +0.060899f, +0.046660f}, + {+0.113290f, +0.081234f, +0.041909f}, + {-0.105415f, -0.030348f, -0.015181f}, + {-0.034112f, -0.007984f, -0.002032f}, + {-0.109019f, +0.032142f, -0.005021f}, + {+0.186112f, -0.090334f, +0.010289f}, + {+0.018376f, -0.004638f, +0.018235f}, + {-0.011521f, +0.024596f, -0.005093f}, + {+0.106685f, -0.043319f, +0.011207f}, + {+0.003719f, +0.002813f, +0.009833f}, + {-0.061529f, +0.014049f, -0.008239f}, + {-0.045872f, +0.041391f, +0.025100f}, + {-0.106073f, -0.025839f, -0.009219f} + }, + { + {+0.689088f, +0.021676f, -0.035498f}, + {+0.512497f, +0.013050f, -0.008139f}, + {+0.080900f, -0.013233f, -0.008488f}, + {+0.415840f, +0.041814f, +0.013996f}, + {+0.278767f, +0.050484f, +0.020716f}, + {-0.124237f, -0.048494f, -0.003541f}, + {-0.083860f, +0.012095f, -0.001839f}, + {-0.040470f, -0.043256f, +0.009440f}, + {+0.127554f, +0.052174f, -0.027560f}, + {+0.038197f, +0.025553f, +0.002386f}, + {+0.013296f, -0.017618f, +0.006802f}, + {+0.049000f, +0.034411f, -0.008434f}, + {+0.023951f, +0.015385f, +0.000397f}, + {-0.079741f, -0.014689f, +0.006056f}, + {+0.015937f, +0.036771f, +0.013501f}, + {-0.116284f, -0.032742f, -0.005608f} + }, + { + {+0.733240f, +0.033897f, -0.028463f}, + {+0.683283f, +0.019108f, -0.024422f}, + {+0.165878f, +0.024612f, -0.005353f}, + {+0.489377f, -0.026929f, -0.018187f}, + {+0.343135f, -0.029846f, -0.016631f}, + {-0.086256f, +0.016816f, +0.014815f}, + {-0.129107f, +0.000075f, +0.000830f}, + {+0.047145f, -0.000801f, +0.008881f}, + {+0.023844f, +0.003992f, -0.023086f}, + {+0.042301f, -0.008336f, -0.009579f}, + {+0.039371f, -0.014019f, +0.003266f}, + {-0.037930f, -0.005491f, -0.006528f}, + {+0.020403f, -0.000483f, -0.004551f}, + {-0.081119f, -0.016241f, +0.003920f}, + {+0.051945f, -0.020771f, -0.013605f}, + {-0.091078f, +0.021518f, +0.009604f} + }, + { + {+0.733114f, -0.029809f, -0.003150f}, + {+0.758988f, -0.025935f, -0.015102f}, + {+0.280906f, -0.031811f, -0.003778f}, + {+0.459117f, +0.008405f, -0.019040f}, + {+0.333055f, -0.004022f, -0.017856f}, + {-0.012149f, +0.009636f, +0.003754f}, + {-0.156853f, +0.003236f, +0.004887f}, + {+0.114968f, +0.002815f, -0.004184f}, + {-0.064559f, -0.023528f, +0.001333f}, + {+0.039134f, -0.015161f, -0.005522f}, + {+0.063282f, -0.001881f, -0.005278f}, + {-0.121057f, +0.006821f, +0.003568f}, + {-0.006828f, +0.002343f, -0.000194f}, + {-0.069156f, -0.009861f, -0.001545f}, + {+0.070362f, -0.029774f, -0.011253f}, + {-0.061366f, +0.013312f, +0.005905f} + }, + { + {+0.724625f, -0.001203f, +0.006316f}, + {+0.787100f, +0.019364f, -0.003117f}, + {+0.401617f, +0.025467f, -0.004330f}, + {+0.392760f, +0.000769f, -0.009132f}, + {+0.296783f, +0.006051f, -0.006244f}, + {+0.080677f, +0.011855f, -0.011409f}, + {-0.155686f, -0.003923f, +0.003032f}, + {+0.152027f, +0.011289f, -0.005772f}, + {-0.122199f, -0.008679f, +0.013528f}, + {+0.032224f, +0.005650f, +0.003051f}, + {+0.086101f, +0.012645f, -0.003029f}, + {-0.171824f, -0.008018f, +0.006233f}, + {-0.049811f, -0.010853f, +0.002128f}, + {-0.046385f, +0.014661f, +0.005149f}, + {+0.075593f, +0.018900f, +0.006819f}, + {-0.042682f, -0.001204f, -0.002701f} + }, + { + {+0.710313f, +0.016351f, +0.000594f}, + {+0.788202f, +0.001698f, +0.001880f}, + {+0.478276f, -0.009988f, -0.006465f}, + {+0.338553f, -0.006580f, +0.000873f}, + {+0.267876f, -0.004181f, +0.000561f}, + {+0.161632f, -0.031504f, -0.010015f}, + {-0.112024f, -0.007981f, -0.001560f}, + {+0.161078f, -0.006395f, +0.000785f}, + {-0.159938f, +0.023767f, +0.006167f}, + {+0.016977f, +0.011649f, +0.002458f}, + {+0.101033f, -0.005466f, +0.000979f}, + {-0.168147f, -0.002987f, +0.004477f}, + {-0.090853f, +0.008103f, +0.002155f}, + {-0.019160f, +0.010061f, +0.003516f}, + {+0.068113f, +0.017356f, +0.008667f}, + {-0.034415f, -0.006094f, -0.000653f} + }, + { + {+0.687296f, -0.010309f, -0.005056f}, + {+0.764260f, -0.015559f, -0.000832f}, + {+0.464886f, -0.002946f, -0.003297f}, + {+0.298384f, -0.012876f, +0.002489f}, + {+0.246598f, -0.005940f, +0.001267f}, + {+0.184060f, +0.014332f, +0.000763f}, + {-0.024137f, +0.022250f, -0.004819f}, + {+0.154151f, -0.010440f, +0.001340f}, + {-0.181725f, -0.011644f, -0.002738f}, + {-0.007528f, -0.010988f, -0.002133f}, + {+0.103221f, -0.002109f, +0.001628f}, + {-0.103776f, +0.007568f, -0.001735f}, + {-0.108578f, +0.000395f, +0.003349f}, + {+0.017935f, -0.001653f, -0.006823f}, + {+0.063247f, -0.018078f, -0.002599f}, + {-0.031929f, -0.003751f, +0.000579f} + }, + { + {+0.659915f, +0.003181f, -0.004789f}, + {+0.723641f, +0.015598f, -0.004701f}, + {+0.344320f, +0.034439f, +0.003396f}, + {+0.252485f, +0.010951f, -0.000869f}, + {+0.213766f, +0.011294f, -0.001229f}, + {+0.112272f, +0.023126f, +0.008479f}, + {+0.086512f, -0.032942f, -0.003959f}, + {+0.151070f, +0.005416f, -0.003241f}, + {-0.183618f, -0.008669f, -0.002985f}, + {-0.037360f, +0.003147f, -0.002379f}, + {+0.095879f, +0.005536f, +0.000670f}, + {+0.009973f, -0.033041f, -0.006312f}, + {-0.086652f, -0.000941f, +0.001227f}, + {+0.070708f, -0.028404f, -0.005854f}, + {+0.082798f, -0.007130f, -0.008870f}, + {-0.024953f, -0.002080f, -0.001188f} + }, + { + {+0.634763f, -0.001208f, -0.002397f}, + {+0.683670f, -0.007693f, -0.006039f}, + {+0.143818f, -0.065248f, +0.001626f}, + {+0.187585f, -0.010607f, +0.001657f}, + {+0.155102f, -0.012347f, -0.000836f}, + {-0.047669f, -0.064360f, +0.004465f}, + {+0.176375f, +0.020282f, -0.000832f}, + {+0.166599f, +0.005868f, -0.005383f}, + {-0.165581f, +0.017111f, +0.003241f}, + {-0.067470f, +0.001639f, +0.002026f}, + {+0.090399f, -0.004464f, -0.000923f}, + {+0.138735f, +0.040116f, -0.001857f}, + {-0.018624f, +0.015969f, -0.003767f}, + {+0.124121f, +0.022397f, +0.003509f}, + {+0.132318f, +0.030070f, -0.004033f}, + {-0.005451f, +0.010583f, +0.000461f} + }, + { + {+0.613639f, +0.002441f, -0.000996f}, + {+0.658994f, -0.004033f, -0.003708f}, + {-0.066781f, +0.052613f, -0.005380f}, + {+0.103141f, +0.024662f, +0.003094f}, + {+0.069224f, +0.020885f, +0.001016f}, + {-0.237901f, +0.057325f, -0.006669f}, + {+0.198251f, +0.008139f, -0.001238f}, + {+0.196297f, -0.014019f, -0.004087f}, + {-0.137085f, -0.006189f, +0.006787f}, + {-0.092626f, +0.005231f, +0.005081f}, + {+0.098805f, +0.001528f, -0.003973f}, + {+0.227978f, -0.011869f, +0.001188f}, + {+0.083502f, -0.031761f, -0.003653f}, + {+0.154304f, +0.003532f, +0.005157f}, + {+0.192731f, -0.026618f, +0.005738f}, + {+0.025619f, -0.008251f, +0.002697f} + }, + { + {+0.592443f, -0.004265f, -0.000675f}, + {+0.651475f, +0.007639f, +0.001077f}, + {-0.211884f, -0.008375f, -0.003618f}, + {+0.015847f, -0.026610f, -0.001288f}, + {-0.030980f, -0.024402f, +0.000682f}, + {-0.377865f, -0.004628f, -0.005328f}, + {+0.127740f, -0.031243f, -0.004692f}, + {+0.216064f, +0.008428f, -0.000840f}, + {-0.107665f, -0.004148f, +0.003207f}, + {-0.104222f, -0.007982f, +0.002781f}, + {+0.121055f, +0.007151f, -0.006643f}, + {+0.232842f, -0.021111f, -0.004010f}, + {+0.181984f, +0.020598f, -0.002112f}, + {+0.154857f, -0.016563f, -0.001311f}, + {+0.234230f, -0.006972f, +0.006138f}, + {+0.062816f, -0.000374f, -0.000261f} + }, + { + {+0.565815f, +0.006621f, -0.000731f}, + {+0.652157f, +0.001839f, +0.002786f}, + {-0.256941f, -0.016709f, +0.005201f}, + {-0.049457f, +0.004802f, -0.002568f}, + {-0.121870f, +0.014390f, +0.001453f}, + {-0.418806f, -0.025565f, +0.008436f}, + {-0.023252f, +0.033441f, -0.003455f}, + {+0.192750f, +0.014454f, -0.000969f}, + {-0.080190f, +0.006138f, -0.004702f}, + {-0.090978f, -0.000288f, -0.001642f}, + {+0.136520f, -0.012063f, -0.004637f}, + {+0.143202f, +0.027531f, -0.007344f}, + {+0.230859f, -0.004544f, -0.002668f}, + {+0.140224f, +0.009293f, -0.007214f}, + {+0.242282f, +0.025199f, -0.006229f}, + {+0.100859f, -0.005416f, -0.004924f} + }, + { + {+0.532337f, -0.007417f, -0.000543f}, + {+0.652955f, -0.010368f, -0.001740f}, + {-0.220699f, +0.013404f, +0.007323f}, + {-0.077945f, +0.013141f, +0.004826f}, + {-0.182039f, -0.009934f, +0.002503f}, + {-0.362601f, +0.019757f, +0.014603f}, + {-0.211924f, -0.030990f, +0.005294f}, + {+0.105625f, -0.028087f, -0.003678f}, + {-0.054535f, +0.015575f, -0.006139f}, + {-0.049202f, +0.015528f, -0.003083f}, + {+0.111395f, +0.002877f, +0.002743f}, + {-0.015299f, -0.023373f, +0.001099f}, + {+0.201870f, -0.009975f, -0.000096f}, + {+0.130715f, +0.012877f, -0.003882f}, + {+0.221564f, -0.009858f, -0.016146f}, + {+0.132494f, +0.017520f, -0.002095f} + }, + { + {+0.495834f, +0.008532f, -0.000369f}, + {+0.652356f, +0.003292f, -0.006811f}, + {-0.149624f, -0.011936f, +0.002662f}, + {-0.071256f, -0.002030f, +0.009341f}, + {-0.200363f, +0.000872f, +0.001071f}, + {-0.238216f, -0.009887f, +0.004541f}, + {-0.381151f, +0.041781f, +0.008291f}, + {-0.039667f, +0.026941f, +0.000063f}, + {-0.036683f, -0.023635f, +0.004916f}, + {+0.009186f, -0.024708f, +0.001260f}, + {+0.023299f, +0.026996f, +0.008496f}, + {-0.194696f, +0.039072f, +0.009744f}, + {+0.098003f, +0.033287f, +0.002536f}, + {+0.131758f, -0.006621f, +0.002658f}, + {+0.173806f, -0.018597f, -0.006932f}, + {+0.145380f, -0.006223f, +0.004430f} + }, + { + {+0.463299f, -0.007155f, -0.000770f}, + {+0.648076f, +0.009295f, -0.004610f}, + {-0.089513f, +0.010398f, +0.000359f}, + {-0.033244f, -0.002975f, +0.003236f}, + {-0.178153f, +0.013477f, +0.001343f}, + {-0.077802f, +0.029144f, -0.007460f}, + {-0.474851f, -0.029171f, -0.001803f}, + {-0.217055f, -0.041281f, +0.004828f}, + {-0.037249f, -0.008239f, +0.011497f}, + {+0.059921f, +0.009759f, +0.005233f}, + {-0.114758f, -0.056676f, +0.002229f}, + {-0.334964f, -0.046076f, +0.002995f}, + {-0.042473f, -0.043913f, -0.000922f}, + {+0.133390f, -0.007415f, +0.001167f}, + {+0.081735f, -0.007332f, +0.010523f}, + {+0.133499f, -0.015420f, +0.003583f} + }, + { + {+0.441203f, +0.002482f, -0.000824f}, + {+0.629545f, -0.003537f, +0.002292f}, + {-0.068500f, -0.000883f, +0.001586f}, + {+0.038519f, -0.014498f, -0.003426f}, + {-0.131180f, -0.015847f, +0.003732f}, + {+0.083693f, -0.047317f, -0.005981f}, + {-0.461803f, -0.022290f, -0.008344f}, + {-0.384732f, +0.037693f, +0.003505f}, + {-0.048144f, +0.029049f, +0.001374f}, + {+0.084768f, +0.008739f, +0.001947f}, + {-0.251499f, +0.035994f, -0.008053f}, + {-0.379916f, +0.000042f, -0.006724f}, + {-0.160178f, +0.020677f, -0.004025f}, + {+0.124411f, +0.010697f, -0.004992f}, + {-0.067302f, +0.056203f, +0.010926f}, + {+0.110573f, +0.015976f, -0.002867f} + }, + { + {+0.430897f, +0.000433f, -0.000350f}, + {+0.586004f, -0.017187f, +0.004129f}, + {-0.087700f, -0.011728f, +0.002208f}, + {+0.139979f, +0.032148f, -0.002572f}, + {-0.080931f, +0.008008f, +0.004145f}, + {+0.204274f, +0.031020f, +0.002988f}, + {-0.365555f, +0.057171f, +0.001535f}, + {-0.496090f, -0.014326f, +0.002762f}, + {-0.036347f, -0.000076f, -0.009610f}, + {+0.087371f, -0.006753f, -0.002953f}, + {-0.332582f, +0.010055f, -0.004412f}, + {-0.314151f, +0.048523f, -0.001669f}, + {-0.210677f, +0.006259f, -0.001554f}, + {+0.097223f, +0.002730f, -0.004153f}, + {-0.243214f, -0.058784f, -0.001131f}, + {+0.100970f, +0.001509f, -0.005827f} + }, + { + {+0.427847f, -0.001191f, +0.000192f}, + {+0.522040f, +0.027328f, -0.001322f}, + {-0.123746f, +0.015960f, -0.000425f}, + {+0.250557f, -0.029225f, +0.001401f}, + {-0.041411f, +0.001671f, +0.000435f}, + {+0.251666f, +0.011713f, +0.002737f}, + {-0.259410f, -0.030558f, +0.013501f}, + {-0.523363f, -0.008886f, +0.005097f}, + {+0.023565f, -0.037779f, -0.005281f}, + {+0.085570f, -0.002595f, -0.003055f}, + {-0.343956f, -0.022947f, +0.008052f}, + {-0.182050f, -0.049717f, +0.010139f}, + {-0.188646f, -0.025113f, +0.004590f}, + {+0.043971f, +0.008025f, +0.002158f}, + {-0.383316f, +0.019159f, -0.004800f}, + {+0.118679f, -0.020135f, -0.001036f} + }, + { + {+0.424775f, -0.001427f, +0.000274f}, + {+0.458547f, -0.013186f, -0.005324f}, + {-0.143005f, -0.001551f, -0.002520f}, + {+0.342091f, +0.013355f, +0.001866f}, + {-0.012473f, +0.005183f, -0.002228f}, + {+0.229007f, -0.024031f, -0.004922f}, + {-0.213143f, -0.021386f, +0.008846f}, + {-0.469349f, +0.018839f, +0.005224f}, + {+0.120107f, +0.037044f, +0.005367f}, + {+0.094940f, +0.009229f, +0.000146f}, + {-0.312164f, +0.002650f, +0.009985f}, + {-0.056636f, +0.008288f, +0.009234f}, + {-0.124730f, +0.013388f, +0.006509f}, + {-0.037461f, -0.023127f, +0.003625f}, + {-0.438903f, +0.013352f, +0.002069f}, + {+0.155431f, +0.012048f, +0.004072f} + }, + { + {+0.415850f, +0.004534f, -0.000668f}, + {+0.414572f, -0.002652f, -0.002367f}, + {-0.124613f, -0.010725f, -0.002281f}, + {+0.397126f, -0.000677f, -0.001120f}, + {+0.014003f, -0.010619f, +0.000267f}, + {+0.170253f, +0.018842f, -0.008960f}, + {-0.241128f, +0.034417f, -0.004698f}, + {-0.359282f, -0.033550f, +0.005250f}, + {+0.216676f, -0.010427f, +0.006057f}, + {+0.120954f, -0.008613f, +0.002469f}, + {-0.268504f, -0.001802f, +0.003587f}, + {+0.013045f, +0.010217f, -0.002327f}, + {-0.059871f, -0.003931f, +0.001188f}, + {-0.132164f, +0.026563f, +0.001240f}, + {-0.403193f, -0.027848f, +0.009266f}, + {+0.190953f, +0.002021f, +0.001187f} + }, + { + {+0.399726f, -0.003989f, -0.001238f}, + {+0.392346f, +0.005321f, +0.003177f}, + {-0.072827f, +0.023138f, +0.000364f}, + {+0.417980f, -0.003176f, -0.003953f}, + {+0.044470f, +0.006065f, +0.002234f}, + {+0.111558f, -0.001243f, -0.006696f}, + {-0.306891f, -0.017879f, -0.010556f}, + {-0.227947f, +0.027747f, +0.006660f}, + {+0.285131f, -0.003545f, -0.002248f}, + {+0.160581f, +0.005372f, +0.001188f}, + {-0.228536f, +0.004194f, +0.000473f}, + {+0.021041f, -0.010096f, -0.009272f}, + {-0.021484f, +0.000358f, -0.003354f}, + {-0.213365f, -0.015260f, -0.000168f}, + {-0.303399f, +0.026027f, +0.011571f}, + {+0.212111f, -0.000447f, -0.003261f} + }, + { + {+0.378407f, +0.003850f, -0.000653f}, + {+0.380175f, +0.007586f, +0.003255f}, + {-0.012127f, -0.017400f, +0.004348f}, + {+0.420589f, +0.000881f, -0.004600f}, + {+0.082045f, -0.000538f, -0.001160f}, + {+0.069379f, -0.007873f, +0.001279f}, + {-0.364957f, -0.009593f, -0.003601f}, + {-0.103978f, -0.012644f, +0.002536f}, + {+0.322327f, -0.004962f, -0.006100f}, + {+0.208381f, -0.007687f, -0.001556f}, + {-0.193755f, -0.004206f, -0.000887f}, + {-0.012722f, -0.002660f, -0.005208f}, + {-0.021028f, +0.002645f, -0.003959f}, + {-0.256559f, +0.000206f, +0.001247f}, + {-0.175255f, -0.013434f, +0.005713f}, + {+0.216424f, -0.004406f, -0.001903f} + }, + { + {+0.355186f, -0.004417f, +0.000047f}, + {+0.367959f, -0.007051f, -0.000589f}, + {+0.030278f, -0.000745f, +0.003677f}, + {+0.419972f, +0.001580f, -0.004098f}, + {+0.126164f, +0.010538f, -0.004622f}, + {+0.036142f, -0.005050f, +0.006483f}, + {-0.395580f, +0.008424f, +0.006868f}, + {+0.004418f, +0.013200f, -0.004102f}, + {+0.338438f, +0.004391f, -0.003969f}, + {+0.257936f, +0.011270f, -0.002562f}, + {-0.157184f, +0.010190f, -0.001022f}, + {-0.066694f, -0.007499f, +0.001955f}, + {-0.058038f, -0.007898f, -0.001836f}, + {-0.252063f, +0.011457f, +0.004218f}, + {-0.038996f, +0.019229f, -0.002930f}, + {+0.207135f, -0.002683f, +0.000920f} + }, + { + {+0.333833f, +0.005141f, -0.000033f}, + {+0.354343f, +0.002376f, -0.001512f}, + {+0.044789f, +0.011943f, -0.002345f}, + {+0.420054f, -0.005203f, -0.002411f}, + {+0.168493f, -0.019086f, -0.001101f}, + {-0.000312f, +0.019974f, +0.002740f}, + {-0.404430f, +0.003854f, +0.008761f}, + {+0.101609f, -0.024344f, -0.004621f}, + {+0.343021f, -0.002003f, -0.002287f}, + {+0.300798f, -0.012232f, -0.000926f}, + {-0.115201f, -0.012523f, +0.000667f}, + {-0.124884f, +0.013322f, +0.003505f}, + {-0.124657f, +0.015080f, +0.000444f}, + {-0.208063f, -0.009838f, +0.004149f}, + {+0.098778f, -0.030234f, -0.005691f}, + {+0.191672f, +0.010274f, -0.000986f} + }, + { + {+0.317651f, -0.003399f, -0.000638f}, + {+0.342009f, -0.000734f, -0.000383f}, + {+0.041234f, -0.003266f, -0.006626f}, + {+0.412818f, +0.000564f, -0.000053f}, + {+0.193269f, +0.005756f, +0.003803f}, + {-0.038455f, -0.012921f, -0.002898f}, + {-0.397973f, -0.006421f, +0.004371f}, + {+0.186407f, +0.018164f, -0.002443f}, + {+0.339213f, -0.001972f, -0.002251f}, + {+0.327935f, +0.003077f, +0.000361f}, + {-0.072360f, +0.008411f, +0.001308f}, + {-0.171731f, -0.013927f, +0.001434f}, + {-0.206591f, -0.018817f, +0.001471f}, + {-0.140714f, +0.015540f, +0.002302f}, + {+0.227639f, +0.031497f, -0.003750f}, + {+0.179263f, -0.004105f, -0.004389f} + }, + { + {+0.307693f, +0.001076f, -0.000945f}, + {+0.334320f, +0.001717f, -0.000049f}, + {+0.033552f, -0.011447f, -0.002121f}, + {+0.387841f, +0.007421f, +0.001088f}, + {+0.192595f, +0.010377f, +0.002843f}, + {-0.067483f, -0.002402f, -0.001682f}, + {-0.373557f, +0.001444f, -0.001449f}, + {+0.251051f, -0.016030f, -0.000496f}, + {+0.323516f, +0.001530f, -0.001658f}, + {+0.335944f, +0.003218f, -0.000567f}, + {-0.034654f, -0.006672f, +0.000906f}, + {-0.193976f, +0.003406f, -0.001146f}, + {-0.284432f, +0.017472f, +0.001142f}, + {-0.067179f, -0.009754f, -0.000138f}, + {+0.329347f, -0.022749f, -0.000471f}, + {+0.172128f, -0.005358f, -0.003493f} + }, + { + {+0.301577f, +0.001184f, -0.000322f}, + {+0.332736f, -0.000666f, -0.000894f}, + {+0.023585f, -0.000609f, +0.003132f}, + {+0.344006f, -0.015803f, +0.000034f}, + {+0.177998f, -0.013137f, -0.002069f}, + {-0.082056f, +0.003433f, +0.002633f}, + {-0.324370f, +0.018955f, -0.002626f}, + {+0.287377f, +0.000225f, -0.000071f}, + {+0.290720f, -0.007672f, -0.000038f}, + {+0.329996f, -0.006498f, -0.002605f}, + {-0.003682f, +0.004563f, +0.000624f}, + {-0.185737f, +0.009876f, -0.000494f}, + {-0.338831f, -0.008465f, +0.000490f}, + {-0.000651f, +0.014424f, -0.001842f}, + {+0.385445f, -0.000494f, -0.001075f}, + {+0.160154f, +0.003230f, +0.000530f} + }, + { + {+0.294359f, +0.001008f, +0.000587f}, + {+0.335716f, -0.002537f, -0.000929f}, + {+0.006697f, +0.010781f, +0.001057f}, + {+0.292769f, +0.014442f, -0.002216f}, + {+0.173218f, -0.002305f, -0.004071f}, + {-0.084637f, +0.001890f, +0.003059f}, + {-0.253587f, -0.025906f, +0.002221f}, + {+0.295508f, +0.003624f, -0.001780f}, + {+0.240102f, +0.014422f, -0.000050f}, + {+0.320004f, -0.000226f, -0.002968f}, + {+0.025595f, -0.006552f, +0.001052f}, + {-0.154653f, -0.014381f, +0.002635f}, + {-0.357893f, -0.004680f, +0.001836f}, + {+0.050259f, -0.009177f, -0.001013f}, + {+0.390921f, +0.011091f, -0.005488f}, + {+0.128396f, +0.010797f, +0.002030f} + }, + { + {+0.281980f, -0.004479f, +0.000473f}, + {+0.338235f, +0.000938f, -0.000317f}, + {-0.016443f, -0.008216f, -0.002310f}, + {+0.250822f, -0.005381f, -0.002547f}, + {+0.194113f, +0.011993f, -0.002133f}, + {-0.078814f, -0.001480f, +0.000683f}, + {-0.178794f, +0.013791f, +0.004329f}, + {+0.286440f, -0.008258f, -0.003815f}, + {+0.180165f, -0.014312f, -0.000718f}, + {+0.312559f, +0.001222f, -0.001335f}, + {+0.061211f, +0.002642f, -0.000385f}, + {-0.117426f, +0.006897f, +0.004033f}, + {-0.342706f, +0.010139f, +0.004471f}, + {+0.079430f, +0.002660f, -0.001268f}, + {+0.356398f, -0.011250f, -0.007640f}, + {+0.072072f, -0.018003f, +0.000575f} + }, + { + {+0.264584f, +0.006225f, -0.000553f}, + {+0.334355f, +0.002104f, -0.000390f}, + {-0.041411f, +0.000660f, -0.001379f}, + {+0.227742f, -0.002231f, -0.000499f}, + {+0.236723f, -0.015277f, -0.000143f}, + {-0.066692f, -0.002089f, -0.000940f}, + {-0.116641f, -0.003621f, +0.000856f}, + {+0.274189f, -0.002260f, -0.003775f}, + {+0.124476f, +0.010538f, -0.000672f}, + {+0.307116f, -0.000375f, -0.000391f}, + {+0.109323f, -0.010339f, -0.003218f}, + {-0.087624f, +0.002282f, +0.001095f}, + {-0.305220f, -0.004246f, +0.003226f}, + {+0.088209f, -0.001890f, -0.000514f}, + {+0.297714f, +0.002109f, -0.002943f}, + {+0.002305f, +0.018254f, -0.000698f} + }, + { + {+0.245860f, -0.004071f, -0.001278f}, + {+0.320735f, -0.004451f, -0.000718f}, + {-0.064973f, -0.003268f, +0.001022f}, + {+0.221237f, +0.003408f, +0.001969f}, + {+0.282979f, +0.012181f, +0.001619f}, + {-0.050139f, +0.005534f, -0.000714f}, + {-0.071497f, +0.004571f, -0.002571f}, + {+0.265456f, +0.000937f, -0.001591f}, + {+0.084560f, -0.004757f, +0.000011f}, + {+0.300229f, -0.001315f, +0.000134f}, + {+0.168137f, +0.018612f, -0.002406f}, + {-0.066781f, +0.001637f, -0.001882f}, + {-0.257378f, +0.011005f, +0.000980f}, + {+0.083095f, -0.005045f, -0.000085f}, + {+0.224972f, -0.016565f, +0.001685f}, + {-0.061472f, -0.012660f, -0.001272f} + }, + { + {+0.229589f, +0.000720f, -0.000554f}, + {+0.297388f, +0.006061f, -0.000830f}, + {-0.086308f, +0.008311f, -0.000100f}, + {+0.220891f, +0.005343f, +0.000760f}, + {+0.312804f, +0.002048f, +0.000535f}, + {-0.033600f, -0.001954f, -0.000821f}, + {-0.037726f, -0.009547f, -0.001800f}, + {+0.256770f, -0.001354f, -0.000172f}, + {+0.064615f, +0.001499f, +0.000378f}, + {+0.288880f, +0.006082f, -0.000716f}, + {+0.223988f, -0.015499f, +0.000654f}, + {-0.048524f, -0.007439f, -0.000777f}, + {-0.208116f, -0.011040f, +0.001557f}, + {+0.074335f, +0.004704f, -0.001723f}, + {+0.146222f, +0.020815f, +0.000166f}, + {-0.103517f, +0.003200f, -0.000724f} + }, + { + {+0.216659f, -0.000775f, +0.000774f}, + {+0.266859f, -0.007292f, -0.000934f}, + {-0.105304f, -0.004788f, -0.002437f}, + {+0.217403f, -0.003973f, -0.002583f}, + {+0.318044f, -0.007929f, -0.003539f}, + {-0.023696f, +0.000702f, -0.001989f}, + {-0.008068f, +0.006711f, +0.000114f}, + {+0.242367f, -0.004361f, +0.000832f}, + {+0.061343f, +0.003214f, +0.000949f}, + {+0.273736f, -0.004941f, -0.002356f}, + {+0.260361f, +0.001261f, +0.000909f}, + {-0.027365f, +0.006696f, +0.001482f}, + {-0.163814f, +0.008052f, +0.001931f}, + {+0.071141f, -0.000562f, -0.003221f}, + {+0.073591f, -0.015255f, -0.001489f}, + {-0.121162f, +0.004631f, +0.001675f} + }, + { + {+0.205784f, +0.003757f, +0.000700f}, + {+0.232994f, +0.005953f, -0.000561f}, + {-0.123682f, -0.003377f, -0.000485f}, + {+0.205753f, -0.000981f, -0.002067f}, + {+0.304943f, +0.001966f, -0.004525f}, + {-0.026104f, -0.002420f, -0.000748f}, + {+0.021981f, -0.003022f, -0.000957f}, + {+0.220204f, +0.009944f, -0.000624f}, + {+0.066717f, -0.001208f, +0.001408f}, + {+0.258003f, -0.000477f, -0.001518f}, + {+0.270472f, +0.007879f, -0.002698f}, + {-0.001424f, -0.001591f, +0.000485f}, + {-0.125885f, -0.003310f, +0.000529f}, + {+0.074527f, -0.008121f, -0.001699f}, + {+0.017069f, +0.005535f, -0.000272f}, + {-0.124829f, -0.001926f, +0.003798f} + }, + { + {+0.196417f, -0.003644f, -0.000603f}, + {+0.199207f, -0.006086f, +0.000295f}, + {-0.146052f, -0.001687f, +0.003740f}, + {+0.182052f, -0.002076f, +0.001266f}, + {+0.282909f, +0.000690f, -0.001105f}, + {-0.044152f, -0.004210f, +0.001817f}, + {+0.054138f, +0.007409f, -0.002335f}, + {+0.196668f, -0.006189f, -0.002331f}, + {+0.072925f, -0.001260f, +0.000239f}, + {+0.242629f, -0.000541f, +0.000943f}, + {+0.260897f, -0.003994f, -0.004883f}, + {+0.029070f, +0.005485f, -0.001962f}, + {-0.092855f, +0.004046f, -0.001954f}, + {+0.076259f, +0.005415f, +0.002510f}, + {-0.019261f, -0.001366f, +0.002709f}, + {-0.127606f, -0.004435f, +0.002949f} + }, + { + {+0.189173f, +0.000560f, -0.001059f}, + {+0.167547f, +0.008258f, -0.000141f}, + {-0.174715f, +0.013815f, +0.002907f}, + {+0.145627f, +0.012083f, +0.002087f}, + {+0.256566f, +0.006772f, +0.000776f}, + {-0.075271f, +0.013763f, +0.000701f}, + {+0.085309f, -0.009140f, -0.001366f}, + {+0.180099f, +0.000959f, -0.002178f}, + {+0.077061f, -0.000891f, -0.000372f}, + {+0.225986f, +0.007128f, +0.000680f}, + {+0.242442f, +0.000129f, -0.003190f}, + {+0.061120f, -0.011120f, -0.001079f}, + {-0.062759f, -0.011288f, -0.001129f}, + {+0.065406f, +0.009942f, +0.002436f}, + {-0.038027f, +0.005472f, +0.002780f}, + {-0.134062f, +0.004375f, +0.001136f} + }, + { + {+0.183656f, +0.000923f, -0.000164f}, + {+0.139835f, -0.005429f, -0.001020f}, + {-0.202643f, -0.008873f, -0.000639f}, + {+0.102603f, -0.014782f, -0.000700f}, + {+0.227902f, -0.008291f, -0.000524f}, + {-0.108562f, -0.007847f, -0.001593f}, + {+0.108523f, +0.004720f, -0.000054f}, + {+0.172882f, +0.003322f, -0.000542f}, + {+0.078483f, -0.001260f, -0.000596f}, + {+0.207608f, -0.004999f, -0.001085f}, + {+0.221842f, -0.000718f, -0.000351f}, + {+0.087045f, +0.004787f, +0.000547f}, + {-0.037398f, +0.005336f, +0.001064f}, + {+0.041563f, -0.010757f, -0.000998f}, + {-0.043387f, -0.001956f, +0.000527f}, + {-0.140276f, -0.003188f, -0.000142f} + }, + { + {+0.177711f, +0.001442f, +0.000461f}, + {+0.115859f, +0.004532f, -0.001235f}, + {-0.218668f, -0.005427f, +0.000911f}, + {+0.063962f, +0.003468f, -0.001219f}, + {+0.198372f, +0.004393f, -0.000814f}, + {-0.132046f, -0.004112f, +0.000882f}, + {+0.118012f, +0.003780f, -0.001160f}, + {+0.169530f, -0.000759f, +0.000923f}, + {+0.077288f, -0.001422f, -0.000499f}, + {+0.187625f, -0.000022f, -0.000030f}, + {+0.200958f, +0.007075f, +0.000014f}, + {+0.099701f, +0.002974f, -0.000910f}, + {-0.019722f, +0.003866f, -0.001104f}, + {+0.014166f, +0.005774f, -0.002177f}, + {-0.039277f, -0.003862f, +0.000381f}, + {-0.138918f, -0.005302f, +0.000608f} + }, + { + {+0.169075f, -0.003877f, -0.000219f}, + {+0.092373f, -0.003200f, -0.000934f}, + {-0.217383f, +0.010383f, +0.006743f}, + {+0.037373f, +0.004176f, +0.003172f}, + {+0.168763f, -0.000238f, +0.001996f}, + {-0.140535f, +0.007256f, +0.006564f}, + {+0.113037f, -0.005040f, -0.003602f}, + {+0.161555f, -0.002184f, +0.001327f}, + {+0.073875f, +0.002628f, +0.001536f}, + {+0.165667f, +0.001239f, +0.003853f}, + {+0.179435f, -0.009646f, -0.002896f}, + {+0.097770f, -0.003616f, -0.003027f}, + {-0.009431f, -0.004981f, -0.006157f}, + {-0.008081f, +0.000345f, -0.000806f}, + {-0.031139f, +0.005138f, +0.002262f}, + {-0.125572f, +0.007103f, +0.003194f} + }, + { + {+0.156703f, +0.003123f, -0.000930f}, + {+0.066141f, +0.001589f, +0.001238f}, + {-0.199134f, -0.002236f, +0.009123f}, + {+0.024449f, +0.000091f, +0.006919f}, + {+0.141646f, +0.003103f, +0.005668f}, + {-0.133486f, +0.000744f, +0.008630f}, + {+0.097019f, -0.000327f, -0.002792f}, + {+0.144791f, +0.002980f, +0.002476f}, + {+0.068698f, +0.001637f, +0.003084f}, + {+0.144321f, +0.006179f, +0.006251f}, + {+0.155892f, +0.002625f, -0.004264f}, + {+0.084319f, +0.000388f, -0.002288f}, + {-0.006549f, -0.002981f, -0.008326f}, + {-0.021606f, -0.003867f, +0.002491f}, + {-0.023191f, -0.001810f, +0.003729f}, + {-0.101442f, -0.001244f, +0.002402f} + }, + { + {+0.140100f, -0.000742f, +0.000187f}, + {+0.036425f, -0.005652f, +0.004036f}, + {-0.165186f, -0.002894f, +0.004265f}, + {+0.025616f, -0.008625f, +0.004162f}, + {+0.121725f, -0.015558f, +0.002974f}, + {-0.111098f, -0.006811f, +0.003090f}, + {+0.072921f, -0.001667f, +0.000669f}, + {+0.120893f, -0.005073f, +0.004382f}, + {+0.065161f, -0.005346f, +0.001749f}, + {+0.129726f, -0.017304f, +0.000877f}, + {+0.126372f, +0.005082f, +0.000663f}, + {+0.063630f, -0.002788f, +0.000025f}, + {-0.013562f, +0.008476f, -0.004178f}, + {-0.027532f, -0.002871f, +0.003910f}, + {-0.014651f, +0.000004f, +0.003901f}, + {-0.068381f, +0.002931f, -0.001605f} + } +}; +const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +{ + { + {+0.353305f, +0.566845f, +0.200116f}, + {-0.451504f, +0.563006f, -0.083565f}, + {+0.022092f, +0.111945f, -0.003135f}, + {+0.047133f, +0.000194f, -0.000386f}, + {-0.039375f, +0.036049f, +0.015307f}, + {-0.013502f, +0.004406f, -0.016833f}, + {-0.050267f, +0.058356f, +0.017434f}, + {-0.013681f, +0.080836f, -0.019699f}, + {-0.037136f, +0.024371f, +0.052200f}, + {-0.050122f, +0.078803f, +0.019790f}, + {+0.004565f, -0.007656f, +0.001338f}, + {-0.009821f, +0.051585f, +0.003219f}, + {-0.003833f, -0.023411f, -0.003160f}, + {+0.007736f, -0.042621f, +0.010291f}, + {+0.014210f, -0.003392f, -0.001270f}, + {-0.005609f, +0.001063f, +0.001854f} + }, + { + {+0.011160f, -0.509237f, -0.132176f}, + {-0.142996f, +0.819544f, -0.093135f}, + {+0.003358f, +0.077333f, -0.008548f}, + {+0.004495f, +0.024167f, +0.025614f}, + {-0.020911f, -0.057490f, -0.024558f}, + {-0.020938f, -0.024631f, -0.022840f}, + {-0.049990f, -0.113634f, -0.053590f}, + {+0.010020f, +0.210234f, +0.026992f}, + {-0.094579f, -0.407023f, -0.103353f}, + {-0.038956f, -0.088489f, -0.058039f}, + {-0.002875f, -0.015645f, +0.000778f}, + {-0.020714f, -0.104784f, -0.070444f}, + {-0.008794f, +0.002924f, +0.009615f}, + {+0.004361f, -0.056762f, +0.007070f}, + {+0.010128f, +0.073116f, +0.035032f}, + {-0.005641f, -0.006012f, -0.000245f} + }, + { + {-0.192410f, -0.206164f, -0.191132f}, + {+0.278956f, -0.236216f, +0.253095f}, + {-0.002616f, +0.068222f, +0.000710f}, + {-0.043976f, +0.107663f, +0.006000f}, + {+0.022830f, -0.121862f, -0.008267f}, + {-0.007646f, -0.104913f, +0.016048f}, + {+0.008805f, -0.278895f, +0.005919f}, + {+0.015200f, +0.180293f, +0.037960f}, + {-0.037987f, -0.531186f, -0.053722f}, + {+0.053411f, -0.405963f, +0.066106f}, + {-0.004225f, -0.049392f, +0.020098f}, + {+0.032849f, -0.404382f, +0.057080f}, + {-0.020343f, +0.025697f, +0.003018f}, + {+0.000399f, -0.049237f, +0.005564f}, + {-0.018895f, +0.170897f, -0.004768f}, + {-0.014229f, +0.049740f, -0.026663f} + }, + { + {-0.062917f, +0.511673f, +0.062418f}, + {+0.164174f, -1.090974f, -0.108397f}, + {+0.009127f, +0.065188f, -0.003083f}, + {-0.018593f, +0.081738f, -0.000771f}, + {+0.020686f, -0.093603f, -0.012011f}, + {-0.000826f, -0.118498f, +0.001498f}, + {+0.025996f, -0.307659f, -0.023797f}, + {-0.008194f, +0.054598f, -0.009722f}, + {+0.040351f, -0.445888f, -0.056326f}, + {+0.030847f, -0.708631f, -0.081623f}, + {-0.002063f, -0.033938f, +0.025075f}, + {+0.027403f, -0.458795f, +0.033429f}, + {-0.021373f, -0.007009f, -0.010388f}, + {-0.002090f, -0.031407f, +0.008158f}, + {-0.028475f, +0.071069f, -0.046847f}, + {-0.007602f, +0.116385f, +0.002531f} + }, + { + {+0.114739f, +0.069536f, +0.170911f}, + {-0.106068f, -0.653946f, -0.186091f}, + {+0.032435f, +0.023922f, +0.003440f}, + {+0.048701f, +0.139999f, -0.053329f}, + {-0.008680f, -0.251941f, +0.071200f}, + {+0.004397f, -0.120323f, -0.000310f}, + {+0.025654f, -0.324361f, -0.006461f}, + {-0.004810f, +0.061858f, -0.007597f}, + {+0.097919f, -0.641143f, +0.015289f}, + {-0.011357f, -0.557580f, -0.143138f}, + {-0.004726f, +0.016709f, -0.000434f}, + {-0.013229f, -0.166606f, -0.093126f}, + {-0.007411f, +0.011792f, -0.021547f}, + {-0.005396f, -0.034575f, +0.011453f}, + {+0.010644f, +0.011719f, -0.021909f}, + {+0.005419f, +0.030988f, +0.043631f} + }, + { + {+0.066623f, -0.089947f, +0.096291f}, + {-0.228582f, -0.462839f, -0.023355f}, + {+0.030597f, +0.055459f, +0.010541f}, + {+0.104887f, +0.337465f, -0.003674f}, + {-0.072691f, -0.405228f, +0.038864f}, + {-0.004864f, -0.081470f, +0.022241f}, + {+0.026067f, -0.215427f, +0.055659f}, + {+0.015556f, +0.034465f, -0.026853f}, + {+0.081559f, -0.329728f, +0.167841f}, + {-0.004434f, -0.224966f, +0.027520f}, + {-0.000854f, +0.017986f, -0.001169f}, + {+0.017103f, -0.022207f, -0.026879f}, + {+0.016949f, +0.070641f, -0.004353f}, + {-0.006585f, -0.086138f, -0.004695f}, + {+0.059412f, +0.107209f, +0.004895f}, + {+0.005676f, -0.059162f, +0.003180f} + }, + { + {-0.248577f, +0.462186f, -0.044825f}, + {-0.092220f, -0.576619f, -0.031483f}, + {-0.018552f, +0.118241f, -0.000190f}, + {+0.024038f, +0.192235f, +0.076006f}, + {-0.073463f, -0.111697f, -0.085309f}, + {-0.045418f, -0.052428f, +0.014128f}, + {+0.004341f, -0.088144f, -0.002830f}, + {+0.058183f, -0.067481f, +0.003537f}, + {-0.112838f, +0.181474f, -0.013812f}, + {-0.051144f, -0.057123f, -0.036471f}, + {+0.002310f, +0.009489f, +0.002928f}, + {+0.036815f, -0.070367f, -0.013190f}, + {+0.025238f, +0.001933f, +0.022381f}, + {+0.011799f, -0.070089f, -0.017261f}, + {+0.079383f, -0.005050f, +0.042259f}, + {+0.027513f, -0.031781f, -0.014727f} + }, + { + {-0.588729f, +0.069942f, -0.118192f}, + {+0.336864f, +0.087523f, +0.133178f}, + {-0.091818f, +0.000222f, -0.031435f}, + {-0.240072f, -0.209090f, -0.026656f}, + {+0.106536f, +0.210008f, +0.006949f}, + {-0.086566f, -0.077574f, +0.013942f}, + {+0.036640f, -0.012230f, +0.021355f}, + {+0.059977f, -0.024737f, +0.017673f}, + {-0.214469f, +0.026100f, -0.046140f}, + {-0.016107f, +0.082852f, +0.011968f}, + {+0.003608f, -0.021470f, -0.008749f}, + {+0.046323f, +0.010871f, +0.015628f}, + {-0.008214f, -0.079699f, -0.002987f}, + {+0.052373f, +0.029312f, +0.014086f}, + {+0.018742f, -0.113603f, +0.010455f}, + {+0.059520f, +0.032936f, +0.004294f} + }, + { + {-0.672439f, -0.199370f, +0.003424f}, + {+0.631922f, +0.138094f, +0.043549f}, + {-0.130748f, -0.058055f, -0.001266f}, + {-0.452933f, -0.003480f, -0.056408f}, + {+0.285057f, -0.030036f, +0.056968f}, + {-0.110275f, +0.011467f, -0.016793f}, + {+0.065972f, +0.005614f, +0.004420f}, + {-0.003151f, +0.047883f, +0.002061f}, + {-0.163084f, -0.130815f, +0.001810f}, + {+0.019555f, +0.025290f, +0.023258f}, + {+0.018781f, -0.034389f, -0.006142f}, + {+0.002509f, +0.046479f, +0.009162f}, + {-0.041047f, -0.024011f, -0.016940f}, + {+0.065623f, +0.027310f, +0.010505f}, + {-0.073560f, +0.039971f, -0.029159f}, + {+0.062876f, +0.006797f, +0.012019f} + }, + { + {-0.543455f, +0.059523f, +0.064094f}, + {+0.700107f, -0.080270f, -0.041520f}, + {-0.154990f, -0.009275f, +0.018360f}, + {-0.474326f, +0.126377f, -0.003035f}, + {+0.327360f, -0.114048f, +0.014833f}, + {-0.071241f, +0.058994f, -0.004572f}, + {+0.087784f, +0.000125f, -0.001107f}, + {-0.094160f, -0.038960f, -0.011917f}, + {-0.019089f, +0.055284f, +0.038765f}, + {+0.023647f, -0.039958f, -0.003588f}, + {+0.043021f, +0.013443f, +0.008032f}, + {-0.077825f, -0.044990f, -0.010103f}, + {-0.040861f, +0.021619f, +0.002193f}, + {+0.044745f, -0.030859f, -0.007951f}, + {-0.123807f, +0.055927f, -0.012492f}, + {+0.025663f, -0.034745f, +0.003611f} + }, + { + {-0.336060f, +0.028886f, +0.031505f}, + {+0.587287f, +0.009083f, -0.042775f}, + {-0.182505f, +0.025753f, +0.007772f}, + {-0.327915f, -0.064183f, +0.035026f}, + {+0.233666f, +0.067260f, -0.031214f}, + {+0.007323f, -0.030500f, +0.014877f}, + {+0.086165f, +0.005866f, -0.002682f}, + {-0.157983f, -0.017671f, -0.007972f}, + {+0.103610f, +0.038997f, +0.019660f}, + {+0.007681f, +0.004657f, -0.015128f}, + {+0.055812f, +0.017923f, +0.003300f}, + {-0.143968f, -0.013845f, -0.008347f}, + {-0.017716f, -0.004963f, +0.006287f}, + {+0.008786f, -0.012160f, -0.007210f}, + {-0.121102f, -0.034578f, +0.019391f}, + {-0.032193f, +0.031317f, -0.010154f} + }, + { + {-0.153248f, -0.008370f, -0.009310f}, + {+0.402033f, -0.000118f, -0.012937f}, + {-0.199763f, -0.006595f, +0.001228f}, + {-0.128842f, +0.004526f, +0.020419f}, + {+0.092842f, +0.010605f, -0.021993f}, + {+0.077909f, -0.025349f, +0.002895f}, + {+0.057392f, -0.008479f, -0.003710f}, + {-0.165419f, +0.022789f, +0.007822f}, + {+0.148908f, -0.037324f, -0.013709f}, + {-0.011296f, +0.018097f, -0.005621f}, + {+0.055136f, -0.008613f, -0.006635f}, + {-0.160576f, +0.015557f, +0.006131f}, + {+0.014844f, -0.003364f, +0.000064f}, + {-0.027453f, -0.001660f, +0.003786f}, + {-0.097934f, -0.032125f, +0.013700f}, + {-0.074549f, +0.020854f, -0.006292f} + }, + { + {-0.021458f, -0.031294f, -0.015786f}, + {+0.225566f, +0.016671f, +0.005476f}, + {-0.179128f, -0.006436f, +0.000989f}, + {+0.030888f, -0.004116f, -0.001010f}, + {-0.023526f, -0.004404f, +0.002301f}, + {+0.113727f, +0.001584f, -0.014207f}, + {+0.006187f, +0.003628f, -0.000322f}, + {-0.130415f, +0.000132f, +0.008388f}, + {+0.133114f, -0.001415f, -0.020106f}, + {-0.026233f, -0.006894f, +0.005590f}, + {+0.046982f, -0.011852f, -0.003518f}, + {-0.124161f, -0.003790f, +0.005992f}, + {+0.039303f, -0.005121f, -0.003574f}, + {-0.061746f, +0.020157f, -0.000385f}, + {-0.073801f, +0.016410f, -0.009153f}, + {-0.089034f, -0.008662f, +0.006612f} + }, + { + {+0.079072f, +0.039673f, -0.003004f}, + {+0.077618f, -0.033045f, +0.007328f}, + {-0.090967f, +0.027848f, +0.000971f}, + {+0.121511f, -0.002007f, -0.010039f}, + {-0.095609f, -0.005944f, +0.008880f}, + {+0.100415f, +0.015820f, -0.006869f}, + {-0.060544f, -0.012856f, +0.004470f}, + {-0.077695f, +0.001667f, -0.001003f}, + {+0.092912f, +0.018201f, -0.005273f}, + {-0.040823f, -0.014455f, +0.004325f}, + {+0.030102f, -0.002197f, +0.002719f}, + {-0.043620f, +0.016980f, +0.000122f}, + {+0.041014f, +0.001499f, -0.001303f}, + {-0.088431f, +0.009078f, -0.001327f}, + {-0.051030f, +0.024992f, -0.008833f}, + {-0.091055f, -0.011437f, +0.003728f} + }, + { + {+0.165755f, -0.020564f, +0.004876f}, + {-0.050384f, +0.037239f, +0.000994f}, + {+0.070084f, -0.036144f, -0.001750f}, + {+0.168503f, -0.016906f, -0.008961f}, + {-0.141507f, +0.014408f, +0.005947f}, + {+0.022796f, +0.010807f, +0.007047f}, + {-0.126569f, +0.016739f, +0.005274f}, + {-0.026827f, -0.017151f, -0.002196f}, + {+0.045512f, +0.004295f, +0.005991f}, + {-0.054896f, +0.008311f, -0.001754f}, + {+0.003645f, +0.010307f, +0.002009f}, + {+0.057176f, -0.014805f, -0.004774f}, + {+0.011072f, +0.010642f, -0.000248f}, + {-0.108885f, -0.004650f, +0.007771f}, + {-0.039664f, -0.018793f, +0.005550f}, + {-0.092338f, -0.000767f, -0.000795f} + }, + { + {+0.239774f, +0.007034f, +0.002631f}, + {-0.158490f, -0.023748f, -0.003698f}, + {+0.270403f, +0.044381f, -0.006888f}, + {+0.208319f, +0.016522f, -0.001863f}, + {-0.188853f, -0.017009f, +0.001321f}, + {-0.109689f, -0.039932f, +0.010880f}, + {-0.162224f, -0.011965f, +0.002284f}, + {+0.008275f, +0.010941f, +0.003208f}, + {-0.008632f, -0.022468f, +0.003767f}, + {-0.062087f, +0.004201f, -0.001503f}, + {-0.024938f, -0.010189f, -0.000489f}, + {+0.144572f, +0.021004f, -0.007356f}, + {-0.046268f, -0.010126f, +0.001327f}, + {-0.126844f, -0.020412f, +0.005586f}, + {-0.049688f, -0.012221f, +0.009513f}, + {-0.100800f, -0.001133f, +0.001097f} + }, + { + {+0.298828f, -0.005793f, -0.001373f}, + {-0.237768f, +0.008765f, -0.003046f}, + {+0.449357f, -0.047352f, -0.004642f}, + {+0.250753f, -0.004865f, -0.001957f}, + {-0.245484f, +0.010819f, +0.000881f}, + {-0.249706f, +0.049408f, +0.003961f}, + {-0.136738f, -0.008753f, -0.001855f}, + {+0.025853f, +0.003385f, +0.004139f}, + {-0.065934f, +0.022501f, -0.003288f}, + {-0.057527f, -0.008394f, +0.002717f}, + {-0.046206f, +0.004855f, -0.002123f}, + {+0.183725f, -0.015903f, -0.001405f}, + {-0.114051f, +0.012348f, +0.005264f}, + {-0.129436f, +0.010088f, -0.004805f}, + {-0.071460f, +0.022939f, +0.001488f}, + {-0.119149f, +0.009223f, +0.000555f} + }, + { + {+0.346011f, +0.008343f, -0.002521f}, + {-0.286535f, +0.000576f, +0.000480f}, + {+0.541635f, +0.014116f, +0.002290f}, + {+0.286228f, +0.009795f, -0.003869f}, + {-0.299965f, -0.009735f, +0.003167f}, + {-0.328736f, -0.018968f, -0.006082f}, + {-0.037520f, +0.034439f, -0.002184f}, + {+0.042204f, -0.003541f, +0.000630f}, + {-0.115659f, -0.004656f, -0.004969f}, + {-0.039051f, +0.003041f, +0.004257f}, + {-0.056424f, -0.001120f, -0.003167f}, + {+0.144869f, -0.019123f, +0.003415f}, + {-0.166286f, -0.018086f, +0.003983f}, + {-0.101679f, +0.021538f, -0.005021f}, + {-0.078280f, -0.006671f, -0.006794f}, + {-0.140047f, -0.004747f, -0.001252f} + }, + { + {+0.388388f, -0.009881f, -0.001847f}, + {-0.316128f, +0.000090f, +0.004009f}, + {+0.513290f, +0.035603f, +0.000300f}, + {+0.296513f, -0.005786f, -0.000267f}, + {-0.333378f, +0.007221f, +0.002877f}, + {-0.295424f, -0.041070f, -0.003600f}, + {+0.114311f, -0.042170f, +0.000214f}, + {+0.081378f, -0.006284f, -0.003240f}, + {-0.150267f, -0.005614f, +0.000485f}, + {-0.005390f, -0.000214f, +0.000390f}, + {-0.064645f, -0.002835f, -0.002892f}, + {+0.026756f, +0.044985f, -0.000392f}, + {-0.170480f, -0.001979f, -0.000156f}, + {-0.050780f, -0.025790f, +0.003317f}, + {-0.047515f, -0.026029f, -0.004739f}, + {-0.153995f, -0.004894f, +0.001183f} + }, + { + {+0.430636f, +0.009808f, -0.001195f}, + {-0.343293f, -0.010478f, +0.003913f}, + {+0.388765f, -0.049553f, -0.008265f}, + {+0.266407f, -0.016789f, +0.000864f}, + {-0.328141f, +0.007654f, +0.002512f}, + {-0.155445f, +0.060858f, +0.009380f}, + {+0.269010f, +0.026881f, -0.000978f}, + {+0.158656f, +0.025362f, -0.003743f}, + {-0.171832f, +0.002756f, +0.006554f}, + {+0.043647f, +0.009482f, -0.003918f}, + {-0.090667f, +0.001476f, +0.001048f}, + {-0.132548f, -0.036105f, -0.003022f}, + {-0.106351f, +0.024154f, -0.000421f}, + {-0.000521f, +0.009705f, +0.007542f}, + {+0.019829f, +0.036619f, +0.006700f}, + {-0.155900f, +0.002824f, +0.004883f} + }, + { + {+0.471455f, -0.008296f, -0.001200f}, + {-0.377731f, +0.016768f, -0.000590f}, + {+0.234888f, +0.026343f, -0.008776f}, + {+0.198215f, +0.029257f, -0.004797f}, + {-0.279113f, -0.015431f, +0.003236f}, + {+0.033581f, -0.032760f, +0.011351f}, + {+0.370767f, -0.006318f, -0.006828f}, + {+0.266209f, -0.029783f, -0.001410f}, + {-0.185419f, +0.012636f, +0.005498f}, + {+0.100533f, -0.019010f, -0.003209f}, + {-0.151097f, +0.010446f, +0.007094f}, + {-0.274631f, +0.012724f, +0.003901f}, + {+0.013966f, -0.029859f, -0.001195f}, + {+0.031705f, +0.010192f, +0.002683f}, + {+0.102880f, -0.011055f, +0.011106f}, + {-0.143777f, +0.006427f, +0.002026f} + }, + { + {+0.505485f, +0.006321f, -0.001405f}, + {-0.419164f, -0.009705f, -0.004024f}, + {+0.115231f, -0.006245f, -0.000430f}, + {+0.110599f, -0.013787f, -0.006578f}, + {-0.197526f, +0.015552f, +0.000736f}, + {+0.208411f, +0.008219f, -0.002566f}, + {+0.381442f, -0.001142f, -0.007728f}, + {+0.371664f, +0.016115f, -0.002975f}, + {-0.191819f, -0.017185f, -0.004447f}, + {+0.147317f, +0.015855f, +0.001243f}, + {-0.239821f, -0.029217f, +0.008681f}, + {-0.348287f, -0.007454f, +0.010181f}, + {+0.149521f, +0.030650f, -0.003365f}, + {+0.048588f, -0.006717f, -0.005355f}, + {+0.186826f, -0.010831f, -0.001024f}, + {-0.115953f, +0.001790f, -0.004618f} + }, + { + {+0.527959f, -0.004605f, -0.000793f}, + {-0.465933f, -0.000734f, -0.000648f}, + {+0.058769f, +0.003399f, +0.003980f}, + {+0.020939f, +0.002500f, +0.001602f}, + {-0.102989f, -0.023640f, -0.000907f}, + {+0.330754f, -0.015227f, -0.013490f}, + {+0.293504f, +0.012966f, +0.002367f}, + {+0.435673f, -0.007769f, -0.006056f}, + {-0.189456f, -0.010551f, -0.008519f}, + {+0.165864f, +0.001568f, +0.003516f}, + {-0.320806f, +0.034715f, +0.000873f}, + {-0.324855f, +0.004016f, +0.002288f}, + {+0.248230f, -0.023651f, -0.001117f}, + {+0.067435f, -0.016300f, -0.003833f}, + {+0.272913f, -0.007587f, -0.015541f}, + {-0.076620f, -0.021772f, -0.003143f} + }, + { + {+0.537963f, +0.000122f, -0.000129f}, + {-0.521439f, -0.006120f, +0.005687f}, + {+0.059349f, +0.002731f, +0.001179f}, + {-0.063524f, -0.015179f, +0.008462f}, + {-0.018295f, +0.018831f, +0.001086f}, + {+0.382316f, +0.020820f, -0.008228f}, + {+0.133723f, -0.051158f, +0.007642f}, + {+0.427333f, -0.004801f, -0.004396f}, + {-0.189172f, +0.025571f, +0.003440f}, + {+0.153064f, -0.017940f, -0.000618f}, + {-0.344855f, -0.000841f, -0.007255f}, + {-0.204120f, +0.035702f, -0.007554f}, + {+0.269414f, -0.005639f, +0.002449f}, + {+0.098719f, +0.013856f, +0.002962f}, + {+0.355359f, +0.040342f, -0.012703f}, + {-0.043435f, +0.014923f, +0.004398f} + }, + { + {+0.539918f, +0.002520f, -0.000803f}, + {-0.586780f, +0.022878f, +0.005664f}, + {+0.088465f, -0.012487f, -0.000009f}, + {-0.133857f, +0.024436f, +0.005429f}, + {+0.038815f, -0.004600f, +0.001199f}, + {+0.354019f, +0.005760f, +0.002225f}, + {-0.035479f, +0.061479f, -0.003852f}, + {+0.333448f, +0.030542f, -0.002292f}, + {-0.214917f, +0.009773f, +0.013046f}, + {+0.126578f, +0.010093f, -0.005470f}, + {-0.286447f, -0.044878f, -0.001444f}, + {-0.026257f, -0.067149f, -0.001093f}, + {+0.208042f, +0.035382f, -0.000884f}, + {+0.140716f, -0.000405f, +0.001329f}, + {+0.398750f, -0.026334f, +0.002502f}, + {-0.035058f, +0.007558f, +0.005919f} + }, + { + {+0.542223f, +0.000691f, -0.001439f}, + {-0.649673f, -0.023205f, -0.000535f}, + {+0.109219f, +0.005980f, +0.002282f}, + {-0.171779f, -0.010220f, -0.000656f}, + {+0.066150f, -0.005365f, -0.002547f}, + {+0.254746f, -0.041005f, +0.002026f}, + {-0.138924f, -0.008674f, -0.012149f}, + {+0.169249f, -0.044112f, -0.002599f}, + {-0.272638f, -0.040677f, +0.004640f}, + {+0.110153f, +0.006462f, -0.003434f}, + {-0.169903f, +0.042984f, +0.010056f}, + {+0.132794f, +0.036153f, +0.009130f}, + {+0.102112f, -0.031703f, -0.006139f}, + {+0.188913f, +0.004870f, -0.004839f}, + {+0.357390f, -0.030371f, +0.006291f}, + {-0.051114f, -0.020551f, -0.000894f} + }, + { + {+0.551847f, -0.004875f, -0.000679f}, + {-0.690272f, +0.004312f, -0.004016f}, + {+0.095639f, +0.010071f, +0.002809f}, + {-0.161818f, -0.013824f, -0.000790f}, + {+0.076081f, -0.002390f, -0.004308f}, + {+0.122361f, +0.040035f, -0.004601f}, + {-0.144006f, -0.036671f, -0.003198f}, + {-0.024466f, +0.039610f, -0.000882f}, + {-0.331827f, +0.020929f, -0.006635f}, + {+0.113319f, -0.007876f, +0.000927f}, + {-0.048322f, -0.009251f, +0.008004f}, + {+0.207982f, +0.015726f, +0.004350f}, + {+0.006949f, +0.009330f, -0.004246f}, + {+0.233905f, -0.014811f, -0.005355f}, + {+0.223143f, +0.054998f, -0.002434f}, + {-0.070208f, +0.002186f, -0.004895f} + }, + { + {+0.570043f, +0.005432f, +0.000103f}, + {-0.699360f, +0.014398f, +0.000427f}, + {+0.048501f, -0.018143f, +0.001306f}, + {-0.107295f, +0.023902f, +0.003671f}, + {+0.082584f, +0.006076f, -0.001731f}, + {+0.005834f, -0.019340f, -0.006865f}, + {-0.085415f, +0.035831f, +0.009933f}, + {-0.202459f, -0.035934f, +0.000303f}, + {-0.353113f, +0.015051f, -0.004263f}, + {+0.130123f, +0.004257f, +0.001776f}, + {+0.043254f, +0.003167f, -0.001496f}, + {+0.189334f, -0.031601f, -0.007634f}, + {-0.040215f, +0.005301f, +0.001534f}, + {+0.256999f, +0.008098f, -0.001598f}, + {+0.036347f, -0.049036f, -0.008301f}, + {-0.070389f, +0.011544f, -0.000794f} + }, + { + {+0.593416f, -0.005649f, +0.000278f}, + {-0.688298f, -0.007364f, +0.005463f}, + {-0.008044f, +0.018190f, -0.001207f}, + {-0.030689f, -0.015365f, +0.004543f}, + {+0.091891f, -0.004696f, +0.000919f}, + {-0.064670f, -0.007573f, -0.000965f}, + {-0.030187f, +0.002153f, +0.010834f}, + {-0.331404f, +0.015975f, +0.000858f}, + {-0.323976f, -0.025164f, +0.004961f}, + {+0.148829f, +0.000188f, -0.000078f}, + {+0.101305f, -0.006103f, -0.005181f}, + {+0.115300f, +0.016832f, -0.010749f}, + {-0.032766f, -0.011589f, +0.005290f}, + {+0.239406f, +0.007974f, +0.000705f}, + {-0.145255f, +0.023713f, -0.004941f}, + {-0.046369f, -0.012177f, +0.003695f} + }, + { + {+0.616579f, +0.002929f, -0.000295f}, + {-0.676588f, -0.004629f, +0.003842f}, + {-0.043537f, -0.004766f, -0.003324f}, + {+0.044220f, +0.013845f, +0.003072f}, + {+0.101856f, -0.006437f, -0.001748f}, + {-0.092523f, +0.007377f, +0.006975f}, + {-0.023470f, -0.026713f, -0.000479f}, + {-0.400554f, +0.001062f, +0.004867f}, + {-0.261565f, +0.014128f, +0.007944f}, + {+0.159121f, -0.002751f, -0.002980f}, + {+0.138765f, +0.008950f, -0.004189f}, + {+0.034625f, +0.000481f, -0.002727f}, + {+0.012613f, +0.005909f, +0.003331f}, + {+0.175748f, -0.024801f, -0.000902f}, + {-0.281594f, -0.008334f, +0.003990f}, + {-0.007054f, +0.002604f, +0.002155f} + }, + { + {+0.635179f, -0.002823f, -0.001148f}, + {-0.674199f, +0.007986f, -0.000991f}, + {-0.041014f, -0.013849f, -0.001185f}, + {+0.104750f, -0.003964f, +0.000987f}, + {+0.107619f, -0.003736f, -0.004502f}, + {-0.101204f, +0.003739f, +0.008397f}, + {-0.064575f, +0.021388f, -0.009658f}, + {-0.422196f, -0.004265f, +0.008954f}, + {-0.190975f, -0.003688f, +0.002622f}, + {+0.155793f, -0.001509f, -0.003088f}, + {+0.169274f, -0.008874f, -0.002289f}, + {-0.023162f, +0.001981f, +0.005597f}, + {+0.073018f, -0.010252f, -0.000970f}, + {+0.080452f, +0.024265f, -0.002891f}, + {-0.363635f, +0.004698f, +0.010523f}, + {+0.035663f, -0.006812f, -0.001722f} + }, + { + {+0.647447f, +0.003124f, -0.000778f}, + {-0.678396f, +0.001222f, -0.002175f}, + {-0.008003f, +0.018788f, +0.004232f}, + {+0.153771f, +0.006824f, -0.001505f}, + {+0.102284f, +0.006283f, -0.000369f}, + {-0.107854f, -0.015766f, +0.002536f}, + {-0.127703f, -0.002824f, -0.007472f}, + {-0.415367f, -0.005027f, +0.007128f}, + {-0.124975f, +0.011994f, -0.001327f}, + {+0.135698f, -0.002841f, -0.000522f}, + {+0.197083f, +0.008952f, -0.000525f}, + {-0.049410f, -0.008433f, +0.005306f}, + {+0.128034f, +0.008755f, -0.002993f}, + {-0.020098f, -0.017083f, -0.001266f}, + {-0.399229f, -0.010519f, +0.009961f}, + {+0.073610f, +0.013100f, -0.000219f} + }, + { + {+0.653287f, -0.000651f, -0.000132f}, + {-0.682914f, -0.002014f, +0.000124f}, + {+0.032972f, -0.005837f, +0.006215f}, + {+0.202805f, -0.008225f, -0.002812f}, + {+0.078083f, +0.005921f, +0.003749f}, + {-0.111320f, +0.004540f, -0.003693f}, + {-0.194460f, +0.001719f, +0.000738f}, + {-0.388630f, -0.001712f, +0.002133f}, + {-0.064250f, -0.011691f, -0.000978f}, + {+0.097911f, +0.010340f, +0.000589f}, + {+0.217935f, -0.002537f, +0.000189f}, + {-0.043003f, +0.001190f, +0.000648f}, + {+0.160424f, -0.006445f, -0.003025f}, + {-0.102796f, +0.011222f, +0.001449f}, + {-0.392994f, +0.003832f, +0.004205f}, + {+0.101814f, -0.004741f, +0.002529f} + }, + { + {+0.655085f, -0.000496f, -0.000073f}, + {-0.685269f, -0.000562f, +0.000824f}, + {+0.064749f, -0.008716f, +0.000371f}, + {+0.258268f, +0.016126f, -0.002727f}, + {+0.038467f, -0.019915f, +0.001374f}, + {-0.101519f, +0.013031f, -0.001724f}, + {-0.262717f, -0.010913f, +0.005785f}, + {-0.340935f, +0.010917f, -0.000109f}, + {-0.005117f, +0.011670f, -0.001141f}, + {+0.047975f, -0.015016f, -0.000510f}, + {+0.227673f, -0.001545f, -0.000844f}, + {-0.006815f, +0.010613f, -0.001679f}, + {+0.158152f, -0.002971f, -0.001763f}, + {-0.154604f, -0.004393f, +0.003495f}, + {-0.341946f, +0.012918f, +0.000060f}, + {+0.123129f, -0.003187f, +0.000554f} + }, + { + {+0.657162f, +0.001154f, -0.000704f}, + {-0.686405f, +0.001174f, -0.000024f}, + {+0.087607f, -0.002335f, -0.004967f}, + {+0.314889f, -0.015378f, -0.000770f}, + {+0.001549f, +0.013009f, -0.003904f}, + {-0.077871f, -0.011151f, +0.003120f}, + {-0.333383f, +0.022033f, +0.004891f}, + {-0.273704f, -0.019370f, +0.000308f}, + {+0.054701f, -0.011371f, -0.002150f}, + {-0.003312f, +0.012026f, -0.002061f}, + {+0.228798f, +0.001402f, -0.001592f}, + {+0.048684f, -0.018229f, -0.000520f}, + {+0.117088f, +0.012634f, -0.000896f}, + {-0.173410f, +0.001735f, +0.003820f}, + {-0.247906f, -0.029903f, +0.000682f}, + {+0.148293f, -0.000926f, -0.003582f} + }, + { + {+0.663635f, +0.002010f, -0.001316f}, + {-0.689882f, +0.000220f, -0.000110f}, + {+0.108949f, +0.013447f, -0.002013f}, + {+0.358661f, +0.009695f, +0.001033f}, + {-0.013352f, +0.004281f, -0.004550f}, + {-0.049096f, +0.001505f, +0.002637f}, + {-0.398463f, -0.021957f, -0.000327f}, + {-0.196600f, +0.019778f, +0.001903f}, + {+0.110988f, +0.014423f, -0.001867f}, + {-0.045870f, -0.004558f, -0.001576f}, + {+0.228188f, -0.000097f, -0.001476f}, + {+0.105835f, +0.015244f, +0.001995f}, + {+0.044580f, -0.021539f, -0.001382f}, + {-0.164082f, +0.001655f, +0.001885f}, + {-0.126620f, +0.032568f, +0.003705f}, + {+0.185481f, +0.013419f, -0.004184f} + }, + { + {+0.675624f, -0.004827f, -0.000839f}, + {-0.700179f, +0.002102f, +0.000678f}, + {+0.128613f, -0.006572f, +0.002141f}, + {+0.378743f, +0.002887f, +0.000648f}, + {-0.004220f, -0.012669f, -0.000801f}, + {-0.022440f, -0.000653f, -0.000869f}, + {-0.441665f, +0.002210f, -0.002042f}, + {-0.124814f, -0.014411f, +0.002833f}, + {+0.153596f, -0.007894f, -0.000675f}, + {-0.077085f, +0.001217f, +0.000703f}, + {+0.231308f, +0.000725f, -0.002147f}, + {+0.147273f, -0.003213f, +0.002198f}, + {-0.042268f, +0.020842f, -0.002800f}, + {-0.133721f, -0.009739f, +0.001057f}, + {-0.003152f, -0.021386f, +0.003714f}, + {+0.229253f, -0.015325f, -0.001319f} + }, + { + {+0.689875f, +0.004735f, +0.000183f}, + {-0.720017f, -0.006167f, +0.000699f}, + {+0.141755f, -0.003516f, +0.000834f}, + {+0.376706f, -0.006807f, -0.001713f}, + {+0.011000f, +0.005016f, +0.001618f}, + {-0.000647f, +0.004137f, -0.002283f}, + {-0.454292f, +0.009561f, +0.002281f}, + {-0.069428f, +0.004651f, +0.001574f}, + {+0.172906f, +0.000456f, -0.000712f}, + {-0.102160f, -0.005230f, +0.001608f}, + {+0.237600f, +0.001176f, -0.003651f}, + {+0.166513f, -0.006046f, -0.001258f}, + {-0.123162f, -0.009523f, -0.000972f}, + {-0.093037f, +0.007808f, +0.000738f}, + {+0.101706f, +0.008107f, -0.001772f}, + {+0.261899f, +0.005910f, +0.000263f} + }, + { + {+0.701449f, -0.001309f, +0.000513f}, + {-0.747852f, +0.007083f, +0.000295f}, + {+0.146674f, +0.002063f, -0.002067f}, + {+0.365508f, +0.004005f, -0.003093f}, + {+0.009820f, +0.003073f, +0.001694f}, + {+0.014954f, -0.005079f, -0.001243f}, + {-0.444057f, -0.005273f, +0.005170f}, + {-0.030220f, -0.001713f, -0.001402f}, + {+0.167308f, +0.005594f, -0.001307f}, + {-0.126894f, +0.005843f, +0.001163f}, + {+0.239461f, -0.006087f, -0.002206f}, + {+0.171030f, +0.001130f, -0.003837f}, + {-0.185728f, +0.008176f, +0.002303f}, + {-0.053859f, -0.008398f, -0.000003f}, + {+0.180213f, -0.012225f, -0.006311f}, + {+0.267399f, +0.003688f, -0.000070f} + }, + { + {+0.707682f, -0.001614f, -0.000417f}, + {-0.778938f, -0.006537f, +0.000334f}, + {+0.145291f, +0.002890f, -0.001284f}, + {+0.359528f, +0.005062f, -0.001469f}, + {-0.019378f, -0.015221f, +0.000076f}, + {+0.021977f, +0.000916f, -0.000266f}, + {-0.425305f, -0.000822f, +0.003160f}, + {+0.002113f, +0.007052f, -0.002427f}, + {+0.143996f, -0.006679f, -0.001487f}, + {-0.153276f, -0.008199f, +0.000318f}, + {+0.224106f, -0.002607f, +0.000957f}, + {+0.172702f, +0.005631f, -0.001975f}, + {-0.227595f, -0.009189f, +0.001906f}, + {-0.024550f, +0.006878f, +0.000998f}, + {+0.231993f, +0.016149f, -0.003555f}, + {+0.242520f, -0.012045f, -0.001170f} + }, + { + {+0.709804f, +0.000997f, -0.001515f}, + {-0.808027f, +0.005290f, +0.000583f}, + {+0.139809f, +0.000435f, +0.000818f}, + {+0.365924f, -0.006226f, +0.001737f}, + {-0.071369f, +0.017742f, -0.003060f}, + {+0.017802f, +0.003027f, -0.000621f}, + {-0.407651f, -0.000451f, +0.000175f}, + {+0.034591f, -0.007791f, -0.002030f}, + {+0.114950f, +0.006228f, -0.001120f}, + {-0.179490f, +0.006128f, -0.000795f}, + {+0.183246f, +0.015768f, +0.000773f}, + {+0.177035f, -0.003531f, +0.000696f}, + {-0.250400f, +0.001355f, +0.001108f}, + {-0.008187f, +0.000159f, +0.001456f}, + {+0.254611f, -0.001384f, -0.000532f}, + {+0.198496f, +0.013948f, -0.002759f} + }, + { + {+0.710823f, +0.002381f, -0.001069f}, + {-0.831214f, -0.003447f, +0.000878f}, + {+0.132056f, -0.007797f, -0.000969f}, + {+0.382880f, -0.001094f, +0.000711f}, + {-0.129160f, -0.007502f, -0.002763f}, + {+0.003161f, -0.000767f, +0.000443f}, + {-0.392711f, +0.006305f, +0.000815f}, + {+0.067053f, +0.011901f, -0.000327f}, + {+0.090742f, -0.003835f, -0.000996f}, + {-0.202084f, -0.000560f, +0.000195f}, + {+0.122322f, -0.020924f, -0.002535f}, + {+0.182462f, -0.002778f, -0.000258f}, + {-0.259161f, +0.001293f, +0.002195f}, + {+0.000645f, -0.003627f, -0.000469f}, + {+0.248733f, -0.007401f, -0.001654f}, + {+0.153178f, -0.008546f, -0.003483f} + }, + { + {+0.712186f, -0.002003f, +0.000341f}, + {-0.846788f, +0.001521f, +0.001394f}, + {+0.124294f, +0.003415f, -0.004317f}, + {+0.406372f, -0.002613f, -0.002804f}, + {-0.179207f, +0.002493f, +0.001438f}, + {-0.017437f, +0.004122f, +0.002593f}, + {-0.378082f, -0.002349f, +0.002279f}, + {+0.093160f, -0.004321f, +0.001305f}, + {+0.077016f, -0.001502f, +0.000076f}, + {-0.220676f, +0.001245f, +0.002361f}, + {+0.057208f, +0.011096f, -0.003599f}, + {+0.185276f, +0.001151f, -0.002614f}, + {-0.259729f, -0.001827f, +0.003455f}, + {+0.012127f, +0.000504f, -0.003413f}, + {+0.221948f, +0.010321f, -0.003531f}, + {+0.118717f, -0.000242f, -0.001468f} + }, + { + {+0.713662f, -0.000828f, +0.000545f}, + {-0.855438f, -0.002950f, +0.000977f}, + {+0.115830f, +0.005727f, -0.002674f}, + {+0.431080f, +0.008386f, -0.003025f}, + {-0.218522f, -0.008054f, +0.003300f}, + {-0.036091f, -0.008702f, +0.001428f}, + {-0.359216f, +0.001218f, +0.000904f}, + {+0.107642f, -0.001544f, +0.000220f}, + {+0.072571f, -0.000752f, +0.000715f}, + {-0.237634f, -0.007061f, +0.001792f}, + {+0.001551f, -0.003678f, -0.000322f}, + {+0.181633f, +0.003122f, -0.001514f}, + {-0.255564f, -0.003731f, +0.002293f}, + {+0.032826f, +0.012636f, -0.002484f}, + {+0.185211f, -0.004024f, -0.002705f}, + {+0.094101f, -0.001623f, +0.001061f} + }, + { + {+0.715808f, +0.001447f, -0.000564f}, + {-0.858599f, +0.000128f, +0.000166f}, + {+0.099314f, +0.001041f, +0.001297f}, + {+0.448457f, -0.007760f, -0.000064f}, + {-0.248826f, +0.008996f, +0.001277f}, + {-0.041985f, +0.000319f, -0.000791f}, + {-0.330901f, -0.006650f, -0.000552f}, + {+0.113746f, +0.002963f, -0.001774f}, + {+0.073588f, -0.000327f, +0.000159f}, + {-0.253601f, +0.004683f, -0.000245f}, + {-0.041369f, +0.004973f, +0.002735f}, + {+0.166731f, +0.003863f, +0.000533f}, + {-0.246518f, -0.001268f, -0.000049f}, + {+0.057814f, -0.010629f, +0.001615f}, + {+0.147641f, +0.004485f, +0.000244f}, + {+0.070521f, +0.005007f, +0.001670f} + }, + { + {+0.720382f, +0.001583f, -0.001168f}, + {-0.858507f, +0.001602f, +0.000561f}, + {+0.067329f, -0.015190f, +0.000273f}, + {+0.450274f, -0.005070f, +0.000753f}, + {-0.271109f, -0.002256f, +0.000399f}, + {-0.028488f, +0.011815f, +0.001154f}, + {-0.292330f, +0.012166f, +0.000199f}, + {+0.120202f, +0.001560f, -0.002785f}, + {+0.077618f, +0.000385f, -0.000057f}, + {-0.267478f, +0.001019f, +0.000455f}, + {-0.074822f, -0.008817f, +0.002528f}, + {+0.138952f, -0.011104f, -0.000590f}, + {-0.231196f, +0.009528f, +0.001492f}, + {+0.074656f, -0.000989f, +0.002061f}, + {+0.113858f, -0.008628f, +0.000648f}, + {+0.041189f, -0.009773f, +0.000867f} + }, + { + {+0.728412f, -0.003781f, -0.000442f}, + {-0.858915f, -0.000641f, +0.001243f}, + {+0.021588f, +0.015568f, -0.003718f}, + {+0.435021f, +0.011190f, -0.002580f}, + {-0.286107f, -0.000454f, +0.002042f}, + {+0.001012f, -0.010763f, +0.004584f}, + {-0.248323f, -0.011164f, +0.001788f}, + {+0.134196f, -0.006281f, -0.001978f}, + {+0.082702f, +0.001367f, -0.001190f}, + {-0.278772f, -0.000302f, +0.002741f}, + {-0.102933f, +0.009391f, -0.000025f}, + {+0.103537f, +0.008673f, -0.002139f}, + {-0.211947f, -0.006496f, +0.004418f}, + {+0.077185f, +0.005220f, -0.000312f}, + {+0.087037f, +0.006765f, -0.000943f}, + {+0.005530f, +0.010882f, -0.000993f} + }, + { + {+0.738976f, +0.002329f, +0.000136f}, + {-0.861896f, +0.000932f, +0.002377f}, + {-0.029402f, -0.003271f, -0.002468f}, + {+0.408989f, -0.003243f, -0.003584f}, + {-0.293612f, -0.002313f, +0.002730f}, + {+0.038002f, +0.000412f, +0.002803f}, + {-0.206194f, +0.003320f, +0.000488f}, + {+0.155421f, +0.006078f, -0.001116f}, + {+0.087818f, +0.003223f, -0.001518f}, + {-0.285833f, -0.006231f, +0.001960f}, + {-0.128249f, -0.001074f, -0.000243f}, + {+0.068575f, -0.002940f, -0.000700f}, + {-0.191804f, -0.003014f, +0.002724f}, + {+0.067942f, -0.005643f, -0.002245f}, + {+0.068213f, -0.000980f, -0.001053f}, + {-0.030778f, -0.002407f, -0.000036f} + }, + { + {+0.750300f, +0.000058f, -0.000825f}, + {-0.866279f, +0.001749f, +0.003432f}, + {-0.078123f, -0.003921f, +0.005991f}, + {+0.379010f, -0.005518f, +0.002243f}, + {-0.292486f, +0.009941f, -0.001947f}, + {+0.075433f, +0.005336f, -0.005378f}, + {-0.170771f, -0.002341f, -0.003169f}, + {+0.177886f, -0.005886f, -0.000679f}, + {+0.091281f, -0.005785f, +0.001198f}, + {-0.285767f, +0.012433f, -0.005156f}, + {-0.152796f, -0.004962f, +0.005079f}, + {+0.040112f, +0.002644f, +0.001940f}, + {-0.171647f, +0.007661f, -0.004705f}, + {+0.053028f, -0.000873f, -0.001571f}, + {+0.054373f, -0.002064f, +0.001211f}, + {-0.062123f, +0.000837f, +0.004082f} + }, + { + {+0.760695f, +0.000187f, -0.002580f}, + {-0.869383f, -0.005374f, +0.001979f}, + {-0.118984f, -0.003432f, +0.014567f}, + {+0.349914f, +0.003949f, +0.011712f}, + {-0.283867f, -0.008607f, -0.011966f}, + {+0.106829f, +0.003798f, -0.012953f}, + {-0.143863f, +0.007735f, -0.004012f}, + {+0.195900f, +0.004792f, +0.000560f}, + {+0.091845f, +0.002959f, +0.004936f}, + {-0.279043f, -0.006225f, -0.015628f}, + {-0.177000f, +0.001330f, +0.012704f}, + {+0.021476f, -0.006516f, +0.001630f}, + {-0.154239f, +0.000969f, -0.011998f}, + {+0.037152f, +0.007671f, +0.004251f}, + {+0.041126f, +0.001005f, +0.004482f}, + {-0.085797f, -0.005363f, +0.006097f} + } +}; + +const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +{ + { + {-0.191323f, +0.550462f, -0.164703f}, + {+0.179339f, -0.105827f, -0.022109f}, + {-0.016317f, +0.069138f, -0.026386f}, + {-0.031302f, +0.044550f, -0.011983f}, + {+0.011873f, +0.049933f, -0.022817f}, + {-0.002100f, +0.025417f, -0.008917f}, + {+0.008673f, +0.072165f, -0.030658f}, + {+0.009984f, -0.046099f, +0.014260f}, + {-0.017932f, +0.200113f, -0.071972f}, + {+0.009948f, +0.076380f, -0.035799f}, + {-0.000500f, -0.013211f, +0.007415f}, + {+0.005467f, +0.017109f, -0.007909f}, + {-0.001381f, -0.024397f, +0.011565f}, + {+0.001735f, -0.017167f, +0.009148f}, + {-0.006994f, -0.015041f, +0.007364f}, + {-0.000274f, +0.004190f, -0.001467f} + }, + { + {-0.330036f, +0.333647f, -0.215680f}, + {+0.446962f, +0.557076f, +0.195252f}, + {-0.017152f, +0.086610f, -0.016060f}, + {-0.053984f, +0.030859f, -0.007361f}, + {+0.031663f, +0.050397f, -0.030580f}, + {-0.013130f, -0.075028f, -0.055072f}, + {+0.035680f, +0.080722f, -0.037346f}, + {+0.011258f, -0.044042f, +0.013548f}, + {+0.004710f, +0.152351f, -0.099878f}, + {+0.054304f, +0.216938f, +0.014289f}, + {-0.014461f, -0.090558f, -0.026436f}, + {+0.019523f, +0.056800f, +0.001967f}, + {-0.012667f, -0.065948f, -0.004877f}, + {-0.011111f, -0.088384f, -0.022179f}, + {-0.018869f, -0.025704f, +0.006997f}, + {+0.000817f, +0.008300f, +0.000651f} + }, + { + {-0.096856f, -0.591788f, +0.084769f}, + {+0.247542f, +1.016515f, +0.073842f}, + {-0.000574f, +0.046908f, -0.004371f}, + {-0.019540f, +0.031177f, -0.013825f}, + {+0.037796f, -0.124420f, +0.041797f}, + {+0.007360f, -0.192733f, -0.007619f}, + {+0.072377f, -0.160383f, +0.061576f}, + {-0.003711f, +0.021943f, -0.004227f}, + {+0.112964f, -0.363004f, +0.093285f}, + {+0.056746f, +0.090813f, +0.072980f}, + {-0.006103f, -0.134417f, -0.008866f}, + {+0.005326f, +0.101653f, -0.016759f}, + {-0.002749f, -0.090650f, +0.006843f}, + {-0.000089f, -0.179843f, +0.016051f}, + {+0.001814f, -0.087437f, +0.037078f}, + {+0.005267f, -0.010738f, +0.007098f} + }, + { + {+0.063555f, -0.411417f, +0.075756f}, + {-0.093014f, +0.372322f, -0.077805f}, + {+0.007107f, +0.054992f, -0.008311f}, + {+0.033886f, +0.080359f, -0.013428f}, + {-0.014436f, -0.207733f, +0.015885f}, + {+0.013408f, -0.128849f, +0.020860f}, + {+0.024255f, -0.374328f, -0.023256f}, + {-0.002134f, +0.023939f, +0.000696f}, + {+0.058983f, -0.666227f, -0.050398f}, + {+0.014357f, +0.059836f, +0.078919f}, + {+0.009066f, -0.055606f, +0.025373f}, + {+0.008234f, +0.193844f, +0.040018f}, + {+0.010778f, -0.088365f, +0.004018f}, + {+0.007190f, -0.141067f, +0.033486f}, + {+0.015950f, -0.182801f, -0.014037f}, + {-0.004549f, -0.103305f, -0.035896f} + }, + { + {+0.019484f, -0.338410f, +0.083536f}, + {-0.202040f, +0.634536f, -0.185332f}, + {+0.007949f, -0.067812f, +0.047529f}, + {+0.048582f, -0.153833f, +0.075433f}, + {-0.054773f, +0.008273f, -0.058696f}, + {-0.024929f, +0.021715f, -0.041866f}, + {-0.026392f, -0.170362f, -0.104628f}, + {+0.014816f, -0.001719f, +0.003760f}, + {-0.050384f, -0.474129f, -0.111890f}, + {-0.050928f, +0.326828f, -0.037272f}, + {+0.005968f, -0.019903f, +0.009428f}, + {+0.002366f, +0.233633f, +0.019586f}, + {+0.014235f, -0.074982f, -0.008001f}, + {-0.003852f, +0.000864f, -0.026540f}, + {+0.024596f, -0.140123f, -0.045292f}, + {+0.007335f, -0.140212f, -0.016737f} + }, + { + {-0.203259f, -0.677311f, +0.036974f}, + {+0.017307f, +0.878070f, -0.170118f}, + {-0.043215f, -0.181813f, +0.012035f}, + {-0.067120f, -0.199982f, +0.078357f}, + {+0.003334f, +0.005382f, -0.060963f}, + {-0.037369f, +0.095076f, -0.002797f}, + {-0.007145f, +0.024172f, -0.016239f}, + {+0.025809f, +0.035193f, +0.010462f}, + {-0.123278f, -0.317455f, +0.005941f}, + {-0.071780f, +0.152842f, -0.115403f}, + {+0.009047f, -0.007435f, +0.015219f}, + {-0.009240f, +0.131025f, -0.037457f}, + {+0.010330f, -0.013791f, +0.019556f}, + {+0.018073f, +0.051639f, -0.007415f}, + {+0.023065f, +0.024816f, +0.028060f}, + {+0.023145f, -0.072535f, +0.012653f} + }, + { + {-0.363585f, -0.196908f, -0.132849f}, + {+0.400794f, -0.061111f, +0.146774f}, + {-0.088996f, -0.035461f, -0.039728f}, + {-0.248102f, +0.210034f, -0.044008f}, + {+0.136603f, -0.269455f, +0.014678f}, + {-0.039867f, +0.056544f, +0.018785f}, + {+0.012335f, -0.061064f, +0.014746f}, + {+0.001640f, +0.021263f, +0.019567f}, + {-0.164395f, -0.120409f, -0.065761f}, + {-0.005008f, -0.124444f, -0.002355f}, + {+0.006089f, +0.036166f, -0.003168f}, + {-0.008972f, +0.027316f, +0.008811f}, + {-0.026456f, +0.074066f, -0.007831f}, + {+0.036264f, -0.025445f, +0.017552f}, + {-0.046783f, +0.110385f, +0.011511f}, + {+0.016634f, -0.063190f, +0.003470f} + }, + { + {-0.140043f, +0.331564f, +0.031879f}, + {+0.418213f, -0.323867f, +0.026950f}, + {-0.066524f, +0.078043f, +0.003209f}, + {-0.275295f, +0.106284f, -0.069212f}, + {+0.205855f, -0.059809f, +0.074823f}, + {-0.024267f, -0.018141f, -0.016347f}, + {+0.021686f, -0.056152f, +0.012278f}, + {-0.065157f, -0.071098f, -0.001681f}, + {-0.025332f, +0.159594f, +0.013561f}, + {+0.029475f, -0.035218f, +0.023811f}, + {+0.011328f, +0.030605f, -0.007685f}, + {-0.054740f, -0.020295f, -0.000302f}, + {-0.047455f, +0.027854f, -0.019731f}, + {+0.022053f, -0.039858f, +0.012679f}, + {-0.116347f, -0.040132f, -0.032026f}, + {-0.007321f, -0.043491f, +0.015668f} + }, + { + {+0.232420f, -0.042183f, +0.090352f}, + {+0.143907f, +0.128870f, -0.081606f}, + {-0.019255f, -0.008481f, +0.025359f}, + {-0.079364f, -0.195197f, +0.009060f}, + {+0.092435f, +0.165349f, +0.007306f}, + {+0.037358f, -0.066958f, -0.009347f}, + {+0.002010f, -0.000201f, -0.007048f}, + {-0.118479f, -0.000141f, -0.016298f}, + {+0.131479f, -0.025371f, +0.046423f}, + {+0.013254f, +0.056073f, -0.007964f}, + {+0.020421f, -0.014051f, +0.008057f}, + {-0.102505f, +0.044999f, -0.012472f}, + {-0.028717f, -0.037569f, +0.002612f}, + {-0.021286f, +0.036718f, -0.008001f}, + {-0.110557f, -0.093273f, -0.012580f}, + {-0.060924f, +0.023756f, -0.000190f} + }, + { + {+0.533983f, -0.079000f, +0.018330f}, + {-0.217748f, +0.012931f, -0.048151f}, + {+0.025802f, -0.036354f, +0.006267f}, + {+0.205140f, +0.060899f, +0.046660f}, + {-0.113290f, -0.081234f, -0.041909f}, + {+0.105415f, +0.030348f, +0.015181f}, + {-0.034112f, -0.007984f, -0.002032f}, + {-0.109019f, +0.032142f, -0.005021f}, + {+0.186112f, -0.090334f, +0.010289f}, + {-0.018376f, +0.004638f, -0.018235f}, + {+0.011521f, -0.024596f, +0.005093f}, + {-0.106685f, +0.043319f, -0.011207f}, + {+0.003719f, +0.002813f, +0.009833f}, + {-0.061529f, +0.014049f, -0.008239f}, + {-0.045872f, +0.041391f, +0.025100f}, + {-0.106073f, -0.025839f, -0.009219f} + }, + { + {+0.689088f, +0.021676f, -0.035498f}, + {-0.512497f, -0.013050f, +0.008139f}, + {+0.080900f, -0.013233f, -0.008488f}, + {+0.415840f, +0.041814f, +0.013996f}, + {-0.278767f, -0.050484f, -0.020716f}, + {+0.124237f, +0.048494f, +0.003541f}, + {-0.083860f, +0.012095f, -0.001839f}, + {-0.040470f, -0.043256f, +0.009440f}, + {+0.127554f, +0.052174f, -0.027560f}, + {-0.038197f, -0.025553f, -0.002386f}, + {-0.013296f, +0.017618f, -0.006802f}, + {-0.049000f, -0.034411f, +0.008434f}, + {+0.023951f, +0.015385f, +0.000397f}, + {-0.079741f, -0.014689f, +0.006056f}, + {+0.015937f, +0.036771f, +0.013501f}, + {-0.116284f, -0.032742f, -0.005608f} + }, + { + {+0.733240f, +0.033897f, -0.028463f}, + {-0.683283f, -0.019108f, +0.024422f}, + {+0.165878f, +0.024612f, -0.005353f}, + {+0.489377f, -0.026929f, -0.018187f}, + {-0.343135f, +0.029846f, +0.016631f}, + {+0.086256f, -0.016816f, -0.014815f}, + {-0.129107f, +0.000075f, +0.000830f}, + {+0.047145f, -0.000801f, +0.008881f}, + {+0.023844f, +0.003992f, -0.023086f}, + {-0.042301f, +0.008336f, +0.009579f}, + {-0.039371f, +0.014019f, -0.003266f}, + {+0.037930f, +0.005491f, +0.006528f}, + {+0.020403f, -0.000483f, -0.004551f}, + {-0.081119f, -0.016241f, +0.003920f}, + {+0.051945f, -0.020771f, -0.013605f}, + {-0.091078f, +0.021518f, +0.009604f} + }, + { + {+0.733114f, -0.029809f, -0.003150f}, + {-0.758988f, +0.025935f, +0.015102f}, + {+0.280906f, -0.031811f, -0.003778f}, + {+0.459117f, +0.008405f, -0.019040f}, + {-0.333055f, +0.004022f, +0.017856f}, + {+0.012149f, -0.009636f, -0.003754f}, + {-0.156853f, +0.003236f, +0.004887f}, + {+0.114968f, +0.002815f, -0.004184f}, + {-0.064559f, -0.023528f, +0.001333f}, + {-0.039134f, +0.015161f, +0.005522f}, + {-0.063282f, +0.001881f, +0.005278f}, + {+0.121057f, -0.006821f, -0.003568f}, + {-0.006828f, +0.002343f, -0.000194f}, + {-0.069156f, -0.009861f, -0.001545f}, + {+0.070362f, -0.029774f, -0.011253f}, + {-0.061366f, +0.013312f, +0.005905f} + }, + { + {+0.724625f, -0.001203f, +0.006316f}, + {-0.787100f, -0.019364f, +0.003117f}, + {+0.401617f, +0.025467f, -0.004330f}, + {+0.392760f, +0.000769f, -0.009132f}, + {-0.296783f, -0.006051f, +0.006244f}, + {-0.080677f, -0.011855f, +0.011409f}, + {-0.155686f, -0.003923f, +0.003032f}, + {+0.152027f, +0.011289f, -0.005772f}, + {-0.122199f, -0.008679f, +0.013528f}, + {-0.032224f, -0.005650f, -0.003051f}, + {-0.086101f, -0.012645f, +0.003029f}, + {+0.171824f, +0.008018f, -0.006233f}, + {-0.049811f, -0.010853f, +0.002128f}, + {-0.046385f, +0.014661f, +0.005149f}, + {+0.075593f, +0.018900f, +0.006819f}, + {-0.042682f, -0.001204f, -0.002701f} + }, + { + {+0.710313f, +0.016351f, +0.000594f}, + {-0.788202f, -0.001698f, -0.001880f}, + {+0.478276f, -0.009988f, -0.006465f}, + {+0.338553f, -0.006580f, +0.000873f}, + {-0.267876f, +0.004181f, -0.000561f}, + {-0.161632f, +0.031504f, +0.010015f}, + {-0.112024f, -0.007981f, -0.001560f}, + {+0.161078f, -0.006395f, +0.000785f}, + {-0.159938f, +0.023767f, +0.006167f}, + {-0.016977f, -0.011649f, -0.002458f}, + {-0.101033f, +0.005466f, -0.000979f}, + {+0.168147f, +0.002987f, -0.004477f}, + {-0.090853f, +0.008103f, +0.002155f}, + {-0.019160f, +0.010061f, +0.003516f}, + {+0.068113f, +0.017356f, +0.008667f}, + {-0.034415f, -0.006094f, -0.000653f} + }, + { + {+0.687296f, -0.010309f, -0.005056f}, + {-0.764260f, +0.015559f, +0.000832f}, + {+0.464886f, -0.002946f, -0.003297f}, + {+0.298384f, -0.012876f, +0.002489f}, + {-0.246598f, +0.005940f, -0.001267f}, + {-0.184060f, -0.014332f, -0.000763f}, + {-0.024137f, +0.022250f, -0.004819f}, + {+0.154151f, -0.010440f, +0.001340f}, + {-0.181725f, -0.011644f, -0.002738f}, + {+0.007528f, +0.010988f, +0.002133f}, + {-0.103221f, +0.002109f, -0.001628f}, + {+0.103776f, -0.007568f, +0.001735f}, + {-0.108578f, +0.000395f, +0.003349f}, + {+0.017935f, -0.001653f, -0.006823f}, + {+0.063247f, -0.018078f, -0.002599f}, + {-0.031929f, -0.003751f, +0.000579f} + }, + { + {+0.659915f, +0.003181f, -0.004789f}, + {-0.723641f, -0.015598f, +0.004701f}, + {+0.344320f, +0.034439f, +0.003396f}, + {+0.252485f, +0.010951f, -0.000869f}, + {-0.213766f, -0.011294f, +0.001229f}, + {-0.112272f, -0.023126f, -0.008479f}, + {+0.086512f, -0.032942f, -0.003959f}, + {+0.151070f, +0.005416f, -0.003241f}, + {-0.183618f, -0.008669f, -0.002985f}, + {+0.037360f, -0.003147f, +0.002379f}, + {-0.095879f, -0.005536f, -0.000670f}, + {-0.009973f, +0.033041f, +0.006312f}, + {-0.086652f, -0.000941f, +0.001227f}, + {+0.070708f, -0.028404f, -0.005854f}, + {+0.082798f, -0.007130f, -0.008870f}, + {-0.024953f, -0.002080f, -0.001188f} + }, + { + {+0.634763f, -0.001208f, -0.002397f}, + {-0.683670f, +0.007693f, +0.006039f}, + {+0.143818f, -0.065248f, +0.001626f}, + {+0.187585f, -0.010607f, +0.001657f}, + {-0.155102f, +0.012347f, +0.000836f}, + {+0.047669f, +0.064360f, -0.004465f}, + {+0.176375f, +0.020282f, -0.000832f}, + {+0.166599f, +0.005868f, -0.005383f}, + {-0.165581f, +0.017111f, +0.003241f}, + {+0.067470f, -0.001639f, -0.002026f}, + {-0.090399f, +0.004464f, +0.000923f}, + {-0.138735f, -0.040116f, +0.001857f}, + {-0.018624f, +0.015969f, -0.003767f}, + {+0.124121f, +0.022397f, +0.003509f}, + {+0.132318f, +0.030070f, -0.004033f}, + {-0.005451f, +0.010583f, +0.000461f} + }, + { + {+0.613639f, +0.002441f, -0.000996f}, + {-0.658994f, +0.004033f, +0.003708f}, + {-0.066781f, +0.052613f, -0.005380f}, + {+0.103141f, +0.024662f, +0.003094f}, + {-0.069224f, -0.020885f, -0.001016f}, + {+0.237901f, -0.057325f, +0.006669f}, + {+0.198251f, +0.008139f, -0.001238f}, + {+0.196297f, -0.014019f, -0.004087f}, + {-0.137085f, -0.006189f, +0.006787f}, + {+0.092626f, -0.005231f, -0.005081f}, + {-0.098805f, -0.001528f, +0.003973f}, + {-0.227978f, +0.011869f, -0.001188f}, + {+0.083502f, -0.031761f, -0.003653f}, + {+0.154304f, +0.003532f, +0.005157f}, + {+0.192731f, -0.026618f, +0.005738f}, + {+0.025619f, -0.008251f, +0.002697f} + }, + { + {+0.592443f, -0.004265f, -0.000675f}, + {-0.651475f, -0.007639f, -0.001077f}, + {-0.211884f, -0.008375f, -0.003618f}, + {+0.015847f, -0.026610f, -0.001288f}, + {+0.030980f, +0.024402f, -0.000682f}, + {+0.377865f, +0.004628f, +0.005328f}, + {+0.127740f, -0.031243f, -0.004692f}, + {+0.216064f, +0.008428f, -0.000840f}, + {-0.107665f, -0.004148f, +0.003207f}, + {+0.104222f, +0.007982f, -0.002781f}, + {-0.121055f, -0.007151f, +0.006643f}, + {-0.232842f, +0.021111f, +0.004010f}, + {+0.181984f, +0.020598f, -0.002112f}, + {+0.154857f, -0.016563f, -0.001311f}, + {+0.234230f, -0.006972f, +0.006138f}, + {+0.062816f, -0.000374f, -0.000261f} + }, + { + {+0.565815f, +0.006621f, -0.000731f}, + {-0.652157f, -0.001839f, -0.002786f}, + {-0.256941f, -0.016709f, +0.005201f}, + {-0.049457f, +0.004802f, -0.002568f}, + {+0.121870f, -0.014390f, -0.001453f}, + {+0.418806f, +0.025565f, -0.008436f}, + {-0.023252f, +0.033441f, -0.003455f}, + {+0.192750f, +0.014454f, -0.000969f}, + {-0.080190f, +0.006138f, -0.004702f}, + {+0.090978f, +0.000288f, +0.001642f}, + {-0.136520f, +0.012063f, +0.004637f}, + {-0.143202f, -0.027531f, +0.007344f}, + {+0.230859f, -0.004544f, -0.002668f}, + {+0.140224f, +0.009293f, -0.007214f}, + {+0.242282f, +0.025199f, -0.006229f}, + {+0.100859f, -0.005416f, -0.004924f} + }, + { + {+0.532337f, -0.007417f, -0.000543f}, + {-0.652955f, +0.010368f, +0.001740f}, + {-0.220699f, +0.013404f, +0.007323f}, + {-0.077945f, +0.013141f, +0.004826f}, + {+0.182039f, +0.009934f, -0.002503f}, + {+0.362601f, -0.019757f, -0.014603f}, + {-0.211924f, -0.030990f, +0.005294f}, + {+0.105625f, -0.028087f, -0.003678f}, + {-0.054535f, +0.015575f, -0.006139f}, + {+0.049202f, -0.015528f, +0.003083f}, + {-0.111395f, -0.002877f, -0.002743f}, + {+0.015299f, +0.023373f, -0.001099f}, + {+0.201870f, -0.009975f, -0.000096f}, + {+0.130715f, +0.012877f, -0.003882f}, + {+0.221564f, -0.009858f, -0.016146f}, + {+0.132494f, +0.017520f, -0.002095f} + }, + { + {+0.495834f, +0.008532f, -0.000369f}, + {-0.652356f, -0.003292f, +0.006811f}, + {-0.149624f, -0.011936f, +0.002662f}, + {-0.071256f, -0.002030f, +0.009341f}, + {+0.200363f, -0.000872f, -0.001071f}, + {+0.238216f, +0.009887f, -0.004541f}, + {-0.381151f, +0.041781f, +0.008291f}, + {-0.039667f, +0.026941f, +0.000063f}, + {-0.036683f, -0.023635f, +0.004916f}, + {-0.009186f, +0.024708f, -0.001260f}, + {-0.023299f, -0.026996f, -0.008496f}, + {+0.194696f, -0.039072f, -0.009744f}, + {+0.098003f, +0.033287f, +0.002536f}, + {+0.131758f, -0.006621f, +0.002658f}, + {+0.173806f, -0.018597f, -0.006932f}, + {+0.145380f, -0.006223f, +0.004430f} + }, + { + {+0.463299f, -0.007155f, -0.000770f}, + {-0.648076f, -0.009295f, +0.004610f}, + {-0.089513f, +0.010398f, +0.000359f}, + {-0.033244f, -0.002975f, +0.003236f}, + {+0.178153f, -0.013477f, -0.001343f}, + {+0.077802f, -0.029144f, +0.007460f}, + {-0.474851f, -0.029171f, -0.001803f}, + {-0.217055f, -0.041281f, +0.004828f}, + {-0.037249f, -0.008239f, +0.011497f}, + {-0.059921f, -0.009759f, -0.005233f}, + {+0.114758f, +0.056676f, -0.002229f}, + {+0.334964f, +0.046076f, -0.002995f}, + {-0.042473f, -0.043913f, -0.000922f}, + {+0.133390f, -0.007415f, +0.001167f}, + {+0.081735f, -0.007332f, +0.010523f}, + {+0.133499f, -0.015420f, +0.003583f} + }, + { + {+0.441203f, +0.002482f, -0.000824f}, + {-0.629545f, +0.003537f, -0.002292f}, + {-0.068500f, -0.000883f, +0.001586f}, + {+0.038519f, -0.014498f, -0.003426f}, + {+0.131180f, +0.015847f, -0.003732f}, + {-0.083693f, +0.047317f, +0.005981f}, + {-0.461803f, -0.022290f, -0.008344f}, + {-0.384732f, +0.037693f, +0.003505f}, + {-0.048144f, +0.029049f, +0.001374f}, + {-0.084768f, -0.008739f, -0.001947f}, + {+0.251499f, -0.035994f, +0.008053f}, + {+0.379916f, -0.000042f, +0.006724f}, + {-0.160178f, +0.020677f, -0.004025f}, + {+0.124411f, +0.010697f, -0.004992f}, + {-0.067302f, +0.056203f, +0.010926f}, + {+0.110573f, +0.015976f, -0.002867f} + }, + { + {+0.430897f, +0.000433f, -0.000350f}, + {-0.586004f, +0.017187f, -0.004129f}, + {-0.087700f, -0.011728f, +0.002208f}, + {+0.139979f, +0.032148f, -0.002572f}, + {+0.080931f, -0.008008f, -0.004145f}, + {-0.204274f, -0.031020f, -0.002988f}, + {-0.365555f, +0.057171f, +0.001535f}, + {-0.496090f, -0.014326f, +0.002762f}, + {-0.036347f, -0.000076f, -0.009610f}, + {-0.087371f, +0.006753f, +0.002953f}, + {+0.332582f, -0.010055f, +0.004412f}, + {+0.314151f, -0.048523f, +0.001669f}, + {-0.210677f, +0.006259f, -0.001554f}, + {+0.097223f, +0.002730f, -0.004153f}, + {-0.243214f, -0.058784f, -0.001131f}, + {+0.100970f, +0.001509f, -0.005827f} + }, + { + {+0.427847f, -0.001191f, +0.000192f}, + {-0.522040f, -0.027328f, +0.001322f}, + {-0.123746f, +0.015960f, -0.000425f}, + {+0.250557f, -0.029225f, +0.001401f}, + {+0.041411f, -0.001671f, -0.000435f}, + {-0.251666f, -0.011713f, -0.002737f}, + {-0.259410f, -0.030558f, +0.013501f}, + {-0.523363f, -0.008886f, +0.005097f}, + {+0.023565f, -0.037779f, -0.005281f}, + {-0.085570f, +0.002595f, +0.003055f}, + {+0.343956f, +0.022947f, -0.008052f}, + {+0.182050f, +0.049717f, -0.010139f}, + {-0.188646f, -0.025113f, +0.004590f}, + {+0.043971f, +0.008025f, +0.002158f}, + {-0.383316f, +0.019159f, -0.004800f}, + {+0.118679f, -0.020135f, -0.001036f} + }, + { + {+0.424775f, -0.001427f, +0.000274f}, + {-0.458547f, +0.013186f, +0.005324f}, + {-0.143005f, -0.001551f, -0.002520f}, + {+0.342091f, +0.013355f, +0.001866f}, + {+0.012473f, -0.005183f, +0.002228f}, + {-0.229007f, +0.024031f, +0.004922f}, + {-0.213143f, -0.021386f, +0.008846f}, + {-0.469349f, +0.018839f, +0.005224f}, + {+0.120107f, +0.037044f, +0.005367f}, + {-0.094940f, -0.009229f, -0.000146f}, + {+0.312164f, -0.002650f, -0.009985f}, + {+0.056636f, -0.008288f, -0.009234f}, + {-0.124730f, +0.013388f, +0.006509f}, + {-0.037461f, -0.023127f, +0.003625f}, + {-0.438903f, +0.013352f, +0.002069f}, + {+0.155431f, +0.012048f, +0.004072f} + }, + { + {+0.415850f, +0.004534f, -0.000668f}, + {-0.414572f, +0.002652f, +0.002367f}, + {-0.124613f, -0.010725f, -0.002281f}, + {+0.397126f, -0.000677f, -0.001120f}, + {-0.014003f, +0.010619f, -0.000267f}, + {-0.170253f, -0.018842f, +0.008960f}, + {-0.241128f, +0.034417f, -0.004698f}, + {-0.359282f, -0.033550f, +0.005250f}, + {+0.216676f, -0.010427f, +0.006057f}, + {-0.120954f, +0.008613f, -0.002469f}, + {+0.268504f, +0.001802f, -0.003587f}, + {-0.013045f, -0.010217f, +0.002327f}, + {-0.059871f, -0.003931f, +0.001188f}, + {-0.132164f, +0.026563f, +0.001240f}, + {-0.403193f, -0.027848f, +0.009266f}, + {+0.190953f, +0.002021f, +0.001187f} + }, + { + {+0.399726f, -0.003989f, -0.001238f}, + {-0.392346f, -0.005321f, -0.003177f}, + {-0.072827f, +0.023138f, +0.000364f}, + {+0.417980f, -0.003176f, -0.003953f}, + {-0.044470f, -0.006065f, -0.002234f}, + {-0.111558f, +0.001243f, +0.006696f}, + {-0.306891f, -0.017879f, -0.010556f}, + {-0.227947f, +0.027747f, +0.006660f}, + {+0.285131f, -0.003545f, -0.002248f}, + {-0.160581f, -0.005372f, -0.001188f}, + {+0.228536f, -0.004194f, -0.000473f}, + {-0.021041f, +0.010096f, +0.009272f}, + {-0.021484f, +0.000358f, -0.003354f}, + {-0.213365f, -0.015260f, -0.000168f}, + {-0.303399f, +0.026027f, +0.011571f}, + {+0.212111f, -0.000447f, -0.003261f} + }, + { + {+0.378407f, +0.003850f, -0.000653f}, + {-0.380175f, -0.007586f, -0.003255f}, + {-0.012127f, -0.017400f, +0.004348f}, + {+0.420589f, +0.000881f, -0.004600f}, + {-0.082045f, +0.000538f, +0.001160f}, + {-0.069379f, +0.007873f, -0.001279f}, + {-0.364957f, -0.009593f, -0.003601f}, + {-0.103978f, -0.012644f, +0.002536f}, + {+0.322327f, -0.004962f, -0.006100f}, + {-0.208381f, +0.007687f, +0.001556f}, + {+0.193755f, +0.004206f, +0.000887f}, + {+0.012722f, +0.002660f, +0.005208f}, + {-0.021028f, +0.002645f, -0.003959f}, + {-0.256559f, +0.000206f, +0.001247f}, + {-0.175255f, -0.013434f, +0.005713f}, + {+0.216424f, -0.004406f, -0.001903f} + }, + { + {+0.355186f, -0.004417f, +0.000047f}, + {-0.367959f, +0.007051f, +0.000589f}, + {+0.030278f, -0.000745f, +0.003677f}, + {+0.419972f, +0.001580f, -0.004098f}, + {-0.126164f, -0.010538f, +0.004622f}, + {-0.036142f, +0.005050f, -0.006483f}, + {-0.395580f, +0.008424f, +0.006868f}, + {+0.004418f, +0.013200f, -0.004102f}, + {+0.338438f, +0.004391f, -0.003969f}, + {-0.257936f, -0.011270f, +0.002562f}, + {+0.157184f, -0.010190f, +0.001022f}, + {+0.066694f, +0.007499f, -0.001955f}, + {-0.058038f, -0.007898f, -0.001836f}, + {-0.252063f, +0.011457f, +0.004218f}, + {-0.038996f, +0.019229f, -0.002930f}, + {+0.207135f, -0.002683f, +0.000920f} + }, + { + {+0.333833f, +0.005141f, -0.000033f}, + {-0.354343f, -0.002376f, +0.001512f}, + {+0.044789f, +0.011943f, -0.002345f}, + {+0.420054f, -0.005203f, -0.002411f}, + {-0.168493f, +0.019086f, +0.001101f}, + {+0.000312f, -0.019974f, -0.002740f}, + {-0.404430f, +0.003854f, +0.008761f}, + {+0.101609f, -0.024344f, -0.004621f}, + {+0.343021f, -0.002003f, -0.002287f}, + {-0.300798f, +0.012232f, +0.000926f}, + {+0.115201f, +0.012523f, -0.000667f}, + {+0.124884f, -0.013322f, -0.003505f}, + {-0.124657f, +0.015080f, +0.000444f}, + {-0.208063f, -0.009838f, +0.004149f}, + {+0.098778f, -0.030234f, -0.005691f}, + {+0.191672f, +0.010274f, -0.000986f} + }, + { + {+0.317651f, -0.003399f, -0.000638f}, + {-0.342009f, +0.000734f, +0.000383f}, + {+0.041234f, -0.003266f, -0.006626f}, + {+0.412818f, +0.000564f, -0.000053f}, + {-0.193269f, -0.005756f, -0.003803f}, + {+0.038455f, +0.012921f, +0.002898f}, + {-0.397973f, -0.006421f, +0.004371f}, + {+0.186407f, +0.018164f, -0.002443f}, + {+0.339213f, -0.001972f, -0.002251f}, + {-0.327935f, -0.003077f, -0.000361f}, + {+0.072360f, -0.008411f, -0.001308f}, + {+0.171731f, +0.013927f, -0.001434f}, + {-0.206591f, -0.018817f, +0.001471f}, + {-0.140714f, +0.015540f, +0.002302f}, + {+0.227639f, +0.031497f, -0.003750f}, + {+0.179263f, -0.004105f, -0.004389f} + }, + { + {+0.307693f, +0.001076f, -0.000945f}, + {-0.334320f, -0.001717f, +0.000049f}, + {+0.033552f, -0.011447f, -0.002121f}, + {+0.387841f, +0.007421f, +0.001088f}, + {-0.192595f, -0.010377f, -0.002843f}, + {+0.067483f, +0.002402f, +0.001682f}, + {-0.373557f, +0.001444f, -0.001449f}, + {+0.251051f, -0.016030f, -0.000496f}, + {+0.323516f, +0.001530f, -0.001658f}, + {-0.335944f, -0.003218f, +0.000567f}, + {+0.034654f, +0.006672f, -0.000906f}, + {+0.193976f, -0.003406f, +0.001146f}, + {-0.284432f, +0.017472f, +0.001142f}, + {-0.067179f, -0.009754f, -0.000138f}, + {+0.329347f, -0.022749f, -0.000471f}, + {+0.172128f, -0.005358f, -0.003493f} + }, + { + {+0.301577f, +0.001184f, -0.000322f}, + {-0.332736f, +0.000666f, +0.000894f}, + {+0.023585f, -0.000609f, +0.003132f}, + {+0.344006f, -0.015803f, +0.000034f}, + {-0.177998f, +0.013137f, +0.002069f}, + {+0.082056f, -0.003433f, -0.002633f}, + {-0.324370f, +0.018955f, -0.002626f}, + {+0.287377f, +0.000225f, -0.000071f}, + {+0.290720f, -0.007672f, -0.000038f}, + {-0.329996f, +0.006498f, +0.002605f}, + {+0.003682f, -0.004563f, -0.000624f}, + {+0.185737f, -0.009876f, +0.000494f}, + {-0.338831f, -0.008465f, +0.000490f}, + {-0.000651f, +0.014424f, -0.001842f}, + {+0.385445f, -0.000494f, -0.001075f}, + {+0.160154f, +0.003230f, +0.000530f} + }, + { + {+0.294359f, +0.001008f, +0.000587f}, + {-0.335716f, +0.002537f, +0.000929f}, + {+0.006697f, +0.010781f, +0.001057f}, + {+0.292769f, +0.014442f, -0.002216f}, + {-0.173218f, +0.002305f, +0.004071f}, + {+0.084637f, -0.001890f, -0.003059f}, + {-0.253587f, -0.025906f, +0.002221f}, + {+0.295508f, +0.003624f, -0.001780f}, + {+0.240102f, +0.014422f, -0.000050f}, + {-0.320004f, +0.000226f, +0.002968f}, + {-0.025595f, +0.006552f, -0.001052f}, + {+0.154653f, +0.014381f, -0.002635f}, + {-0.357893f, -0.004680f, +0.001836f}, + {+0.050259f, -0.009177f, -0.001013f}, + {+0.390921f, +0.011091f, -0.005488f}, + {+0.128396f, +0.010797f, +0.002030f} + }, + { + {+0.281980f, -0.004479f, +0.000473f}, + {-0.338235f, -0.000938f, +0.000317f}, + {-0.016443f, -0.008216f, -0.002310f}, + {+0.250822f, -0.005381f, -0.002547f}, + {-0.194113f, -0.011993f, +0.002133f}, + {+0.078814f, +0.001480f, -0.000683f}, + {-0.178794f, +0.013791f, +0.004329f}, + {+0.286440f, -0.008258f, -0.003815f}, + {+0.180165f, -0.014312f, -0.000718f}, + {-0.312559f, -0.001222f, +0.001335f}, + {-0.061211f, -0.002642f, +0.000385f}, + {+0.117426f, -0.006897f, -0.004033f}, + {-0.342706f, +0.010139f, +0.004471f}, + {+0.079430f, +0.002660f, -0.001268f}, + {+0.356398f, -0.011250f, -0.007640f}, + {+0.072072f, -0.018003f, +0.000575f} + }, + { + {+0.264584f, +0.006225f, -0.000553f}, + {-0.334355f, -0.002104f, +0.000390f}, + {-0.041411f, +0.000660f, -0.001379f}, + {+0.227742f, -0.002231f, -0.000499f}, + {-0.236723f, +0.015277f, +0.000143f}, + {+0.066692f, +0.002089f, +0.000940f}, + {-0.116641f, -0.003621f, +0.000856f}, + {+0.274189f, -0.002260f, -0.003775f}, + {+0.124476f, +0.010538f, -0.000672f}, + {-0.307116f, +0.000375f, +0.000391f}, + {-0.109323f, +0.010339f, +0.003218f}, + {+0.087624f, -0.002282f, -0.001095f}, + {-0.305220f, -0.004246f, +0.003226f}, + {+0.088209f, -0.001890f, -0.000514f}, + {+0.297714f, +0.002109f, -0.002943f}, + {+0.002305f, +0.018254f, -0.000698f} + }, + { + {+0.245860f, -0.004071f, -0.001278f}, + {-0.320735f, +0.004451f, +0.000718f}, + {-0.064973f, -0.003268f, +0.001022f}, + {+0.221237f, +0.003408f, +0.001969f}, + {-0.282979f, -0.012181f, -0.001619f}, + {+0.050139f, -0.005534f, +0.000714f}, + {-0.071497f, +0.004571f, -0.002571f}, + {+0.265456f, +0.000937f, -0.001591f}, + {+0.084560f, -0.004757f, +0.000011f}, + {-0.300229f, +0.001315f, -0.000134f}, + {-0.168137f, -0.018612f, +0.002406f}, + {+0.066781f, -0.001637f, +0.001882f}, + {-0.257378f, +0.011005f, +0.000980f}, + {+0.083095f, -0.005045f, -0.000085f}, + {+0.224972f, -0.016565f, +0.001685f}, + {-0.061472f, -0.012660f, -0.001272f} + }, + { + {+0.229589f, +0.000720f, -0.000554f}, + {-0.297388f, -0.006061f, +0.000830f}, + {-0.086308f, +0.008311f, -0.000100f}, + {+0.220891f, +0.005343f, +0.000760f}, + {-0.312804f, -0.002048f, -0.000535f}, + {+0.033600f, +0.001954f, +0.000821f}, + {-0.037726f, -0.009547f, -0.001800f}, + {+0.256770f, -0.001354f, -0.000172f}, + {+0.064615f, +0.001499f, +0.000378f}, + {-0.288880f, -0.006082f, +0.000716f}, + {-0.223988f, +0.015499f, -0.000654f}, + {+0.048524f, +0.007439f, +0.000777f}, + {-0.208116f, -0.011040f, +0.001557f}, + {+0.074335f, +0.004704f, -0.001723f}, + {+0.146222f, +0.020815f, +0.000166f}, + {-0.103517f, +0.003200f, -0.000724f} + }, + { + {+0.216659f, -0.000775f, +0.000774f}, + {-0.266859f, +0.007292f, +0.000934f}, + {-0.105304f, -0.004788f, -0.002437f}, + {+0.217403f, -0.003973f, -0.002583f}, + {-0.318044f, +0.007929f, +0.003539f}, + {+0.023696f, -0.000702f, +0.001989f}, + {-0.008068f, +0.006711f, +0.000114f}, + {+0.242367f, -0.004361f, +0.000832f}, + {+0.061343f, +0.003214f, +0.000949f}, + {-0.273736f, +0.004941f, +0.002356f}, + {-0.260361f, -0.001261f, -0.000909f}, + {+0.027365f, -0.006696f, -0.001482f}, + {-0.163814f, +0.008052f, +0.001931f}, + {+0.071141f, -0.000562f, -0.003221f}, + {+0.073591f, -0.015255f, -0.001489f}, + {-0.121162f, +0.004631f, +0.001675f} + }, + { + {+0.205784f, +0.003757f, +0.000700f}, + {-0.232994f, -0.005953f, +0.000561f}, + {-0.123682f, -0.003377f, -0.000485f}, + {+0.205753f, -0.000981f, -0.002067f}, + {-0.304943f, -0.001966f, +0.004525f}, + {+0.026104f, +0.002420f, +0.000748f}, + {+0.021981f, -0.003022f, -0.000957f}, + {+0.220204f, +0.009944f, -0.000624f}, + {+0.066717f, -0.001208f, +0.001408f}, + {-0.258003f, +0.000477f, +0.001518f}, + {-0.270472f, -0.007879f, +0.002698f}, + {+0.001424f, +0.001591f, -0.000485f}, + {-0.125885f, -0.003310f, +0.000529f}, + {+0.074527f, -0.008121f, -0.001699f}, + {+0.017069f, +0.005535f, -0.000272f}, + {-0.124829f, -0.001926f, +0.003798f} + }, + { + {+0.196417f, -0.003644f, -0.000603f}, + {-0.199207f, +0.006086f, -0.000295f}, + {-0.146052f, -0.001687f, +0.003740f}, + {+0.182052f, -0.002076f, +0.001266f}, + {-0.282909f, -0.000690f, +0.001105f}, + {+0.044152f, +0.004210f, -0.001817f}, + {+0.054138f, +0.007409f, -0.002335f}, + {+0.196668f, -0.006189f, -0.002331f}, + {+0.072925f, -0.001260f, +0.000239f}, + {-0.242629f, +0.000541f, -0.000943f}, + {-0.260897f, +0.003994f, +0.004883f}, + {-0.029070f, -0.005485f, +0.001962f}, + {-0.092855f, +0.004046f, -0.001954f}, + {+0.076259f, +0.005415f, +0.002510f}, + {-0.019261f, -0.001366f, +0.002709f}, + {-0.127606f, -0.004435f, +0.002949f} + }, + { + {+0.189173f, +0.000560f, -0.001059f}, + {-0.167547f, -0.008258f, +0.000141f}, + {-0.174715f, +0.013815f, +0.002907f}, + {+0.145627f, +0.012083f, +0.002087f}, + {-0.256566f, -0.006772f, -0.000776f}, + {+0.075271f, -0.013763f, -0.000701f}, + {+0.085309f, -0.009140f, -0.001366f}, + {+0.180099f, +0.000959f, -0.002178f}, + {+0.077061f, -0.000891f, -0.000372f}, + {-0.225986f, -0.007128f, -0.000680f}, + {-0.242442f, -0.000129f, +0.003190f}, + {-0.061120f, +0.011120f, +0.001079f}, + {-0.062759f, -0.011288f, -0.001129f}, + {+0.065406f, +0.009942f, +0.002436f}, + {-0.038027f, +0.005472f, +0.002780f}, + {-0.134062f, +0.004375f, +0.001136f} + }, + { + {+0.183656f, +0.000923f, -0.000164f}, + {-0.139835f, +0.005429f, +0.001020f}, + {-0.202643f, -0.008873f, -0.000639f}, + {+0.102603f, -0.014782f, -0.000700f}, + {-0.227902f, +0.008291f, +0.000524f}, + {+0.108562f, +0.007847f, +0.001593f}, + {+0.108523f, +0.004720f, -0.000054f}, + {+0.172882f, +0.003322f, -0.000542f}, + {+0.078483f, -0.001260f, -0.000596f}, + {-0.207608f, +0.004999f, +0.001085f}, + {-0.221842f, +0.000718f, +0.000351f}, + {-0.087045f, -0.004787f, -0.000547f}, + {-0.037398f, +0.005336f, +0.001064f}, + {+0.041563f, -0.010757f, -0.000998f}, + {-0.043387f, -0.001956f, +0.000527f}, + {-0.140276f, -0.003188f, -0.000142f} + }, + { + {+0.177711f, +0.001442f, +0.000461f}, + {-0.115859f, -0.004532f, +0.001235f}, + {-0.218668f, -0.005427f, +0.000911f}, + {+0.063962f, +0.003468f, -0.001219f}, + {-0.198372f, -0.004393f, +0.000814f}, + {+0.132046f, +0.004112f, -0.000882f}, + {+0.118012f, +0.003780f, -0.001160f}, + {+0.169530f, -0.000759f, +0.000923f}, + {+0.077288f, -0.001422f, -0.000499f}, + {-0.187625f, +0.000022f, +0.000030f}, + {-0.200958f, -0.007075f, -0.000014f}, + {-0.099701f, -0.002974f, +0.000910f}, + {-0.019722f, +0.003866f, -0.001104f}, + {+0.014166f, +0.005774f, -0.002177f}, + {-0.039277f, -0.003862f, +0.000381f}, + {-0.138918f, -0.005302f, +0.000608f} + }, + { + {+0.169075f, -0.003877f, -0.000219f}, + {-0.092373f, +0.003200f, +0.000934f}, + {-0.217383f, +0.010383f, +0.006743f}, + {+0.037373f, +0.004176f, +0.003172f}, + {-0.168763f, +0.000238f, -0.001996f}, + {+0.140535f, -0.007256f, -0.006564f}, + {+0.113037f, -0.005040f, -0.003602f}, + {+0.161555f, -0.002184f, +0.001327f}, + {+0.073875f, +0.002628f, +0.001536f}, + {-0.165667f, -0.001239f, -0.003853f}, + {-0.179435f, +0.009646f, +0.002896f}, + {-0.097770f, +0.003616f, +0.003027f}, + {-0.009431f, -0.004981f, -0.006157f}, + {-0.008081f, +0.000345f, -0.000806f}, + {-0.031139f, +0.005138f, +0.002262f}, + {-0.125572f, +0.007103f, +0.003194f} + }, + { + {+0.156703f, +0.003123f, -0.000930f}, + {-0.066141f, -0.001589f, -0.001238f}, + {-0.199134f, -0.002236f, +0.009123f}, + {+0.024449f, +0.000091f, +0.006919f}, + {-0.141646f, -0.003103f, -0.005668f}, + {+0.133486f, -0.000744f, -0.008630f}, + {+0.097019f, -0.000327f, -0.002792f}, + {+0.144791f, +0.002980f, +0.002476f}, + {+0.068698f, +0.001637f, +0.003084f}, + {-0.144321f, -0.006179f, -0.006251f}, + {-0.155892f, -0.002625f, +0.004264f}, + {-0.084319f, -0.000388f, +0.002288f}, + {-0.006549f, -0.002981f, -0.008326f}, + {-0.021606f, -0.003867f, +0.002491f}, + {-0.023191f, -0.001810f, +0.003729f}, + {-0.101442f, -0.001244f, +0.002402f} + }, + { + {+0.140100f, -0.000742f, +0.000187f}, + {-0.036425f, +0.005652f, -0.004036f}, + {-0.165186f, -0.002894f, +0.004265f}, + {+0.025616f, -0.008625f, +0.004162f}, + {-0.121725f, +0.015558f, -0.002974f}, + {+0.111098f, +0.006811f, -0.003090f}, + {+0.072921f, -0.001667f, +0.000669f}, + {+0.120893f, -0.005073f, +0.004382f}, + {+0.065161f, -0.005346f, +0.001749f}, + {-0.129726f, +0.017304f, -0.000877f}, + {-0.126372f, -0.005082f, -0.000663f}, + {-0.063630f, +0.002788f, -0.000025f}, + {-0.013562f, +0.008476f, -0.004178f}, + {-0.027532f, -0.002871f, +0.003910f}, + {-0.014651f, +0.000004f, +0.003901f}, + {-0.068381f, +0.002931f, -0.001605f} + } +}; + +#endif + + +#ifndef UPDATE_FASTCONV_SBA_FILTER const float FASTCONV_HOA2_latency_s = 0.000666667f; const float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS]= { @@ -5892,8 +9513,2228 @@ const float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS]= } }; +#else +const float FASTCONV_HOA2_latency_s = 0.000020833f; +const float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +{ + { + {+0.018159f, +0.985146f, +0.240506f}, + {+0.077046f, -0.024713f, +0.260411f}, + {+0.000593f, +0.132269f, +0.000009f}, + {+0.009213f, +0.054471f, +0.004257f}, + {+0.039823f, -0.044599f, -0.001606f}, + {+0.011090f, -0.028094f, +0.011739f}, + {-0.057613f, +0.083209f, +0.004522f}, + {+0.010244f, +0.028373f, -0.010969f}, + {-0.107601f, +0.182275f, +0.052385f} + }, + { + {-0.152534f, -0.329898f, -0.242342f}, + {-0.209786f, -1.273585f, -0.112026f}, + {-0.011413f, +0.080591f, -0.013524f}, + {-0.034221f, +0.013783f, +0.008826f}, + {-0.012372f, +0.014808f, +0.038195f}, + {+0.003235f, +0.083338f, +0.068446f}, + {+0.003314f, -0.032912f, -0.065265f}, + {+0.003322f, +0.076317f, +0.007937f}, + {-0.015189f, -0.220191f, -0.130843f} + }, + { + {-0.023093f, -0.558938f, -0.150964f}, + {-0.270176f, -0.589966f, -0.359432f}, + {-0.003260f, +0.097037f, -0.014970f}, + {-0.058519f, +0.107799f, -0.014627f}, + {-0.084143f, +0.174088f, -0.006734f}, + {-0.035814f, +0.281769f, -0.006166f}, + {+0.116511f, -0.307921f, +0.020292f}, + {-0.013401f, +0.086307f, +0.012981f}, + {+0.209526f, -0.554513f, -0.048661f} + }, + { + {+0.261551f, +0.304347f, +0.114032f}, + {+0.250896f, +0.779633f, +0.070356f}, + {+0.023786f, +0.088663f, -0.030815f}, + {+0.003407f, +0.082081f, -0.041209f}, + {-0.062118f, +0.047824f, -0.057239f}, + {-0.026013f, +0.155692f, -0.065882f}, + {+0.127095f, -0.164040f, +0.077176f}, + {-0.022006f, +0.035999f, -0.005698f}, + {+0.327951f, -0.045215f, +0.125831f} + }, + { + {+0.359497f, +0.205525f, +0.109865f}, + {+0.745384f, +0.051437f, +0.216054f}, + {+0.066207f, -0.076438f, +0.024748f}, + {+0.143496f, -0.123266f, +0.007838f}, + {+0.098368f, -0.139294f, -0.014972f}, + {+0.065224f, -0.122143f, +0.029816f}, + {-0.019520f, +0.163808f, -0.024174f}, + {+0.008568f, -0.024216f, +0.013284f}, + {+0.111141f, +0.311803f, +0.021197f} + }, + { + {+0.165159f, -0.254129f, -0.025534f}, + {+0.780421f, -0.408205f, +0.025264f}, + {+0.043262f, -0.082839f, +0.025956f}, + {+0.214774f, -0.021619f, +0.026192f}, + {+0.266921f, +0.073753f, +0.026414f}, + {+0.110056f, -0.068805f, +0.038706f}, + {-0.162323f, +0.018037f, -0.046919f}, + {+0.046582f, -0.024241f, +0.003856f}, + {-0.254154f, -0.105995f, -0.060073f} + }, + { + {-0.177496f, +0.069944f, -0.070544f}, + {+0.384878f, +0.205067f, -0.111476f}, + {-0.035734f, +0.067378f, -0.014549f}, + {+0.125583f, +0.062055f, +0.008649f}, + {+0.294346f, +0.048254f, +0.026299f}, + {+0.090207f, +0.084523f, -0.015326f}, + {-0.211714f, -0.100002f, +0.007755f}, + {+0.078344f, -0.022510f, -0.004774f}, + {-0.527842f, -0.045905f, -0.024578f} + }, + { + {-0.463362f, +0.056885f, -0.021761f}, + {-0.150954f, +0.026543f, -0.068293f}, + {-0.101521f, +0.000813f, -0.025478f}, + {-0.095046f, -0.089523f, -0.003261f}, + {+0.134616f, -0.104561f, +0.001013f}, + {+0.059105f, +0.025388f, -0.028020f}, + {-0.181070f, -0.006996f, +0.032275f}, + {+0.082036f, -0.002388f, +0.001840f}, + {-0.586330f, +0.048806f, +0.016554f} + }, + { + {-0.592381f, -0.044571f, +0.029549f}, + {-0.576892f, -0.036976f, +0.022220f}, + {-0.119596f, -0.060394f, -0.001555f}, + {-0.338453f, +0.063985f, -0.014668f}, + {-0.125238f, +0.093159f, -0.021501f}, + {+0.045169f, -0.044028f, +0.000433f}, + {-0.115198f, +0.025252f, +0.004920f}, + {+0.041077f, +0.008697f, +0.004995f}, + {-0.438497f, -0.055561f, +0.020980f} + }, + { + {-0.599054f, -0.014356f, +0.032985f}, + {-0.822874f, -0.044354f, +0.046136f}, + {-0.117506f, +0.008009f, +0.019868f}, + {-0.479925f, +0.018761f, -0.007799f}, + {-0.339581f, -0.001799f, -0.018360f}, + {+0.028531f, -0.004096f, +0.014580f}, + {-0.035532f, +0.016131f, -0.009871f}, + {-0.031577f, -0.038412f, +0.000988f}, + {-0.188266f, +0.051427f, +0.014971f} + }, + { + {-0.558565f, +0.027629f, +0.008677f}, + {-0.934558f, +0.055883f, +0.019701f}, + {-0.143536f, +0.040687f, +0.009496f}, + {-0.475498f, -0.046650f, +0.012347f}, + {-0.418986f, -0.046808f, +0.009187f}, + {-0.019973f, +0.045258f, +0.001389f}, + {+0.040837f, -0.027615f, -0.004137f}, + {-0.104086f, +0.015540f, -0.006688f}, + {+0.045132f, -0.020688f, +0.004131f} + }, + { + {-0.508817f, +0.002572f, -0.006006f}, + {-0.966334f, -0.010598f, +0.000935f}, + {-0.200114f, -0.021501f, -0.002245f}, + {-0.374199f, +0.021235f, +0.015875f}, + {-0.383236f, +0.011504f, +0.019281f}, + {-0.101681f, -0.007702f, -0.004459f}, + {+0.098607f, +0.009824f, -0.000170f}, + {-0.142186f, +0.015367f, -0.000073f}, + {+0.202499f, +0.007942f, -0.007850f} + }, + { + {-0.449816f, -0.025700f, -0.002766f}, + {-0.942805f, -0.019015f, +0.002630f}, + {-0.251515f, +0.005009f, -0.000037f}, + {-0.247529f, -0.018163f, +0.007953f}, + {-0.297646f, -0.008359f, +0.008978f}, + {-0.194833f, +0.010293f, +0.006773f}, + {+0.127610f, -0.005400f, -0.000110f}, + {-0.141062f, -0.005988f, +0.007030f}, + {+0.285592f, -0.008291f, -0.012555f} + }, + { + {-0.376168f, +0.026055f, +0.004627f}, + {-0.871841f, +0.021874f, +0.006470f}, + {-0.251474f, +0.012379f, +0.004839f}, + {-0.143351f, +0.003085f, +0.000557f}, + {-0.213031f, +0.008846f, +0.002525f}, + {-0.266224f, -0.023397f, +0.007678f}, + {+0.122414f, -0.005951f, +0.000933f}, + {-0.115352f, -0.004480f, +0.001947f}, + {+0.318209f, +0.018171f, -0.006837f} + }, + { + {-0.293873f, -0.014103f, +0.005564f}, + {-0.763509f, -0.026484f, +0.005957f}, + {-0.167339f, -0.021635f, +0.004681f}, + {-0.071079f, -0.008355f, -0.004673f}, + {-0.149092f, -0.004738f, -0.000445f}, + {-0.269948f, +0.002632f, +0.000196f}, + {+0.088484f, +0.013962f, +0.000022f}, + {-0.080315f, -0.009623f, -0.002700f}, + {+0.315546f, +0.000498f, +0.000137f} + }, + { + {-0.214030f, +0.010451f, +0.001827f}, + {-0.638609f, +0.024424f, +0.004195f}, + {-0.000480f, +0.033426f, -0.002795f}, + {-0.011678f, +0.017775f, -0.002438f}, + {-0.092630f, +0.011217f, -0.001499f}, + {-0.179494f, +0.027872f, -0.004886f}, + {+0.049375f, -0.006195f, +0.000322f}, + {-0.050886f, +0.014806f, +0.001580f}, + {+0.284102f, -0.013452f, -0.000223f} + }, + { + {-0.142407f, -0.012908f, -0.000129f}, + {-0.521031f, -0.021513f, +0.002424f}, + {+0.212730f, -0.053828f, -0.007313f}, + {+0.050092f, -0.009707f, -0.001567f}, + {-0.022713f, -0.014891f, -0.001899f}, + {-0.013352f, -0.051652f, -0.004824f}, + {+0.034982f, -0.000584f, +0.002038f}, + {-0.037735f, -0.000643f, +0.005700f}, + {+0.234664f, +0.015884f, -0.002619f} + }, + { + {-0.078162f, +0.013149f, +0.000240f}, + {-0.425304f, +0.016123f, +0.001883f}, + {+0.408229f, +0.052323f, -0.001957f}, + {+0.116415f, +0.013525f, -0.004497f}, + {+0.067314f, +0.020251f, -0.003762f}, + {+0.167553f, +0.051767f, +0.000869f}, + {+0.068137f, +0.009479f, +0.001235f}, + {-0.034203f, -0.008399f, +0.003763f}, + {+0.180796f, -0.011205f, -0.003598f} + }, + { + {-0.016750f, -0.012127f, +0.000498f}, + {-0.353965f, -0.008335f, +0.000653f}, + {+0.518342f, -0.011173f, +0.002964f}, + {+0.177026f, -0.019969f, -0.002705f}, + {+0.164814f, -0.026646f, -0.003238f}, + {+0.286213f, -0.012718f, +0.003816f}, + {+0.155640f, -0.020546f, -0.001850f}, + {-0.016416f, +0.003918f, -0.001774f}, + {+0.133919f, +0.003314f, -0.001822f} + }, + { + {+0.046182f, +0.012351f, -0.000034f}, + {-0.298885f, +0.009039f, -0.000810f}, + {+0.511610f, -0.032188f, -0.002291f}, + {+0.211380f, +0.005455f, +0.000933f}, + {+0.241218f, +0.015123f, -0.001103f}, + {+0.293508f, -0.029470f, -0.003051f}, + {+0.280548f, +0.030234f, -0.004368f}, + {+0.041260f, +0.018979f, -0.004541f}, + {+0.098998f, +0.002094f, +0.002904f} + }, + { + {+0.111605f, -0.013530f, -0.000652f}, + {-0.246690f, -0.016108f, +0.001020f}, + {+0.413977f, +0.038179f, -0.009520f}, + {+0.203190f, +0.017508f, -0.002191f}, + {+0.268601f, +0.003682f, -0.001755f}, + {+0.196136f, +0.036857f, -0.009761f}, + {+0.402137f, -0.026686f, -0.005055f}, + {+0.145035f, -0.035432f, -0.001365f}, + {+0.074946f, +0.007868f, +0.004954f} + }, + { + {+0.176108f, +0.013431f, -0.000958f}, + {-0.185298f, +0.016846f, +0.004677f}, + {+0.286889f, -0.019450f, -0.007487f}, + {+0.153787f, -0.015814f, -0.006505f}, + {+0.239195f, -0.011851f, -0.001930f}, + {+0.042102f, -0.023553f, -0.004947f}, + {+0.470133f, +0.012898f, -0.003624f}, + {+0.270107f, +0.025928f, -0.000154f}, + {+0.059116f, -0.020434f, -0.003101f} + }, + { + {+0.234033f, -0.013522f, -0.000160f}, + {-0.105917f, -0.008837f, +0.002769f}, + {+0.184987f, +0.008247f, -0.000624f}, + {+0.076510f, +0.005900f, -0.001804f}, + {+0.166708f, +0.022644f, -0.001485f}, + {-0.112604f, +0.020438f, +0.005184f}, + {+0.450824f, +0.006092f, +0.002002f}, + {+0.374333f, -0.013645f, -0.004183f}, + {+0.050668f, -0.002470f, -0.009849f} + }, + { + {+0.280701f, +0.008633f, +0.001045f}, + {-0.002220f, +0.016553f, -0.003998f}, + {+0.131643f, -0.003842f, +0.001872f}, + {-0.015690f, -0.016479f, +0.005047f}, + {+0.077685f, -0.023492f, -0.003551f}, + {-0.223388f, -0.024340f, +0.007042f}, + {+0.346787f, -0.042038f, +0.003586f}, + {+0.418985f, +0.005219f, -0.005591f}, + {+0.040023f, +0.024273f, +0.000362f} + }, + { + {+0.315972f, -0.002222f, +0.000114f}, + {+0.123110f, -0.036764f, -0.004764f}, + {+0.119199f, -0.002064f, +0.000988f}, + {-0.106689f, +0.025325f, +0.004605f}, + {-0.000310f, +0.007517f, -0.002748f}, + {-0.262374f, +0.010338f, +0.000067f}, + {+0.204029f, +0.052292f, -0.005305f}, + {+0.380172f, +0.016758f, -0.003741f}, + {+0.003388f, +0.008217f, +0.011667f} + }, + { + {+0.346296f, +0.003536f, -0.001898f}, + {+0.248976f, +0.036524f, +0.001389f}, + {+0.120849f, +0.002931f, +0.000722f}, + {-0.173186f, -0.016622f, +0.000289f}, + {-0.054827f, -0.000181f, +0.002418f}, + {-0.225358f, +0.023135f, -0.002820f}, + {+0.091375f, -0.014867f, -0.010230f}, + {+0.260139f, -0.034357f, -0.002468f}, + {-0.068405f, -0.042485f, +0.005111f} + }, + { + {+0.379862f, -0.009494f, -0.001961f}, + {+0.345947f, -0.013885f, +0.004347f}, + {+0.108945f, +0.001609f, +0.002277f}, + {-0.194971f, -0.005237f, -0.000216f}, + {-0.090631f, +0.007307f, +0.004497f}, + {-0.139916f, -0.036851f, +0.003429f}, + {+0.049457f, -0.016676f, -0.004125f}, + {+0.089658f, +0.040648f, -0.001276f}, + {-0.147747f, +0.028109f, -0.006357f} + }, + { + {+0.419521f, +0.011992f, -0.000293f}, + {+0.399888f, -0.006995f, -0.000613f}, + {+0.071268f, -0.013451f, +0.003383f}, + {-0.169244f, +0.016170f, +0.002968f}, + {-0.116230f, -0.009802f, +0.001756f}, + {-0.053621f, +0.017175f, +0.008163f}, + {+0.065166f, +0.025359f, +0.005381f}, + {-0.086447f, -0.037823f, -0.001051f}, + {-0.194782f, +0.007204f, -0.005393f} + }, + { + {+0.461674f, -0.009238f, +0.000744f}, + {+0.422873f, +0.002942f, -0.006024f}, + {+0.017965f, +0.019932f, +0.001068f}, + {-0.112940f, -0.014296f, +0.003691f}, + {-0.135675f, +0.004946f, -0.000913f}, + {-0.001359f, +0.007810f, +0.003619f}, + {+0.090834f, -0.000688f, +0.008234f}, + {-0.227027f, +0.020653f, -0.000262f}, + {-0.193552f, -0.020886f, +0.003761f} + }, + { + {+0.500543f, +0.004460f, -0.000339f}, + {+0.438946f, +0.008173f, -0.005382f}, + {-0.025063f, -0.012096f, -0.002727f}, + {-0.048264f, +0.016297f, +0.004137f}, + {-0.148356f, +0.006714f, +0.001928f}, + {+0.016069f, -0.011271f, -0.004203f}, + {+0.085225f, -0.019738f, +0.001763f}, + {-0.310418f, -0.002136f, +0.003576f}, + {-0.158213f, +0.011793f, +0.008536f} + }, + { + {+0.533110f, -0.005084f, -0.001776f}, + {+0.463561f, -0.015347f, -0.000549f}, + {-0.035070f, -0.007804f, -0.002842f}, + {+0.008595f, -0.003050f, +0.002916f}, + {-0.153491f, +0.002287f, +0.004867f}, + {+0.021318f, +0.000337f, -0.007722f}, + {+0.040490f, +0.023364f, -0.005685f}, + {-0.339640f, -0.004014f, +0.007635f}, + {-0.113068f, +0.002471f, +0.003970f} + }, + { + {+0.559507f, +0.006521f, -0.001337f}, + {+0.495821f, +0.006508f, +0.001808f}, + {-0.009393f, +0.020033f, +0.002230f}, + {+0.057093f, +0.005006f, -0.000599f}, + {-0.147824f, -0.005127f, +0.001599f}, + {+0.035200f, +0.017556f, -0.003623f}, + {-0.026148f, -0.010270f, -0.006517f}, + {-0.331865f, -0.002383f, +0.006123f}, + {-0.069791f, +0.006016f, -0.000948f} + }, + { + {+0.580524f, -0.004095f, -0.000494f}, + {+0.527187f, -0.003574f, +0.000131f}, + {+0.034392f, -0.012275f, +0.006324f}, + {+0.108521f, -0.008134f, -0.002780f}, + {-0.124651f, -0.003736f, -0.002434f}, + {+0.058607f, -0.013665f, +0.003392f}, + {-0.096848f, +0.005058f, -0.001324f}, + {-0.301438f, -0.004261f, +0.001796f}, + {-0.026983f, -0.008052f, -0.001333f} + }, + { + {+0.597812f, +0.002656f, -0.000522f}, + {+0.552363f, +0.003313f, -0.001014f}, + {+0.075214f, -0.005271f, +0.002238f}, + {+0.170571f, +0.018162f, -0.002847f}, + {-0.083934f, +0.017743f, -0.001407f}, + {+0.076846f, -0.004888f, +0.003003f}, + {-0.166265f, -0.007573f, +0.004024f}, + {-0.256165f, +0.011081f, +0.000547f}, + {+0.019750f, +0.010957f, -0.001327f} + }, + { + {+0.613921f, -0.002403f, -0.000945f}, + {+0.571681f, -0.004061f, -0.000722f}, + {+0.106010f, -0.000496f, -0.004030f}, + {+0.238299f, -0.018447f, -0.000821f}, + {-0.038282f, -0.014684f, +0.002501f}, + {+0.080622f, +0.007409f, -0.002126f}, + {-0.235224f, +0.017619f, +0.005449f}, + {-0.203255f, -0.012695f, +0.000929f}, + {+0.070865f, -0.011018f, -0.001639f} + }, + { + {+0.630982f, +0.003698f, -0.001234f}, + {+0.590355f, +0.003219f, -0.000406f}, + {+0.130676f, +0.011921f, -0.002723f}, + {+0.295756f, +0.013516f, +0.001143f}, + {-0.005092f, +0.003596f, +0.003545f}, + {+0.072459f, +0.000272f, -0.002800f}, + {-0.299780f, -0.022696f, +0.001211f}, + {-0.150313f, +0.011501f, +0.001280f}, + {+0.118367f, +0.011753f, -0.001359f} + }, + { + {+0.649444f, -0.004884f, -0.000984f}, + {+0.615054f, -0.005408f, -0.000735f}, + {+0.149940f, -0.006453f, +0.001164f}, + {+0.328584f, -0.000395f, +0.001275f}, + {+0.008438f, +0.005199f, +0.001454f}, + {+0.058218f, -0.000064f, +0.000029f}, + {-0.346981f, +0.007071f, -0.001972f}, + {-0.104327f, -0.007957f, +0.001209f}, + {+0.149121f, -0.004220f, -0.000790f} + }, + { + {+0.667442f, +0.004369f, -0.000509f}, + {+0.649912f, +0.008091f, -0.001108f}, + {+0.160941f, -0.003110f, +0.000358f}, + {+0.335024f, -0.007340f, -0.001370f}, + {+0.010516f, -0.004138f, -0.001016f}, + {+0.042559f, -0.003980f, +0.001022f}, + {-0.366888f, +0.007198f, +0.001062f}, + {-0.068558f, +0.004871f, +0.000722f}, + {+0.153026f, -0.002598f, -0.000878f} + }, + { + {+0.682283f, -0.002839f, -0.000182f}, + {+0.693711f, -0.010677f, -0.001270f}, + {+0.163061f, +0.001749f, -0.001941f}, + {+0.327679f, +0.004372f, -0.003551f}, + {+0.017128f, -0.001449f, -0.002254f}, + {+0.029387f, +0.003404f, +0.000254f}, + {-0.363800f, -0.005157f, +0.004344f}, + {-0.041106f, -0.002019f, -0.000551f}, + {+0.130106f, +0.008236f, -0.000670f} + }, + { + {+0.692437f, +0.000095f, -0.000537f}, + {+0.740634f, +0.011604f, -0.000655f}, + {+0.157996f, +0.002060f, -0.000837f}, + {+0.323158f, +0.005481f, -0.001955f}, + {+0.039932f, +0.012585f, -0.000817f}, + {+0.021634f, -0.000010f, +0.000230f}, + {-0.350228f, -0.000420f, +0.003173f}, + {-0.016658f, +0.005630f, -0.001178f}, + {+0.089943f, -0.012079f, -0.001069f} + }, + { + {+0.698662f, +0.000230f, -0.001425f}, + {+0.782838f, -0.007193f, -0.000387f}, + {+0.147754f, +0.002321f, +0.001054f}, + {+0.330876f, -0.007440f, +0.001734f}, + {+0.078436f, -0.014161f, +0.002562f}, + {+0.020690f, -0.001093f, +0.000930f}, + {-0.336354f, +0.000244f, +0.000495f}, + {+0.007725f, -0.004802f, -0.001236f}, + {+0.047620f, +0.008277f, -0.001417f} + }, + { + {+0.703246f, +0.002409f, -0.001250f}, + {+0.814977f, +0.003204f, -0.001382f}, + {+0.135217f, -0.009385f, -0.001169f}, + {+0.350177f, -0.000838f, +0.000877f}, + {+0.122288f, +0.004476f, +0.002216f}, + {+0.025713f, -0.002869f, -0.000621f}, + {-0.325782f, +0.004520f, +0.000748f}, + {+0.030650f, +0.008462f, -0.000266f}, + {+0.015647f, -0.003005f, -0.000601f} + }, + { + {+0.707436f, -0.002159f, -0.000184f}, + {+0.836328f, -0.001420f, -0.002805f}, + {+0.124343f, +0.003534f, -0.004617f}, + {+0.377173f, -0.003128f, -0.002966f}, + {+0.162938f, -0.001908f, -0.001890f}, + {+0.034346f, -0.001148f, -0.003196f}, + {-0.317600f, -0.001145f, +0.002065f}, + {+0.047783f, -0.002726f, +0.001091f}, + {-0.001518f, -0.002014f, +0.001386f} + }, + { + {+0.711316f, +0.000190f, +0.000116f}, + {+0.849400f, +0.005461f, -0.002132f}, + {+0.115220f, +0.006522f, -0.002677f}, + {+0.406205f, +0.009733f, -0.003200f}, + {+0.198229f, +0.008830f, -0.003296f}, + {+0.041723f, +0.007295f, -0.001797f}, + {-0.307751f, -0.000513f, +0.001061f}, + {+0.056384f, -0.001852f, +0.000252f}, + {-0.007409f, -0.002688f, +0.001636f} + }, + { + {+0.715564f, +0.000878f, -0.000712f}, + {+0.856145f, -0.001865f, -0.000304f}, + {+0.099717f, +0.000516f, +0.001510f}, + {+0.427792f, -0.008621f, -0.000103f}, + {+0.227122f, -0.009743f, -0.000742f}, + {+0.038969f, +0.000573f, +0.000890f}, + {-0.290500f, -0.003837f, -0.000282f}, + {+0.060351f, +0.002258f, -0.001388f}, + {-0.007102f, +0.000681f, +0.000051f} + }, + { + {+0.721724f, +0.001440f, -0.001419f}, + {+0.857928f, -0.002494f, -0.000723f}, + {+0.068940f, -0.015230f, +0.000407f}, + {+0.432906f, -0.004606f, +0.000685f}, + {+0.246924f, +0.000678f, +0.000115f}, + {+0.019686f, -0.012823f, -0.000958f}, + {-0.263371f, +0.009394f, +0.000248f}, + {+0.066836f, +0.001658f, -0.002275f}, + {-0.003255f, +0.001689f, -0.000037f} + }, + { + {+0.730712f, -0.003910f, -0.000870f}, + {+0.858450f, +0.001220f, -0.001946f}, + {+0.023475f, +0.016216f, -0.003883f}, + {+0.419872f, +0.011121f, -0.002752f}, + {+0.256682f, +0.002820f, -0.002128f}, + {-0.013513f, +0.011639f, -0.004607f}, + {-0.229180f, -0.009683f, +0.001814f}, + {+0.080511f, -0.005798f, -0.001723f}, + {+0.001435f, +0.000756f, -0.000451f} + }, + { + {+0.741590f, +0.003101f, -0.000011f}, + {+0.860726f, -0.000300f, -0.002853f}, + {-0.028493f, -0.003694f, -0.002869f}, + {+0.395211f, -0.003270f, -0.003914f}, + {+0.257602f, +0.001422f, -0.002810f}, + {-0.053057f, -0.000570f, -0.002860f}, + {-0.193999f, +0.002947f, +0.000888f}, + {+0.099824f, +0.006425f, -0.000616f}, + {+0.005522f, +0.002697f, -0.000570f} + }, + { + {+0.752785f, -0.000581f, -0.000328f}, + {+0.864679f, -0.002652f, -0.003144f}, + {-0.079249f, -0.003995f, +0.005777f}, + {+0.366044f, -0.005911f, +0.001913f}, + {+0.251095f, -0.009072f, +0.002248f}, + {-0.092600f, -0.005125f, +0.005522f}, + {-0.162554f, -0.001717f, -0.002557f}, + {+0.119626f, -0.005564f, +0.000516f}, + {+0.008439f, -0.004393f, +0.001712f} + }, + { + {+0.763163f, -0.000862f, -0.002020f}, + {+0.868650f, +0.005188f, -0.001363f}, + {-0.122932f, -0.003612f, +0.014766f}, + {+0.337176f, +0.004705f, +0.011739f}, + {+0.240301f, +0.007676f, +0.011938f}, + {-0.125784f, -0.004581f, +0.013027f}, + {-0.137073f, +0.006965f, -0.003725f}, + {+0.136715f, +0.001962f, +0.001072f}, + {+0.010881f, +0.001506f, +0.004158f} + } +}; +const float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +{ + { + {-0.067351f, +0.619497f, -0.224314f}, + {-0.139294f, +0.771571f, -0.258097f}, + {-0.003713f, +0.028657f, -0.008450f}, + {-0.024048f, +0.069155f, -0.020553f}, + {-0.025678f, -0.026025f, +0.019233f}, + {-0.009936f, -0.011063f, +0.007565f}, + {+0.034483f, +0.043638f, -0.029489f}, + {+0.006138f, -0.086263f, +0.038216f}, + {+0.046480f, +0.249243f, -0.117268f} + }, + { + {+0.012648f, +0.734658f, -0.184512f}, + {-0.111037f, +0.538674f, -0.336987f}, + {-0.002627f, -0.020803f, -0.029183f}, + {-0.030921f, +0.004858f, -0.041299f}, + {-0.051115f, -0.078198f, +0.009636f}, + {-0.016252f, -0.028855f, +0.008268f}, + {+0.084591f, +0.153968f, -0.000650f}, + {-0.017068f, -0.206982f, -0.012636f}, + {+0.164507f, +0.469681f, -0.054789f} + }, + { + {+0.223221f, -0.320495f, +0.172323f}, + {+0.327663f, -0.928806f, +0.128055f}, + {+0.019358f, -0.074304f, -0.015400f}, + {+0.035210f, -0.082508f, -0.021387f}, + {-0.001915f, +0.019754f, -0.041779f}, + {+0.009482f, -0.004447f, -0.006672f}, + {+0.039341f, +0.054366f, +0.052326f}, + {-0.015501f, -0.146235f, -0.037803f}, + {+0.140215f, +0.011558f, +0.133087f} + }, + { + {+0.158118f, -0.393316f, +0.132368f}, + {+0.546868f, -0.311888f, +0.284518f}, + {+0.031012f, +0.036496f, +0.023744f}, + {+0.107357f, +0.078785f, +0.019930f}, + {+0.117669f, +0.168393f, -0.014741f}, + {+0.063269f, +0.132935f, +0.029018f}, + {-0.110215f, -0.232883f, -0.026283f}, + {+0.026325f, -0.007643f, +0.015801f}, + {-0.156350f, -0.444539f, +0.006974f} + }, + { + {-0.158057f, +0.298412f, -0.065118f}, + {+0.180062f, +0.634611f, -0.013767f}, + {-0.011461f, +0.071086f, +0.018569f}, + {+0.074813f, +0.048439f, +0.032538f}, + {+0.176343f, -0.017086f, +0.039934f}, + {+0.070878f, +0.087909f, +0.042882f}, + {-0.196698f, -0.095181f, -0.059079f}, + {+0.043237f, +0.006669f, +0.001955f}, + {-0.440379f, +0.000452f, -0.098398f} + }, + { + {-0.449468f, +0.042993f, -0.088093f}, + {-0.450454f, -0.142745f, -0.162071f}, + {-0.082857f, -0.081326f, -0.023342f}, + {-0.091693f, -0.115333f, +0.002878f}, + {+0.059625f, -0.113643f, +0.022660f}, + {+0.002551f, -0.114733f, -0.021413f}, + {-0.134830f, +0.127944f, +0.015214f}, + {+0.039406f, -0.002734f, -0.000806f}, + {-0.456803f, +0.175205f, -0.017055f} + }, + { + {-0.521027f, -0.156261f, +0.000350f}, + {-0.908889f, -0.180570f, -0.051670f}, + {-0.108770f, -0.053291f, -0.027241f}, + {-0.287995f, +0.046150f, -0.015860f}, + {-0.175042f, +0.108856f, -0.012453f}, + {-0.059786f, -0.044325f, -0.033874f}, + {-0.008998f, -0.011671f, +0.039397f}, + {+0.004422f, -0.001021f, +0.005255f}, + {-0.225556f, -0.103116f, +0.036951f} + }, + { + {-0.371766f, +0.087065f, +0.052523f}, + {-1.010425f, +0.130810f, +0.067243f}, + {-0.070822f, +0.064314f, +0.008682f}, + {-0.381257f, -0.000635f, -0.013290f}, + {-0.375703f, -0.033440f, -0.023774f}, + {-0.081888f, +0.060050f, +0.009146f}, + {+0.099530f, -0.054172f, +0.002402f}, + {-0.055187f, -0.030383f, +0.004615f}, + {+0.113698f, +0.047344f, +0.023699f} + }, + { + {-0.133153f, +0.006407f, +0.034476f}, + {-0.837054f, +0.001398f, +0.067755f}, + {-0.019596f, -0.013995f, +0.025797f}, + {-0.306127f, -0.073720f, -0.002010f}, + {-0.417535f, -0.051347f, -0.011222f}, + {-0.096752f, +0.015410f, +0.024298f}, + {+0.165604f, -0.014311f, -0.020675f}, + {-0.110129f, +0.012754f, -0.001173f}, + {+0.396896f, -0.022479f, +0.001703f} + }, + { + {+0.076154f, -0.015041f, -0.005731f}, + {-0.558795f, -0.016178f, +0.011329f}, + {+0.001783f, -0.050805f, +0.008376f}, + {-0.100163f, +0.081596f, +0.016700f}, + {-0.287003f, +0.097687f, +0.016950f}, + {-0.130328f, -0.051441f, +0.002818f}, + {+0.194137f, +0.028286f, -0.006100f}, + {-0.128998f, -0.007273f, -0.004964f}, + {+0.525370f, -0.013001f, -0.010543f} + }, + { + {+0.227729f, -0.027128f, -0.019508f}, + {-0.280803f, -0.046474f, -0.016340f}, + {+0.006184f, +0.007629f, -0.010663f}, + {+0.124161f, -0.022132f, +0.014831f}, + {-0.082170f, -0.023992f, +0.023358f}, + {-0.168199f, +0.000379f, -0.008102f}, + {+0.185287f, +0.007140f, +0.002454f}, + {-0.098830f, -0.034738f, -0.000610f}, + {+0.505599f, +0.024919f, -0.016122f} + }, + { + {+0.345183f, +0.044417f, -0.008489f}, + {-0.029206f, +0.069971f, -0.008062f}, + {+0.040780f, +0.025656f, -0.005557f}, + {+0.280661f, +0.000086f, -0.001939f}, + {+0.091189f, -0.001516f, +0.001765f}, + {-0.178051f, +0.018186f, +0.003683f}, + {+0.147526f, -0.011735f, +0.000472f}, + {-0.034700f, +0.017373f, +0.007552f}, + {+0.404231f, -0.018810f, -0.013580f} + }, + { + {+0.447376f, -0.029945f, +0.002359f}, + {+0.196485f, -0.048776f, +0.000528f}, + {+0.131413f, -0.031345f, +0.001264f}, + {+0.352086f, -0.000092f, -0.009252f}, + {+0.196164f, -0.010102f, -0.008244f}, + {-0.137927f, -0.001411f, +0.005445f}, + {+0.094224f, +0.013361f, +0.000776f}, + {+0.030220f, +0.002376f, +0.001349f}, + {+0.282599f, +0.004869f, -0.002937f} + }, + { + {+0.532898f, +0.008836f, +0.002166f}, + {+0.392609f, +0.034792f, -0.000679f}, + {+0.270895f, +0.030297f, -0.000156f}, + {+0.364913f, -0.004283f, -0.009820f}, + {+0.243967f, +0.002627f, -0.007384f}, + {-0.037047f, +0.017787f, -0.004491f}, + {+0.041930f, -0.015182f, -0.000239f}, + {+0.078287f, +0.007042f, -0.004821f}, + {+0.167608f, -0.019027f, +0.005545f} + }, + { + {+0.594888f, -0.002438f, -0.003208f}, + {+0.547092f, -0.023930f, -0.003204f}, + {+0.418638f, -0.023295f, -0.006545f}, + {+0.358947f, -0.011193f, -0.005371f}, + {+0.268043f, -0.007992f, -0.005934f}, + {+0.108159f, -0.040803f, -0.007847f}, + {+0.014237f, +0.000657f, -0.000908f}, + {+0.104780f, -0.013359f, -0.000511f}, + {+0.064568f, +0.028680f, +0.003338f} + }, + { + {+0.635005f, +0.006702f, -0.005006f}, + {+0.650934f, +0.013984f, -0.004474f}, + {+0.519015f, +0.020899f, -0.008786f}, + {+0.354058f, +0.000065f, -0.000944f}, + {+0.293166f, +0.009243f, -0.003786f}, + {+0.244478f, +0.036317f, -0.004273f}, + {+0.027137f, +0.008991f, +0.000305f}, + {+0.112434f, -0.002933f, +0.003310f}, + {-0.019782f, -0.018420f, -0.000608f} + }, + { + {+0.661388f, -0.006850f, -0.003249f}, + {+0.709859f, -0.007935f, -0.004126f}, + {+0.524557f, -0.002414f, -0.002080f}, + {+0.344994f, +0.003888f, -0.002639f}, + {+0.316812f, -0.006036f, -0.003412f}, + {+0.307717f, -0.012550f, +0.001272f}, + {+0.076841f, -0.011681f, -0.000880f}, + {+0.115864f, +0.008381f, -0.000189f}, + {-0.078312f, +0.007256f, -0.000761f} + }, + { + {+0.681780f, +0.004317f, -0.002114f}, + {+0.740600f, +0.002506f, -0.003738f}, + {+0.416864f, -0.038264f, +0.003168f}, + {+0.319577f, -0.000792f, -0.001313f}, + {+0.319873f, +0.002666f, -0.002245f}, + {+0.258538f, -0.029824f, +0.003409f}, + {+0.141548f, +0.012818f, -0.003839f}, + {+0.135337f, +0.001218f, -0.005061f}, + {-0.109830f, +0.001645f, +0.001441f} + }, + { + {+0.699871f, -0.003221f, -0.002308f}, + {+0.762514f, -0.004609f, -0.003814f}, + {+0.225434f, +0.064939f, -0.001450f}, + {+0.266431f, +0.012897f, +0.002255f}, + {+0.282175f, +0.010311f, +0.000422f}, + {+0.108713f, +0.058556f, -0.002399f}, + {+0.186968f, -0.009396f, -0.004807f}, + {+0.178376f, -0.016506f, -0.006062f}, + {-0.120383f, -0.003023f, +0.004088f} + }, + { + {+0.714529f, +0.003253f, -0.002414f}, + {+0.790696f, +0.011388f, -0.001985f}, + {+0.020833f, -0.046458f, -0.007156f}, + {+0.185944f, -0.029249f, +0.000016f}, + {+0.197551f, -0.028731f, -0.000138f}, + {-0.079181f, -0.043101f, -0.006863f}, + {+0.176963f, -0.004258f, -0.002861f}, + {+0.228839f, +0.021085f, -0.002090f}, + {-0.119574f, -0.002646f, +0.004158f} + }, + { + {+0.721602f, -0.001258f, -0.002069f}, + {+0.831027f, -0.010846f, +0.000173f}, + {-0.126177f, +0.009153f, -0.003439f}, + {+0.096173f, +0.020892f, -0.003906f}, + {+0.084227f, +0.027335f, -0.001653f}, + {-0.229925f, +0.010207f, -0.000875f}, + {+0.090658f, +0.023511f, +0.000256f}, + {+0.250703f, +0.000323f, +0.000133f}, + {-0.115659f, +0.011998f, -0.001947f} + }, + { + {+0.717593f, -0.001188f, -0.001513f}, + {+0.881199f, +0.003795f, -0.002266f}, + {-0.186085f, +0.008805f, +0.004207f}, + {+0.021886f, +0.000682f, +0.000980f}, + {-0.024639f, -0.019808f, -0.000274f}, + {-0.296639f, +0.006775f, +0.008463f}, + {-0.060930f, -0.036828f, +0.003817f}, + {+0.210581f, -0.022700f, -0.003357f}, + {-0.112881f, +0.004715f, -0.006188f} + }, + { + {+0.702872f, +0.004202f, -0.000899f}, + {+0.934393f, -0.006557f, -0.007476f}, + {-0.176147f, -0.010014f, +0.006716f}, + {-0.022135f, +0.003624f, +0.007346f}, + {-0.100594f, +0.012448f, +0.000135f}, + {-0.271960f, -0.005598f, +0.007977f}, + {-0.233701f, +0.046766f, +0.003616f}, + {+0.101020f, +0.023227f, -0.002321f}, + {-0.116785f, -0.020405f, +0.002997f} + }, + { + {+0.682250f, -0.007566f, -0.001501f}, + {+0.978417f, +0.017585f, -0.006636f}, + {-0.137592f, +0.005047f, +0.003880f}, + {-0.028458f, -0.006826f, +0.004609f}, + {-0.129898f, +0.005880f, +0.001391f}, + {-0.175874f, +0.016526f, -0.001013f}, + {-0.367276f, -0.033929f, -0.002775f}, + {-0.060514f, -0.037887f, +0.002465f}, + {-0.137333f, -0.006964f, +0.011955f} + }, + { + {+0.663415f, +0.004606f, -0.002781f}, + {+0.993852f, -0.009178f, +0.000038f}, + {-0.108250f, -0.003270f, +0.001437f}, + {+0.009848f, -0.008477f, -0.000681f}, + {-0.118923f, -0.012268f, +0.005212f}, + {-0.044501f, -0.037572f, -0.003962f}, + {-0.416290f, -0.006378f, -0.006076f}, + {-0.236610f, +0.040350f, +0.002858f}, + {-0.168887f, +0.032800f, +0.004036f} + }, + { + {+0.651781f, +0.001152f, -0.002457f}, + {+0.965546f, -0.016499f, +0.002125f}, + {-0.105651f, -0.001646f, +0.002481f}, + {+0.090167f, +0.025763f, -0.001130f}, + {-0.087686f, +0.003999f, +0.005549f}, + {+0.075223f, +0.035790f, +0.002847f}, + {-0.383115f, +0.037796f, +0.001566f}, + {-0.378556f, -0.025237f, +0.002287f}, + {-0.179845f, -0.008941f, -0.008124f} + }, + { + {+0.645685f, -0.002682f, -0.000593f}, + {+0.900401f, +0.029783f, -0.003285f}, + {-0.124380f, +0.012275f, +0.001822f}, + {+0.193225f, -0.027406f, +0.000945f}, + {-0.052400f, +0.001580f, +0.000684f}, + {+0.141411f, +0.002262f, +0.004491f}, + {-0.319576f, -0.023501f, +0.010635f}, + {-0.448327f, +0.001574f, +0.004044f}, + {-0.141908f, -0.032139f, -0.005596f} + }, + { + {+0.638137f, -0.002412f, +0.000310f}, + {+0.826423f, -0.017144f, -0.007574f}, + {-0.140725f, -0.006104f, -0.000815f}, + {+0.290930f, +0.019453f, +0.001904f}, + {-0.016875f, +0.009182f, -0.001656f}, + {+0.145675f, -0.017736f, -0.001807f}, + {-0.285941f, -0.010851f, +0.008570f}, + {-0.435070f, +0.011023f, +0.004307f}, + {-0.062178f, +0.036767f, +0.005654f} + }, + { + {+0.623287f, +0.007299f, -0.001056f}, + {+0.770521f, -0.001075f, -0.004559f}, + {-0.130645f, -0.003274f, -0.002902f}, + {+0.361351f, -0.005902f, +0.000348f}, + {+0.020477f, -0.011841f, +0.000752f}, + {+0.114514f, +0.018145f, -0.007488f}, + {-0.305625f, +0.026256f, -0.000446f}, + {-0.353862f, -0.030431f, +0.004835f}, + {+0.024417f, -0.010793f, +0.007820f} + }, + { + {+0.600902f, -0.006021f, -0.002348f}, + {+0.739248f, +0.005015f, +0.001571f}, + {-0.087167f, +0.021027f, -0.001847f}, + {+0.400187f, +0.000286f, -0.002317f}, + {+0.060945f, +0.009244f, +0.002589f}, + {+0.083328f, +0.001928f, -0.007725f}, + {-0.359405f, -0.019595f, -0.006438f}, + {-0.237042f, +0.027090f, +0.006659f}, + {+0.089013f, -0.004244f, -0.000128f} + }, + { + {+0.574438f, +0.003368f, -0.001494f}, + {+0.720431f, +0.005878f, +0.002928f}, + {-0.025553f, -0.022088f, +0.002875f}, + {+0.419048f, +0.001480f, -0.004334f}, + {+0.105303f, -0.000852f, -0.000385f}, + {+0.070507f, -0.013892f, -0.000793f}, + {-0.411663f, -0.001662f, -0.003755f}, + {-0.118815f, -0.013893f, +0.002937f}, + {+0.127181f, -0.002212f, -0.005490f} + }, + { + {+0.546941f, -0.004959f, -0.000239f}, + {+0.700235f, -0.009986f, -0.000285f}, + {+0.026874f, +0.006811f, +0.004565f}, + {+0.432826f, +0.004148f, -0.005149f}, + {+0.153860f, +0.009932f, -0.004309f}, + {+0.067445f, +0.005555f, +0.005512f}, + {-0.441084f, +0.007824f, +0.003852f}, + {-0.016912f, +0.012081f, -0.003174f}, + {+0.148914f, +0.007013f, -0.004323f} + }, + { + {+0.520436f, +0.006384f, -0.000382f}, + {+0.674657f, +0.006620f, -0.001998f}, + {+0.052406f, +0.010142f, -0.000198f}, + {+0.447102f, -0.009070f, -0.003159f}, + {+0.202135f, -0.018081f, -0.002032f}, + {+0.055887f, +0.014144f, +0.003615f}, + {-0.448314f, -0.001324f, +0.007309f}, + {+0.065957f, -0.020607f, -0.003258f}, + {+0.162472f, -0.004875f, -0.002127f} + }, + { + {+0.496665f, -0.004859f, -0.000887f}, + {+0.647428f, -0.004741f, -0.001434f}, + {+0.053060f, -0.007546f, -0.006118f}, + {+0.453309f, +0.004051f, -0.000324f}, + {+0.237178f, +0.009221f, +0.002058f}, + {+0.029969f, -0.014850f, -0.002643f}, + {-0.439805f, -0.002523f, +0.005619f}, + {+0.128558f, +0.010056f, -0.001511f}, + {+0.167737f, +0.001236f, -0.001456f} + }, + { + {+0.475983f, +0.003710f, -0.000970f}, + {+0.624608f, +0.003603f, -0.000812f}, + {+0.042149f, -0.008534f, -0.003432f}, + {+0.438672f, +0.005526f, +0.000965f}, + {+0.249063f, +0.004782f, +0.002016f}, + {-0.000807f, +0.001028f, -0.002841f}, + {-0.416440f, +0.003745f, +0.000359f}, + {+0.170217f, -0.009457f, -0.000867f}, + {+0.158107f, +0.002167f, -0.000901f} + }, + { + {+0.456962f, -0.002559f, -0.000574f}, + {+0.609653f, -0.002905f, -0.001117f}, + {+0.025784f, -0.000666f, +0.002060f}, + {+0.399694f, -0.014955f, +0.000161f}, + {+0.242149f, -0.009905f, -0.001262f}, + {-0.026686f, +0.000156f, +0.001218f}, + {-0.373014f, +0.013273f, -0.002730f}, + {+0.191984f, -0.000973f, -0.000838f}, + {+0.127455f, -0.008313f, +0.000023f} + }, + { + {+0.437008f, +0.003925f, -0.000081f}, + {+0.601093f, +0.000232f, -0.001372f}, + {+0.002960f, +0.010345f, +0.001054f}, + {+0.347170f, +0.016956f, -0.002319f}, + {+0.233004f, +0.002825f, -0.003373f}, + {-0.044339f, +0.004384f, +0.002020f}, + {-0.309506f, -0.024368f, +0.000882f}, + {+0.198003f, -0.000405f, -0.001486f}, + {+0.077236f, +0.014350f, -0.000034f} + }, + { + {+0.414109f, -0.005431f, -0.000037f}, + {+0.592705f, -0.001470f, -0.001222f}, + {-0.024584f, -0.008451f, -0.001721f}, + {+0.300043f, -0.007510f, -0.003376f}, + {+0.236922f, +0.005189f, -0.002904f}, + {-0.053435f, -0.002953f, +0.000365f}, + {-0.239443f, +0.015553f, +0.003945f}, + {+0.195817f, -0.003961f, -0.001987f}, + {+0.019225f, -0.012398f, -0.000024f} + }, + { + {+0.388577f, +0.006627f, -0.000411f}, + {+0.576851f, +0.002898f, -0.000753f}, + {-0.052952f, +0.001666f, -0.000781f}, + {+0.271771f, -0.002315f, -0.001136f}, + {+0.256751f, -0.010892f, -0.000933f}, + {-0.055321f, -0.000623f, -0.000321f}, + {-0.178829f, -0.004699f, +0.001577f}, + {+0.192108f, -0.001841f, -0.002156f}, + {-0.030601f, +0.010281f, +0.000029f} + }, + { + {+0.362659f, -0.006023f, -0.001007f}, + {+0.548393f, -0.008477f, -0.000553f}, + {-0.079254f, -0.004768f, +0.001192f}, + {+0.262246f, +0.003901f, +0.002002f}, + {+0.282691f, +0.009035f, +0.001549f}, + {-0.052737f, +0.001616f, +0.000062f}, + {-0.134033f, +0.004191f, -0.001751f}, + {+0.189322f, +0.000295f, -0.001194f}, + {-0.059659f, -0.002213f, -0.000053f} + }, + { + {+0.339002f, +0.002927f, -0.000712f}, + {+0.507223f, +0.011672f, -0.001408f}, + {-0.101892f, +0.008754f, -0.000366f}, + {+0.261016f, +0.005455f, +0.000964f}, + {+0.300336f, +0.003329f, +0.000659f}, + {-0.049601f, +0.001946f, -0.000746f}, + {-0.101681f, -0.008021f, -0.001522f}, + {+0.184646f, -0.000891f, -0.000474f}, + {-0.064232f, -0.004100f, +0.000831f} + }, + { + {+0.318447f, -0.002583f, +0.000342f}, + {+0.458166f, -0.011334f, -0.002134f}, + {-0.119857f, -0.003793f, -0.002673f}, + {+0.257649f, -0.004527f, -0.002750f}, + {+0.302642f, -0.006786f, -0.003304f}, + {-0.050079f, -0.001140f, -0.002294f}, + {-0.075154f, +0.006079f, +0.000154f}, + {+0.175259f, -0.002462f, +0.000450f}, + {-0.050689f, +0.006815f, +0.002112f} + }, + { + {+0.300124f, +0.004647f, +0.000429f}, + {+0.407177f, +0.007551f, -0.001229f}, + {-0.135280f, -0.004904f, -0.000353f}, + {+0.246029f, -0.001362f, -0.002342f}, + {+0.292460f, +0.000038f, -0.003938f}, + {-0.057770f, -0.002994f, -0.000700f}, + {-0.048950f, -0.002677f, -0.000542f}, + {+0.161196f, +0.006930f, -0.000490f}, + {-0.030107f, -0.002304f, +0.001927f} + }, + { + {+0.283695f, -0.004672f, -0.000499f}, + {+0.357931f, -0.007644f, +0.000792f}, + {-0.154465f, -0.001114f, +0.004046f}, + {+0.221394f, -0.002251f, +0.001225f}, + {+0.274104f, +0.001365f, -0.000312f}, + {-0.076006f, -0.003175f, +0.002372f}, + {-0.019797f, +0.006502f, -0.001827f}, + {+0.147944f, -0.003560f, -0.001898f}, + {-0.011081f, -0.000127f, -0.000375f} + }, + { + {+0.269518f, +0.002457f, -0.001001f}, + {+0.311326f, +0.012837f, +0.000327f}, + {-0.181319f, +0.014112f, +0.003014f}, + {+0.182651f, +0.012951f, +0.002036f}, + {+0.248875f, +0.007948f, +0.001266f}, + {-0.104063f, +0.013233f, +0.001219f}, + {+0.010928f, -0.008987f, -0.001152f}, + {+0.141371f, -0.000838f, -0.001781f}, + {+0.004297f, -0.004808f, -0.000787f} + }, + { + {+0.257138f, -0.000471f, -0.000295f}, + {+0.269065f, -0.008971f, -0.001327f}, + {-0.209242f, -0.009445f, -0.000789f}, + {+0.136359f, -0.015642f, -0.000837f}, + {+0.218917f, -0.009939f, -0.000695f}, + {-0.133100f, -0.007332f, -0.001415f}, + {+0.037336f, +0.006071f, +0.000081f}, + {+0.141848f, +0.003924f, -0.000450f}, + {+0.015759f, +0.001304f, -0.000104f} + }, + { + {+0.244594f, +0.002255f, +0.000537f}, + {+0.232039f, +0.006188f, -0.001385f}, + {-0.226456f, -0.005183f, +0.000708f}, + {+0.094177f, +0.004239f, -0.001379f}, + {+0.188550f, +0.003755f, -0.001033f}, + {-0.152408f, -0.005083f, +0.000982f}, + {+0.053373f, +0.001503f, -0.000759f}, + {+0.144008f, -0.001965f, +0.000959f}, + {+0.023577f, -0.002308f, -0.000076f} + }, + { + {+0.229867f, -0.004876f, +0.000170f}, + {+0.197603f, -0.004728f, -0.000560f}, + {-0.226600f, +0.010780f, +0.006854f}, + {+0.064221f, +0.003891f, +0.003122f}, + {+0.161189f, +0.001104f, +0.002261f}, + {-0.157190f, +0.008241f, +0.006888f}, + {+0.056895f, -0.003410f, -0.003127f}, + {+0.141412f, -0.001071f, +0.001644f}, + {+0.029485f, +0.003593f, +0.001358f} + }, + { + {+0.212288f, +0.005142f, -0.000800f}, + {+0.162483f, +0.004117f, +0.001433f}, + {-0.209328f, -0.002547f, +0.009702f}, + {+0.048193f, +0.000129f, +0.007210f}, + {+0.139874f, +0.002121f, +0.005784f}, + {-0.146647f, +0.000237f, +0.009054f}, + {+0.049793f, -0.001403f, -0.002729f}, + {+0.132126f, +0.003164f, +0.002133f}, + {+0.035201f, -0.000152f, +0.002301f} + }, + { + {+0.191599f, -0.002871f, -0.000708f}, + {+0.125250f, -0.008746f, +0.003116f}, + {-0.175384f, -0.002970f, +0.005044f}, + {+0.046507f, -0.009000f, +0.004794f}, + {+0.128202f, -0.013178f, +0.002850f}, + {-0.120273f, -0.005762f, +0.003583f}, + {+0.034030f, -0.000067f, +0.000427f}, + {+0.118790f, -0.004116f, +0.002419f}, + {+0.044052f, -0.001094f, +0.001102f} + } +}; +const float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +{ + { + {+0.018159f, +0.985146f, +0.240506f}, + {-0.077046f, +0.024713f, -0.260411f}, + {+0.000593f, +0.132269f, +0.000009f}, + {+0.009213f, +0.054471f, +0.004257f}, + {-0.039823f, +0.044599f, +0.001606f}, + {-0.011090f, +0.028094f, -0.011739f}, + {-0.057613f, +0.083209f, +0.004522f}, + {+0.010244f, +0.028373f, -0.010969f}, + {-0.107601f, +0.182275f, +0.052385f} + }, + { + {-0.152534f, -0.329898f, -0.242342f}, + {+0.209786f, +1.273585f, +0.112026f}, + {-0.011413f, +0.080591f, -0.013524f}, + {-0.034221f, +0.013783f, +0.008826f}, + {+0.012372f, -0.014808f, -0.038195f}, + {-0.003235f, -0.083338f, -0.068446f}, + {+0.003314f, -0.032912f, -0.065265f}, + {+0.003322f, +0.076317f, +0.007937f}, + {-0.015189f, -0.220191f, -0.130843f} + }, + { + {-0.023093f, -0.558938f, -0.150964f}, + {+0.270176f, +0.589966f, +0.359432f}, + {-0.003260f, +0.097037f, -0.014970f}, + {-0.058519f, +0.107799f, -0.014627f}, + {+0.084143f, -0.174088f, +0.006734f}, + {+0.035814f, -0.281769f, +0.006166f}, + {+0.116511f, -0.307921f, +0.020292f}, + {-0.013401f, +0.086307f, +0.012981f}, + {+0.209526f, -0.554513f, -0.048661f} + }, + { + {+0.261551f, +0.304347f, +0.114032f}, + {-0.250896f, -0.779633f, -0.070356f}, + {+0.023786f, +0.088663f, -0.030815f}, + {+0.003407f, +0.082081f, -0.041209f}, + {+0.062118f, -0.047824f, +0.057239f}, + {+0.026013f, -0.155692f, +0.065882f}, + {+0.127095f, -0.164040f, +0.077176f}, + {-0.022006f, +0.035999f, -0.005698f}, + {+0.327951f, -0.045215f, +0.125831f} + }, + { + {+0.359497f, +0.205525f, +0.109865f}, + {-0.745384f, -0.051437f, -0.216054f}, + {+0.066207f, -0.076438f, +0.024748f}, + {+0.143496f, -0.123266f, +0.007838f}, + {-0.098368f, +0.139294f, +0.014972f}, + {-0.065224f, +0.122143f, -0.029816f}, + {-0.019520f, +0.163808f, -0.024174f}, + {+0.008568f, -0.024216f, +0.013284f}, + {+0.111141f, +0.311803f, +0.021197f} + }, + { + {+0.165159f, -0.254129f, -0.025534f}, + {-0.780421f, +0.408205f, -0.025264f}, + {+0.043262f, -0.082839f, +0.025956f}, + {+0.214774f, -0.021619f, +0.026192f}, + {-0.266921f, -0.073753f, -0.026414f}, + {-0.110056f, +0.068805f, -0.038706f}, + {-0.162323f, +0.018037f, -0.046919f}, + {+0.046582f, -0.024241f, +0.003856f}, + {-0.254154f, -0.105995f, -0.060073f} + }, + { + {-0.177496f, +0.069944f, -0.070544f}, + {-0.384878f, -0.205067f, +0.111476f}, + {-0.035734f, +0.067378f, -0.014549f}, + {+0.125583f, +0.062055f, +0.008649f}, + {-0.294346f, -0.048254f, -0.026299f}, + {-0.090207f, -0.084523f, +0.015326f}, + {-0.211714f, -0.100002f, +0.007755f}, + {+0.078344f, -0.022510f, -0.004774f}, + {-0.527842f, -0.045905f, -0.024578f} + }, + { + {-0.463362f, +0.056885f, -0.021761f}, + {+0.150954f, -0.026543f, +0.068293f}, + {-0.101521f, +0.000813f, -0.025478f}, + {-0.095046f, -0.089523f, -0.003261f}, + {-0.134616f, +0.104561f, -0.001013f}, + {-0.059105f, -0.025388f, +0.028020f}, + {-0.181070f, -0.006996f, +0.032275f}, + {+0.082036f, -0.002388f, +0.001840f}, + {-0.586330f, +0.048806f, +0.016554f} + }, + { + {-0.592381f, -0.044571f, +0.029549f}, + {+0.576892f, +0.036976f, -0.022220f}, + {-0.119596f, -0.060394f, -0.001555f}, + {-0.338453f, +0.063985f, -0.014668f}, + {+0.125238f, -0.093159f, +0.021501f}, + {-0.045169f, +0.044028f, -0.000433f}, + {-0.115198f, +0.025252f, +0.004920f}, + {+0.041077f, +0.008697f, +0.004995f}, + {-0.438497f, -0.055561f, +0.020980f} + }, + { + {-0.599054f, -0.014356f, +0.032985f}, + {+0.822874f, +0.044354f, -0.046136f}, + {-0.117506f, +0.008009f, +0.019868f}, + {-0.479925f, +0.018761f, -0.007799f}, + {+0.339581f, +0.001799f, +0.018360f}, + {-0.028531f, +0.004096f, -0.014580f}, + {-0.035532f, +0.016131f, -0.009871f}, + {-0.031577f, -0.038412f, +0.000988f}, + {-0.188266f, +0.051427f, +0.014971f} + }, + { + {-0.558565f, +0.027629f, +0.008677f}, + {+0.934558f, -0.055883f, -0.019701f}, + {-0.143536f, +0.040687f, +0.009496f}, + {-0.475498f, -0.046650f, +0.012347f}, + {+0.418986f, +0.046808f, -0.009187f}, + {+0.019973f, -0.045258f, -0.001389f}, + {+0.040837f, -0.027615f, -0.004137f}, + {-0.104086f, +0.015540f, -0.006688f}, + {+0.045132f, -0.020688f, +0.004131f} + }, + { + {-0.508817f, +0.002572f, -0.006006f}, + {+0.966334f, +0.010598f, -0.000935f}, + {-0.200114f, -0.021501f, -0.002245f}, + {-0.374199f, +0.021235f, +0.015875f}, + {+0.383236f, -0.011504f, -0.019281f}, + {+0.101681f, +0.007702f, +0.004459f}, + {+0.098607f, +0.009824f, -0.000170f}, + {-0.142186f, +0.015367f, -0.000073f}, + {+0.202499f, +0.007942f, -0.007850f} + }, + { + {-0.449816f, -0.025700f, -0.002766f}, + {+0.942805f, +0.019015f, -0.002630f}, + {-0.251515f, +0.005009f, -0.000037f}, + {-0.247529f, -0.018163f, +0.007953f}, + {+0.297646f, +0.008359f, -0.008978f}, + {+0.194833f, -0.010293f, -0.006773f}, + {+0.127610f, -0.005400f, -0.000110f}, + {-0.141062f, -0.005988f, +0.007030f}, + {+0.285592f, -0.008291f, -0.012555f} + }, + { + {-0.376168f, +0.026055f, +0.004627f}, + {+0.871841f, -0.021874f, -0.006470f}, + {-0.251474f, +0.012379f, +0.004839f}, + {-0.143351f, +0.003085f, +0.000557f}, + {+0.213031f, -0.008846f, -0.002525f}, + {+0.266224f, +0.023397f, -0.007678f}, + {+0.122414f, -0.005951f, +0.000933f}, + {-0.115352f, -0.004480f, +0.001947f}, + {+0.318209f, +0.018171f, -0.006837f} + }, + { + {-0.293873f, -0.014103f, +0.005564f}, + {+0.763509f, +0.026484f, -0.005957f}, + {-0.167339f, -0.021635f, +0.004681f}, + {-0.071079f, -0.008355f, -0.004673f}, + {+0.149092f, +0.004738f, +0.000445f}, + {+0.269948f, -0.002632f, -0.000196f}, + {+0.088484f, +0.013962f, +0.000022f}, + {-0.080315f, -0.009623f, -0.002700f}, + {+0.315546f, +0.000498f, +0.000137f} + }, + { + {-0.214030f, +0.010451f, +0.001827f}, + {+0.638609f, -0.024424f, -0.004195f}, + {-0.000480f, +0.033426f, -0.002795f}, + {-0.011678f, +0.017775f, -0.002438f}, + {+0.092630f, -0.011217f, +0.001499f}, + {+0.179494f, -0.027872f, +0.004886f}, + {+0.049375f, -0.006195f, +0.000322f}, + {-0.050886f, +0.014806f, +0.001580f}, + {+0.284102f, -0.013452f, -0.000223f} + }, + { + {-0.142407f, -0.012908f, -0.000129f}, + {+0.521031f, +0.021513f, -0.002424f}, + {+0.212730f, -0.053828f, -0.007313f}, + {+0.050092f, -0.009707f, -0.001567f}, + {+0.022713f, +0.014891f, +0.001899f}, + {+0.013352f, +0.051652f, +0.004824f}, + {+0.034982f, -0.000584f, +0.002038f}, + {-0.037735f, -0.000643f, +0.005700f}, + {+0.234664f, +0.015884f, -0.002619f} + }, + { + {-0.078162f, +0.013149f, +0.000240f}, + {+0.425304f, -0.016123f, -0.001883f}, + {+0.408229f, +0.052323f, -0.001957f}, + {+0.116415f, +0.013525f, -0.004497f}, + {-0.067314f, -0.020251f, +0.003762f}, + {-0.167553f, -0.051767f, -0.000869f}, + {+0.068137f, +0.009479f, +0.001235f}, + {-0.034203f, -0.008399f, +0.003763f}, + {+0.180796f, -0.011205f, -0.003598f} + }, + { + {-0.016750f, -0.012127f, +0.000498f}, + {+0.353965f, +0.008335f, -0.000653f}, + {+0.518342f, -0.011173f, +0.002964f}, + {+0.177026f, -0.019969f, -0.002705f}, + {-0.164814f, +0.026646f, +0.003238f}, + {-0.286213f, +0.012718f, -0.003816f}, + {+0.155640f, -0.020546f, -0.001850f}, + {-0.016416f, +0.003918f, -0.001774f}, + {+0.133919f, +0.003314f, -0.001822f} + }, + { + {+0.046182f, +0.012351f, -0.000034f}, + {+0.298885f, -0.009039f, +0.000810f}, + {+0.511610f, -0.032188f, -0.002291f}, + {+0.211380f, +0.005455f, +0.000933f}, + {-0.241218f, -0.015123f, +0.001103f}, + {-0.293508f, +0.029470f, +0.003051f}, + {+0.280548f, +0.030234f, -0.004368f}, + {+0.041260f, +0.018979f, -0.004541f}, + {+0.098998f, +0.002094f, +0.002904f} + }, + { + {+0.111605f, -0.013530f, -0.000652f}, + {+0.246690f, +0.016108f, -0.001020f}, + {+0.413977f, +0.038179f, -0.009520f}, + {+0.203190f, +0.017508f, -0.002191f}, + {-0.268601f, -0.003682f, +0.001755f}, + {-0.196136f, -0.036857f, +0.009761f}, + {+0.402137f, -0.026686f, -0.005055f}, + {+0.145035f, -0.035432f, -0.001365f}, + {+0.074946f, +0.007868f, +0.004954f} + }, + { + {+0.176108f, +0.013431f, -0.000958f}, + {+0.185298f, -0.016846f, -0.004677f}, + {+0.286889f, -0.019450f, -0.007487f}, + {+0.153787f, -0.015814f, -0.006505f}, + {-0.239195f, +0.011851f, +0.001930f}, + {-0.042102f, +0.023553f, +0.004947f}, + {+0.470133f, +0.012898f, -0.003624f}, + {+0.270107f, +0.025928f, -0.000154f}, + {+0.059116f, -0.020434f, -0.003101f} + }, + { + {+0.234033f, -0.013522f, -0.000160f}, + {+0.105917f, +0.008837f, -0.002769f}, + {+0.184987f, +0.008247f, -0.000624f}, + {+0.076510f, +0.005900f, -0.001804f}, + {-0.166708f, -0.022644f, +0.001485f}, + {+0.112604f, -0.020438f, -0.005184f}, + {+0.450824f, +0.006092f, +0.002002f}, + {+0.374333f, -0.013645f, -0.004183f}, + {+0.050668f, -0.002470f, -0.009849f} + }, + { + {+0.280701f, +0.008633f, +0.001045f}, + {+0.002220f, -0.016553f, +0.003998f}, + {+0.131643f, -0.003842f, +0.001872f}, + {-0.015690f, -0.016479f, +0.005047f}, + {-0.077685f, +0.023492f, +0.003551f}, + {+0.223388f, +0.024340f, -0.007042f}, + {+0.346787f, -0.042038f, +0.003586f}, + {+0.418985f, +0.005219f, -0.005591f}, + {+0.040023f, +0.024273f, +0.000362f} + }, + { + {+0.315972f, -0.002222f, +0.000114f}, + {-0.123110f, +0.036764f, +0.004764f}, + {+0.119199f, -0.002064f, +0.000988f}, + {-0.106689f, +0.025325f, +0.004605f}, + {+0.000310f, -0.007517f, +0.002748f}, + {+0.262374f, -0.010338f, -0.000067f}, + {+0.204029f, +0.052292f, -0.005305f}, + {+0.380172f, +0.016758f, -0.003741f}, + {+0.003388f, +0.008217f, +0.011667f} + }, + { + {+0.346296f, +0.003536f, -0.001898f}, + {-0.248976f, -0.036524f, -0.001389f}, + {+0.120849f, +0.002931f, +0.000722f}, + {-0.173186f, -0.016622f, +0.000289f}, + {+0.054827f, +0.000181f, -0.002418f}, + {+0.225358f, -0.023135f, +0.002820f}, + {+0.091375f, -0.014867f, -0.010230f}, + {+0.260139f, -0.034357f, -0.002468f}, + {-0.068405f, -0.042485f, +0.005111f} + }, + { + {+0.379862f, -0.009494f, -0.001961f}, + {-0.345947f, +0.013885f, -0.004347f}, + {+0.108945f, +0.001609f, +0.002277f}, + {-0.194971f, -0.005237f, -0.000216f}, + {+0.090631f, -0.007307f, -0.004497f}, + {+0.139916f, +0.036851f, -0.003429f}, + {+0.049457f, -0.016676f, -0.004125f}, + {+0.089658f, +0.040648f, -0.001276f}, + {-0.147747f, +0.028109f, -0.006357f} + }, + { + {+0.419521f, +0.011992f, -0.000293f}, + {-0.399888f, +0.006995f, +0.000613f}, + {+0.071268f, -0.013451f, +0.003383f}, + {-0.169244f, +0.016170f, +0.002968f}, + {+0.116230f, +0.009802f, -0.001756f}, + {+0.053621f, -0.017175f, -0.008163f}, + {+0.065166f, +0.025359f, +0.005381f}, + {-0.086447f, -0.037823f, -0.001051f}, + {-0.194782f, +0.007204f, -0.005393f} + }, + { + {+0.461674f, -0.009238f, +0.000744f}, + {-0.422873f, -0.002942f, +0.006024f}, + {+0.017965f, +0.019932f, +0.001068f}, + {-0.112940f, -0.014296f, +0.003691f}, + {+0.135675f, -0.004946f, +0.000913f}, + {+0.001359f, -0.007810f, -0.003619f}, + {+0.090834f, -0.000688f, +0.008234f}, + {-0.227027f, +0.020653f, -0.000262f}, + {-0.193552f, -0.020886f, +0.003761f} + }, + { + {+0.500543f, +0.004460f, -0.000339f}, + {-0.438946f, -0.008173f, +0.005382f}, + {-0.025063f, -0.012096f, -0.002727f}, + {-0.048264f, +0.016297f, +0.004137f}, + {+0.148356f, -0.006714f, -0.001928f}, + {-0.016069f, +0.011271f, +0.004203f}, + {+0.085225f, -0.019738f, +0.001763f}, + {-0.310418f, -0.002136f, +0.003576f}, + {-0.158213f, +0.011793f, +0.008536f} + }, + { + {+0.533110f, -0.005084f, -0.001776f}, + {-0.463561f, +0.015347f, +0.000549f}, + {-0.035070f, -0.007804f, -0.002842f}, + {+0.008595f, -0.003050f, +0.002916f}, + {+0.153491f, -0.002287f, -0.004867f}, + {-0.021318f, -0.000337f, +0.007722f}, + {+0.040490f, +0.023364f, -0.005685f}, + {-0.339640f, -0.004014f, +0.007635f}, + {-0.113068f, +0.002471f, +0.003970f} + }, + { + {+0.559507f, +0.006521f, -0.001337f}, + {-0.495821f, -0.006508f, -0.001808f}, + {-0.009393f, +0.020033f, +0.002230f}, + {+0.057093f, +0.005006f, -0.000599f}, + {+0.147824f, +0.005127f, -0.001599f}, + {-0.035200f, -0.017556f, +0.003623f}, + {-0.026148f, -0.010270f, -0.006517f}, + {-0.331865f, -0.002383f, +0.006123f}, + {-0.069791f, +0.006016f, -0.000948f} + }, + { + {+0.580524f, -0.004095f, -0.000494f}, + {-0.527187f, +0.003574f, -0.000131f}, + {+0.034392f, -0.012275f, +0.006324f}, + {+0.108521f, -0.008134f, -0.002780f}, + {+0.124651f, +0.003736f, +0.002434f}, + {-0.058607f, +0.013665f, -0.003392f}, + {-0.096848f, +0.005058f, -0.001324f}, + {-0.301438f, -0.004261f, +0.001796f}, + {-0.026983f, -0.008052f, -0.001333f} + }, + { + {+0.597812f, +0.002656f, -0.000522f}, + {-0.552363f, -0.003313f, +0.001014f}, + {+0.075214f, -0.005271f, +0.002238f}, + {+0.170571f, +0.018162f, -0.002847f}, + {+0.083934f, -0.017743f, +0.001407f}, + {-0.076846f, +0.004888f, -0.003003f}, + {-0.166265f, -0.007573f, +0.004024f}, + {-0.256165f, +0.011081f, +0.000547f}, + {+0.019750f, +0.010957f, -0.001327f} + }, + { + {+0.613921f, -0.002403f, -0.000945f}, + {-0.571681f, +0.004061f, +0.000722f}, + {+0.106010f, -0.000496f, -0.004030f}, + {+0.238299f, -0.018447f, -0.000821f}, + {+0.038282f, +0.014684f, -0.002501f}, + {-0.080622f, -0.007409f, +0.002126f}, + {-0.235224f, +0.017619f, +0.005449f}, + {-0.203255f, -0.012695f, +0.000929f}, + {+0.070865f, -0.011018f, -0.001639f} + }, + { + {+0.630982f, +0.003698f, -0.001234f}, + {-0.590355f, -0.003219f, +0.000406f}, + {+0.130676f, +0.011921f, -0.002723f}, + {+0.295756f, +0.013516f, +0.001143f}, + {+0.005092f, -0.003596f, -0.003545f}, + {-0.072459f, -0.000272f, +0.002800f}, + {-0.299780f, -0.022696f, +0.001211f}, + {-0.150313f, +0.011501f, +0.001280f}, + {+0.118367f, +0.011753f, -0.001359f} + }, + { + {+0.649444f, -0.004884f, -0.000984f}, + {-0.615054f, +0.005408f, +0.000735f}, + {+0.149940f, -0.006453f, +0.001164f}, + {+0.328584f, -0.000395f, +0.001275f}, + {-0.008438f, -0.005199f, -0.001454f}, + {-0.058218f, +0.000064f, -0.000029f}, + {-0.346981f, +0.007071f, -0.001972f}, + {-0.104327f, -0.007957f, +0.001209f}, + {+0.149121f, -0.004220f, -0.000790f} + }, + { + {+0.667442f, +0.004369f, -0.000509f}, + {-0.649912f, -0.008091f, +0.001108f}, + {+0.160941f, -0.003110f, +0.000358f}, + {+0.335024f, -0.007340f, -0.001370f}, + {-0.010516f, +0.004138f, +0.001016f}, + {-0.042559f, +0.003980f, -0.001022f}, + {-0.366888f, +0.007198f, +0.001062f}, + {-0.068558f, +0.004871f, +0.000722f}, + {+0.153026f, -0.002598f, -0.000878f} + }, + { + {+0.682283f, -0.002839f, -0.000182f}, + {-0.693711f, +0.010677f, +0.001270f}, + {+0.163061f, +0.001749f, -0.001941f}, + {+0.327679f, +0.004372f, -0.003551f}, + {-0.017128f, +0.001449f, +0.002254f}, + {-0.029387f, -0.003404f, -0.000254f}, + {-0.363800f, -0.005157f, +0.004344f}, + {-0.041106f, -0.002019f, -0.000551f}, + {+0.130106f, +0.008236f, -0.000670f} + }, + { + {+0.692437f, +0.000095f, -0.000537f}, + {-0.740634f, -0.011604f, +0.000655f}, + {+0.157996f, +0.002060f, -0.000837f}, + {+0.323158f, +0.005481f, -0.001955f}, + {-0.039932f, -0.012585f, +0.000817f}, + {-0.021634f, +0.000010f, -0.000230f}, + {-0.350228f, -0.000420f, +0.003173f}, + {-0.016658f, +0.005630f, -0.001178f}, + {+0.089943f, -0.012079f, -0.001069f} + }, + { + {+0.698662f, +0.000230f, -0.001425f}, + {-0.782838f, +0.007193f, +0.000387f}, + {+0.147754f, +0.002321f, +0.001054f}, + {+0.330876f, -0.007440f, +0.001734f}, + {-0.078436f, +0.014161f, -0.002562f}, + {-0.020690f, +0.001093f, -0.000930f}, + {-0.336354f, +0.000244f, +0.000495f}, + {+0.007725f, -0.004802f, -0.001236f}, + {+0.047620f, +0.008277f, -0.001417f} + }, + { + {+0.703246f, +0.002409f, -0.001250f}, + {-0.814977f, -0.003204f, +0.001382f}, + {+0.135217f, -0.009385f, -0.001169f}, + {+0.350177f, -0.000838f, +0.000877f}, + {-0.122288f, -0.004476f, -0.002216f}, + {-0.025713f, +0.002869f, +0.000621f}, + {-0.325782f, +0.004520f, +0.000748f}, + {+0.030650f, +0.008462f, -0.000266f}, + {+0.015647f, -0.003005f, -0.000601f} + }, + { + {+0.707436f, -0.002159f, -0.000184f}, + {-0.836328f, +0.001420f, +0.002805f}, + {+0.124343f, +0.003534f, -0.004617f}, + {+0.377173f, -0.003128f, -0.002966f}, + {-0.162938f, +0.001908f, +0.001890f}, + {-0.034346f, +0.001148f, +0.003196f}, + {-0.317600f, -0.001145f, +0.002065f}, + {+0.047783f, -0.002726f, +0.001091f}, + {-0.001518f, -0.002014f, +0.001386f} + }, + { + {+0.711316f, +0.000190f, +0.000116f}, + {-0.849400f, -0.005461f, +0.002132f}, + {+0.115220f, +0.006522f, -0.002677f}, + {+0.406205f, +0.009733f, -0.003200f}, + {-0.198229f, -0.008830f, +0.003296f}, + {-0.041723f, -0.007295f, +0.001797f}, + {-0.307751f, -0.000513f, +0.001061f}, + {+0.056384f, -0.001852f, +0.000252f}, + {-0.007409f, -0.002688f, +0.001636f} + }, + { + {+0.715564f, +0.000878f, -0.000712f}, + {-0.856145f, +0.001865f, +0.000304f}, + {+0.099717f, +0.000516f, +0.001510f}, + {+0.427792f, -0.008621f, -0.000103f}, + {-0.227122f, +0.009743f, +0.000742f}, + {-0.038969f, -0.000573f, -0.000890f}, + {-0.290500f, -0.003837f, -0.000282f}, + {+0.060351f, +0.002258f, -0.001388f}, + {-0.007102f, +0.000681f, +0.000051f} + }, + { + {+0.721724f, +0.001440f, -0.001419f}, + {-0.857928f, +0.002494f, +0.000723f}, + {+0.068940f, -0.015230f, +0.000407f}, + {+0.432906f, -0.004606f, +0.000685f}, + {-0.246924f, -0.000678f, -0.000115f}, + {-0.019686f, +0.012823f, +0.000958f}, + {-0.263371f, +0.009394f, +0.000248f}, + {+0.066836f, +0.001658f, -0.002275f}, + {-0.003255f, +0.001689f, -0.000037f} + }, + { + {+0.730712f, -0.003910f, -0.000870f}, + {-0.858450f, -0.001220f, +0.001946f}, + {+0.023475f, +0.016216f, -0.003883f}, + {+0.419872f, +0.011121f, -0.002752f}, + {-0.256682f, -0.002820f, +0.002128f}, + {+0.013513f, -0.011639f, +0.004607f}, + {-0.229180f, -0.009683f, +0.001814f}, + {+0.080511f, -0.005798f, -0.001723f}, + {+0.001435f, +0.000756f, -0.000451f} + }, + { + {+0.741590f, +0.003101f, -0.000011f}, + {-0.860726f, +0.000300f, +0.002853f}, + {-0.028493f, -0.003694f, -0.002869f}, + {+0.395211f, -0.003270f, -0.003914f}, + {-0.257602f, -0.001422f, +0.002810f}, + {+0.053057f, +0.000570f, +0.002860f}, + {-0.193999f, +0.002947f, +0.000888f}, + {+0.099824f, +0.006425f, -0.000616f}, + {+0.005522f, +0.002697f, -0.000570f} + }, + { + {+0.752785f, -0.000581f, -0.000328f}, + {-0.864679f, +0.002652f, +0.003144f}, + {-0.079249f, -0.003995f, +0.005777f}, + {+0.366044f, -0.005911f, +0.001913f}, + {-0.251095f, +0.009072f, -0.002248f}, + {+0.092600f, +0.005125f, -0.005522f}, + {-0.162554f, -0.001717f, -0.002557f}, + {+0.119626f, -0.005564f, +0.000516f}, + {+0.008439f, -0.004393f, +0.001712f} + }, + { + {+0.763163f, -0.000862f, -0.002020f}, + {-0.868650f, -0.005188f, +0.001363f}, + {-0.122932f, -0.003612f, +0.014766f}, + {+0.337176f, +0.004705f, +0.011739f}, + {-0.240301f, -0.007676f, -0.011938f}, + {+0.125784f, +0.004581f, -0.013027f}, + {-0.137073f, +0.006965f, -0.003725f}, + {+0.136715f, +0.001962f, +0.001072f}, + {+0.010881f, +0.001506f, +0.004158f} + } +}; + +const float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +{ + { + {-0.067351f, +0.619497f, -0.224314f}, + {+0.139294f, -0.771571f, +0.258097f}, + {-0.003713f, +0.028657f, -0.008450f}, + {-0.024048f, +0.069155f, -0.020553f}, + {+0.025678f, +0.026025f, -0.019233f}, + {+0.009936f, +0.011063f, -0.007565f}, + {+0.034483f, +0.043638f, -0.029489f}, + {+0.006138f, -0.086263f, +0.038216f}, + {+0.046480f, +0.249243f, -0.117268f} + }, + { + {+0.012648f, +0.734658f, -0.184512f}, + {+0.111037f, -0.538674f, +0.336987f}, + {-0.002627f, -0.020803f, -0.029183f}, + {-0.030921f, +0.004858f, -0.041299f}, + {+0.051115f, +0.078198f, -0.009636f}, + {+0.016252f, +0.028855f, -0.008268f}, + {+0.084591f, +0.153968f, -0.000650f}, + {-0.017068f, -0.206982f, -0.012636f}, + {+0.164507f, +0.469681f, -0.054789f} + }, + { + {+0.223221f, -0.320495f, +0.172323f}, + {-0.327663f, +0.928806f, -0.128055f}, + {+0.019358f, -0.074304f, -0.015400f}, + {+0.035210f, -0.082508f, -0.021387f}, + {+0.001915f, -0.019754f, +0.041779f}, + {-0.009482f, +0.004447f, +0.006672f}, + {+0.039341f, +0.054366f, +0.052326f}, + {-0.015501f, -0.146235f, -0.037803f}, + {+0.140215f, +0.011558f, +0.133087f} + }, + { + {+0.158118f, -0.393316f, +0.132368f}, + {-0.546868f, +0.311888f, -0.284518f}, + {+0.031012f, +0.036496f, +0.023744f}, + {+0.107357f, +0.078785f, +0.019930f}, + {-0.117669f, -0.168393f, +0.014741f}, + {-0.063269f, -0.132935f, -0.029018f}, + {-0.110215f, -0.232883f, -0.026283f}, + {+0.026325f, -0.007643f, +0.015801f}, + {-0.156350f, -0.444539f, +0.006974f} + }, + { + {-0.158057f, +0.298412f, -0.065118f}, + {-0.180062f, -0.634611f, +0.013767f}, + {-0.011461f, +0.071086f, +0.018569f}, + {+0.074813f, +0.048439f, +0.032538f}, + {-0.176343f, +0.017086f, -0.039934f}, + {-0.070878f, -0.087909f, -0.042882f}, + {-0.196698f, -0.095181f, -0.059079f}, + {+0.043237f, +0.006669f, +0.001955f}, + {-0.440379f, +0.000452f, -0.098398f} + }, + { + {-0.449468f, +0.042993f, -0.088093f}, + {+0.450454f, +0.142745f, +0.162071f}, + {-0.082857f, -0.081326f, -0.023342f}, + {-0.091693f, -0.115333f, +0.002878f}, + {-0.059625f, +0.113643f, -0.022660f}, + {-0.002551f, +0.114733f, +0.021413f}, + {-0.134830f, +0.127944f, +0.015214f}, + {+0.039406f, -0.002734f, -0.000806f}, + {-0.456803f, +0.175205f, -0.017055f} + }, + { + {-0.521027f, -0.156261f, +0.000350f}, + {+0.908889f, +0.180570f, +0.051670f}, + {-0.108770f, -0.053291f, -0.027241f}, + {-0.287995f, +0.046150f, -0.015860f}, + {+0.175042f, -0.108856f, +0.012453f}, + {+0.059786f, +0.044325f, +0.033874f}, + {-0.008998f, -0.011671f, +0.039397f}, + {+0.004422f, -0.001021f, +0.005255f}, + {-0.225556f, -0.103116f, +0.036951f} + }, + { + {-0.371766f, +0.087065f, +0.052523f}, + {+1.010425f, -0.130810f, -0.067243f}, + {-0.070822f, +0.064314f, +0.008682f}, + {-0.381257f, -0.000635f, -0.013290f}, + {+0.375703f, +0.033440f, +0.023774f}, + {+0.081888f, -0.060050f, -0.009146f}, + {+0.099530f, -0.054172f, +0.002402f}, + {-0.055187f, -0.030383f, +0.004615f}, + {+0.113698f, +0.047344f, +0.023699f} + }, + { + {-0.133153f, +0.006407f, +0.034476f}, + {+0.837054f, -0.001398f, -0.067755f}, + {-0.019596f, -0.013995f, +0.025797f}, + {-0.306127f, -0.073720f, -0.002010f}, + {+0.417535f, +0.051347f, +0.011222f}, + {+0.096752f, -0.015410f, -0.024298f}, + {+0.165604f, -0.014311f, -0.020675f}, + {-0.110129f, +0.012754f, -0.001173f}, + {+0.396896f, -0.022479f, +0.001703f} + }, + { + {+0.076154f, -0.015041f, -0.005731f}, + {+0.558795f, +0.016178f, -0.011329f}, + {+0.001783f, -0.050805f, +0.008376f}, + {-0.100163f, +0.081596f, +0.016700f}, + {+0.287003f, -0.097687f, -0.016950f}, + {+0.130328f, +0.051441f, -0.002818f}, + {+0.194137f, +0.028286f, -0.006100f}, + {-0.128998f, -0.007273f, -0.004964f}, + {+0.525370f, -0.013001f, -0.010543f} + }, + { + {+0.227729f, -0.027128f, -0.019508f}, + {+0.280803f, +0.046474f, +0.016340f}, + {+0.006184f, +0.007629f, -0.010663f}, + {+0.124161f, -0.022132f, +0.014831f}, + {+0.082170f, +0.023992f, -0.023358f}, + {+0.168199f, -0.000379f, +0.008102f}, + {+0.185287f, +0.007140f, +0.002454f}, + {-0.098830f, -0.034738f, -0.000610f}, + {+0.505599f, +0.024919f, -0.016122f} + }, + { + {+0.345183f, +0.044417f, -0.008489f}, + {+0.029206f, -0.069971f, +0.008062f}, + {+0.040780f, +0.025656f, -0.005557f}, + {+0.280661f, +0.000086f, -0.001939f}, + {-0.091189f, +0.001516f, -0.001765f}, + {+0.178051f, -0.018186f, -0.003683f}, + {+0.147526f, -0.011735f, +0.000472f}, + {-0.034700f, +0.017373f, +0.007552f}, + {+0.404231f, -0.018810f, -0.013580f} + }, + { + {+0.447376f, -0.029945f, +0.002359f}, + {-0.196485f, +0.048776f, -0.000528f}, + {+0.131413f, -0.031345f, +0.001264f}, + {+0.352086f, -0.000092f, -0.009252f}, + {-0.196164f, +0.010102f, +0.008244f}, + {+0.137927f, +0.001411f, -0.005445f}, + {+0.094224f, +0.013361f, +0.000776f}, + {+0.030220f, +0.002376f, +0.001349f}, + {+0.282599f, +0.004869f, -0.002937f} + }, + { + {+0.532898f, +0.008836f, +0.002166f}, + {-0.392609f, -0.034792f, +0.000679f}, + {+0.270895f, +0.030297f, -0.000156f}, + {+0.364913f, -0.004283f, -0.009820f}, + {-0.243967f, -0.002627f, +0.007384f}, + {+0.037047f, -0.017787f, +0.004491f}, + {+0.041930f, -0.015182f, -0.000239f}, + {+0.078287f, +0.007042f, -0.004821f}, + {+0.167608f, -0.019027f, +0.005545f} + }, + { + {+0.594888f, -0.002438f, -0.003208f}, + {-0.547092f, +0.023930f, +0.003204f}, + {+0.418638f, -0.023295f, -0.006545f}, + {+0.358947f, -0.011193f, -0.005371f}, + {-0.268043f, +0.007992f, +0.005934f}, + {-0.108159f, +0.040803f, +0.007847f}, + {+0.014237f, +0.000657f, -0.000908f}, + {+0.104780f, -0.013359f, -0.000511f}, + {+0.064568f, +0.028680f, +0.003338f} + }, + { + {+0.635005f, +0.006702f, -0.005006f}, + {-0.650934f, -0.013984f, +0.004474f}, + {+0.519015f, +0.020899f, -0.008786f}, + {+0.354058f, +0.000065f, -0.000944f}, + {-0.293166f, -0.009243f, +0.003786f}, + {-0.244478f, -0.036317f, +0.004273f}, + {+0.027137f, +0.008991f, +0.000305f}, + {+0.112434f, -0.002933f, +0.003310f}, + {-0.019782f, -0.018420f, -0.000608f} + }, + { + {+0.661388f, -0.006850f, -0.003249f}, + {-0.709859f, +0.007935f, +0.004126f}, + {+0.524557f, -0.002414f, -0.002080f}, + {+0.344994f, +0.003888f, -0.002639f}, + {-0.316812f, +0.006036f, +0.003412f}, + {-0.307717f, +0.012550f, -0.001272f}, + {+0.076841f, -0.011681f, -0.000880f}, + {+0.115864f, +0.008381f, -0.000189f}, + {-0.078312f, +0.007256f, -0.000761f} + }, + { + {+0.681780f, +0.004317f, -0.002114f}, + {-0.740600f, -0.002506f, +0.003738f}, + {+0.416864f, -0.038264f, +0.003168f}, + {+0.319577f, -0.000792f, -0.001313f}, + {-0.319873f, -0.002666f, +0.002245f}, + {-0.258538f, +0.029824f, -0.003409f}, + {+0.141548f, +0.012818f, -0.003839f}, + {+0.135337f, +0.001218f, -0.005061f}, + {-0.109830f, +0.001645f, +0.001441f} + }, + { + {+0.699871f, -0.003221f, -0.002308f}, + {-0.762514f, +0.004609f, +0.003814f}, + {+0.225434f, +0.064939f, -0.001450f}, + {+0.266431f, +0.012897f, +0.002255f}, + {-0.282175f, -0.010311f, -0.000422f}, + {-0.108713f, -0.058556f, +0.002399f}, + {+0.186968f, -0.009396f, -0.004807f}, + {+0.178376f, -0.016506f, -0.006062f}, + {-0.120383f, -0.003023f, +0.004088f} + }, + { + {+0.714529f, +0.003253f, -0.002414f}, + {-0.790696f, -0.011388f, +0.001985f}, + {+0.020833f, -0.046458f, -0.007156f}, + {+0.185944f, -0.029249f, +0.000016f}, + {-0.197551f, +0.028731f, +0.000138f}, + {+0.079181f, +0.043101f, +0.006863f}, + {+0.176963f, -0.004258f, -0.002861f}, + {+0.228839f, +0.021085f, -0.002090f}, + {-0.119574f, -0.002646f, +0.004158f} + }, + { + {+0.721602f, -0.001258f, -0.002069f}, + {-0.831027f, +0.010846f, -0.000173f}, + {-0.126177f, +0.009153f, -0.003439f}, + {+0.096173f, +0.020892f, -0.003906f}, + {-0.084227f, -0.027335f, +0.001653f}, + {+0.229925f, -0.010207f, +0.000875f}, + {+0.090658f, +0.023511f, +0.000256f}, + {+0.250703f, +0.000323f, +0.000133f}, + {-0.115659f, +0.011998f, -0.001947f} + }, + { + {+0.717593f, -0.001188f, -0.001513f}, + {-0.881199f, -0.003795f, +0.002266f}, + {-0.186085f, +0.008805f, +0.004207f}, + {+0.021886f, +0.000682f, +0.000980f}, + {+0.024639f, +0.019808f, +0.000274f}, + {+0.296639f, -0.006775f, -0.008463f}, + {-0.060930f, -0.036828f, +0.003817f}, + {+0.210581f, -0.022700f, -0.003357f}, + {-0.112881f, +0.004715f, -0.006188f} + }, + { + {+0.702872f, +0.004202f, -0.000899f}, + {-0.934393f, +0.006557f, +0.007476f}, + {-0.176147f, -0.010014f, +0.006716f}, + {-0.022135f, +0.003624f, +0.007346f}, + {+0.100594f, -0.012448f, -0.000135f}, + {+0.271960f, +0.005598f, -0.007977f}, + {-0.233701f, +0.046766f, +0.003616f}, + {+0.101020f, +0.023227f, -0.002321f}, + {-0.116785f, -0.020405f, +0.002997f} + }, + { + {+0.682250f, -0.007566f, -0.001501f}, + {-0.978417f, -0.017585f, +0.006636f}, + {-0.137592f, +0.005047f, +0.003880f}, + {-0.028458f, -0.006826f, +0.004609f}, + {+0.129898f, -0.005880f, -0.001391f}, + {+0.175874f, -0.016526f, +0.001013f}, + {-0.367276f, -0.033929f, -0.002775f}, + {-0.060514f, -0.037887f, +0.002465f}, + {-0.137333f, -0.006964f, +0.011955f} + }, + { + {+0.663415f, +0.004606f, -0.002781f}, + {-0.993852f, +0.009178f, -0.000038f}, + {-0.108250f, -0.003270f, +0.001437f}, + {+0.009848f, -0.008477f, -0.000681f}, + {+0.118923f, +0.012268f, -0.005212f}, + {+0.044501f, +0.037572f, +0.003962f}, + {-0.416290f, -0.006378f, -0.006076f}, + {-0.236610f, +0.040350f, +0.002858f}, + {-0.168887f, +0.032800f, +0.004036f} + }, + { + {+0.651781f, +0.001152f, -0.002457f}, + {-0.965546f, +0.016499f, -0.002125f}, + {-0.105651f, -0.001646f, +0.002481f}, + {+0.090167f, +0.025763f, -0.001130f}, + {+0.087686f, -0.003999f, -0.005549f}, + {-0.075223f, -0.035790f, -0.002847f}, + {-0.383115f, +0.037796f, +0.001566f}, + {-0.378556f, -0.025237f, +0.002287f}, + {-0.179845f, -0.008941f, -0.008124f} + }, + { + {+0.645685f, -0.002682f, -0.000593f}, + {-0.900401f, -0.029783f, +0.003285f}, + {-0.124380f, +0.012275f, +0.001822f}, + {+0.193225f, -0.027406f, +0.000945f}, + {+0.052400f, -0.001580f, -0.000684f}, + {-0.141411f, -0.002262f, -0.004491f}, + {-0.319576f, -0.023501f, +0.010635f}, + {-0.448327f, +0.001574f, +0.004044f}, + {-0.141908f, -0.032139f, -0.005596f} + }, + { + {+0.638137f, -0.002412f, +0.000310f}, + {-0.826423f, +0.017144f, +0.007574f}, + {-0.140725f, -0.006104f, -0.000815f}, + {+0.290930f, +0.019453f, +0.001904f}, + {+0.016875f, -0.009182f, +0.001656f}, + {-0.145675f, +0.017736f, +0.001807f}, + {-0.285941f, -0.010851f, +0.008570f}, + {-0.435070f, +0.011023f, +0.004307f}, + {-0.062178f, +0.036767f, +0.005654f} + }, + { + {+0.623287f, +0.007299f, -0.001056f}, + {-0.770521f, +0.001075f, +0.004559f}, + {-0.130645f, -0.003274f, -0.002902f}, + {+0.361351f, -0.005902f, +0.000348f}, + {-0.020477f, +0.011841f, -0.000752f}, + {-0.114514f, -0.018145f, +0.007488f}, + {-0.305625f, +0.026256f, -0.000446f}, + {-0.353862f, -0.030431f, +0.004835f}, + {+0.024417f, -0.010793f, +0.007820f} + }, + { + {+0.600902f, -0.006021f, -0.002348f}, + {-0.739248f, -0.005015f, -0.001571f}, + {-0.087167f, +0.021027f, -0.001847f}, + {+0.400187f, +0.000286f, -0.002317f}, + {-0.060945f, -0.009244f, -0.002589f}, + {-0.083328f, -0.001928f, +0.007725f}, + {-0.359405f, -0.019595f, -0.006438f}, + {-0.237042f, +0.027090f, +0.006659f}, + {+0.089013f, -0.004244f, -0.000128f} + }, + { + {+0.574438f, +0.003368f, -0.001494f}, + {-0.720431f, -0.005878f, -0.002928f}, + {-0.025553f, -0.022088f, +0.002875f}, + {+0.419048f, +0.001480f, -0.004334f}, + {-0.105303f, +0.000852f, +0.000385f}, + {-0.070507f, +0.013892f, +0.000793f}, + {-0.411663f, -0.001662f, -0.003755f}, + {-0.118815f, -0.013893f, +0.002937f}, + {+0.127181f, -0.002212f, -0.005490f} + }, + { + {+0.546941f, -0.004959f, -0.000239f}, + {-0.700235f, +0.009986f, +0.000285f}, + {+0.026874f, +0.006811f, +0.004565f}, + {+0.432826f, +0.004148f, -0.005149f}, + {-0.153860f, -0.009932f, +0.004309f}, + {-0.067445f, -0.005555f, -0.005512f}, + {-0.441084f, +0.007824f, +0.003852f}, + {-0.016912f, +0.012081f, -0.003174f}, + {+0.148914f, +0.007013f, -0.004323f} + }, + { + {+0.520436f, +0.006384f, -0.000382f}, + {-0.674657f, -0.006620f, +0.001998f}, + {+0.052406f, +0.010142f, -0.000198f}, + {+0.447102f, -0.009070f, -0.003159f}, + {-0.202135f, +0.018081f, +0.002032f}, + {-0.055887f, -0.014144f, -0.003615f}, + {-0.448314f, -0.001324f, +0.007309f}, + {+0.065957f, -0.020607f, -0.003258f}, + {+0.162472f, -0.004875f, -0.002127f} + }, + { + {+0.496665f, -0.004859f, -0.000887f}, + {-0.647428f, +0.004741f, +0.001434f}, + {+0.053060f, -0.007546f, -0.006118f}, + {+0.453309f, +0.004051f, -0.000324f}, + {-0.237178f, -0.009221f, -0.002058f}, + {-0.029969f, +0.014850f, +0.002643f}, + {-0.439805f, -0.002523f, +0.005619f}, + {+0.128558f, +0.010056f, -0.001511f}, + {+0.167737f, +0.001236f, -0.001456f} + }, + { + {+0.475983f, +0.003710f, -0.000970f}, + {-0.624608f, -0.003603f, +0.000812f}, + {+0.042149f, -0.008534f, -0.003432f}, + {+0.438672f, +0.005526f, +0.000965f}, + {-0.249063f, -0.004782f, -0.002016f}, + {+0.000807f, -0.001028f, +0.002841f}, + {-0.416440f, +0.003745f, +0.000359f}, + {+0.170217f, -0.009457f, -0.000867f}, + {+0.158107f, +0.002167f, -0.000901f} + }, + { + {+0.456962f, -0.002559f, -0.000574f}, + {-0.609653f, +0.002905f, +0.001117f}, + {+0.025784f, -0.000666f, +0.002060f}, + {+0.399694f, -0.014955f, +0.000161f}, + {-0.242149f, +0.009905f, +0.001262f}, + {+0.026686f, -0.000156f, -0.001218f}, + {-0.373014f, +0.013273f, -0.002730f}, + {+0.191984f, -0.000973f, -0.000838f}, + {+0.127455f, -0.008313f, +0.000023f} + }, + { + {+0.437008f, +0.003925f, -0.000081f}, + {-0.601093f, -0.000232f, +0.001372f}, + {+0.002960f, +0.010345f, +0.001054f}, + {+0.347170f, +0.016956f, -0.002319f}, + {-0.233004f, -0.002825f, +0.003373f}, + {+0.044339f, -0.004384f, -0.002020f}, + {-0.309506f, -0.024368f, +0.000882f}, + {+0.198003f, -0.000405f, -0.001486f}, + {+0.077236f, +0.014350f, -0.000034f} + }, + { + {+0.414109f, -0.005431f, -0.000037f}, + {-0.592705f, +0.001470f, +0.001222f}, + {-0.024584f, -0.008451f, -0.001721f}, + {+0.300043f, -0.007510f, -0.003376f}, + {-0.236922f, -0.005189f, +0.002904f}, + {+0.053435f, +0.002953f, -0.000365f}, + {-0.239443f, +0.015553f, +0.003945f}, + {+0.195817f, -0.003961f, -0.001987f}, + {+0.019225f, -0.012398f, -0.000024f} + }, + { + {+0.388577f, +0.006627f, -0.000411f}, + {-0.576851f, -0.002898f, +0.000753f}, + {-0.052952f, +0.001666f, -0.000781f}, + {+0.271771f, -0.002315f, -0.001136f}, + {-0.256751f, +0.010892f, +0.000933f}, + {+0.055321f, +0.000623f, +0.000321f}, + {-0.178829f, -0.004699f, +0.001577f}, + {+0.192108f, -0.001841f, -0.002156f}, + {-0.030601f, +0.010281f, +0.000029f} + }, + { + {+0.362659f, -0.006023f, -0.001007f}, + {-0.548393f, +0.008477f, +0.000553f}, + {-0.079254f, -0.004768f, +0.001192f}, + {+0.262246f, +0.003901f, +0.002002f}, + {-0.282691f, -0.009035f, -0.001549f}, + {+0.052737f, -0.001616f, -0.000062f}, + {-0.134033f, +0.004191f, -0.001751f}, + {+0.189322f, +0.000295f, -0.001194f}, + {-0.059659f, -0.002213f, -0.000053f} + }, + { + {+0.339002f, +0.002927f, -0.000712f}, + {-0.507223f, -0.011672f, +0.001408f}, + {-0.101892f, +0.008754f, -0.000366f}, + {+0.261016f, +0.005455f, +0.000964f}, + {-0.300336f, -0.003329f, -0.000659f}, + {+0.049601f, -0.001946f, +0.000746f}, + {-0.101681f, -0.008021f, -0.001522f}, + {+0.184646f, -0.000891f, -0.000474f}, + {-0.064232f, -0.004100f, +0.000831f} + }, + { + {+0.318447f, -0.002583f, +0.000342f}, + {-0.458166f, +0.011334f, +0.002134f}, + {-0.119857f, -0.003793f, -0.002673f}, + {+0.257649f, -0.004527f, -0.002750f}, + {-0.302642f, +0.006786f, +0.003304f}, + {+0.050079f, +0.001140f, +0.002294f}, + {-0.075154f, +0.006079f, +0.000154f}, + {+0.175259f, -0.002462f, +0.000450f}, + {-0.050689f, +0.006815f, +0.002112f} + }, + { + {+0.300124f, +0.004647f, +0.000429f}, + {-0.407177f, -0.007551f, +0.001229f}, + {-0.135280f, -0.004904f, -0.000353f}, + {+0.246029f, -0.001362f, -0.002342f}, + {-0.292460f, -0.000038f, +0.003938f}, + {+0.057770f, +0.002994f, +0.000700f}, + {-0.048950f, -0.002677f, -0.000542f}, + {+0.161196f, +0.006930f, -0.000490f}, + {-0.030107f, -0.002304f, +0.001927f} + }, + { + {+0.283695f, -0.004672f, -0.000499f}, + {-0.357931f, +0.007644f, -0.000792f}, + {-0.154465f, -0.001114f, +0.004046f}, + {+0.221394f, -0.002251f, +0.001225f}, + {-0.274104f, -0.001365f, +0.000312f}, + {+0.076006f, +0.003175f, -0.002372f}, + {-0.019797f, +0.006502f, -0.001827f}, + {+0.147944f, -0.003560f, -0.001898f}, + {-0.011081f, -0.000127f, -0.000375f} + }, + { + {+0.269518f, +0.002457f, -0.001001f}, + {-0.311326f, -0.012837f, -0.000327f}, + {-0.181319f, +0.014112f, +0.003014f}, + {+0.182651f, +0.012951f, +0.002036f}, + {-0.248875f, -0.007948f, -0.001266f}, + {+0.104063f, -0.013233f, -0.001219f}, + {+0.010928f, -0.008987f, -0.001152f}, + {+0.141371f, -0.000838f, -0.001781f}, + {+0.004297f, -0.004808f, -0.000787f} + }, + { + {+0.257138f, -0.000471f, -0.000295f}, + {-0.269065f, +0.008971f, +0.001327f}, + {-0.209242f, -0.009445f, -0.000789f}, + {+0.136359f, -0.015642f, -0.000837f}, + {-0.218917f, +0.009939f, +0.000695f}, + {+0.133100f, +0.007332f, +0.001415f}, + {+0.037336f, +0.006071f, +0.000081f}, + {+0.141848f, +0.003924f, -0.000450f}, + {+0.015759f, +0.001304f, -0.000104f} + }, + { + {+0.244594f, +0.002255f, +0.000537f}, + {-0.232039f, -0.006188f, +0.001385f}, + {-0.226456f, -0.005183f, +0.000708f}, + {+0.094177f, +0.004239f, -0.001379f}, + {-0.188550f, -0.003755f, +0.001033f}, + {+0.152408f, +0.005083f, -0.000982f}, + {+0.053373f, +0.001503f, -0.000759f}, + {+0.144008f, -0.001965f, +0.000959f}, + {+0.023577f, -0.002308f, -0.000076f} + }, + { + {+0.229867f, -0.004876f, +0.000170f}, + {-0.197603f, +0.004728f, +0.000560f}, + {-0.226600f, +0.010780f, +0.006854f}, + {+0.064221f, +0.003891f, +0.003122f}, + {-0.161189f, -0.001104f, -0.002261f}, + {+0.157190f, -0.008241f, -0.006888f}, + {+0.056895f, -0.003410f, -0.003127f}, + {+0.141412f, -0.001071f, +0.001644f}, + {+0.029485f, +0.003593f, +0.001358f} + }, + { + {+0.212288f, +0.005142f, -0.000800f}, + {-0.162483f, -0.004117f, -0.001433f}, + {-0.209328f, -0.002547f, +0.009702f}, + {+0.048193f, +0.000129f, +0.007210f}, + {-0.139874f, -0.002121f, -0.005784f}, + {+0.146647f, -0.000237f, -0.009054f}, + {+0.049793f, -0.001403f, -0.002729f}, + {+0.132126f, +0.003164f, +0.002133f}, + {+0.035201f, -0.000152f, +0.002301f} + }, + { + {+0.191599f, -0.002871f, -0.000708f}, + {-0.125250f, +0.008746f, -0.003116f}, + {-0.175384f, -0.002970f, +0.005044f}, + {+0.046507f, -0.009000f, +0.004794f}, + {-0.128202f, +0.013178f, -0.002850f}, + {+0.120273f, +0.005762f, -0.003583f}, + {+0.034030f, -0.000067f, +0.000427f}, + {+0.118790f, -0.004116f, +0.002419f}, + {+0.044052f, -0.001094f, +0.001102f} + } +}; + +#endif + + +#ifndef UPDATE_FASTCONV_SBA_FILTER const float FASTCONV_FOA_latency_s = 0.000666667f; const float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]= { @@ -7110,6 +12951,1224 @@ const float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]= {-0.118370f, +0.031720f, -0.024225f, -0.000048f, +0.000065f} } }; +#else +const float FASTCONV_FOA_latency_s = 0.000020833f; +const float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +{ + { + {+0.181652f, +0.754551f, +0.218658f}, + {+0.313875f, -0.422228f, +0.135528f}, + {+0.014440f, +0.116710f, -0.013575f}, + {+0.042997f, +0.018886f, -0.015597f} + }, + { + {-0.171103f, -0.431000f, -0.158827f}, + {-0.162330f, -1.016290f, +0.055279f}, + {-0.009076f, +0.107488f, -0.010075f}, + {-0.002269f, +0.060685f, +0.014338f} + }, + { + {-0.320265f, -0.250765f, -0.167171f}, + {-0.685853f, +0.069215f, -0.258616f}, + {-0.021745f, +0.080557f, +0.010049f}, + {-0.070084f, +0.090970f, +0.018109f} + }, + { + {-0.090062f, +0.396798f, +0.031329f}, + {-0.547868f, +0.612159f, -0.064837f}, + {-0.014055f, +0.010916f, -0.020054f}, + {-0.104609f, -0.009719f, -0.014645f} + }, + { + {+0.310752f, -0.054756f, +0.106519f}, + {+0.077791f, -0.305320f, +0.144875f}, + {+0.048626f, -0.050345f, -0.007511f}, + {-0.035749f, -0.049561f, -0.008157f} + }, + { + {+0.590278f, -0.119063f, +0.024674f}, + {+0.708076f, -0.088569f, +0.094265f}, + {+0.119880f, +0.048720f, +0.014661f}, + {+0.120422f, +0.058573f, +0.004643f} + }, + { + {+0.638355f, +0.074625f, -0.043889f}, + {+1.048572f, +0.131298f, -0.037692f}, + {+0.143385f, +0.033975f, +0.014623f}, + {+0.293747f, -0.017822f, -0.000451f} + }, + { + {+0.521197f, -0.005266f, -0.041412f}, + {+1.094584f, +0.000210f, -0.073803f}, + {+0.109004f, -0.035628f, -0.003452f}, + {+0.407579f, +0.034241f, -0.002887f} + }, + { + {+0.361479f, -0.014806f, -0.009497f}, + {+0.986770f, -0.046512f, -0.029288f}, + {+0.057809f, +0.027844f, -0.015215f}, + {+0.409283f, +0.014805f, +0.005752f} + }, + { + {+0.229108f, -0.009840f, +0.009477f}, + {+0.839323f, +0.000705f, +0.009034f}, + {+0.036287f, +0.030074f, -0.010227f}, + {+0.293083f, -0.069929f, -0.004421f} + }, + { + {+0.125590f, +0.030181f, +0.007318f}, + {+0.687756f, +0.052219f, +0.009126f}, + {+0.052382f, -0.019274f, +0.003613f}, + {+0.122951f, +0.036356f, -0.013394f} + }, + { + {+0.030890f, -0.030176f, -0.000832f}, + {+0.531513f, -0.048483f, -0.004668f}, + {+0.067811f, -0.004747f, +0.002746f}, + {-0.026040f, -0.009502f, -0.004388f} + }, + { + {-0.062962f, +0.019124f, -0.003537f}, + {+0.376029f, +0.026217f, -0.006323f}, + {+0.042499f, +0.013437f, -0.001738f}, + {-0.120763f, +0.008891f, +0.001968f} + }, + { + {-0.150437f, -0.012367f, -0.001050f}, + {+0.234297f, -0.021072f, -0.000774f}, + {-0.046092f, -0.025628f, -0.001827f}, + {-0.163500f, +0.007913f, +0.005640f} + }, + { + {-0.224579f, +0.011037f, +0.001567f}, + {+0.118032f, +0.020982f, +0.001167f}, + {-0.190587f, +0.031698f, +0.001189f}, + {-0.181600f, +0.008625f, +0.006827f} + }, + { + {-0.283765f, -0.012148f, +0.001665f}, + {+0.031141f, -0.014212f, +0.000704f}, + {-0.354999f, -0.033990f, +0.005051f}, + {-0.201565f, -0.012572f, +0.001547f} + }, + { + {-0.330851f, +0.010110f, +0.000281f}, + {-0.032740f, +0.010680f, +0.000608f}, + {-0.489897f, +0.028555f, +0.005370f}, + {-0.226930f, +0.003469f, +0.000412f} + }, + { + {-0.370651f, -0.006974f, -0.000273f}, + {-0.085140f, -0.009699f, +0.000484f}, + {-0.550417f, -0.008550f, +0.002078f}, + {-0.248676f, -0.002190f, +0.002941f} + }, + { + {-0.408944f, +0.005900f, +0.000497f}, + {-0.135902f, +0.010386f, +0.000573f}, + {-0.516823f, -0.021637f, +0.000484f}, + {-0.254059f, +0.003659f, +0.002185f} + }, + { + {-0.450752f, -0.008484f, +0.001446f}, + {-0.191283f, -0.014617f, -0.000163f}, + {-0.408035f, +0.040263f, +0.003661f}, + {-0.231639f, +0.007741f, +0.000045f} + }, + { + {-0.497579f, +0.012039f, +0.001191f}, + {-0.253854f, +0.015815f, -0.001949f}, + {-0.274552f, -0.030994f, +0.006408f}, + {-0.178594f, -0.020739f, +0.002028f} + }, + { + {-0.545362f, -0.010634f, +0.000559f}, + {-0.324146f, -0.011460f, -0.001641f}, + {-0.169370f, +0.009075f, +0.003395f}, + {-0.105323f, +0.013694f, +0.002900f} + }, + { + {-0.587196f, +0.008279f, +0.000328f}, + {-0.403134f, +0.010566f, +0.002217f}, + {-0.118490f, +0.003381f, -0.001814f}, + {-0.027446f, -0.008251f, -0.001827f} + }, + { + {-0.618017f, -0.004259f, +0.000361f}, + {-0.490358f, -0.020714f, +0.004529f}, + {-0.113358f, -0.003251f, -0.002770f}, + {+0.041459f, +0.013481f, -0.005194f} + }, + { + {-0.637687f, +0.001567f, +0.000820f}, + {-0.576790f, +0.023931f, +0.002213f}, + {-0.125198f, +0.004103f, -0.001443f}, + {+0.086209f, -0.010781f, -0.003979f} + }, + { + {-0.651150f, -0.001076f, +0.001428f}, + {-0.645409f, -0.014669f, -0.000718f}, + {-0.123622f, +0.001940f, -0.001608f}, + {+0.092869f, +0.002431f, -0.000324f} + }, + { + {-0.664780f, +0.003292f, +0.001710f}, + {-0.683586f, +0.000299f, -0.000557f}, + {-0.092026f, -0.012393f, -0.001589f}, + {+0.056395f, +0.017649f, +0.000374f} + }, + { + {-0.682371f, -0.006662f, +0.000792f}, + {-0.693411f, +0.007664f, +0.002560f}, + {-0.036899f, +0.016426f, -0.000987f}, + {-0.012285f, -0.023342f, -0.003158f} + }, + { + {-0.702854f, +0.004929f, -0.000169f}, + {-0.690742f, -0.001912f, +0.004494f}, + {+0.017981f, -0.013806f, -0.000030f}, + {-0.088921f, +0.012514f, -0.003181f} + }, + { + {-0.722549f, -0.002146f, +0.000430f}, + {-0.692300f, -0.005917f, +0.002876f}, + {+0.046872f, +0.003463f, +0.001220f}, + {-0.154235f, -0.010645f, -0.001356f} + }, + { + {-0.739092f, +0.002594f, +0.001242f}, + {-0.704186f, +0.008734f, -0.000319f}, + {+0.036822f, +0.011640f, +0.000478f}, + {-0.201705f, +0.002195f, +0.000385f} + }, + { + {-0.751826f, -0.003070f, +0.000998f}, + {-0.721419f, -0.002290f, -0.001142f}, + {-0.005059f, -0.018609f, -0.002901f}, + {-0.237750f, -0.005780f, +0.002036f} + }, + { + {-0.760887f, +0.001608f, +0.000546f}, + {-0.736911f, +0.001064f, +0.000228f}, + {-0.057870f, +0.010116f, -0.004534f}, + {-0.273933f, +0.006641f, +0.002467f} + }, + { + {-0.767195f, -0.000265f, +0.000748f}, + {-0.748024f, -0.000586f, +0.001053f}, + {-0.102334f, +0.003212f, +0.000059f}, + {-0.315083f, -0.011342f, +0.002600f} + }, + { + {-0.772327f, +0.001114f, +0.000964f}, + {-0.756683f, +0.002199f, +0.000983f}, + {-0.133057f, +0.004906f, +0.003973f}, + {-0.355964f, +0.012189f, +0.001107f} + }, + { + {-0.777379f, -0.001664f, +0.000676f}, + {-0.767213f, -0.002558f, +0.000597f}, + {-0.152753f, -0.009690f, +0.001092f}, + {-0.384303f, -0.006913f, -0.001047f} + }, + { + {-0.782304f, +0.001186f, +0.000401f}, + {-0.783173f, +0.004116f, +0.000499f}, + {-0.161920f, -0.000439f, -0.001076f}, + {-0.390874f, -0.005592f, -0.000791f} + }, + { + {-0.786466f, -0.000413f, +0.000504f}, + {-0.805468f, -0.004296f, +0.000905f}, + {-0.161504f, +0.005798f, +0.001317f}, + {-0.378159f, +0.009420f, +0.002017f} + }, + { + {-0.789480f, +0.000911f, +0.000469f}, + {-0.831991f, +0.006156f, +0.001415f}, + {-0.154727f, +0.000127f, +0.002457f}, + {-0.358994f, -0.003224f, +0.003001f} + }, + { + {-0.791179f, +0.000118f, +0.000378f}, + {-0.858608f, -0.007156f, +0.000826f}, + {-0.143224f, -0.002141f, -0.000223f}, + {-0.346009f, -0.003832f, +0.000505f} + }, + { + {-0.791713f, -0.000506f, +0.000690f}, + {-0.880258f, +0.003409f, +0.000310f}, + {-0.126671f, -0.005516f, -0.001744f}, + {-0.344447f, +0.002552f, -0.002098f} + }, + { + {-0.791760f, -0.000637f, +0.000646f}, + {-0.894068f, +0.000147f, +0.001099f}, + {-0.106700f, +0.011976f, +0.001536f}, + {-0.352724f, +0.003880f, -0.000028f} + }, + { + {-0.791607f, +0.000326f, +0.000259f}, + {-0.900705f, -0.000766f, +0.002346f}, + {-0.087833f, -0.003369f, +0.004535f}, + {-0.367814f, +0.002794f, +0.003185f} + }, + { + {-0.791360f, +0.000216f, +0.000145f}, + {-0.902761f, -0.003469f, +0.001579f}, + {-0.071216f, -0.005336f, +0.001636f}, + {-0.384313f, -0.008317f, +0.002102f} + }, + { + {-0.791514f, -0.000959f, +0.000554f}, + {-0.901431f, +0.000403f, -0.000135f}, + {-0.050334f, -0.003160f, -0.002061f}, + {-0.392811f, +0.004068f, -0.000843f} + }, + { + {-0.792816f, -0.000333f, +0.001006f}, + {-0.897192f, +0.003319f, +0.000240f}, + {-0.018937f, +0.014843f, -0.000267f}, + {-0.385889f, +0.008000f, -0.000602f} + }, + { + {-0.795515f, +0.001892f, +0.000664f}, + {-0.892619f, -0.002628f, +0.001553f}, + {+0.020997f, -0.013093f, +0.003597f}, + {-0.364329f, -0.010852f, +0.002618f} + }, + { + {-0.798742f, -0.001369f, -0.000006f}, + {-0.889854f, +0.001159f, +0.002594f}, + {+0.062746f, +0.000823f, +0.002081f}, + {-0.335764f, +0.002095f, +0.002620f} + }, + { + {-0.801561f, -0.000332f, -0.000055f}, + {-0.888481f, +0.002442f, +0.002445f}, + {+0.101614f, +0.005650f, -0.006242f}, + {-0.306982f, +0.005040f, -0.003292f} + }, + { + {-0.803505f, +0.001996f, +0.000969f}, + {-0.886774f, -0.004132f, +0.000094f}, + {+0.134585f, +0.001923f, -0.014731f}, + {-0.282127f, -0.002996f, -0.011457f} + } +}; + +const float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +{ + { + {-0.171042f, +0.590899f, -0.184148f}, + {-0.244016f, +0.359802f, -0.065072f}, + {-0.014995f, +0.035748f, -0.012250f}, + {-0.031507f, +0.034780f, -0.009895f} + }, + { + {-0.228601f, +0.478433f, -0.200802f}, + {-0.468416f, -0.184796f, -0.220307f}, + {-0.021499f, +0.027785f, -0.012584f}, + {-0.060325f, +0.030602f, -0.002599f} + }, + { + {+0.101029f, -0.456163f, +0.083058f}, + {-0.043611f, -0.870939f, -0.055288f}, + {+0.001858f, +0.027597f, -0.016310f}, + {-0.029059f, +0.033806f, -0.005356f} + }, + { + {+0.410000f, -0.084502f, +0.139239f}, + {+0.675225f, +0.218111f, +0.204844f}, + {+0.040662f, +0.051315f, -0.018039f}, + {+0.063503f, +0.056458f, -0.016519f} + }, + { + {+0.415696f, +0.265055f, +0.002626f}, + {+1.013647f, +0.334903f, +0.081079f}, + {+0.065042f, -0.040883f, +0.012352f}, + {+0.181037f, -0.059880f, +0.005085f} + }, + { + {+0.148368f, -0.111388f, -0.073685f}, + {+0.845933f, -0.250930f, -0.091257f}, + {+0.025616f, -0.060138f, +0.012766f}, + {+0.228995f, -0.032819f, +0.003215f} + }, + { + {-0.193830f, -0.014212f, -0.040266f}, + {+0.402943f, +0.020025f, -0.092885f}, + {-0.058690f, +0.041101f, -0.008172f}, + {+0.161828f, +0.015394f, -0.004824f} + }, + { + {-0.448848f, +0.024310f, +0.012126f}, + {-0.042491f, +0.043522f, -0.007450f}, + {-0.129054f, -0.013924f, -0.014446f}, + {-0.004772f, -0.042423f, +0.005623f} + }, + { + {-0.581348f, +0.015560f, +0.027528f}, + {-0.364335f, +0.028974f, +0.038991f}, + {-0.152614f, -0.032355f, -0.005641f}, + {-0.218401f, +0.075676f, -0.000317f} + }, + { + {-0.641251f, -0.033204f, +0.014171f}, + {-0.576730f, -0.078039f, +0.024279f}, + {-0.144066f, +0.021824f, +0.009938f}, + {-0.391879f, -0.026769f, -0.009335f} + }, + { + {-0.678995f, +0.021986f, +0.000075f}, + {-0.725441f, +0.048920f, -0.000285f}, + {-0.153455f, +0.022432f, +0.008363f}, + {-0.464657f, -0.026611f, +0.001799f} + }, + { + {-0.709246f, -0.001743f, -0.002228f}, + {-0.829481f, -0.007880f, -0.002786f}, + {-0.208073f, -0.023291f, +0.000232f}, + {-0.446725f, +0.013756f, +0.010505f} + }, + { + {-0.725841f, -0.005310f, +0.002197f}, + {-0.889756f, -0.003342f, +0.005446f}, + {-0.296494f, +0.020861f, +0.000461f}, + {-0.383826f, -0.016046f, +0.008157f} + }, + { + {-0.724803f, +0.003851f, +0.004749f}, + {-0.910037f, -0.002807f, +0.007312f}, + {-0.382641f, -0.013902f, +0.003575f}, + {-0.319137f, +0.005237f, +0.005556f} + }, + { + {-0.710495f, -0.001176f, +0.003666f}, + {-0.902293f, -0.002075f, +0.004352f}, + {-0.421514f, +0.001837f, +0.005564f}, + {-0.276374f, +0.006416f, -0.000678f} + }, + { + {-0.690926f, +0.001911f, +0.001428f}, + {-0.883286f, +0.004067f, +0.003096f}, + {-0.382030f, +0.012331f, +0.003744f}, + {-0.247702f, +0.008689f, -0.002881f} + }, + { + {-0.672402f, -0.004418f, +0.000819f}, + {-0.868037f, -0.001291f, +0.002503f}, + {-0.260382f, -0.031252f, -0.000392f}, + {-0.215212f, -0.010735f, +0.000421f} + }, + { + {-0.658558f, +0.003708f, +0.001700f}, + {-0.863001f, -0.000603f, +0.002111f}, + {-0.084457f, +0.046037f, -0.001989f}, + {-0.169471f, +0.007931f, +0.000103f} + }, + { + {-0.650017f, -0.001079f, +0.002333f}, + {-0.867523f, +0.003563f, +0.001620f}, + {+0.093137f, -0.042759f, +0.000290f}, + {-0.110082f, -0.012804f, -0.002290f} + }, + { + {-0.643665f, -0.001088f, +0.001723f}, + {-0.877421f, -0.003410f, +0.000713f}, + {+0.217492f, +0.016953f, +0.001740f}, + {-0.046668f, +0.018761f, -0.001213f} + }, + { + {-0.633405f, -0.001560f, +0.000669f}, + {-0.887575f, -0.001389f, +0.001467f}, + {+0.260289f, +0.010429f, -0.001427f}, + {+0.003491f, -0.008000f, +0.000581f} + }, + { + {-0.613764f, +0.006196f, +0.000648f}, + {-0.893912f, +0.004015f, +0.004684f}, + {+0.234569f, -0.016937f, -0.004729f}, + {+0.024290f, -0.008269f, -0.003225f} + }, + { + {-0.584438f, -0.007700f, +0.000979f}, + {-0.892617f, +0.003169f, +0.005373f}, + {+0.180710f, +0.012490f, -0.004688f}, + {+0.010563f, +0.002672f, -0.005332f} + }, + { + {-0.550310f, +0.008552f, +0.001243f}, + {-0.875679f, -0.001053f, +0.001808f}, + {+0.139761f, -0.001299f, -0.002407f}, + {-0.037114f, -0.006797f, -0.001129f} + }, + { + {-0.518417f, -0.006133f, +0.001495f}, + {-0.833856f, -0.011056f, -0.000737f}, + {+0.132343f, -0.004055f, -0.000776f}, + {-0.115163f, +0.018375f, +0.002028f} + }, + { + {-0.493716f, +0.003010f, +0.001174f}, + {-0.768131f, +0.020508f, -0.000066f}, + {+0.152693f, +0.008282f, -0.001169f}, + {-0.209710f, -0.025096f, +0.001590f} + }, + { + {-0.475954f, -0.001122f, +0.000352f}, + {-0.692851f, -0.022031f, +0.002804f}, + {+0.177765f, -0.009921f, +0.000059f}, + {-0.298030f, +0.020217f, -0.000155f} + }, + { + {-0.460792f, +0.002405f, -0.000376f}, + {-0.628175f, +0.009296f, +0.003825f}, + {+0.180171f, -0.003908f, +0.001064f}, + {-0.358358f, -0.006713f, -0.000347f} + }, + { + {-0.443319f, -0.006234f, +0.000246f}, + {-0.585810f, +0.000344f, +0.001004f}, + {+0.146499f, +0.011689f, +0.000951f}, + {-0.382061f, -0.004531f, +0.001751f} + }, + { + {-0.421955f, +0.005364f, +0.001214f}, + {-0.561763f, -0.000808f, -0.002176f}, + {+0.084775f, -0.020993f, +0.000045f}, + {-0.377713f, +0.006390f, +0.003942f} + }, + { + {-0.398163f, -0.003724f, +0.000751f}, + {-0.543402f, -0.007140f, -0.001937f}, + {+0.018165f, +0.017000f, -0.002291f}, + {-0.362688f, -0.001927f, +0.003741f} + }, + { + {-0.373625f, +0.004821f, +0.000045f}, + {-0.521728f, +0.008459f, +0.000565f}, + {-0.028207f, -0.002987f, -0.002148f}, + {-0.349401f, +0.000605f, +0.002646f} + }, + { + {-0.349815f, -0.005517f, +0.000230f}, + {-0.496496f, -0.005695f, +0.001454f}, + {-0.043081f, -0.009641f, +0.002012f}, + {-0.338864f, +0.001346f, +0.001602f} + }, + { + {-0.328050f, +0.004001f, +0.000439f}, + {-0.471819f, +0.004175f, +0.001005f}, + {-0.032608f, +0.005428f, +0.005314f}, + {-0.322952f, +0.001273f, -0.000092f} + }, + { + {-0.308595f, -0.003134f, +0.000145f}, + {-0.451672f, -0.002574f, +0.000427f}, + {-0.010290f, +0.004974f, +0.001398f}, + {-0.292677f, -0.007601f, -0.001415f} + }, + { + {-0.290597f, +0.003355f, -0.000136f}, + {-0.436743f, +0.002865f, +0.000374f}, + {+0.017338f, +0.007331f, -0.002166f}, + {-0.247618f, +0.015355f, -0.000635f} + }, + { + {-0.272998f, -0.004175f, +0.000021f}, + {-0.424310f, -0.002403f, +0.000711f}, + {+0.047898f, -0.011482f, +0.000426f}, + {-0.198447f, -0.014503f, +0.001973f} + }, + { + {-0.255459f, +0.003452f, +0.000162f}, + {-0.409862f, +0.003440f, +0.000963f}, + {+0.077199f, +0.004028f, +0.001741f}, + {-0.160349f, +0.003060f, +0.002227f} + }, + { + {-0.238237f, -0.003448f, +0.000017f}, + {-0.389274f, -0.003315f, +0.000451f}, + {+0.103396f, -0.000155f, -0.000865f}, + {-0.141016f, +0.003270f, -0.000528f} + }, + { + {-0.221659f, +0.003880f, +0.000200f}, + {-0.360274f, +0.007600f, -0.000068f}, + {+0.127118f, +0.006707f, -0.002120f}, + {-0.136776f, -0.001506f, -0.002388f} + }, + { + {-0.206321f, -0.002421f, +0.000222f}, + {-0.323761f, -0.010008f, +0.000633f}, + {+0.147702f, -0.009697f, +0.000777f}, + {-0.138196f, -0.005501f, -0.000185f} + }, + { + {-0.192402f, +0.002339f, -0.000141f}, + {-0.283782f, +0.009026f, +0.001400f}, + {+0.162715f, +0.001250f, +0.002766f}, + {-0.137599f, +0.001369f, +0.002680f} + }, + { + {-0.179623f, -0.002933f, -0.000145f}, + {-0.244500f, -0.005039f, +0.000589f}, + {+0.172860f, +0.006728f, -0.000517f}, + {-0.130069f, +0.003207f, +0.001003f} + }, + { + {-0.168039f, +0.002857f, +0.000210f}, + {-0.207651f, +0.005569f, -0.001162f}, + {+0.183789f, +0.001069f, -0.004319f}, + {-0.111107f, +0.002870f, -0.002170f} + }, + { + {-0.157725f, -0.001947f, +0.000454f}, + {-0.172892f, -0.010252f, -0.000596f}, + {+0.198825f, -0.011358f, -0.002404f}, + {-0.080708f, -0.012176f, -0.001780f} + }, + { + {-0.148241f, +0.000618f, +0.000026f}, + {-0.141203f, +0.007243f, +0.001063f}, + {+0.212313f, +0.004737f, +0.000973f}, + {-0.046659f, +0.011069f, +0.000996f} + }, + { + {-0.138402f, -0.001765f, -0.000579f}, + {-0.113224f, -0.004585f, +0.001287f}, + {+0.215767f, +0.007978f, -0.001019f}, + {-0.020004f, +0.000374f, +0.000573f} + }, + { + {-0.127236f, +0.003443f, -0.000426f}, + {-0.086775f, +0.002732f, +0.000319f}, + {+0.206200f, -0.011017f, -0.006667f}, + {-0.006720f, -0.005737f, -0.003684f} + }, + { + {-0.114738f, -0.003852f, +0.000286f}, + {-0.059179f, -0.002958f, -0.001772f}, + {+0.184707f, +0.002148f, -0.008785f}, + {-0.006688f, +0.000728f, -0.006182f} + }, + { + {-0.100815f, +0.002358f, +0.000595f}, + {-0.029594f, +0.008594f, -0.002770f}, + {+0.151524f, +0.003310f, -0.003987f}, + {-0.019197f, +0.005615f, -0.002853f} + } +}; + +const float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +{ + { + {+0.181652f, +0.754551f, +0.218658f}, + {-0.313875f, +0.422228f, -0.135528f}, + {+0.014440f, +0.116710f, -0.013575f}, + {+0.042997f, +0.018886f, -0.015597f} + }, + { + {-0.171103f, -0.431000f, -0.158827f}, + {+0.162330f, +1.016290f, -0.055279f}, + {-0.009076f, +0.107488f, -0.010075f}, + {-0.002269f, +0.060685f, +0.014338f} + }, + { + {-0.320265f, -0.250765f, -0.167171f}, + {+0.685853f, -0.069215f, +0.258616f}, + {-0.021745f, +0.080557f, +0.010049f}, + {-0.070084f, +0.090970f, +0.018109f} + }, + { + {-0.090062f, +0.396798f, +0.031329f}, + {+0.547868f, -0.612159f, +0.064837f}, + {-0.014055f, +0.010916f, -0.020054f}, + {-0.104609f, -0.009719f, -0.014645f} + }, + { + {+0.310752f, -0.054756f, +0.106519f}, + {-0.077791f, +0.305320f, -0.144875f}, + {+0.048626f, -0.050345f, -0.007511f}, + {-0.035749f, -0.049561f, -0.008157f} + }, + { + {+0.590278f, -0.119063f, +0.024674f}, + {-0.708076f, +0.088569f, -0.094265f}, + {+0.119880f, +0.048720f, +0.014661f}, + {+0.120422f, +0.058573f, +0.004643f} + }, + { + {+0.638355f, +0.074625f, -0.043889f}, + {-1.048572f, -0.131298f, +0.037692f}, + {+0.143385f, +0.033975f, +0.014623f}, + {+0.293747f, -0.017822f, -0.000451f} + }, + { + {+0.521197f, -0.005266f, -0.041412f}, + {-1.094584f, -0.000210f, +0.073803f}, + {+0.109004f, -0.035628f, -0.003452f}, + {+0.407579f, +0.034241f, -0.002887f} + }, + { + {+0.361479f, -0.014806f, -0.009497f}, + {-0.986770f, +0.046512f, +0.029288f}, + {+0.057809f, +0.027844f, -0.015215f}, + {+0.409283f, +0.014805f, +0.005752f} + }, + { + {+0.229108f, -0.009840f, +0.009477f}, + {-0.839323f, -0.000705f, -0.009034f}, + {+0.036287f, +0.030074f, -0.010227f}, + {+0.293083f, -0.069929f, -0.004421f} + }, + { + {+0.125590f, +0.030181f, +0.007318f}, + {-0.687756f, -0.052219f, -0.009126f}, + {+0.052382f, -0.019274f, +0.003613f}, + {+0.122951f, +0.036356f, -0.013394f} + }, + { + {+0.030890f, -0.030176f, -0.000832f}, + {-0.531513f, +0.048483f, +0.004668f}, + {+0.067811f, -0.004747f, +0.002746f}, + {-0.026040f, -0.009502f, -0.004388f} + }, + { + {-0.062962f, +0.019124f, -0.003537f}, + {-0.376029f, -0.026217f, +0.006323f}, + {+0.042499f, +0.013437f, -0.001738f}, + {-0.120763f, +0.008891f, +0.001968f} + }, + { + {-0.150437f, -0.012367f, -0.001050f}, + {-0.234297f, +0.021072f, +0.000774f}, + {-0.046092f, -0.025628f, -0.001827f}, + {-0.163500f, +0.007913f, +0.005640f} + }, + { + {-0.224579f, +0.011037f, +0.001567f}, + {-0.118032f, -0.020982f, -0.001167f}, + {-0.190587f, +0.031698f, +0.001189f}, + {-0.181600f, +0.008625f, +0.006827f} + }, + { + {-0.283765f, -0.012148f, +0.001665f}, + {-0.031141f, +0.014212f, -0.000704f}, + {-0.354999f, -0.033990f, +0.005051f}, + {-0.201565f, -0.012572f, +0.001547f} + }, + { + {-0.330851f, +0.010110f, +0.000281f}, + {+0.032740f, -0.010680f, -0.000608f}, + {-0.489897f, +0.028555f, +0.005370f}, + {-0.226930f, +0.003469f, +0.000412f} + }, + { + {-0.370651f, -0.006974f, -0.000273f}, + {+0.085140f, +0.009699f, -0.000484f}, + {-0.550417f, -0.008550f, +0.002078f}, + {-0.248676f, -0.002190f, +0.002941f} + }, + { + {-0.408944f, +0.005900f, +0.000497f}, + {+0.135902f, -0.010386f, -0.000573f}, + {-0.516823f, -0.021637f, +0.000484f}, + {-0.254059f, +0.003659f, +0.002185f} + }, + { + {-0.450752f, -0.008484f, +0.001446f}, + {+0.191283f, +0.014617f, +0.000163f}, + {-0.408035f, +0.040263f, +0.003661f}, + {-0.231639f, +0.007741f, +0.000045f} + }, + { + {-0.497579f, +0.012039f, +0.001191f}, + {+0.253854f, -0.015815f, +0.001949f}, + {-0.274552f, -0.030994f, +0.006408f}, + {-0.178594f, -0.020739f, +0.002028f} + }, + { + {-0.545362f, -0.010634f, +0.000559f}, + {+0.324146f, +0.011460f, +0.001641f}, + {-0.169370f, +0.009075f, +0.003395f}, + {-0.105323f, +0.013694f, +0.002900f} + }, + { + {-0.587196f, +0.008279f, +0.000328f}, + {+0.403134f, -0.010566f, -0.002217f}, + {-0.118490f, +0.003381f, -0.001814f}, + {-0.027446f, -0.008251f, -0.001827f} + }, + { + {-0.618017f, -0.004259f, +0.000361f}, + {+0.490358f, +0.020714f, -0.004529f}, + {-0.113358f, -0.003251f, -0.002770f}, + {+0.041459f, +0.013481f, -0.005194f} + }, + { + {-0.637687f, +0.001567f, +0.000820f}, + {+0.576790f, -0.023931f, -0.002213f}, + {-0.125198f, +0.004103f, -0.001443f}, + {+0.086209f, -0.010781f, -0.003979f} + }, + { + {-0.651150f, -0.001076f, +0.001428f}, + {+0.645409f, +0.014669f, +0.000718f}, + {-0.123622f, +0.001940f, -0.001608f}, + {+0.092869f, +0.002431f, -0.000324f} + }, + { + {-0.664780f, +0.003292f, +0.001710f}, + {+0.683586f, -0.000299f, +0.000557f}, + {-0.092026f, -0.012393f, -0.001589f}, + {+0.056395f, +0.017649f, +0.000374f} + }, + { + {-0.682371f, -0.006662f, +0.000792f}, + {+0.693411f, -0.007664f, -0.002560f}, + {-0.036899f, +0.016426f, -0.000987f}, + {-0.012285f, -0.023342f, -0.003158f} + }, + { + {-0.702854f, +0.004929f, -0.000169f}, + {+0.690742f, +0.001912f, -0.004494f}, + {+0.017981f, -0.013806f, -0.000030f}, + {-0.088921f, +0.012514f, -0.003181f} + }, + { + {-0.722549f, -0.002146f, +0.000430f}, + {+0.692300f, +0.005917f, -0.002876f}, + {+0.046872f, +0.003463f, +0.001220f}, + {-0.154235f, -0.010645f, -0.001356f} + }, + { + {-0.739092f, +0.002594f, +0.001242f}, + {+0.704186f, -0.008734f, +0.000319f}, + {+0.036822f, +0.011640f, +0.000478f}, + {-0.201705f, +0.002195f, +0.000385f} + }, + { + {-0.751826f, -0.003070f, +0.000998f}, + {+0.721419f, +0.002290f, +0.001142f}, + {-0.005059f, -0.018609f, -0.002901f}, + {-0.237750f, -0.005780f, +0.002036f} + }, + { + {-0.760887f, +0.001608f, +0.000546f}, + {+0.736911f, -0.001064f, -0.000228f}, + {-0.057870f, +0.010116f, -0.004534f}, + {-0.273933f, +0.006641f, +0.002467f} + }, + { + {-0.767195f, -0.000265f, +0.000748f}, + {+0.748024f, +0.000586f, -0.001053f}, + {-0.102334f, +0.003212f, +0.000059f}, + {-0.315083f, -0.011342f, +0.002600f} + }, + { + {-0.772327f, +0.001114f, +0.000964f}, + {+0.756683f, -0.002199f, -0.000983f}, + {-0.133057f, +0.004906f, +0.003973f}, + {-0.355964f, +0.012189f, +0.001107f} + }, + { + {-0.777379f, -0.001664f, +0.000676f}, + {+0.767213f, +0.002558f, -0.000597f}, + {-0.152753f, -0.009690f, +0.001092f}, + {-0.384303f, -0.006913f, -0.001047f} + }, + { + {-0.782304f, +0.001186f, +0.000401f}, + {+0.783173f, -0.004116f, -0.000499f}, + {-0.161920f, -0.000439f, -0.001076f}, + {-0.390874f, -0.005592f, -0.000791f} + }, + { + {-0.786466f, -0.000413f, +0.000504f}, + {+0.805468f, +0.004296f, -0.000905f}, + {-0.161504f, +0.005798f, +0.001317f}, + {-0.378159f, +0.009420f, +0.002017f} + }, + { + {-0.789480f, +0.000911f, +0.000469f}, + {+0.831991f, -0.006156f, -0.001415f}, + {-0.154727f, +0.000127f, +0.002457f}, + {-0.358994f, -0.003224f, +0.003001f} + }, + { + {-0.791179f, +0.000118f, +0.000378f}, + {+0.858608f, +0.007156f, -0.000826f}, + {-0.143224f, -0.002141f, -0.000223f}, + {-0.346009f, -0.003832f, +0.000505f} + }, + { + {-0.791713f, -0.000506f, +0.000690f}, + {+0.880258f, -0.003409f, -0.000310f}, + {-0.126671f, -0.005516f, -0.001744f}, + {-0.344447f, +0.002552f, -0.002098f} + }, + { + {-0.791760f, -0.000637f, +0.000646f}, + {+0.894068f, -0.000147f, -0.001099f}, + {-0.106700f, +0.011976f, +0.001536f}, + {-0.352724f, +0.003880f, -0.000028f} + }, + { + {-0.791607f, +0.000326f, +0.000259f}, + {+0.900705f, +0.000766f, -0.002346f}, + {-0.087833f, -0.003369f, +0.004535f}, + {-0.367814f, +0.002794f, +0.003185f} + }, + { + {-0.791360f, +0.000216f, +0.000145f}, + {+0.902761f, +0.003469f, -0.001579f}, + {-0.071216f, -0.005336f, +0.001636f}, + {-0.384313f, -0.008317f, +0.002102f} + }, + { + {-0.791514f, -0.000959f, +0.000554f}, + {+0.901431f, -0.000403f, +0.000135f}, + {-0.050334f, -0.003160f, -0.002061f}, + {-0.392811f, +0.004068f, -0.000843f} + }, + { + {-0.792816f, -0.000333f, +0.001006f}, + {+0.897192f, -0.003319f, -0.000240f}, + {-0.018937f, +0.014843f, -0.000267f}, + {-0.385889f, +0.008000f, -0.000602f} + }, + { + {-0.795515f, +0.001892f, +0.000664f}, + {+0.892619f, +0.002628f, -0.001553f}, + {+0.020997f, -0.013093f, +0.003597f}, + {-0.364329f, -0.010852f, +0.002618f} + }, + { + {-0.798742f, -0.001369f, -0.000006f}, + {+0.889854f, -0.001159f, -0.002594f}, + {+0.062746f, +0.000823f, +0.002081f}, + {-0.335764f, +0.002095f, +0.002620f} + }, + { + {-0.801561f, -0.000332f, -0.000055f}, + {+0.888481f, -0.002442f, -0.002445f}, + {+0.101614f, +0.005650f, -0.006242f}, + {-0.306982f, +0.005040f, -0.003292f} + }, + { + {-0.803505f, +0.001996f, +0.000969f}, + {+0.886774f, +0.004132f, -0.000094f}, + {+0.134585f, +0.001923f, -0.014731f}, + {-0.282127f, -0.002996f, -0.011457f} + } +}; + +const float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +{ + { + {-0.171042f, +0.590899f, -0.184148f}, + {+0.244016f, -0.359802f, +0.065072f}, + {-0.014995f, +0.035748f, -0.012250f}, + {-0.031507f, +0.034780f, -0.009895f} + }, + { + {-0.228601f, +0.478433f, -0.200802f}, + {+0.468416f, +0.184796f, +0.220307f}, + {-0.021499f, +0.027785f, -0.012584f}, + {-0.060325f, +0.030602f, -0.002599f} + }, + { + {+0.101029f, -0.456163f, +0.083058f}, + {+0.043611f, +0.870939f, +0.055288f}, + {+0.001858f, +0.027597f, -0.016310f}, + {-0.029059f, +0.033806f, -0.005356f} + }, + { + {+0.410000f, -0.084502f, +0.139239f}, + {-0.675225f, -0.218111f, -0.204844f}, + {+0.040662f, +0.051315f, -0.018039f}, + {+0.063503f, +0.056458f, -0.016519f} + }, + { + {+0.415696f, +0.265055f, +0.002626f}, + {-1.013647f, -0.334903f, -0.081079f}, + {+0.065042f, -0.040883f, +0.012352f}, + {+0.181037f, -0.059880f, +0.005085f} + }, + { + {+0.148368f, -0.111388f, -0.073685f}, + {-0.845933f, +0.250930f, +0.091257f}, + {+0.025616f, -0.060138f, +0.012766f}, + {+0.228995f, -0.032819f, +0.003215f} + }, + { + {-0.193830f, -0.014212f, -0.040266f}, + {-0.402943f, -0.020025f, +0.092885f}, + {-0.058690f, +0.041101f, -0.008172f}, + {+0.161828f, +0.015394f, -0.004824f} + }, + { + {-0.448848f, +0.024310f, +0.012126f}, + {+0.042491f, -0.043522f, +0.007450f}, + {-0.129054f, -0.013924f, -0.014446f}, + {-0.004772f, -0.042423f, +0.005623f} + }, + { + {-0.581348f, +0.015560f, +0.027528f}, + {+0.364335f, -0.028974f, -0.038991f}, + {-0.152614f, -0.032355f, -0.005641f}, + {-0.218401f, +0.075676f, -0.000317f} + }, + { + {-0.641251f, -0.033204f, +0.014171f}, + {+0.576730f, +0.078039f, -0.024279f}, + {-0.144066f, +0.021824f, +0.009938f}, + {-0.391879f, -0.026769f, -0.009335f} + }, + { + {-0.678995f, +0.021986f, +0.000075f}, + {+0.725441f, -0.048920f, +0.000285f}, + {-0.153455f, +0.022432f, +0.008363f}, + {-0.464657f, -0.026611f, +0.001799f} + }, + { + {-0.709246f, -0.001743f, -0.002228f}, + {+0.829481f, +0.007880f, +0.002786f}, + {-0.208073f, -0.023291f, +0.000232f}, + {-0.446725f, +0.013756f, +0.010505f} + }, + { + {-0.725841f, -0.005310f, +0.002197f}, + {+0.889756f, +0.003342f, -0.005446f}, + {-0.296494f, +0.020861f, +0.000461f}, + {-0.383826f, -0.016046f, +0.008157f} + }, + { + {-0.724803f, +0.003851f, +0.004749f}, + {+0.910037f, +0.002807f, -0.007312f}, + {-0.382641f, -0.013902f, +0.003575f}, + {-0.319137f, +0.005237f, +0.005556f} + }, + { + {-0.710495f, -0.001176f, +0.003666f}, + {+0.902293f, +0.002075f, -0.004352f}, + {-0.421514f, +0.001837f, +0.005564f}, + {-0.276374f, +0.006416f, -0.000678f} + }, + { + {-0.690926f, +0.001911f, +0.001428f}, + {+0.883286f, -0.004067f, -0.003096f}, + {-0.382030f, +0.012331f, +0.003744f}, + {-0.247702f, +0.008689f, -0.002881f} + }, + { + {-0.672402f, -0.004418f, +0.000819f}, + {+0.868037f, +0.001291f, -0.002503f}, + {-0.260382f, -0.031252f, -0.000392f}, + {-0.215212f, -0.010735f, +0.000421f} + }, + { + {-0.658558f, +0.003708f, +0.001700f}, + {+0.863001f, +0.000603f, -0.002111f}, + {-0.084457f, +0.046037f, -0.001989f}, + {-0.169471f, +0.007931f, +0.000103f} + }, + { + {-0.650017f, -0.001079f, +0.002333f}, + {+0.867523f, -0.003563f, -0.001620f}, + {+0.093137f, -0.042759f, +0.000290f}, + {-0.110082f, -0.012804f, -0.002290f} + }, + { + {-0.643665f, -0.001088f, +0.001723f}, + {+0.877421f, +0.003410f, -0.000713f}, + {+0.217492f, +0.016953f, +0.001740f}, + {-0.046668f, +0.018761f, -0.001213f} + }, + { + {-0.633405f, -0.001560f, +0.000669f}, + {+0.887575f, +0.001389f, -0.001467f}, + {+0.260289f, +0.010429f, -0.001427f}, + {+0.003491f, -0.008000f, +0.000581f} + }, + { + {-0.613764f, +0.006196f, +0.000648f}, + {+0.893912f, -0.004015f, -0.004684f}, + {+0.234569f, -0.016937f, -0.004729f}, + {+0.024290f, -0.008269f, -0.003225f} + }, + { + {-0.584438f, -0.007700f, +0.000979f}, + {+0.892617f, -0.003169f, -0.005373f}, + {+0.180710f, +0.012490f, -0.004688f}, + {+0.010563f, +0.002672f, -0.005332f} + }, + { + {-0.550310f, +0.008552f, +0.001243f}, + {+0.875679f, +0.001053f, -0.001808f}, + {+0.139761f, -0.001299f, -0.002407f}, + {-0.037114f, -0.006797f, -0.001129f} + }, + { + {-0.518417f, -0.006133f, +0.001495f}, + {+0.833856f, +0.011056f, +0.000737f}, + {+0.132343f, -0.004055f, -0.000776f}, + {-0.115163f, +0.018375f, +0.002028f} + }, + { + {-0.493716f, +0.003010f, +0.001174f}, + {+0.768131f, -0.020508f, +0.000066f}, + {+0.152693f, +0.008282f, -0.001169f}, + {-0.209710f, -0.025096f, +0.001590f} + }, + { + {-0.475954f, -0.001122f, +0.000352f}, + {+0.692851f, +0.022031f, -0.002804f}, + {+0.177765f, -0.009921f, +0.000059f}, + {-0.298030f, +0.020217f, -0.000155f} + }, + { + {-0.460792f, +0.002405f, -0.000376f}, + {+0.628175f, -0.009296f, -0.003825f}, + {+0.180171f, -0.003908f, +0.001064f}, + {-0.358358f, -0.006713f, -0.000347f} + }, + { + {-0.443319f, -0.006234f, +0.000246f}, + {+0.585810f, -0.000344f, -0.001004f}, + {+0.146499f, +0.011689f, +0.000951f}, + {-0.382061f, -0.004531f, +0.001751f} + }, + { + {-0.421955f, +0.005364f, +0.001214f}, + {+0.561763f, +0.000808f, +0.002176f}, + {+0.084775f, -0.020993f, +0.000045f}, + {-0.377713f, +0.006390f, +0.003942f} + }, + { + {-0.398163f, -0.003724f, +0.000751f}, + {+0.543402f, +0.007140f, +0.001937f}, + {+0.018165f, +0.017000f, -0.002291f}, + {-0.362688f, -0.001927f, +0.003741f} + }, + { + {-0.373625f, +0.004821f, +0.000045f}, + {+0.521728f, -0.008459f, -0.000565f}, + {-0.028207f, -0.002987f, -0.002148f}, + {-0.349401f, +0.000605f, +0.002646f} + }, + { + {-0.349815f, -0.005517f, +0.000230f}, + {+0.496496f, +0.005695f, -0.001454f}, + {-0.043081f, -0.009641f, +0.002012f}, + {-0.338864f, +0.001346f, +0.001602f} + }, + { + {-0.328050f, +0.004001f, +0.000439f}, + {+0.471819f, -0.004175f, -0.001005f}, + {-0.032608f, +0.005428f, +0.005314f}, + {-0.322952f, +0.001273f, -0.000092f} + }, + { + {-0.308595f, -0.003134f, +0.000145f}, + {+0.451672f, +0.002574f, -0.000427f}, + {-0.010290f, +0.004974f, +0.001398f}, + {-0.292677f, -0.007601f, -0.001415f} + }, + { + {-0.290597f, +0.003355f, -0.000136f}, + {+0.436743f, -0.002865f, -0.000374f}, + {+0.017338f, +0.007331f, -0.002166f}, + {-0.247618f, +0.015355f, -0.000635f} + }, + { + {-0.272998f, -0.004175f, +0.000021f}, + {+0.424310f, +0.002403f, -0.000711f}, + {+0.047898f, -0.011482f, +0.000426f}, + {-0.198447f, -0.014503f, +0.001973f} + }, + { + {-0.255459f, +0.003452f, +0.000162f}, + {+0.409862f, -0.003440f, -0.000963f}, + {+0.077199f, +0.004028f, +0.001741f}, + {-0.160349f, +0.003060f, +0.002227f} + }, + { + {-0.238237f, -0.003448f, +0.000017f}, + {+0.389274f, +0.003315f, -0.000451f}, + {+0.103396f, -0.000155f, -0.000865f}, + {-0.141016f, +0.003270f, -0.000528f} + }, + { + {-0.221659f, +0.003880f, +0.000200f}, + {+0.360274f, -0.007600f, +0.000068f}, + {+0.127118f, +0.006707f, -0.002120f}, + {-0.136776f, -0.001506f, -0.002388f} + }, + { + {-0.206321f, -0.002421f, +0.000222f}, + {+0.323761f, +0.010008f, -0.000633f}, + {+0.147702f, -0.009697f, +0.000777f}, + {-0.138196f, -0.005501f, -0.000185f} + }, + { + {-0.192402f, +0.002339f, -0.000141f}, + {+0.283782f, -0.009026f, -0.001400f}, + {+0.162715f, +0.001250f, +0.002766f}, + {-0.137599f, +0.001369f, +0.002680f} + }, + { + {-0.179623f, -0.002933f, -0.000145f}, + {+0.244500f, +0.005039f, -0.000589f}, + {+0.172860f, +0.006728f, -0.000517f}, + {-0.130069f, +0.003207f, +0.001003f} + }, + { + {-0.168039f, +0.002857f, +0.000210f}, + {+0.207651f, -0.005569f, +0.001162f}, + {+0.183789f, +0.001069f, -0.004319f}, + {-0.111107f, +0.002870f, -0.002170f} + }, + { + {-0.157725f, -0.001947f, +0.000454f}, + {+0.172892f, +0.010252f, +0.000596f}, + {+0.198825f, -0.011358f, -0.002404f}, + {-0.080708f, -0.012176f, -0.001780f} + }, + { + {-0.148241f, +0.000618f, +0.000026f}, + {+0.141203f, -0.007243f, -0.001063f}, + {+0.212313f, +0.004737f, +0.000973f}, + {-0.046659f, +0.011069f, +0.000996f} + }, + { + {-0.138402f, -0.001765f, -0.000579f}, + {+0.113224f, +0.004585f, -0.001287f}, + {+0.215767f, +0.007978f, -0.001019f}, + {-0.020004f, +0.000374f, +0.000573f} + }, + { + {-0.127236f, +0.003443f, -0.000426f}, + {+0.086775f, -0.002732f, -0.000319f}, + {+0.206200f, -0.011017f, -0.006667f}, + {-0.006720f, -0.005737f, -0.003684f} + }, + { + {-0.114738f, -0.003852f, +0.000286f}, + {+0.059179f, +0.002958f, +0.001772f}, + {+0.184707f, +0.002148f, -0.008785f}, + {-0.006688f, +0.000728f, -0.006182f} + }, + { + {-0.100815f, +0.002358f, +0.000595f}, + {+0.029594f, -0.008594f, +0.002770f}, + {+0.151524f, +0.003310f, -0.003987f}, + {-0.019197f, +0.005615f, -0.002853f} + } +}; +#endif const float FASTCONV_HRIR_latency_s = 0.000666667f; diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 0cf8e35a6d..9bfa68b074 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -44,6 +44,20 @@ /* Binaural rendering data set based on HRIRs */ extern const float FASTCONV_HRIR_latency_s; +#ifdef UPDATE_FASTCONV_SBA_FILTER +extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; +extern float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +#else extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; @@ -56,6 +70,7 @@ extern float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; extern float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; extern float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; extern float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; +#endif extern float leftHRIRReal[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS]; extern float leftHRIRImag[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS]; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index c763630325..abba25124c 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -756,6 +756,22 @@ typedef struct ivas_hrtfs_fastconv_struct float rightHRIRImag[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS]; float FASTCONV_HOA3_latency_s; +#ifdef UPDATE_FASTCONV_SBA_FILTER + float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; + float FASTCONV_HOA2_latency_s; + float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; + float FASTCONV_FOA_latency_s; + float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +#else float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; @@ -771,6 +787,7 @@ typedef struct ivas_hrtfs_fastconv_struct float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]; +#endif float FASTCONV_BRIR_latency_s; float leftBRIRReal[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS_MAX]; float leftBRIRImag[BINAURAL_CONVBANDS][HRTF_LS_CHANNELS][BINAURAL_NTAPS_MAX]; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index e2181ca6e1..c2408e89ca 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -969,10 +969,17 @@ static ivas_error init_fastconv_HRTF_handle( { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + set_zero( hHrtf->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); +#else set_zero( hHrtf->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRImag_HOA3[i][j], BINAURAL_NTAPS ); +#endif } } hHrtf->FASTCONV_HOA2_latency_s = 0; @@ -980,10 +987,17 @@ static ivas_error init_fastconv_HRTF_handle( { for ( j = 0; j < 9; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + set_zero( hHrtf->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); +#else set_zero( hHrtf->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRImag_HOA2[i][j], BINAURAL_NTAPS ); +#endif } } hHrtf->FASTCONV_FOA_latency_s = 0; @@ -991,10 +1005,17 @@ static ivas_error init_fastconv_HRTF_handle( { for ( j = 0; j < 4; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + set_zero( hHrtf->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); + set_zero( hHrtf->rightHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); +#else set_zero( hHrtf->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRImag_FOA[i][j], BINAURAL_NTAPS ); +#endif } } @@ -1114,42 +1135,69 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } hrtf_data_rptr += sizeof( uint16_t ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( BINAURAL_NTAPS_SBA != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS_SBA)" ); + } +#else if ( BINAURAL_NTAPS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } } @@ -1165,42 +1213,69 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } hrtf_data_rptr += sizeof( uint16_t ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( BINAURAL_NTAPS_SBA != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS_SBA)" ); + } +#else if ( BINAURAL_NTAPS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } } @@ -1216,42 +1291,69 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } hrtf_data_rptr += sizeof( uint16_t ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( BINAURAL_NTAPS_SBA != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS_SBA)" ); + } +#else if ( BINAURAL_NTAPS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_NTAPS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->leftHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->leftHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) { +#ifdef UPDATE_FASTCONV_SBA_FILTER + memcpy( ( *hHRTF )->rightHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); + hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); +#else memcpy( ( *hHRTF )->rightHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); +#endif } } } -- GitLab From 077bc4b90d4f72a528bebff165579a242ef99c3d Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Wed, 28 Jun 2023 15:47:27 +0530 Subject: [PATCH 0277/1418] Added fix for bit inexactness of renderer pytest [x]Also added fix for a few ASAN warnings --- lib_dec/ivas_binRenderer_internal.c | 17 ++++++++--------- lib_dec/ivas_dec.c | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index ed84955daf..f1e39caf8a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1589,7 +1589,7 @@ void ivas_binaural_reverb_processFrame( return; } -void ivas_binRenderer_2( +static void ivas_binRenderer_2( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1747,16 +1747,14 @@ void ivas_binRenderer_2( } } #endif - - +#ifdef FIX_SPLIT_REND_MERGE /* Obtain the binaural dmx and compute the reverb */ if ( hBinRenderer->hReverb != NULL ) { - float reverbRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float inRe[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - float inIm[BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - + float reverbRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float inRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; + float inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm ); for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) @@ -1768,7 +1766,7 @@ void ivas_binRenderer_2( } } - ivas_binaural_reverb_processFrame( hBinRenderer->hReverb, BINAURAL_CHANNELS, inRe, inIm, reverbRe, reverbIm, 0u ); + ivas_binaural_reverb_processSubframe( hBinRenderer->hReverb, BINAURAL_CHANNELS, numTimeSlots, inRe, inIm, reverbRe, reverbIm ); /* Add the conv module and reverb module output */ for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) @@ -1791,6 +1789,7 @@ void ivas_binRenderer_2( } } +#endif pop_wmops(); return; diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index fdabbaf08f..2ecb26f530 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -70,7 +70,9 @@ ivas_error ivas_dec( float pan_left, pan_right; ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS]; - +#ifdef FIX_BIT_EXACT + int16_t i, j, k, l; +#endif error = IVAS_ERR_OK; push_wmops( "ivas_dec" ); @@ -761,7 +763,22 @@ ivas_error ivas_dec( hSplitBinRend = &st_ivas->splitBinRend; max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; - +#ifdef FIX_BIT_EXACT + for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) + { + for ( j = 0; j < BINAURAL_CHANNELS; j++ ) + { + for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) + { + for ( l = 0; l < CLDFB_NO_CHANNELS_MAX; l++ ) + { + hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[i][j][k][l] = 0.0f; + hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[i][j][k][l] = 0.0f; + } + } + } + } +#endif ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, -- GitLab From e23c90a0410f224baaa6e5323b907921e2c34b90 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Thu, 29 Jun 2023 13:14:52 +0530 Subject: [PATCH 0278/1418] Fixes for the updation of the branch with main --- lib_dec/ivas_binRenderer_internal.c | 4 ++-- lib_dec/ivas_dec.c | 21 ++-------------- lib_dec/ivas_dirac_dec.c | 25 +++++++++++++++++-- lib_rend/lib_rend.c | 37 ++++++++++++++++++++++++++++- 4 files changed, 63 insertions(+), 24 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index f1e39caf8a..6c66a47ec7 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1395,8 +1395,8 @@ void ivas_binaural_cldfb_sf( #ifdef FIX_SPLIT_REND_MERGE st_ivas->hHeadTrackData, #endif -#ifdef FIX_SPLIT_REND_MERGE - NULL, +#ifdef SPLIT_REND_WITH_HEAD_ROT + &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif st_ivas->hCombinedOrientationData, subframeIdx, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 2ecb26f530..fdabbaf08f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -70,9 +70,7 @@ ivas_error ivas_dec( float pan_left, pan_right; ivas_error error; float *p_output[MAX_OUTPUT_CHANNELS]; -#ifdef FIX_BIT_EXACT - int16_t i, j, k, l; -#endif + error = IVAS_ERR_OK; push_wmops( "ivas_dec" ); @@ -763,22 +761,7 @@ ivas_error ivas_dec( hSplitBinRend = &st_ivas->splitBinRend; max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; -#ifdef FIX_BIT_EXACT - for ( i = 0; i < MAX_HEAD_ROT_POSES; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - for ( k = 0; k < CLDFB_NO_COL_MAX; k++ ) - { - for ( l = 0; l < CLDFB_NO_CHANNELS_MAX; l++ ) - { - hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[i][j][k][l] = 0.0f; - hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[i][j][k][l] = 0.0f; - } - } - } - } -#endif + ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 7940350a40..ef0a9de92d 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2937,7 +2937,7 @@ void ivas_dirac_dec_render_sf( st_ivas->hHeadTrackData, #endif #ifdef SPLIT_REND_WITH_HEAD_ROT - NULL, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif st_ivas->hCombinedOrientationData, subframe_idx, @@ -2946,7 +2946,28 @@ void ivas_dirac_dec_render_sf( Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); - +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + int16_t pos_idx; +#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG + for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) +#else + for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) +#endif + { + for ( slot_idx = 0; slot_idx < hDirAC->subframe_nbslots[subframe_idx]; slot_idx++ ) + { + for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) + { + mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); + mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); + } + } + } + } +#endif /* Inverse CLDFB*/ for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 0b1f104408..061481e0dc 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1422,12 +1422,13 @@ static ivas_error setRendInputActiveIsm( error = IVAS_ERR_OK; - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_LC3PLUS || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { +#ifndef FIX_SPLIT_REND_MERGE if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1438,6 +1439,12 @@ static ivas_error setRendInputActiveIsm( { return error; } +#else + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif } else if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) { @@ -1448,17 +1455,45 @@ static ivas_error setRendInputActiveIsm( } else { +#ifndef FIX_SPLIT_REND_MERGE + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } + else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR) + { + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, + NULL, *rendCtx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 1 +#endif + ) ) != IVAS_ERR_OK ) + { + return error; + } + } +#endif } -- GitLab From f190d90bbfa1783e1c296b87789811aab3c9b42f Mon Sep 17 00:00:00 2001 From: Ke Zhao Date: Thu, 29 Jun 2023 17:53:57 +1000 Subject: [PATCH 0279/1418] Use macros for SBA channel numbers --- lib_com/ivas_cnst.h | 7 +++++++ lib_com/options.h | 3 +-- lib_dec/ivas_binRenderer_internal.c | 6 +++--- lib_rend/ivas_rom_binauralRenderer.c | 24 ++++++++++++------------ lib_rend/ivas_rom_binauralRenderer.h | 24 ++++++++++++------------ lib_rend/ivas_stat_rend.h | 24 ++++++++++++------------ lib_util/hrtf_file_reader.c | 18 ++++++++++++------ 7 files changed, 59 insertions(+), 47 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 3228c578d7..fdb256474c 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -174,6 +174,9 @@ typedef enum #define CPE_CHANNELS 2 /* number of CPE (stereo) channels */ #define FOA_CHANNELS 4 /* number of FOA channels */ #define HOA2_CHANNELS 9 +#ifdef UPDATE_FASTCONV_SBA_FILTER +#define HOA3_CHANNELS 16 +#endif #define MAX_NUM_OBJECTS 4 /* max. number of audio objects */ @@ -1509,7 +1512,11 @@ typedef enum #define BINAURAL_NTAPS_MAX 96 #define HRTF_SH_ORDER 3 +#ifdef UPDATE_FASTCONV_SBA_FILTER +#define HRTF_SH_CHANNELS HOA3_CHANNELS +#else #define HRTF_SH_CHANNELS 16 +#endif #define HRTF_LS_CHANNELS 15 #define HRTF_NUM_BINS 60 #define REVERB_PREDELAY_MAX 20 /* Max input delay for reverb module */ diff --git a/lib_com/options.h b/lib_com/options.h index 012bb52d42..d91da64469 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,8 +160,7 @@ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ - -#define UPDATE_FASTCONV_SBA_FILTER +#define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index cc855055ec..348833d0b1 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -441,21 +441,21 @@ static ivas_error ivas_binaural_hrtf_open( } #ifdef UPDATE_FASTCONV_SBA_FILTER - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + for ( j = 0; j < HOA3_CHANNELS; j++ ) { mvr2r( leftHRIRReal_HOA3[i][j], HrtfFastConv->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); mvr2r( leftHRIRImag_HOA3[i][j], HrtfFastConv->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); mvr2r( rightHRIRReal_HOA3[i][j], HrtfFastConv->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); mvr2r( rightHRIRImag_HOA3[i][j], HrtfFastConv->rightHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); } - for ( j = 0; j < 9; j++ ) + for ( j = 0; j < HOA2_CHANNELS; j++ ) { mvr2r( leftHRIRReal_HOA2[i][j], HrtfFastConv->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); mvr2r( leftHRIRImag_HOA2[i][j], HrtfFastConv->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); mvr2r( rightHRIRReal_HOA2[i][j], HrtfFastConv->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); mvr2r( rightHRIRImag_HOA2[i][j], HrtfFastConv->rightHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); } - for ( j = 0; j < 4; j++ ) + for ( j = 0; j < FOA_CHANNELS; j++ ) { mvr2r( leftHRIRReal_FOA[i][j], HrtfFastConv->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); mvr2r( leftHRIRImag_FOA[i][j], HrtfFastConv->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index 2aea03c406..dfd82e0583 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -3676,7 +3676,7 @@ const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS]= #else const float FASTCONV_HOA3_latency_s = 0.000020833f; -const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.353305f, +0.566845f, +0.200116f}, @@ -4580,7 +4580,7 @@ const float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= } }; -const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.191323f, +0.550462f, -0.164703f}, @@ -5484,7 +5484,7 @@ const float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.353305f, +0.566845f, +0.200116f}, @@ -6388,7 +6388,7 @@ const float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][16][BINAURAL_NTAPS_SBA]= +const float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.191323f, +0.550462f, -0.164703f}, @@ -9515,7 +9515,7 @@ const float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS]= #else const float FASTCONV_HOA2_latency_s = 0.000020833f; -const float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +const float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.018159f, +0.985146f, +0.240506f}, @@ -10069,7 +10069,7 @@ const float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= } }; -const float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +const float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.067351f, +0.619497f, -0.224314f}, @@ -10623,7 +10623,7 @@ const float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +const float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.018159f, +0.985146f, +0.240506f}, @@ -11177,7 +11177,7 @@ const float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]= +const float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.067351f, +0.619497f, -0.224314f}, @@ -12953,7 +12953,7 @@ const float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS]= }; #else const float FASTCONV_FOA_latency_s = 0.000020833f; -const float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +const float leftHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.181652f, +0.754551f, +0.218658f}, @@ -13257,7 +13257,7 @@ const float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= } }; -const float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +const float leftHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.171042f, +0.590899f, -0.184148f}, @@ -13561,7 +13561,7 @@ const float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +const float rightHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]= { { {+0.181652f, +0.754551f, +0.218658f}, @@ -13865,7 +13865,7 @@ const float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= } }; -const float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]= +const float rightHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]= { { {-0.171042f, +0.590899f, -0.184148f}, diff --git a/lib_rend/ivas_rom_binauralRenderer.h b/lib_rend/ivas_rom_binauralRenderer.h index 9bfa68b074..daf6794c57 100644 --- a/lib_rend/ivas_rom_binauralRenderer.h +++ b/lib_rend/ivas_rom_binauralRenderer.h @@ -45,18 +45,18 @@ /* Binaural rendering data set based on HRIRs */ extern const float FASTCONV_HRIR_latency_s; #ifdef UPDATE_FASTCONV_SBA_FILTER -extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; -extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; -extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; -extern float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; -extern float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; -extern float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; -extern float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; -extern float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; -extern float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; -extern float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; -extern float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; -extern float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; +extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float leftHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; +extern float rightHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; #else extern float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; extern float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index abba25124c..f60e64b661 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -757,20 +757,20 @@ typedef struct ivas_hrtfs_fastconv_struct float FASTCONV_HOA3_latency_s; #ifdef UPDATE_FASTCONV_SBA_FILTER - float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; - float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; - float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; - float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS_SBA]; + float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_HOA3[BINAURAL_CONVBANDS][HOA3_CHANNELS][BINAURAL_NTAPS_SBA]; float FASTCONV_HOA2_latency_s; - float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; - float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; - float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; - float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][9][BINAURAL_NTAPS_SBA]; + float leftHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_HOA2[BINAURAL_CONVBANDS][HOA2_CHANNELS][BINAURAL_NTAPS_SBA]; float FASTCONV_FOA_latency_s; - float leftHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; - float leftHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; - float rightHRIRReal_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; - float rightHRIRImag_FOA[BINAURAL_CONVBANDS][4][BINAURAL_NTAPS_SBA]; + float leftHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; + float leftHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRReal_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; + float rightHRIRImag_FOA[BINAURAL_CONVBANDS][FOA_CHANNELS][BINAURAL_NTAPS_SBA]; #else float leftHRIRReal_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; float leftHRIRImag_HOA3[BINAURAL_CONVBANDS][HRTF_SH_CHANNELS][BINAURAL_NTAPS]; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index c2408e89ca..ed2e446a1a 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -967,14 +967,16 @@ static ivas_error init_fastconv_HRTF_handle( hHrtf->FASTCONV_HOA3_latency_s = 0; for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA3_CHANNELS; j++ ) + { set_zero( hHrtf->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRImag_HOA3[i][j], BINAURAL_NTAPS_SBA ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { set_zero( hHrtf->leftHRIRReal_HOA3[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_HOA3[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_HOA3[i][j], BINAURAL_NTAPS ); @@ -985,14 +987,16 @@ static ivas_error init_fastconv_HRTF_handle( hHrtf->FASTCONV_HOA2_latency_s = 0; for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < 9; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA2_CHANNELS; j++ ) + { set_zero( hHrtf->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRImag_HOA2[i][j], BINAURAL_NTAPS_SBA ); #else + for ( j = 0; j < 9; j++ ) + { set_zero( hHrtf->leftHRIRReal_HOA2[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_HOA2[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_HOA2[i][j], BINAURAL_NTAPS ); @@ -1003,14 +1007,16 @@ static ivas_error init_fastconv_HRTF_handle( hHrtf->FASTCONV_FOA_latency_s = 0; for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < 4; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < FOA_CHANNELS; j++ ) + { set_zero( hHrtf->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS_SBA ); set_zero( hHrtf->rightHRIRImag_FOA[i][j], BINAURAL_NTAPS_SBA ); #else + for ( j = 0; j < 4; j++ ) + { set_zero( hHrtf->leftHRIRReal_FOA[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->leftHRIRImag_FOA[i][j], BINAURAL_NTAPS ); set_zero( hHrtf->rightHRIRReal_FOA[i][j], BINAURAL_NTAPS ); -- GitLab From 4eaa34396476f3125b857fc642f61463beeb6a89 Mon Sep 17 00:00:00 2001 From: Ke Zhao Date: Fri, 30 Jun 2023 11:40:12 +1000 Subject: [PATCH 0280/1418] Fix bug with checking of channel numbers when reading HOA2 and FOA HRTF binary files --- lib_util/hrtf_file_reader.c | 93 +++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 24 deletions(-) diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index ed2e446a1a..4ad3073029 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1135,10 +1135,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( HOA3_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA3_CHANNELS)" ); + } +#else if ( HRTF_SH_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_SH_CHANNELS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); #ifdef UPDATE_FASTCONV_SBA_FILTER @@ -1156,12 +1163,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA3_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1169,12 +1178,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA3_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1182,12 +1193,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA3_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1195,12 +1208,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA3_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_HOA3[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1213,10 +1228,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( HOA2_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA2_CHANNELS)" ); + } +#else if ( HRTF_SH_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_SH_CHANNELS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); #ifdef UPDATE_FASTCONV_SBA_FILTER @@ -1234,12 +1256,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA2_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1247,12 +1271,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA2_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1260,12 +1286,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA2_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1273,12 +1301,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < HOA2_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_HOA2[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1291,10 +1321,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); +#ifdef UPDATE_FASTCONV_SBA_FILTER + if ( FOA_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (FOA_CHANNELS)" ); + } +#else if ( HRTF_SH_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_SH_CHANNELS)" ); } +#endif hrtf_data_rptr += sizeof( uint16_t ); #ifdef UPDATE_FASTCONV_SBA_FILTER @@ -1312,12 +1349,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < FOA_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1325,12 +1364,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < FOA_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->leftHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1338,12 +1379,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < FOA_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRReal_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif @@ -1351,12 +1394,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { - for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) - { #ifdef UPDATE_FASTCONV_SBA_FILTER + for ( j = 0; j < FOA_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS_SBA * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS_SBA * sizeof( float ); #else + for ( j = 0; j < HRTF_SH_CHANNELS; j++ ) + { memcpy( ( *hHRTF )->rightHRIRImag_FOA[i][j], hrtf_data_rptr, BINAURAL_NTAPS * sizeof( float ) ); hrtf_data_rptr += BINAURAL_NTAPS * sizeof( float ); #endif -- GitLab From d4a62614e7ed0f52e565c5361e67636c4fa8fa71 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 30 Jun 2023 09:02:32 +0300 Subject: [PATCH 0281/1418] Fixes issue 585 by correcting condition --- lib_com/ivas_prot.h | 4 ++++ lib_com/options.h | 1 + lib_dec/ivas_dec.c | 4 ++++ lib_dec/ivas_jbm_dec.c | 4 ++++ lib_dec/ivas_masa_dec.c | 10 +++++++++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 9bc253776d..f39e5a4aa5 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5121,6 +5121,10 @@ void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ const int16_t output_frame /* i : output frame length per channel */ +#ifdef FIX_585_MASA_2TC_DTX_EXT + , + const int16_t nchan_remapped /* i : number of transports used in core */ +#endif ); diff --git a/lib_com/options.h b/lib_com/options.h index e4d3a06b58..81f53ae13c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,6 +161,7 @@ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ +#define FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 439a90fb2c..6ba9a31bb1 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -390,7 +390,11 @@ ivas_error ivas_dec( if ( st_ivas->ivas_format == MASA_FORMAT ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); +#else ivas_masa_prerender( st_ivas, output, output_frame ); +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index ff28af051a..9c0fc76955 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -292,7 +292,11 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); +#else ivas_masa_prerender( st_ivas, output, output_frame ); +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 0576fe8121..57b628b5f8 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -565,10 +565,18 @@ static ivas_error ivas_masa_dec_config( void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ - const int16_t output_frame /* i : output frame length per channel */ + const int16_t output_frame /* i : output frame length per channel */ +#ifdef FIX_585_MASA_2TC_DTX_EXT + , + const int16_t nchan_remapped /* i : number of transports used in core */ +#endif ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && nchan_remapped == 1 ) +#else if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) +#endif { if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) { -- GitLab From 27b490a31ea94e3e53d29b6ef51cf1987e3e6217 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 30 Jun 2023 09:18:51 +0300 Subject: [PATCH 0282/1418] Apply clang format --- lib_dec/ivas_masa_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 57b628b5f8..1ad0a36427 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -565,7 +565,7 @@ static ivas_error ivas_masa_dec_config( void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ - const int16_t output_frame /* i : output frame length per channel */ + const int16_t output_frame /* i : output frame length per channel */ #ifdef FIX_585_MASA_2TC_DTX_EXT , const int16_t nchan_remapped /* i : number of transports used in core */ -- GitLab From 15281eaf66487c23e903fd0c30591db5f605609c Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Fri, 30 Jun 2023 09:32:42 +0200 Subject: [PATCH 0283/1418] Fix binaural crash --- lib_dec/ivas_jbm_dec.c | 3 +- lib_dec/ivas_mc_paramupmix_dec.c | 58 +++++++++++++++++++------------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index c86739c323..9119451443 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -397,7 +397,6 @@ ivas_error ivas_jbm_dec_tc( ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); } } - } #endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) @@ -1494,7 +1493,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( #ifdef JBM_PARAMUPMIX else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - num_tc = MC_PARAMUPMIX_MAX_INPUT_CHANS; + num_tc = MC_PARAMUPMIX_MAX_INPUT_CHANS; } #endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index d23be11bf5..421f008396 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -302,8 +302,8 @@ void ivas_mc_paramupmix_dec( #ifdef JBM_PARAMUPMIX void ivas_mc_paramupmix_dec_digest_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ ) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -311,7 +311,7 @@ void ivas_mc_paramupmix_dec_digest_tc( assert( hMCParamUpmix ); push_wmops( "ivas_mc_paramupmix_dec_digest_tc" ); - + ivas_param_upmix_dec_decorr_subframes( st_ivas ); /* adapt subframes */ @@ -324,12 +324,12 @@ void ivas_mc_paramupmix_dec_digest_tc( void ivas_mc_paramupmix_dec_render( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ - uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ - uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ - float *input_f[], /* i: core-coder transport channels */ - float *output_f[] /* i/o: synthesized core-coder transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint16_t nSamplesAsked, /* i : number of CLDFB slots requested */ + uint16_t *nSamplesRendered, /* o : number of CLDFB slots rendered */ + uint16_t *nSamplesAvailable, /* o : number of CLDFB slots still to render */ + float *input_f[], /* i: core-coder transport channels */ + float *output_f[] /* i/o: synthesized core-coder transport channels */ ) { int16_t slots_to_render, first_sf, last_sf, subframe_idx; @@ -346,7 +346,7 @@ void ivas_mc_paramupmix_dec_render( output_f_local[ch] = output_f[ch]; } - slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); + slot_size = st_ivas->hTcBuffer->n_samples_granularity; /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */ slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, nSamplesAsked / slot_size ); @@ -356,7 +356,7 @@ void ivas_mc_paramupmix_dec_render( for ( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) { - mvr2r( input_f[ch], output_f_local[ch], *nSamplesRendered); + mvr2r( input_f[ch], output_f_local[ch], *nSamplesRendered ); } while ( slots_to_render > 0 ) @@ -387,12 +387,19 @@ void ivas_mc_paramupmix_dec_render( *nSamplesAvailable = ( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered ) * slot_size; + /* Binaural renderer will do the slot rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + st_ivas->hTcBuffer->slots_rendered = 0; + st_ivas->hTcBuffer->subframes_rendered = 0; + } + + pop_wmops(); } #endif - /*------------------------------------------------------------------------- * ivas_mc_paramupmix_dec_open() * @@ -478,9 +485,12 @@ ivas_error ivas_mc_paramupmix_dec_open( { nchan_to_allocate = 2 * BINAURAL_CHANNELS; } - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) + if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - return error; + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) + { + return error; + } } if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) { @@ -588,14 +598,14 @@ static void paramupmix_td_decorr_process_jbm( } static void ivas_param_upmix_dec_decorr_subframes( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ + Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ ) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; int16_t i, ch; int32_t output_Fs; int16_t output_frame; - float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ + float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ float *p_tc[MC_PARAMUPMIX_MAX_INPUT_CHANS]; hMCParamUpmix = st_ivas->hMCParamUpmix; @@ -613,7 +623,7 @@ static void ivas_param_upmix_dec_decorr_subframes( for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { - pPcm_temp[i] = p_tc[8+i]; /* decorrelated */ + pPcm_temp[i] = p_tc[8 + i]; /* decorrelated */ } paramupmix_td_decorr_process_jbm( hMCParamUpmix->hTdDecorr, &( p_tc[4] ), pPcm_temp, output_frame ); @@ -753,13 +763,13 @@ static void ps_pred_process_sf( } -static void ivas_mc_paramupmix_dec_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ +static void ivas_mc_paramupmix_dec_sf( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ ) { int16_t i, ch, slot_idx, k; - float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ + float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ /*CLDFB*/ float Cldfb_RealBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS][JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; @@ -772,7 +782,7 @@ static void ivas_mc_paramupmix_dec_sf( for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) { - pPcm_temp[2 * i] = output_f[i + 4]; /* un-decorrelated */ + pPcm_temp[2 * i] = output_f[i + 4]; /* un-decorrelated */ pPcm_temp[2 * i + 1] = output_f[i + 8]; /* decorrelated */ } @@ -839,7 +849,7 @@ static void ivas_mc_paramupmix_dec_sf( /* adjust delay of other channels */ noparamupmix_delay = NS2SA( st_ivas->hDecoderConfig->output_Fs, IVAS_FB_DEC_DELAY_NS ); n_samples_rendered = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered] * hMCParamUpmix->num_freq_bands; - if (n_samples_rendered > noparamupmix_delay) + if ( n_samples_rendered > noparamupmix_delay ) { for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) { @@ -858,7 +868,7 @@ static void ivas_mc_paramupmix_dec_sf( mvr2r( &output_f[ch][0], tmp_buf, n_samples_rendered ); mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], n_samples_rendered ); mvr2r( &hMCParamUpmix->pcm_delay[ch][n_samples_rendered], &hMCParamUpmix->pcm_delay[ch][0], noparamupmix_delay - n_samples_rendered ); - mvr2r( tmp_buf, &hMCParamUpmix->pcm_delay[ch][noparamupmix_delay-n_samples_rendered], n_samples_rendered ); + mvr2r( tmp_buf, &hMCParamUpmix->pcm_delay[ch][noparamupmix_delay - n_samples_rendered], n_samples_rendered ); } } -- GitLab From d9deaa78ac41b63ce1ece98aaf41f833725a6e9a Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Fri, 30 Jun 2023 09:57:02 +0200 Subject: [PATCH 0284/1418] Adapt interpolators --- lib_dec/ivas_mc_paramupmix_dec.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 421f008396..d1e25c18e1 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -317,8 +317,15 @@ void ivas_mc_paramupmix_dec_digest_tc( /* adapt subframes */ ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); - + if (st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM) + { + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_SUBFRAMES_5MS, nCldfbSlots, hMCParamUpmix->param_interpolator ); + } + else + { + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); + } + pop_wmops(); } @@ -394,7 +401,6 @@ void ivas_mc_paramupmix_dec_render( st_ivas->hTcBuffer->subframes_rendered = 0; } - pop_wmops(); } #endif @@ -475,6 +481,11 @@ ivas_error ivas_mc_paramupmix_dec_open( buffer_mode = TC_BUFFER_MODE_RENDERER; nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); nchan_to_allocate = nchan_tc; + if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); + } + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) { buffer_mode = TC_BUFFER_MODE_BUFFER; @@ -485,18 +496,18 @@ ivas_error ivas_mc_paramupmix_dec_open( { nchan_to_allocate = 2 * BINAURAL_CHANNELS; } - if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_SUBFRAMES_5MS, DEFAULT_JBM_SUBFRAMES_5MS, hMCParamUpmix->param_interpolator ); + } + else { if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) { return error; } + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } - if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); - } - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } #endif -- GitLab From ab953740461977eb13f5c74322278439cb4b8156 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 30 Jun 2023 09:58:32 +0200 Subject: [PATCH 0285/1418] fail complexity jobs when a mode fails stil upload all data for the successful modes --- .gitlab-ci.yml | 19 +++++++++++++------ ci/complexity_measurements/getWmops.sh | 5 ++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b365c0e22d..7f461d4df7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1193,6 +1193,7 @@ coverage-test-on-main-scheduled: stage: test artifacts: name: "$CI_JOB_NAME--$CI_COMMIT_REF_NAME--sha-$CI_COMMIT_SHA" + when: always expire_in: 1 week paths: - $CI_JOB_NAME-public @@ -1208,8 +1209,9 @@ complexity-stereo-in-stereo-out: - *complexity-measurements-setup - in_format=stereo - out_format=stereo - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val complexity-ism-in-binaural-out: extends: @@ -1224,8 +1226,9 @@ complexity-ism-in-binaural-out: - *complexity-measurements-setup - in_format=ISM - out_format=BINAURAL - - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val complexity-sba-hoa3-in-hoa3-out: extends: @@ -1240,8 +1243,9 @@ complexity-sba-hoa3-in-hoa3-out: - *complexity-measurements-setup - in_format=SBA - out_format=HOA3 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val complexity-mc-in-7_1_4-out: extends: @@ -1256,8 +1260,9 @@ complexity-mc-in-7_1_4-out: - *complexity-measurements-setup - in_format=MC - out_format=7_1_4 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val complexity-masa-in-7_1_4-out: extends: @@ -1272,8 +1277,9 @@ complexity-masa-in-7_1_4-out: - *complexity-measurements-setup - in_format=MASA - out_format=7_1_4 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val complexity-StereoDmxEVS-stereo-in-mono-out: extends: @@ -1288,8 +1294,9 @@ complexity-StereoDmxEVS-stereo-in-mono-out: - *complexity-measurements-setup - in_format=StereoDmxEVS - out_format=mono - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? - *complexity-measurements-prepare-artifacts + - exit $ret_val # --------------------------------------------------------------- # Other jobs diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index baec52ab6f..e81575892b 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -53,8 +53,11 @@ config_file="scripts/config/ci_linux_ltv.json" wmopsFilenameFlcLast=wmops_newsletter_stereo__${commit_sha}_${date} wmopsFilenameFlc=${destDir}/wmops/logs/${wmopsFilenameFlcLast} +ret_val=0 + # instrument and build ./scripts/IvasBuildAndRunChecks.py -p $config_file --checks COMPLEXITY --create_complexity_tables ${wmopsFilenameFlc} -C $ivas_format -f ${ep} --oc $output_format +ret_val=$? # get the info on worst-case operating point: WMOPS number, enc-operating mode, dec-operating mode ### WMOPS @@ -83,4 +86,4 @@ ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM - +exit $ret_val \ No newline at end of file -- GitLab From b282f5e8a26b00fcee60f4d1b2f20955482d8442 Mon Sep 17 00:00:00 2001 From: Sumeyra Kanik Date: Fri, 30 Jun 2023 10:50:23 +0200 Subject: [PATCH 0286/1418] Move printout message up --- apps/renderer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 557c626871..17300a695a 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1393,13 +1393,6 @@ int main( exit( -1 ); } - if ( !args.quietModeEnabled && args.delayCompensationEnabled ) - { - fprintf( stdout, "\nRenderer delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); - } - - fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); - #ifdef FIX_488_SYNC_DELAY if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { @@ -1407,6 +1400,13 @@ int main( } #endif + if ( !args.quietModeEnabled && args.delayCompensationEnabled ) + { + fprintf( stdout, "\nRenderer delay: %-5u [samples] - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale ); + } + + fprintf( stdout, "\n\nRendering of %d frames finished\n\n", frame ); + #ifdef DEBUGGING int32_t cnt_frames_limited, noClipping; if ( ( cnt_frames_limited = IVAS_REND_GetCntFramesLimited( hIvasRend ) ) > 0 ) -- GitLab From 7d1fb57939a87cbe58af22c6ad004d94fe1800e4 Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 30 Jun 2023 11:09:49 +0200 Subject: [PATCH 0287/1418] get return value from getWmops correctly --- .gitlab-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f461d4df7..6fc7d44893 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1209,7 +1209,8 @@ complexity-stereo-in-stereo-out: - *complexity-measurements-setup - in_format=stereo - out_format=stereo - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1226,7 +1227,8 @@ complexity-ism-in-binaural-out: - *complexity-measurements-setup - in_format=ISM - out_format=BINAURAL - - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1243,7 +1245,8 @@ complexity-sba-hoa3-in-hoa3-out: - *complexity-measurements-setup - in_format=SBA - out_format=HOA3 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1260,7 +1263,8 @@ complexity-mc-in-7_1_4-out: - *complexity-measurements-setup - in_format=MC - out_format=7_1_4 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1277,7 +1281,8 @@ complexity-masa-in-7_1_4-out: - *complexity-measurements-setup - in_format=MASA - out_format=7_1_4 - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val @@ -1294,7 +1299,8 @@ complexity-StereoDmxEVS-stereo-in-mono-out: - *complexity-measurements-setup - in_format=StereoDmxEVS - out_format=mono - - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$? + - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" + - ret_val=$? - *complexity-measurements-prepare-artifacts - exit $ret_val -- GitLab From 0e6288ee6932bebed18fa425ff8e3f9a2fa24919 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 14:54:02 +0200 Subject: [PATCH 0288/1418] Make gitignoring ref executables more generic --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1829cde3a7..a0132de63b 100644 --- a/.gitignore +++ b/.gitignore @@ -48,9 +48,9 @@ tests/dut tests/ref scripts/testv/*_cut*.pcm # default reference binary name -IVAS_cod_ref -IVAS_dec_ref -IVAS_rend_ref +IVAS_cod_ref* +IVAS_dec_ref* +IVAS_rend_ref* # Python files that pop up when running scripts __pycache__/ -- GitLab From 100970f829e71212866d28f3c440dfcdcf3e2efc Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:00:45 +0200 Subject: [PATCH 0289/1418] Add ivas-razel-runner as submodule --- .gitmodules | 4 ++++ scripts/razel/ivas_razel_runner | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 scripts/razel/ivas_razel_runner diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..3ca7eb7d97 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "scripts/razel/ivas_razel_runner"] + path = scripts/razel/ivas_razel_runner + url = git@git01.iis.fhg.de:sgi/ivas-razel-runner.git + branch = rend diff --git a/scripts/razel/ivas_razel_runner b/scripts/razel/ivas_razel_runner new file mode 160000 index 0000000000..3096b12e17 --- /dev/null +++ b/scripts/razel/ivas_razel_runner @@ -0,0 +1 @@ +Subproject commit 3096b12e173137dfbafa9fe6658bdf461c6529f3 -- GitLab From 155596955316f0ab26d5435f337b3907b4c3ecc6 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:12:31 +0200 Subject: [PATCH 0290/1418] Update ivas-razel-runner --- scripts/razel/ivas_razel_runner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/razel/ivas_razel_runner b/scripts/razel/ivas_razel_runner index 3096b12e17..9bc7a9da1c 160000 --- a/scripts/razel/ivas_razel_runner +++ b/scripts/razel/ivas_razel_runner @@ -1 +1 @@ -Subproject commit 3096b12e173137dfbafa9fe6658bdf461c6529f3 +Subproject commit 9bc7a9da1c25a9b2845f0a816f8427c6c611d83a -- GitLab From c1eb02d624c0d2e2c8e408420520b913605c7f14 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:15:28 +0200 Subject: [PATCH 0291/1418] Add test scripts for Razel --- scripts/razel/ivas_files_map_for_razel.py | 82 ++++++++++ scripts/razel/test_renderer_razel.py | 177 ++++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 scripts/razel/ivas_files_map_for_razel.py create mode 100755 scripts/razel/test_renderer_razel.py diff --git a/scripts/razel/ivas_files_map_for_razel.py b/scripts/razel/ivas_files_map_for_razel.py new file mode 100644 index 0000000000..0939b0b53b --- /dev/null +++ b/scripts/razel/ivas_files_map_for_razel.py @@ -0,0 +1,82 @@ +from typing import Optional + +from ivas_razel_runner.include.core import ( + AudioConfig, + AudioFormat, + AudioSampleType, + CustomSpeakerLayoutFile, + File, + Files, + SceneDescriptionFile, + WavFile, +) +from ivas_razel_runner.include.ivas_rend import IvasRendInputFile + + +def in_file_for_audio_config(config: AudioConfig | SceneDescriptionFile) -> IvasRendInputFile: + if config == AudioFormat.MONO: + return WavFile("scripts/testv/stv48c.wav", True, 48000, 1, AudioSampleType.INT16) + if config == AudioFormat.STEREO: + return WavFile("scripts/testv/stvST48c.wav", True, 48000, 2, AudioSampleType.INT16) + if config == AudioFormat.ISM1: + return WavFile("scripts/testv/stv1ISM48s.wav", True, 48000, 1, AudioSampleType.INT16) + if config == AudioFormat.ISM2: + return WavFile("scripts/testv/stv2ISM48s.wav", True, 48000, 2, AudioSampleType.INT16) + if config == AudioFormat.ISM3: + return WavFile("scripts/testv/stv3ISM48s.wav", True, 48000, 3, AudioSampleType.INT16) + if config == AudioFormat.ISM4: + return WavFile("scripts/testv/stv4ISM48s.wav", True, 48000, 4, AudioSampleType.INT16) + if config == AudioFormat.MC_5_1: + return WavFile("scripts/testv/stv51MC48c.wav", True, 48000, 6, AudioSampleType.INT16) + if config == AudioFormat.MC_7_1: + return WavFile("scripts/testv/stv71MC48c.wav", True, 48000, 8, AudioSampleType.INT16) + if config == AudioFormat.MC_5_1_2: + return WavFile("scripts/testv/stv512MC48c.wav", True, 48000, 8, AudioSampleType.INT16) + if config == AudioFormat.MC_5_1_4: + return WavFile("scripts/testv/stv514MC48c.wav", True, 48000, 10, AudioSampleType.INT16) + if config == AudioFormat.MC_7_1_4: + return WavFile("scripts/testv/stv714MC48c.wav", True, 48000, 12, AudioSampleType.INT16) + if config == AudioFormat.FOA: + return WavFile("scripts/testv/stvFOA48c.wav", True, 48000, 4, AudioSampleType.INT16) + if config == AudioFormat.HOA2: + return WavFile("scripts/testv/stv2OA48c.wav", True, 48000, 9, AudioSampleType.INT16) + if config == AudioFormat.HOA3: + return WavFile("scripts/testv/stv3OA48c.wav", True, 48000, 16, AudioSampleType.INT16) + if config == AudioFormat.MASA1: + return WavFile("scripts/testv/stv2MASA1TC48c.wav", True, 48000, 1, AudioSampleType.INT16) + if config == AudioFormat.MASA2: + return WavFile("scripts/testv/stv2MASA2TC48c.wav", True, 48000, 2, AudioSampleType.INT16) + if isinstance(config, SceneDescriptionFile): + return config + if isinstance(config, CustomSpeakerLayoutFile): + # Assume test file is 5_1 for now + assert config.num_channels == AudioFormat.MC_5_1.num_channels + return WavFile("scripts/testv/stv51MC48c.wav", True, 48000, 6, AudioSampleType.INT16) + + raise RuntimeError(f"No input file for audio config {config}") + + +def md_files_for_audio_config(config: AudioConfig | SceneDescriptionFile) -> Optional[Files]: + if config == AudioFormat.ISM1: + return [File("scripts/testv/stvISM1.csv", True)] + if config == AudioFormat.ISM2: + return [File("scripts/testv/stvISM1.csv", True), File("scripts/testv/stvISM2.csv", True)] + if config == AudioFormat.ISM3: + return [ + File("scripts/testv/stvISM1.csv", True), + File("scripts/testv/stvISM2.csv", True), + File("scripts/testv/stvISM3.csv", True), + ] + if config == AudioFormat.ISM4: + return [ + File("scripts/testv/stvISM1.csv", True), + File("scripts/testv/stvISM2.csv", True), + File("scripts/testv/stvISM3.csv", True), + File("scripts/testv/stvISM4.csv", True), + ] + if config == AudioFormat.MASA1: + return [File("scripts/testv/stv2MASA1TC48c.met", True)] + if config == AudioFormat.MASA2: + return [File("scripts/testv/stv2MASA2TC48c.met", True)] + + return None diff --git a/scripts/razel/test_renderer_razel.py b/scripts/razel/test_renderer_razel.py new file mode 100755 index 0000000000..4a61dcfa57 --- /dev/null +++ b/scripts/razel/test_renderer_razel.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 + +import itertools +import logging +from pathlib import Path + +from ivas_files_map_for_razel import in_file_for_audio_config, md_files_for_audio_config +from ivas_razel_runner.include.core import ( + AudioFile, + AudioFormat, + CustomSpeakerLayoutFile, + File, + FileFormat, + SceneDescriptionFile, + WavDiffArgs, + WavFile, +) +from ivas_razel_runner.include.ivas_rend import IvasRend, IvasRendConfig, UnsupportedConfigWarning +from ivas_razel_runner.include.sox import Sox +from razel import Razel + +####################################################### + +BINAURAL_FORMATS = [ + AudioFormat.BINAURAL, + AudioFormat.BINAURAL_ROOM_IR, + AudioFormat.BINAURAL_ROOM_REVERB, +] +DEFAULT_CUSTOM_SPEAKER_LAYOUT = CustomSpeakerLayoutFile("scripts/ls_layouts/cicp6.txt", 6) +DEFAULT_SCENE_DESCRIPTION_FILE = SceneDescriptionFile("_dev/in/scene_ism2.txt", in_file_for_audio_config(AudioFormat.ISM2)) # type: ignore + +####################################################### + +INPUT_FORMATS = IvasRend.get_valid_in_audio_configs(DEFAULT_CUSTOM_SPEAKER_LAYOUT, DEFAULT_SCENE_DESCRIPTION_FILE) +OUTPUT_FORMATS = IvasRend.get_valid_out_audio_configs(DEFAULT_CUSTOM_SPEAKER_LAYOUT) +HEAD_ROTATION_FILES = [File("scripts/testv/headrot_case00_3000_q.csv", True), None] +SAMPLING_RATES = [48000] # TODO(sgi): use others + +####################################################### + +KNOWN_BROKEN_BASELINE_CONFIGS = [ + lambda config: config.in_audio_config == AudioFormat.MASA1, + lambda config: isinstance(config.in_audio_config, SceneDescriptionFile), + lambda config: config.in_audio_config == AudioFormat.MASA2 + and isinstance(config.out_audio_config, CustomSpeakerLayoutFile), + lambda config: config.in_audio_config == AudioFormat.MASA2 + and config.out_audio_config in [AudioFormat.BINAURAL_ROOM_IR, AudioFormat.BINAURAL_ROOM_REVERB], +] +KNOWN_CLIPPING_CONFIGS = [ + lambda config: config.in_audio_config + in [AudioFormat.MC_5_1_2, AudioFormat.MC_5_1_4, AudioFormat.MC_5_1, AudioFormat.MC_7_1_4, AudioFormat.MC_7_1] + and config.out_audio_config in [AudioFormat.MONO, AudioFormat.FOA, AudioFormat.HOA2, AudioFormat.HOA3], + lambda config: isinstance(config.in_audio_config, CustomSpeakerLayoutFile) + and config.out_audio_config + in [AudioFormat.MONO, AudioFormat.STEREO, AudioFormat.FOA, AudioFormat.HOA2, AudioFormat.HOA3], + lambda config: config.in_audio_config + in [ + AudioFormat.MC_5_1, + AudioFormat.MC_5_1_2, + AudioFormat.MC_5_1_4, + AudioFormat.MC_7_1, + AudioFormat.MC_7_1_4, + AudioFormat.FOA, + AudioFormat.HOA2, + AudioFormat.HOA3, + ] + and config.out_audio_config in BINAURAL_FORMATS, +] +NON_BE_TO_REF_WITH_5MS_FRAMING = [ + lambda config: config.in_audio_config + in [ + AudioFormat.ISM1, + AudioFormat.ISM2, + AudioFormat.ISM3, + AudioFormat.ISM4, + ] + and config.out_audio_config != AudioFormat.MONO, + lambda config: config.in_audio_config + in [ + AudioFormat.MASA1, + AudioFormat.MASA2, + ], +] +NON_BE_TO_REF_WITH_20MS_FRAMING = [ + lambda config: config.out_audio_config in BINAURAL_FORMATS and config.head_rotation is not None, +] + +####################################################### + + +def main(): + root_workspace = Path(__file__).parent / ".." / ".." + Razel.init(str(root_workspace)) + logging.basicConfig(level=logging.INFO) + + rend_cut = IvasRend(str(root_workspace / "IVAS_rend")) + rend_ref = IvasRend(str(root_workspace / "IVAS_rend_ref_5ms")) + sox = Sox("sox") + AudioFile.set_audio_conversion_tool(sox) + + # Define exceptional configs - order matters here! + rend_ref.add_support_check_for_nonstandard_configs(match_broken_config) + rend_cut.add_support_check_for_nonstandard_configs(match_broken_config) + rend_ref.add_support_check_for_nonstandard_configs( + # Reference can do binaural rendering with 20 ms frames + lambda config: config.out_audio_config in BINAURAL_FORMATS + and config.in_audio_config not in [AudioFormat.MONO, AudioFormat.STEREO] + and not config.framing_5ms + ) + + for in_format, out_format, head_rotation_file in itertools.product( + INPUT_FORMATS, OUTPUT_FORMATS, HEAD_ROTATION_FILES + ): + in_file = in_file_for_audio_config(in_format) + md_files = md_files_for_audio_config(in_format) + config = IvasRendConfig(in_format, out_format, md_files, head_rotation=head_rotation_file, framing_5ms=False) + + if any(match(config) for match in KNOWN_CLIPPING_CONFIGS): + config.input_gain = 0.2 + + # These files' length is not a multiple of 5ms, which causes different output lengths with 5ms framing on/off + if in_file.basename in ["stvFOA48c.wav", "stv2OA48c.wav", "stv3OA48c.wav"]: + assert isinstance(in_file, WavFile) + in_file = in_file.trim(0, 20) + + # Run REF 20ms + try: + out_20ms_ref = rend_ref.render(in_file, config, FileFormat.WAV) + except UnsupportedConfigWarning as e: + logging.info("%s Skipping %s", e.reason, config) + out_20ms_ref = None + + # Run CUT 20ms + try: + out_20ms_cut = rend_cut.render(in_file, config, FileFormat.WAV) + except UnsupportedConfigWarning as e: + logging.info("%s Skipping %s", e.reason, config) + out_20ms_cut = None + + if out_20ms_ref and out_20ms_cut: + if any(match(config) for match in NON_BE_TO_REF_WITH_20MS_FRAMING): + assert isinstance(out_20ms_cut, WavFile) + out_20ms_cut.should_not_equal(out_20ms_ref) + out_20ms_cut.should_be_similar_to(out_20ms_ref, WavDiffArgs(mld_max=0.01)) + else: + out_20ms_cut.should_equal(out_20ms_ref) + + # Run CUT 5ms + config.framing_5ms = True + try: + out_5ms_cut = rend_cut.render(in_file, config, FileFormat.WAV) + except UnsupportedConfigWarning as e: + logging.info("%s Skipping %s", e.reason, config) + out_5ms_cut = None + + if out_5ms_cut and out_20ms_ref: + if any(match(config) for match in NON_BE_TO_REF_WITH_5MS_FRAMING): + assert isinstance(out_5ms_cut, WavFile) + out_5ms_cut.should_not_equal(out_20ms_ref) + out_5ms_cut.should_be_similar_to( + out_20ms_ref, WavDiffArgs(mld_max=16) + ) # TODO(sgi): also test ISM with no metadata (should be BE) + else: + out_5ms_cut.should_equal(out_20ms_ref) + + Razel.instance().run(["exec", "-k"]) + + +def match_broken_config(config): + if any(match(config) for match in KNOWN_BROKEN_BASELINE_CONFIGS): + raise UnsupportedConfigWarning("Known broken config.") + + return False + + +if __name__ == "__main__": + main() -- GitLab From 0adf96d7ec9542a2cf470b33e0ad16085d8babb4 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:22:30 +0200 Subject: [PATCH 0292/1418] Add CI job for 5ms framing --- .gitlab-ci-custom.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index f3453eedff..2ce99be7c9 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -368,6 +368,48 @@ renderer-msan: - report-junit.xml +renderer-5ms-framing-asan: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-cmake"] + stage: test + script: + # Build reference executable - 5ms framing disabled + - cp lib_com/options.h lib_com/options.h.bak + - sed -i '/API_5MS/d' lib_com/options.h + - mkdir cmake-build && cmake -B cmake-build . && cmake --build cmake-build -- -j + - cp cmake-build/IVAS_rend IVAS_rend_ref + + # Build test executable + - mv -f lib_com/options.h.bak lib_com/options.h + - cmake -B cmake-build -DCLANG=asan . && cmake --build cmake-build -- -j + - cp cmake-build/IVAS_rend . + + # Run Razel test + - scripts/razel/test_renderer_razel.py + +renderer-5ms-framing-msan: + extends: + - .test-job-linux + - .rules-merge-request + needs: ["build-codec-linux-cmake"] + stage: test + script: + # Build reference executable - 5ms framing disabled + - cp lib_com/options.h lib_com/options.h.bak + - sed -i '/API_5MS/d' lib_com/options.h + - mkdir cmake-build && cmake -B cmake-build . && cmake --build cmake-build -- -j + - cp cmake-build/IVAS_rend IVAS_rend_ref + + # Build test executable + - mv -f lib_com/options.h.bak lib_com/options.h + - cmake -B cmake-build -DCLANG=msan . && cmake --build cmake-build -- -j + - cp cmake-build/IVAS_rend . + + # Run Razel test + - scripts/razel/test_renderer_razel.py + .merge-request-comparison-setup-codec: &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons - make clean -- GitLab From b8c5069e6b8c468be39388199ba7d17de0cb1a79 Mon Sep 17 00:00:00 2001 From: Vidhya V P <100825@ittiam.com> Date: Fri, 30 Jun 2023 18:57:06 +0530 Subject: [PATCH 0293/1418] Minor modification [x]A change that that missed while updating the branch --- lib_dec/ivas_spar_decoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 906a73b317..352d99ba9e 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1678,7 +1678,11 @@ void ivas_spar_dec_upmixer_sf( } else { - if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB +#ifdef SPLIT_REND_WITH_HEAD_ROT + || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM +#endif + ) ) { for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { -- GitLab From 963bc877016791fe92960e3589f9338aec2afdd3 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:27:32 +0200 Subject: [PATCH 0294/1418] [tmp] debug submodule --- .gitlab-ci-custom.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 2ce99be7c9..9413dc8573 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -396,6 +396,7 @@ renderer-5ms-framing-msan: needs: ["build-codec-linux-cmake"] stage: test script: + - git submodule status # tmp DBG # Build reference executable - 5ms framing disabled - cp lib_com/options.h lib_com/options.h.bak - sed -i '/API_5MS/d' lib_com/options.h -- GitLab From 77f916883e1039e2157230dd098efa1b8599057b Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:30:27 +0200 Subject: [PATCH 0295/1418] [tmp] debug submodule --- .gitlab-ci-custom.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 9413dc8573..f49a8fab71 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -396,7 +396,11 @@ renderer-5ms-framing-msan: needs: ["build-codec-linux-cmake"] stage: test script: - - git submodule status # tmp DBG + # tmp DBG + - git submodule status + - ls -la scripts/razel + - ls -la scripts/razel/ivas_razel_runner + # Build reference executable - 5ms framing disabled - cp lib_com/options.h lib_com/options.h.bak - sed -i '/API_5MS/d' lib_com/options.h -- GitLab From dba2648e8d82ec2ceabdc0aa608c22ce33abba75 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:34:00 +0200 Subject: [PATCH 0296/1418] Fix submodule checkout --- .gitlab-ci-custom.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index f49a8fab71..dc11fb76ac 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -21,6 +21,7 @@ variables: UPSTREAM_URL: "https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/" INTERNAL_TESTV_DIR: "/testv" INTERNAL_CI_REPO_CLONE_DIR: "ivas-internal-ci" + GIT_SUBMODULE_STRATEGY: recursive # This sets when pipelines are created. Jobs have more specific rules to restrict them. -- GitLab From 65413e7ff8a307605fa95732212322ed01f10898 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 15:35:48 +0200 Subject: [PATCH 0297/1418] Remove debugging code --- .gitlab-ci-custom.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index dc11fb76ac..2771d66f37 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -397,11 +397,6 @@ renderer-5ms-framing-msan: needs: ["build-codec-linux-cmake"] stage: test script: - # tmp DBG - - git submodule status - - ls -la scripts/razel - - ls -la scripts/razel/ivas_razel_runner - # Build reference executable - 5ms framing disabled - cp lib_com/options.h lib_com/options.h.bak - sed -i '/API_5MS/d' lib_com/options.h -- GitLab From 6000eb10b67d3573789a03aa4bdca937e69c11b9 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 16:23:29 +0200 Subject: [PATCH 0298/1418] Use relative submodule URL --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 3ca7eb7d97..192aece8ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "scripts/razel/ivas_razel_runner"] path = scripts/razel/ivas_razel_runner - url = git@git01.iis.fhg.de:sgi/ivas-razel-runner.git + url = ../../sgi/ivas-razel-runner.git branch = rend -- GitLab From 3935354834f02888e9ac5d05db41703c45cf85bf Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 16:31:49 +0200 Subject: [PATCH 0299/1418] Try to fix search for clang --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8098dc1c68..ddd1816562 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter -Wno-unused-function") # CLANG if(CLANG) - find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) + find_program(clangBin NAMES clang-13 /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "") if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory") -- GitLab From 65c81e0533bc6603619e1d77fab4365bc9eba8c2 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 16:41:34 +0200 Subject: [PATCH 0300/1418] Revert "Try to fix search for clang" This reverts commit 3935354834f02888e9ac5d05db41703c45cf85bf. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddd1816562..8098dc1c68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter -Wno-unused-function") # CLANG if(CLANG) - find_program(clangBin NAMES clang-13 /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) + find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "") if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory") -- GitLab From 6045854454599f4c7fe189b01496b26d36f66a8a Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 16:44:46 +0200 Subject: [PATCH 0301/1418] Fix building reference without sanitizer --- .gitlab-ci-custom.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 2771d66f37..4eab63e877 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -379,12 +379,14 @@ renderer-5ms-framing-asan: # Build reference executable - 5ms framing disabled - cp lib_com/options.h lib_com/options.h.bak - sed -i '/API_5MS/d' lib_com/options.h - - mkdir cmake-build && cmake -B cmake-build . && cmake --build cmake-build -- -j - - cp cmake-build/IVAS_rend IVAS_rend_ref + - cmake -B cmake-build-ref . + - cmake --build cmake-build-ref -- -j + - cp cmake-build-ref/IVAS_rend IVAS_rend_ref # Build test executable - mv -f lib_com/options.h.bak lib_com/options.h - - cmake -B cmake-build -DCLANG=asan . && cmake --build cmake-build -- -j + - cmake -B cmake-build -DCLANG=asan . + - cmake --build cmake-build -- -j - cp cmake-build/IVAS_rend . # Run Razel test @@ -400,12 +402,14 @@ renderer-5ms-framing-msan: # Build reference executable - 5ms framing disabled - cp lib_com/options.h lib_com/options.h.bak - sed -i '/API_5MS/d' lib_com/options.h - - mkdir cmake-build && cmake -B cmake-build . && cmake --build cmake-build -- -j - - cp cmake-build/IVAS_rend IVAS_rend_ref + - cmake -B cmake-build-ref . + - cmake --build cmake-build-ref -- -j + - cp cmake-build-ref/IVAS_rend IVAS_rend_ref # Build test executable - mv -f lib_com/options.h.bak lib_com/options.h - - cmake -B cmake-build -DCLANG=msan . && cmake --build cmake-build -- -j + - cmake -B cmake-build -DCLANG=msan . + - cmake --build cmake-build -- -j - cp cmake-build/IVAS_rend . # Run Razel test -- GitLab From 9fba8fd275d248d1b173ca700d5ebc97055808b7 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 16:46:28 +0200 Subject: [PATCH 0302/1418] Fix reference binary name --- .gitlab-ci-custom.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci-custom.yml b/.gitlab-ci-custom.yml index 4eab63e877..89cc0a6a4b 100644 --- a/.gitlab-ci-custom.yml +++ b/.gitlab-ci-custom.yml @@ -381,7 +381,7 @@ renderer-5ms-framing-asan: - sed -i '/API_5MS/d' lib_com/options.h - cmake -B cmake-build-ref . - cmake --build cmake-build-ref -- -j - - cp cmake-build-ref/IVAS_rend IVAS_rend_ref + - cp cmake-build-ref/IVAS_rend IVAS_rend_ref_5ms # Build test executable - mv -f lib_com/options.h.bak lib_com/options.h @@ -404,7 +404,7 @@ renderer-5ms-framing-msan: - sed -i '/API_5MS/d' lib_com/options.h - cmake -B cmake-build-ref . - cmake --build cmake-build-ref -- -j - - cp cmake-build-ref/IVAS_rend IVAS_rend_ref + - cp cmake-build-ref/IVAS_rend IVAS_rend_ref_5ms # Build test executable - mv -f lib_com/options.h.bak lib_com/options.h -- GitLab From 1866d6d87d90c2473651fda8adceb709d30db475 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 30 Jun 2023 17:02:08 +0200 Subject: [PATCH 0303/1418] Update ivas-razel-runner --- scripts/razel/ivas_razel_runner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/razel/ivas_razel_runner b/scripts/razel/ivas_razel_runner index 9bc7a9da1c..9676b98c61 160000 --- a/scripts/razel/ivas_razel_runner +++ b/scripts/razel/ivas_razel_runner @@ -1 +1 @@ -Subproject commit 9bc7a9da1c25a9b2845f0a816f8427c6c611d83a +Subproject commit 9676b98c617410b94bbb61feb4fb2dc778887255 -- GitLab From 06554bba18feafa8234bda4d5d672fb9a386ac78 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Mon, 3 Jul 2023 11:57:49 +0200 Subject: [PATCH 0304/1418] with MONO output, OMASA should not initialize hDirAC for rendering. this was triggered in bitrate switching. pre-compiler switch: OMASA_BRSW_MONO_FIX --- lib_com/options.h | 1 + lib_dec/ivas_masa_dec.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 8bb76b3452..3d341e277b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -166,6 +166,7 @@ #ifdef MASA_AND_OBJECTS #define MASAISM_EDIT_OBJECTS /* Nokia: Temporary command line editing of object directions in the decoder */ #define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix +#define OMASA_BRSW_MONO_FIX /* Nokia: fix renderer config under rateswitching and MONO output */ #endif /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 10d90e9ee7..aec5991fbe 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1279,7 +1279,11 @@ ivas_error ivas_masa_dec_reconfigure( /* renderer might have changed, reselect */ ivas_renderer_select( st_ivas ); +#ifdef OMASA_BRSW_MONO_FIX + if ( ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) && st_ivas->hDirAC == NULL ) +#else if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->hDirAC == NULL ) +#endif { /* init a new DirAC dec */ if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) @@ -1287,7 +1291,11 @@ ivas_error ivas_masa_dec_reconfigure( return error; } } +#ifdef OMASA_BRSW_MONO_FIX + else if ( ( st_ivas->renderer_type == RENDERER_DISABLE || st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) && st_ivas->hDirAC != NULL ) +#else else if ( st_ivas->renderer_type == RENDERER_DISABLE && st_ivas->hDirAC != NULL ) +#endif { /* close unnecessary DirAC dec */ ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); -- GitLab From d63fd0684518506f6445a94d9a68b387b810edb7 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Mon, 3 Jul 2023 13:27:13 +0200 Subject: [PATCH 0305/1418] Change granularity of MIXER_CONV for PARAMUPMIX --- lib_com/ivas_prot.h | 6 +++++- lib_dec/ivas_init_dec.c | 11 +++++++++++ lib_dec/ivas_ism_dec.c | 5 ++++- lib_dec/ivas_jbm_dec.c | 31 ++++++++++++++++++++++++++++++- lib_dec/ivas_mc_paramupmix_dec.c | 14 +++++--------- lib_dec/ivas_mct_dec.c | 4 ++++ 6 files changed, 59 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 6014794be5..66eb5b6233 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -837,7 +837,11 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( /*! r: render granularity */ int16_t ivas_jbm_dec_get_render_granularity( const RENDERER_TYPE rendererType, /* i : renderer type */ - const int32_t output_Fs /* i : sampling rate */ +#ifdef JBM_PARAMUPMIX + const IVAS_FORMAT ivas_format, /* i : ivas format */ + const MC_MODE mc_mode, /* i : MC mode */ +#endif + const int32_t output_Fs /* i : sampling rate */ ); ivas_error ivas_jbm_dec_tc_buffer_open( diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 2294203053..0e63166be3 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1332,7 +1332,18 @@ ivas_error ivas_init_decoder( if ( st_ivas->hDecoderConfig->voip_active ) { +#ifdef JBM_PARAMUPMIX + if ( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) + { + granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); + } + else + { + granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); + } +#else granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); +#endif n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index c031ec8c4b..b3c5acc2e4 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -133,8 +133,11 @@ static ivas_error ivas_ism_bitrate_switching( /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv render what still fits in the new granularity */ +#ifdef JBM_PARAMUPMIX + tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); +#else tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->hDecoderConfig->output_Fs ); - +#endif if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, MC_MODE_NONE, last_ism_mode, nSamplesRendered, data ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9119451443..f77beed717 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1579,7 +1579,36 @@ static void ivas_jbm_dec_copy_tc( * * *--------------------------------------------------------------------------*/ +#ifdef JBM_PARAMUPMIX +/*! r: render granularity */ +int16_t ivas_jbm_dec_get_render_granularity( + const RENDERER_TYPE rendererType, /* i : renderer type */ + const IVAS_FORMAT ivas_format, /* i : ivas format */ + const MC_MODE mc_mode, /* i : MC mode */ + const int32_t output_Fs /* i : sampling rate */ +) +{ + int16_t render_granularity; + + if ( rendererType == RENDERER_BINAURAL_OBJECTS_TD || rendererType == RENDERER_BINAURAL_MIXER_CONV || rendererType == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + if ( ( ivas_format == MC_FORMAT ) && ( mc_mode == MC_MODE_PARAMUPMIX ) ) + { + render_granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); + } + else + { + render_granularity = NS2SA( output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); + } + } + else + { + render_granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); + } + return render_granularity; +} +#else /*! r: render granularity */ int16_t ivas_jbm_dec_get_render_granularity( const RENDERER_TYPE rendererType, /* i : renderer type */ @@ -1599,7 +1628,7 @@ int16_t ivas_jbm_dec_get_render_granularity( return render_granularity; } - +#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc_buffer_open() diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index d1e25c18e1..98385d9394 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -317,15 +317,15 @@ void ivas_mc_paramupmix_dec_digest_tc( /* adapt subframes */ ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - if (st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_SUBFRAMES_5MS, nCldfbSlots, hMCParamUpmix->param_interpolator ); + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); } else { ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbSlots, hMCParamUpmix->param_interpolator ); } - + pop_wmops(); } @@ -496,18 +496,14 @@ ivas_error ivas_mc_paramupmix_dec_open( { nchan_to_allocate = 2 * BINAURAL_CHANNELS; } - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_SUBFRAMES_5MS, DEFAULT_JBM_SUBFRAMES_5MS, hMCParamUpmix->param_interpolator ); - } - else + if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) { if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK ) { return error; } - ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } + ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } #endif diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 51d6856987..acdd30811b 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -748,7 +748,11 @@ static ivas_error ivas_mc_dec_reconfig( /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ +#ifdef JBM_PARAMUPMIX + tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); +#else tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->hDecoderConfig->output_Fs ); +#endif if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &hIntSetupOld, last_mc_mode, ISM_MODE_NONE, nSamplesRendered, data ) ) != IVAS_ERR_OK ) -- GitLab From dc87c0d9644872dd526903c6105b3ccbb42d338f Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Mon, 3 Jul 2023 14:09:49 +0200 Subject: [PATCH 0306/1418] Revert "Build windows when pushing to main" This reverts commit 883574ab13aa936af97ecc3bd8bd6aac8396df38. --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fc7d44893..ac1190e552 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -283,10 +283,10 @@ build-codec-sanitizers-linux: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh -build-codec-windows-cmake: +.build-codec-windows-cmake: extends: - .build-job-windows-with-check-for-warnings - - .rules-main-push + - .rules-basis script: - *print-common-info-windows - $winoutdata = $null @@ -296,10 +296,10 @@ build-codec-windows-cmake: - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - ("exit $LASTEXITCODE") | Invoke-Expression -build-codec-windows-msbuild: +.build-codec-windows-msbuild: extends: - .build-job-windows-with-check-for-warnings - - .rules-main-push + - .rules-basis script: - *print-common-info-windows - $winoutdata = $null -- GitLab From 9ce67a9645850a62a8a7251106f329918ba4f4f2 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Mon, 3 Jul 2023 14:09:59 +0200 Subject: [PATCH 0307/1418] Revert "deactivate all windows jobs until windows runners are back" This reverts commit e0abe2b8e8dd45ac48baf88dd83d3246d17df011. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac1190e552..afe2924204 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -283,7 +283,7 @@ build-codec-sanitizers-linux: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh -.build-codec-windows-cmake: +build-codec-windows-cmake: extends: - .build-job-windows-with-check-for-warnings - .rules-basis @@ -296,7 +296,7 @@ build-codec-sanitizers-linux: - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - ("exit $LASTEXITCODE") | Invoke-Expression -.build-codec-windows-msbuild: +build-codec-windows-msbuild: extends: - .build-job-windows-with-check-for-warnings - .rules-basis -- GitLab From dea854b36d1d2610cab0ef9c0897017b51c5884d Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Mon, 3 Jul 2023 14:10:05 +0200 Subject: [PATCH 0308/1418] Revert "Temporarily disable be-2-evs-windows -- Ericsson Windows runner to be paused" This reverts commit 6df461bd00e86c1f95732266a400adfe546adf8b. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afe2924204..5d97bec156 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -737,7 +737,7 @@ selection-test-processing: # --------------------------------------------------------------- # check bitexactness to EVS windows binaries -.be-2-evs-windows: # Temporarily disabled -- Ericsson Windows runner used for HL activities which the reduces capacity for this job. To be resumed after selection +be-2-evs-windows: extends: - .rules-main-push tags: -- GitLab From c07f6ee2e02b940ddbe812ba3b7a209068c424ca Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 3 Jul 2023 14:24:29 +0200 Subject: [PATCH 0309/1418] move MR pipeline BE tests into sudirectory --- .gitlab-ci.yml | 21 ++++++++++--------- tests/__init__.py | 0 tests/codec_be_on_mr/__init__.py | 0 .../{ => codec_be_on_mr}/test_masa_enc_dec.py | 4 ++-- tests/{ => codec_be_on_mr}/test_param_file.py | 8 +++---- .../test_sba_bs_dec_plc.py | 4 ++-- tests/{ => codec_be_on_mr}/test_sba_bs_enc.py | 6 +++--- tests/conftest.py | 2 +- tests/prepare_pytests.py | 6 +++--- tests/run_pytests.py | 4 ++-- 10 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/codec_be_on_mr/__init__.py rename tests/{ => codec_be_on_mr}/test_masa_enc_dec.py (99%) rename tests/{ => codec_be_on_mr}/test_param_file.py (98%) rename tests/{ => codec_be_on_mr}/test_sba_bs_dec_plc.py (98%) rename tests/{ => codec_be_on_mr}/test_sba_bs_enc.py (99%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b365c0e22d..b0fa618ac7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ variables: EXIT_CODE_NON_BE: 123 EXIT_CODE_FAIL: 1 PROCESSING_SCRIPTS_BIN_DIR: "/test-bin" + TESTS_DIR_CODEC_BE_ON_MR: "tests/codec_be_on_mr" default: interruptible: true # Make all jobs by default interruptible @@ -531,15 +532,15 @@ ivas-pytest-on-merge-request: # create short test vectors - python3 tests/create_short_testvectors.py # create references - - python3 -m pytest tests -v --update_ref 1 -m create_ref - - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2 + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi ### run pytest - exit_code=0 - - python3 -m pytest tests -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check @@ -579,14 +580,14 @@ evs-pytest-on-merge-request: ### prepare pytest # create references - - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi ### run pytest for EVS cases - exit_code=0 - - python3 -m pytest tests/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml || exit_code=$? - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true - *merge-request-comparison-check @@ -840,15 +841,15 @@ codec-comparison-on-main-push: - mv IVAS_cod_test IVAS_cod - mv IVAS_dec_test IVAS_dec # create references - - python3 -m pytest tests -v --update_ref 1 -m create_ref - - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2 + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2 ### re-checkout the latest commit here, if ref_using_main is set - if [ $ref_using_main -eq 1 ]; then git checkout $latest_commit;fi ### run pytest - exit_code=0 - - python3 -m pytest tests -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || exit_code=$? + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml || exit_code=$? - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi @@ -1125,8 +1126,8 @@ coverage-test-on-main-scheduled: - make GCOV=1 -j - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script - python3 tests/create_short_testvectors.py - - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n 0 --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec + - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n 0 --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - python3 -m pytest tests/test_param_file.py -v -n 0 --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - bash ci/smoke_test.sh coverage - python3 -m pytest -q -n auto tests/renderer/test_renderer_be_comparison.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/codec_be_on_mr/__init__.py b/tests/codec_be_on_mr/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test_masa_enc_dec.py b/tests/codec_be_on_mr/test_masa_enc_dec.py similarity index 99% rename from tests/test_masa_enc_dec.py rename to tests/codec_be_on_mr/test_masa_enc_dec.py index bfa24c6d30..134611ae04 100644 --- a/tests/test_masa_enc_dec.py +++ b/tests/codec_be_on_mr/test_masa_enc_dec.py @@ -41,8 +41,8 @@ import pytest from typing import Optional from filecmp import cmp -from cmp_pcm import cmp_pcm -from conftest import EncoderFrontend, DecoderFrontend +from tests.conftest import EncoderFrontend, DecoderFrontend +from tests.cmp_pcm import cmp_pcm # params #output_mode_list = ['MONO', 'STEREO', '5_1', '7_1', '5_1_2', '5_1_4', '7_1_4', 'FOA', 'HOA2', 'HOA3', 'BINAURAL', 'BINAURAL_ROOM', 'EXT'] diff --git a/tests/test_param_file.py b/tests/codec_be_on_mr/test_param_file.py similarity index 98% rename from tests/test_param_file.py rename to tests/codec_be_on_mr/test_param_file.py index 5a2c64f589..02e00336f0 100644 --- a/tests/test_param_file.py +++ b/tests/codec_be_on_mr/test_param_file.py @@ -40,10 +40,10 @@ import platform import filecmp from subprocess import run import pytest -from cmp_pcm import cmp_pcm -from cut_pcm import cut_samples -from conftest import EncoderFrontend, DecoderFrontend -from testconfig import PARAM_FILE +from tests.cmp_pcm import cmp_pcm +from tests.cut_pcm import cut_samples +from tests.conftest import EncoderFrontend, DecoderFrontend +from tests.testconfig import PARAM_FILE VALID_DEC_OUTPUT_CONF = [ diff --git a/tests/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr/test_sba_bs_dec_plc.py similarity index 98% rename from tests/test_sba_bs_dec_plc.py rename to tests/codec_be_on_mr/test_sba_bs_dec_plc.py index bead7cda93..c095f27558 100644 --- a/tests/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr/test_sba_bs_dec_plc.py @@ -38,8 +38,8 @@ import os import errno import pytest -from cmp_pcm import cmp_pcm -from conftest import DecoderFrontend +from tests.cmp_pcm import cmp_pcm +from tests.conftest import DecoderFrontend # params tag_list = ['stvFOA'] diff --git a/tests/test_sba_bs_enc.py b/tests/codec_be_on_mr/test_sba_bs_enc.py similarity index 99% rename from tests/test_sba_bs_enc.py rename to tests/codec_be_on_mr/test_sba_bs_enc.py index 759e1cce4f..3b05399784 100644 --- a/tests/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr/test_sba_bs_enc.py @@ -39,9 +39,9 @@ import os import errno import pytest -from cmp_pcm import cmp_pcm -from cut_pcm import cut_samples -from conftest import EncoderFrontend, DecoderFrontend +from tests.cmp_pcm import cmp_pcm +from tests.cut_pcm import cut_samples +from tests.conftest import EncoderFrontend, DecoderFrontend from cut_bs import cut_from_start # params diff --git a/tests/conftest.py b/tests/conftest.py index d7a35a36e0..958e0b10ac 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -41,7 +41,7 @@ from subprocess import run import textwrap from typing import Optional import os -import testconfig +import tests.testconfig import pytest logger = logging.getLogger(__name__) diff --git a/tests/prepare_pytests.py b/tests/prepare_pytests.py index 9074a6704a..69e1e25fea 100755 --- a/tests/prepare_pytests.py +++ b/tests/prepare_pytests.py @@ -98,12 +98,12 @@ def main(argv): else: base_cmd = ["python3", "-m", "pytest"] if args.param_file: - base_cmd += ["tests/test_param_file.py", "--param_file", args.param_file] + base_cmd += ["tests/codec_be_on_mr/test_param_file.py", "--param_file", args.param_file] else: - base_cmd += ["tests"] + base_cmd += ["tests/codec_be_on_mr"] base_cmd += [ "-n", - args.numprocesses, + "14", "--update_ref", "1", ] diff --git a/tests/run_pytests.py b/tests/run_pytests.py index d20de6ef72..368d599647 100755 --- a/tests/run_pytests.py +++ b/tests/run_pytests.py @@ -93,9 +93,9 @@ def main(argv): else: cmd = ["python3", "-m", "pytest"] if args.param_file: - cmd += ["tests/test_param_file.py", "--param_file", args.param_file] + cmd += ["tests/codec_be_on_mr/test_param_file.py", "--param_file", args.param_file] else: - cmd += ["tests"] + cmd += ["tests/codec_be_on_mr"] cmd += ["-n", args.numprocesses] result = subprocess.run(cmd, check=False) -- GitLab From e574247963d17f40e6543b5ee0ca58c56f6f887a Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 3 Jul 2023 15:17:03 +0200 Subject: [PATCH 0310/1418] rename things --- .gitlab-ci.yml | 2 +- .../__init__.py | 0 .../test_masa_enc_dec.py | 0 .../test_param_file.py | 0 .../test_sba_bs_dec_plc.py | 0 .../test_sba_bs_enc.py | 0 tests/prepare_pytests.py | 4 ++-- tests/run_pytests.py | 4 ++-- 8 files changed, 5 insertions(+), 5 deletions(-) rename tests/{codec_be_on_mr => codec_be_on_mr_nonselection}/__init__.py (100%) rename tests/{codec_be_on_mr => codec_be_on_mr_nonselection}/test_masa_enc_dec.py (100%) rename tests/{codec_be_on_mr => codec_be_on_mr_nonselection}/test_param_file.py (100%) rename tests/{codec_be_on_mr => codec_be_on_mr_nonselection}/test_sba_bs_dec_plc.py (100%) rename tests/{codec_be_on_mr => codec_be_on_mr_nonselection}/test_sba_bs_enc.py (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0fa618ac7..fe829be035 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ variables: EXIT_CODE_NON_BE: 123 EXIT_CODE_FAIL: 1 PROCESSING_SCRIPTS_BIN_DIR: "/test-bin" - TESTS_DIR_CODEC_BE_ON_MR: "tests/codec_be_on_mr" + TESTS_DIR_CODEC_BE_ON_MR: "tests/codec_be_on_mr_nonselection" default: interruptible: true # Make all jobs by default interruptible diff --git a/tests/codec_be_on_mr/__init__.py b/tests/codec_be_on_mr_nonselection/__init__.py similarity index 100% rename from tests/codec_be_on_mr/__init__.py rename to tests/codec_be_on_mr_nonselection/__init__.py diff --git a/tests/codec_be_on_mr/test_masa_enc_dec.py b/tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py similarity index 100% rename from tests/codec_be_on_mr/test_masa_enc_dec.py rename to tests/codec_be_on_mr_nonselection/test_masa_enc_dec.py diff --git a/tests/codec_be_on_mr/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py similarity index 100% rename from tests/codec_be_on_mr/test_param_file.py rename to tests/codec_be_on_mr_nonselection/test_param_file.py diff --git a/tests/codec_be_on_mr/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py similarity index 100% rename from tests/codec_be_on_mr/test_sba_bs_dec_plc.py rename to tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py diff --git a/tests/codec_be_on_mr/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py similarity index 100% rename from tests/codec_be_on_mr/test_sba_bs_enc.py rename to tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py diff --git a/tests/prepare_pytests.py b/tests/prepare_pytests.py index 69e1e25fea..9e50ea90d1 100755 --- a/tests/prepare_pytests.py +++ b/tests/prepare_pytests.py @@ -98,9 +98,9 @@ def main(argv): else: base_cmd = ["python3", "-m", "pytest"] if args.param_file: - base_cmd += ["tests/codec_be_on_mr/test_param_file.py", "--param_file", args.param_file] + base_cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] else: - base_cmd += ["tests/codec_be_on_mr"] + base_cmd += ["tests/codec_be_on_mr_nonselection"] base_cmd += [ "-n", "14", diff --git a/tests/run_pytests.py b/tests/run_pytests.py index 368d599647..91ab8f27d5 100755 --- a/tests/run_pytests.py +++ b/tests/run_pytests.py @@ -93,9 +93,9 @@ def main(argv): else: cmd = ["python3", "-m", "pytest"] if args.param_file: - cmd += ["tests/codec_be_on_mr/test_param_file.py", "--param_file", args.param_file] + cmd += ["tests/codec_be_on_mr_nonselection/test_param_file.py", "--param_file", args.param_file] else: - cmd += ["tests/codec_be_on_mr"] + cmd += ["tests/codec_be_on_mr_nonselection"] cmd += ["-n", args.numprocesses] result = subprocess.run(cmd, check=False) -- GitLab From c21992b0b8386318525445b8c2a5a631e25f5fe4 Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Mon, 3 Jul 2023 18:24:31 +0200 Subject: [PATCH 0311/1418] [fix] enable reverb for ISM mode switching - enable reverb when switching from ParamISM to DiscISM for the first time. --- lib_dec/ivas_ism_dec.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index c031ec8c4b..cae5ebaf4d 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -184,6 +184,15 @@ static ivas_error ivas_ism_bitrate_switching( { return error; } +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + 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; + } + } +#endif } } else @@ -258,6 +267,14 @@ static ivas_error ivas_ism_bitrate_switching( { st_ivas->hHrtfTD = NULL; } + +#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM + if (st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB) + { + ivas_reverb_close( &st_ivas->hReverb ); + } + +#endif } } else -- GitLab From 8295a205d3cd2c3778769754886fd334be186d96 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Tue, 4 Jul 2023 09:23:19 +0200 Subject: [PATCH 0312/1418] Fix memory error --- lib_dec/ivas_mc_paramupmix_dec.c | 4 +++- lib_dec/ivas_stat_dec.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 98385d9394..318f7f1705 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -472,6 +472,7 @@ ivas_error ivas_mc_paramupmix_dec_open( #ifdef JBM_PARAMUPMIX /* allocate transport channels*/ + hMCParamUpmix->free_param_interpolator = 0; if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) { int16_t nchan_to_allocate; @@ -502,6 +503,7 @@ ivas_error ivas_mc_paramupmix_dec_open( { return error; } + hMCParamUpmix->free_param_interpolator = 1; } ivas_jbm_dec_get_adapted_linear_interpolator( DEFAULT_JBM_CLDFB_TIMESLOTS, DEFAULT_JBM_CLDFB_TIMESLOTS, hMCParamUpmix->param_interpolator ); } @@ -541,7 +543,7 @@ void ivas_mc_paramupmix_dec_close( } } #ifdef JBM_PARAMUPMIX - if ( ( *hMCParamUpmix )->param_interpolator != NULL ) + if ( ( ( *hMCParamUpmix )->param_interpolator != NULL ) && ( ( *hMCParamUpmix )->free_param_interpolator == 1 ) ) { free( ( *hMCParamUpmix )->param_interpolator ); } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 697a577c87..152cf5091e 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -804,6 +804,7 @@ typedef struct ivas_mc_paramupmix_dec_data_structure float *pcm_delay[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS]; #ifdef JBM_PARAMUPMIX float *param_interpolator; + int16_t free_param_interpolator; #endif } MC_PARAMUPMIX_DEC_DATA, *MC_PARAMUPMIX_DEC_HANDLE; -- GitLab From 06809cf589deab9775fca587a61b002fa24dbfb8 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 4 Jul 2023 11:08:55 +0200 Subject: [PATCH 0313/1418] first version with single experiment OPs and limited parameters --- .gitignore | 7 ++-- tests/codec_be_on_mr_selection/__init__.py | 41 +++++++++++++++++++ tests/codec_be_on_mr_selection/constants.py | 8 ++++ .../test_experiments.py | 37 +++++++++++++++++ 4 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 tests/codec_be_on_mr_selection/__init__.py create mode 100644 tests/codec_be_on_mr_selection/constants.py create mode 100644 tests/codec_be_on_mr_selection/test_experiments.py diff --git a/.gitignore b/.gitignore index a2f6a6b95f..4d9dbe0474 100644 --- a/.gitignore +++ b/.gitignore @@ -42,10 +42,9 @@ scripts/out/ scripts/self_test_summary.txt scripts/cppp/ binary/ -tests/renderer/cut -tests/renderer/ref -tests/dut -tests/ref +tests/**/[c|d]ut +tests/**/ref +tests/*/testv scripts/testv/*_cut*.pcm # default reference binary name IVAS_cod_ref diff --git a/tests/codec_be_on_mr_selection/__init__.py b/tests/codec_be_on_mr_selection/__init__.py new file mode 100644 index 0000000000..87aba47645 --- /dev/null +++ b/tests/codec_be_on_mr_selection/__init__.py @@ -0,0 +1,41 @@ +import tempfile +import filecmp +from pathlib import Path +import subprocess +from .constants import TESTV_PATH, REF_PATH, DUT_PATH + + +def get_testvector_for_exp_cat_and_testset(experiment, category, testset): + fname = f"{experiment}-cat{category}-{testset}-input.wav" + return TESTV_PATH.joinpath(fname).absolute() + + +def get_out_bitstream_and_synthesis_name(input_signal, bitrate, dtx, fer): + dtx_str = "DTXon" if dtx else "DTXoff" + fer_str = "FER_5perc" if fer else "FER_0perc" + suffix = [".192", ".wav"] + return [DUT_PATH.joinpath(f"{input_signal.name}-{bitrate}bps-{dtx_str}-{fer_str}{s}") for s in suffix] + + +def get_error_pattern_for_exp_cat_and_testset(experiment, category, testset): + ep_file = TESTV_PATH.joinpath(f"{experiment}-cat{category}-{testset}-ep.192") + return ep_file + + +def apply_error_pattern_on_bitstream(in_bitstream: Path, error_pattern: Path, out_bitstream: Path): + # temporary file only really needed if same name is given for in and out bs + with tempfile.TemporaryDirectory() as tmpdir: + if in_bitstream == out_bitstream: + in_bitstream = Path(tmpdir).joinpath(in_bitstream.name) + + cmd = ["eid-xor", "-vbr", "-fer", in_bitstream, error_pattern, out_bitstream] + + subprocess.run(cmd) + + +def is_be_to_reference(dut_file: Path): + assert dut_file.parent == DUT_PATH + + # TODO: handle .wav files differently + ref_file = REF_PATH.joinpath(dut_file.name) + return filecmp.cmp(ref_file, dut_file) \ No newline at end of file diff --git a/tests/codec_be_on_mr_selection/constants.py b/tests/codec_be_on_mr_selection/constants.py new file mode 100644 index 0000000000..50209f7eb0 --- /dev/null +++ b/tests/codec_be_on_mr_selection/constants.py @@ -0,0 +1,8 @@ +from pathlib import Path + +HERE = Path(__file__).parent +TESTV_PATH = HERE.joinpath("testv") +REF_PATH = HERE.joinpath("ref") +DUT_PATH = HERE.joinpath("dut") + +SAMPLING_RATE = 48 \ No newline at end of file diff --git a/tests/codec_be_on_mr_selection/test_experiments.py b/tests/codec_be_on_mr_selection/test_experiments.py new file mode 100644 index 0000000000..00d4830666 --- /dev/null +++ b/tests/codec_be_on_mr_selection/test_experiments.py @@ -0,0 +1,37 @@ +import pytest +from . import get_testvector_for_exp_cat_and_testset, get_out_bitstream_and_synthesis_name, apply_error_pattern_on_bitstream, get_error_pattern_for_exp_cat_and_testset, is_be_to_reference + +P800_1_BITRATES = [13200, 16400, 24400, 32000, 48000, 13200, 16400, 24400, 32000, 48000, 24400, 13200] +P800_1_DTX = 10 * [False] + 2 * [True] +P800_1_FER = 5 * [False] + 5 * [True] + [False, True] +# TODO: use correct range +P800_1_CATEGORIES = range(1, 3) +P800_1_TESTSETS = ["a", "d"] +P800_1_PARAMS = list(zip(P800_1_BITRATES, P800_1_DTX, P800_1_FER)) + + +@pytest.mark.create_ref +@pytest.mark.parametrize("bitrate,dtx,fer", P800_1_PARAMS) +@pytest.mark.parametrize("category", P800_1_CATEGORIES) +@pytest.mark.parametrize("testset", P800_1_TESTSETS) +def test_p800_1(bitrate, dtx, fer, category, testset, dut_encoder_frontend, dut_decoder_frontend, update_ref): + sampling_rate = 48 + output_mode = "STEREO" + options = ["-stereo"] + + testv = get_testvector_for_exp_cat_and_testset("P800-1", category, testset) + dut_bitstream, dut_output = get_out_bitstream_and_synthesis_name(testv, bitrate, dtx, fer) + dut_encoder_frontend.run(bitrate, sampling_rate, testv, dut_bitstream, dtx_mode=dtx, add_option_list=options) + + if update_ref != 1 and not is_be_to_reference(dut_bitstream): + pytest.fail("Bitstream file differs from reference") + + if fer: + error_pattern = get_error_pattern_for_exp_cat_and_testset("P800-1", category, testset) + apply_error_pattern_on_bitstream(dut_bitstream, error_pattern, dut_bitstream) + + dut_decoder_frontend.run(output_mode, sampling_rate, dut_bitstream, dut_output) + + # TODO: also compare metadata if present + if update_ref != 1 and not is_be_to_reference(dut_output): + pytest.fail("Decoder output differs from reference") \ No newline at end of file -- GitLab From 128fd43c203a70de57a50e28007c915d5eb5516e Mon Sep 17 00:00:00 2001 From: Charles Kinuthia Date: Tue, 4 Jul 2023 11:26:11 +0200 Subject: [PATCH 0314/1418] clang-format --- lib_dec/ivas_ism_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index cae5ebaf4d..5533fcd6b3 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -269,7 +269,7 @@ static ivas_error ivas_ism_bitrate_switching( } #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if (st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB) + if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { ivas_reverb_close( &st_ivas->hReverb ); } -- GitLab From 2969baca9227bdab454d4dd4d0f65a6a7f9b5ef0 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 4 Jul 2023 11:47:54 +0200 Subject: [PATCH 0315/1418] refactor --- .../test_experiments.py | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/tests/codec_be_on_mr_selection/test_experiments.py b/tests/codec_be_on_mr_selection/test_experiments.py index 00d4830666..58e8bbd964 100644 --- a/tests/codec_be_on_mr_selection/test_experiments.py +++ b/tests/codec_be_on_mr_selection/test_experiments.py @@ -1,37 +1,53 @@ import pytest from . import get_testvector_for_exp_cat_and_testset, get_out_bitstream_and_synthesis_name, apply_error_pattern_on_bitstream, get_error_pattern_for_exp_cat_and_testset, is_be_to_reference +P800_CATEGORIES = range(1, 3) + P800_1_BITRATES = [13200, 16400, 24400, 32000, 48000, 13200, 16400, 24400, 32000, 48000, 24400, 13200] P800_1_DTX = 10 * [False] + 2 * [True] P800_1_FER = 5 * [False] + 5 * [True] + [False, True] # TODO: use correct range -P800_1_CATEGORIES = range(1, 3) P800_1_TESTSETS = ["a", "d"] -P800_1_PARAMS = list(zip(P800_1_BITRATES, P800_1_DTX, P800_1_FER)) +P800_1_PARAMS = zip(P800_1_BITRATES, P800_1_DTX, P800_1_FER) +P800_2_BITRATES = [13200, 16400, 24400, 32000, 48000, 64000, 13200, 16400, 24400, 32000, 48000] +P800_2_DTX = 6 * [False] + 5 * [False] +P800_2_TESTSETS = ["b", "d"] +P800_2_PARAMS = list(zip(P800_2_BITRATES, P800_2_DTX)) -@pytest.mark.create_ref -@pytest.mark.parametrize("bitrate,dtx,fer", P800_1_PARAMS) -@pytest.mark.parametrize("category", P800_1_CATEGORIES) -@pytest.mark.parametrize("testset", P800_1_TESTSETS) -def test_p800_1(bitrate, dtx, fer, category, testset, dut_encoder_frontend, dut_decoder_frontend, update_ref): +OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT = { + "P800-1": ("STEREO", ["-stereo"]), + "P800-2": ("STEREO", ["-stereo"]), +} + + +def run_check(experiment, category, testset, bitrate, dtx, fer, encoder_frontend, decoder_frontend, is_ref_creation): sampling_rate = 48 - output_mode = "STEREO" - options = ["-stereo"] + output_mode, options = OUTPUT_MODES_AND_OPTIONS_FOR_EXPERIMENT[experiment] + + testv = get_testvector_for_exp_cat_and_testset(experiment, category, testset) + error_pattern = get_error_pattern_for_exp_cat_and_testset(experiment, category, testset) if fer else None - testv = get_testvector_for_exp_cat_and_testset("P800-1", category, testset) dut_bitstream, dut_output = get_out_bitstream_and_synthesis_name(testv, bitrate, dtx, fer) - dut_encoder_frontend.run(bitrate, sampling_rate, testv, dut_bitstream, dtx_mode=dtx, add_option_list=options) + encoder_frontend.run(bitrate, sampling_rate, testv, dut_bitstream, dtx_mode=dtx, add_option_list=options) - if update_ref != 1 and not is_be_to_reference(dut_bitstream): + if not is_ref_creation and not is_be_to_reference(dut_bitstream): pytest.fail("Bitstream file differs from reference") - if fer: - error_pattern = get_error_pattern_for_exp_cat_and_testset("P800-1", category, testset) + if error_pattern is not None: apply_error_pattern_on_bitstream(dut_bitstream, error_pattern, dut_bitstream) - dut_decoder_frontend.run(output_mode, sampling_rate, dut_bitstream, dut_output) + decoder_frontend.run(output_mode, sampling_rate, dut_bitstream, dut_output) # TODO: also compare metadata if present - if update_ref != 1 and not is_be_to_reference(dut_output): - pytest.fail("Decoder output differs from reference") \ No newline at end of file + if not is_ref_creation and not is_be_to_reference(dut_output): + pytest.fail("Decoder output differs from reference") + + +@pytest.mark.create_ref +@pytest.mark.parametrize("bitrate,dtx,fer", P800_1_PARAMS) +@pytest.mark.parametrize("category", P800_CATEGORIES) +@pytest.mark.parametrize("testset", P800_1_TESTSETS) +def test_p800_1(bitrate, dtx, fer, category, testset, dut_encoder_frontend, dut_decoder_frontend, update_ref): + experiment = "P800-1" + run_check(experiment, category, testset, bitrate, dtx, fer, dut_encoder_frontend, dut_decoder_frontend, update_ref == 1) \ No newline at end of file -- GitLab From 40008d54638d967cd14c988aa03a2863f3bbd797 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Tue, 4 Jul 2023 12:16:29 +0200 Subject: [PATCH 0316/1418] Decorrelation JBM split up --- lib_com/ivas_prot.h | 3 +- lib_dec/ivas_jbm_dec.c | 2 +- lib_dec/ivas_mc_paramupmix_dec.c | 48 +++++++++++++++++++------------- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index a185318a7a..5f18f27668 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3884,7 +3884,8 @@ void ivas_mc_paramupmix_dec_read_BS( #ifdef JBM_PARAMUPMIX void ivas_mc_paramupmix_dec_digest_tc( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ + const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */ + const int16_t nSamplesForRendering /* i : number of samples provided */ ); void ivas_mc_paramupmix_dec_render( diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9fffa4a0f5..3b26ef44e1 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -625,7 +625,7 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( #ifdef JBM_PARAMUPMIX else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots ); + ivas_mc_paramupmix_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, st_ivas->hTcBuffer->n_samples_available ); } #endif else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 318f7f1705..d63a67302c 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -60,7 +60,7 @@ static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_ static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); -static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas ); +static void ivas_param_upmix_dec_decorr_subframes( Decoder_Struct *st_ivas, const int16_t nSamplesForRendering ); #endif static void paramupmix_td_decorr_process( ivas_td_decorr_state_t *hTdDecorr[], float pcm_in[][L_FRAME48k], float **pp_out_pcm, const int16_t output_frame ); @@ -302,8 +302,9 @@ void ivas_mc_paramupmix_dec( #ifdef JBM_PARAMUPMIX void ivas_mc_paramupmix_dec_digest_tc( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - const uint8_t nCldfbSlots /* i : number of CLFBS slots in the transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const uint8_t nCldfbSlots, /* i : number of CLFBS slots in the transport channels */ + const int16_t nSamplesForRendering /* i : number of samples provided */ ) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -312,7 +313,7 @@ void ivas_mc_paramupmix_dec_digest_tc( push_wmops( "ivas_mc_paramupmix_dec_digest_tc" ); - ivas_param_upmix_dec_decorr_subframes( st_ivas ); + ivas_param_upmix_dec_decorr_subframes( st_ivas, nSamplesForRendering ); /* adapt subframes */ ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); @@ -607,35 +608,44 @@ static void paramupmix_td_decorr_process_jbm( } static void ivas_param_upmix_dec_decorr_subframes( - Decoder_Struct *st_ivas /* i/o: IVAS decoder handle */ -) + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + const int16_t nSamplesForRendering ) { MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; - int16_t i, ch; - int32_t output_Fs; - int16_t output_frame; - float *pPcm_temp[MC_PARAMUPMIX_COMBINATIONS * 2]; /* decorrelated and undecorrelated*/ - float *p_tc[MC_PARAMUPMIX_MAX_INPUT_CHANS]; + float *pPcm_tmp[MC_PARAMUPMIX_COMBINATIONS]; + float *p_tc[MC_PARAMUPMIX_COMBINATIONS]; + int16_t nchan_internal, ch; + int16_t nSamplesLeftForTD, default_frame; hMCParamUpmix = st_ivas->hMCParamUpmix; assert( hMCParamUpmix ); push_wmops( "ivas_param_upmix_dec_decorr_subframes" ); - output_Fs = st_ivas->hDecoderConfig->output_Fs; - output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); + /* TD decorrelator */ + default_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); + nSamplesLeftForTD = nSamplesForRendering; + nchan_internal = MC_PARAMUPMIX_COMBINATIONS; - for ( ch = 0; ch < MC_PARAMUPMIX_MAX_INPUT_CHANS; ch++ ) + for ( ch = 0; ch < nchan_internal; ch++ ) { - p_tc[ch] = st_ivas->hTcBuffer->tc[ch]; + pPcm_tmp[ch] = st_ivas->hTcBuffer->tc[ch + 8]; + p_tc[ch] = st_ivas->hTcBuffer->tc[ch + 4]; } - for ( i = 0; i < MC_PARAMUPMIX_COMBINATIONS; i++ ) + while ( nSamplesLeftForTD ) { - pPcm_temp[i] = p_tc[8 + i]; /* decorrelated */ - } + int16_t nSamplesToDecorr = min( nSamplesLeftForTD, default_frame ); + + paramupmix_td_decorr_process_jbm( hMCParamUpmix->hTdDecorr, p_tc, pPcm_tmp, nSamplesToDecorr ); + + for ( ch = 0; ch < nchan_internal; ch++ ) + { + p_tc[ch] += nSamplesToDecorr; + } - paramupmix_td_decorr_process_jbm( hMCParamUpmix->hTdDecorr, &( p_tc[4] ), pPcm_temp, output_frame ); + nSamplesLeftForTD -= nSamplesToDecorr; + } pop_wmops(); -- GitLab From 60a5fe0352d3a63c692c9508d08d4d2527830082 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Tue, 4 Jul 2023 13:12:07 +0200 Subject: [PATCH 0317/1418] Msan fix --- lib_dec/ivas_mc_paramupmix_dec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index d63a67302c..fdedb13e77 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -474,6 +474,7 @@ ivas_error ivas_mc_paramupmix_dec_open( #ifdef JBM_PARAMUPMIX /* allocate transport channels*/ hMCParamUpmix->free_param_interpolator = 0; + hMCParamUpmix->param_interpolator = NULL; if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL ) { int16_t nchan_to_allocate; @@ -544,9 +545,12 @@ void ivas_mc_paramupmix_dec_close( } } #ifdef JBM_PARAMUPMIX - if ( ( ( *hMCParamUpmix )->param_interpolator != NULL ) && ( ( *hMCParamUpmix )->free_param_interpolator == 1 ) ) + if ( ( *hMCParamUpmix )->param_interpolator != NULL ) { - free( ( *hMCParamUpmix )->param_interpolator ); + if ( ( *hMCParamUpmix )->free_param_interpolator == 1 ) + { + free( ( *hMCParamUpmix )->param_interpolator ); + } } #endif free( *hMCParamUpmix ); -- GitLab From e0d7ebc680f4cc4a6fa87ab6f3dead6e52bca071 Mon Sep 17 00:00:00 2001 From: Marek Szczerba Date: Tue, 4 Jul 2023 15:43:25 +0200 Subject: [PATCH 0318/1418] Clang issue --- lib_rend/ivas_reverb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index cfea5594a1..0ec7e1f1f4 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1905,7 +1905,7 @@ ivas_error ivas_binaural_reverb_open( else { #ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM - if (renderer_type == RENDERER_BINAURAL_FASTCONV ) + if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) #else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) #endif -- GitLab From 31f625e1791124d8dcd636f5dadc7bf0b8586e3e Mon Sep 17 00:00:00 2001 From: Michael Schug Date: Tue, 4 Jul 2023 17:12:36 +0200 Subject: [PATCH 0319/1418] for paramupmix jbm -vs 100 compared to normal operation should give identical output --- lib_dec/ivas_mc_paramupmix_dec.c | 42 ++++++++++++++++++++++++++------ lib_dec/ivas_stat_dec.h | 2 ++ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index fdedb13e77..25538a2ae4 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -56,7 +56,7 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_mod_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t ch ); #ifdef JBM_PARAMUPMIX -static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch ); +static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); @@ -376,6 +376,12 @@ void ivas_mc_paramupmix_dec_render( assert( slots_to_render == 0 ); #endif + for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) + { + mvr2r( hMCParamUpmix->alpha_prev[ch], hMCParamUpmix->alpha_sf[ch], IVAS_MAX_NUM_BANDS ); + mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); + } + for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; @@ -733,7 +739,8 @@ static void ps_pred_process_sf( float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /* in/out */ float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, - const int16_t ch ) + const int16_t ch, + const int16_t slots_rendered ) { float vmre, vmim, vsre, vsim; int16_t iqmf, ipar, ismp, iismp; @@ -742,6 +749,10 @@ static void ps_pred_process_sf( float *beta1, *beta2; float *alpha_prev = hMCParamUpmix->alpha_prev[ch]; float *beta_prev = hMCParamUpmix->beta_prev[ch]; + float *alpha_sf = hMCParamUpmix->alpha_sf[ch]; + float *beta_sf = hMCParamUpmix->beta_sf[ch]; + float dalpha, dbeta, ifac; + float alpha_start[IVAS_MAX_NUM_BANDS], beta_start[IVAS_MAX_NUM_BANDS]; const int16_t qmf_to_par_band[] = { 0, 1, 2, 3, 4, 5, 5, 6, 6, 7, @@ -752,9 +763,10 @@ static void ps_pred_process_sf( 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }; + mvr2r(alpha_sf, alpha_start, IVAS_MAX_NUM_BANDS); + mvr2r(beta_sf, beta_start, IVAS_MAX_NUM_BANDS); for ( iqmf = 0; iqmf < CLDFB_NO_CHANNELS_MAX; iqmf++ ) { - /* For changing no of parameter bands (ipar1 != ipar2), TIGGER_FRAMING assumed */ ipar = qmf_to_par_band[iqmf]; alpha1 = alpha_prev; beta1 = beta_prev; @@ -762,13 +774,24 @@ static void ps_pred_process_sf( ismp = 0; alpha2 = hMCParamUpmix->alphas[ch]; beta2 = hMCParamUpmix->betas[ch]; - alpha_smp = alpha1[ipar]; - beta_smp = beta1[ipar]; + alpha_smp = alpha_start[ipar]; + beta_smp = beta_start[ipar]; for ( iismp = 0; iismp < hTcBuffer->subframe_nbslots[hTcBuffer->subframes_rendered]; iismp++ ) { - alpha_smp = alpha1[ipar] + ( alpha2[ipar] - alpha1[ipar] ) * param_interpol[iismp]; - beta_smp = beta1[ipar] + ( beta2[ipar] - beta1[ipar] ) * param_interpol[iismp]; + if ((slots_rendered == 0) && (iismp == 0)) + { + ifac = param_interpol[iismp]; + } + else + { + ifac = param_interpol[iismp] - param_interpol[iismp-1]; + } + dalpha = (alpha2[ipar] - alpha1[ipar]) * ifac; + dbeta = (beta2[ipar] - beta1[ipar]) * ifac; + + alpha_smp += dalpha; + beta_smp += dbeta; vmre = qmf_mod_re[ismp][iqmf]; vmim = qmf_mod_im[ismp][iqmf]; @@ -780,6 +803,8 @@ static void ps_pred_process_sf( ismp++; } + alpha_sf[ipar] = alpha_smp; + beta_sf[ipar] = beta_smp; } return; @@ -827,7 +852,8 @@ static void ivas_mc_paramupmix_dec_sf( Cldfb_RealBuffer[2 * ch + 1], /* in/out decorr */ Cldfb_ImagBuffer[2 * ch + 1], &hMCParamUpmix->param_interpolator[st_ivas->hTcBuffer->slots_rendered], - ch ); + ch, + st_ivas->hTcBuffer->slots_rendered ); /*-- m, s -> l, r ----------------------------*/ for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 152cf5091e..e13be18793 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -804,6 +804,8 @@ typedef struct ivas_mc_paramupmix_dec_data_structure float *pcm_delay[MC_PARAMUPMIX_MAX_TRANSPORT_CHANS]; #ifdef JBM_PARAMUPMIX float *param_interpolator; + float alpha_sf[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS]; + float beta_sf[MC_PARAMUPMIX_COMBINATIONS][IVAS_MAX_NUM_BANDS]; int16_t free_param_interpolator; #endif -- GitLab From 1f1b79c01f3c0ded99a4d884715934efbd18fad0 Mon Sep 17 00:00:00 2001 From: rtyag Date: Wed, 5 Jul 2023 18:07:19 +1000 Subject: [PATCH 0320/1418] merge fixes --- lib_com/ivas_prot.h | 3 - lib_com/options.h | 57 ++-- lib_dec/ivas_binRenderer_internal.c | 439 ++-------------------------- lib_dec/ivas_dec.c | 26 +- lib_dec/ivas_dirac_dec.c | 7 +- lib_dec/ivas_mc_param_dec.c | 3 - lib_dec/ivas_output_config.c | 17 +- lib_rend/ivas_prot_rend.h | 17 +- lib_rend/ivas_rotation.c | 157 +++------- lib_rend/ivas_splitRendererPre.c | 7 + lib_rend/ivas_stat_rend.h | 3 + lib_rend/lib_rend.c | 180 ++---------- 12 files changed, 162 insertions(+), 754 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index bf28f2c545..4d91ff2a98 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5172,9 +5172,6 @@ void ivas_binaural_cldfb_sf( #endif void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - #ifdef FIX_SPLIT_REND_MERGE - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ - #endif #ifdef SPLIT_REND_WITH_HEAD_ROT MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #endif diff --git a/lib_com/options.h b/lib_com/options.h index 11c1790886..f788eb8f41 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -138,12 +138,40 @@ #define BASOP_NOGLOB /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define FIX_BIT_EXACT /* fix for bit-inexactness in splitrendering renderer pytest*/ -#define FIX_SPLIT_REND_MERGE /* Resolving the compilation warnings after splitrenderer main updation */ + +#define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ +#define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ +#define RENAME_GWLPR /* FhG: Rename clashing symbol */ + +#define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ +#define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ +#define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ +#define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ +#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ +#define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ +#define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ +#define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ +#define FIX_568_ISM_BITRATE_SWITCHING /* Philips: Issue 568: Bugfix for renderer re-initialization by ISM and bitrate switching */ +#define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ +#define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ +#define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ +#define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ +#define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ +#define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ +#define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ +#define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ +#define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ +#define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ +#define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ + #define SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT + +#define FIX_SPLIT_REND_MERGE /* Resolving the compilation warnings after splitrenderer main updation */ + + //#define SPLIT_REND_WITH_HEAD_ROT_DEBUG // only for debugging purposes //#define DBG_WAV_WRITER @@ -183,31 +211,6 @@ #define FIX_SPLIT_REND_OPEN_ERROR_HANDLING /* adds missing error handling around ivas_split_renderer_open calls */ // #define SPLIT_REND_LC3PLUS_HBR_DBG /* Override bitrate per LC3 core */ #endif -#define TD_TDREND_FIX_NULLPTR_ACCESS /* FhG: avoid nullptr access in ivas_rend_TDObjRendOpen */ -#define TD_REND_FIX_DIV_BY_ZERO /* FhG: avoid division by zero in sincResample fn */ -#define RENAME_GWLPR /* FhG: Rename clashing symbol */ - -#define FIX_563_PARAMMC_LIMITER /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set */ -#define FIX_560_VAD_FLAG /* Eri: Issue 560 - VAD flag issue for unified stereo */ -#define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ -#define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ -#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ -#define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ -#define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ -#define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ -#define FIX_568_ISM_BITRATE_SWITCHING /* Philips: Issue 568: Bugfix for renderer re-initialization by ISM and bitrate switching */ -#define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ -#define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ -#define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ -#define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ -#define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ -#define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ -#define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ -#define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ -#define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ -#define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ -#define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ - /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 6c66a47ec7..c29d8a6858 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -680,9 +680,6 @@ ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#ifndef FIX_SPLIT_REND_MERGE - RENDER_CONFIG_DATA *hRendCfg, -#endif MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { @@ -745,9 +742,6 @@ ivas_error ivas_rend_openCldfbRend( /* Allocate memories and buffers needed for convolutional module */ if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config, -#ifndef FIX_SPLIT_REND_MERGE - hRendCfg, -#endif pCldfbRend->hHrtfFastConv, hBinRenderer->numPoses ) ) != IVAS_ERR_OK ) { return error; @@ -856,9 +850,6 @@ ivas_error ivas_binRenderer_open( st_ivas->renderer_type, 1, AUDIO_CONFIG_7_1_4, -#ifndef FIX_SPLIT_REND_MERGE - st_ivas->hRenderConfig, -#endif st_ivas->hHrtfFastConv #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -889,9 +880,6 @@ ivas_error ivas_binRenderer_open( st_ivas->renderer_type, st_ivas->hIntSetup.is_loudspeaker_setup, st_ivas->hIntSetup.output_config, -#ifndef FIX_SPLIT_REND_MERGE - st_ivas->hRenderConfig, -#endif st_ivas->hHrtfFastConv #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -1276,9 +1264,6 @@ void ivas_binaural_cldfb( /* Implement binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, -#ifdef FIX_SPLIT_REND_MERGE - st_ivas->hHeadTrackData, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif @@ -1392,9 +1377,6 @@ void ivas_binaural_cldfb_sf( /* Implement binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, -#ifdef FIX_SPLIT_REND_MERGE - st_ivas->hHeadTrackData, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif @@ -1428,373 +1410,7 @@ void ivas_binaural_cldfb_sf( return; } #endif -#ifdef FIX_BIT_EXACT -/*------------------------------------------------------------------------- - * ivas_binaural_reverb_processFrame() - * - * Compute the reverberation - room effect - *------------------------------------------------------------------------*/ - -void ivas_binaural_reverb_processFrame( - REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */ - const int16_t numInChannels, /* i : num inputs to be processed */ - float inReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data real, Comment: This change swaps two first dimensions as first dimension is not constant. */ - float inImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : input CLDFB data imag */ - float outReal[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data real */ - float outImag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : output CLDFB data imag */ - const uint8_t offsetSamplesIO /* i : number of offset samples */ -) -{ - /* Declare the required variables */ - int16_t idx, bin, ch, sample, invertSampleIndex, tapIdx, *phaseShiftTypePr; - float **tapRealPr, **tapImagPr; - - /* 1) Rotate the data in the loop buffer of the reverberator. - * Notice that the audio at the loop buffers is at time-inverted order - * for convolution purposes later on. */ - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - /* Move the data forwards by blockSize (i.e. by the frame size of 16 CLDFB slots) */ - mvr2r( hReverb->loopBufReal[bin], hReverb->loopBufReal[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); - mvr2r( hReverb->loopBufImag[bin], hReverb->loopBufImag[bin] + hReverb->blockSize, hReverb->loopBufLength[bin] ); - - /* Add the data from the end of the loop to the beginning, with an attenuation factor - * according to RT60. This procedure generates an IIR decaying response. The response - * is decorrelated later on. */ - v_multc( hReverb->loopBufReal[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufReal[bin], hReverb->blockSize ); - v_multc( hReverb->loopBufImag[bin] + hReverb->loopBufLength[bin], hReverb->loopAttenuationFactor[bin], hReverb->loopBufImag[bin], hReverb->blockSize ); - } - - /* 2) Apply the determined pre-delay to the input audio, and add the delayed audio to the loop. */ - idx = hReverb->preDelayBufferIndex; - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - uint16_t sampleWithOffset; - sampleWithOffset = sample + offsetSamplesIO; - invertSampleIndex = hReverb->blockSize - sample - 1; - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - /* Add from pre-delay buffer a sample to the loop buffer, in a time-inverted order. - * Also apply the spectral gains determined for the reverberation */ - hReverb->loopBufReal[bin][invertSampleIndex] += hReverb->preDelayBufferReal[idx][bin] * hReverb->reverbEqGains[bin]; - hReverb->loopBufImag[bin][invertSampleIndex] += hReverb->preDelayBufferImag[idx][bin] * hReverb->reverbEqGains[bin]; - hReverb->preDelayBufferReal[idx][bin] = 0.0f; - hReverb->preDelayBufferImag[idx][bin] = 0.0f; - } - - /* Add every second input channel as is to the pre-delay buffer, and every second input channel with - * 90 degrees phase shift to reduce energy imbalances between coherent and incoherent sounds */ - for ( ch = 0; ch < numInChannels; ch++ ) - { - if ( ch % 2 ) - { - v_add( hReverb->preDelayBufferReal[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - else - { - v_sub( hReverb->preDelayBufferReal[idx], inImag[ch][sampleWithOffset], hReverb->preDelayBufferReal[idx], hReverb->numBins ); - v_add( hReverb->preDelayBufferImag[idx], inReal[ch][sampleWithOffset], hReverb->preDelayBufferImag[idx], hReverb->numBins ); - } - } - idx = ( idx + 1 ) % hReverb->preDelayBufferLength; - } - hReverb->preDelayBufferIndex = idx; - - /* 3) Perform the filtering/decorrelating, using complex and sparse FIR filtering */ - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - /* These tap pointers have been determined to point to the loop buffer at sparse locations */ - tapRealPr = hReverb->tapPointersReal[bin][ch]; - tapImagPr = hReverb->tapPointersImag[bin][ch]; - phaseShiftTypePr = hReverb->tapPhaseShiftType[bin][ch]; - - /* Flush output */ - set_f( hReverb->outputBufferReal[bin][ch], 0.0f, hReverb->blockSize ); - set_f( hReverb->outputBufferImag[bin][ch], 0.0f, hReverb->blockSize ); - /* Add from temporally decaying sparse tap locations the audio to the output. */ - for ( tapIdx = 0; tapIdx < hReverb->taps[bin][ch]; tapIdx++ ) - { - switch ( phaseShiftTypePr[tapIdx] ) - { - case 0: /* 0 degrees phase */ - v_add( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_add( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - case 1: /* 90 degrees phase */ - v_sub( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_add( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - case 2: /* 180 degrees phase */ - v_sub( hReverb->outputBufferReal[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_sub( hReverb->outputBufferImag[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - default: /* 270 degrees phase */ - v_add( hReverb->outputBufferReal[bin][ch], tapImagPr[tapIdx], hReverb->outputBufferReal[bin][ch], hReverb->blockSize ); - v_sub( hReverb->outputBufferImag[bin][ch], tapRealPr[tapIdx], hReverb->outputBufferImag[bin][ch], hReverb->blockSize ); - break; - } - } - } - - /* Generate diffuse field binaural coherence by mixing the incoherent reverberated channels with pre-defined gains */ - if ( bin <= hReverb->highestBinauralCoherenceBin ) - { - if ( hReverb->useBinauralCoherence ) - { - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - float leftRe, rightRe, leftIm, rightIm; - - leftRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][1][sample]; - rightRe = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferReal[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferReal[bin][0][sample]; - leftIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][0][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][1][sample]; - rightIm = hReverb->binauralCoherenceDirectGains[bin] * hReverb->outputBufferImag[bin][1][sample] + hReverb->binauralCoherenceCrossmixGains[bin] * hReverb->outputBufferImag[bin][0][sample]; - - hReverb->outputBufferReal[bin][0][sample] = leftRe; - hReverb->outputBufferReal[bin][1][sample] = rightRe; - hReverb->outputBufferImag[bin][0][sample] = leftIm; - hReverb->outputBufferImag[bin][1][sample] = rightIm; - } - } - } - } - - /* 4) Write data to output */ - for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - for ( sample = 0; sample < hReverb->blockSize; sample++ ) - { - uint16_t sampleWithOffset; - - sampleWithOffset = sample + offsetSamplesIO; - /* Audio was in the temporally inverted order for convolution, re-invert audio to output */ - invertSampleIndex = hReverb->blockSize - sample - 1; - - for ( bin = 0; bin < hReverb->numBins; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = hReverb->outputBufferReal[bin][ch][invertSampleIndex]; - outImag[ch][sampleWithOffset][bin] = hReverb->outputBufferImag[bin][ch][invertSampleIndex]; - } - for ( ; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) - { - outReal[ch][sampleWithOffset][bin] = 0.0f; - outImag[ch][sampleWithOffset][bin] = 0.0f; - } - } - } - - return; -} -static void ivas_binRenderer_2( - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData, -#endif -#ifdef SPLIT_REND_WITH_HEAD_ROT - float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ - float Cldfb_ImagBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ -#else - float Cldfb_RealBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ - float Cldfb_ImagBuffer_Binaural[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Binaural signals */ -#endif - float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ - float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX] /* i : LS signals */ -) -{ - int16_t chIdx, k; -#ifdef SPLIT_REND_WITH_HEAD_ROT - int16_t pos_idx, num_poses; -#endif - int16_t numTimeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; - - push_wmops( "fastconv_binaural_rendering" ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - num_poses = hBinRenderer->numPoses; -#endif - - /* Compute Convolution */ - /* memory reset for the binaural output */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { - set_zero( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); - set_zero( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], CLDFB_NO_CHANNELS_MAX ); - } - } - } -#else - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { - set_zero( Cldfb_RealBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); - set_zero( Cldfb_ImagBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX ); - } - } -#endif - - /* Head rotation in HOA3 or CICPx */ - if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) - { - if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) - { - /* Rotation in SHD (HOA3) */ - 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, MAX_PARAM_SPATIAL_SUBFRAMES, 3 ); - } - else if ( hHeadTrackData->shd_rot_max_order > 0 ) - { - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hHeadTrackData->Rmat, hBinRenderer->hInputSetup->nchan_out_woLFE, MAX_PARAM_SPATIAL_SUBFRAMES, hHeadTrackData->shd_rot_max_order ); - } - } - else - { - /* Rotation in SD (CICPx) */ - rotateFrame_sd_cldfb_2( hHeadTrackData, RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, hBinRenderer->conv_band ); - } - } - - /* HOA decoding to CICP19 if needed*/ - if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && hBinRenderer->nInChannels != 16 ) - { - ivas_sba2mc_cldfb( *( hBinRenderer->hInputSetup ), RealBuffer, ImagBuffer, hBinRenderer->nInChannels, hBinRenderer->conv_band, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer->hoa_dec_mtx ); - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[0], Cldfb_ImagBuffer_Binaural[0], RealBuffer, ImagBuffer, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer, 0 ); -#else - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, RealBuffer, ImagBuffer, hBinRenderer -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - 0 -#endif - ); -#endif - -#ifdef SPLIT_REND_WITH_HEAD_ROT - /*TODO : move this to a separate function*/ - if ( pMultiBinPoseData->num_poses > 1 ) - { - IVAS_QUATERNION Quaternions_rel, Quaternions_abs, *Quaternions_ref; - float Rmat_local[3][3]; - - if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) - { - Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; - Quaternions_rel.w = -3.0f; /*euler*/ - Quaternions_abs.w = -3.0f; /*euler*/ - Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ - - for ( pos_idx = 1; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) - { - Quaternions_rel.x = pMultiBinPoseData->relative_head_poses[pos_idx][0] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; - Quaternions_rel.y = pMultiBinPoseData->relative_head_poses[pos_idx][1] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; - Quaternions_rel.z = pMultiBinPoseData->relative_head_poses[pos_idx][2] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; - Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; - Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; - Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; - - - QuatToRotMat( Quaternions_rel, Rmat_local ); - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, MAX_PARAM_SPATIAL_SUBFRAMES, 3 ); - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, MAX_PARAM_SPATIAL_SUBFRAMES, hBinRenderer -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - pos_idx -#endif - ); - } - -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - if ( hPostRendHeadTrackData != NULL ) - { - IVAS_QUATERNION *Quaternions_new1; - IVAS_QUATERNION Quaternions_new; - Quaternions_new1 = &hPostRendHeadTrackData->Quaternions[hPostRendHeadTrackData->num_quaternions++]; - Quaternions_new.w = -3.0f; /*euler*/ - Quat2EulerDegree( *Quaternions_new1, &Quaternions_new.z, &Quaternions_new.y, &Quaternions_new.x ); /*order in Quat2Euler seems to be reversed ?*/ - Quaternions_rel.x = Quaternions_new.x - Quaternions_abs.x; - Quaternions_rel.y = Quaternions_new.y - Quaternions_abs.y; - Quaternions_rel.z = Quaternions_new.z - Quaternions_abs.z; - Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x; - Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y; - Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z; - - QuatToRotMat( Quaternions_rel, Rmat_local ); - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, 3 ); - ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[num_poses], Cldfb_ImagBuffer_Binaural[num_poses], RealBuffer, ImagBuffer, hBinRenderer -#ifdef SPLIT_REND_WITH_HEAD_ROT - , - num_poses -#endif - ); - } -#endif - } - } -#endif -#ifdef FIX_SPLIT_REND_MERGE - /* Obtain the binaural dmx and compute the reverb */ - if ( hBinRenderer->hReverb != NULL ) - { - float reverbRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float reverbIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float inRe[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - float inIm[BINAURAL_CHANNELS][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX]; - ivas_binaural_obtain_DMX( numTimeSlots, hBinRenderer, RealBuffer, ImagBuffer, inRe, inIm ); - - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { - set_zero( reverbRe[chIdx][k], hBinRenderer->max_band ); - set_zero( reverbIm[chIdx][k], hBinRenderer->max_band ); - } - } - - ivas_binaural_reverb_processSubframe( hBinRenderer->hReverb, BINAURAL_CHANNELS, numTimeSlots, inRe, inIm, reverbRe, reverbIm ); - - /* Add the conv module and reverb module output */ - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < numTimeSlots; k++ ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - for ( pos_idx = 0; pos_idx < num_poses; pos_idx++ ) - { - /* Combine first and second parts to generate binaural output signal with room effect */ - v_add( Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); - v_add( Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[pos_idx][chIdx][k], hBinRenderer->conv_band ); - } -#else - /* Combine first and second parts to generate binaural output signal with room effect */ - v_add( Cldfb_RealBuffer_Binaural[chIdx][k], reverbRe[chIdx][k], Cldfb_RealBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); - v_add( Cldfb_ImagBuffer_Binaural[chIdx][k], reverbIm[chIdx][k], Cldfb_ImagBuffer_Binaural[chIdx][k], hBinRenderer->conv_band ); -#endif - } - } - } - -#endif - pop_wmops(); - - return; -} -#endif /*------------------------------------------------------------------------- * ivas_binRenderer() * @@ -1803,9 +1419,6 @@ static void ivas_binRenderer_2( void ivas_binRenderer( BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: binaural renderer handle */ -#ifdef FIX_SPLIT_REND_MERGE - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i/o: head track handle */ -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #endif @@ -1903,18 +1516,16 @@ void ivas_binRenderer( #ifdef SPLIT_REND_WITH_HEAD_ROT /*TODO : move this to a separate function*/ -#ifdef FIX_SPLIT_REND_MERGE if ( pMultiBinPoseData != NULL ) { -#endif if ( pMultiBinPoseData->num_poses > 1 ) { IVAS_QUATERNION Quaternions_rel, Quaternions_abs, *Quaternions_ref; float Rmat_local[3][3]; - if ( hHeadTrackData && hHeadTrackData->num_quaternions >= 0 && hBinRenderer->rotInCldfb ) + if ( hCombinedOrientationData && hBinRenderer->rotInCldfb ) { - Quaternions_ref = &hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions - 1]; + Quaternions_ref = &hCombinedOrientationData->Quaternions[0]; Quaternions_rel.w = -3.0f; /*euler*/ Quaternions_abs.w = -3.0f; /*euler*/ Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ @@ -1966,9 +1577,7 @@ void ivas_binRenderer( #endif } } -#ifdef FIX_SPLIT_REND_MERGE } -#endif #endif /* Obtain the binaural dmx and compute the reverb */ @@ -2020,7 +1629,7 @@ void ivas_binRenderer( #ifdef SPLIT_REND_WITH_HEAD_ROT void ivas_rend_CldfbMultiBinRendProcess( const BINAURAL_RENDERER_HANDLE hCldfbRend, - const IVAS_REND_HeadRotData *pHeadRotData, + const COMBINED_ORIENTATION_HANDLE *pCombinedOrientationData, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -2028,8 +1637,7 @@ void ivas_rend_CldfbMultiBinRendProcess( float Cldfb_Out_Imag[][BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], const int16_t low_res_pre_rend_rot ) { - int16_t sf_idx, slot_idx, ch_idx, idx, pose_idx; - HEAD_TRACK_DATA head_track; + int16_t sf_idx, slot_idx, ch_idx, idx, pose_idx, i, j; float Cldfb_RealBuffer_sfIn[MAX_INPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer_sfIn[MAX_INPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG @@ -2053,41 +1661,36 @@ void ivas_rend_CldfbMultiBinRendProcess( mvr2r( &Cldfb_In_Imag[ch_idx][idx][0], &Cldfb_ImagBuffer_sfIn[ch_idx][slot_idx][0], hCldfbRend->max_band ); } } - head_track.num_quaternions = 0; - head_track.shd_rot_max_order = -1; - if ( low_res_pre_rend_rot ) - { - head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, 0 ); - } - else + + if ( ( *pCombinedOrientationData ) != NULL ) { - head_track.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositions, sf_idx ); + if ( low_res_pre_rend_rot ) + { + ( *pCombinedOrientationData )->Quaternions[sf_idx] = ( *pCombinedOrientationData )->Quaternions[0]; + for ( i = 0; i < 3; i++ ) + { + for ( j = 0; j < 3; j++ ) + { + ( *pCombinedOrientationData )->Rmat[sf_idx][i][j] = ( *pCombinedOrientationData )->Rmat[0][i][j]; + } + } + } + ( *pCombinedOrientationData )->shd_rot_max_order = -1; } #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG head_track_post.num_quaternions = 0; head_track_post.shd_rot_max_order = -1; head_track_post.Quaternions[0] = ivas_split_rend_get_sf_rot_data( pHeadRotData->headPositionsPostRend, sf_idx ); #endif -#ifdef FIX_BIT_EXACT - ivas_binRenderer_2( hCldfbRend, &head_track, - pMultiBinPoseData, -#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG - &head_track_post, -#endif - Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#else - ivas_binRenderer( hCldfbRend, &head_track, + + ivas_binRenderer( hCldfbRend, pMultiBinPoseData, -#ifdef FIX_SPLIT_REND_MERGE - NULL, - 0, MAX_PARAM_SPATIAL_SUBFRAMES, -#endif + *pCombinedOrientationData, sf_idx, MAX_PARAM_SPATIAL_SUBFRAMES, #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG &head_track_post, #endif Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer_sfIn, Cldfb_ImagBuffer_sfIn ); -#endif for ( pose_idx = 0; pose_idx < hCldfbRend->numPoses; pose_idx++ ) { for ( slot_idx = 0; slot_idx < MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index fdabbaf08f..d57d5cba53 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -102,18 +102,6 @@ ivas_error ivas_dec( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || - ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) - { -#ifdef SPLIT_REND_LC3PLUS - assert( ( st_ivas->ivas_format == SBA_FORMAT || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC ) ) && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA or discrete ISM format and 48k sampling rate only" ); -#else - assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); -#endif - ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hHeadTrackData, hSplitRendBits ); - } -#endif for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { p_output[n] = &output[n][0]; @@ -128,6 +116,18 @@ ivas_error ivas_dec( return error; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) || + ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { +#ifdef SPLIT_REND_LC3PLUS + assert( ( st_ivas->ivas_format == SBA_FORMAT || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC ) ) && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA or discrete ISM format and 48k sampling rate only" ); +#else + assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); +#endif + ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, hSplitRendBits ); + } +#endif /*----------------------------------------------------------------* * Decoding + Rendering *----------------------------------------------------------------*/ @@ -581,7 +581,7 @@ ivas_error ivas_dec( , 0 #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index ef0a9de92d..dc36c64f9f 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2933,9 +2933,6 @@ void ivas_dirac_dec_render_sf( { /* Perform binaural rendering */ ivas_binRenderer( st_ivas->hBinRenderer, -#ifdef FIX_SPLIT_REND_MERGE - st_ivas->hHeadTrackData, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif @@ -2961,8 +2958,8 @@ void ivas_dirac_dec_render_sf( { for ( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { - mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); - mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx][ch][index_slot + slot_idx], hDirAC->num_freq_bands ); + mvr2r( Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx][ch][slot_idx_start + slot_idx], hDirAC->num_freq_bands ); + mvr2r( Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx], st_ivas->splitBinRend.hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx][ch][slot_idx_start + slot_idx], hDirAC->num_freq_bands ); } } } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 264202e811..bd55264e5b 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1756,9 +1756,6 @@ void ivas_param_mc_dec_render( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { ivas_binRenderer( st_ivas->hBinRenderer, -#ifdef FIX_SPLIT_REND_MERGE - st_ivas->hHeadTrackData, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT &st_ivas->splitBinRend.splitrend.multiBinPoseData, #endif diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 4af9523ff6..e87b5cd0cb 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -448,7 +448,7 @@ void ivas_renderer_select( } #ifdef SPLIT_REND_WITH_HEAD_ROT -void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, HEAD_TRACK_DATA_HANDLE hHeadTrackData, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ) +void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ) { hSplitRendBits->bits_written = 0; hSplitRendBits->bits_read = 0; @@ -459,15 +459,22 @@ void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS ivas_renderSplitGetMultiBinPoseData( hSplitBinConfig, &hSplitBinRend->splitrend.multiBinPoseData, - hHeadTrackData->sr_pose_pred_axis ); + hCombinedOrientationData->sr_pose_pred_axis ); #ifdef SPLIT_REND_IVAS_DEC_HT_TR - if ( hHeadTrackData != NULL ) + if ( hCombinedOrientationData != NULL ) { - int16_t sf; + int16_t sf, i, j; for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { - hHeadTrackData->Quaternions[sf] = hHeadTrackData->Quaternions[0]; + hCombinedOrientationData->Quaternions[sf] = hCombinedOrientationData->Quaternions[0]; + for ( i = 0; i < 3; i++ ) + { + for ( j = 0; j < 3; j++ ) + { + hCombinedOrientationData->Rmat[sf][i][j] = hCombinedOrientationData->Rmat[0][i][j]; + } + } } } #endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index dd3be52c41..898bf3fc3b 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -539,7 +539,7 @@ ivas_error ivas_rend_openMultiBinCrend( #ifdef SPLIT_REND_WITH_HEAD_ROT void ivas_rend_CldfbMultiBinRendProcess( const BINAURAL_RENDERER_HANDLE hCldfbRend, - const IVAS_REND_HeadRotData *pHeadRotData, + const COMBINED_ORIENTATION_HANDLE *pCombinedOrientationData, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, float Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], float Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], @@ -555,9 +555,6 @@ ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, const IVAS_REND_AudioConfig inConfig, const IVAS_REND_AudioConfig outConfig, -#ifndef FIX_SPLIT_REND_MERGE - RENDER_CONFIG_DATA *hRendCfg, -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, #endif @@ -942,17 +939,7 @@ void rotateFrame_shd_cldfb( const int16_t numTimeSlots, /* i : number of time slots to process */ const int16_t shd_rot_max_order /* i : split-order rotation method */ ); -#ifdef FIX_BIT_EXACT -void rotateFrame_sd_cldfb_2( - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ - float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ - float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain imag part */ - const IVAS_OUTPUT_SETUP_HANDLE hOutputSetup, /* i : output format setup number of channels */ - const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ - const int16_t nb_band /* i : number of CLDFB bands to process */ -); -#endif void rotateFrame_sd_cldfb( float Rmat[3][3], /* i : real-space rotation matrix */ float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ @@ -1081,7 +1068,7 @@ ivas_error ivas_orient_trk_Process( void ivas_set_split_rend_setup( IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, IVAS_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, - HEAD_TRACK_DATA_HANDLE hHeadTrackData, + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i/o: combined orientation handle */ IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits ); void ivas_init_split_rend_handles( diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 4e817ed33b..01d6b68420 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -48,7 +48,13 @@ * Local funtion declarations *-----------------------------------------------------------------------*/ -static ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, IVAS_VECTOR3 *listenerPos, int16_t numHeadRotQuaternions, EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); +static ivas_error combine_external_and_head_orientations( IVAS_QUATERNION *headRotQuaternions, IVAS_VECTOR3 *listenerPos, +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis, /* i : split rend pose prediction axis*/ +#endif + int16_t numHeadRotQuaternions, + EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, + COMBINED_ORIENTATION_HANDLE hCombinedOrientationData ); static void external_target_interpolation( EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const int16_t i ); @@ -666,112 +672,6 @@ void rotateFrame_shd_cldfb( return; } -#ifdef FIX_BIT_EXACT -void rotateFrame_sd_cldfb_2( - HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ - float Cldfb_RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain real part */ - float Cldfb_ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i/o: unrotated HOA3 signal buffer in cldfb domain imag part */ - const IVAS_OUTPUT_SETUP_HANDLE hOutputSetup, /* i : output format setup number of channels */ - const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ - const int16_t nb_band /* i : number of CLDFB bands to process */ -) -{ - int16_t iBlock, iBand, m, n; - float gains[MAX_CICP_CHANNELS - 1][MAX_CICP_CHANNELS - 1]; - int16_t azimuth, elevation; - float Rmat[3][3]; - float g1; - float realRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; - float imagRot[MAX_CICP_CHANNELS - 1][MAX_PARAM_SPATIAL_SUBFRAMES * CLDFB_NO_CHANNELS_MAX]; - float *p_realRot, *p_imagRot; - float *p_real, *p_imag; - int16_t nInChannels; - int16_t isPlanar; - - push_wmops( "rotateFrame_sd_cldfb" ); - - nInChannels = hOutputSetup->nchan_out_woLFE; - isPlanar = 1; - for ( n = 0; n < nInChannels; n++ ) - { - if ( hOutputSetup->ls_elevation[n] != 0 ) - { - isPlanar = 0; - break; - } - } - - /* Get next quaternion and calculate rotation matrix */ - QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], Rmat ); - - /* rotation of Euler angles */ - for ( n = 0; n < nInChannels; n++ ) - { - rotateAziEle( hOutputSetup->ls_azimuth[n], hOutputSetup->ls_elevation[n], &azimuth, &elevation, Rmat, isPlanar ); - if ( hEFAPdata != NULL && ( hOutputSetup->ls_azimuth[n] != azimuth || hOutputSetup->ls_elevation[n] != elevation ) ) - { - efap_determine_gains( hEFAPdata, gains[n], azimuth, elevation, EFAP_MODE_EFAP ); - } - else - { - set_zero( gains[n], nInChannels ); - gains[n][n] = 1.0f; - } - } - - /* Apply panning gains by mtx multiplication*/ - for ( n = 0; n < nInChannels; n++ ) - { - set_zero( realRot[n], MAX_PARAM_SPATIAL_SUBFRAMES * nb_band ); - set_zero( imagRot[n], MAX_PARAM_SPATIAL_SUBFRAMES * nb_band ); - for ( m = 0; m < nInChannels; m++ ) - { - g1 = gains[m][n]; - p_realRot = realRot[n]; - p_imagRot = imagRot[n]; - if ( g1 > 0.f ) - { - for ( iBlock = 0; iBlock < MAX_PARAM_SPATIAL_SUBFRAMES; iBlock++ ) - { - p_real = Cldfb_RealBuffer[m][iBlock]; - p_imag = Cldfb_ImagBuffer[m][iBlock]; - for ( iBand = 0; iBand < nb_band; iBand++ ) - { - *( p_realRot ) = *p_realRot + g1 * *( p_real++ ); - *( p_imagRot ) = *p_imagRot + g1 * *( p_imag++ ); - p_realRot++; - p_imagRot++; - } - } - } - } - } - - for ( n = 0; n < nInChannels; n++ ) - { - p_realRot = realRot[n]; - p_imagRot = imagRot[n]; - for ( iBlock = 0; iBlock < MAX_PARAM_SPATIAL_SUBFRAMES; iBlock++ ) - { - p_real = Cldfb_RealBuffer[n][iBlock]; - p_imag = Cldfb_ImagBuffer[n][iBlock]; - for ( iBand = 0; iBand < nb_band; iBand++ ) - { - *( p_real++ ) = *( p_realRot++ ); - *( p_imag++ ) = *( p_imagRot++ ); - } - for ( ; iBand < CLDFB_NO_CHANNELS_MAX; iBand++ ) - { - *( p_real++ ) = 0.f; - *( p_imag++ ) = 0.f; - } - } - } - pop_wmops(); - - return; -} -#endif /*------------------------------------------------------------------------- * rotateFrame_sd_cldfb() @@ -1041,6 +941,9 @@ ivas_error combine_external_and_head_orientations_dec( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; +#endif IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; int16_t numHeadRotQuaternions = 0; @@ -1053,9 +956,22 @@ ivas_error combine_external_and_head_orientations_dec( headRotQuaternions = hHeadTrackData->Quaternions; listenerPos = hHeadTrackData->Pos; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; +#endif + } +#ifdef SPLIT_REND_WITH_HEAD_ROT + else + { + sr_pose_pred_axis = DEFAULT_AXIS; } +#endif - return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, +#ifdef SPLIT_REND_WITH_HEAD_ROT + sr_pose_pred_axis, +#endif + numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); } @@ -1071,11 +987,17 @@ ivas_error combine_external_and_head_orientations_rend( COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ ) { +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; +#endif IVAS_QUATERNION *headRotQuaternions = NULL; IVAS_VECTOR3 *listenerPos = NULL; int16_t numHeadRotQuaternions = 0; int16_t i; +#ifdef SPLIT_REND_WITH_HEAD_ROT + sr_pose_pred_axis = DEFAULT_AXIS; +#endif if ( hHeadTrackData != NULL ) { if ( hHeadTrackData->headRotEnabled ) @@ -1083,6 +1005,9 @@ ivas_error combine_external_and_head_orientations_rend( headRotQuaternions = hHeadTrackData->headPositions; listenerPos = hHeadTrackData->Pos; } +#ifdef SPLIT_REND_WITH_HEAD_ROT + sr_pose_pred_axis = hHeadTrackData->sr_pose_pred_axis; +#endif } else if ( hExtOrientationData != NULL ) { @@ -1096,7 +1021,11 @@ ivas_error combine_external_and_head_orientations_rend( } } - return combine_external_and_head_orientations( headRotQuaternions, listenerPos, numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); + return combine_external_and_head_orientations( headRotQuaternions, listenerPos, +#ifdef SPLIT_REND_WITH_HEAD_ROT + sr_pose_pred_axis, +#endif + numHeadRotQuaternions, hExtOrientationData, hCombinedOrientationData ); } @@ -1108,8 +1037,11 @@ ivas_error combine_external_and_head_orientations_rend( *------------------------------------------------------------------------*/ static ivas_error combine_external_and_head_orientations( - IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ - IVAS_VECTOR3 *listenerPos, /* i : listener position */ + IVAS_QUATERNION *headRotQuaternions, /* i : quaternions for head rotation */ + IVAS_VECTOR3 *listenerPos, /* i : listener position */ +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis, /* i : split rend pose prediction axis*/ +#endif int16_t numHeadRotQuaternions, /* i : number of head rotation quaternions */ EXTERNAL_ORIENTATION_HANDLE hExtOrientationData, /* i : external orientation handle */ COMBINED_ORIENTATION_HANDLE hCombinedOrientationData /* i/o: combined orientation handle */ @@ -1350,6 +1282,9 @@ static ivas_error combine_external_and_head_orientations( hCombinedOrientationData->enableCombinedOrientation[i] = 0; } } +#ifdef SPLIT_REND_WITH_HEAD_ROT + hCombinedOrientationData->sr_pose_pred_axis = sr_pose_pred_axis; +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_splitRendererPre.c b/lib_rend/ivas_splitRendererPre.c index 9fccbb8ec6..3892b4710d 100644 --- a/lib_rend/ivas_splitRendererPre.c +++ b/lib_rend/ivas_splitRendererPre.c @@ -2193,6 +2193,13 @@ ivas_error ivas_renderMultiBinToSplitBinaural( } #endif } +#ifdef SPLIT_REND_LC3PLUS + else + { + pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; + pBits->codec = IVAS_SPLIT_REND_CODEC_NONE; + } +#endif /*zero pad*/ /*TODO: do this inside the LCLD ENC codec */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 5103342d0b..674ba95d6c 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -514,6 +514,9 @@ typedef struct ivas_combined_orientation_struct float procChEneIIR[2][MASA_FREQUENCY_BANDS]; int16_t shd_rot_max_order; IVAS_VECTOR3 listenerPos[MAX_PARAM_SPATIAL_SUBFRAMES]; +#ifdef SPLIT_REND_WITH_HEAD_ROT + IVAS_SPLIT_REND_ROT_AXIS sr_pose_pred_axis; +#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 061481e0dc..ff1a048508 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1474,13 +1474,13 @@ static ivas_error setRendInputActiveIsm( } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR) + else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, NULL, *rendCtx.pOutSampleRate @@ -2644,9 +2644,6 @@ updateSbaPanGains( { assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, -#ifndef FIX_SPLIT_REND_MERGE - hRendCfg, -#endif &inputSba->splitRendWrapper.multiBinPoseData, *rendCtx.pOutSampleRate ); if ( error != IVAS_ERR_OK ) @@ -2683,9 +2680,6 @@ updateSbaPanGains( { error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, -#ifndef FIX_SPLIT_REND_MERGE - hRendCfg, -#endif &inputSba->splitRendWrapper.multiBinPoseData, *rendCtx.pOutSampleRate ); if ( error != IVAS_ERR_OK ) @@ -5698,128 +5692,7 @@ static ivas_error rotateFrameSba( return IVAS_ERR_OK; } -#ifdef FIX_BIT_EXACT -static ivas_error rotateFrameSba_2( - IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ - const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ - rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ - IVAS_REND_AudioBuffer outAudio /* o : Output Audio buffer */ -) -{ - int16_t i, l, n, m; - int16_t m1, m2; - int16_t shd_rot_max_order; - int16_t subframe_idx, subframe_len; -#ifdef SBA_CREND_ROT_OPT - float *writePtr; -#else - float *readPtr, *writePtr; -#endif - rotation_matrix Rmat; - float tmpRot[2 * HEADROT_ORDER + 1]; - rotation_gains gains; - ivas_error error; -#ifdef SBA_CREND_ROT_OPT - int16_t idx; - float val, cf, oneminuscf; -#endif - - push_wmops( "rotateFrameSba" ); - - if ( ( error = getAmbisonicsOrder( inConfig, &shd_rot_max_order ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* subframe loop */ - subframe_len = inAudio.config.numSamplesPerChannel / RENDERER_HEAD_POSITIONS_PER_FRAME; - for ( subframe_idx = 0; subframe_idx < RENDERER_HEAD_POSITIONS_PER_FRAME; subframe_idx++ ) - { - /* initialize rotation matrices with zeros */ - for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) - { - set_zero( gains[i], HEADROT_SHMAT_DIM ); - } - - /* Get next quaternion and calculate rotation matrix */ - QuatToRotMat( headRotData->headPositions[subframe_idx], Rmat ); - - /* calculate ambisonics rotation matrices for the previous and current frames */ - SHrotmatgen( gains, Rmat, shd_rot_max_order ); - - for ( i = 0; i < subframe_len; i++ ) - { -#ifdef SBA_CREND_ROT_OPT - idx = subframe_idx * subframe_len + i; - cf = headRotData->crossfade[i]; - oneminuscf = 1 - cf; -#endif - /* As the rotation matrix becomes block diagonal in a SH basis, we can*/ - /* apply each angular-momentum block individually to save complexity. */ - - /* loop over l blocks */ - m1 = 1; - m2 = 4; - for ( l = 1; l <= shd_rot_max_order; l++ ) - { - /* compute mtx-vector product for this l */ - for ( n = m1; n < m2; n++ ) - { - tmpRot[n - m1] = 0.f; - for ( m = m1; m < m2; m++ ) - { -#ifdef SBA_CREND_ROT_OPT - val = inAudio.data[m * inAudio.config.numSamplesPerChannel + idx]; - /* crossfade with previous rotation gains */ - tmpRot[n - m1] += ( cf * gains[n][m] * val + oneminuscf * gains_prev[n][m] * val ); -#else - readPtr = getSmplPtr( inAudio, m, subframe_idx * subframe_len + i ); - /* crossfade with previous rotation gains */ - tmpRot[n - m1] += headRotData->crossfade[i] * gains[n][m] * ( *readPtr ) + - ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr ); -#endif - } - } - /* 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; - } - } - - /*unoptimized code for reference (full matrix multiplication)*/ - // for ( n = 0; n < nchan; n++ ) - // { - // tmpRot[n] = 0.f; - // - // for ( m = 0; m < nchan; m++ ) - // { - // tmpRot[n] += SHrotmat[n][m] * output[m][i]; - // } - // } - // for ( n = 0; n < nchan; n++ ) - // { - // output[n][i] = tmpRot[n]; - // } - - /* move SHrotmat to SHrotmat_prev */ - for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) - { - mvr2r( gains[i], gains_prev[i], HEADROT_SHMAT_DIM ); - } - } - - pop_wmops(); - - return IVAS_ERR_OK; -} -#endif static ivas_error renderIsmToBinaural( const input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) @@ -7176,8 +7049,9 @@ static ivas_error renderSbaToMultiBinaural( float *p_tmpCrendBuffer[MAX_OUTPUT_CHANNELS]; #endif - int16_t i, pos_idx; - IVAS_REND_HeadRotData HeadRotDataLocal; + int16_t sf, i, j, pos_idx; + COMBINED_ORIENTATION_DATA combinedOrientationDataLocal; + COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal; ivas_error error; @@ -7190,12 +7064,18 @@ static ivas_error renderSbaToMultiBinaural( } #endif push_wmops( "renderSbaToMultiBinaural" ); - - HeadRotDataLocal = *sbaInput->base.ctx.pHeadRotData; - for ( i = 1; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) - + pCombinedOrientationDataLocal = *sbaInput->base.ctx.pCombinedOrientationData; + combinedOrientationDataLocal = *pCombinedOrientationDataLocal; + for ( sf = 1; sf < RENDERER_HEAD_POSITIONS_PER_FRAME; sf++ ) { - HeadRotDataLocal.headPositions[i] = HeadRotDataLocal.headPositions[0]; + combinedOrientationDataLocal.Quaternions[sf] = combinedOrientationDataLocal.Quaternions[0]; + for ( i = 0; i < 3; i++ ) + { + for ( j = 0; j < 3; j++ ) + { + combinedOrientationDataLocal.Rmat[sf][i][j] = combinedOrientationDataLocal.Rmat[0][i][j]; + } + } } tmpRotBuffer = sbaInput->base.inputBuffer; @@ -7207,14 +7087,15 @@ static ivas_error renderSbaToMultiBinaural( IVAS_QUATERNION Quaternions_orig[RENDERER_HEAD_POSITIONS_PER_FRAME], Quaternions_abs; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { - Quaternions_orig[i] = HeadRotDataLocal.headPositions[i]; + Quaternions_orig[i] = combinedOrientationDataLocal.Quaternions[i]; Quaternions_abs.w = -3.0f; - Quat2EulerDegree( HeadRotDataLocal.headPositions[i], &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ + Quat2EulerDegree( combinedOrientationDataLocal.Quaternions[i], &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/ Quaternions_abs.x += pMultiBinPoseData->relative_head_poses[pos_idx][0]; Quaternions_abs.y += pMultiBinPoseData->relative_head_poses[pos_idx][1]; Quaternions_abs.z += pMultiBinPoseData->relative_head_poses[pos_idx][2]; - HeadRotDataLocal.headPositions[i] = Quaternions_abs; + combinedOrientationDataLocal.Quaternions[i] = Quaternions_abs; + QuatToRotMat( combinedOrientationDataLocal.Quaternions[i], combinedOrientationDataLocal.Rmat[i] ); } @@ -7222,23 +7103,14 @@ static ivas_error renderSbaToMultiBinaural( mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); - -#ifdef FIX_BIT_EXACT - rotateFrameSba_2( sbaInput->base.inputBuffer, - sbaInput->base.inConfig, - &HeadRotDataLocal, - sbaInput->rot_gains_prev[pos_idx], - tmpRotBuffer ); -#else + pCombinedOrientationDataLocal = &combinedOrientationDataLocal; rotateFrameSba( sbaInput->base.inputBuffer, sbaInput->base.inConfig, - &HeadRotDataLocal, -#ifdef FIX_SPLIT_REND_MERGE - sbaInput->base.ctx.pCombinedOrientationData, -#endif + sbaInput->base.ctx.pHeadRotData, + &pCombinedOrientationDataLocal, sbaInput->rot_gains_prev[pos_idx], tmpRotBuffer ); -#endif + copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); @@ -7258,7 +7130,7 @@ static ivas_error renderSbaToMultiBinaural( for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { - HeadRotDataLocal.headPositions[i] = Quaternions_orig[i]; + combinedOrientationDataLocal.Quaternions[i] = Quaternions_orig[i]; } /* move to output */ @@ -7289,7 +7161,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput, ivas_rend_CldfbMultiBinRendProcess( sbaInput->cldfbRendWrapper.hCldfbRend, - sbaInput->base.ctx.pHeadRotData, + sbaInput->base.ctx.pCombinedOrientationData, &sbaInput->splitRendWrapper.multiBinPoseData, Cldfb_RealBuffer, Cldfb_ImagBuffer, -- GitLab From b4c76218f33146a7da416f5a28e3ede9134b78dd Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Wed, 5 Jul 2023 11:11:42 +0200 Subject: [PATCH 0321/1418] fix synchronization of subframe information, fix compile problem when API_5MS is deactivated, memory optimization --- apps/decoder.c | 4 + lib_dec/ivas_dirac_dec.c | 4 + lib_dec/ivas_ism_param_dec.c | 19 +- lib_dec/ivas_jbm_dec.c | 712 +++++++++++++++++++++++++---------- lib_dec/ivas_mc_param_dec.c | 28 +- lib_dec/ivas_spar_decoder.c | 4 + lib_dec/lib_dec.c | 32 +- 7 files changed, 566 insertions(+), 237 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 71a296ed00..d7600702a8 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -421,8 +421,12 @@ int main( { #ifdef API_5MS if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) +#else +#ifndef VARIABLE_SPEED_DECODING + if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, IVAS_DEC_VOIP_MODE_VOIP, 100, 60, arg.inputFormat ) ) != IVAS_ERR_OK ) +#endif #endif { fprintf( stderr, "\nCould not enable VOIP: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index f692ef1931..35cfeecfe3 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2141,6 +2141,10 @@ void ivas_dirac_dec_set_md_map( hDirAC->subframes_rendered = 0; ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hDirAC->subframe_nbslots, &hDirAC->nb_subframes ); +#ifdef API_5MS + st_ivas->hTcBuffer->nb_subframes = hDirAC->nb_subframes; + mvs2s( hDirAC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hDirAC->nb_subframes ); +#endif /* set mapping according to dirac_read_idx */ diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 7a243dc266..22c5822f30 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -1263,14 +1263,23 @@ void ivas_param_ism_dec_digest_tc( *-----------------------------------------------------------------*/ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { +#endif - cldfbAnalysis_ts( &( transport_channels_f[ch][hDirAC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hDirAC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); - mvr2r( RealBuffer, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], hDirAC->num_freq_bands ); - mvr2r( ImagBuffer, &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], hDirAC->num_freq_bands ); + float RealBuffer[CLDFB_NO_CHANNELS_MAX]; + float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; + cldfbAnalysis_ts( &( transport_channels_f[ch][hDirAC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hDirAC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + mvr2r( RealBuffer, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], hDirAC->num_freq_bands ); + mvr2r( ImagBuffer, &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], hDirAC->num_freq_bands ); +#ifdef API_5MS + } + ivas_param_ism_collect_slot( hDirAC, &hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], &hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc[slot_idx * hDirAC->num_freq_bands * nchan_transport + ch * hDirAC->num_freq_bands], ch, ref_power, cx_diag ); +#else ivas_param_ism_collect_slot( hDirAC, RealBuffer, ImagBuffer, ch, ref_power, cx_diag ); +#endif } } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 42c834c70f..e36905725b 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -60,6 +60,9 @@ static void ivas_jbm_dec_copy_masa_meta_to_buffer( Decoder_Struct *st_ivas ); static void ivas_jbm_masa_sf_to_slot_map( Decoder_Struct *st_ivas, const int16_t nCldfbTs ); #endif +#ifdef API_5MS +static void ivas_jbm_dec_copy_tc_no_tsm( Decoder_Struct *st_ivas, float *tc[], const int16_t output_frame ); +#endif /*--------------------------------------------------------------------------* * ivas_jbm_dec_tc() @@ -497,9 +500,19 @@ ivas_error ivas_jbm_dec_tc( /*----------------------------------------------------------------* * Write IVAS transport channels *----------------------------------------------------------------*/ - - ivas_syn_output_f( p_output, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data ); - +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active == 1 ) + { +#endif + ivas_syn_output_f( p_output, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data ); +#ifdef API_5MS + } + else + { + /* directly copy to tc buffers */ + ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, output_frame ); + } +#endif /*----------------------------------------------------------------* * Common updates @@ -563,7 +576,18 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( { p_data_f[n] = &data_f[n][0]; } - ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) + { +#endif + ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); +#ifdef API_5MS + } + else + { + *nSamplesResidual = 0; + } +#endif n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity; if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) @@ -642,7 +666,12 @@ ivas_error ivas_jbm_dec_render( { int16_t n, nchan_out; int16_t nchan_transport; +#ifdef API_5MS + uint16_t nSamplesRenderedLocal; + float output[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ +#else float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ +#endif int16_t nchan_remapped; int32_t output_Fs; AUDIO_CONFIG output_config; @@ -664,294 +693,478 @@ ivas_error ivas_jbm_dec_render( nchan_out = st_ivas->hDecoderConfig->nchan_out; nchan_transport = st_ivas->hTcBuffer->nchan_transport_jbm; output_config = st_ivas->hDecoderConfig->output_config; +#ifndef API_5MS nSamplesAskedLocal = nSamplesAsked + st_ivas->hTcBuffer->n_samples_discard; +#endif - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) +#ifdef API_5MS + nSamplesRenderedLocal = 0; + *nSamplesRendered = 0; + while ( *nSamplesRendered < nSamplesAsked && st_ivas->hTcBuffer->n_samples_available > 0 ) { - p_output[n] = &output[n][0]; - } + nSamplesAskedLocal = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered] * st_ivas->hTcBuffer->n_samples_granularity; +#endif - for ( n = 0; n < st_ivas->hTcBuffer->nchan_transport_internal; n++ ) - { - p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; - } + for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) + { + p_output[n] = &output[n][0]; + } - /*----------------------------------------------------------------* - * Combine orientations - *----------------------------------------------------------------*/ + for ( n = 0; n < st_ivas->hTcBuffer->nchan_transport_internal; n++ ) + { + p_tc[n] = &st_ivas->hTcBuffer->tc[n][st_ivas->hTcBuffer->n_samples_rendered]; + } - if ( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, - st_ivas->hCombinedOrientationData ) ) != IVAS_ERR_OK ) - { - return error; - } + /*----------------------------------------------------------------* + * Combine orientations + *----------------------------------------------------------------*/ - /*----------------------------------------------------------------* - * Rendering - *----------------------------------------------------------------*/ + if ( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, + st_ivas->hCombinedOrientationData ) ) != IVAS_ERR_OK ) + { + return error; + } - if ( st_ivas->ivas_format == UNDEFINED_FORMAT ) - { - assert( 0 ); - } - else if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) - { + /*----------------------------------------------------------------* + * Rendering + *----------------------------------------------------------------*/ + + if ( st_ivas->ivas_format == UNDEFINED_FORMAT ) + { + assert( 0 ); + } + else if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) + { +#ifdef API_5MS + ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, p_output ); +#else ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); - } - else if ( st_ivas->ivas_format == STEREO_FORMAT ) - { - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_MC ) +#endif + } + else if ( st_ivas->ivas_format == STEREO_FORMAT ) { + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_MC ) + { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, nSamplesRenderedLocal, p_tc, p_output ); +#else *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); +#endif + } } - } - else if ( st_ivas->ivas_format == ISM_FORMAT ) - { - /* Rendering */ - if ( st_ivas->ism_mode == ISM_MODE_PARAM ) + else if ( st_ivas->ivas_format == ISM_FORMAT ) { - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + /* Rendering */ + if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { +#ifdef API_5MS + ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, st_ivas->nchan_transport, p_output ); +#else ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, st_ivas->nchan_transport, p_output ); - } - else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { +#endif + } + else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) + { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#else *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; - pan_right = 1.f - pan_left; +#endif + pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; + pan_right = 1.f - pan_left; +#ifdef API_5MS + v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], nSamplesRenderedLocal ); + v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], nSamplesRenderedLocal ); +#else v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered ); v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered ); - } - else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); - - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) +#endif + } + else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { - /* Convert CICP19 -> Ambisonics */ +#ifdef API_5MS + ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, p_output ); +#else + ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); +#endif + if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) + { + /* Convert CICP19 -> Ambisonics */ +#ifdef API_5MS + ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, nSamplesRenderedLocal, st_ivas->hOutSetup.ambisonics_order, 0.f ); +#else ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); +#endif + } } } - } - else /* ISM_MODE_DISC */ - { + else /* ISM_MODE_DISC */ + { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#else *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#endif - /* Loudspeaker or Ambisonics rendering */ - if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ + /* Loudspeaker or Ambisonics rendering */ + if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { + /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ +#ifdef API_5MS + ivas_ism_render_sf( st_ivas, p_output, nSamplesRenderedLocal ); +#else ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); - } - else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) - { - pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; - pan_right = 1.f - pan_left; +#endif + } + else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) + { + pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f; + pan_right = 1.f - pan_left; +#ifdef API_5MS + v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], nSamplesRenderedLocal ); + v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], nSamplesRenderedLocal ); +#else v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered ); v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered ); - } - 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 */ +#endif + } + 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 API_5MS + ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, nSamplesRenderedLocal, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); +#else ivas_ism2sba_sf( st_ivas->hTcBuffer->tc, p_output, st_ivas->hIsmRendererData, st_ivas->nchan_transport, *nSamplesRendered, st_ivas->hTcBuffer->n_samples_rendered, st_ivas->hIntSetup.ambisonics_order ); - } +#endif + } - /* Binaural rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { - if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) + /* Binaural rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { - return error; +#ifdef API_5MS + if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, nSamplesRenderedLocal ) ) != IVAS_ERR_OK ) +#else + if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } } - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { +#ifdef API_5MS + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, + NULL, st_ivas->hTcBuffer, p_output, p_output, nSamplesRenderedLocal, output_Fs ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } +#endif + { + return error; + } +#ifdef API_5MS + ivas_binaural_add_LFE( st_ivas, nSamplesRenderedLocal, p_output, p_output ); +#else ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); - } +#endif + } #ifdef DEBUGGING - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - ivas_binaural_cldfb_sf( st_ivas, *nSamplesRendered, p_output ); - } + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) + { +#ifdef API_5MS + ivas_binaural_cldfb_sf( st_ivas, nSamplesRenderedLocal, p_output ); +#else + ivas_binaural_cldfb_sf( st_ivas, *nSamplesRendered, p_output ); #endif + } +#endif + } } - } - else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) - { - nchan_remapped = nchan_transport; - - /* Loudspeakers, Ambisonics or Binaural rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) { + nchan_remapped = nchan_transport; + + /* Loudspeakers, Ambisonics or Binaural rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { +#ifdef API_5MS + ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, nchan_remapped, p_output ); +#else ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); - } - else if ( st_ivas->ivas_format == MASA_FORMAT ) - { - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) +#endif + } + else if ( st_ivas->ivas_format == MASA_FORMAT ) { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - for ( n = 0; n < nchan_remapped; n++ ) + if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#else + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#endif + for ( n = 0; n < nchan_remapped; n++ ) + { +#ifdef API_5MS + mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], nSamplesRenderedLocal ); +#else mvr2r( st_ivas->hTcBuffer->tc[n] + st_ivas->hTcBuffer->n_samples_rendered, p_output[n], *nSamplesRendered ); - } +#endif + } +#ifdef API_5MS + if ( ( error = ivas_sba_linear_renderer( p_output, nSamplesRenderedLocal, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_sba_linear_renderer( p_output, *nSamplesRendered, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } + } + else if ( st_ivas->renderer_type == RENDERER_DIRAC ) { - return error; +#ifdef API_5MS + ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, p_output ); +#else + ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); +#endif } } - else if ( st_ivas->renderer_type == RENDERER_DIRAC ) + else /* SBA_MODE_SPAR */ { - ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); - } - } - else /* SBA_MODE_SPAR */ - { +#ifdef API_5MS + ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, p_output ); +#else ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); +#endif + } } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - if ( st_ivas->mc_mode == MC_MODE_MCT ) + else if ( st_ivas->ivas_format == MC_FORMAT ) { - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->mc_mode == MC_MODE_MCT ) { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#else + *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); +#endif + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + { +#ifdef API_5MS + ivas_mc2sba( st_ivas->hTransSetup, p_tc, p_output, nSamplesRenderedLocal, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); +#else ivas_mc2sba( st_ivas->hTransSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); - } +#endif + } - /* Rendering */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { + /* Rendering */ + if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) + { +#ifdef API_5MS + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, + st_ivas->hCombinedOrientationData, + &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_tc, p_output, nSamplesRenderedLocal, output_Fs ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, st_ivas->hTcBuffer, p_tc, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - +#endif + { + return error; + } +#ifdef API_5MS + ivas_binaural_add_LFE( st_ivas, nSamplesRenderedLocal, st_ivas->hTcBuffer->tc, p_output ); +#else ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc, p_output ); - } - else if ( st_ivas->renderer_type == RENDERER_MC ) - { +#endif + } + else if ( st_ivas->renderer_type == RENDERER_MC ) + { +#ifdef API_5MS + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); + ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, nSamplesRenderedLocal, p_tc, p_output ); +#else *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc, p_output ); - } - else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) - { - ivas_mc2sba( st_ivas->hIntSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) - { - if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) +#endif + } + else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { - return error; +#ifdef API_5MS + ivas_mc2sba( st_ivas->hIntSetup, p_tc, p_output, nSamplesRenderedLocal, st_ivas->hOutSetup.ambisonics_order, 0.f ); +#else + ivas_mc2sba( st_ivas->hIntSetup, p_tc, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); +#endif } - + else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) + { +#ifdef API_5MS + if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, nSamplesRenderedLocal ) ) != IVAS_ERR_OK ) +#else + if ( ( ivas_td_binaural_renderer_sf( st_ivas, p_output, *nSamplesRendered ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#ifdef API_5MS + ivas_binaural_add_LFE( st_ivas, nSamplesRenderedLocal, st_ivas->hTcBuffer->tc, p_output ); +#else ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc, p_output ); +#endif + } } - } - else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) - { + else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) + { +#ifdef API_5MS + ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, p_output ); +#else ivas_param_mc_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); - } +#endif + } #ifdef API_5MS - else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) - { - /* zero output for now, not yet implemented... */ - int16_t ch; - *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - for ( ch = 0; ch < nchan_out; ch++ ) + else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - set_zero( p_output[ch], *nSamplesRendered ); - } - } -#endif - else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) - { - int16_t offset = st_ivas->hDirAC->slots_rendered * st_ivas->hDirAC->slot_size; - nchan_remapped = st_ivas->nchan_transport; + /* zero output for now, not yet implemented... */ + int16_t ch; + nSamplesRenderedLocal = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); + for ( ch = 0; ch < nchan_out; ch++ ) + { + set_zero( p_output[ch], nSamplesRenderedLocal ); + } } - else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */ +#endif + else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { - ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); + int16_t offset = st_ivas->hDirAC->slots_rendered * st_ivas->hDirAC->slot_size; + nchan_remapped = st_ivas->nchan_transport; - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) + { +#ifdef API_5MS + ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, nchan_remapped, p_output ); +#else + ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); +#endif + } + else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */ { - /* we still need to copy the separate channel if available */ - if ( st_ivas->hOutSetup.separateChannelEnabled ) +#ifdef API_5MS + ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, &nSamplesRenderedLocal, nSamplesAvailableNext, p_output ); +#else + ivas_dirac_dec_render( st_ivas, nchan_remapped, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output ); +#endif + if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) { + /* we still need to copy the separate channel if available */ + if ( st_ivas->hOutSetup.separateChannelEnabled ) + { +#ifdef API_5MS + mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], nSamplesRenderedLocal ); +#else mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); - } - +#endif + } +#ifdef API_5MS + ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, nSamplesRenderedLocal, st_ivas->hOutSetup.ambisonics_order, 0.f ); +#else ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); - } - else if ( st_ivas->intern_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 ) ) - { - for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) +#endif + } + else if ( st_ivas->intern_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 ) ) { + for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) + { +#ifdef API_5MS + set_zero( output[n], nSamplesRenderedLocal ); +#else set_zero( output[n], *nSamplesRendered ); +#endif + } } } - } - /* copy discrete C and TD LFE from internal TC to output */ - if ( st_ivas->hOutSetup.separateChannelEnabled ) - { - if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) + /* copy discrete C and TD LFE from internal TC to output */ + if ( st_ivas->hOutSetup.separateChannelEnabled ) { + if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || + output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || + output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) + { +#ifdef API_5MS + mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, output[LFE_CHANNEL], nSamplesRenderedLocal ); + mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], nSamplesRenderedLocal ); +#else mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, output[LFE_CHANNEL], *nSamplesRendered ); mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); - } - else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) - { - /* Delay the separated channel to sync with the DirAC rendering */ +#endif + } + else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) + { + /* Delay the separated channel to sync with the DirAC rendering */ +#ifdef API_5MS + mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], nSamplesRenderedLocal ); +#else mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); +#endif + } } } } - } - /*----------------------------------------------------------------* - * Write IVAS output channels - * - compensation for saturation - * - float to integer conversion - *----------------------------------------------------------------*/ + /*----------------------------------------------------------------* + * Write IVAS output channels + * - compensation for saturation + * - float to integer conversion + *----------------------------------------------------------------*/ +#ifdef API_5MS + st_ivas->hTcBuffer->n_samples_available -= nSamplesRenderedLocal; + st_ivas->hTcBuffer->n_samples_rendered += nSamplesRenderedLocal; +#else st_ivas->hTcBuffer->n_samples_available -= *nSamplesRendered; st_ivas->hTcBuffer->n_samples_rendered += *nSamplesRendered; +#endif - if ( st_ivas->hTcBuffer->n_samples_discard > 0 ) - { - for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) + if ( st_ivas->hTcBuffer->n_samples_discard > 0 ) { - p_output[n] += st_ivas->hTcBuffer->n_samples_discard; - } + for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) + { + p_output[n] += st_ivas->hTcBuffer->n_samples_discard; + } +#ifdef API_5MS + nSamplesRenderedLocal -= st_ivas->hTcBuffer->n_samples_discard; +#else *nSamplesRendered -= st_ivas->hTcBuffer->n_samples_discard; - st_ivas->hTcBuffer->n_samples_discard = 0; - } +#endif + st_ivas->hTcBuffer->n_samples_discard = 0; + } +#ifdef API_5MS + ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, nSamplesRenderedLocal, st_ivas->BER_detect ); +#else ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect ); +#endif + +#ifdef API_5MS +#ifdef DEBUGGING + st_ivas->noClipping += +#endif + ivas_syn_output( p_output, nSamplesRenderedLocal, nchan_out, data + *nSamplesRendered * nchan_out ); + *nSamplesRendered += nSamplesRenderedLocal; + } +#else #ifdef DEBUGGING st_ivas->noClipping += #endif ivas_syn_output( p_output, *nSamplesRendered, nchan_out, data ); - +#endif *nSamplesAvailableNext = st_ivas->hTcBuffer->n_samples_available; pop_wmops(); @@ -1508,6 +1721,9 @@ static void ivas_jbm_dec_copy_tc( } hTcBuffer->n_samples_rendered = 0; +#ifdef API_5MS + hTcBuffer->subframes_rendered = 0; +#endif return; } @@ -1627,27 +1843,42 @@ ivas_error ivas_jbm_dec_tc_buffer_open( nsamp_to_allocate = hTcBuffer->nchan_buffer_full * n_samp_full; nsamp_to_allocate += nchan_residual * n_samp_residual; - if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); - } - set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); - - offset = 0; - for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_full; - } - for ( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) +#ifdef API_5MS + if ( nsamp_to_allocate == 0 ) { - hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; - offset += n_samp_residual; + hTcBuffer->tc_buffer = NULL; + for ( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS; ch_idx++ ) + { + hTcBuffer->tc[ch_idx] = NULL; + } } - for ( ; ch_idx < MAX_TRANSPORT_CHANNELS; ch_idx++ ) + else { - hTcBuffer->tc[ch_idx] = NULL; +#endif + if ( ( hTcBuffer->tc_buffer = (float *) malloc( nsamp_to_allocate * sizeof( float ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) ); + } + set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate ); + + offset = 0; + for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ ) + { + hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; + offset += n_samp_full; + } + for ( ; ch_idx < hTcBuffer->nchan_transport_internal; ch_idx++ ) + { + hTcBuffer->tc[ch_idx] = &hTcBuffer->tc_buffer[offset]; + offset += n_samp_residual; + } + for ( ; ch_idx < MAX_TRANSPORT_CHANNELS; ch_idx++ ) + { + hTcBuffer->tc[ch_idx] = NULL; + } +#ifdef API_5MS } +#endif } st_ivas->hTcBuffer = hTcBuffer; @@ -1985,6 +2216,75 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( return buffer_mode; } +#ifdef API_5MS +void ivas_jbm_dec_copy_tc_no_tsm( + Decoder_Struct *st_ivas, + float *tc[], + const int16_t output_frame ) +{ + int16_t n_ch_full_copy; + int16_t n_ch_cldfb; + int16_t ch_idx; + DECODER_TC_BUFFER_HANDLE hTcBuffer; + + hTcBuffer = st_ivas->hTcBuffer; + hTcBuffer->n_samples_buffered = output_frame; + hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; + n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); + n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; + /* copy full tcs*/ + for ( ch_idx = 0; ch_idx < n_ch_full_copy; ch_idx++ ) + { + mvr2r( tc[ch_idx], st_ivas->hTcBuffer->tc[ch_idx], hTcBuffer->n_samples_buffered ); + } + + /* CLDFB ana for ParamMC/ParamISM */ + if ( n_ch_cldfb > 0 ) + { + float *cldfb_real_buffer; + float *cldfb_imag_buffer; + int16_t cldfb_ch, slot_idx, num_freq_bands; + + cldfb_real_buffer = NULL; + cldfb_imag_buffer = NULL; + num_freq_bands = 0; + + if ( st_ivas->ivas_format == ISM_FORMAT ) + { + cldfb_real_buffer = st_ivas->hDirAC->hParamIsmRendering->Cldfb_RealBuffer_tc; + cldfb_imag_buffer = st_ivas->hDirAC->hParamIsmRendering->Cldfb_ImagBuffer_tc; + num_freq_bands = st_ivas->hDirAC->num_freq_bands; + } + else if ( st_ivas->ivas_format == MC_FORMAT ) + { + cldfb_real_buffer = st_ivas->hParamMC->Cldfb_RealBuffer_tc; + cldfb_imag_buffer = st_ivas->hParamMC->Cldfb_ImagBuffer_tc; + num_freq_bands = st_ivas->hParamMC->num_freq_bands; + } +#ifdef DEBUGGING + else + { + assert( 0 && "Residual (direct CLDFB transport channels) only possible for ParamMC/ParamISM!" ); + } +#endif + /* CLDFB Analysis*/ + + for ( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) + { + for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) + { + cldfbAnalysis_ts( &( tc[ch_idx][num_freq_bands * slot_idx] ), + &cldfb_real_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + &cldfb_imag_buffer[slot_idx * num_freq_bands * n_ch_cldfb + cldfb_ch * num_freq_bands], + num_freq_bands, st_ivas->cldfbAnaDec[cldfb_ch] ); + } + } + } + hTcBuffer->n_samples_rendered = 0; + hTcBuffer->subframes_rendered = 0; +} +#endif + #ifdef FIX_470_MASA_JBM_EXT /*--------------------------------------------------------------------------* diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 16159ad005..6fe970d227 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1456,6 +1456,10 @@ void ivas_param_mc_dec_digest_tc( hParamMC->slots_rendered = 0; hParamMC->subframes_rendered = 0; ivas_jbm_dec_get_adapted_subframes( nCldfbSlots, hParamMC->subframe_nbslots, &hParamMC->nb_subframes ); +#ifdef API_5MS + st_ivas->hTcBuffer->nb_subframes = hParamMC->nb_subframes; + mvs2s( hParamMC->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hParamMC->nb_subframes ); +#endif ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator ); @@ -1468,18 +1472,24 @@ void ivas_param_mc_dec_digest_tc( /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { - float RealBuffer[CLDFB_NO_CHANNELS_MAX]; - float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - - /* CLDFB Analysis*/ - for ( ch = 0; ch < nchan_transport; ch++ ) +#ifdef API_5MS + if ( st_ivas->hDecoderConfig->tsm_active ) { - cldfbAnalysis_ts( &( transport_channels_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); +#endif + float RealBuffer[CLDFB_NO_CHANNELS_MAX]; + float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; - mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); - } + /* CLDFB Analysis*/ + for ( ch = 0; ch < nchan_transport; ch++ ) + { + cldfbAnalysis_ts( &( transport_channels_f[ch][hParamMC->num_freq_bands * slot_idx] ), RealBuffer, ImagBuffer, hParamMC->num_freq_bands, st_ivas->cldfbAnaDec[ch] ); + mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); + mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); + } +#ifdef API_5MS + } +#endif if ( slot_idx >= 2 * hParamMC->hMetadataPMC->attackIndex ) { ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], cx, cx_imag, hParamMC, nchan_transport ); diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index df60891a58..ce339e80cc 100755 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1166,6 +1166,10 @@ void ivas_spar_dec_set_render_map( hSpar->subframes_rendered = 0; set_s( hSpar->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME ); ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hSpar->subframe_nbslots, &hSpar->nb_subframes ); +#ifdef API_5MS + st_ivas->hTcBuffer->nb_subframes = hSpar->nb_subframes; + mvs2s( hSpar->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hSpar->nb_subframes ); +#endif ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, 1, 0, DEFAULT_JBM_CLDFB_TIMESLOTS, hSpar->render_to_md_map ); return; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5fbbee3df3..d33c55deff 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3662,17 +3662,16 @@ ivas_error IVAS_DEC_reconfigure( } } #ifdef API_5MS - } -#endif -#ifdef API_5MS - if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); -#else + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); + } +#endif +#ifndef API_5MS if ( ( hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) { @@ -3696,17 +3695,16 @@ ivas_error IVAS_DEC_reconfigure( } #ifdef API_5MS apa_buffer_size = APA_BUF_PER_CHANNEL; + free( hIvasDec->apaExecBuffer ); + if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); + } + set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); } #endif /* realloc apa_exe_buffer */ -#ifdef API_5MS - free( hIvasDec->apaExecBuffer ); - if ( ( hIvasDec->apaExecBuffer = malloc( sizeof( float ) * apa_buffer_size * nTransportChannels ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); - } - set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); -#else +#ifndef API_5MS free( hIvasDec->hVoIP->apaExecBuffer ); if ( ( hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( float ) * APA_BUF_PER_CHANNEL * nTransportChannels ) ) == NULL ) { -- GitLab From 67d82c2aa3298894c094c5cc3d645bf22e1230d9 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Wed, 5 Jul 2023 11:23:42 +0200 Subject: [PATCH 0322/1418] Clang and msan fix --- lib_dec/ivas_init_dec.c | 17 ++++++++++++++++- lib_dec/ivas_jbm_dec.c | 2 +- lib_dec/ivas_mc_paramupmix_dec.c | 18 +++++++++--------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 0e63166be3..3154f19461 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1336,20 +1336,35 @@ ivas_error ivas_init_decoder( if ( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) { granularity = NS2SA( output_Fs, CLDFB_SLOT_NS ); + + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, MC_PARAMUPMIX_MAX_INPUT_CHANS, MC_PARAMUPMIX_MAX_INPUT_CHANS, granularity ) ) != IVAS_ERR_OK ) + { + return error; + } } else { granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); + + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + + if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) + { + return error; + } } #else granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES ); -#endif + n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas ); if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK ) { return error; } +#endif } } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 3b26ef44e1..43ad5d59fe 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1486,7 +1486,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( #ifdef JBM_PARAMUPMIX else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { - num_tc = MC_PARAMUPMIX_MAX_INPUT_CHANS; + num_tc = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; } #endif else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 25538a2ae4..c790d5b59d 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -489,7 +489,7 @@ ivas_error ivas_mc_paramupmix_dec_open( buffer_mode = TC_BUFFER_MODE_RENDERER; nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - nchan_to_allocate = nchan_tc; + nchan_to_allocate = MC_PARAMUPMIX_MAX_INPUT_CHANS; if ( ( hMCParamUpmix->param_interpolator = (float *) malloc( MAX_JBM_CLDFB_TIMESLOTS * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); @@ -503,7 +503,7 @@ ivas_error ivas_mc_paramupmix_dec_open( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { - nchan_to_allocate = 2 * BINAURAL_CHANNELS; + nchan_to_allocate = MC_PARAMUPMIX_MAX_INPUT_CHANS; } if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) { @@ -763,8 +763,8 @@ static void ps_pred_process_sf( 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }; - mvr2r(alpha_sf, alpha_start, IVAS_MAX_NUM_BANDS); - mvr2r(beta_sf, beta_start, IVAS_MAX_NUM_BANDS); + mvr2r( alpha_sf, alpha_start, IVAS_MAX_NUM_BANDS ); + mvr2r( beta_sf, beta_start, IVAS_MAX_NUM_BANDS ); for ( iqmf = 0; iqmf < CLDFB_NO_CHANNELS_MAX; iqmf++ ) { ipar = qmf_to_par_band[iqmf]; @@ -779,16 +779,16 @@ static void ps_pred_process_sf( for ( iismp = 0; iismp < hTcBuffer->subframe_nbslots[hTcBuffer->subframes_rendered]; iismp++ ) { - if ((slots_rendered == 0) && (iismp == 0)) + if ( ( slots_rendered == 0 ) && ( iismp == 0 ) ) { ifac = param_interpol[iismp]; } else { - ifac = param_interpol[iismp] - param_interpol[iismp-1]; + ifac = param_interpol[iismp] - param_interpol[iismp - 1]; } - dalpha = (alpha2[ipar] - alpha1[ipar]) * ifac; - dbeta = (beta2[ipar] - beta1[ipar]) * ifac; + dalpha = ( alpha2[ipar] - alpha1[ipar] ) * ifac; + dbeta = ( beta2[ipar] - beta1[ipar] ) * ifac; alpha_smp += dalpha; beta_smp += dbeta; @@ -852,7 +852,7 @@ static void ivas_mc_paramupmix_dec_sf( Cldfb_RealBuffer[2 * ch + 1], /* in/out decorr */ Cldfb_ImagBuffer[2 * ch + 1], &hMCParamUpmix->param_interpolator[st_ivas->hTcBuffer->slots_rendered], - ch, + ch, st_ivas->hTcBuffer->slots_rendered ); /*-- m, s -> l, r ----------------------------*/ -- GitLab From c4d393b219f0e620ceee541562d98e38bbc52097 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 5 Jul 2023 11:57:12 +0200 Subject: [PATCH 0323/1418] add split rendering support for MC format --- lib_com/options.h | 1 + lib_dec/ivas_dec.c | 57 ++++-- lib_dec/ivas_init_dec.c | 27 ++- lib_dec/ivas_output_config.c | 4 + lib_rend/ivas_crend.c | 116 +++++++++++ lib_rend/ivas_objectRenderer.c | 8 + lib_rend/ivas_prot_rend.h | 9 + lib_rend/lib_rend.c | 356 ++++++++++++++++++++++++++++++++- 8 files changed, 560 insertions(+), 18 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 11c1790886..1e287d1b20 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,6 +180,7 @@ #define SPLIT_REND_STACK_OPT #define SPLIT_REND_LC3PLUS /* FhG: split rendering using LC3plus codec */ +#define SPLIT_REND_LC3PLUS_MC /* FhG: split rendering using LC3plus codec for Multichannel content */ #define FIX_SPLIT_REND_OPEN_ERROR_HANDLING /* adds missing error handling around ivas_split_renderer_open calls */ // #define SPLIT_REND_LC3PLUS_HBR_DBG /* Override bitrate per LC3 core */ #endif diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index fdabbaf08f..b8e55507bc 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -107,12 +107,19 @@ ivas_error ivas_dec( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef SPLIT_REND_LC3PLUS +#ifdef SPLIT_REND_LC3PLUS_MC + assert( ( st_ivas->ivas_format == SBA_FORMAT || + ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC ) || + ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) ) && + ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA, discrete ISM, or MCT-MC formats and 48 kHz sampling rate only" ); +#else assert( ( st_ivas->ivas_format == SBA_FORMAT || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC ) ) && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA or discrete ISM format and 48k sampling rate only" ); +#endif #else assert( st_ivas->ivas_format == SBA_FORMAT && ( output_Fs == 48000 ) && "split binaural mode is currently supported with SBA format and 48k sampling rate only" ); #endif ivas_set_split_rend_setup( &st_ivas->splitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hHeadTrackData, hSplitRendBits ); - } + } #endif for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ ) { @@ -511,19 +518,30 @@ ivas_error ivas_dec( /* Rendering */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, - st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs +#ifdef SPLIT_REND_LC3PLUS_MC + if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_rend_crendProcessSplitBin( st_ivas, output, output_frame ); + } + else + { +#endif + if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, + st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs #ifdef SPLIT_REND_WITH_HEAD_ROT - , - 0 + , + 0 #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) - { - return error; - } + { + return error; + } - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); + ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); +#ifdef SPLIT_REND_LC3PLUS_MC + } +#endif } else if ( st_ivas->renderer_type == RENDERER_MC ) { @@ -535,12 +553,23 @@ ivas_error ivas_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { - if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) +#ifdef SPLIT_REND_LC3PLUS_MC + if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) { - return error; + ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ); // TODO tmu check } + else + { +#endif + if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK ) + { + return error; + } - ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); + ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); +#ifdef SPLIT_REND_LC3PLUS_MC + } +#endif } } else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) @@ -581,7 +610,7 @@ ivas_error ivas_dec( , 0 #endif - ) ) != IVAS_ERR_OK ) + ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 46d6cc0904..cfb45b5eb0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1333,7 +1333,7 @@ ivas_error ivas_init_decoder( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->splitBinRend.splitrend.multiBinPoseData, st_ivas->hHeadTrackData->sr_pose_pred_axis ); - /* Split rendering with ISMs only supported with LC3plus */ + /* Split rendering with MC/ISMs only supported with LC3plus */ #ifndef SPLIT_REND_CLDFB_ISM assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ); #endif @@ -1392,12 +1392,37 @@ ivas_error ivas_init_decoder( return error; } } +#ifdef SPLIT_REND_LC3PLUS_MC + + if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) + { + ivas_renderSplitGetMultiBinPoseData( + &st_ivas->hRenderConfig->split_rend_config, + &st_ivas->splitBinRend.splitrend.multiBinPoseData, + st_ivas->hHeadTrackData->sr_pose_pred_axis ); + + /* Split rendering with MC only supported with LC3plus */ + assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LC3PLUS ); + + error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend, + &st_ivas->hRenderConfig->split_rend_config, + hDecoderConfig->output_Fs, 0, 0 ); + if ( error != IVAS_ERR_OK ) + { + return error; + } + } +#endif 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 #ifdef SPLIT_REND_WITH_HEAD_ROT , +#ifdef SPLIT_REND_LC3PLUS_MC + ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB ) ? st_ivas->splitBinRend.splitrend.multiBinPoseData.num_poses : 1 +#else 1 +#endif #endif ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 4af9523ff6..604f136623 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -203,7 +203,11 @@ void ivas_renderer_select( else { *internal_config = transport_config; +#ifdef SPLIT_REND_LC3PLUS_MC + if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) +#else if ( output_config == AUDIO_CONFIG_BINAURAL ) +#endif { #ifdef DEBUGGING if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 22ec6406d2..a520a44dfa 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1741,3 +1741,119 @@ ivas_error ivas_rend_crendProcessSubframe( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_LC3PLUS_MC + + +/*-----------------------------------------------------------------------------------------* + * Function ivas_rend_crend_ProcessSplitBin() + * + * Process call for IVAS Crend renderer + *-----------------------------------------------------------------------------------------*/ + +ivas_error ivas_rend_crendProcessSplitBin( + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + float output[][L_FRAME48k], /* i/o: SCE channels / Binaural synthesis */ + const int16_t output_frame /* i : output frame length */ +) +{ + int16_t i; + int16_t pos_idx; + float gain_lfe; + float tmpLfeBuffer[L_FRAME48k]; + float tmpInputBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + float tmpSplitBinBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + ivas_error error; + + pMultiBinPoseData = &st_ivas->splitBinRend.splitrend.multiBinPoseData; + + /* Save current head positions */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + originalHeadRot[i] = st_ivas->hHeadTrackData->Quaternions[i]; + } + + /* copy input */ + for ( i = 0; i < st_ivas->nchan_transport; ++i ) + { + mvr2r( output[i], tmpInputBuffer[i], output_frame ); + } + + /* TODO tmu : partial duplication of ivas_binaural_add_LFE() for efficiency */ + /* copy LFE */ + mvr2r( output[st_ivas->hIntSetup.index_lfe[0]], tmpLfeBuffer, output_frame ); + gain_lfe = ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hHrtfCrend != NULL ) ) ? st_ivas->hCrendWrapper->hHrtfCrend->gain_lfe : GAIN_LFE; + v_multc( tmpLfeBuffer, gain_lfe, tmpLfeBuffer, output_frame ); + + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; ++pos_idx ) + { + /* Update head positions */ + if ( pos_idx != 0 ) + { + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + if ( originalHeadRot[i].w == -3.0f ) + { + st_ivas->hHeadTrackData->Quaternions[i].w = -3.0f; + st_ivas->hHeadTrackData->Quaternions[i].x = originalHeadRot[i].x + pMultiBinPoseData->relative_head_poses[pos_idx][0]; + st_ivas->hHeadTrackData->Quaternions[i].y = originalHeadRot[i].y + pMultiBinPoseData->relative_head_poses[pos_idx][1]; + st_ivas->hHeadTrackData->Quaternions[i].z = originalHeadRot[i].z + pMultiBinPoseData->relative_head_poses[pos_idx][2]; + } + else + { + st_ivas->hHeadTrackData->Quaternions[i].w = -3.0f; + Quat2EulerDegree( originalHeadRot[i], /* TODO tmu : fix bug with ordering*/ + &st_ivas->hHeadTrackData->Quaternions[i].z, + &st_ivas->hHeadTrackData->Quaternions[i].y, + &st_ivas->hHeadTrackData->Quaternions[i].x ); + st_ivas->hHeadTrackData->Quaternions[i].x += pMultiBinPoseData->relative_head_poses[pos_idx][0]; + st_ivas->hHeadTrackData->Quaternions[i].y += pMultiBinPoseData->relative_head_poses[pos_idx][1]; + st_ivas->hHeadTrackData->Quaternions[i].z += pMultiBinPoseData->relative_head_poses[pos_idx][2]; + } + } + } + + /* render inplace to first two channels of tmpInputBuffer */ + 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, + tmpInputBuffer, + st_ivas->hDecoderConfig->output_Fs, + pos_idx ) ) != IVAS_ERR_OK ) + { + return error; + } + + for ( i = 0; i < BINAURAL_CHANNELS; ++i ) + { + /* accumulate LFE to output */ + v_add( tmpInputBuffer[i], tmpLfeBuffer, tmpInputBuffer[i], output_frame ); + + /* move to split bin output buffer */ + mvr2r( tmpInputBuffer[i], tmpSplitBinBuffer[pos_idx * BINAURAL_CHANNELS + i], output_frame ); + + /* overwrite rendered channels with input again for next iteration */ + mvr2r( output[i], tmpInputBuffer[i], output_frame ); + } + } + + /* copy split binaural rendered signals to final output */ + for ( i = 0; i < BINAURAL_CHANNELS * pMultiBinPoseData->num_poses; ++i ) + { + mvr2r( tmpSplitBinBuffer[i], output[i], output_frame ); + } + + /* Restore original head rotation */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + st_ivas->hHeadTrackData->Quaternions[i] = originalHeadRot[i]; + } + + return IVAS_ERR_OK; +} +#endif diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 50f31c48a6..6ce2664c55 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -718,7 +718,11 @@ void ObjRenderIvasFrame_splitBinaural( ) { int32_t i; +#ifdef SPLIT_REND_LC3PLUS_MC + float tmpProcessing[MAX_OUTPUT_CHANNELS][L_FRAME48k]; +#else float tmpProcessing[MAX_NUM_OBJECTS][L_FRAME48k]; +#endif float tmpBinaural[MAX_HEAD_ROT_POSES * 2][L_FRAME48k]; #ifdef FIX_SPLIT_REND_MERGE float *p_tmpProcessing[MAX_NUM_OBJECTS]; @@ -759,7 +763,11 @@ void ObjRenderIvasFrame_splitBinaural( /* Copy input audio to a processing buffer. Cannot render in-place because binaurally rendered * audio would overwrite original material, which is still needed for rendering next head pose. */ +#ifdef SPLIT_REND_LC3PLUS_MC + for ( i = 0; i < st_ivas->nchan_transport; ++i ) +#else for ( i = 0; i < MAX_NUM_OBJECTS; ++i ) +#endif { mvr2r( output[i], tmpProcessing[i], output_frame ); } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index dd3be52c41..c5c1786f87 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -640,6 +640,15 @@ ivas_error ivas_rend_crendProcessSubframe( const int32_t output_Fs /* i : output sampling rate */ ); +#ifdef SPLIT_REND_LC3PLUS_MC +/* TODO tmu : interface cleanup */ +ivas_error ivas_rend_crendProcessSplitBin( + Decoder_Struct *st_ivas, + float output[][L_FRAME48k], + const int16_t output_frame +); +#endif + /*----------------------------------------------------------------------------------* * Reverberator *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 061481e0dc..d641606441 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -31,6 +31,7 @@ *******************************************************************************************************/ #include "options.h" +#include "ivas_stat_rend.h" #include "lib_rend.h" #include "prot.h" #include "ivas_prot.h" @@ -177,6 +178,9 @@ typedef struct EFAP_WRAPPER efapInWrapper; TDREND_WRAPPER tdRendWrapper; CREND_WRAPPER_HANDLE crendWrapper; +#ifdef SPLIT_REND_LC3PLUS_MC + TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ +#endif REVERB_HANDLE hReverb; rotation_gains rot_gains_prev; int16_t nonDiegeticPan; @@ -1474,13 +1478,13 @@ static ivas_error setRendInputActiveIsm( } if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR) + else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, NULL, *rendCtx.pOutSampleRate @@ -2135,6 +2139,10 @@ static ivas_error updateMcPanGains( switch ( outConfig ) { case IVAS_REND_AUDIO_CONFIG_BINAURAL: +#ifdef SPLIT_REND_LC3PLUS_MC + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#endif break; /* Do nothing */ case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: @@ -2181,6 +2189,9 @@ static ivas_error initMcBinauralRendering( RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; +#ifdef SPLIT_REND_LC3PLUS_MC + int16_t i; +#endif int32_t outSampleRate; /* check if re-initialization */ @@ -2190,6 +2201,16 @@ static ivas_error initMcBinauralRendering( inputMc->tdRendWrapper.hHrtfTD = NULL; } +#ifdef SPLIT_REND_LC3PLUS_MC + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) + { + ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); + inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; + } + } +#endif ivas_rend_closeCrend( &inputMc->crendWrapper #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2235,6 +2256,27 @@ static ivas_error initMcBinauralRendering( return error; } +#ifdef SPLIT_REND_LC3PLUS_MC + if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + /* Open TD renderer wrappers */ + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], + inConfig, + hRendCfg, + &inputMc->customLsInput, + outSampleRate ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Assert same delay as main TD renderer */ + assert( inputMc->splitTdRendWrappers[i].binaural_latency_ns == inputMc->tdRendWrapper.binaural_latency_ns ); + } + } + +#endif if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) @@ -2365,6 +2407,9 @@ static ivas_error setRendInputActiveMc( const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) { +#ifdef SPLIT_REND_LC3PLUS_MC + int16_t i; +#endif ivas_error error; rendering_context rendCtx; IVAS_REND_AudioConfig outConfig; @@ -2399,8 +2444,19 @@ static ivas_error setRendInputActiveMc( inputMc->hMcMasa = NULL; initRotGains( inputMc->rot_gains_prev ); inputMc->lfeRouting = defaultLfeRouting( inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ); +#ifdef SPLIT_REND_LC3PLUS_MC + for ( i = 0; i < (int16_t) ( sizeof( inputMc->splitTdRendWrappers ) / sizeof( *inputMc->splitTdRendWrappers ) ); ++i ) + { + inputMc->splitTdRendWrappers[i] = defaultTdRendWrapper(); + } +#endif + +#ifdef SPLIT_REND_LC3PLUS_MC + if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) +#else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) { @@ -2427,6 +2483,9 @@ static ivas_error setRendInputActiveMc( static void clearInputMc( input_mc *inputMc ) { +#ifdef SPLIT_REND_LC3PLUS_MC + int16_t i; +#endif rendering_context rendCtx; rendCtx = inputMc->base.ctx; @@ -2462,6 +2521,17 @@ static void clearInputMc( inputMc->tdRendWrapper.hHrtfTD = NULL; } +#ifdef SPLIT_REND_LC3PLUS_MC + for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) + { + if ( inputMc->splitTdRendWrappers[i].hBinRendererTd != NULL ) + { + ivas_td_binaural_close( &inputMc->splitTdRendWrappers[i].hBinRendererTd ); + inputMc->splitTdRendWrappers[i].hHrtfTD = NULL; + } + } +#endif + ivas_mcmasa_ana_close( &( inputMc->hMcMasa ) ); return; @@ -4242,7 +4312,11 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return error; } +#ifdef SPLIT_REND_LC3PLUS_MC + if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) +#else if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) +#endif { if ( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) { @@ -6400,14 +6474,24 @@ static ivas_error renderActiveInputsIsm( static ivas_error renderLfeToBinaural( const input_mc *mcInput, +#ifdef SPLIT_REND_LC3PLUS_MC + const IVAS_REND_AudioConfig outConfig, +#endif IVAS_REND_AudioBuffer outAudio ) { int16_t i; int16_t lfe_idx; +#ifdef SPLIT_REND_LC3PLUS_MC + int16_t pose_idx, num_poses; +#endif float gain; float *readPtr, *writePtr; +#ifdef SPLIT_REND_LC3PLUS_MC + assert( ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) && "Must be binaural output" ); +#else assert( ( outAudio.config.numChannels == 2 ) && "Must be binaural output" ); +#endif push_wmops( "renderLfeToBinaural" ); @@ -6427,6 +6511,34 @@ static ivas_error renderLfeToBinaural( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_LC3PLUS_MC + /* Copy LFE to left and right binaural channels */ + if ( mcInput->base.ctx.pSplitRendWrapper != NULL ) + { + num_poses = mcInput->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses; + } + else + { + num_poses = 1; + } + + for ( pose_idx = 0; pose_idx < num_poses; ++pose_idx ) + { + readPtr = getSmplPtr( mcInput->base.inputBuffer, lfe_idx, 0 ); + writePtr = getSmplPtr( outAudio, pose_idx * BINAURAL_CHANNELS, 0 ); + for ( i = 0; i < mcInput->base.inputBuffer.config.numSamplesPerChannel; i++ ) + { + *writePtr++ += gain * ( *readPtr++ ); + } + + readPtr = getSmplPtr( mcInput->base.inputBuffer, lfe_idx, 0 ); + writePtr = getSmplPtr( outAudio, pose_idx * BINAURAL_CHANNELS + 1, 0 ); + for ( i = 0; i < mcInput->base.inputBuffer.config.numSamplesPerChannel; i++ ) + { + *writePtr++ += gain * ( *readPtr++ ); + } + } +#else /* Copy LFE to left and right ears */ readPtr = getSmplPtr( mcInput->base.inputBuffer, lfe_idx, 0 ); writePtr = getSmplPtr( outAudio, 0, 0 ); @@ -6441,6 +6553,7 @@ static ivas_error renderLfeToBinaural( { *writePtr++ += gain * ( *readPtr++ ); } +#endif pop_wmops(); @@ -6539,7 +6652,11 @@ static ivas_error renderMcToBinaural( accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); +#ifdef SPLIT_REND_LC3PLUS_MC + if ( ( error = renderLfeToBinaural( mcInput, outConfig, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -6637,7 +6754,11 @@ static ivas_error renderMcToBinauralRoom( accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); +#ifdef SPLIT_REND_LC3PLUS_MC + if ( ( error = renderLfeToBinaural( mcInput, outConfig, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -6735,7 +6856,11 @@ static ivas_error renderMcCustomLsToBinauralRoom( accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); +#ifdef SPLIT_REND_LC3PLUS_MC + if ( ( error = renderLfeToBinaural( mcInput, outConfig, outAudio ) ) != IVAS_ERR_OK ) +#else if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -6810,6 +6935,220 @@ static ivas_error renderMcToMasa( return IVAS_ERR_OK; } +#ifdef SPLIT_REND_LC3PLUS_MC +static ivas_error renderMcToSplitBinaural( + input_mc *mcInput, + const IVAS_REND_AudioConfig outConfig, + IVAS_REND_AudioBuffer outAudio ) +{ + int16_t i, pos_idx; + int16_t output_frame; + ivas_error error; + const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + const SPLIT_REND_WRAPPER *pSplitRendWrapper; + float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; + float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; + float tmpSplitBinauralBuffer[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; + IVAS_REND_AudioConfig inConfig; + IVAS_REND_AudioBuffer tmpRotBuffer; + IVAS_QUATERNION originalHeadRot[MAX_PARAM_SPATIAL_SUBFRAMES]; + IVAS_REND_HeadRotData modifiedHeadRotData; + const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; + + push_wmops( "renderMcToSplitBinaural" ); + + inConfig = mcInput->base.inConfig; + output_frame = mcInput->base.inputBuffer.config.numSamplesPerChannel; + + pSplitRendWrapper = mcInput->base.ctx.pSplitRendWrapper; + pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData; + + for ( i = 0; i < MAX_OUTPUT_CHANNELS; ++i ) + { + p_tmpRendBuffer[i] = tmpRendBuffer[i]; + } + + /* save current head positions */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + originalHeadRot[i] = mcInput->base.ctx.pHeadRotData->headPositions[i]; + } + modifiedHeadRotData = *mcInput->base.ctx.pHeadRotData; + + + for ( pos_idx = 0; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ ) + { + /* Update head positions */ + if ( pos_idx != 0 ) + { + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + if ( originalHeadRot[i].w == -3.0f ) + { + modifiedHeadRotData.headPositions[i].w = -3.0f; + modifiedHeadRotData.headPositions[i].x = originalHeadRot[i].x + pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + modifiedHeadRotData.headPositions[i].y = originalHeadRot[i].y + pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + modifiedHeadRotData.headPositions[i].z = originalHeadRot[i].z + pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + } + else + { + modifiedHeadRotData.headPositions[i].w = -3.0f; + Quat2EulerDegree( originalHeadRot[i], + &modifiedHeadRotData.headPositions[i].z, + &modifiedHeadRotData.headPositions[i].y, + &modifiedHeadRotData.headPositions[i].x ); + modifiedHeadRotData.headPositions[i].x += pMultiBinPoseData->relative_head_poses[pos_idx - 1][0]; + modifiedHeadRotData.headPositions[i].y += pMultiBinPoseData->relative_head_poses[pos_idx - 1][1]; + modifiedHeadRotData.headPositions[i].z += pMultiBinPoseData->relative_head_poses[pos_idx - 1][2]; + } + + ( *mcInput->base.ctx.pCombinedOrientationData )->Quaternions[i] = modifiedHeadRotData.headPositions[i]; + } + } + + if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM || inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) + { + /* tdrend processing overview: + * 1. copy from inputBuffer to tmpRendBuffer + * 2. td_binaural_renderer_ext: inplace processing in tmpRendBuffer + * 3. copy from tmpRendBuffer to tmpSplitBinBuffer + * 4. LFE mixing + * 5. tmpSplitBinBuffer accumulated to outBuffer */ + + /* copy input to tdrend input/output buffer */ + copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); + + /* set quaternions */ + hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; + + /* Render */ + if ( pos_idx == 0 ) + { + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->tdRendWrapper, + mcInput->base.inConfig, + &mcInput->customLsInput, + hCombinedOrientationData, + NULL, + mcInput->hReverb, + mcInput->base.inputBuffer.config.numSamplesPerChannel, + tmpRendBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( ( error = ivas_td_binaural_renderer_ext( &mcInput->splitTdRendWrappers[pos_idx - 1], + mcInput->base.inConfig, + &mcInput->customLsInput, + hCombinedOrientationData, + NULL, + mcInput->hReverb, + mcInput->base.inputBuffer.config.numSamplesPerChannel, + tmpRendBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + /* Copy rendered audio to tmp storage buffer. Copying directly to output would + * overwrite original audio, which is still needed for rendering next head pose. */ + mvr2r( tmpRendBuffer[0], tmpSplitBinauralBuffer[2 * pos_idx], output_frame ); + mvr2r( tmpRendBuffer[1], tmpSplitBinauralBuffer[2 * pos_idx + 1], output_frame ); + } + else + { + /* crend processing overview: + * 1. rotateFrameMc: inputBuffer to tmpRotBuffer + * 2. crend_process: tmpRotBuffer to tmpRendBuffer + * 3. copy from tmpRendBuffer to tmpSplitBinBuffer + * 4. LFE mixing + * 5. tmpSplitBinBuffer accumulated to outBuffer */ + + /* temporary buffer for rotation in source format */ + tmpRotBuffer = mcInput->base.inputBuffer; + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + + + /* perform rotation in source format to tmpRotBuffer */ + if ( pos_idx == 0 ) + { + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, + mcInput->base.inConfig, + mcInput->customLsInput, + mcInput->base.ctx.pHeadRotData, + mcInput->base.ctx.pCombinedOrientationData, + mcInput->rot_gains_prev, + mcInput->efapInWrapper.hEfap, + tmpRotBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else + { + if ( ( error = rotateFrameMc( mcInput->base.inputBuffer, + mcInput->base.inConfig, + mcInput->customLsInput, + &modifiedHeadRotData, + mcInput->base.ctx.pCombinedOrientationData, + mcInput->rot_gains_prev, + mcInput->efapInWrapper.hEfap, + tmpRotBuffer ) ) != IVAS_ERR_OK ) + { + return error; + } + } + + copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer ); + + /* call CREND (rotation already performed) */ + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, + getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), + getIvasAudioConfigFromRendAudioConfig( outConfig ), + NULL, + NULL, + NULL, + NULL, + p_tmpRendBuffer, + *mcInput->base.ctx.pOutSampleRate +#ifdef SPLIT_REND_WITH_HEAD_ROT + , + 0 +#endif + ) ) != IVAS_ERR_OK ) + { + return error; + } + + /* Copy rendererd audio to tmp storage buffer, Copying directly to output would + * overwrite original audio, which is still needed for rendering next head pose. */ + mvr2r( tmpRendBuffer[0], tmpSplitBinauralBuffer[2 * pos_idx], output_frame ); + mvr2r( tmpRendBuffer[1], tmpSplitBinauralBuffer[2 * pos_idx + 1], output_frame ); + + free( tmpRotBuffer.data ); + } + } + + /* TODO tmu : needs delay compensation */ + if ( ( error = renderLfeToBinaural( mcInput, outConfig, outAudio ) ) != IVAS_ERR_OK ) + { + return error; + } + + accumulate2dArrayToBuffer( tmpSplitBinauralBuffer, &outAudio ); + + /* restore original headrotation data */ + for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; ++i ) + { + ( *mcInput->base.ctx.pCombinedOrientationData )->Quaternions[i] = originalHeadRot[i]; + } + pop_wmops(); + + return IVAS_ERR_OK; +} + +#endif static ivas_error renderInputMc( input_mc *mcInput, IVAS_REND_AudioConfig outConfig, @@ -6860,6 +7199,12 @@ static ivas_error renderInputMc( error = renderMcToBinauralRoom( mcInput, outConfig, outAudio ); } break; +#ifdef SPLIT_REND_LC3PLUS_MC + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CLDFB: + case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + error = renderMcToSplitBinaural( mcInput, outConfig, outAudio ); + break; +#endif default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; } @@ -8453,8 +8798,13 @@ ivas_error IVAS_REND_GetSamples( || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) - /* The condition below is a temp fix for differences in procesing paths between split rendering of SBA and ISM. Should be unified */ + /* The condition below is a temp fix for differences in procesing paths between split rendering of SBA and ISM. Should be unified */ +#ifdef SPLIT_REND_LC3PLUS_MC + && ( ( hIvasRend->inputsIsm[0].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) || + ( hIvasRend->inputsMc[0].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) ) ) +#else && hIvasRend->inputsIsm[0].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) +#endif { /* TODO: doesn't work for multiple SBA inputs, needs to be updated like the ISM path for TD */ ivas_split_rend_bits_t bits; -- GitLab From fc61fe548d23cfdcd264e56d7d119636141279a1 Mon Sep 17 00:00:00 2001 From: Jan Brouwer Date: Wed, 5 Jul 2023 12:41:33 +0200 Subject: [PATCH 0324/1418] add script text_to_binary_payload.py to read a text-based configuration file and generate the equivalent binary payload --- ...generate_acoustic_environments_metadata.py | 13 +- scripts/reverb/text_to_binary_payload.py | 151 ++++++++++++++++++ 2 files changed, 160 insertions(+), 4 deletions(-) create mode 100644 scripts/reverb/text_to_binary_payload.py diff --git a/scripts/reverb/generate_acoustic_environments_metadata.py b/scripts/reverb/generate_acoustic_environments_metadata.py index 5ac095e5a1..fc6698ef73 100644 --- a/scripts/reverb/generate_acoustic_environments_metadata.py +++ b/scripts/reverb/generate_acoustic_environments_metadata.py @@ -31,13 +31,13 @@ """ # -# Generate binary render configuration output files for testing purposes -# The binary code generation is based on the MPEG-I audio standard -# which defines functions to decode raw bitstream into internal parameters +# Generate binary render configuration output files for testing purposes. +# The binary code generation is based on the MPEG-I audio standard, +# which defines functions to decode raw bitstream into internal parameters. # -from bitarray import bitarray, test as bitarray_test +from bitarray import bitarray import math from enum import Enum import numpy as np @@ -238,6 +238,11 @@ class fgdMethod(Enum): Default_Banding = '10' +def get_default_grid_nr_bands(code): + assert 0 <= code <= 8 + return [10, 10, 31, 5, 6, 3, 41, 21, 25][code] + + def get_distance_code(distance, isSmallScene = True): # 0, 1, ... 99 metersCode = [ diff --git a/scripts/reverb/text_to_binary_payload.py b/scripts/reverb/text_to_binary_payload.py new file mode 100644 index 0000000000..2ad58c0f26 --- /dev/null +++ b/scripts/reverb/text_to_binary_payload.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 + +""" + (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. +""" + +# +# Read a text-based configuration file and generate the equivalent binary payload. +# Makes use of the pyhton configuration file parser configparser, +# and of the payload configuration functions in generate_acoustic_environments_metadata. +# The configuration file format is as follows: +# +# [
:] +#